[SCR] [X3:TC/AP] [v1.9.8.12] [03/23/14] Galaxy Explorer

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator » Wed, 1. Feb 12, 08:12

DrBullwinkle wrote:1) Which observer(s) is/are correct?
2) What is the object?
1) both
2) pyramid :)

-> So I think the multi-ship logic needs a bit more testing.

jepp! I know. My workaround right now is to put them into different sectors before starting. But you are right, will check that. maybe add another global var containing current working sectors ...

With that var I can also get a number for new explorer's names!

Earth: did you try setting terrans to enemy for that explorer ship?

t-file: Can you send me your tunings? I didn't completely rewrite it so I can still implement it!

sat drop in enemy sectors -> will check it out :)


good morning! you're early up!

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Wed, 1. Feb 12, 13:57

gnasirator wrote:2) pyramid :)
Exactly. :) The point is that two different people, with different experiences and/or skill sets, can see exactly the same thing and come to completely different conclusions. And their observations may both be partially correct and partially wrong -- or incomplete -- at the same time.

If you can see things from the other person's point of view, then you will understand them better.

On that note, your edits to your original post make the instructions much clearer now. Nice job.
Earth: did you try setting terrans to enemy
If Terrans are set as enemy, then the explorer will avoid all of Terran space. They need a separate rule to avoid *Earth*. Always. There is no reason for an explorer to *ever* go into Earth sector.

I will take another look at the t file.

BTW, is there a reason that you pack your scripts and t files? It makes testing and debug a little bit more difficult, because the X3 Editor is not very well-behaved about extracting them.
good morning! you're early up!
I was up late. Now I'm up early(ish). :) Probably lunch time for you?

gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator » Wed, 1. Feb 12, 15:34

is there a reason that you pack your scripts and t files?
There is:
Reason is, that X3 prefers .pck files over .xmls. So if there is an old .pck file in your scripts folder and I supply an xml, it will produce errors.

That's why I generally supply all files as .pck.
If you want, I can add a 2nd link with an xml version ... ?!



-> Always exclude earth. yes sir! it's on the todo list :)

-> and about time: your guess was right. it was 13:57 here when you posted.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Wed, 1. Feb 12, 16:45

gnasirator wrote:if there is an old .pck file in your scripts folder and I supply an xml, it will produce errors.
Right. That is why I would never distribute a .pck unless there is a good reason to do so. :)

But, no matter. Maybe you could consider distributing only the source files when you also change the names of your scripts to something like plugin.gnas.explore...

In the meantime, rather than a separate distribution (which is a maintenance hassle), you could distribute both .pck's and .xml's in the same archive. (Same with the t files.) That way, people who don't want the .pck's can delete them. Everybody else will wind up using the .pck's.

Otherwise, I can just suck it up and deal with the .pck's. It is not a show-stopper, obviously. :)

gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator » Wed, 1. Feb 12, 18:11

hmm good idea.

I think I'll do the dual way then.

Internall I'm maintaining two backup folders anyway. One with xmls and one with pcks, as it's a pain to unpack them all manually in x3 again if I wanted to edit them :)

you're so full of good ideas ... impressive!

edit:
New List:

- Make sure that multiple Explorers do not all do the same thing at the same time.

- Special handling for Earth sector (avoid it). Earth may be "friendly" but they are phobic about satellites (and Explorers). There is no value in an Explorer entering Earth sector at all.
Done. Automatic numbering required too much additional code, so I skipped that. And honestly, if you have a swarm of explorers, it doesn't matter which one is which, as long as you can see, what they are doing.
It would matter, if you were friends with the pilot ...

edit2:
- Try to reproduce Probe1's report about dropping satellites in hostile sectors. It is unclear whether he used the config menu to turn off hostile sectors, but we should try to reproduce it.
Done, fixed. probe1 was right. My relation check didn't work. don't know, why. I now use another that works.

And I now distribute both pck and xmls... it's redundand but saves some work for bugfixing/editing ;)

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Thu, 2. Feb 12, 16:52

