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

call RemoveDestructable() not working

Status
Not open for further replies.
Level 2
Joined
Mar 12, 2013
Messages
4
Hello,
I have a problem in a trigger I am doing right now. I want to try to remove a destructable, but somehow "call RemoveDestructable(d)" doesn't seem to work, neither does "call KillDestructable(d)". What does work though is to hide the destructable, so it shouldn't be a variable problem. Does anyone know the issue and how to fix it?
Thanks in advance.

JASS:
struct Slot
        trackable tra
        multiboard mb
        destructable d
        integer st
        trigger t
        trigger t2
        real x
        real y
        real f
        method TrackableOnHoverAction takes nothing returns nothing
            local SlotType slty=.st
            call DisplayTextToPlayer(Player(0),0,0,("hover"+slty.text))
        endmethod
        method UpdateSlotType takes integer i returns nothing
            call KillDestructable(.d)
        endmethod
        static method create takes string s,real x,real y,real f,integer i returns Slot
            local Slot this=Slot.allocate()
            local SlotType ST=i
            set .x=x
            set .y=y
            set .f=f
            set .st=i
            set .d=CreateDestructable(ST.d,x,y,f,1,0)
            set .tra=CreateTrackable(s,x,y,f)
            set .t=CreateTrigger()
            call TriggerRegisterTrackableTrackEvent(.t,.tra)
            call TriggerAddAction(.t,function TrackableOnHover)
            return this
        endmethod
    endstruct
 
Last edited by a moderator:
RemoveDestructable cant "remove"?

images
 
Level 2
Joined
Mar 12, 2013
Messages
4
Did you even set the value in the local variable destructable? if it doesn't have a value, nothing happens with RemoveDestructable or KillDestructable.

As stated above, changing the KillDestructable() to ShowDestructable(false) works perfectly. It's simply that the command RemoveDestructable() doesn't do anything even though it's supposed to (if I don't understand that function completely wrong)
 
Does the destructable have a death animation?
Also, check the object data for the destructable.

Does it disappear after like a minute? I'm pretty sure it's something with missing death animations or false object data. Remember that dead destructables don't vanish instantly, but play its death animation and depending on the object data leave a trunk permanently. They do not decay like units and need to be removed manually.
 
What´s the point of having a custom destructable with no death animation? that resource should be fixed so.
Is there any reason you need to post bullshit in response to everything I write?

There are a thousand reasons to have destructables that don't neccessarily need proper death animations.
 
Status
Not open for further replies.
Top