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

[Solved] last created thing with CreateDestructableZ ?

Status
Not open for further replies.
Level 23
Joined
Oct 18, 2008
Messages
937
with GUI lacking a way to create destructibles at a height I've used this custom script. so far it worked but a related problem has presented itself.

  • (Destructible - (Last created destructible)
does not refer to things created this way. I assume I will need another script to refer to it.

simply put, I need

  • Trigger - Add to shrubadd <gen> the event (Destructible - (Last created destructible) dies)
but with the correct reference.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
The GUI actions to create objects look roughly like this in Jass:
JASS:
set bj_lastCreatedUnit = CreateUnit(...)
return bj_lastCreatedUnit
Last created unit is not something that gets automatically assigned to the last created unit. Instead the variable is set in the actions. If you want to store your last created destructible you need to do: set yourVariable=CreateDestructible(...) instead of call CreateDestructible()
You can use set bj_lastCreatedDestructable = CreateDestructible(...), because bj_lastCreatedDestructable is "Last Created Destructible".
 
Status
Not open for further replies.
Top