Thanks. The ideas come from experience. I haven't written an X3 script yet, but I have written a lot of code. Every problem solved adds to the "library". :)

gnasirator wrote:Automatic numbering required too much additional code, so I skipped that. And honestly, if you have a swarm of explorers, it doesn't matter which one is which, as long as you can see, what they are doing.
OK. I don't mind that you skipped it, but just so that you know a different POV, the only reason that I would use automatic naming would be to help me to identify each explorer so that I can watch its progress. Specifically, I want to know which sector it started in. I can do that easily enough by manually naming the explorers. In other words, the numbering would be the main reason for using automatic naming (for me). (But it is OK the way it is... that is why you have a config screen!)


My relation check didn't work. don't know, why. I now use another that works.
OK, good.

Right now I am working on the Duke's plot. The greatest challenge is that Duke's Buccaneer's keep sending me to assassinate pirates and Paranids. But I had to be friends with the pirates in order to start the Duke's plot, and I did build a large space fuel/weed complex, which resulted in many pirates being spawned. So the net result is that I have a *lot* of pirates roaming my universe, who *should* be friendly, but who become angry every time I kill a pirate.

This environment is hazardous for my explorers! I don't want them killing pirates, but I also don't want them to be killed because they ignore threats. And I *do* want them to maintain satellites in pirate sectors.

I do not have a solution for that problem. :( I am just pointing it out.


Here is the t file that I have been using:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<language id="44">
<!-- [grey][/grey] [blue][/blue] [cyan][/cyan] [green][/green] [magenta][/magenta] [red][/red] -->
<!-- [white][/white] [yellow][/yellow] -->

<!--Galaxy Explorer -->


<page id="2008" title="scipt objects commands" descr="0">
	<t id="558">EXPLORE_GALAXY</t>
	<t id="1260">EXPLORE_GALAXY_CONFIG</t>
 </page>
 <page id="2010" title="commands" descr="Long version of commands assigned to ships using the command console. Page 2010 and 2011 belong together and hold short and long versions of the same commands"> 
	<t id="558">Galaxy Explorer</t>
	<t id="1260">Galaxy Explorer Configuration...</t>
 </page>
 <page id="2011" title="commands" descr="Short version of commands. These are the commands assigned to ships using the commandconsole. Page 2010 and 2011 belong together and hold short and long versions of the same commands"> 
	<t id="558">Gal.Exp</t>
	<t id="1260">Gal.Exp.Cfg</t>
 </page>
 <page id="2022" title="command info" descr=" ">
	<t id="558">This command makes the ship explore the whole x-universe. Can optionally drop satellites and scan asteroids.</t>
	<t id="1260">Galaxy Explorer Settings Menu</t>
 </page>
 <page id="7600" title="Command Overview" descr=" ">

	<!--Explorer Befehle -->
	<t id="1000">Galaxy Explorer</t>
	<!-- <t id="2000">Start Galaxy Explorer...</t> -->
    
	<t id="3100">Galaxy Explorer Settings</t>
	<t id="3150">Drop sat type</t>
	<t id="3220">Drop navSats</t>
	<t id="3230">Drop adv. navSats</t>
	<t id="3235">Drop sats at gates of large sectors</t>
	
	<!-- Is this still used? (Bullwinkle) =============================================== -->
	<t id="3240">Autobuy satellites</t>
	<!-- ================================================================= -->

	<t id="3300">Scan asteroids</t>
	<t id="3310">Error: Need mineral scanner to scan asteroids.</t>
	<t id="3400">Scan sectors</t>
	<t id="3520">Radius of sector to scan</t>
	<t id="3600">Automatically rename Explorers</t>
	<t id="3700">Explore hostile sectors</t>
	<t id="3800">Explore unknown sectors</t>
	<t id="4000">Save Setup as Default</t>
	<t id="5000">Load Setup from Default</t>
	<t id="8000">Yes</t>
	<t id="8500">Adv.</t>
	<t id="9000">No</t>
	<t id="9500">Std.</t>
	<t id="9600">None</t>

  </page>
</language>

Notes:

- Do you still use id 3240?

- I see what you mean about the menu command being the same as the text shown in the Property view. However, for human users, a consistent name is quicker to scan. So "Galaxy Explorer" makes sense in both locations. This is consistent with Station Camper, for example, which shows "Station Camper" in the Property view when it is working. I like it that way... it is direct and easy to spot. (But you're the boss.) :)

- What does the "G" in "G ASAT ROID 120%" stand for?

- All caps is harder to read than mixed case. It takes longer for the eye to scan.


Overall, Galaxy Explorers is working well! You have a nice script in progress here, Gnasirator.

gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator » Thu, 2. Feb 12, 17:36

thanks I'll add your t-file changes!

id 3240 is not used anymore, that's true. But i left it in because the whole buying routine is still in, too. It's just deactivated. Maybe I have to redecide about that as spawning sats it could be a critical point for signing.

Btw: 'G' stands for Gates which stands for drop satellites at gates!
I assumed that interested users would find that out automatically over time ... e.g. by try and error :)

Btw there is another nice script out there that does automatic naming.
I don't know if it works with the explorers but I guess with automatic naming switched off, it should be no problem.
It officially supports my mk3 improvement btw ;)
link: http://forum.egosoft.com/viewtopic.php?t=307684
maybe that would help you?

