• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Help with Triggering AI - Guard

Status
Not open for further replies.
Level 5
Joined
Dec 10, 2007
Messages
65
Hi, ive been making a remake of an old game "Escape from Colditz" and i need to make trigger(s) which makes a guard behave in a certain way if certain conditions are met. These triggers need to be multi-instanciable, meaning that it doesnt just work for one guard, but all of the guards / prisoners.
I have already made "area" buffs which are cast to the prisoners when they step into a new area, and also the prisoners have a passive ability which tells them what nationality they are.
All area buffs are based on the "Endurance" Aura.
All nationality buffs are based on the "Bash" passive ability.

1) Guard - Prisoner in Guard uniform
The guard will run up to the prisoner dressed as a guard and stop him to ask for his pass. If he doesnt have a pass, he is sent to solitary confinement (back in original prisoner uniform) with all inventory lost. The guard cant just stop him immediatly, but needs to be a certain distance away before he can stop the prisoner. Also, if the prisoner/guard runs away he can just shoot them (if in range of a shot). The guard shouldnt just shoot straight away if the prisoner moves alittle bit then stops, he should kind of chase them till a certain distance then get out the rifle.

Ive been having trouble with this one as its abit hit and miss, they will run up to you and ask, but if u run away, they wont shoot / follow (trigger at bottom)

2) Guard - Prisoner in restricted area
The guard will run up to the prisoner, and the prisoner will have a "Caught" buff aquired meaning any guard can now chase this prisoner and capture / shoot him. Similar to the first one, but doesnt require a pass because they will just get sent straight to the solitary confinement.

Pretty much the same situation, submitted trigger at bottom.

3) Guard - Prisoner with Caught Buff
The guard will run up to the prisoner and send to solitary confinement, pretty much identical if the prisoner was in a restricted area.

4) Guard - Prisoner in other nationality quarters
A prisoner is in another nationality quarters other than their own, pretty much acts exactly like if in a restricted area.

Havent had the chance to code this one, because of the unsuccess of the other triggers.

5) Guard - Prisoner in Open Access Area at night time
A prisoner is caught in a open access area at night time, results in the same situation for if they were in a restricted area.

Same problem.

I hope someone out there can help me with these triggers because its really starting to frustrate me. I will +rep and add your name to the credits if you are successful in making these triggers work. If you need more help with me describing the actions/conditions required, just post it up and il try and help. If you need to see my triggers in action I can post up the map with it working. The triggers also dont have to be done in GUI, can be done in JAZZ, im just not that great with JAZZ.

If anyone is also wanting to help with other parts of the map, terraining, triggers, testing, general helping i could post up the map and add to the creator of the map (if enough help was given) with joint credit of the final map release :wthumbsup:

Here is some code that ive tried to make work, but its very complicated and doesnt work 100% of the time. Needs alot of work :wsad:

