Ship AI question

Freeform discussion about anything related to modding Transcendence.
Post Reply
phantomfoot
Anarchist
Anarchist
Posts: 18
Joined: Sun Mar 21, 2010 8:13 pm

Hello good people!

Is there a way to make an enemy ship stop, stay in one place and attack from a stationary position?

I've tried using ObjMoveTo to stop the ship, which is fine, but as soon as it is stopped the little critter immediately wants to fly off again.

shpOrderHold doesn't seem to work either.

Is it possible?
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

i believe that shporderwait will make it stop shooting too :roll:

[evil idea] install a propulsion drive with 0 thrust :twisted:, when you need it to resume cruising, remove it
hex
Miner
Miner
Posts: 34
Joined: Wed Jan 03, 2007 11:46 am

If you tell your wingmen to wait I'm pretty sure they still fire, if that's right then the relevant code is:

Code: Select all

(shpCancelOrders [the ship])
(shpOrder [the ship] 'hold)
Hmm...
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

I think digdugs idea is the only one that will work... we have very little control over the engagement rules of the ai, apart from what can be set at the ship design stage.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

hex, orders 'hold and 'wait are not the same, but I'm not really sure of the difference, maybe alterecco and Bobby know more.
speedofsquid
Commonwealth Pilot
Commonwealth Pilot
Posts: 55
Joined: Wed Aug 27, 2008 6:30 pm
Location: USA

A ship ordered to wait does not face enemies or fire. A ship ordered to hold does.

shpOrderHold works for me on a hostile ship with no eventHandler and no other orders that was specifically created with a script (not a random encounter or otherwise associated with a station). Setting the aggressor attribute in the ship's AISettings did not seem to have any effect when the ship was holding.

I had a different problem with ordering a hostile ship to hold: the ship would not stop holding after the specified time. However, ordering the ship to wait for a specified time worked as expected.
phantomfoot
Anarchist
Anarchist
Posts: 18
Joined: Sun Mar 21, 2010 8:13 pm

speedofsquid wrote:
shpOrderHold works for me on a hostile ship with no eventHandler and no other orders that was specifically created with a script (not a random encounter or otherwise associated with a station).
Thanks that's good to know, I will try it out. The eventHandler might have been what was stopping it from working. But I think alterecco is right, it appears extremely difficult to get them to behave a certain way. A centauri raider with a zero thrust propulsion drive fitted still thrusts like crazy trying to move (quite funny to see actually) and does not necessarily attack.
Post Reply