• 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.

[JASS] IsDestructableTreeDestroy

Status
Not open for further replies.
Level 13
Joined
Mar 29, 2012
Messages
542
Hello guys.... I need a favor here... About Jass, and this is the first time I'm using it, but I'm not sure if it can or maybe I just use GUI Instead of this.

Can I make function to check and destroy tree like this :
[jass=My Jass]function IsDestructableTreeDestroy takes destructable dt, boolean tb returns nothing
......
endfunction[/code]

dt = The destructable that will check and destroy (kill)
tb = 'True' then destroy the destructable 'False' I don't need to tell, right ? :)

Or only using GUI ?. And sorry, I'm not tested it yet.:grin:
 
this is originally posted by mag but i dont know if it works.
You must first create peasant,hide it then make it invulnerable.

Here is a sample snippet to check if it is a tree or not:
[jass=]
function IsDestTree takes destructable d returns boolean
return IssueTargetOrderById(your_dummy,OrderId("harvest")) and IssueImmediateOrder(your_dummy,OrderId("stop"))
endfunction[/code]
This function will return true if the destructable is harvestable and false if not.
 
Level 13
Joined
Mar 29, 2012
Messages
542
First, i copy the scripts, then paste, then change something. But after save, error...maybe i did a mistake...:vw_unimpressed:

[jass=My Jass]function IsDestructableTree takes destructable idt_destructable returns boolean
if (GetUnitCurrentOrder(udg_Harvester) == OrderId("harvest")) then
return true
else
return false
endif
endfunction[/code]

Is that okay ? or maybe there's a shorter way than this ?:vw_wtf: I didn't test it yet
 
Status
Not open for further replies.
Top