Jump to content

GRAW SP Scripting 4


GRIN_Wolfsong

Recommended Posts

  • 2 weeks later...

Ok. New version for patch v1.35

Admins can remove the post above.

Event Element Types

General Info About Events

<event name="my_event">

<event name="my_event" once="true">

- name => give it any name you want to use when calling it

- once => if this event can be run only once (only needed in special cases)

Note: Remember to close the event tag with </event>

General Info About Start_Time

All elements can be used with or without the start_time variable.

start_time => delay in running element after the event containing it is executed, in seconds

Note: If start_time is not included in an element, default "0.0" will be used

Quick list

- DebugString => show text when debugging

- TriggerEvent => runs another event from within an event

- TriggerRandomEvent => Randomly triggers 1 of up to 4 events

- BreakEvent => stop another event from within an event

- UnitInArea => activates/deactivates a trigger zone

- ActivateGroup => show group and start set behaviour

- ActivateRandomGroup => Randomly activates 1 of up to 4 groups

- RemoveGroup => hide group

- ActivateVehicle => show vehicle and start set behavior

- RemoveVehicle => hide vehicle

- ExplodeVehicle => destroy vehicle

- ActivateCypher => turn Cypher over to player control

- SetVipTarget => make group a target of interest for Cypher

- Backdrop => show/hide backdrop

- SaveGame => saves current game

- Objective => add/remove/update/abort and objective and/or marker

- MissionCommand => activate/deactivate a mission command area

- ChangeMission => end mission in success and setup for next mission in campaign

- GameOver => end mission in failure

- ShowInventory => show inventory selection menu

- GiveAmmo => resupply ammo

- Actor => run NarCom sequence

- ShowMessage => display message to player

- EnableHud => turns on Hud

- ScrambleHud => add interference to Hud

- Music => select music to play

- SetMusicMood => adjust music settings

- SetIndestructable => make dynamic prop indestructable

- OrderTank => setup to order a tank around

- OrderCar => setup to order a car around

- SimulateDriving => simulate that a vehicle is moving (when inside)

- OrderHeli => setup to order a helicopter around

- SetHeliStand => display "press x" message when on ground, open doors when with ropes

- SetHeliDropRope => make helicopter lower ropes

- SetHeliDrop => let you exit helicopter when with ropes

- SetHeliCloseDoors => make helicopter close doors

- SetTransportType => specify what the team transport is for

- SetToSupply => set supply capability of a vehicle

- SupportDone => "special command for original mission"

- UnitVisibility => hide/show props

- AnimateUnit => run animations inside unit

- UnitSequence => run animated sequence inbedded in unit

- EnableUnit => turn on unit, like demolition objective prop

- DisableUnit => turn off unit, like demolition objective prop

- EnableHuman => "special command for original mission"

- SetCanTakeOrders => toggle player control over a vehicle

- SetAiGetUp => tell AI to get up and draw weapon

- GroupJoinTeam => have group join player team

- SetPlayerControlled => toggle player control over a group

- Composition => run composition

- SetSlot => change which slot the unit is in

- Outro => end mission and run outro sequence

- OgrSetGameOver => end [GR] match

- OgrEnableExtraction => turns on/off extraction zone in [GR]-Recon

- UseVar => creates or manipulates mission variables

- ActivateEventIfVar => may trigger event depending on variable value or string contents and set conditions

Other found elements never used in the original game

- SetGlobal

- SetPostEffect

----------------------------------------------------

<element type="DebugString" msg="Begin Game" start_time="0.5"/>

<element type="DebugString" msg="Begin Game"/>

- type => DebugString => show text when debugging

- msg => text to show

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="TriggerEvent" event="heli_ride" start_time="0.1"/>

<element type="TriggerEvent" event="heli_ride"/>

- type => TriggerEvent => runs another event from within an event

- event => name of event to run

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="TriggerRandomEvent" event1="A" chance1="25" event2="B" chance2="50" event3="C" chance3="75" event4="D" chance4="100" start_time="5.0"/>

<element type="TriggerRandomEvent" event1="A" chance1="25" event2="B" chance2="50" event3="C" chance3="75" event4="D" chance4="100"/>

<element type="TriggerRandomEvent" event1="A" chance1="33" event2="B" chance2="66" event3="C" chance3="100" start_time="1.0"/>

<element type="TriggerRandomEvent" event1="A" chance1="33" event2="B" chance2="66" event3="C" chance3="100"/>

<element type="TriggerRandomEvent" event1="eventA" chance1="50" event2="eventB" chance2="100" start_time="30.0"/>

<element type="TriggerRandomEvent" event1="eventA" chance1="50" event2="eventB" chance2="100"/>

- type => TriggerRandomEvent => Randomly triggers 1 of up to 4 events

- event1 => Name of first event that can get triggered

- event2 => Name of second event that can get triggered

- event3 => Name of third event that can get triggered

- event4 => Name of fourth event that can get triggered

- chance1 => Number between 1 and 100

- chance2 => Number between chance1 and 100

- chance3 => Number between chance2 and 100

- chance4 => Number between chance3 and 100

- start_time => (see first part of tutorial)

Note: You only need to use one event and one chance to this element to work.

Note: The chance number set indicates to upper limit for that event to get triggered on a D100 (RPG people will understand this very well :P).

Example: if chance1=40, chance2=55, chance3=74, chance4=90 then

- event1 will trigger if => 0 < "random number" < 40

- event2 will trigger if => 40 < "random number" < 55

- event3 will trigger if => 55 < "random number" < 74

- event4 will trigger if => 74 < "random number" < 90

- and no event at all will trigger if => 90 < "random number"

----------------------------------------------------

<element type="BreakEvent" event="tutorial_tacticalmap" start_time="0.0"/>

<element type="BreakEvent" event="tutorial_tacticalmap"/>

- type => BreakEvent => stop another event from within an event

- event => name of event to stop

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="UnitInArea" area="heli_insert" state="activate" start_time="0.0"/>

<element type="UnitInArea" area="heli_insert" state="activate"/>

<element type="UnitInArea" area="heli_insert" state="deactivate" start_time="0.0"/>

<element type="UnitInArea" area="heli_insert" state="deactivate"/>

- type => UnitInArea => activates/deactivates a trigger zone

- area => name of area_group

- state => what to do? "activate" or "deactivate"

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="ActivateGroup" group_id="guards01" start_time="0.0"/>

<element type="ActivateGroup" group_id="guards01"/>

- type => ActivateGroup => show group and start set behaviour

- group_id => name of group to show

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="ActivateRandomGroup" group1="enemy1" chance1="25" group2="enemy2" chance2="50" group3="enemy3" chance3="75" group4="enemy4" chance4="100" start_time="30.0"/>

