• 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] Wc3 just completely stumping me

Status
Not open for further replies.
Level 3
Joined
May 21, 2011
Messages
31
I'm an experienced wc3 map maker, especially with the trigger editor (Even though I get lazy a lot), but now WC3 has just completely gave me a mental block.

Don't worry about going to advanced with me ^.^


Well, I just started making this map and wc3 screwed me up, I already ran into a major problem and I can't go too far without fixing it, and it's a major thing with the map. The problem is, this trigger just stops... I only have 3 triggers so far, and none of them stop triggers.

Here they are...

  • ]Generate Doodads
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Cinematic - Turn cinematic mode On for (All players)
      • Game - Display to (All players) the text: Setting Preset Vari...
      • Wait 0.25 seconds
      • Set Texture_Unit[1] = T4Chains1
      • Set Texture_Unit[2] = T5Chains2
      • Set Texture_Unit[3] = T6Chains3
      • Set Texture_Unit[4] = T7Chains4
      • Set Region[1] = P1 Start <gen>
      • Set Region[2] = P2 Start <gen>
      • Set Region[3] = P3 Start <gen>
      • Set Region[4] = P4 Start <gen>
      • Set Region[5] = P5 Start <gen>
      • Game - Display to (All players) the text: |c00000099Generatin...
      • Wait 0.25 seconds
      • -------- Blood --------
      • For each (Integer A) from 1 to 16, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 1 <gen>)
          • Unit - Create 1 T1Blood for Neutral Passive at P[0] facing (Random angle) degrees
          • Animation - Change (Last created unit)'s size to ((Random real number between 100.00 and 200.00)%, (Random real number between 100.00 and 200.00)%, (Random real number between 100.00 and 200.00)%) of its original size
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 16, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 2 <gen>)
          • Unit - Create 1 T1Blood for Neutral Passive at P[0] facing (Random angle) degrees
          • Animation - Change (Last created unit)'s size to ((Random real number between 100.00 and 200.00)%, (Random real number between 100.00 and 200.00)%, (Random real number between 100.00 and 200.00)%) of its original size
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 32, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Start Center <gen>)
          • Unit - Create 1 T1Blood for Neutral Passive at P[0] facing (Random angle) degrees
          • Animation - Change (Last created unit)'s size to ((Random real number between 100.00 and 200.00)%, (Random real number between 100.00 and 200.00)%, (Random real number between 100.00 and 200.00)%) of its original size
          • Custom script: call RemoveLocation(udg_P[0])
      • -------- Chains --------
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 1 <gen>)
          • Unit - Create 1 Texture_Unit[(Random integer number between 1 and 4)] for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 2 <gen>)
          • Unit - Create 1 Texture_Unit[(Random integer number between 1 and 4)] for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Start Center <gen>)
          • Unit - Create 1 Texture_Unit[(Random integer number between 1 and 4)] for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • -------- Corpse Sitting --------
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 1 <gen>)
          • Unit - Create 1 T2CorSit for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 2 <gen>)
          • Unit - Create 1 T2CorSit for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Start Center <gen>)
          • Unit - Create 1 T2CorSit for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • -------- Torture Table --------
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 1 <gen>)
          • Unit - Create 1 T3TorTab for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 2 <gen>)
          • Unit - Create 1 T3TorTab for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • -------- Bats --------
      • For each (Integer A) from 1 to 1, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 1 <gen>)
          • Unit - Create 1 T8Bats for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 1, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 2 <gen>)
          • Unit - Create 1 T8Bats for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Start Center <gen>)
          • Unit - Create 1 T8Bats for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • -------- Flies --------
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 1 <gen>)
          • Unit - Create 1 T9Flies for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Cage 2 <gen>)
          • Unit - Create 1 T9Flies for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set P[0] = (Random point in Start Center <gen>)
          • Unit - Create 1 T9Flies for Neutral Passive at P[0] facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_P[0])
      • Game - Display to (All players) the text: 10% Complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 20% Complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 30% Complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 40% Complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 50% Complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 60% Complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 70% Complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 80% Complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 90% Complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 100% Complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: Doodads Finished.
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: |c00990000Generatin...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 10% complete...
      • -------- Generate Wives --------
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set P[0] = (Center of Region[(Integer A)])
          • Unit - Create 1 Woman for (Player((Integer A))) at P[0] facing (Random angle) degrees
          • Unit - Make (Last created unit) Invulnerable
          • Unit - Pause (Last created unit)
          • Animation - Play (Last created unit)'s death animation
          • Unit - Set life of (Last created unit) to 1.00%
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 4 to 5, do (Actions)
        • Loop - Actions
          • Set P[0] = (Center of Region[(Integer A)])
          • Unit - Create 1 Woman for (Player((Integer A))) at P[0] facing (Random angle) degrees
          • Unit - Make (Last created unit) Invulnerable
          • Unit - Pause (Last created unit)
          • Animation - Play (Last created unit)'s death animation
          • Unit - Set life of (Last created unit) to 1.00%
          • Custom script: call RemoveLocation(udg_P[0])
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 20% complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 30% complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 40% complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 50% complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 60% complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 70% complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 80% complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 90% complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: 100% complete...
      • Wait 0.25 seconds
      • Game - Display to (All players) the text: Units generated
      • Wait 0.25 seconds
      • Cinematic - Turn cinematic mode Off for (All players)
      • Game - Display to (All players) the text: |c00009900Generatio...
      • Wait 0.25 seconds
      • -------- Messages --------
      • Game - Display to (All players) the text: |c00990000You awake...
      • -------- Pan Camera --------
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set P[0] = (Center of Cage 1 <gen>)
          • Camera - Pan camera for (Player((Integer A))) to P[0] over 0.00 seconds
          • Custom script: call RemoveLocation(udg_P[0])
      • For each (Integer A) from 4 to 6, do (Actions)
        • Loop - Actions
          • Set P[0] = (Center of Cage 2 <gen>)
          • Camera - Pan camera for (Player((Integer A))) to P[0] over 0.00 seconds
          • Custom script: call RemoveLocation(udg_P[0])
  • Resuscitate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Resuscitate
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Target unit of ability being cast)) Equal to (Owner of (Casting unit))
        • Then - Actions
          • Unit - Make (Target unit of ability being cast) Vulnerable
          • Unit - Unpause (Target unit of ability being cast)
          • Animation - Play (Target unit of ability being cast)'s stand animation
          • Game - Display to (Player group((Owner of (Target unit of ability being cast)))) the text: It worked! Your wif...
          • Item - Remove (Item carried by (Casting unit) of type Resuscitate)
        • Else - Actions
          • Game - Display to (Player group((Owner of (Casting unit)))) the text: You must target your own units.
  • Knife
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Knife
    • Actions
      • Set P[0] = (Position of (Casting unit))
      • Unit - Turn collision for (Casting unit) Off
      • Unit - Create 1 Victim Knife for (Owner of (Casting unit)) at P[0] facing (Facing of (Casting unit)) degrees
      • Hero - Give (Item carried by (Casting unit) in slot 1) to (Last created unit)
      • Hero - Give (Item carried by (Casting unit) in slot 2) to (Last created unit)
      • Hero - Give (Item carried by (Casting unit) in slot 3) to (Last created unit)
      • Hero - Give (Item carried by (Casting unit) in slot 4) to (Last created unit)
      • Hero - Give (Item carried by (Casting unit) in slot 5) to (Last created unit)
      • Hero - Give (Item carried by (Casting unit) in slot 6) to (Last created unit)
      • Selection - Select (Last created unit) for (Owner of (Casting unit))
      • Unit - Remove (Casting unit) from the game
      • Custom script: call RemoveLocation(udg_P[0])

