Alrighty... How to find ships inside stations?

The place to discuss scripting and game modifications for X²: The Threat.

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

Post Reply
GnatB
Posts: 1225
Joined: Thu, 27. Feb 03, 20:44
x3

Alrighty... How to find ships inside stations?

Post by GnatB » Tue, 20. Jan 04, 05:44

I've tried just about everything I can think of, but as yet there doesn't appear to be any way to get a handle to any ships that are currently docked inside a station. I've tried just about every argument to the only "findships" function there is, and it never seems to return any ship inside a station.

I'd like my damage report & maintenance script to work on ships that are actually docked, but as it currently stands, I can't get a handle on 'em. So only ships in flight head off for repairs. Has anyone, (or possibly any developers care to add a function/argument/code snippet), been able to "find" ships inside a station?

ouch
Posts: 462
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by ouch » Tue, 20. Jan 04, 18:10

I feel your pain, I can't find one either it's made me stop development on my script.

coxpwr
Posts: 124
Joined: Mon, 28. Apr 03, 08:10
x2

Post by coxpwr » Tue, 20. Jan 04, 18:20

As to actually writing a script i'm dead in the water but I had a thought for you. Can you tie your script into looking at your ships owned directory to locate the ships and then do a search station and do a find landed ships with that tag or just owned ship> trade with station>repair ship . Just a thought.

GnatB
Posts: 1225
Joined: Thu, 27. Feb 03, 20:44
x3

Post by GnatB » Tue, 20. Jan 04, 19:36

scripting engine has no "your ships owned" directory, so no, I can't look there...

I can find out how many ships are IN a station, but there doesn't seem to be any way to get direct access to the ships themselves....

Oh, and the "repair" part doesn't appear to be automatable either, unless the "ware" you need to repair is one of the "read-textwhatever" that appears in the wares listings.

Sgt. Dubious
Posts: 164
Joined: Wed, 31. Dec 03, 20:39
x2

Post by Sgt. Dubious » Tue, 20. Jan 04, 19:52

I had some ideas to help you out on your multiple fighter response squads, haven't tried em yet, I got other fish to fry.. *grumble*

To set it up, they will have to be out of their carrier, but this should work.

get all the ships in question, and set up 2 loops, one nested in the other.

Main loop: Make a ship a formation leader. give it a unique variable (Red Leader) (SquadCount = 0 ShipID = ShipID +1)
Sub loop: Assign the next X fighters to that formation. ('While Squadcount < Xvariable' remember to increase ShipID in this loop as well)

Append formation leaders into an array of their own.

Optionally append the squads into their own array (Red Squadron, whatever).

Keep it going with counters until all available fighter craft have been partitioned into groups. Tell them to return and dock. Now, when the carrier detects an enemy, tell it to order a formation leader (with LeaderCount = size of Array Leaders; Leaders[OnAlert]) to Attack and Land. Its formation should follow.

Alternately, tell it to order each ship in its formation's Array individually.

After a squad has been dispatched, do OnAlert = OnAlert + 1 to ready the next squad for the next threat.

This may need several scripts, on to collect the ships, then on for the Carrier to run, you will have to call it in the original script to transfer the Squad data.

This seems like it will work, if you try it, let me know.

[Edit: Also let me know if one of those ReadText wares turns out to be Hull Repair, I wanted to investigate that too at some point]

GnatB
Posts: 1225
Joined: Thu, 27. Feb 03, 20:44
x3

Post by GnatB » Tue, 20. Jan 04, 23:50

Oh, I already know how I'm gonna add a defense fleet to my carrier, if/when I get one, that part's... well.. easy.

Make a script with command called "add to fleet" that just flys to a given sector and loops. Then have part of the carriers AI loop check for any ship with that command in the current sector, and add any such ships to it's array of "owned ships"... then once I've got that, it doesn't matter where the carrier AI script decides to send them, either to attack, to dock, to repair, to fetch missiles from some factory, whatever, it's *got* them....

Planning on having the carrier send out fleets of interceptors whenever enemies appear. Figure 2 per enemy, 1 wingleader assigned to attack the enemy ship, and 1 wingman assigned to protect the wingleader. Once the enemy is destroyed, move on to closest enemy ship, unless damaged, in which case retreat to carrier until no enemies in sector, then head in for repairs. Haven't figured out yet how I'm gonna handle clusters... don't know if they appear as 1 ship (which I'd assume they do) or if they appear as X ships.... either way, I'm not really worried about handling ships assigned to a carrier.... it's the generic "untasked" ships/freighters I'm having a hard time getting a handle on.

