Jump to content

GRAW SP Scripting 3


Recommended Posts

And another one. :D

Triggers

General Triggers(Users) Syntax

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

- name => name of user/trigger

- type => number of times it can be successfully executed

</user>

General Info About Group_ID

"friendly1" => mitchell/server

"friendly2" => kirkland

"friendly3" => allen

"friendly4" => brown

"mp_players" => all players in MP

"players" => all ghosts SP/MP

or any group_id defined for a human/humans in the map editor

Trigger Conditions Short List

- UnitInArea => Unit In Zone Trigger

- Vehicle => Destroyed Vehicle Trigger

- UnitDestroyed => Destroyed Prop Or Static Trigger

- EnemyGroup => Human Killed Trigger (not just for enemies ;) )

- HeliCleared => Group Cleared Helicopter Trigger

- TransportCleared => Group Cleared Ground Vehicle Trigger

- TeamInTransport => Group In Ground Vehicle Trigger

- TeamMemberJoined=> There Is One More...

Trigger Conditions Description List

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

Unit In Zone Trigger (as described in the first tutorial)

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

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

- type => define that it's a unit in area trigger

- area => which defined area_group?

<event name="show_area_intel"/>

- name => which event to run if condition is true

</user>

Clean Code:

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

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

<event name="show_area_intel"/>

</user>

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

Many Units In Different Zone/Zones Trigger

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

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

- type => define that it's a unit in area trigger

- area => which first defined area_group?

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

- type => define that it's a unit in area trigger

- area => which second defined area_group?

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

- type => define that it's a unit in area trigger

- area => which third defined area_group?

<event name="everyone_in_place"/>

- name => which event to run if condition is true

</user>

Clean Code:

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

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

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

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

<event name="everyone_in_place"/>

</user>

NOTE: For all triggers that doesn't have a closing tag you can just add them after each other. In this case three area checks.

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

Destroyed Vehicle Trigger

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

<trigger type="Vehicle">

- type => define that it's vehicle based trigger, if the defined vehicle is destroyed the condition is true

<vehicle id="vehicle01"/>

- id => which vehicle is the trigger for?, use vehicle_id set for the vehicle in the map editor

</trigger>

<event name="destroy_vehicle01"/>

- name => which event to run if condition is true

</user>

Clean Code:

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

<trigger type="Vehicle">

<vehicle id="vehicle01"/>

</trigger>

<event name="destroy_vehicle01"/>

</user>

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

Destroyed Two Vehicles Trigger

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

<trigger type="Vehicle">

- type => define that it's vehicle based trigger, if the defined vehicle is destroyed the condition is true

<vehicle id="vehicle01"/>

- id => which is the first vehicle?, use vehicle_id set for the vehicle in the map editor

<vehicle id="vehicle02"/>

- id => which is the second vehicle?, use vehicle_id set for the vehicle in the map editor

</trigger>

<event name="destroy_both_vehicles"/>

- name => which event to run if both the above condition are true

</user>

Clean Code:

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

<trigger type="Vehicle">

<vehicle id="vehicle01"/>

<vehicle id="vehicle02"/>

</trigger>

<event name="destroy_both_vehicles"/>

</user>

NOTE: For all triggers that have a closing tag you can add any number of the required input as you want. In this case two vehicles.

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

Destroyed Prop Or Static Trigger

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

<trigger type="UnitDestroyed" id="main_prop"/>

- type => define that it's a unit destroyed trigger (props and statics are called units in world.xml)

- id => which prop or static is the trigger for?, use name_id set for the prop or static in the map editor

<event name="remove_main_prop"/>

- name => which event to run if the above condition is true

</user>

Clean Code:

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

<trigger type="UnitDestroyed" id="main_prop"/>

<event name="remove_main_prop"/>

</user>

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

Human Killed Trigger

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

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

- type => define that it's group kill trigger

- name => name of trigger (use same as group_id for which the trigger concerns)

<enemy group_id="alpha_squad" condition="4"/>

- group_id => which group is the trigger for? (see first part of tutorial)

- condition => how many has to be killed? Any number, or just "all" if you want that

</trigger>

<event name="launch_counter_attack"/>

- name => which event to run if the above condition is true

</user>

Clean Code:

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

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

<enemy group_id="alpha_squad" condition="4"/>

</trigger>

<event name="launch_counter_attack"/>

</user>

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

Group Cleared Helicopter Trigger

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

<trigger type="HeliCleared" vehicle_id="blackhawk01" group_id="friendly1"/>

- type => define that it's a cleared helicopter trigger

- vehicle_id => which helicopter does it concern?, use vehicle_id set for the vehicle in the map editor

- group_id => who has to be clear? (see first part of tutorial)

<event name="after_crash"/>

- name => which event to run if the above condition is true

</user>

Clean Code:

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

<trigger type="HeliCleared" vehicle_id="blackhawk01" group_id="friendly1"/>

<event name="after_crash"/>

</user>

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

Group Cleared Ground Vehicle Trigger

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

<trigger type="TransportCleared" vehicle_id="apc01" group_id="friendly1"/>

