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



Page history last edited by davros123 11 years, 11 months ago


Anti-Personnel Mines   



In order to make mines work in GRAW2, I needed to create a new static prop.  The new prop is called dav_mine.

A "prop" is an object in the GRAW editor (for example, a wall is a static prop). In this case, the prop is a mine.  It is based upon (and looks just like) the existing static prop called "at_mine".  However the problem with the at_mine static prop is that it could not be triggered to explode when a person walks over it.  It will also explode when shot on the trigger mechanism, ( the 3 prongs), or exploded with a grenade or other explosion nearby. From the code I belive it will only explode when a vehicle moves over it - though I have not tested this feature.


Landmines in GRAW2...now working! from davros on Vimeo.

now with sound effect from davros123 on Vimeo.



Download the mines mod from here.

To do this you need to click here to download this file and place the 4 files into your data directory.

The files are as follows...






Making the mine name unique to your mission to avaoid conflicts

You'll need to make some changes to these files to prevent any conflicts with other people also using mines in thir missions.  Let's say your mission is called "sanctuary", (note: Bogie has already used this name so don't name your mission this!)


To make the mines work for your mission and not conflict with any other bundles, do the following steps....

1) rename "u_dav_mine.xml" to "u_dav_mine_sanctuary.xml"

2) Change it's contents to match the following bold text, note the new prop name.

          <unit type="prop" name="dav_mine_sanctuary" slot="13">
               <network sync="bodies" />
              <model file="\props\dav_mine_sanctuary\dav_mine.xml"/>
               <script_class name="base" class="Base"/>
               <script_class name="damage" class="DamageSystem"/>
               <stats block="base_data">
               <xi:include href="/data/units/mass.xml#xpointer(/mass/mass_object_large/*)"/>

3) change the prop directory name from "data\objects\props\dav_mine\" to "data\objects\props\dav_mine_sanctuary\" 

4) change the directory path in your dav_mine_sanctuary.xml to reflect the new path

<diesel file="/data/objects/props/dav_mine/dav_mine.diesel" orientation_object="align" materials="/data/objects/props/dav_mine/materials.xml"/>

changes to....

<diesel file="/data/objects/props/dav_mine_sanctuary/dav_mine.diesel" orientation_object="align" materials="/data/objects/props/dav_mine_sanctuary/materials.xml"/>

Done! Now you'll have :

<graw2>\data\units\props\u_dav_mine_sanctuary.xml   <--- and updated the .xml as per step 2.


<graw2>data\objects\props\dav_mine_sanctuary\dav_mine.xml <--- and updated the .xml as per step 4.



Make sure you include these files when you bundle your mission for testing and release.


You can now open up your mission in the graw editor.


Placing them in the editor

The new anti-personnel mine prop is called dav_mine_<whatever-you-named-it> and, once set up, appears in the small static porps list in the eitor (press Control-2 in the editoe to see the small static props list). You can easily find it in the list of props by typing dav in the mask and pressing enter as shown in the following image.


To set up a mine, you need to

  • Place the static prop "dav_mine_<whatever-you-named-it>" on your map.

I suggest that you also use control-downarrow to lower it such that just the top of the mine is showing above ground level.  

  • Give the dav_mine prop a name of "mine_01". 

Subsequent mines will have a name of mine_02, mine_03 etc...

  • Create a circle location on the map centred on the mine and slightly larger than the size of the mine - this location is the trigger point. When a player moves into this location, if the mine is armed, it will explode killing them. It needs to be larger than the mine to allow it to trigger as the player moves over it. if it is too small, the player may pass throiugh it before it triggers.
  • If the mine does not explaode when you walk over it, try a larger diameter circle ie. radius="100".

The location must be named "loc_mine_01". Subsequent mines will have a location name of loc_mine_02, loc_mine_03 etc...


How to use anti-personnel mines in your mission.

The first step is to download and place the mines_routine.xml in your mission folder (ie. same folder where you have your mission.xml). this is a script I have written to make it easier and cleaner to use mines.


The final step is to set up the mine in your missoin.xml. Create the following entries in your mission.xml.

  • Put the following include statement at the start of your mission.xml . This include the mines routine into the misison script

          <xi:include href = "mines_routine.xml#xpointer(/to_include/*)"/>

  • Include the following line in your mission.xml.

@setup_mine( 01 )