<element type="ActivateRandomGroup" group1="enemy1" chance1="25" group2="enemy2" chance2="50" group3="enemy3" chance3="75" group4="enemy4" chance4="100"/>

<element type="ActivateRandomGroup" group1="enemy1" chance1="33" group2="enemy2" chance2="66" group3="enemy3" chance3="100" start_time="30.0"/>

<element type="ActivateRandomGroup" group1="enemy1" chance1="33" group2="enemy2" chance2="66" group3="enemy3" chance3="100"/>

<element type="ActivateRandomGroup" group1="enemy1" chance1="50" group2="enemy2" chance2="100" start_time="30.0"/>

<element type="ActivateRandomGroup" group1="enemy1" chance1="50" group2="enemy2" chance2="100"/>

- type => ActivateRandomGroup => Randomly activates 1 of up to 4 groups

- group1 => Name of first group that can get triggered

- group2 => Name of second group that can get triggered

- group3 => Name of third group that can get triggered

- group4 => Name of fourth group that can get triggered

- chance1 => Number between 1 and 100

- chance2 => Number between chance1 and 100

- chance3 => Number between chance2 and 100

- chance4 => Number between chance3 and 100

- start_time => (see first part of tutorial)

Note: You only need to use one group and one chance to this element to work.

Note: The chance number set indicates to upper limit for that group to get activated on a D100 (RPG people will understand this very well :P).

Example: if chance1=40, chance2=55, chance3=74, chance4=90 then

- group1 will activate if => 0 < "random number" < 40

- group2 will activate if => 40 < "random number" < 55

- group3 will activate if => 55 < "random number" < 74

- group4 will activate if => 74 < "random number" < 90

- and no group at all will activate if => 90 < "random number"

----------------------------------------------------

<element type="RemoveGroup" group_id="guards01" start_time="5.0"/>

<element type="RemoveGroup" group_id="guards01"/>

- type => RemoveGroup => hide group (all groups are hidden at start of mission by default)

- group_id => name of group to hide

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="ActivateVehicle" vehicle_id="square_panhard01" start_time="0.0"/>

<element type="ActivateVehicle" vehicle_id="square_panhard01"/>

- type => ActivateVehicle => show vehicle

- vehicle_id => name of vehicle to show

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="RemoveVehicle" vehicle_id="insert_heli" start_time="35"/>

<element type="RemoveVehicle" vehicle_id="insert_heli"/>

- type => RemoveVehicle => hide vehicle (all vehicles are hidden at start of mission by default)

- vehicle_id => name of vehicle to hide

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="ExplodeVehicle" vehicle_id="apc_2" start_time="4"/>

<element type="ExplodeVehicle" vehicle_id="apc_2"/>

- type => ExplodeVehicle => destroy vehicle

- vehicle_id => name of vehicle to destory

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="ActivateCypher" vehicle_id="cypher" start_time="2.5"/>

<element type="ActivateCypher" vehicle_id="cypher"/>

- type => ActivateCypher => turn Cypher over to player control

- vehicle_id => name of cypher to show

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetVipTarget" vehicle_id="cypher" target_name="ramirez" event="enter_ramirez" start_time="2.5"/>

<element type="SetVipTarget" vehicle_id="cypher" target_name="ramirez" event="enter_ramirez"/>

- type => SetVipTarget => make group a target of interest for Cypher

- vehicle_id => name of cypher

- target_name => name of target group

- event => event to run

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="Backdrop" action="hide" start_time="0.1"/>

<element type="Backdrop" action="hide"/>

<element type="Backdrop" action="show" start_time="0.1"/>

<element type="Backdrop" action="show"/>

- type => Backdrop => show/hide backdrop

- action => what to do? "show" or "hide"

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SaveGame" name="check_point03" start_time="1.0"/>

<element type="SaveGame" name="check_point03"/>

- type => SaveGame => saves current game

- name => name of savegame

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="Objective" id="objective1" headline_id="mx_head_obj1" txt_id="mx_txt_obj1" state="add" mode="1" start_time="32.0"/>

<element type="Objective" id="objective1" headline_id="mx_head_obj1" txt_id="mx_txt_obj1" state="add" mode="1"/>

<element type="Objective" id="objective1" state="remove" mode="1" start_time="0.2"/>

<element type="Objective" id="objective1" state="remove" start_time="4.0"/>

<element type="Objective" id="objective1" state="remove"/>

<element type="Objective" id="objective1_wp" state="add" waypoint_id="mx_obj1_wp" waypoint="4124.5317 9184.1592 612.1196" mode="1" start_time="5"/>

<element type="Objective" id="objective1_wp" state="add" waypoint_id="mx_obj1_wp" waypoint="4124.5317 9184.1592 612.1196" mode="1"/>

<element type="Objective" id="objective1_wp" state="remove" mode="1" start_time="0.0"/>

<element type="Objective" id="objective1_wp" state="remove" mode="1"/>

- type => Objective => add/remove/update and objective and/or marker

- id => your internal name of objective or objective marker to work on

- headline_id => which string entry to show as headline for objective, found in /strings/mission*.xml

- headline => headline to show, instead of using string entry

- txt_id => which string entry to show as description for objective, found in /strings/mission*.xml

- txt => description to show, instead of using string entry

- waypoint_id => which string entry to show as marker label, found in /strings/mission*.xml

- waypoint => "x y z" coordinates for objective marker

- state => what to do with it? "add", "update", "remove" or "aborted"

- mode => "1" or "2" for primary and secondary objective

- start_time => (see first part of tutorial)

Note: For more info see SP Scripting 2 - Mission Objectives And The GUI

----------------------------------------------------

<element type="MissionCommand" name="search" action="start" start_time="2.0"/>

<element type="MissionCommand" name="search" action="stop" start_time="0.0"/>

- type => MissionCommand => activate/deactivate a mission command area

- name => name of mission command area

- action => what to do? "start" or "stop"

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="ChangeMission" path="/levels/mission03/mission03" level_number="2" start_time="20.0"/>

<element type="ChangeMission" path="/levels/mission03/mission03" level_number="2"/>

- type => ChangeMission => end mission in success and setup for next mission in campaign

- path => define path to next mission

- level_number => which mission in the campaign it is

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="GameOver" start_time="2.0"/>

<element type="GameOver"/>

- type => GameOver => end mission in failure

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="ShowInventory"/>

<element type="ShowInventory" disable_weapon="predator" start_time="3.0"/>

<element type="ShowInventory" tutorial="true" disable_weapon="predator" start_time="3.0"/>

- type => ShowInventory => show inventory selection menu

