| 
  • 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
 

Adding Objectives

Page history last edited by davros123 12 years, 3 months ago

Page Contents


 


Adding Objectives

When modding in GRAW 2, adding one or two objectives can turn a simple "shoot-em-up" into a tactical mission.

Adding Objectives is a simple procedure, In this example we want to place a C4 charge on an Adat to destroy it, this

in turn will trigger a second objective which is to find and destroy a communications antenna.

 

So, firstly, in the map editor we need to create and place three items:

1) A location trigger that we will call "loc_trig00"

2) An Adat that we will cal "adat01"

3) A communications antenna that we will call "antenna01"

 

That done, we can save and exit from the editor and open up our "mission.xml" file.

In the mission.xml file we first need to add the following to the "start_mission" event:

  <element type="MakeAttachable" attach="true" detonate_event="e_destroyed_adat01" vehicle_id="adat01"/>

  <element type="MakeAttachable" attach="true" detonate_event="e_destroyed_antenna01" name_id="antenna01"/>

  <element type="StartTrigger" name="t_destroyed_adat01" start_time="2"/>

   <element type="StartTrigger" name="t_destroyed_antenna01" start_time="2"/>

 

This enables us to plant a charge on both the "adat01" and the "antenna01" and starts the triggers that will set the Objectives when certain  conditions are satisfied.

 

So, now to the main body of the mission script, if we add the following:

 

<!-- Add first objective destroy adat01

==========================-->

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

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

  <event name="e_add_objective1"/>

</trigger>

  <event name="e_add_objective1">

  <element type="Objective" id="obj1" state="add" headline_id="your text" txt_id="your text" waypoint_id="your text" waypoint="your x-y-z co-ordinates"/>

</event>

<!-- Add second Objective ... break communication link

========================================-->

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

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

  <event name="add_objective2"/>

</trigger>

  <event name="add_objective2">

  <element type="Objective" id="obj2" state="add" headline_id="your text" text_id="your text" waypoint_id="your text" waypoint="your x-y-z co-ordinates"/>

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

</event>

 

What we have are our two objectives, the first objective is set by the player being in a certain location ("loc_trig00"), the second objective is set by the first objective being  satisfied ("t_destroyed_adat01")

 

A walkthrough would be something like this:

 

When the player enters an area (UnitInLocation)  (loc_trig00) the first objective (obj1) is added and in the game a green arrow will guide you to the target (adat01) which will show as a green box as you approach.

 

Once the target is reached we can plant a C4 charge on the adat01 and destroy it ....... BOOOOM !!

 

Destroying the adat01(t_destroyed_adat01) triggers the addition of our second objective and goes something like this:

 

BOOOOM !! adat01 is destroyed and triggers (t_destroyed_adat01) our condition (VehicleDestroyed) (adat01) to add our second objective (obj2) at the same time the first objective is removed from the objectives list as it is now complete (id="obj1" state="completed"), and in the game a green arrow will now guide you to the next target which in this case will be (antenna01).

 

When selecting your waypoints for targets, I would recommend you look them up in the world.xml  file (ie.. for the loc_trig00 do a search in the world.xml for loc_trig00) and use the FULL co-ordinates including the numbers after the decimal point (ie.... "-3638.04 -2749.988 363.45395"). Otherwise your waypoint "green box" will appear to be in a different location as you approach.

 

Also, the above is only an example, you can use anything as a trigger ... vehicle destroyed, patrol destroyed, sniper killed, hostage found etc...etc.. and if you use the "if_all" if_any" or if_none conditions then several conditions can be set to satisfy an objective.

 

Comments (0)

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