1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

(1.31) Custom script: "Any unit takes damage" event

Discussion in 'World Editor Help Zone' started by Setokaiva, Jun 3, 2019.

  1. Setokaiva

    Setokaiva

    Joined:
    Sep 15, 2011
    Messages:
    48
    Resources:
    0
    Resources:
    0
    The recent patch to 1.31 had, in the notes, a reference to new capability for custom scripts to detect when any unit is damaged for a trigger event. Does anyone know how exactly I would write such an event in custom script?
     
  2. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,474
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    The same as with any player unit event.
    Code (vJASS):
    call TriggerRegisterPlayerUnitEvent(YourTrigger, YourPlayer, EVENT_PLAYER_UNIT_DAMAGED, null)

    Note this was constructed for the 1.31 PTR, I have not updated the native list of the program I used to look up the names for 1.31 release.
     
  3. Setokaiva

    Setokaiva

    Joined:
    Sep 15, 2011
    Messages:
    48
    Resources:
    0
    Resources:
    0
    I've never used custom scripts for any player unit event; I've always used GUI. This is why I was asking, because so far, I've used actions to add an event to another trigger to detect unit damage. But I'd rather have a way to do this without needing an indexer. Thanks!
     
  4. Devalut

    Devalut

    Joined:
    Feb 9, 2009
    Messages:
    778
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Bribe released his damage engine 5.0.0.0 that no longer requires his unit indexer!