BradThorn
Posts: 671
Joined: Mon, 3. Nov 03, 23:07
x2

Post by BradThorn » Wed, 21. Jan 04, 04:22

GnatB wrote:Oh, I already know how I'm gonna add a defense fleet to my carrier, if/when I get one, that part's... well.. easy.

Make a script with command called "add to fleet" that just flys to a given sector and loops. Then have part of the carriers AI loop check for any ship with that command in the current sector, and add any such ships to it's array of "owned ships"... then once I've got that, it doesn't matter where the carrier AI script decides to send them, either to attack, to dock, to repair, to fetch missiles from some factory, whatever, it's *got* them....

Planning on having the carrier send out fleets of interceptors whenever enemies appear. Figure 2 per enemy, 1 wingleader assigned to attack the enemy ship, and 1 wingman assigned to protect the wingleader. Once the enemy is destroyed, move on to closest enemy ship, unless damaged, in which case retreat to carrier until no enemies in sector, then head in for repairs. Haven't figured out yet how I'm gonna handle clusters... don't know if they appear as 1 ship (which I'd assume they do) or if they appear as X ships.... either way, I'm not really worried about handling ships assigned to a carrier.... it's the generic "untasked" ships/freighters I'm having a hard time getting a handle on.
They'll appear as 1 ship, so your carrier will dispatch 2 ships to engage them. When they get close, the cluster will break. The carrier will then issue more fighters... Your 2 ships will get swarmed. Hopefully they survive long enough for the rest to get there and save them. Depends on range really...

GnatB
Posts: 1225
Joined: Thu, 27. Feb 03, 20:44
x3

Post by GnatB » Wed, 21. Jan 04, 06:50

Yeah, that's the problem. Don't really want to be losing 2 novas to every cluster, and I *think* I have a better method worked out... I'm thinking if I can detect if the ship in question is a khaak M3, (which I'd assume I can, though I haven't really checked) then I can I send a paranid m5 to attack any khaak M3 that "spawns" without a bunch of other khaak M5's spawning in the same logic loop until there is shield damage to the M3, or it dissapears, then return to the carrier, and THEN send out the M3 (probably argon, maybe paranids) squad. Figure the super fast m5 should be able to "poke" the M3 into "declustering" if it happens to be a cluster, and if it's not, it should be able to escape and head back home without getting vaporized. Especially if it's armed with mosquitos with missile fire probability at 100%, and restocking whenever it gets back to base. In either case, I'm guessing that this technique would prove if it's a cluster one way or the other, as well as breaking up the cluster, with minimal risk... only 1 m5, and it *should* be fairly safe...

Heh, imagine that... using a scout to... well... scout.

pjknibbs
Posts: 41359
Joined: Wed, 6. Nov 02, 20:31
x4

Post by pjknibbs » Wed, 21. Jan 04, 09:10

I'm not sure your scout will survive. Even in a Paranid Pegasus I was flying myself I got toasted by a Khaak M3 I happened to fly too close to on the way somewhere--given that the Khaak lasers on an M3 are pretty much a one-hit-kill for an M5 class ship, and they auto-aim, it's pretty difficult to avoid them!

GnatB
Posts: 1225
Joined: Thu, 27. Feb 03, 20:44
x3

Post by GnatB » Wed, 21. Jan 04, 14:42

Yep, that's what the mosquitos are for... I'd hope they have considerably longer range then lasers... they should, anyways.

GnatB
Posts: 1225
Joined: Thu, 27. Feb 03, 20:44
x3

Post by GnatB » Wed, 21. Jan 04, 20:54

Thought of something.... also throw in a check to see if the "unknown khaak m3's" lasers are at full power... if they aren't, then it can't be a cluster, and the scouts job is accomplished.... run away.... so if the khaak misses once, or shoots anything else... like maybe a missile headed it's way... the scout will be safe.

Sgt. Dubious
Posts: 164
Joined: Wed, 31. Dec 03, 20:39
x2

Post by Sgt. Dubious » Wed, 21. Jan 04, 22:21

I'd check max laser power, if it's 0, then it's a cluster. Less risk to the scout ship.

GnatB
Posts: 1225
Joined: Thu, 27. Feb 03, 20:44
x3

Post by GnatB » Thu, 22. Jan 04, 00:04

Hmm... I seem to remember checking a khaak cluster and it's hull/shields/laser power were identical to that of an M3. I can always check again though... if so, it solves the problem nicely. Check all ships for 0 max laser power... If said ship exists, send a scout out to force it into separating by firing a mosquito, and as soon as it's gone/has laser power, scout goes running home.

Post Reply

Return to “X²: The Threat - Scripts and Modding”