• 🏆 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!

Game crashes...

Status
Not open for further replies.
Level 4
Joined
Jun 7, 2008
Messages
37
I've made a trigger that's supposed to replace a hero with another when the hero in question obtains a certain item, but the game crashes the moment I try to pick the item up. Why does it happen and how can I fix it?
Thanks in advance.

  • AquaBlade
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Aquatic Blade
    • Actions
      • Unit - Replace (Hero manipulating item) with a Morphling (Sword) using The new unit's default life and mana
      • Hero - Set (Last replaced unit) Hero-level to 10, Hide level-up graphics
      • Hero - Learn skill for (Last replaced unit): Tsunami Slash (Cairne)
      • Unit - Set level of Tsunami Slash (Cairne) for (Last replaced unit) to 4
      • Hero - Give (Item carried by (Hero manipulating item) in slot 1) to (Last replaced unit)
      • Hero - Give (Item carried by (Hero manipulating item) in slot 2) to (Last replaced unit)
      • Hero - Give (Item carried by (Hero manipulating item) in slot 3) to (Last replaced unit)
      • Hero - Give (Item carried by (Hero manipulating item) in slot 4) to (Last replaced unit)
      • Hero - Give (Item carried by (Hero manipulating item) in slot 5) to (Last replaced unit)
      • Hero - Give (Item carried by (Hero manipulating item) in slot 6) to (Last replaced unit)
 
Level 4
Joined
Jun 7, 2008
Messages
37
Thanks alot for the quick response. I tried to do as you suggested, but to no avail...
I dunno which event response would work :bored:
  • AquaBlade
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Aquatic Blade
    • Actions
      • Set trans = (Triggering unit)
      • Set itemc[1] = (Item carried by trans in slot 1)
      • Set itemc[2] = (Item carried by trans in slot 2)
      • Set itemc[3] = (Item carried by trans in slot 3)
      • Set itemc[4] = (Item carried by trans in slot 4)
      • Set itemc[5] = (Item carried by trans in slot 5)
      • Set itemc[6] = (Item carried by trans in slot 6)
      • Unit - Replace trans with a Morphling (Sword) using The new unit's default life and mana
      • Hero - Set (Last replaced unit) Hero-level to 10, Hide level-up graphics
      • Hero - Learn skill for (Last replaced unit): Tsunami Slash (Cairne)
      • Unit - Set level of Tsunami Slash (Cairne) for (Last replaced unit) to 4
      • Hero - Give itemc[1] to (Last replaced unit)
      • Hero - Give itemc[2] to (Last replaced unit)
      • Hero - Give itemc[3] to (Last replaced unit)
      • Hero - Give itemc[4] to (Last replaced unit)
      • Hero - Give itemc[5] to (Last replaced unit)
      • Hero - Give itemc[6] to (Last replaced unit)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Also note that the replace unit action sets the level of heroes and transfers items, so most of the code is useless.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Ah, about the crash.
Ffs the second unit acquires the item too...
So remove the item from the first unit, before you replace it.
If you want the second unit to have the item make a copy of it(in the OE) and create an item(like the copy) for the second unit.
 
Level 4
Joined
Jun 7, 2008
Messages
37
Ah, about the crash.
Ffs the second unit acquires the item too...
So remove the item from the first unit, before you replace it.
If you want the second unit to have the item make a copy of it(in the OE) and create an item(like the copy) for the second unit.

That fixed it, thanks :thumbs_up:
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
That would generally make it work too, but has issues with MUI.
Example Unit picks that Item while trigger being disabled.
 
Status
Not open for further replies.
Top