• 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] Problem

Status
Not open for further replies.
Level 18
Joined
May 27, 2007
Messages
1,689
I have a trigger for the weapon system of a map I am workibg, that SHOULD work, but of course it doesn't. What happens is when you drop the item, you hear a sound like when a game is over, then WC3 closes it doesn't crash, it just closes, no messages or anything popup but anyway here it is
  • Drop Item
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to .45 Magnum
          • (Unit-type of (Hero manipulating item)) Equal to Umbrella Mercenary (Magnum)
        • Then - Actions
          • Unit - Replace (Hero manipulating item) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
          • Selection - Select (Last created unit) for (Owner of (Triggering unit))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Equal to Beretta M92F
              • (Unit-type of (Hero manipulating item)) Equal to Umbrella Mercenary (Pistol)
            • Then - Actions
              • Unit - Replace (Hero manipulating item) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
              • Selection - Select (Last created unit) for (Owner of (Triggering unit))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item being manipulated)) Equal to Flame Thrower
                  • (Unit-type of (Hero manipulating item)) Equal to Umbrella Mercenary (Flame Thrower)
                • Then - Actions
                  • Unit - Replace (Hero manipulating item) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
                  • Selection - Select (Last created unit) for (Owner of (Triggering unit))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-type of (Item being manipulated)) Equal to HK53
                      • (Unit-type of (Hero manipulating item)) Equal to Umbrella Mercenary (SMG)
                    • Then - Actions
                      • Unit - Replace (Hero manipulating item) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
                      • Selection - Select (Last created unit) for (Owner of (Triggering unit))
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Item-type of (Item being manipulated)) Equal to M-66 Rocket Launcher
                          • (Unit-type of (Hero manipulating item)) Equal to Umbrella Mercenary (Rocket Launcher)
                        • Then - Actions
                          • Unit - Replace (Hero manipulating item) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
                          • Selection - Select (Last created unit) for (Owner of (Triggering unit))
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Item-type of (Item being manipulated)) Equal to M4a1
                              • (Unit-type of (Hero manipulating item)) Equal to Umbrella Mercenary (Assault Rifle)
                            • Then - Actions
                              • Unit - Replace (Hero manipulating item) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
                              • Selection - Select (Last created unit) for (Owner of (Triggering unit))
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Item-type of (Item being manipulated)) Equal to Mini-Gun
                                  • (Unit-type of (Triggering unit)) Equal to Umbrella Mercenary (Mini Gun)
                                • Then - Actions
                                  • Unit - Replace (Triggering unit) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
                                  • Selection - Select (Last created unit) for (Owner of (Triggering unit))
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Item-type of (Item being manipulated)) Equal to Shotgun
                                      • (Unit-type of (Triggering unit)) Equal to Umbrella Mercenary (Shotgun)
                                    • Then - Actions
                                      • Unit - Replace (Triggering unit) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
                                      • Selection - Select (Last created unit) for (Owner of (Triggering unit))
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Item-type of (Item being manipulated)) Equal to Sniper Rifle
                                          • (Unit-type of (Triggering unit)) Equal to Umbrella Mercenary (Sniper Rifle)
                                        • Then - Actions
                                          • Unit - Replace (Triggering unit) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
                                          • Selection - Select (Last created unit) for (Owner of (Triggering unit))
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Item-type of (Item being manipulated)) Equal to U-70 Mine Thrower
                                              • (Unit-type of (Triggering unit)) Equal to Umbrella Mercenary (Mine Thrower)
                                            • Then - Actions
                                              • Unit - Replace (Triggering unit) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
                                              • Selection - Select (Last created unit) for (Owner of (Triggering unit))
                                            • Else - Actions
I tried to change some of the Triggering Unit to Hero Manipulating Blah Blah, but that did not work
 
Level 18
Joined
May 27, 2007
Messages
1,689
Yes this trigger is defintly the problem, becuz when disabled, everything works fine, except for the fact when you drop the item you are still equipped
The last Created Unit does not work
The item being manipulated should work
I got the suggestion to Turn Off the trigger at begginning and then on at the end of the trigger, and that doesn't make Wc3 close, but when you drop a different item the first time, or after changing another, then it shows the item on the ground, but it still takes up a slot in the inventory, and you cannot use it. After dropping it a second time, then it drops out of the inventory also
 
Level 6
Joined
Feb 19, 2004
Messages
147
Ohhhh I've had this problem before all you have to do is take all those if then elses and move them to the first line like instead of them making a stepladder look make them straight down like this
If
Then
else
If
then
else
etc.

And if you put "Do Nothing" under else then it skips the rest of the trigger completely so just leave the else blank
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Ohhhh I've had this problem before all you have to do is take all those if then elses and move them to the first line like instead of them making a stepladder look make them straight down like this
If
Then
else
If
then
else
etc.

And if you put "Do Nothing" under else then it skips the rest of the trigger completely so just leave the else blank
A) DoNothing does not skip the rest of the trigger completely.

B) The else-tree is at least more efficient (better) than your way, since it doesn't check every if, and instead only the first.


If that's crashing it then GUI is even worse than I previously believed -.-
 
Level 18
Joined
May 27, 2007
Messages
1,689
Poot I did that here is the trigger I have, still not working
  • Drop Item
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to U-70 Mine Thrower
                  • MineThrower[(Player number of (Owner of (Triggering unit)))] Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to Sniper Rifle
                  • SniperRifle[(Player number of (Owner of (Triggering unit)))] Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to Shotgun
                  • Shotgun[(Player number of (Owner of (Triggering unit)))] Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to M4a1
                  • AssaultRifle[(Player number of (Owner of (Triggering unit)))] Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to Mini-Gun
                  • Minigun[(Player number of (Owner of (Triggering unit)))] Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to HK53
                  • SMG[(Player number of (Owner of (Triggering unit)))] Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to M-66 Rocket Launcher
                  • RocketLauncher[(Player number of (Owner of (Triggering unit)))] Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to Flame Thrower
                  • FlameThrower[(Player number of (Owner of (Triggering unit)))] Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to Beretta M92F
                  • Pistol[(Player number of (Owner of (Triggering unit)))] Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to .45 Magnum
                  • Magnum[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Set Hero_Exp[(Player number of (Owner of (Triggering unit)))] = (Hero experience of (Triggering unit))
          • Unit - Replace (Hero manipulating item) with a Umbrella Mercenary (Weaponless) using The old unit's relative life and mana
          • Hero - Set (Last replaced unit) experience to Hero_Exp[(Player number of (Owner of (Triggering unit)))], Hide level-up graphics
        • Else - Actions
 
Status
Not open for further replies.
Top