ThePlatoon.com
December 03, 2008, 12:13:36 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Look around and get acquainted to the new settings and features.
 
  Home   Forum   Help Search Calendar Login Register  
  Shop Gallery  
Pages: [1]   Go Down
  Print  
Author Topic: GR:AW SP Scripting 1  (Read 758 times)
0 Members and 1 Guest are viewing this topic.
Wolfsong
One with nature...
Administrator
Sr. Member
*****

Rep: 7
Offline Offline

Posts: 518
1933.00 credits

View Inventory
Send Money to Wolfsong

75672554 WolfsongSwe@Hotmail.com
View Profile WWW
« on: November 29, 2006, 08:29:23 AM »

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.

Quote
How To show units triggered by player in a zone

Items 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]
Logged

---===[ STAFF ]===---
Lead Technical Artist at Grin Inc.
Current Projects:
- Bionic Commando (PC/PS3/360)
- Bionic Commando - Rearmed (PC/PSN/XBL)
- Wanted (PC/PS3/360)
- Terminator: Salvation
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
SMF Theme © Gaia
Valid XHTML 1.0! Valid CSS!