• 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] which information i need to insert?

Status
Not open for further replies.
Level 28
Joined
Jan 26, 2007
Messages
4,789
trigger whichTrigger: by default this is something like "gg_trg_TRIGGER_NAME".

unit whichUnit: pre-placed units can be used once you use an action in GUI that uses that unit.
Then it becomes "gg_unit_rawId_integer".
Example: if it's a footman (id: 'hfoo') and it is the 8th unit in the map (the order in which you placed them, can be seen by clicking on the unit in the editor), it will become "gg_unit_hfoo_0008".

unitevent whichEvent, this is the list:
JASS:
// Unit Events
    constant unitevent EVENT_UNIT_DAMAGED
    constant unitevent EVENT_UNIT_DEATH
    constant unitevent EVENT_UNIT_DECAY
    constant unitevent EVENT_UNIT_DETECTED
    constant unitevent EVENT_UNIT_HIDDEN 
    constant unitevent EVENT_UNIT_SELECTED
    constant unitevent EVENT_UNIT_DESELECTED
                                                                        
    constant unitevent EVENT_UNIT_STATE_LIMIT                                              
    // Events which may have a filter for the "other unit"              
    //                                                                  
    constant unitevent EVENT_UNIT_ACQUIRED_TARGET
    constant unitevent EVENT_UNIT_TARGET_IN_RANGE
    constant unitevent EVENT_UNIT_ATTACKED
    constant unitevent EVENT_UNIT_RESCUED
                                                                        
    constant unitevent EVENT_UNIT_CONSTRUCT_CANCEL
    constant unitevent EVENT_UNIT_CONSTRUCT_FINISH
                                                                        
    constant unitevent EVENT_UNIT_UPGRADE_START
    constant unitevent EVENT_UNIT_UPGRADE_CANCEL
    constant unitevent EVENT_UNIT_UPGRADE_FINISH
                                                                        
    // Events which involve the specified unit performing               
    // training of other units                                          
    //                                                                  
    constant unitevent EVENT_UNIT_TRAIN_START
    constant unitevent EVENT_UNIT_TRAIN_CANCEL
    constant unitevent EVENT_UNIT_TRAIN_FINISH
                                                                        
    constant unitevent EVENT_UNIT_RESEARCH_START
    constant unitevent EVENT_UNIT_RESEARCH_CANCEL
    constant unitevent EVENT_UNIT_RESEARCH_FINISH
                                                                        
    constant unitevent EVENT_UNIT_ISSUED_ORDER 
    constant unitevent EVENT_UNIT_ISSUED_POINT_ORDER
    constant unitevent EVENT_UNIT_ISSUED_TARGET_ORDER
                                                                       
    constant unitevent EVENT_UNIT_HERO_LEVEL
    constant unitevent EVENT_UNIT_HERO_SKILL
                                                                        
    constant unitevent EVENT_UNIT_HERO_REVIVABLE
    constant unitevent EVENT_UNIT_HERO_REVIVE_START
    constant unitevent EVENT_UNIT_HERO_REVIVE_CANCEL
    constant unitevent EVENT_UNIT_HERO_REVIVE_FINISH
                                                                        
    constant unitevent EVENT_UNIT_SUMMON
                                                                        
    constant unitevent EVENT_UNIT_DROP_ITEM
    constant unitevent EVENT_UNIT_PICKUP_ITEM
    constant unitevent EVENT_UNIT_USE_ITEM
Search for what you want to detect, and use the "EVENT_UNIT_WHATEVER" of that.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
That native does not require a unit, so you don't write anything there.
JASS:
native TriggerRegisterPlayerUnitEvent takes trigger whichTrigger, player whichPlayer, playerunitevent whichPlayerUnitEvent, boolexpr filter returns event

Player: which player's units you wish to detect (from Player(0) to Player(15) ).
Boolexpr: you can write "null" in there.
Playerevent list:

JASS:
// EVENT_PLAYER_UNIT

    constant playerunitevent EVENT_PLAYER_UNIT_ATTACKED
    constant playerunitevent EVENT_PLAYER_UNIT_RESCUED

    constant playerunitevent EVENT_PLAYER_UNIT_DEATH
    constant playerunitevent EVENT_PLAYER_UNIT_DECAY

    constant playerunitevent EVENT_PLAYER_UNIT_DETECTED
    constant playerunitevent EVENT_PLAYER_UNIT_HIDDEN

    constant playerunitevent EVENT_PLAYER_UNIT_SELECTED
    constant playerunitevent EVENT_PLAYER_UNIT_DESELECTED

    constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_START
    constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL
    constant playerunitevent EVENT_PLAYER_UNIT_CONSTRUCT_FINISH

    constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_START
    constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_CANCEL
    constant playerunitevent EVENT_PLAYER_UNIT_UPGRADE_FINISH

    constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_START
    constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_CANCEL
    constant playerunitevent EVENT_PLAYER_UNIT_TRAIN_FINISH

    constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_START
    constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_CANCEL
    constant playerunitevent EVENT_PLAYER_UNIT_RESEARCH_FINISH
    constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_ORDER
    constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER
    constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER
    constant playerunitevent EVENT_PLAYER_UNIT_ISSUED_UNIT_ORDER

    constant playerunitevent EVENT_PLAYER_HERO_LEVEL
    constant playerunitevent EVENT_PLAYER_HERO_SKILL

    constant playerunitevent EVENT_PLAYER_HERO_REVIVABLE

    constant playerunitevent EVENT_PLAYER_HERO_REVIVE_START
    constant playerunitevent EVENT_PLAYER_HERO_REVIVE_CANCEL
    constant playerunitevent EVENT_PLAYER_HERO_REVIVE_FINISH
    constant playerunitevent EVENT_PLAYER_UNIT_SUMMON
    constant playerunitevent EVENT_PLAYER_UNIT_DROP_ITEM
    constant playerunitevent EVENT_PLAYER_UNIT_PICKUP_ITEM 
    constant playerunitevent EVENT_PLAYER_UNIT_USE_ITEM

    constant playerunitevent EVENT_PLAYER_UNIT_LOADED

You could've created the event in GUI and then converted it to JASS, that should've instantly given you the answer.
You sure you're going to be okay by the way?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Do you have JNGP (Jass NewGen Project)?
In that editor, you can right-click on any function to see how they work.
When you right-click the BJ that registers any unit action, you will see how you can use the native for that.

In my previous post, I also explained which native you could use and explained the values, maybe you should pay some attention to that? :p

In any case: using the BJ for "get any unit action" isn't even a bad BJ, you can use that if you wish.
 
Status
Not open for further replies.
Top