• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Game crash without error after giving item to hero

Status
Not open for further replies.
Level 12
Joined
Jan 13, 2008
Messages
559
wow..i just realised whats wrong z.z

/e: I got another problem so maybe someone can help with this.

  • using Potions
    • Events
      • Unit - A unit Uses 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 Potion of Healing (50)
        • Then - Actions
          • For each (Integer A) from 0 to 9, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Equal to (Player(((Integer A) + 1)))
                • Then - Actions
                  • Unit - Set life of player_hero[(Integer A)] to ((Life of player_hero[(Integer A)]) + 50.00)
                  • Special Effect - Create a special effect attached to the chest of player_hero[(Integer A)] using Abilities\Spells\Human\Heal\HealTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
        • Else - Actions
For some reasno it doesnt show the specialeffect..it only shows when I dont destroy it immediately..but why? it usually works tho
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,381
There are two types of effects - one with animations and other without animations (or better yet, with only stand animation).

When you destroy an effect, it immediately plays its "death" animation. If it doesn't have death animation, it plays stand animation and once it ends the effect is destroyed.

In your case, HealTarget has a very short death animation, hence when you destroy it immediately, it gets removed (it doesn't even have time to produce any particles).
In other cases like Holy Light, where the effect does not have death animation the stand animation is played fully.

You can easily find out which effects do have animations and which do not in the preview wnidow of your WE - if you can change animations there, it obviously has animations.
 
Level 12
Joined
Jan 13, 2008
Messages
559
Ah, this explains it. Thank you. I have another problem right now:

  • abort quest
    • Events
      • Unit - A unit Loses an item (if the hero drops the item)
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Campaign
    • Actions
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: test)
      • Item - Remove (Item being manipulated)
The problem is that Item - Remove (Item being manipulated) somehow triggers the event again and the text gets displayed twice. How can I change that? I could hide the item but...is that rlly the best solution? And if I wanna hide it..how do I select the item? because Item - Hide (Item being manipulated) does not work (it does not get hidden) even tho it should work?!
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,381
Well it's logical that it happens that way. Your trigger fires when you loose a campaing-class item, which is the item you remove.

Fix is simple - Turn off the trigger before you remove the item and turn it back on immediately after.

  • abort quest
    • Events
      • Unit - A unit Loses an item (if the hero drops the item)
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Campaign
    • Actions
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: test)
      • Trigger - Turn off (This trigger)
      • Item - Remove (Item being manipulated)
      • Trigger - Turn on (This trigger)
 
Status
Not open for further replies.
Top