Members | Sign In
All Forums > Mission Scripting
avatar

Scripting a Nuke Blast?

posted Jun 20, 2012 06:27:43 by Altaem
I want to make a scenario where a number of drifting space wrecks have to be investigated for survivors. I'd like one to be trapped so it explodes when the player ship comes close to investigate.

Any way to have an event trigger an explosion?
page   1
10 replies
avatar
avbeeri said Jun 20, 2012 15:30:34
Hmm. the explosion i don't know how to do, but you can destroy objects in a certain distance from a point, i think.
avatar
DwayneShaffer said Jun 20, 2012 18:07:37
This should give you the effect that you are looking for. things to remember are the push radius of both objects and how much damage you are looking for. I tested it in the sim. and it works pretty good. The effect is that of a nuke going off and it was cool LOL.


<event name_arme="Event 2" id_arme="42b2db07-07d4-4064-90e2-4748d48c774e">
<if_exists name="Artemis" />
<if_variable name="trap" comparator="NOT" value="1.0" />
<if_distance name1="Artemis" name2="YourObject" comparator="LESS_EQUAL" value="300.0" />
<create count="1" type="mines" startX="50450.0" startY="-10.0" startZ="43850.0" endX="50450.0" endY="-10.0" endZ="43850.0" />
<set_variable name="trap" value="1.0" />
</event>

<event name_arme="Event 1" id_arme="26835f61-f55f-4b67-a714-9f4f0f49cd15">
<if_exists name="Artemis" />
<if_distance name1="Artemis" name2="YourObject" comparator="LESS_EQUAL" value="300.0" />
<if_variable name="trap" comparator="EQUALS" value="1.0" />
<if_variable name="ambush1" comparator="NOT" value="1.0" />
<addto_object_property value="1.0" property="triggersMines" name="Artemis" />
<set_variable name="ambush1" value="1.0" />
</event>
[Last edited Jun 20, 2012 18:08:29]
Dwayne Shaffer C.O.
Vidar GSR 3701
C.D.F. 7th Fleet
http://vidar-gsr-3701.webs.com/
avatar
Mike_Substelny said Jun 20, 2012 20:31:16
Dwayne's solution should work. The mine and the nuke have the same blast (currently). If you want a bigger explosion, then create another mine or two displaced slightly above and below the first mine on the Y axis. You'll get a huge KABLEWEEEE!
"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
Eric said Jun 21, 2012 03:39:20
Can someone explain what the second event does that Dwayne lists? Specifically what does this line do?

<addto_object_property value="1.0" property="triggersMines" name="Artemis"/>

I haven't dived in to the scripting since the AI Stack overhaul. Can we give Artemis our own properties now?

Also, what are the name_arme and id_arme commands in the event declaration?
avatar
DwayneShaffer said Jun 21, 2012 04:29:15

<addto_object_property value="1.0" property="triggersMines" name="Artemis"/>

This is use to trigger a mine by the named object. It is now part of the Mission scripting system.

name_arme and id_arme

Is use by the Mission Editor designed by Hissatsu to help keep track of the events in the editor.

http://www.artemis.eochu.com/?page_id=28#/20120419/artemis-mission-editor-ver-1204191-early-alph-1501862/page5/
Dwayne Shaffer C.O.
Vidar GSR 3701
C.D.F. 7th Fleet
http://vidar-gsr-3701.webs.com/
avatar
Altaem said Jun 21, 2012 07:26:22
Thank you.
That resulted in some comical testing. Forgot to have a non moving "wreck". By the time I got near it to trigger the event the mine spawned, but nowhere near either of us.

Don't suppose it's possible to create objects relative to an existing object?
avatar
DwayneShaffer said Jun 21, 2012 08:04:50
Sorry at this time we can not do that due to the fact that mines are not a named objects.
You can due that with just about any named object like enemy ships, neutral ships, Stations.

<set_relative_position name2="YourObject" distance="100" angle="10.0" name1="Artemis" />

and for generic meshes

<set_relative_position name2="Artemis" distance="100" angle="10.0" name1="generic mesh" />
Dwayne Shaffer C.O.
Vidar GSR 3701
C.D.F. 7th Fleet
http://vidar-gsr-3701.webs.com/
avatar
DwayneShaffer said Jun 21, 2012 08:11:32
I added this line in the start area were I create the YourObject to keep it from moving to represent a derelict ship.

<add_ai type="DIR_THROTTLE" value1="0.0" value2="0.0" name="YourObject" />
Dwayne Shaffer C.O.
Vidar GSR 3701
C.D.F. 7th Fleet
http://vidar-gsr-3701.webs.com/
avatar
Mike_Substelny said Jun 21, 2012 17:32:33
Eric, if you don't mind writing a huge amount of code then you can have the mine spawn anywhere you like, just write one event for every possible set of coordinates where you want to spawn. If you want to use all 100,000 x 100,000 whole number grid coordinates then you will have 10,000,000,000 events for spawning mines.
"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
Altaem said Jun 22, 2012 08:48:45
Interesting... I might try that.
Login below to reply: