Trigger Help

Status
Not open for further replies.
Level 1
Joined
Sep 18, 2010
Messages
2
I am making a game where you are the Naga, I have the first cutscene, but what i want is when he kills 2 towers, another cutscene happens, if anyone can help, thank you:vw_wtf::goblin_jawdrop:
 
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units of type Tower) and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to TowersGroup
  • Trigger2
  • Events
    • Unit - A unit dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to Tower
    • ((Killing unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
  • Actions
    • Unit Group - Remove (Triggering unit) from TowersGroup
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Number of units in TowersGroup) Equal to 0
      • Then - Actions
        • //Cutscene actions
      • Else - Actions
This will make the actions when two towers die. If you want to perform the actions when a specific unit kills them, you can do it like this:
If you don't have the unit pre-set in the map, use the following trigger:
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hash = (Last created hashtable)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units of type X) and do (Actions)
      • Loop - Actions
        • Hashtable - Save 0 as 1 of (Key(Picked unit)) in Hash
        • Unit Group - Add (Picked unit) to Group
Else, if you have it preset,
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Unit = Naga 000 <gen>
    • Hashtable - Create a hashtable
    • Set Hash = (Last created hashtable)
    • Custom script: call SaveInteger (udg_Hash, GetHandleId (udg_Unit), 1, 0)
and then, whatever trigger you choose from the above, add this trigger:
  • Trigger2
  • Events
    • Unit - A unit dies
  • Conditions
    • (Unit-type of (Killing unit)) Equal to Naga
  • Actions
    • Set Kills = (Load 1 of (Key(Killing unit)) in Hash)
    • Hashtable - Save (Kills + 1) as 1 of (Key(Killing unit)) in Hash
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • Kills Equal to 2
      • Then - Actions
        • //Cutscene actions here
        • Hashtable - Clear all child hashtables of (Key(Killing unit)) in Hash
      • Else - Actions
 
Status
Not open for further replies.
Top