GRIN_Wolfsong Posted November 27, 2006 Share Posted November 27, 2006 Of course you can set up multiple different conditions to trigger an event in GR:AW. Note: What you can't do is use NOT, as in is something hasn't yet happened. But this can be solved with some ugly scripting if it's absolutly needed. AND & OR Conditioned Triggers AND Condition: It's easy to create AND conditioned triggers in GR:AW, as I showed in Scripting 3 you can just stack conditions, but I'll include that here as well. Example: You want "tank01" AND "tank02" to be destroyed AND have "vip" in "helicopter_01" as a trigger condition for the "objective1_completed" event to run. <!--Condition 1, 2 AND 3--> <user name="tanks_gone_and_vip_out" type="once"> <trigger type="Vehicle"> <vehicle id="tank01"/> <vehicle id="tank02"/> </trigger> <trigger type="TeamInTransport" vehicle_id="helicopter_01" group_id="vip"/> <event name="objective1_completed"/> </user> <!--Event To Run--> <event name="objective1_completed"> <element type="..... <element type="..... </event> OR Condition: To make an OR conditioned trigger there is a little more work, but it's still very simple. All you need is 1 trigger for each OR condition and set the event they trigger to only run once. Example: You want "tank01" OR "tank02" to be destroyed OR have "vip" in "helicopter_01" as a trigger condition for the "objective1_completed" event to run. <!--Condition 1--> <user name="tank1_gone" type="once"> <trigger type="Vehicle"> <vehicle id="tank01"/> </trigger> <event name="objective1_completed"/> </user> <!--OR Condition 2--> <user name="tank2_gone" type="once"> <trigger type="Vehicle"> <vehicle id="tank02"/> </trigger> <event name="objective1_completed"/> </user> <!--OR Condition 3--> <user name="vip_out" type="once"> <trigger type="TeamInTransport" vehicle_id="helicopter_01" group_id="vip"/> <event name="objective1_completed"/> </user> <!--Event To Run--> <event name="objective1_completed" once="true"> <element type="..... <element type="..... </event> Note: The important part, as I wrote above, is to add the once="true" part in the event declaration so that it only can be used once everytime the mission is run. When the first condition is triggered it will will the event. The other two will still trigger when they occur, but as the event can only run once, nothing else will happen. AND OR Condition: Of course you see how to combine these, but I'll write an example on this anyhow. Example: You want "tank01" to be destroyed AND have "vip" in "helicopter_01" OR you want "tank02" to be destroyed to be the trigger condition for the "objective1_completed" event to run. <!--Condition 1 & 2--> <user name="tank1_gone_and_vip_out" type="once"> <trigger type="Vehicle"> <vehicle id="tank01"/> </trigger> <trigger type="TeamInTransport" vehicle_id="helicopter_01" group_id="vip"/> <event name="objective1_completed"/> </user> <!--OR Condition 2--> <user name="tank2_gone" type="once"> <trigger type="Vehicle"> <vehicle id="tank02"/> </trigger> <event name="objective1_completed"/> </user> <!--Event To Run--> <event name="objective1_completed" once="true"> <element type="..... <element type="..... </event> Simple as that. Enjoy. Quote Link to comment Share on other sites More sharing options...
Ratte Posted August 6, 2007 Share Posted August 6, 2007 Hi, I have a problem. I want to trigger an event by killing 3 groups, but nothing works I tried these scripts: 1) <area_group name="area1" area_name="area1" group="mp_players" interval="0.3" condition="1"/> <user name="user" type="once"> <trigger type="UnitInArea" area="area1"/> <event name="event1"/> </user> <user name="killed" type="once"> <trigger type="EnemyGroup" name="1"> <enemy group_id="1" condition="all"/> </trigger> <trigger type="EnemyGroup" name="2"> <enemy group_id="2" condition="all"/> </trigger> <trigger type="EnemyGroup" name="3"> <enemy group_id="3" condition="all"/> </trigger> <event name="activate_killed"/> </user> <event name="start_game"> <element type="UnitInArea" area="area1" state="activate" start_time="0.1"></element> </event> <event name="event1"> <element type="ActivateGroup" group_id="1" start_time="2"/> <element type="ActivateGroup" group_id="2" start_time="2"/> <element type="ActivateGroup" group_id="3" start_time="2"/> </event> <event name="activate_killed"> <element type="ActivateVehicle" group_id="car" start_time="0"/> </event> In this case nothing works, no triggering action. but this script is written in the first mission but not used (<!-- ...-->) Then I tried this: 2) .... <user name="killed" type="once"> <trigger type="EnemyGroup" name="1"> <enemy group_id="1" condition="all"/> <enemy group_id="2" condition="all"/> <enemy group_id="3" condition="all"/> </trigger> <event name="activate_killed"/> </user> .... In this case the event triggers but already when team 1 is killed, the others are irrelevant... What I do wrong??? Quote Link to comment Share on other sites More sharing options...
GRIN_Wolfsong Posted August 6, 2007 Author Share Posted August 6, 2007 It should work like this: <user name="killed" type="once"> <trigger type="EnemyGroup" name="abc"> <enemy group_id="group_01" condition="all"/> <enemy group_id="group_02" condition="all"/> <enemy group_id="group_03" condition="all"/> </trigger> <event name="activate_killed"/> </user> I'm a bit rusty on GRAW1 scripting as I didn't really deal with it long. After I had written the guide I was taken in by Grin to work on GRAW2 and the condition system is totally rewritten now to make more sense and be easier to use. Quote Link to comment Share on other sites More sharing options...
Ratte Posted August 12, 2007 Share Posted August 12, 2007 It should work like this: <user name="killed" type="once"> <trigger type="EnemyGroup" name="abc"> <enemy group_id="group_01" condition="all"/> <enemy group_id="group_02" condition="all"/> <enemy group_id="group_03" condition="all"/> </trigger> <event name="activate_killed"/> </user> I'm a bit rusty on GRAW1 scripting as I didn't really deal with it long. After I had written the guide I was taken in by Grin to work on GRAW2 and the condition system is totally rewritten now to make more sense and be easier to use. Yes, i think thats the right scripting, but the problem was: the groups together should not be more than 8 bots !!! however.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.