about your pirate problem .... theoretically I COULD implement an emergency escape routine when attacked. I could copy the code from my mk3 improvement. explorers would flee into another sector when attacked and restart themselves there.
but it's not really usefull as its main power lies in the trader's using their jumpdrives to escape.
and I won't implement jumpdrive usage into galaxy explorers. way too much micro management about fuelling and so on ;)
so that's what I could offer you:
if attacked:
- cancel current task
- fly straight out of sector
- restart there

on the other hand, the explorers never really stand still anyway. so it doesn't matter whether they fly out of sector or stay inside. they always just fly with max speed.

naah I think I'll leave it ... :)

and about all caps text:
internal command names are all written in caps. so I just follow standards there.

greetings

edit: one more thing about your edits.
Naming all ships Galaxy Explorer makes their names too long. that's why I chose scout. it's nicely short.
Suggestion: Gal.Ex. instead?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Thu, 2. Feb 12, 18:36

gnasirator wrote:the whole buying routine is still in, too.
Oh, I did not know that you wrote that! My original suggestion to just spawn the satellites was intended to avoid your having to write a routine to buy them.

However, I noticed a good side-effect from spawing. Discoverers don't have enough cargo space to hold satellites and even emergency jump fuel. So spawning is good, cargo-wise. It allows me to give my Discoverers 40 eCells, which is enough to jump over trouble spots.

However, there is nothing wrong with buying satellites. I just did not think it was worthwhile to invest more time in a feature that doesn't directly affect the main mission. :)
'G' stands for Gates which stands for drop satellites at gates!
I assumed that interested users would find that out automatically over time ... e.g. by try and error :)
Probably an "interested" user would figure it out, but not me. :P I turned on the feature and never looked at it again. :)

I love Rename Ships with Expressions (RSwE). I use it to make it easier to find important ships, my ships, the current ship(s) that I am MORTing, and fighter wings. It's awesome.
if attacked:
- cancel current task
- fly straight out of sector
- restart there
Oh, I *like* that idea. However, as you say, they mostly fly at max speed (except near gates and asteroids and when dropping satellites :) ).

In any case, I suspect that my Discoverers get one-shot killed by Harriers. Even with Gazz's OOS Rebalance, those Harriers one-shot a lot of my ships (including UT's and even Ospreys).
about all caps text:
internal command names are all written in caps. so I just follow standards there.
Of course. I meant for "ASAT ROID". But it is a tiny comment... do as you like.
Naming all ships Galaxy Explorer makes their names too long.
Too long for what? It fit everywhere that I looked. But I don't really care what you use as a base name, because automatically naming without individual identifiers causes more problems than it solves, especially if you work with them from the Property view.

