• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] last created thing with CreateDestructableZ ?

Status
Not open for further replies.
Level 25
Joined
Oct 18, 2008
Messages
945
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.
 
Level 16
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