1) Guard - Prisoner in Guard uniform
  • guard uniform pass
    • Events
      • Unit - A unit comes within 700.00 of Nazi Guard (Rifle) 0061 <gen>
    • Conditions
      • ((Triggering player) controller) Not equal to (Neutral Passive controller)
      • ((Triggering player) controller) Not equal to (Player 2 (Blue) controller)
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Nazi Guard (No Rifle)
          • (Unit-type of (Triggering unit)) Equal to Nazi Guard (Rifle)
    • Actions
      • Set Unit_Guard_Prisoner[1] = Nazi Guard (Rifle) 0061 <gen>
      • Set Unit_Guard_Prisoner[2] = (Triggering unit)
      • Set guardPost = (Position of Unit_Guard_Prisoner[1])
      • Unit - Order Unit_Guard_Prisoner[1] to Move To (Position of Unit_Guard_Prisoner[2])
      • Trigger - Turn on guard check starter <gen>
  • guard check starter (Initially off)
    • Events
      • Unit - A unit comes within 400.00 of Nazi Guard (Rifle) 0061 <gen>
    • Conditions
      • ((Triggering player) controller) Not equal to (Neutral Passive controller)
      • ((Triggering player) controller) Not equal to (Player 2 (Blue) controller)
      • Or - Any (Conditions) are true
        • (Unit-type of (Triggering unit)) Equal to Nazi Guard (No Rifle)
        • (Unit-type of (Triggering unit)) Equal to Nazi Guard (Rifle)
    • Actions
      • Trigger - Turn on guard loop checker <gen>
      • Trigger - Turn off guard uniform pass <gen>
      • Trigger - Turn off (This trigger)
  • guard loop checker (initially off)
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
      • Kill Equal to False
    • Actions
      • Set GuardDistance = (Distance between (Position of Unit_Guard_Prisoner[1]) and (Position of Unit_Guard_Prisoner[2])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GuardDistance Less than or equal to 500.00
        • Then - Actions
          • Unit - Order Unit_Guard_Prisoner[1] to Move To (Position of Unit_Guard_Prisoner[2])
          • Wait 2.50 seconds
          • Unit - Order Unit_Guard_Prisoner[1] to Stop
        • Else - Actions
          • Set Kill = True
          • Unit - Order Unit_Guard_Prisoner[1] to Attack Unit_Guard_Prisoner[2]
  • Take Pass or DIE
    • Events
      • Unit - A unit comes within 100.00 of Nazi Guard (Rifle) 0061 <gen>
    • Conditions
      • ((Triggering player) controller) Not equal to (Player 2 (Blue) controller)
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Nazi Guard (No Rifle)
          • (Unit-type of (Triggering unit)) Equal to Nazi Guard (Rifle)
    • Actions
      • Set Kill = False
      • Unit - Order Nazi Guard (Rifle) 0061 <gen> to Stop
      • Trigger - Turn off guard loop checker <gen>
      • Wait 0.02 seconds
      • Game - Display to Player Group - Player 1 (Red) the text: Guard: Stop right there! Hand over your pass!
      • Sound - Play ArrangedTeamInvitation <gen>
      • Unit - Change ownership of (Triggering unit) to Neutral Passive and Retain color
      • Wait 0.02 seconds
      • Selection - select (Triggering unit)
      • Wait 0.02 seconds
      • Unit - Order (Triggering unit) to Stop
      • Wait 1.50 seconds
      • Unit - Make (Triggering unit) face Nazi Guard (Rifle) 0061 <gen> over 1.50 seconds
      • Wait 1.50 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Item carried by (Triggering unit) of type Pass) is owned) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Charges remaining in (Item carried by (Triggering unit) of type Pass)) Equal to 1
            • Then - Actions
              • Item - Remove (Item carried by (Triggering unit) of type Pass)
            • Else - Actions
              • Item - Set charges remaining in (Item carried by (Triggering unit) of type Pass) to ((Charges remaining in (Item carried by (Triggering unit) of type Pass)) - 1)
          • Wait 0.00 seconds
          • Game - Display to Player Group - Player 1 (Red) the text: You have been ordered to hand over a pass.
          • Wait 0.00 seconds
          • Sound - Play QuestCompleted <gen>
          • Wait 1.50 seconds
          • Unit - Order Nazi Guard (Rifle) 0061 <gen> to Move To guardPost
          • Wait 1.00 seconds
          • Unit - Change ownership of (Triggering unit) to Player 1 (Red) and Retain color
          • Wait 0.02 seconds
          • Selection - Select (Triggering unit)
          • Wait 0.02 seconds
          • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally
          • Wait 10.00 seconds
          • Trigger - Turn on guard uniform pass <gen>
        • Else - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: You have been caught without a pass and been sent to solitary confinement.
          • Wait 0.00 seconds
          • Sound - Play QuestFailed <gen>
          • Wait 1.50 seconds
          • Unit - Move (Triggering unit) instantly to (Center of solitaryCELL10 <gen>)
          • Wait 0.02 seconds
          • Camera - Pan camera for Player 1 (Red) to (Center of solitaryCELL10 <gen>) over 0.00 seconds
          • Wait 0.02 seconds
          • Unit - Change ownership of (Triggering unit) to Player 1 (Red) and Retain color
          • Wait 0.02 seconds
          • Unit - Replace (Triggering unit) with a Prisoner (Male 2) using The old unit's relative life and mana
          • Wait 0.02 seconds
          • Selection - Select (Last replaced unit)
          • Wait 0.02 seconds
          • Sound - Play BattleNetDoorsStereo2 <gen>
          • Wait 0.02 seconds
          • Trigger - Turn on guard uniform pass <gen>