- tutorial => use tutorial mode with "true"

- disable_weapon => remove weapon from inventory

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="GiveAmmo" start_time="1.0"/>

<element type="GiveAmmo"/>

- type => GiveAmmo => resupply ammo

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="Actor" actor="m02_briefing" start_time="5.0"/>

<element type="Actor" actor="m02_briefing"/>

- type => Actor => run NarCom sequence

- actor => name or actor to run, found in /lib/managers/xml/actor_manager_*.xml

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="ShowMessage" msg_id="m11_message_briefing" start_time="4.0"/>

<element type="ShowMessage" msg_id="m11_message_briefing"/>

<element type="ShowMessage" msg="You have completed the mission successfully!" start_time="1.0"/>

<element type="ShowMessage" msg="You have completed the mission successfully!"/>

- type => ShowMessage => display message to player

- msg_id => which string entry to show, found in /strings/mission*.xml

- msg => message to show, instead of using string entry

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="EnableHud" start_time="1.0"/>

<element type="EnableHud"/>

- type => EnableHud => turns on Hud

- start_time => (see first part of tutorial)

Note: Mission specific element for mission01.

----------------------------------------------------

<element type="ScrambleHud" id="jamming01" mode="add" position="-21794.572 10892.932 0" range="23524.465" start_time="1.0"/>

<element type="ScrambleHud" id="jamming01" mode="add" position="-21794.572 10892.932 0" range="23524.465"/>

<element type="ScrambleHud" id="jamming01" mode="remove" start_time="0.4"/>

<element type="ScrambleHud" id="jamming01" mode="remove"/>

- type => ScrambleHud => add interference to Hud

- id => your internal name or jamming

- mode => turn on/off by using "add" or "remove"

- position => "x y z" coordinates for the source of the interference

- range => how far from the source interference occurs, in centimeters

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="Music" cue="1" start_time="10.0"/>

<element type="Music" cue="3"/>

- type => Music => select music to play

- cue => which piece of music?

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetMusicMood" tempo="200" mood="0" start_time="0.0"/>

<element type="SetMusicMood" tempo="-500" mood="-500"/>

<element type="SetMusicMood" mood="-1000"/>

<element type="SetMusicMood" tempo="500"/>

- type => SetMusicMood => adjust music settings

- tempo => adjust tempo of music

- mood => adjust mood of music

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetIndestructable" name_id="fueltrailer" start_time="6.0"/>

<element type="SetIndestructable" name_id="fueltrailer"/>

- type => SetIndestructable => make dynamic prop indestructable

- name_id => name of dynamic "cover" to be indestructable (dynamic is called cover in world.xml)

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="OrderTank" vehicle_id="tank01" order="set_fire_ready" value="true" start_time="10.1"/>

<element type="OrderTank" vehicle_id="tank01" order="set_fire_ready" value="true"/>

<element type="OrderTank" vehicle_id="tank01" order="set_fire_ready" value="false" start_time="5.1"/>

<element type="OrderTank" vehicle_id="tank01" order="set_fire_ready" value="false"/>

<element type="OrderTank" vehicle_id="tank01" ai="true" order="move" world_x="-6942" world_y="-13449" start_time="20.0"/>

<element type="OrderTank" vehicle_id="tank01" ai="true" order="move" world_x="-6942" world_y="-13449"/>

<element type="OrderTank" vehicle_id="tank01" ai="true" order="patrol" start_time="1.0">

<waypoint position="12500 4500 0"/>

<waypoint position="2500 4500 0"/>

</element>

- type => OrderTank => setup to order a tank around

- vehicle_id => name of tank

- ai => turn ai on/off, "ture" or "false"

- order => what should the tank do? "set_fire_ready", "move" or "patrol"

- value => sets "set_fire_ready" status, "true" or "false"

- world_x => x coordinate of "move" destination

- world_y => y coordinate of "move" destination

- start_time => (see first part of tutorial)

- waypoint position => "x y z" coordinates for a waypoint in "patrol"

----------------------------------------------------

<element type="OrderCar" vehicle_id="square_panhard01" order="move" position="12350 8940 0" start_time="0.1"/>

<element type="OrderCar" vehicle_id="square_panhard01" order="move" position="12350 8940 0"/>

- type => OrderCar => setup to order a car around

- vehicle_id => name of car

- order => what should the car do? "move"

- position => "x y z" coordinates of "move" destination

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SimulateDriving" vehicle_id="stryker01" action="start" mute="true" start_time="2"/>

<element type="SimulateDriving" vehicle_id="stryker01" action="start" start_time="2.0"/>

<element type="SimulateDriving" vehicle_id="stryker01" action="start"/>

<element type="SimulateDriving" vehicle_id="stryker01" action="stop" start_time="50.0"/>

<element type="SimulateDriving" vehicle_id="stryker01" action="stop"/>

- type => SimulateDriving => simulate that a vehicle is moving (when inside)

- vehicle_id => name of vehicle

- action => turn on/off driving simulation, "start" or "stop"

- mute => "true" or "false"

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="OrderHeli" vehicle_id="heli01" order="start" up="8000" forward="1000" speed="0.8" start_time="0"/>

<element type="OrderHeli" vehicle_id="heli01" order="start" up="8000" forward="1000" speed="0.8"/>

<element type="OrderHeli" vehicle_id="heli01" order="move" position="-25365 309 2516" speed="0.8" target="true" start_time="2"/>

<element type="OrderHeli" vehicle_id="heli01" order="move" position="-25365 309 2516" speed="0.8" target="true"/>

<element type="OrderHeli" vehicle_id="heli01" order="land" position="-28239 532 868" speed="0.6" target="true" start_time="8"/>

<element type="OrderHeli" vehicle_id="heli01" order="land" position="-28239 532 868" speed="0.6" target="true"/>

<element type="OrderHeli" vehicle_id="heli01" order="target" target_rot="0 0 29" position="-28239 532 868" speed="1.0" start_time="9"/>

<element type="OrderHeli" vehicle_id="heli01" order="target" target_rot="0 0 29" position="-28239 532 868" speed="1.0"/>

<element type="OrderHeli" vehicle_id="heli01" order="target" position="24476 16921 2953" speed="1.0" start_time="13.0"/>

<element type="OrderHeli" vehicle_id="heli01" order="target" position="24476 16921 2953" speed="1.0"/>

- type => OrderHeli => setup to order a helicopter around

- vehicle_id => name of helicopter

- order => what should the helicopter do? "start", "move", "land" or "target"

- up => gives high to rise to during "start"

- forward => gives forward movement while rising during "start"

- target_rot => "x y z" rotation coordinates (z value is angle counter clockwise)