("Galaxy Explorer" is, however, consistent.) (And it is obvious and easy to scan.) (And it looks nice.) :)

gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator » Thu, 2. Feb 12, 18:59

sorry my mistake.
the names DO fit.

they used to be too long when I had the "SCAN" in, too.
already changed that internally.

the buying routine actually is not very sophisticated and works quite well. problem is that satellites are rare throughout the universe. and with explorers having to buy their vast amounts of satellites it takes a LOT longer to build and maintain a sat network.
on the other hand ... it's just how life is out there :)

buying would add another interesting point:
it would make sense to have bigger and slower ships for maintaining the sat network. and small + fast ships for exploration.
I will definitely rethink the spawning decision!

about the escaping:
If the average M5 would live long enough to make a jump out of sector it would be worth a try. but my harpies are all almost instakilled. like yours.
So it would be a waste of work.
On the other hand, if I implemented the buying routine back in and e.g. a TS is used to maintain the sat network, the whole fuelling and jumping concept would make sense.

Naming:
ok I get it. Will try it with non capitals there.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Thu, 2. Feb 12, 19:09

Do you know a way to determine, for certain, when a ship is one-shot killed? I am guessing because it happens often. And Harriers do it to Corvettes, which is just wrong.

I am not sure what to say about escaping and buying satellites. I think that I would recommend fine-tuning your current feature set 100% before adding more complexity. Otherwise, you run the risk of the problems that I mentioned in my very first post to you (death by feature creep)!

My first Explorer (the one that was killed at Earth) was a Spitfyre. That seemed to last longer. It does not seem likely that a Harrier would one-shot a Spitfyre. For that matter, not many ships can catch up to a Spitfyre. Heck, a Spitfyre can outrun most missiles! :)

gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator » Fri, 3. Feb 12, 01:26

jeah. death by feature creep. I KNOW exactly what you mean.

I worked at an advanced enemy avoidance routine until now. I wanted the explorers to actively fly around hostiles.
but all that task management killed me. I got the directions ... at least the one away from the enemy.

I now settled on just escaping into the nearest gate if there is any aggressor close to me.
but it's not good enough, yet ...
have to find at least a suitable gate to avoid enemy.

we'll see... tomorrow :)

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Fri, 3. Feb 12, 01:45

The ability to escape would be a nice additional feature, but don't torture yourself trying to make it work. Galaxy Explorers are already limited by the inability to use a jump drive for defense. I understand the problem with the eCells, and agree that it seems like a lot of extra effort for questionable additional benefit.

Kestrels or Spitfyres are alternative solutions to the problem. :)

gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator » Sat, 4. Feb 12, 11:04

yes ... I had a test run tonight which should show if the current avoid routine was any better.

well - it didn't. All explorers dead.

So I'll implement another Idea to it I had this morning. If that is no help either, I'll remove it totally.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sat, 4. Feb 12, 16:23

After giving the avoidance problem more thought, I think that lightly-armed ships have only two viable defenses:

1) Outrun (and avoid) assailants. A fast ship helps.

2) Jump.

Both of these behaviors are in vanilla flight scripts that the NPC's use. So how much of it can you reuse in your scripts?

I understand your reluctance to add refueling code to Galaxy Explorers. Again, is there are way to reuse vanilla scripts to do the job?

I am just brain-storming here. If there is no vanilla code that you can re-use, then don't worry about it. I was just looking for an "inexpensive" way to get the behaviors that you seek (inexpensive in terms of your time).

gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator » Sat, 4. Feb 12, 17:09

Well there are no built in mechanisms I know of - at least not when it comes to totally avoiding to get in range of aggressors.

So I wrote a little routine myself and was successful.
Explorers now scan for enemies in range and as soon as one tries to attack, the explorers flee into a gate away from the enemy if possible.