- type => define that it's a team out of vehicle trigger

- vehicle_id => which vehicle doea it concern?, use vehicle_id set for the vehicle in the map editor

- group_id => who has to be outside? (see first part of tutorial)

<event name="objective1"/>

- name => which event to run if the above condition is true

</user>

Clean Code:

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

<trigger type="TransportCleared" vehicle_id="apc01" group_id="friendly1"/>

<event name="objective1"/>

</user>

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

Group In Ground Vehicle Trigger

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

<trigger type="TeamInTransport" vehicle_id="apc01" group_id="friendly1"/>

- type => define that it's a team in vehicle trigger

- vehicle_id => which vehicle doea it concern?, use vehicle_id set for the vehicle in the map editor

- group_id => who has to be inside? (see first part of tutorial)

<event name="end_mission"/>

- name => which event to run if the above condition is true

</user>

Clean Code:

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

<trigger type="TeamInTransport" vehicle_id="apc01" group_id="friendly1"/>

<event name="end_mission"/>

</user>

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

There Is One More...

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

<trigger type="TeamMemberJoined" group_id="friendly1" condition="3"/>

- type => define check if another member has been added to the team

- group_id => to which group? (see first part of tutorial)

- condition => ??

<event name="team_grows"/>

- name => which event to run if the above condition is true

</user>

Clean Code:

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

<trigger type="TeamMemberJoined" group_id="friendly1" condition="3"/>

<event name="team_grows"/>

</user>

NOTE: This is used together with some special elements in the into mission only:

<element type="SetAiGetUp" group_id="friendly4" start_time="0.0"/>

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

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

Examples On Combining Different Trigger Types

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

<trigger type="Vehicle">

<vehicle id="tank01"/>

<vehicle id="tank02"/>

<vehicle id="tank03"/>

</trigger>

<trigger type="TeamInTransport" vehicle_id="helicopter_01" group_id="vip"/>

<event name="destroyed_tanks"/>

</user>

NOTE: All you have to do is line them up one after the other. Just remember to close the triggers that require those tags.

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

Solution If You Don't Want To Allow Any Caualties

Check If Kirkland Is Dead

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

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

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

</trigger>

<event name="member_dead"/>

</user>

Check If Allen Is Dead

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

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

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

</trigger>

<event name="member_dead"/>

</user>

Check If Brown Is Dead

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

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

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

</trigger>

<event name="member_dead"/>

</user>

If Anyone Is Dead, End Game

<event name="member_dead">

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

</event>

That will be it for today. It should get all you scripters out there going a long long way. All that is left are all teh different elements and also the scripts for the fancy addons like insertions, compositions and such. I'll post it when I've untangled it enough. 0:) Enjoy for now.

EDIT: Added short list for quicker overview of what is available.

Edited by Wolfsong
Link to comment
Share on other sites

  • 5 weeks later...

Ok. For the old GR1 modders, here is a translation of the available trigger types in GR1 to those in GR:AW, when there is an available alternative.

TRIGGER TRANSLATOR - GR to GR:AW

GR1 - GR:AW

ActorFired - (n/a)

Black - (n/a)

Call - (not needed, call event directly)

DeathActor - EnemyGroup

DeathAnyActor - EnemyGroup

DeathCompany - EnemyGroup

DeathCompanyMember - EnemyGroup

DeathPlatoon - EnemyGroup

DeathPlatoonMember - EnemyGroup

DeathTeam - EnemyGroup

DeathTeamMember - EnemyGroup

DeathVehicle - Vehicle

DemoChargePlaced - (not needed, use special c4 trigger events)

DoorOpened - (not needed, no doors to open)

DoorClosed - (not needed, no doors to close)

EscortAborted - (n/a)

EscortCompleted - (n/a)

EscortInitiated - (n/a)

LoopActors - (n/a)

LoopCompanies - (n/a)

LoopPlatoons - (n/a)

LoopTeams - (n/a)

MapObjectDestroyed - UnitDestroyed

NoPlayerLeft - EnemyGroup

PreAction - (not needed, use special start_mission event)

ProximityActor - UnitInArea

ProximityCompany - UnitInArea

ProximityPlatoon - UnitInArea

ProximityTeam - UnitInArea

ProximityVehicle - UnitInArea

Respawn - (n/a)

RoutActor - EnemyGroup

RoutCompany - EnemyGroup

RoutPlatoon - EnemyGroup

RoutTeam - EnemyGroup

SkipCinematic - (not needed, uses special mission script file)

Startup - (not needed, use special start_mission event)

TimeElapsed - (not needed, call event directly)

TimerExpired - (not needed, call event directly)

TimerExpiredForGame - (n/a)

UICommandModeActivated - (n/a)

UIFireFieldSet - (n/a)

UIROESet - (n/a)

UITeamSelected - (n/a)

UIWaypointSet - (n/a)

(n/a) - TeamInTransport

(n/a) - HeliCleared

(n/a) - TransportCleared

(n/a) - TeamMemberJoined

I actually don't remember how we detected for people in vehicles in GR1? Can anyone fill me in?

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