- position => "x y z" coordinates for "move", "land" or "target" destination

- target => does it have a target for "move" or "land"?

- speed => how fast should it move?

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetHeliStand" vehicle_id="heli01" start_time="0.0"/>

<element type="SetHeliStand" vehicle_id="heli01"/>

- type => SetHeliStand => display "press x" message when on ground, open doors when with ropes

- vehicle_id => name of helicopter

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetHeliDropRope" vehicle_id="heli01" start_time="3.0"/>

<element type="SetHeliDropRope" vehicle_id="heli01"/>

- type => SetHeliDropRope => make helicopter lower ropes

- vehicle_id => name of helicopter

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetHeliDrop" vehicle_id="heli01" start_time="5.0"/>

<element type="SetHeliDrop" vehicle_id="heli01"/>

- type => SetHeliDrop => let you exit helicopter when with ropes

- vehicle_id => name of helicopter

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetHeliCloseDoors" vehicle_id="heli01" start_time="3.0"/>

<element type="SetHeliCloseDoors" vehicle_id="heli01"/>

- type => SetHeliCloseDoors => make helicopter close doors

- vehicle_id => name of helicopter

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetTransportType" vehicle_id="heli01" transport_type="insertion" start_time="1.0"/>

<element type="SetTransportType" vehicle_id="heli01" transport_type="insertion"/>

<element type="SetTransportType" vehicle_id="heli02" transport_type="extraction" start_time="1.0"/>

<element type="SetTransportType" vehicle_id="heli02" transport_type="extraction"/>

<element type="SetTransportType" vehicle_id="heli01" transport_type="extraction" group_id="president" start_time="1.0"/>

<element type="SetTransportType" vehicle_id="heli01" transport_type="extraction" group_id="president"/>

- type => SetTransportType => specify what the team transport is for

- vehilce_id => name of transport

- transport_type => "insertion" or "extraction"

- group_id => name of group to set transport for?

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetToSupply" vehicle_id="stryker01" event="enter_equipment" slot_name="backpack" start_time="10.0"/>

<element type="SetToSupply" vehicle_id="stryker01" event="enter_equipment" slot_name="backpack"/>

<element type="SetToSupply" vehicle_id="stryker01" event="enter_equipment" start_time="82"/>

<element type="SetToSupply" vehicle_id="stryker01" event="enter_equipment"/>

<element type="SetToSupply" vehicle_id="stryker01" mode="false" start_time="1.0"/>

<element type="SetToSupply" vehicle_id="stryker01" mode="false"/>

- type => SetToSupply => set supply capability of a vehicle

- vehicle_id => name of vehicle

- event => event to run when supply is done

- slot_name => where to supply? (for players use "backpack")

- mode => capability to supply? "true" or "false" (default is "true" when using element)

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SupportDone" vehicle_id="f15" start_time="6.0"/>

<element type="SupportDone" vehicle_id="f15"/>

- type => SupportDone => "special command for original mission"

- vehicle_id => name of vehicle

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="UnitVisibility" name_id="player_parachute" action="hide" start_time="5.0"/>

<element type="UnitVisibility" name_id="player_parachute" action="hide"/>

<element type="UnitVisibility" name_id="player_parachute" action="show" start_time="3.0"/>

<element type="UnitVisibility" name_id="player_parachute" action="show"/>

- type => UnitVisibility => hide/show props

- name_id => name of prop

- action => select status, "show" or "hide"

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="AnimateUnit" name_id="depot01" animation_group="hangar_door" play_to="length" speed="1.5" start_time="2.0"/>

<element type="AnimateUnit" name_id="depot01" animation_group="hangar_door" play_to="length" speed="1.5"/>

<element type="AnimateUnit" name_id="depot01" animation_group="hangar_door" play_to="0" speed="-1" start_time="1.0"/>

<element type="AnimateUnit" name_id="depot01" animation_group="hangar_door" play_to="0" speed="-1"/>

- type => AnimateUnit => run animations inside unit

- name_id => name of unit

- animation_group => which animation to run?

- play_to => stop when? "length" is the end and "0" is the beginning

- speed => how fast and which direction should it run, negative is backwards

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="UnitSequence" name_id="gasstation" start_time="1.0"/>

<element type="UnitSequence" name_id="gasstation"/>

<element type="UnitSequence" name_id="blackhawk_m10_crashanim" start_time="6.5"/>

<element type="UnitSequence" name_id="blackhawk_m10_crashanim"/>

- type => UnitSequence => run animated sequence inbedded in unit

- name_id => name of unit

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="EnableUnit" name_id="c4_bunker01" start_time="7.6"/>

<element type="EnableUnit" name_id="c4_bunker01"/>

- type => EnableUnit => turn on unit, like demolition objective prop

- name_id => name of unit

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="DisableUnit" name_id="c4_bunker01" start_time="7.6"/>

<element type="DisableUnit" name_id="c4_bunker01"/>

- type => DisableUnit => turn off unit, like demolition objective prop

- name_id => name of unit

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="EnableHuman" group_id="president" start_time="5.0"/>

<element type="EnableHuman" group_id="president"/>

- type => EnableHuman => "special command for original mission"

- group_id => name of group to enable

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetCanTakeOrders" vehicle_id="tank01" value="true" start_time="10.0"/>

<element type="SetCanTakeOrders" vehicle_id="tank01" value="true"/>

<element type="SetCanTakeOrders" vehicle_id="tank01" value="false" start_time="1.0"/>

<element type="SetCanTakeOrders" vehicle_id="tank01" value="false"/>

- type => SetCanTakeOrders => toggle player control over a vehicle

- vehicle_id => name of vehicle

- value => can it? "true" or "false"

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetAiGetUp" group_id="tank_crew01" start_time="2.0"/>

<element type="SetAiGetUp" group_id="tank_crew01"/>

<element type="SetAiGetUp" group_id="friendly2" start_time="0.1"/>

<element type="SetAiGetUp" group_id="friendly2"/>

- type => SetAiGetUp => tell AI to get up and draw weapon

- group_id => name of group

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="GroupJoinTeam" group_id="friendly2" start_time="1.0"/>

<element type="GroupJoinTeam" group_id="friendly2"/>

- type => GroupJoinTeam => have group join player team

- group_id => name of group to have join

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="SetPlayerControlled" group_id="tank_crew01" vehicle_id="tank01" target_is_tank="true" value="true" start_time="3.0"/>

<element type="SetPlayerControlled" group_id="tank_crew01" vehicle_id="tank01" target_is_tank="true" value="true"/>

<element type="SetPlayerControlled" group_id="tank_crew01" pub_name="support_crew" value="false" dont_change_slot="true" start_time="3.0"/>

