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

  • Finally, you can manage your Google Docs, uploads, and email attachments (plus Dropbox and Slack files) in one convenient place. Claim a free account, and in less than 2 minutes, Dokkio (from the makers of PBworks) can automatically organize your content for you.

View
 

Basic setup of the mission xml

This version was saved 12 years, 6 months ago View current version     Page history
Saved by davros123
on November 19, 2008 at 10:16:24 pm
 

Page Contents


 


 

Basic scripting of the mission file

 

Even the most complex of co-op mission scripts in ghost recon are made up of two basic elements.  The trigger and the event. So in other words, a mission script is a series of events that are waiting to be triggered.

 

If you read a mission.XML you will see that this is exactly how a mission script is laid out.  So when planning your mission you need to consider what events you want and how they will be triggered.  Some events you may want to trigger when a player enters an area, other events you may want to trigger when all enemies in a group have died and still other events may be triggered by a combination of conditions - but essentially everything that happens in a mission script is triggered by something else.

 

So when planning your mission, I recommend you think about it as a movie.  See yourself walking through the mission and how things will unfold.  For example, as the players walk along the road they might get to a point which triggers a vehicle to come in the opposite direction.  If a fight breaks out with the occupants of the vehicles, you might want to trigger additional troops to come down the road on foot as backup for the mexicans.  Now they are alerted a helicopter gunships will be called by the Mexicans and will arrive in five minutes.  You need to consider what happens if the players do not engage the vehicle but moved stealthily passed it.  What happens next - well, that's up to you.  Essentially what you have done is mapped out the triggers and events for your script.  Once you have mapped this out it is relatively easy to translate it into a mission.XML file.

 

Triggers and events both have a standard structure which is outlined in detail in the "scripting for beginners" PDF that accompanies the game. So I suggest you print this pdf as you'll refer to it often.

 

In order for a trigger to become active, you need to activate it.  To activate a trigger you would have script like this...

    <element type="StartTrigger" name="t_loc_panhard01" start_time="0"/>

Not surprisingly, this will activate the trigger, "t_loc_panhard01" after one second delay. Once a trigger is activated it will sit there in the background and wait until its conditions are met. When they are met, it will trigger an event.

 

You can also call events directly from other events, like this...

    <event name="e_event_xyz">

             <element type = "TriggerEvent" event = "e_event01" start_time = "0"/>

             <element type = "TriggerEvent" event = "e_event02" start_time = "1"/>

             <element type = "TriggerEvent" event = "e_event03" start_time = "1"/>

    </event>

This can be handy when you want to trigger a number of events at once.

 

So let's have a look at an example of how we might script and the above scenario of the ghosts walking down a road.

Firstly will need to a trigger which triggers when the ghosts (team_a) enter a location on the map (loc_panhard01) and activates the vehicle to come in the opposite direction..

The mission.xml script might look like this....

 

<event name="start_mission">
        <element type="StartTrigger" name="t_loc_vehicle01" start_time="0"/>
    </event>

     <trigger name="t_loc_vehicle01" interval="1" preserved="false">
        <condition type="UnitInLocation" location="loc_panhard01" player_type="team_a" amount="1"/>
        <event name="e_start_vehicle01"/>
    </trigger>   

    <event name="e_start_vehicle01">
           <element type="ActivateVehicle" vehicle_id="panhard01" start_time=".5"/>
           <element type="OrderCar" vehicle_id="panhard01" order="move" position="-817 -12836 -600" speed="1" start_time="1"/>       
    </event>

 

Then we need another trigger which calls reinforcements if the occupants of the vehicle get into a firefight...so we might change the script to look like this...

    <event name="start_mission">

        <element type="StartTrigger" name="t_loc_vehicle01" start_time="0"/>

    </event>

    <trigger name="t_loc_vehicle01" interval="1" preserved="false">

        <condition type="UnitInLocation" location="loc_panhard01" player_type="team_a" amount="1"/>

        <event name="e_start_vehicle01"/>

    </trigger>   

    <event name="e_start_vehicle01">

           <element type="ActivateVehicle" vehicle_id="panhard01" start_time=".5"/>

           <element type="OrderCar" vehicle_id="panhard01" order="move" position="-817 -12836 -600" speed="1" start_time="1"/>

        <element type="StartTrigger" name="t_panhard01_in_fight" start_time="0"/>    

    </event>

     <trigger name="t_panhard01_in_fight" interval="1" preserved="false">

         <condition type = "UnitInCombat" combat="true" group_id = "panhard01_passengers" greater_than= "0"/>

        <event name="e_call_reinforcements"/>

    </trigger>

    <event name="e_call_reinforcements">

          <element type="ActivateGroup" group_id="reinforcements01" start_time="1"/>

    </event>

 

 

 

Comments (0)

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