2) Guard - Prisoner in restricted area
  • prisoner restricted
    • Events
      • Unit - A unit comes within 700.00 of Nazi Guard (Rifle) 0131 <gen>
    • Conditions
      • ((Triggering player) controller) Not equal to (Neutral Passive controller)
      • ((Triggering player) controller) Not equal to (Player 2 (Blue) controller)
      • (Unit-type of (Triggering unit)) Equal to Prisoner (Male 2)
      • Or - Any (Conditions) are true
        • Conditions
          • ((Triggering unit) has buff Caught ) Equal to True
          • ((Triggering unit) has buff Restricted Area ) Equal to True
    • Actions
      • Set Unit_Guard_Prisoner[1] = Nazi Guard (Rifle) 0131 <gen>
      • Set Unit_Guard_Prisoner[2] = (Triggering unit)
      • Set guardPost = (Position of Unit_Guard_Prisoner[1])
      • Unit - Order Unit_Guard_Prisoner[1] to Move To (Position of Unit_Guard_Prisoner[2])
      • Unit - Add Caught (Endurance Aura) to (Triggering unit)
      • Trigger - Turn on prisoner check starter
  • prisoner check starter (initially off)
    • Events
      • Unit - A unit comes within 400.00 of Nazi Guard (Rifle) 0131 <gen>
    • Conditions
      • ((Triggering player) controller) Not equal to (Neutral Passive controller)
      • ((Triggering player) controller) Not equal to (Player 2 (Blue) controller)
      • (Unit-type of (Triggering unit)) Equal to Prisoner (Male 2)
    • Actions
      • Trigger - Turn on prisoner loop checker <gen>
      • Trigger - Turn off prisoner restricted <gen>
      • Trigger - Turn off (This trigger)
  • prisoner loop checker (Initially off)
    • Conditions
      • Kill Equal to False
    • Actions
      • Set GuardDistance = (Distance between (Position of Unit_Guard_Prisoner[1]) and (Position of Unit_Guard_Prisoner[2])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Guard Distance Less then or equal to 500.00
        • Then - Actions
          • Unit - Order Unit_Guard_Prisoner[1] to Move To (Position of Unit_Guard_Prisoner[2])
          • Wait 2.50 seconds
          • Unit - Order Unit_Guard_Prisoner[1] to Stop
        • Else - Actions
          • Set Kill = True
          • Unit - Order Unit_Guard_Prisoner[1] to Attack Unit_Guard_Prisoner[2]
  • Send to solitary
    • Events
      • Unit - A unit comes within 100.00 of Nazi Guard (Rifle) 0131 <gen>
    • Conditions
      • ((Triggering player) controller) Not equal to (Player 2 (Blue) controller)
      • (Unit-type of (Triggering unit)) Equal to Prisoner (Male 2)
      • ((Triggering unit) has buff Caught ) Equal to True
    • Actions
      • Set Kill = False
      • Unit - Order Nazi Guard (Rifle) 0131 <gen> to Stop
      • Trigger - Turn off prisoner loop checker <gen>
      • Wait 0.02 seconds
      • Game - Display to Player Group - Player 1 (Red) the text: Guard: Stop right there! You are in a Restricted Area!
      • Sound - Play ArrangedTeamInvitation <gen>
      • Unit - Change ownership of (Triggering unit) to Neutral Passive and Retain color
      • Wait 0.02 seconds
      • Selection - Select (Triggering unit)
      • Wait 0.02 seconds
      • Unit - Order (Triggering unit) to Stop
      • Wait 1.50 seconds
      • Unit - Make (Triggering unit) face Nazi Guard (Rifle) 0131 <gen> over 1.50 seconds
      • Wait 1.50 seconds
      • Game - Display to Player Group - Player 1 (Red) the text: You have been caught in a restricted area and been sent to solitary confinement.
      • Wait 0.00 seconds
      • Sound - Play QuestFailed <gen>
      • Wait 1.50 seconds
      • Unit - Move (Triggering unit) instantly to (Center of solitaryCELL10 <gen>)
      • Wait 0.02 seconds
      • Camera - Pan camera for Player 1 (Red) to (Center of solitaryCELL10 <gen>) over 0.00 seconds
      • Wait 0.02 seconds
      • Unit - Change ownership of (Last replaced unit) to Player 1 (Red) and Retain color
      • Wait 0.02 seconds
      • Selection - Select (Last replaced unit)
      • Wait 0.02 seconds
      • Sound - Play BattleNetDoorsStereo2 <gen>
      • Wait 0.02 seconds
      • Trigger - Turn on guard uniform pass <gen>
 
Level 6
Joined
Nov 28, 2007
Messages
203
Actually, i thought that it wouldn't.
In the last trigger: "Last Replaced Unit"??? Where do you replace a unit? If you don't replace a unit, then what unit should change ownership and be selected? If it's the unit that 'Comes within 100 of blablabla..' , then just set it to "Triggering unit".

[EDIT]: aha.. it's at the "Take Pass or DIE" trigger. If this map is singleplayer, then it should work.

Checking for other wrong things.
 
Level 5
Joined
Dec 10, 2007
Messages
65
But thats the thing, i need it to be "Multi-instanciable" which means, doesnt just work for one player, but all players (and all guards). Like i said before, it does work some of the time, but the guard wont chase you and kill you, its just really needs work. May have to do with the periodic timer, frustraiting trigger. :hohum:
 
Level 6
Joined
Nov 28, 2007
Messages
203
I think I can re-do all triggers into one and make it MUI O_O (It will be a long one, though :grin:)
I'll post here soon if it succeeds/fails.

[EDIT]: With soon i mean in like.. 72 hours >.< Need to get some sleep now.

[EDIT2]: Half of the trigger is done

[EDIT3]: Almost done :D

[EDIT4]: Last part now...

[EDIT5]: Last function now!!!!!

[EDIT6]: Done!! Now i'm just gonna check through the trigger and change wrong stuff..

[EDIT7]: Here's that frustrating trigger (Lets just hope it works :wgrin:):

  • Guard Prisoner Trigger
    • Events
      • Unit - A unit comes within 700.00 of Nazi Guard (Rifle) 0061 0001 <gen>
      • Unit - A unit comes within 400.00 of Nazi Guard (Rifle) 0061 0001 <gen>
      • Unit - A unit comes within 100.00 of Nazi Guard (Rifle) 0061 0001 <gen>
      • Unit - A unit comes within 700.00 of Nazi Guard (Rifle) 0131 0000 <gen>
      • Unit - A unit comes within 400.00 of Nazi Guard (Rifle) 0131 0000 <gen>
      • Unit - A unit comes within 100.00 of Nazi Guard (Rifle) 0131 0000 <gen>
    • Conditions
    • Actions
      • -------- *guard uniform pass* --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in (Units within 700.00 of (Position of Nazi Guard (Rifle) 0061 0001 <gen>))) Equal to True
          • (Owner of (Triggering unit)) Not equal to Neutral Passive
          • (Owner of (Triggering unit)) Not equal to Player 2 (Blue)
          • GuardUniformPass_ONOFF[(Player number of (Owner of (Triggering unit)))] Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Nazi Guard (No Rifle)
              • (Unit-type of (Triggering unit)) Equal to Nazi Guard (Rifle)
        • Then - Actions
          • Set Player_Main_Unit[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
          • Set Last_Guard[(Player number of (Owner of (Triggering unit)))] = Nazi Guard (Rifle) 0061 0001 <gen>
          • Set guardPost = (Position of Last_Guard[(Player number of (Owner of (Triggering unit)))])
          • Unit - Order Last_Guard[(Player number of (Owner of (Triggering unit)))] to Move To (Position of Player_Main_Unit[(Player number of (Owner of (Triggering unit)))])
          • -------- "Turning On" *guard check starter* --------
          • Set GuardCheckStarter_ONOFF[(Player number of (Owner of (Triggering unit)))] = True
          • -------- Reducing Lag --------
          • Skip remaining actions
        • Else - Actions
      • -------- *guard check starter* --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in (Units within 400.00 of (Position of Nazi Guard (Rifle) 0061 0001 <gen>))) Equal to True
          • (Owner of (Triggering unit)) Not equal to Neutral Passive
          • (Owner of (Triggering unit)) Not equal to Player 2 (Blue)
          • GuardCheckStarter_ONOFF[(Player number of (Owner of (Triggering unit)))] Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Nazi Guard (No Rifle)
              • (Unit-type of (Triggering unit)) Equal to Nazi Guard (Rifle)
        • Then - Actions
          • Set Player_Main_Unit[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
          • Set Last_Guard[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
          • Set guardPost = (Position of Last_Guard[(Player number of (Owner of (Triggering unit)))])
          • Unit - Order Last_Guard[(Player number of (Owner of (Triggering unit)))] to Move To (Position of Player_Main_Unit[(Player number of (Owner of (Triggering unit)))])
          • -------- "Turning On" *Kill loop checker* --------
          • Set KillLoopChecker_ONOFF[(Player number of (Owner of (Triggering unit)))] = True
          • -------- "Turning Off" *guard uniform pass* --------
          • Set GuardUniformPass_ONOFF[(Player number of (Owner of (Triggering unit)))] = False
          • -------- "Turning Off" *This Trigger* --------
          • Set GuardCheckStarter_ONOFF[(Player number of (Owner of (Triggering unit)))] = False
          • -------- Reducing Lag --------
          • Skip remaining actions
        • Else - Actions
      • -------- *Take Pass or DIE* --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in (Units within 100.00 of (Position of Nazi Guard (Rifle) 0061 0001 <gen>))) Equal to True
          • (Owner of (Triggering unit)) Not equal to Player 2 (Blue)
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Nazi Guard (No Rifle)
              • (Unit-type of (Triggering unit)) Equal to Nazi Guard (Rifle)
        • Then - Actions
          • Set Kill[(Player number of (Owner of (Triggering unit)))] = False
          • Unit - Order Nazi Guard (Rifle) 0061 0001 <gen> to Stop
          • -------- "Turning On" *Kill loop checker* --------
          • Set KillLoopChecker_ONOFF[(Player number of (Owner of (Triggering unit)))] = False
          • Wait 0.02 seconds
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Guard: Stop right t...
          • Sound - Play ArrangedTeamInvitation <gen>
          • Unit - Change ownership of (Triggering unit) to Neutral Passive and Retain color
          • Wait 0.02 seconds
          • Selection - Select (Triggering unit) for (Owner of (Triggering unit))
          • Wait 0.02 seconds
          • Unit - Order (Triggering unit) to Stop
          • Wait 1.50 seconds
          • Unit - Make (Triggering unit) face Nazi Guard (Rifle) 0061 0001 <gen> over 1.50 seconds
          • Wait 1.50 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has an item of type Pass) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Charges remaining in (Item carried by (Triggering unit) of type Pass)) Greater than or equal to 1
                • Then - Actions
                  • Item - Set charges remaining in (Item carried by (Triggering unit) of type Pass) to ((Charges remaining in (Item carried by (Triggering unit) of type Pass)) - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Charges remaining in (Item carried by (Triggering unit) of type Pass)) Less than 1
                    • Then - Actions
                      • Item - Remove (Item carried by (Triggering unit) of type Pass)
                    • Else - Actions
                • Else - Actions
                  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You have been order...
                  • Sound - Play QuestCompleted <gen>
                  • Wait 1.50 seconds
                  • Unit - Order Nazi Guard (Rifle) 0061 0001 <gen> to Move To guardPost
                  • Wait 1.00 seconds
                  • Unit - Change ownership of (Triggering unit) to (Owner of (Triggering unit)) and Retain color
                  • Wait 0.02 seconds
                  • Selection - Select (Triggering unit) for (Owner of (Triggering unit))
                  • Wait 0.02 seconds
                  • Player - Make Player 2 (Blue) treat (Owner of (Triggering unit)) as an Ally
                  • Wait 10.00 seconds
                  • -------- "Turning On" *guard uniform pass* --------
                  • Set GuardUniformPass_ONOFF[(Player number of (Owner of (Triggering unit)))] = True
            • Else - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You have been caugh...
              • Sound - Play QuestFailed <gen>
              • Wait 1.50 seconds
              • Unit - Move (Triggering unit) instantly to (Center of solitaryCELL10 <gen>)
              • Wait 0.02 seconds
              • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of solitaryCELL10 <gen>) over 0.00 seconds
              • Wait 0.02 seconds
              • Unit - Change ownership of (Triggering unit) to (Owner of (Triggering unit)) and Retain color
              • Wait 0.02 seconds
              • Unit - Replace (Triggering unit) with a Prisoner (Male 2) using The old unit's relative life and mana
              • Set LastReplacedUnit[(Player number of (Owner of (Triggering unit)))] = (Last replaced unit)
              • Wait 0.02 seconds
              • Selection - Select LastReplacedUnit[(Player number of (Owner of (Triggering unit)))] for (Owner of (Triggering unit))
              • Wait 0.02 seconds
              • Sound - Play BattleNetDoorsStereo2 <gen>
              • Wait 0.02 seconds
              • -------- "Turning On" *guard uniform pass* --------
              • Set GuardUniformPass_ONOFF[(Player number of (Owner of (Triggering unit)))] = True
          • -------- Reducing Lag --------
          • Skip remaining actions
        • Else - Actions
      • -------- *prisoner restricted* --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in (Units within 700.00 of (Position of Nazi Guard (Rifle) 0131 0000 <gen>))) Equal to True
          • (Owner of (Triggering unit)) Not equal to Player 2 (Blue)
          • (Owner of (Triggering unit)) Not equal to Neutral Passive
          • (Unit-type of (Triggering unit)) Equal to Prisoner (Male 2)
          • PrisonerRestricted_ONOFF[(Player number of (Owner of (Triggering unit)))] Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • ((Triggering unit) has buff Caught) Equal to True
              • ((Triggering unit) has buff RestrictedArea) Equal to True
        • Then - Actions
          • Set Last_Guard[(Player number of (Owner of (Triggering unit)))] = Nazi Guard (Rifle) 0131 0000 <gen>
          • Set Player_Main_Unit[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
          • Set guardPost = (Position of Last_Guard[(Player number of (Owner of (Triggering unit)))])
          • Unit - Order Last_Guard[(Player number of (Owner of (Triggering unit)))] to Move To (Position of Player_Main_Unit[(Player number of (Owner of (Triggering unit)))])
          • Unit - Add CaughtEnduranceAura to (Triggering unit)
          • -------- "Turning On" *prisoner check starter* --------
          • Set PrisonerCheckStarter_ONOFF[(Player number of (Owner of (Triggering unit)))] = True
          • -------- Reducing Lag --------
          • Skip remaining actions
        • Else - Actions
      • -------- *prisoner check starter* --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in (Units within 400.00 of (Position of Nazi Guard (Rifle) 0131 0000 <gen>))) Equal to True
          • (Owner of (Triggering unit)) Not equal to Player 2 (Blue)
          • (Owner of (Triggering unit)) Not equal to Neutral Passive
          • (Unit-type of (Triggering unit)) Equal to Prisoner (Male 2)
          • PrisonerCheckStarter_ONOFF[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • -------- "Turning On" *Kill loop checker* --------
          • Set KillLoopChecker_ONOFF[(Player number of (Owner of (Triggering unit)))] = True
          • -------- "Turning Off" *prisoner restricted* --------
          • Set PrisonerRestricted_ONOFF[(Player number of (Owner of (Triggering unit)))] = False
          • -------- "Turning Off" *This Trigger* --------
          • Set PrisonerCheckStarter_ONOFF[(Player number of (Owner of (Triggering unit)))] = False
          • -------- Reducing Lag --------
          • Skip remaining actions
        • Else - Actions
      • -------- *Send to solitary* --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in (Units within 100.00 of (Position of Nazi Guard (Rifle) 0131 0000 <gen>))) Equal to True
          • (Owner of (Triggering unit)) Not equal to Player 2 (Blue)
          • (Unit-type of (Triggering unit)) Equal to Prisoner (Male 2)
          • ((Triggering unit) has buff Caught) Equal to True
        • Then - Actions
          • Set Kill[(Player number of (Owner of (Triggering unit)))] = False
          • Unit - Order Nazi Guard (Rifle) 0131 0000 <gen> to Stop
          • -------- "Turning Off" *kill loop checker* --------
          • Set KillLoopChecker_ONOFF[(Player number of (Owner of (Triggering unit)))] = False
          • Wait 0.02 seconds
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: Guard: Stop right t...
          • Sound - Play ArrangedTeamInvitation <gen>
          • Unit - Change ownership of (Triggering unit) to Neutral Passive and Retain color
          • Wait 0.02 seconds
          • Selection - Select (Triggering unit) for (Owner of (Triggering unit))
          • Wait 0.02 seconds
          • Unit - Order (Triggering unit) to Stop
          • Wait 1.50 seconds
          • Unit - Make (Triggering unit) face Nazi Guard (Rifle) 0131 0000 <gen> over 1.50 seconds
          • Wait 1.50 seconds
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You have been caugh...
          • Sound - Play QuestFailed <gen>
          • Wait 1.50 seconds
          • Unit - Move (Triggering unit) instantly to (Center of solitaryCELL10 <gen>)
          • Wait 0.02 seconds
          • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of solitaryCELL10 <gen>) over 0.00 seconds
          • Wait 0.02 seconds
          • Unit - Change ownership of (Triggering unit) to (Owner of (Triggering unit)) and Retain color
          • Wait 0.02 seconds
          • Selection - Select (Triggering unit) for (Owner of (Triggering unit))
          • Wait 0.02 seconds
          • Sound - Play BattleNetDoorsStereo2 <gen>
          • Wait 0.02 seconds
          • -------- "Turning On" *guard uniform pass* --------
          • Set GuardUniformPass_ONOFF[(Player number of (Owner of (Triggering unit)))] = True
        • Else - Actions