<element type="SetPlayerControlled" group_id="tank_crew01" pub_name="support_crew" value="false" dont_change_slot="true"/>

<element type="SetPlayerControlled" group_id="president" vehicle_id="evac" pub_name="support_president" value="true" start_time="7.0"/>

<element type="SetPlayerControlled" group_id="president" vehicle_id="evac" pub_name="support_president" value="true"/>

- type => SetPlayerControlled => toggle player control over a group

- group_id => name or group

- vehicle_id => name of vehicle

- pub_name => which string entry to show for group in control list, found in /strings/ghost_members.xml

- target_is_tank => "true" or "false", special command for the mission it's used in

- dont_change_slot => "true" or "false", special command for the mission it's used in

- value => turn it on/off, "true" or "false"

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="Composition" vehicle_id="heli01" composition="blackhawk_clouds" start_time="5.0"/>

<element type="Composition" vehicle_id="heli01" composition="blackhawk_clouds"/>

<element type="Composition" vehicle_id="heli01" composition="blackhawk_clouds" mode="deactivate" start_time="90.0"/>

<element type="Composition" vehicle_id="heli01" composition="blackhawk_clouds" mode="deactivate"/>

<element type="Composition" id="start_mort_01" start_time="30"/>

<element type="Composition" id="start_mort_01"/>

<element type="Composition" id="start_mort_01" mode="deactivate" start_time="30"/>

<element type="Composition" id="start_mort_01" mode="deactivate"/>

<element type="Composition" id="gogogo_01" start_time="6.0"/>

<element type="Composition" id="gogogo_01"/>

- type => Composition => run composition

- id => name of composition_testbox if defined in map editor, defined in world.xml

- vehicle_id => name of vehicle to use composition on (if needed)

- composition => name of composition to run if not defined in world.xml, found in /lib/managers/xml/composition_manager.xml

- mode => turn on/off, "activate" or "deactivate" ("activate" is default when running element)

- start_time => (see first part of tutorial)

Note: There are two main types of compositions, those that are defined by a composition_testbox in the mapeditor (founf in world.xml) and those that don't have a set location and are run directly from the composition_manager.xml.

Note: Only compositions that loop need to be deactivated.

----------------------------------------------------

<element type="SetSlot" name_id="fueltrailer" slot="16" start_time="9.0"/>

<element type="SetSlot" name_id="first_scrambler" slot="20"/>

- type => SetSlot => change which slot the unit is in (affects how it is used in the game)

- name_id => name of item to slot

- slot => number of slot to place it in

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="Outro" vehicle_id="extract_heli" start_time="71"/>

- type => Outro => end mission and run outro sequence

- vehicle_id => name of vehicle

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="OgrSetGameOver" start_time="10.0"/>

<element type="OgrSetGameOver"/>

- type => OgrSetGameOver => end [GR] match

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="OgrEnableExtractionCheck" enable="false" start_time="5.0"/>

<element type="OgrEnableExtractionCheck" enable="false"/>

<element type="OgrEnableExtractionCheck" enable="true" start_time="1.0"/>

<element type="OgrEnableExtractionCheck" enable="true"/>

- type => OgrEnableExtractionCheck => turns on/off extraction zone in [GR]-Recon

- enable => turn it on or off, "true" or "false"

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="UseVar" id="variable_a" set="5" start_time="1.0"/>

<element type="UseVar" id="variable_s" set="event_a"/>

<element type="UseVar" id="variable_b" set="5"/>

<element type="UseVar" id="variable_b" add="2"/>

<element type="UseVar" id="variable_b" mul="5"/>

<element type="UseVar" id="variable_c" set_random="20"/>

<element type="UseVar" id="variable_e" set_var="variable_a"/>

<element tpye="UseVar" id="variable_e" add_var="variable_b"/>

<element type="UseVar" id="variable_e" mul_var="variable_c"/>

- type => UseVar => creates or manipulates mission variables

- id => name or variable to apply on

- set => sets "id" variable to given value or string

- add => adds given value to value in "id" variable and stores result

- mul => multiplies given value with vaule in "id" variable and stores result

- set_var => copies this variable into "id" variable

- add_var => adds value of this variable to value in "id" variable and stores result in "id"

- mul_var => multiplies value of this variable with value in "id" variable and stores result in "id"

- set_random => stores a random value between 0 and given value into "id" variable

- set_time => stores the current gametime, in seconds, since start_game was executed, into "id"

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="ActivateEventIfVar" id="variable_a" greater_than="6" event="event_a" start_time="1.0"/>

<element type="ActivateEventIfVar" id="variable_a" greater_than="6" event="event_a"/>

<element type="ActivateEventIfVar" id="variable_b" less_than="5" event="event_b"/>

<element type="ActivateEventIfVar" id="variable_b" equals_var="variable_a" event="event_c"/>

- type => ActivateEventIfVar => may trigger event depending on variable value or string contents and set conditions

- id => name of variable to check against

- equal => runs event if "id" variable is equal to given value or string

- less_than => runs event if "id" variable less then given value

- greater_than => runs event if "id" variable greater then given value

- equals_var => runs event if "id" variable equals this variable

- less_than_var => runs event if "id" variable is smaller than this variable

- greater_than_var => runs event if "id" variable is larger than this variable

- event => event to run if check is true

- start_time => (see first part of tutorial)

Ok. That's the update.

EDIT: Added UseVar, ActivateEventIfVar and DisableUnit. Thanx to Grin_GeckoGore. :thumbsup:

Edited by Wolfsong
Link to comment
Share on other sites

Hmm... I try to add a new version of this and it won't post... :angry:

Sorry about that. I had to add antispam measure to the forum, and an incorrect setting was making all new posts invisible. Should be fixed now.

Thanx Rocky.

I removed the double post I did of the entire list when I first figured I'd pressed the wrong button.

Link to comment
Share on other sites

Thanks to your great tutorials Wolfsong and patch 1.35, I'm feeling inspired. Probably won't amount to much but I wanted to give mission modding a go. Unfortunately, I keep crashing out of the mission editor immediately after hitting the "create" button. Below is the crash log and I've disabled all my mods. (renamed local/english directory to local/english_x) What am I missing?

Crash in application version: grpcrc1.35

data\lib\units\extensions\inventory.dsf(-1): cant find member: _inventory_slot in type <void>

SCRIPT STACK

data\lib\managers\playermanager.dsf(0)

data\lib\managers\playermanager.dsf(0)

data\lib\managers\playermanager.dsf(0)

data\lib\setups\setup.dsf(0)

data\levels\editor\editor.dsf(0)

Link to comment
Share on other sites