I'm completely stumped o_o. Keep in mind I am competent and incompetent, my search skills are very horrible and I probably missed something entirely basic.


*Edit: I forgot to mention (icompetent side again) that the trigger that stops is knife. It stops at the second item give, and just spots that's all I can say. No further actions continue.
 
Last edited:
I'll soon try to help you with 1st trigger. About last 2, there is no way they can casue mentioned issue. You have to consider that spamming actions in one trigger can sometimes make war3 engine start ignoring part of code within.

Use (Triggering unit) instead of (Casting unit), replace (Owner of (Casting unit) with (Triggering player) as well. Do not use array variables if you aren't perfoming enought actions refering to higher amount of arrays for given variable. In this case you are using just 1, so it's completely worthless (it takes much more memory than single non aray variable). Loops were invented to help you executing multiple actions.

  • Knife
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Knife
    • Actions
      • Set P = (Position of (Triggering unit))
      • Unit - Turn collision for (Triggering unit) Off
      • Unit - Create 1 Victim Knife for (Triggering player) at P facing (Facing of (Triggering unit)) degrees
      • For each (Integer i) from 1 to 6 do Actions
        • Loop - Actions
          • Hero - Give (Item carried by (Triggering unit)) in slot i) to (Last created unit)
      • Selection - Select (Last created unit) for (Triggering player)
      • Unit - Remove (Triggering unit) from the game
      • Custom script: call RemoveLocation(udg_P)
Where 'i' in integer variable.


Simillar hits as those in previous trigger, although this time you leak player force. Things that leak.
  • Resuscitate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Resuscitate
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Target unit of ability being cast)) Equal to (Triggering player)
        • Then - Actions
          • Unit - Make (Target unit of ability being cast) Vulnerable
          • Unit - Unpause (Target unit of ability being cast)
          • Animation - Play (Target unit of ability being cast)'s stand animation
          • Set force = (Player group((Owner of (Target unit of ability being cast))))
          • Game - Display to force the text: It worked! Your wif...
          • Item - Remove (Item carried by (Triggering unit) of type Resuscitate)
          • Custom script: call DestroyForce(udg_force)
        • Else - Actions
          • Set force = (Player group(Triggering player))
          • Game - Display to (Player group((Owner of (Casting unit)))) the text: You must target your own units.
          • Custom script: call DestroyForce(udg_force)
Where 'force' is player group variable.
 
Level 3
Joined
May 21, 2011
Messages
31
I didn't realize the player forces needed to be leaked like that, thanks! I will change those around.


I use the variable P as a global point variable for triggers that don't need to store variable data over time. This is mainly so I don't have to look through 100 different point variables.

Like this trigger, where you quickly run the trigger and clean the variable, no holding it across triggers. For trigger loops and stuff I don't use it.

I keep it an array just incase I need to use multiple points ^.^


For the loops I constantly forget to do that, the only place I usually apply things I know like that is math. (Stupid incompetent side again)



It has never given me a problem before :p







It's working now, Thanks so much :D
 
Last edited:
Status
Not open for further replies.
Top