[EDIT8]: Hey, i forgot one trigger (did 2 triggers because of that it should reduce lag. alot):
  • Kill loop checker
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • -------- *Kill loop checker* --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KillLoopChecker_ONOFF[(Player number of (Owner of (Triggering unit)))] Equal to True
          • Kill[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set GuardDistance[(Player number of (Owner of (Triggering unit)))] = (Distance between (Position of Player_Main_Unit[(Player number of (Owner of (Triggering unit)))]) and (Position of Last_Guard[(Player number of (Owner of (Triggering unit)))]))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GuardDistance[(Player number of (Owner of (Triggering unit)))] Less than or equal to 500.00
            • Then - Actions
              • Unit - Order Last_Guard[(Player number of (Owner of (Triggering unit)))] to Move To (Position of Player_Main_Unit[(Player number of (Owner of (Triggering unit)))])
              • Wait 2.50 seconds
              • Unit - Order Last_Guard[(Player number of (Owner of (Triggering unit)))] to Stop
            • Else - Actions
              • Set Kill[(Player number of (Owner of (Triggering unit)))] = True
              • Unit - Order Last_Guard[(Player number of (Owner of (Triggering unit)))] to Attack Player_Main_Unit[(Player number of (Owner of (Triggering unit)))]
        • Else - Actions
[EDIT9]: Edited some "triggering player" errors ^^
 
Last edited:
Level 5
Joined
Dec 10, 2007
Messages
65
particular guard?

I noticed that this only triggers for the event of one particular guard, im guessing that their isnt a way to make it for all guards, or will i have to copy and paste - changing for each guard?

[Edit] - never mind, i just saw the event for a second guard, so im guessing all i do is copy for each guard the 700,400,100 events to each. cheers man, going to test it now and will post up the results.

[Edit 2] - uh, for the second trigger it relies on "Owner of triggering unit" but it doesnt have anywhere in the events where it calls this, maybe store an integer of the player number in a integer variable array (and obviously set it in the previous trigger). Other than that, the other trigger looks good so far, i havent tested it in war3 yet, so il try n figure out this last one then try.

[Edit 3] - what ive done is made a for loop (between 1 & 8) and replaced owner of trig unit with "integer A". Testing triggers now, hopefully will work.

[Edit 4] - Ive tested it, and bad news. Its worse than what i started with, sorry but i might try and tweak with what triggers i had, instead of one big trigger, its prob better having separate triggers.
 
Last edited:
Level 6
Joined
Nov 28, 2007
Messages
203
[Edit 2] - uh, for the second trigger it relies on "Owner of triggering unit" but it doesnt have anywhere in the events where it calls this, maybe store an integer of the player number in a integer variable array (and obviously set it in the previous trigger). Other than that, the other trigger looks good so far, i havent tested it in war3 yet, so il try n figure out this last one then try.
eh.. :grin: i first had it in the first trigger and copied all, but forgot to change the triggering unit :S

[Edit 3] - what ive done is made a for loop (between 1 & 8) and replaced owner of trig unit with "integer A". Testing triggers now, hopefully will work.
That would work.

[Edit 4] - Ive tested it, and bad news. Its worse than what i started with, sorry but i might try and tweak with what triggers i had, instead of one big trigger, its prob better having separate triggers.
Damn :hohum:
The two-trigger thing was just an extra, so if you haven't thought of this, you can do:
Just copy the actions&conditions from my trigger and split them into many triggers. (replace the boolean actions with "turn trigger on/off" and remove the boolean conditions that checks if it's on or off)
 
Level 5
Joined
Jan 15, 2007
Messages
199
humpadumpa, if you post a trigger that long, please post it converted, even if it is in the GUI forum. It will take a RIDICULOUSLY long time to put copy all that in gui. If you post after you convert to custom text, they can convert an empty GUI trigger to JASS, then paste in, and press undo convert trigger. It will convert it all back to the GUI, and will only take about 10 seconds instead of 2 hours.
 
Status
Not open for further replies.
Top