Downside is: The enemies have to get very close for the script to recognize them as a threat because I want to make sure they are trying to attack ME.
Still, I can escape before they shoot - most of the time :)

When there are lots of enemies in the sector there are still chances to have the explorer killed. But they DO avoid at least single threats pretty well now.

All in all I think this is an improvement and as good as possible with the game - so I'm happy with it :)

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sat, 4. Feb 12, 19:45

Sounds good. I will give it a try.
gnasirator wrote:I think this is ... as good as possible with the game
Oooh... dangerous words. :) SOMEBODY will always find a way to prove you wrong! :)

For example, the game allows jumping. :P

But I understand what you mean.

Somebody wrote a script that scans enemy intentions (presumably by scanning the scripts on their stack). Could you scan enemy ships in range to see if they have the Explorer targeted (following... or killing...)?

Slightly off-topic: Want to know how *I* would approach the problem? I would make them jump. And I would spawn energy cells over time. Forget buying them! Energy cells (for ships), in my opinion, are only fun early in the game. After a couple of dozen ships they become tedious rather than challenging. And carriers that cannot carry enough energy cells for the fleet are absurd.

Personally, I use a modified version of Capital Ship Energy Cell Generator (CSecG). I modified it to work on all ships rather than just capitals. (I use Version *2* only. Version 1 is buggy and Version 3 is bloated.)

But that's just me... other folks may have different opinions on that! :)

gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator » Sat, 4. Feb 12, 23:18

DrBullwinkle wrote:Somebody wrote a script that scans enemy intentions (presumably by scanning the scripts on their stack). Could you scan enemy ships in range to see if they have the Explorer targeted (following... or killing...)?
That's just how I did it at first. I scanned enemies for script lib.ship.attack.std on stack. But then it could be that they weren't attacking me or that they were running tortuga and wouldn't use that script at all so I settled to use "enemy -> get attack target" to find if they are trying to attack me.
downside is, it has a very limited range.

About your cheating habits - I don't want that for me :)
I hate spawning anything if avoidable.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sat, 4. Feb 12, 23:49

Yeah, how and when to cheat are very personal things. Even the people who play "vanilla" usually cheat by using exploits, such as looking up locations of abandoned ships and nividium rock clusters. Or cloning weapons instead of taking the time to stimulate the economy to build them.

That is the brilliance of X3 and the script editor. People can cheat exactly as much as they like. And "cheats" can make things more difficult rather than easier.

The things that I simplify are redundant, tedious tasks, such as equipment handling and complex building. After doing them the vanilla way 50 or 100 times, they just are not fun anymore.

But I spend more time adjusting combat difficulty so that there is more challenge. X3 is quite weak in combat. So I increased hulls, gave MARS only to enemies, and tweaked the Opponent Balancing System (OBS.xml) to quadruple the difficulty of missions.

The result is that a pair of MARS-equipped Q's are almost scary in their ferocity. They are even more intimidating when escorted by barrage-firing M8's. That is the way that it should be, IMHO. I don't want to be able to kill a Q with my M3, or win every mission the first time I try, as in the vanilla game.

It's big fun to have to try a combat mission a few times in order to survive. (Well, it's fun for me!)

(See? I told you this was off-topic. :) )

gnasirator
Posts: 1114
Joined: Mon, 13. Dec 04, 16:15
x3tc

Post by gnasirator » Sun, 5. Feb 12, 11:51

DrBullwinkle wrote:(See? I told you this was off-topic. :) )
Yeah got it :)
Sounds really nice! Even though I wouldn't want to miss MARS on my ship anymore. Still, if you have tweaked your game enough that you think it would be worth sharing, I'd be interested.

But right, off topic :)

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 5. Feb 12, 17:16

I do want to share what I have cooked up. It needs some clean-up before it will be easy to share.

As for MARS, I do use Goblins for non-combat tasks. They are a lot of fun... more fun than I expected! For my turrets, I use Missile Defense 2. So I am not completely defenseless against missiles, and my turrets will independently track targets. However, the enemies get superior firepower.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”