Need Local Variable for Destructible

ShikaShadow

Cool Member
Reaction score
0
Hello, I am familiar with making a unit variable local within a trigger, but how can I make a destructible variable local? The formula "local unit = udg_name" doesn't work for destructible variables. And "local destructible = udg_name" doesn't work and gives an error when map is saved. I have to make the trigger local because the skill can be casted multiple times by multiple people at any given moment. The wait has to be there so that I can bring the tree's animation speed back to what it was before the right-click event. Without making the trigger local, it will be constantly interrupted causing trees to be stuck at the faster animation speed.

Here is the trigger:



Tree Jump Effect
Events
Unit - A unit Is issued an order targeting an object
Conditions
And - All (Conditions) are true
Conditions
(Issued order) Equal to Right-Click
(Mana of (Ordered unit)) Greater than or equal to 50.00
Or - Any (Conditions) are true
Conditions
(Destructible-type of (Target destructible of issued order)) Equal to Summer Tree Wall
(Destructible-type of (Target destructible of issued order)) Equal to Felwood Canopy Tree
(Destructible-type of (Target destructible of issued order)) Equal to Cityscape Summer Tree Wall
Actions
Set TreeTarget = (Target destructible of issued order)
Animation - Change TreeTarget's animation speed to 70.00% of its original speed
Wait 1.00 seconds
Animation - Change TreeTarget's animation speed to 5.00% of its original speed
 

HydraRancher

Truth begins in lies
Reaction score
197
Instead of using locals, you can assign via hashtable the destructible to the triggering unit. Then use that to refer.
 

ShikaShadow

Cool Member
Reaction score
0
Okay I haven't heard of hash tables but I see some examples on search. I'll see if I can learn to make one for this particular trigger.
 

ShikaShadow

Cool Member
Reaction score
0
I can't create hash tables as I'm using Warcraft Editor Unlimited. The map is too complex to easily switch to a different editor. Is there no way to designate a destructible variable as local?
 

Curo

Why am I still playing this game...?
Reaction score
109
I can't create hash tables as I'm using Warcraft Editor Unlimited. The map is too complex to easily switch to a different editor. Is there no way to designate a destructible variable as local?

For being "unlimited", this sounds pretty limited to me, if it can't do hashtables.
 

ShikaShadow

Cool Member
Reaction score
0
The fact that there's no apparent support for localizing variables that are destructibles/doodads in ANY editor makes things very complicated or impossible. If only I could just begin the trigger with 'local destructible TreeTarget' and end with 'set TreeTarget = null'.
 

Solmyr

Ultra Cool Member
Reaction score
30
If only I could just begin the trigger with 'local destructible TreeTarget' and end with 'set TreeTarget = null'.
You most certainly can, but the syntax is not [ljass]local destructible[/ljass], it is [ljass]local destructable[/ljass], and this is exactly where your mistake lies :)
 

HydraRancher

Truth begins in lies
Reaction score
197
You most certainly can, but the syntax is not [ljass]local destructible[/ljass], it is [ljass]local destructable[/ljass], and this is exactly where your mistake lies :)

Oh really? :3 It's quite funny how a typo can ruin your entire JASS code.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top