Like I did 5 years ago, I'll try to write up some helping texts on scripting.
I'll be using XML found in the mission.xml file. Much in the mission.xml refers to entires found in the world.xml, which is created by the map editor. Those are the "physical" names set to objects, all other names see here is just names used between scripts inside the mission.xml.
How To show units triggered by player in a zoneItems needed from map editor:
- 1x area (I called it area_intel)
- 1x human (I called the group intel_group01)
Define A Trigger Zone For Player (place in beginning of script_data, after include)[color="RoyalBlue"]
[/color]
- name => what you call it (use same as area_name)
- area_name => name given to area in editor
- group_id => who can trigger it? ("friendly1" == mitchell/server, "mp_players" == all players MP, "players" == all ghosts SP/MP, or any group_id set for a human/humans in the map editor)
- interval => seconds between checks
- condition => how many from group_id is needed?
NOTE: If you want a vehicle to trigger an area just replace group_id with vehicle_id and enter the name of the vehilce as defined in the map editor. You also have to remove the condition variable. Like in this example:
[color="RoyalBlue"]
[/color]
Activate Trigger Zone (place in an event, example in if active from beginning )[color="RoyalBlue"]
[/color]
- type => what action to take, UnitInArea check selected
- area => ok, which UnitInArea check?, area_group defined earlier
- state => what to do with it?, activate/deactivate
- start_time => when?, seconds delay after event executed
Create Trigger For Player In Zone[color="RoyalBlue"]
[/color]
- Define trigger/condition to run
- type => what will trigger it? ("UnitInArea == zone trigger)
- area => which defined area_group?
[color="RoyalBlue"][/color]
What will happen?
- name => event to run if trigger ok
[color="RoyalBlue"][/color]
Create Event To Run When Zone Is Triggered[color="RoyalBlue"]
[/color]
- name => name to call to run event
[color="RoyalBlue"][/color]
Prevents zone being activated again by deactivating it
- type => what action to take, UnitInArea check selected
- area => which UnitInArea check?, area_group defined earlier
- state => activate/deactivate
[color="RoyalBlue"][/color]
Activate group of humans, make them visible and start their given actions
- type => what action to take, "ActivateGroup"
- group_id => ok then, which group?
- start_time => when?, seconds delay after event executed
.
. (add as many elements as you want, all executes when "show_area_intel" in run)
.
[color="RoyalBlue"][/color]
And the clean XML code with only overview comments:
[color="RoyalBlue"]
[/color]
[color="RoyalBlue"]
[/color]
[color="RoyalBlue"]
[/color]
[color="RoyalBlue"]
[/color]