• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Map is crashing on trigger please help!

Status
Not open for further replies.
Level 8
Joined
Sep 15, 2006
Messages
426
My problem is whenever my map runs this trigger:
  • Drop
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item being manipulated) Equal to myGun
    • Actions
      • Unit - Replace (Hero manipulating item) with a Syndicate Footsoldier (No Weapon) using The old unit's relative life and mana
      • Unit - Change color of (Last replaced unit) to Black
      • Selection - Add (Last replaced unit) to selection for (Owner of (Hero manipulating item))
runs, my map crashes. Is there any reason why this is happening?
 
Level 19
Joined
Apr 25, 2006
Messages
1,309
If you replace a unit the replaced hero isn't owned by anyone anymore, so you can't refer to that, it does not excist anymore and the game crashes. Try to use a variable and save the owner of the unit, player. Try this and it might work. Or in the last action just simply change it to owner of replaced unit.
Last one is better...

Also if the old unit has more mana or life than new unit's max, I have no idea how the trigger reacts to this. Maybe it gives the new unit its max mana/life.
 
Level 8
Joined
Sep 15, 2006
Messages
426
I'm not sure that that's it. Even if I use Selection - Add (Last replaced unit) to selection for Player 1 (Red) it still crashes.
 
Level 19
Joined
Apr 25, 2006
Messages
1,309
I'm not sure that that's it. Even if I use Selection - Add (Last replaced unit) to selection for Player 1 (Red) it still crashes.
Then I was wrong with the replace thing apparently. Then try changing the "old unit's relative life and mana" to something else and test if it works. If this does not work there might be something wrong with the mygun variable.
 
Level 8
Joined
Sep 15, 2006
Messages
426
I'm not sure about the variable. I tried removing it from the trigger that sets it, and that seemed to fix it. Although when I removed it as a condition from the Drop trigger and re-enabled the trigger, the problem reoccured. It seems there is a joint issue between that trigger and the myGun variable. Hmm.
 
Level 19
Joined
Apr 25, 2006
Messages
1,309
Alright, I tested your trigger and used one item in place of your condition item variable. Your trigger works perfectly. This means the problem is with your item variable. Now put an item to your map and select it to the condition to the place of your variable and it works.

The reason why your game crashes is because of another trigger, not this one.
 
Level 8
Joined
Sep 15, 2006
Messages
426
Is there any reason that this trigger:
  • Tactical 1
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to |cff0f0f0f.45 Tactical|r
      • (Charges remaining in (Item being manipulated)) Greater than 0
    • Actions
      • Item - Set charges remaining in (Item being manipulated) to ((Charges remaining in (Item being manipulated)) + 1)
      • Unit - Replace (Hero manipulating item) with a Syndicate Footsoldier (.45 Tactical) using The old unit's relative life and mana
      • Unit - Change color of (Last replaced unit) to Black
      • Selection - Add (Last replaced unit) to selection for Player 1 (Red)
      • Unit - Change color of (Last replaced unit) to Black
would crash? For some reason, if I either have a reference to the myGun variable in it or just have the Drop trigger enabled, THIS trigger will cause my map to crash. WTF?
 
Level 8
Joined
Sep 15, 2006
Messages
426
Well, I have no clue what was going on, but I tried adding wait for .01 seconds as the first action. For some reason, this makes it work. Not sure why, but it's fixed other triggers of mine in the past.
 
Status
Not open for further replies.
Top