Members | Sign In
All Forums > Mission Scripting
avatar

I'd like a Neutral ship to be created and NOT move but how?

posted Sep 10, 2012 22:57:18 by AlexVanPatten
Greetings, I'm new to scripting missions and have been reading the documentation. I'm looking for a way to create a neutral ship but NOT have it move. Here is the code I used to create the ship and then the code(s) I used to have it not move, but still, it's coasting right along.

<create type="neutral" x="86950.0" y="0.0" z="31355.0" angle="0" name="TSN Oswego" hullID="1" />
<set_object_property property="topSpeed" value="0" name="TSN Oswego" />
<set_object_property property="topSpeed" value="0.0" name="TSN Oswego" />


I wasn't sure if "0" was the same as "0.0" so I did both. I tried one, then the other, and no luck. What am I missing?
[Last edited Sep 10, 2012 22:58:47]
page   1
10 replies
avatar
AaronMacke said Sep 11, 2012 01:48:44
I think I am using <add_ai type="DIR_THROTTLE" value1="0.0" value2="0.0" name="Ship" /> which tells the AI to point him at 0 degrees, and set 0 throttle. Seems to be working for me.
avatar
DwayneShaffer said Sep 11, 2012 03:00:16
This creates the Neutral Ship

<create type="neutral" x="25856.0" y="0.0" z="34674.0" angle="0" name="USS Neutral Ship" hullID="7101" />

This clears the IA Stack

<clear_ai name="USS Neutral Ship" />

This place keeps the ship from going anywhere Notice that the value1 value2 value3 coordinates are the same as the neutrals ships X Y Z coordinates.

<add_ai type="POINT_THROTTLE" value1="25856" value2="0" value3="34674" value4="0.0" name="USS Neutral Ship" />

This will keep the ship were you want it to stay.
Dwayne Shaffer C.O.
Vidar GSR 3701
C.D.F. 7th Fleet
http://vidar-gsr-3701.webs.com/
avatar
AlexVanPatten said Sep 11, 2012 04:23:07
Thank you very much for the replies. I'm at work and will test this out in the AM when I get home (night shift in the ER).

Another quick question while I have you all here..for scripting purposes, is 0.0 the same as 0? I'm used to coding in another language and sometimes things get funky when decimals are added to certain values.

Example, if I set a variable to 1 is 1.0 the same thing? The mission editor program loves to set my values using a decimal, even if the trailing number is 0 and I wanted to be sure it wasn't going to mess anything up.
[Last edited Sep 11, 2012 04:51:50]
avatar
DwayneShaffer said Sep 11, 2012 08:02:23
Example, if I set a variable to 1 is 1.0 the same thing? The mission editor program loves to set my values using a decimal, even if the trailing number is 0 and I wanted to be sure it wasn't going to mess anything up.


Yes value 1 and 1.0 are the same.
Dwayne Shaffer C.O.
Vidar GSR 3701
C.D.F. 7th Fleet
http://vidar-gsr-3701.webs.com/
avatar
AlexVanPatten said Sep 11, 2012 08:29:15
Great! Thanks!
avatar
Mike_Substelny said Sep 14, 2012 00:36:08
You can always set the maximum speed to zero, but you need to do that in a code block after the block that created the ship.
"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
AlexVanPatten said Sep 14, 2012 00:59:06
Could you show me an example line of that please?
avatar
Mike_Substelny said Sep 17, 2012 15:08:26
"Havok in the Hamak Sector" starts with a neutral ship called Acme Arms Dealer that is parked at a station. I do it by giving that ship a really slow topSpeed.

Here is an excerpt from the code:

<start name="Havoc in the Hamak Sector 1.65">
<create type ="neutral" hulltype="5" x="11990" y="0" z="80010" raceKeys="USFP friendly" hullKeys="Transport Cargo" name="Acme Arms Dealer" angle="175"/>
<clear_ai name ="Acme Arms Dealer"/>
<add_ai name ="Acme Arms Dealer" type ="POINT_THROTTLE" value1="12000" value2="0" value3="80000" value4=".1"/>
</start>


<event name="Starring Cressida Neal">
<if_variable name="starring1" comparator="!=" value="1"/>
<set_variable name="starring1" value="1"/>
<set_object_property name="Acme Arms Dealer" property="topSpeed" value=".001"/>
</event>

See how I created the ship in the Start block but set its maximum speed in a subsequent Event block? That is important. Later in the mission I do the same thing with three enemy ships.
"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
GregKurlinski said Sep 24, 2012 18:52:18
is it just the topSpeed property that needs to be set in a second block, or do any Set Object Propertys need to be set in seperate block from the Create block?
avatar
Mike_Substelny said Sep 25, 2012 16:36:45
I believe it is just the topSpeed property. This is a part of how the Artemis program works that Thom explained to me once, but I cannot remember the explanation.
"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).
Login below to reply: