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

Tome of Experiance Bug

Status
Not open for further replies.
Level 7
Joined
Jun 19, 2017
Messages
141
Hello, i have a question regarding the items that are "used when acquired" like the Tome of Experiance.
The problem is that, when you use it from the ground it leaves a permanent graphic glitch on it's spot that looks like a regular tome but unclickable, and it doesn't dissappear at all.
Screenshot below. On it you can see the small tomes on the ground, although unclickable, they are just ugly. Any idea how to remove them ?
 

Attachments

  • Tome of Experiance bug.png
    Tome of Experiance bug.png
    2 MB · Views: 129

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
You can remove the item when it's picked up. However this will also remove the death animation of the item, so you might want to wait a little before you remove it.
The easiest way is to use a local variable and a wait:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Powerup
    • Actions
      • Custom script: local item itm = GetManipulatedItem()
      • Wait 0.50 seconds
      • Custom script: call RemoveItem(itm)
      • Custom script: set itm = null
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Didn't think about that. Then it's probably more complicated. There is already a resource in the spell section that should solve it: Item Cleanup 1.2
Check it out and see if it works for you.

The problem has already been there. The tomes just get very small so you can barely see them. If you are not looking for them you will most likely not see them.
 
Level 7
Joined
Jun 19, 2017
Messages
141
Actually i found out this simple trigger works even better than the above mentioned "Item Cleanup 1.2". Can you check to tell me if it's good ?
  • Delete Tomes
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Item - Pick every item in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current life of (Picked item)) Equal to 0.00
            • Then - Actions
              • Item - Remove (Picked item)
            • Else - Actions
 
Level 13
Joined
May 10, 2009
Messages
868
I know this is weird as hell, but "Item - Remove" natives does NOT remove an item when its health points are equal to 0.00. Set its life to 1.00, then remove it. Otherwise, Item enumerator will iterate over them all the time.
That's why "Item Cleanup" does this.

  • For each (Integer Loop) from 0 to ItemsToClean, do (Actions)
    • Loop - Actions
      • Item - Set life of CleanedItem[Loop] to 1.00
      • Item - Remove CleanedItem[Loop]
      • Set CleanedItem[Loop] = No item
 
Status
Not open for further replies.
Top