English freeimage() vs killobject()

1 reply
Goto Page
To the start Previous 1 Next To the start
22.02.20 04:20:22 pm
Super User
Offline Off
Is there any difference between cs2d lua cmd freeimage and cs2d cmd killobject when it comes to removing an image? I know the fact that unlike cs2d lua cmd freeimage, cs2d cmd killobject triggers cs2d lua hook objectkill hook. But I wonder if there is anything going on in the background.

I have been trying to get an answer to this via Discord but apparently nobody has any answer yet.
Create your UI easy and fast: UI Framework | Go deeper into the darkness and test your bravery: file cs2d Outlast II Modification (27)
22.02.20 11:52:40 pm
Offline Off
Yes, there are differences.

cs2d cmd killobject does checks related to killing other objects than images, especially buildings. Like rewards, punishments and effects when killing a building. It does NOT remove tweens associated with the image.

cs2d cmd freeimage does not do all these checks but only removes tweens associated with that image.

So when using both with images the main difference is that tweens are not removed with cs2d cmd killobject. This is most likely nothing you want to happen. Therefore I recommend to just always use cs2d cmd freeimage to remove images and not cs2d cmd killobject.

There most likely isn't any relevant difference in peformance/traffic.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
To the start Previous 1 Next To the start