Thanks to your great tutorials Wolfsong and patch 1.35, I'm feeling inspired. Probably won't amount to much but I wanted to give mission modding a go. Unfortunately, I keep crashing out of the mission editor immediately after hitting the "create" button. Below is the crash log and I've disabled all my mods. (renamed local/english directory to local/english_x) What am I missing?

Crash in application version: grpcrc1.35

data\lib\units\extensions\inventory.dsf(-1): cant find member: _inventory_slot in type <void>

SCRIPT STACK

data\lib\managers\playermanager.dsf(0)

data\lib\managers\playermanager.dsf(0)

data\lib\managers\playermanager.dsf(0)

data\lib\setups\setup.dsf(0)

data\levels\editor\editor.dsf(0)

You must have the local/english directory as it was after clean install of the game and then patch applied. The editor, unlike the game, always look for files in the english folder. Make sure there are no modded files in the local/english directory when you start.

I got a few crashes, but that was because I had installed mods I'd downloaded and they had put stuff in local/english. Once I'd cleaned it, everything worked.

Link to comment
Share on other sites

OK, cleaned the local/english directory, removed it totally (didn't have the "english" folder to begin with) and still no go. Same crash, same error. I'll try uninstalling GRAW completely and reinstalling patch 1.35 directly. Last install was 1.35 over 1.30, might have messed things up I guess. :huh:

While I'm asking anyway though, which files do I have to unpack if I want to work off of a pre-existing mission? Basically, I want to avoid creating the entire map from scratch and focus on the objectives/bad guys.

Edited by Pritzl
Link to comment
Share on other sites

OK, cleaned the local/english directory, removed it totally (didn't have the "english" folder to begin with) and still no go. Same crash, same error. I'll try uninstalling GRAW completely and reinstalling patch 1.35 directly. Last install was 1.35 over 1.30, might have messed things up I guess. :huh:

While I'm asking anyway though, which files do I have to unpack if I want to work off of a pre-existing mission? Basically, I want to avoid creating the entire map from scratch and focus on the objectives/bad guys.

http://img56.imageshack.us/img56/7600/bundlesg7.jpg

Not sure if this is what you want but it gets you into Mission 1 ready for editing.

Tinker

<_<

Link to comment
Share on other sites

Actually, I was wondering which files specifically need to go where under the custom_levels/my_mission folder. Within it, there is an xml folder, a scripts folder and a description.xml file as far as I can tell, but what to put where?

Oh and I just reinstalled but still no go. Editor crashes with the same error and the only mod I've done on the new reinstall is change the "editor="true"" parameter in context.xml. It seems the Gods of Gaming are conspiring against me on this one.

[edit]Note to self: RTFM! There it was in black and white (actually pale brown thanks to my XML syntax editor) a comment at the top of the content.xml file on how to properly activate the editor. It's working now, albeit rather awkwardly; am I going to have to edit the content.xml file back and forth whenever I want to test out a mission I'm working on?[/edit]

Edited by Pritzl
Link to comment
Share on other sites

Actually, I was wondering which files specifically need to go where under the custom_levels/my_mission folder. Within it, there is an xml folder, a scripts folder and a description.xml file as far as I can tell, but what to put where?

Oh and I just reinstalled but still no go. Editor crashes with the same error and the only mod I've done on the new reinstall is change the "editor="true"" parameter in context.xml. It seems the Gods of Gaming are conspiring against me on this one.

Did you re-install GRAW or just the patches, as i had this before, only a fresh graw install fixed it?

Sry i can`t really help any more til you fix this, good luck.

Tinker

:(

Link to comment
Share on other sites

Oh I fixed it. See the [edit] above. All I need now is to figure out which mission files I need to extract from the bundle and where do I place them to start modding from a pre-existing mission. The main objective being to avoid redesigning the entire map from scratch. e.g. I would like to use the strongpoint map - which is a bloody brilliant map imo - for a hostage rescue mission. As such I guess I would need the world.xml file or some such but not the mission.xml file. Correct?

Just to be clear, which file(s) do I extract and where do I put it under the custom_levels/work/my_new_mission/ folder for it to be just a blank map file?

Link to comment
Share on other sites

Actually, I was wondering which files specifically need to go where under the custom_levels/my_mission folder. Within it, there is an xml folder, a scripts folder and a description.xml file as far as I can tell, but what to put where?

Oh and I just reinstalled but still no go. Editor crashes with the same error and the only mod I've done on the new reinstall is change the "editor="true"" parameter in context.xml. It seems the Gods of Gaming are conspiring against me on this one.

[edit]Note to self: RTFM! There it was in black and white (actually pale brown thanks to my XML syntax editor) a comment at the top of the content.xml file on how to properly activate the editor. It's working now, albeit rather awkwardly; am I going to have to edit the content.xml file back and forth whenever I want to test out a mission I'm working on?[/edit]

You shouldn't have to edit the content.XML file for the map editor. It runs on it's own content-editor.XML if you start the editor with the link called "Ghost Recon Advanced Warfighter Map Editor" found in your windows start menu where the rest of the GR:AW stuff was placed. ;)

Oh I fixed it. See the [edit] above. All I need now is to figure out which mission files I need to extract from the bundle and where do I place them to start modding from a pre-existing mission. The main objective being to avoid redesigning the entire map from scratch. e.g. I would like to use the strongpoint map - which is a bloody brilliant map imo - for a hostage rescue mission. As such I guess I would need the world.xml file or some such but not the mission.xml file. Correct?

Just to be clear, which file(s) do I extract and where do I put it under the custom_levels/work/my_new_mission/ folder for it to be just a blank map file?

You need the world.XML only. BUT, it won't be clean. All the stuff will still be in there. On the mission I'm working on I used mission05 as the base. I started by opening the world.XML in UltraEdit (use your XML editor of choise) and going through the blocks and deleting everything that is mission specific.

I left the entries inside the tags that are terrain specific:

<ai_graph name="main"> (don't want to redo all this work)

</ai_graph>

<ai_graph name="vehicle"> (don't want to redo all this work)

</ai_graph>

<electric name="first"> (if you want the telephone poles to stay)

</electric>

<wires name="first"> (if you want the telephone poles to stay)

</wires>

<sky name="first"> (this is set when you export anyhow)

</sky>

<small_static name="first"> (you're gonna have to clean out some mission specific props in the editor later...)

</small_static>

<sounds name="first"> (if you want the same kind of setting)

</sounds>

<milieus name="first"> (haven't seen anything inside these tags...)

</milieus>

<static name="first"> (this is the map itself, so leave it)

</static>

<static_addon name="first"> (haven't seen anything inside these tags...)

</static_addon>

And I deleted all entries inside these tags that are mission specific:

<areas name="first">

</areas>

<compositions name="first">

</compositions>

<cover name="first"> (this could be argued to be terrain specific but I like to place my own dynamic objects)

</cover>

<mission_command name="first">

</mission_command>

<vehicle name="first">

</vehicle>

I only left the following entires that are player specific in the following tags:

<human name="first">

<unit name="group_unit" group="friendly" group_id="friendly1" vehicle_id="hawk_0" crew="false">

<order order="Guard" source_pos="-21870.328 -24741.85 0" order_pos="-21870.328 -24241.85 -881.56445" patrol_type="moveguard_recon">

</order>

<position pos_x="-21870.328" pos_y="-24741.85" pos_z="-681.56445"/>

<rotation yaw="0" pitch="0" roll="-179.99911"/>

</unit>

</human>

<player name="first">

<unit name="ghost_player" vehicle_id="none" mod="OnFoot">

<position pos_x="0" pos_y="0" pos_z="0"/>

<rotation yaw="0" pitch="0" roll="0"/>

</unit>

</player>

Hope that helps.

Edited by Wolfsong
Link to comment
Share on other sites

You shouldn't have to edit the content.XML file for the map editor. It runs on it's own content-editor.XML if you start the editor with the link called "Ghost Recon Advanced Warfighter Map Editor" found in your windows start menu where the rest of the GR:AW stuff was placed. ;)

:blush: Now I feel like a royal idiot... I have no idea how I missed that shortcut.

You need the world.XML only. BUT, it won't be clean. All the stuff will still be in there. On the mission I'm working on I used mission05 as the base. I started by opening the world.XML in UltraEdit (use your XML editor of choise) and going through the blocks and deleting everything that is mission specific.

Only world.xml? So it's pulling the terrain diesel file straight from the bundle? Which subdirectory to I place the world.xml file in?

[edit]Seems to work fine. Awesome![/edit]

I only left the following entires that are player specific in the following tags:

<human name="first">

<unit name="group_unit" group="mex_guerilla_patrol1" group_id="wave1" vehicle_id="none" crew="false">

<order order="Guard" source_pos="1309.1118 2514.8137 0" order_pos="1309.1118 3014.8137 -3.9022903" patrol_type="moveguard_recon">

</order>

<position pos_x="1309.1118" pos_y="2514.8137" pos_z="196.09772"/>

<rotation yaw="0" pitch="0" roll="0"/>

</unit>

</human>

Errrmmm... why is this group considered player-specific? It seems like a regular enemy unit to me.

Much appreciated btw...

Edited by Pritzl
Link to comment
Share on other sites

You need the world.XML only. BUT, it won't be clean. All the stuff will still be in there. On the mission I'm working on I used mission05 as the base. I started by opening the world.XML in UltraEdit (use your XML editor of choise) and going through the blocks and deleting everything that is mission specific.

Aha

Nice short cut...now to understand these codes :huh:

Still struggling, but it comes more apparent by the day, thnx for the help.

:zorro:

Pritzl:

Errrmmm... why is this group considered player-specific? It seems like a regular enemy unit to me.

Much appreciated btw...

Good Question?

:wacko::rofl:

Link to comment
Share on other sites

You need the world.XML only. BUT, it won't be clean. All the stuff will still be in there. On the mission I'm working on I used mission05 as the base. I started by opening the world.XML in UltraEdit (use your XML editor of choise) and going through the blocks and deleting everything that is mission specific.

Only world.xml? So it's pulling the terrain diesel file straight from the bundle? Which subdirectory to I place the world.xml file in?

When you export from the map editor it creates a new diesel file. :thumbsup:

I only left the following entires that are player specific in the following tags:

<human name="first">

<unit name="group_unit" group="mex_guerilla_patrol1" group_id="wave1" vehicle_id="none" crew="false">

<order order="Guard" source_pos="1309.1118 2514.8137 0" order_pos="1309.1118 3014.8137 -3.9022903" patrol_type="moveguard_recon">

</order>

<position pos_x="1309.1118" pos_y="2514.8137" pos_z="196.09772"/>

<rotation yaw="0" pitch="0" roll="0"/>

</unit>

</human>

Errrmmm... why is this group considered player-specific? It seems like a regular enemy unit to me.

Ops. I was a little to fast on the copy-paste there. I'll post the correct one tomorrow when I'm close to my files again, at my girlfriends place right now. It should be the one that uses "friendy" as group type, where this one says "mex_guerilla_patrol1".

Link to comment
Share on other sites

Wolfsong thats a great tutorial!

I'm impressed! :D

There was very little time for me to add the new mission scripting tags, and i really wanted for you to have more of them.

However 2 undocumented commands crept in there also... i had a idea of letting you name and store flags or variables, and then comparing them with eachother and starting events based on the results. I guess i only got halfway there, so no guarantees how well these work, or if you have any use for them (didnt have time to test them more than just barely)

EDIT: I have now looked at the code, here are the correct commands:

Basically they work like this, they are called:

UseVar - Stores, adds multipicates a variable with a number or with another variable.

id - what variable we want to work with

set - store a number or a string into a variable.

add - adds a number to a variable

mul - multiplicates a variable with a number

set_var - copies one variable into another.

add_var - adds one variable to another

mul_var - multiplicates one variable with another.

set_random - stores a random number between 0 and X into a variable.

set_time - stores the current seconds since the game started.

ActivateEventIfVar

Activates an event based on the number or string in a variable

id - which variable we want to compare

equals - event will run if the variable equals this number or string

less_than - event will run if the variable is less than this number

greater_then - event will run if the variable is greater than this number

equals_var - event will run if the the variable equals another variable.

less_than_var - event will run if the the variable is less than another variable.

greater_than_var - event will run if the the variable is greater than another variable.

event - this specifies which event will run if the conditions above evaluates as true.

Some examples:

-> create a variable called 'my_var' and set it to 5:

<element type="UseVar" id="my_var" set="5" />

-> create a variable called 'my_var' and store a string into it. Can be used to store the name of events for example, that will be run at a later time.

<element type="UseVar" id="my_event_var" set="my_precious_event" />

- add 5 to my_var, my_var = 5 + 7 = 12:

<element type="UseVar" id="my_var" add="7" />

- multiply my_var by 3, my_var= 12 * 3 = 36:

<element type="UseVar" id="my_var" mul="3" />

- my_var filled with a a random number between 0 and 10, maybe 7.75:

<element type="UseVar" id="my_var" set_random="10" />

- my_var fills with the number of seconds since the current game started:

<element type="UseVar" id="my_var" set_time="" />

- another variable called another_var is copied into my_var:

<element type="UseVar" id="another_var" set="1235" />

<element type="UseVar" id="my_var" set_var="another_var" />

- variable another_var is added to my_var

<element type="UseVar" id="my_var" add_var="another_var" />

- variable another_var is multiplied with my_var, and the result is stored into my_var

<element type="UseVar" id="my_var" mul_var="another_var" />

<element type="ActivateEventIf" id="my_var" equals="5" event="do_something" />

<element type="ActivateEventIf" id="my_var" equals_var="compare_me" event="do_something" />

<element type="ActivateEventIf" id="my_var" less_than="5" event="do_something" />

<element type="ActivateEventIf" id="my_var" less_than_var="another_var" event="do_something" />

<element type="ActivateEventIf" id="my_var" greater_than="5" event="do_something" />

<element type="ActivateEventIf" id="my_var" greater_than_var="wooot43" event="do_something" />

-GeckoGore

Link to comment
Share on other sites

Thanks. That does look very promising.

Might I ask a quick related question though? WRT triggers, when exactly are they evaluated. I'm interested particularly in UnitInArea triggers and how they work. Do they remain "tripped" once a unit enters the designated area or is it a flag type system whereby it remains tripped so long as a unit is in the designated area but reverts to untriggered when that unit leaves the area?

e.g. Suppose I set up an area trigger, and then make it a requirement that it be triggered as well as an EnemyGroup trigger to start an event. Now, assume the area trigger is tripped, would the event run the minute the EnemyGroup trigger is satisfied... or... will they have to occur simultaneously for the event to be triggered? i.e. UnitInArea at the same time as the EnemyGroup part is satisfied?

Thanks...

Link to comment
Share on other sites

Here is the correct "human" unit to save:

<unit name="group_unit" group="friendly" group_id="friendly1" vehicle_id="hawk_0" crew="false">

<order order="Guard" source_pos="-21870.328 -24741.85 0" order_pos="-21870.328 -24241.85 -881.56445" patrol_type="moveguard_recon">

</order>

<position pos_x="-21870.328" pos_y="-24741.85" pos_z="-681.56445"/>

<rotation yaw="0" pitch="0" roll="-179.99911"/>

</unit>

As you can see the "group" is defined as "friendly", which if you look into the group_manager.xml is the name of the player team.

Also notice the "vehicle_id" tag which shows what vehicle the player team will be inserted with. ;)

And lastly, whatever name you use as "group_id" is what you'll have to use in the mission script if you want to refer to the player team, like in area setups and such. Which in this case is "friendly1".

However 2 undocumented commands crept in there also... i had a idea of letting you name and store flags or variables, and then comparing them with eachother and starting events based on the results. I guess i only got halfway there, so no guarantees how well these work, or if you have any use for them (didnt have time to test them more than just barely)

Im at home i cant access the code, might be a few errors in here.

Basically they work like this, they are called:

-UseVar

Stores, adds multipicates a variable with a number or with another variable

id, store, add, mul, add_var, mul_var, rand, time

-ActivateEventIfVar

Activates an event based on then number in a variable

id

equal

less_than

greater_then

equals_var

less_than_var

greater_than_var

event

<element type="UseVar" id="my_variable" store="5" /> - creates a var called my_variable and sets it =5

<element type="UseVar" id="my_variable" add="2" /> - my_variable = 5 + 2 = 7

<element type="ActivateEventVarIf" id="my_variable" greater_than="6" event="do_stuff" /> - runs and event if my_variable>6

I will have to clarify have this works tomorrow... if anyone is interested.

As i said what i wrote here is just from memory, might not work...

That is great news, many has complained about no flags and variables! I'll list them as well.

EDIT:

Added this on the list so far:

----------------------------------------------------

<element type="UseVar" id="my_variable" store="5" start_time="1.0"/>

<element type="UseVar" id="my_variable" store="5"/>

<element type="UseVar" id="my_variable" add="2"/>

- type => UseVar => creates or manipulates mission variables

- id => name or variable to apply on

- store => sets variable to given value

- add => adds given value to stored value and stores result

- mul => multiplies given value with stored vaule and stores result

- add_var =>

- mul_var =>

- rand =>

- time =>

- start_time => (see first part of tutorial)

----------------------------------------------------

<element type="ActivateEventVarIf" id="my_variable" greater_than="6" event="event_a" start_time="1.0"/> - runs and event if my_variable>6

<element type="ActivateEventVarIf" id="my_variable" less_than="6" event="event_a"/>

- type => ActivateEventVarIf => may trigger event depending on variable value and set conditions

- id => name of variable to check against

- equal => runs event if variable is equal to given value

- less_than => runs event if variable less then given value

- greater_than => runs event if variable greater then given value

- event => event to run if check is true

- equals_var =>

- less_than_var =>

- greater_than_var =>

- start_time => (see first part of tutorial)

Edited by Wolfsong
Link to comment
Share on other sites

Thanks. That does look very promising.

Might I ask a quick related question though? WRT triggers, when exactly are they evaluated. I'm interested particularly in UnitInArea triggers and how they work. Do they remain "tripped" once a unit enters the designated area or is it a flag type system whereby it remains tripped so long as a unit is in the designated area but reverts to untriggered when that unit leaves the area?

e.g. Suppose I set up an area trigger, and then make it a requirement that it be triggered as well as an EnemyGroup trigger to start an event. Now, assume the area trigger is tripped, would the event run the minute the EnemyGroup trigger is satisfied... or... will they have to occur simultaneously for the event to be triggered? i.e. UnitInArea at the same time as the EnemyGroup part is satisfied?

Both have to be satisfied at the same time if you set it up like:

<user name="check_zone_a_and_group_b" type="once">

<trigger type="UnitInArea" area="zone_a"/>

<trigger type="EnemyGroup" name="group_b">

<enemy group_id="group_b" condition="all"/>

</trigger>

<event name="all_clear"/>

</user>

Ok, first area has to activeted before it can be triggered. After that it will check in the interval set for the area if the designated group is there in the amount specified or not. This will continue to update until the area is deactivated, which will also set it to false, and as such prevent the tirgger from every successfully run again if the area isn't reactivated.

And that also leads to the fact that the designated team has to be in the area, which is turned on, at the same time as the enemy group is dead for this trigger to successfully run. the EnemyGroup trigger will also check it's condition whenever it is called for, so that will "remember" if the group has had enough team members killed. Which is why you should always use a trigger set to type="once" when setting it up to only check if a group is dead, or it will continue to trigger in rapid succession.

In this case it would work to have it without the type="once" attribute as you should anyhow deactivate the area as a first thing in the event that it triggers so that it will not continue to check and take processor powers through the rest of the mission, if not needed again that is.

Does that make it clearer?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...