| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Advanced scripting of the mission xml

This version was saved 15 years, 3 months ago View current version     Page history
Saved by Bogie
on January 10, 2009 at 3:43:28 am
 


 


Adding a Zeus

Adding a Zeus to your mission is a three step process.  First, in the editor, create a "Target Marker" in the location where you would like your Zeus.  Name this marker "target_zeus01".

 

Second, In the world.xml, search for your "target_zeus01" to obtain the positional x,y,z coordinates where you placed your marker.

 

And lastly, enter this information into your mission.xml:

<element type = "CreateUnit" weapon="predator" pos="5538.6543 -3598.2598 522.5941" spare_clips="1" yaw_pitch_roll="0 0 50" />

 

The position or 'pos="x y z"' comment are the x,y,z coordinates that you pulled from your Target Marker.  If you need to be precise with the placement of your Zeus (IE place the Zeus on top of a box), the Zeus 0,0,0 location is not centered, but on the corner.  So if you would like to center your Zeus, you may need to add or subtract 2-3 from your 'X' and\or 'Y' coordinates to get the desired effect.

 

 

Setting up respawn points

To keep your Ghosts from having to run across the map after an area has been cleared, you may wish to consider setting up additional locations to spawn in the unfortunate incident that a player has been killed.  To do this, setup your respawn locations in the editor.  For our example, we'll have three spawn locations:

  • coop_spawn:  This is your initial spawning location
  • loc_respawn01: After a particular area has been entered (say loc_trig01), then your team will respawn to this location
  • loc_respawn02: After your team detonated an ADAT, you want to respawn at the ADAT location.  So you would create the loc_respawn02 at the site of the ADAT

 

Here is the code:

<trigger name ="t_loc_trig01" interval="2" preserved="false">

<condition type ="UnitInLocation" location ="loc_trig01" player_type = "team_a" greater_than="0"/>

<event name ="e_loc_trig01"/>

</trigger>

<event name = "e_loc_trig01">

<element type = "StopTrigger" name = "t_loc_trig01"/>

<element type = "SetSpawnLocation" location = "coop_spawn" side = "1" set = "false"/>

<element type = "SetSpawnLocation" location = "loc_respawn01" side = "1" set = "true"/>

</event>

 

<trigger name="t_adat01_dead" interval="2" preserved="false">

<condition type = "VehicleDestroyed" vehicle_id="adat01" amount = "all"/>

<event name="e_adat01_dead"/>

</trigger>

<event name = "e_adat01_dead">

<element type = "StopTrigger" name = "t_adat01_dead"/>

<element type="Objective" id="adat_destroyed" state="completed"/>

<element type="SetSpawnLocation" location="loc_respawn01" side="1" set="false"/>

<element type="SetSpawnLocation" location="loc_respawn02" side="1" set="true"/>

 

</event>

 

The above code assumes that you must pass through loc_trig01 prior to detonating the ADAT.  If not, you can even add all three locations to the code such as this example with the ADAT detonation:

 

<event name = "e_adat01_dead">

<element type = "StopTrigger" name = "t_adat01_dead"/>

<element type="Objective" id="adat_destroyed" state="completed"/>

<element type = "SetSpawnLocation" location = "coop_spawn" side = "1" set = "false"/>

<element type="SetSpawnLocation" location="loc_respawn01" side="1" set="false"/>

<element type="SetSpawnLocation" location="loc_respawn02" side="1" set="true"/>

 

</event>

Where both "coop_spawn" and "loc_respawn01" are set to not spawn any more players.

 

Setting up variables

There may be times when you need to store numeric values when manipulating your missions.  In this example, we'll have 10 objectives in order to complete your mission.  So our objective in this code is to add '1' each time a mission is completed.  When our variable equals 10, then we can end the game.

 

First, we'll need to setup our variable string using the "Calculate" element under our starting conditions:

 

 

 

 

Comments (0)

You don't have permission to comment on this page.