Trigger run on ability 'root' and run on doodad select

Status
Not open for further replies.
Level 3
Joined
Dec 6, 2005
Messages
67
Couple of questions...

First i was wondering on a GUI or JASS way of detecting the casting of the ability 'root' and root only, not 'unroot'. I realize its the same ability just a turn on/off so i guess is there a way to tell which?

Second is there a way to run a trigger when player selects a doodad/destructible?

P.S. on numer 1 i need the trigger to run only after the building succesfully roots, so doing it by order string on targeting a point, won't work
 
Last edited:
Level 3
Joined
Dec 6, 2005
Messages
67
I'd like to add a pop-up on trees that shows their hp. So far i've got them selectable, but there life won't show up on the side, so all u see is the life bar, well i'd like to make some floating numbers appear when u click on it. And i'm trying the spell id bit shortly, you think that will work? The problem is that 'root' and 'unroot' are the same spell... one is 'on' the other is 'off'
 
Level 3
Joined
Dec 6, 2005
Messages
67
Hmm guess 'root' isn't an ability at all... By root i hope everyone realizes i mean the Night Elf trees ability to uproot and root.
Code:
Event
Unit - A unit Finishes casting an ability
Conditions

Actions
Game - Display to (All players) the text: (Name of (Ability being cast))
isn't outputing anything when i use the 'ability'....
 
I'd like to add a pop-up on trees that shows their hp. So far i've got them selectable, but there life won't show up on the side, so all u see is the life bar, well i'd like to make some floating numbers appear when u click on it. And i'm trying the spell id bit shortly, you think that will work? The problem is that 'root' and 'unroot' are the same spell... one is 'on' the other is 'off'

Perhaps just show a small floating text whenever they're attacked? I don't know.

That's assuming you can't figure out a selection event for them.

Edit: Use "starts the effect of an ability"
 
Level 3
Joined
Dec 6, 2005
Messages
67
Appreciate the suggestion, but already tried
Code:
Starts effect of ability
and no luck either... i think maybe its just an order? Like move and attack? In which case i need when it finishes the order... :/
 
Level 3
Joined
Dec 6, 2005
Messages
67
bump... is this really that hard? figured this would be a 'duh' question, but apparently harder than i had expected...
 
Detecting Root:
  • Trigger
  • Events
    • Unit - A unit is issued an order with no target
  • Conditions
    • (Issued Order) Equal to (order(root))
  • Actions
    • Custom script: call TriggerSleepAction(2.5)
    • <Do your actions here>
2.5 follows the Data - Duration. It is actually the time until successful enroot, so, if you set it to 4.00 seconds instead, use Custom script: call TriggerSleepAction(4.0).

Concerning the second question, no, you cannot detect such thing, sorry.
 
Level 3
Joined
Dec 6, 2005
Messages
67
thanks for the suggestion Pharaoh but a couple of problems with that,
First, 'root' is an order targeting a point
Second, i need the actions to fire once the tree is rooted not as soon as he recieves the command... what if player cancel? I need on finish.

I was thinking that since 'root' , 'unroot' is an on/off ability is there anyway that i can detect which state its in?

I'll elaborate on what i'm trying to do if that helps... basically the idea is to make a building that can takeoff and fly. First i have the regular building with
target type: Structure with a dummy ability 'liftoff'
now when the ability 'liftoff' is cast the unit is replaced with the flying version
target type:air, and immediately told to 'uproot'
now i need a way to detect when the building roots itself again so that i can replace with the ground version... otherwise they have a building that can't be targeted by ground troops :/

Hmm, if i can't do number #2 (on destructible select) is there anyway that i can make a unit act as a tree? Be useable for lumber gathering and everything?
 
Level 4
Joined
Mar 23, 2008
Messages
87
@Pharao: Why do you use TSA instead of Wait? Aren't they one and the same?

@Drenith: Rooted and unrooted are different unit-types if i remember correctly. just do a if/then/else check if its one unit type or another when the wait is over
 
Level 3
Joined
Dec 6, 2005
Messages
67
unless they have different unit codes internally then no, they are the same unit... its odd because the editor has an uprooted version that i can use to place on the map, but when using the unit-type comparison trigger it doesn't have buildings in uprooted form

actually, for a slighly different approach, is there a JASS way to change the target type? Dynamically change from 'structure' to 'air'?
 
Status
Not open for further replies.
Top