Note :This line must appear OUTSIDE of other tags (ie. NOT inside an <event>...</event> tag. THIS IS IMPORTANT). Subsequent mines will require additional lines ie..@setup_mine( 02 ).... @setup_mine( 03 ) etc...


  • To activate the mine, use the following command inside an event.  Change the number "01" to the number of your mine. Subsequent mines will require additional lines and numbers of 02, 03 etc.

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


  • In the (unlikely) event you want to disarm a mine after activating it, use the following script command. Change the number "01" to the number of your mine.

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


I have included a sample mission file with the above commands used to setup and trigger mines.

Download it by clicking here.



Note the mines will kill anyone within a 7 meter radius.

Randomising the location of mines


Let's say you have one mine, but want to have it spawn randomly in four different places, so every time you play the game, you don't know there it is!

The following script will create a mine on your map from within your mission.xml.

The commented out text is from the world.xml and shows the location we want our mine.  To get the location coordinates, I placed the mine where I wanted it using the editor, then went to the world.xml and removed the unit (ie. cut out the above greyed out text), and added the "CreateUnit" command to my mission.xml.   This created the mine in the desired location (x,y,z coordinates). I then used CentreLocation to move the "trigger" location (loc_mine_01) onto the mine.

<element type="CreateUnit" unit="dav_mine"  name_id="mine_01" pos="-3942.8521 12645.541 -2383.4531"  yaw_pitch_roll="0 0 0" />
<!--            <unit name="dav_mine" unit_id="7858" name_id="mine_01" cover_off="false">
                <position pos_x="-3942.8521" pos_y="12645.541" pos_z="-2383.4531"/>
                <rotation yaw="0" pitch="0" roll="0"/>

<element type = "CenterLocation" location = "loc_mine_01"  position = "-3942.8521 12645.541 -2383.4531" />
<element type = "TriggerEvent" event = "e_arm_mine_01" start_time = "0"/>

All you need to do to randomise this is to have 4 events which place the mines in diff. x,y,z coordinates and trigger them by the following "random" command. The 4 events would be called e_mine_01_loc_a ...e_mine_01_loc_d.

<element type="TriggerRandomEvent" event1="e_mine_01_loc_a" chance1="25" event2="e_mine_01_loc_b" chance2="50" event3="e_mine_01_loc_c" chance3="75" event4="e_mine_01_loc_d" chance4="100" start_time = "8"/>


And finally, create the 4 events for e_mine_01_loc_a, e_mine_01_loc_b, e_mine_01_loc_c, e_mine_01_loc_d

<event name="e_mine_01_loc_a">
<element type="CreateUnit" unit="dav_mine"  name_id="mine_01" pos="-3942.8521 12645.541 -2383.4531"  yaw_pitch_roll="0 0 0" />
<element type = "CenterLocation" location = "loc_mine_01"  position = "-3942.8521 12645.541 -2383.4531" />
<element type = "TriggerEvent" event = "e_arm_mine_01" start_time = "0"/>





Technical details of the mod. and what it all means...

Much more to add here about the structure of the unit files etc...but for now, what I basically did was take a copy of the existing unit (at_mine) and rename it to dav_mine and change the dav_mine.xml to include the sequence tag.  This tag is the one called by the UnitSequence command in the mines_routine.xml (<element type = "UnitSequence" name_id="mine_$mine_number"/>).  It's what causes the mine to explode.  This should be doable for any unit - though I am yet to test it with other units.


range : all the object in this range shall be given damage. Its counted in radie so 700 will meen a sphere with 7m radie from the position. ie. 14m circumference.


<more to go in here>

Comments (4)

Galor said

at 6:22 pm on Mar 25, 2009

Good work !!

Galor said

at 6:25 pm on Mar 25, 2009

This change, which also serves for the rest of the game modes? (HH, Siege, RVSA, TDM)
I followed your step by step directions for use on a map HH, but mine does not explode when they step on it.
How or where can I link Loc_mine_01 with the object mine_01?...

davros123 said

at 10:05 pm on Mar 25, 2009

Hi Galor. Thanks for the feedback.

You'll need to change the mines_routine.xml.
See this post in the forums...http://www.ghostrecon.net/forums/index.php?showtopic=51431&st=0&gopid=537112&#

Also, it might be easier to ask these questions on the forums...then I'll update the wiki with any changes we discover.


Galor said

at 12:14 am on Mar 27, 2009

The problem continues and I have followed the steps from zero..... I am missing something, or should I be doing wrong.....

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