Members | Sign In
All Forums > Mission Scripting
avatar

Toggline "Ignore Comm" for a neutral ship

posted Mar 21, 2013 20:38:17 by john
WHAT I'M TRYING TO DO: Create a neutral ship which should ignore Comm commands while distance to player ship is > 10000. If distance to player ship <= 10000 then the neutral ship should obey Comm commands.

SETUP: I am using full version 1.70 on Win7. I used Mission The Waning Dark as a template since the Borland Cargo ship there ignores Comm commands. I copied the creation lines:

<create type ="neutral" raceKeys="friendly" hullKeys="cargo" x="70100" y="0" z="45000" name="Borland Cargo" angle="0"/>
<set_object_property name="Borland Cargo" property="willAcceptCommsOrders" value="0" />

However the neutral ship obeys Comm commands instead of ignoring them.

QUESTION: Is the "willAcceptCommsOrders" property still valid? Any suggestions on most efficient way to accomplish the desired result?

ADDN'L INFO: My intent is to create a mission with multiple neutral "merchant" ships transiting from one side of the map to the other. Players are acting as customs and will board/scan each ship searching for smugglers, enemy spies, etc. Some ships will have contraband, some will be pirates that turn hostile and attack and so forth. The players should have to close with a merchant ship before ordering it to stop and be boarded.
page   1
7 replies
avatar
Eric said Mar 21, 2013 23:41:26
If I'm remembering right, you may need to put the Set_object_property line in a different event than the creation event. So after you create the ship, set a variable to 1. Then have an event that if the variable is one, set it to not take orders, and then flip the variable back to 0. I'm not 100% sure that will work, but it's worth a try.
avatar
PhilipTemple-Watts said Mar 22, 2013 13:20:10
Afaik, following comms orders isn't an object property you set, it's a command you add to the ai stack.

<add_ai type="FOLLOW_COMMS_ORDERS" name="Goliath" />

Eric is right though, I recall having trouble trying to set object properties in the same event they're created in. You can add items to the AI stack in the same event though.

The command to add comms control is a one-way thing though, so you may have to clear the ai stack once the interaction has happened, then manually re-add whatever commands you had telling the merchants where to go.
[Last edited Mar 22, 2013 13:20:27]
avatar
john said Mar 22, 2013 14:25:56
I haven't messed with the AI stack yet. I will start experimenting and see where that gets me. Thanks!
avatar
xavierwise.tsn said Mar 22, 2013 17:06:08
When I am scripting I have a create event for any ships (usually at the same time the system is created) and then a separate event called "De-42 AI" or something. In that event I add in all the AI commands I want. Putting AI commands in the same event that creates the ship doesn't work.
avatar
RussJudge said Mar 27, 2013 12:54:30
In my research for both the Mission Editor tool and Artemis Mod Loader, I could find no evidence that willAcceptCommsOrders is currently valid. All I can tell you is that if it ever was valid, it was valid some time prior to version 1.661 of Artemis.
Russ
Author of Artemis Mod Loader.

Sign up for a free Dropbox account.
avatar
Mike_Substelny said Mar 27, 2013 14:42:59
I don't think that willAcceptCommsOrders is valid any more. You need to clear the old AI stack and build a new one.
"Damn the torpedoes! Four bells, Captain Drayton!"

(Likely actual words of Admiral David Farragut, USN, at the battle of Mobile Bay. Four bells was the signal for the engine room to make full steam ahead).
avatar
john said Mar 29, 2013 15:56:31
Clearing and rebuilding the AI stack worked. Thanks!
Login below to reply: