1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

life into damage

Discussion in 'World Editor Help Zone' started by turtlelink2, Apr 7, 2010.

  1. turtlelink2

    turtlelink2

    Joined:
    Jun 14, 2008
    Messages:
    72
    Resources:
    0
    Resources:
    0
    Hello i need a trigger that makes it when a type of unit loses life it does more damage, i cant figure out how to make it for every 4 life it loses it does 1 extra damage.
     
  2. ZiggyMcjoney

    ZiggyMcjoney

    Joined:
    May 4, 2008
    Messages:
    109
    Resources:
    1
    Maps:
    1
    Resources:
    1
    You need to use a Damage Detection system.

    Simplest way to make one yourself is to just do this

    Code (Text):
    Events
     Unit enters playable map area

    Actions
     Add the event "(Entering unit) Takes damage" to <YOUR TRIGGER>
    You will also want to do this at map initialization:

    Code (Text):
    Events
     Map initialization

    Actions
     Set Temp_Group = Units in (Playable map area)
     Unit Group - Pick every unit in Temp_Group and do:
      Loop - (Actions):
       Add the event "(Entering unit) Takes damage" to <YOUR TRIGGER>
     Custom Script: call DestroyGroup(udg_Temp_Group)
    However, you will need to be careful, because if a unit re-enters the map, the event will be added twice so the trigger will fire off twice. To get around this, you can add a Dummy Ability that does nothing, and that can't be seen (Base it off of an item ability like Item Armour Bonus), to these triggers, and then make a condition check that the entering unit does not have that ability, else it will not fire.

    THE EASIER WAY TO DO THAT:
    Download a damage detection system. Search them up, there's several on Hive and on other websites too - I don't use one, so I can't recommend any.

    Anyways, from there on, you have your trigger that does the actions:

    Code (Text):
    Events
     (none, because it is added through another trigger)

    Conditions
     Level of <ABILITY> for (Damage source) Greater than or Equal to 1

    Actions
     Cause (Damage source) to damage (Triggering unit) for (((Max life of (Damage source)) - (Current life of (Damage source)) / 4)
    Hope that makes sense.
     
  3. Acutesharpness

    Acutesharpness

    Joined:
    Aug 14, 2007
    Messages:
    927
    Resources:
    3
    Maps:
    3
    Resources:
    3
    There is a simplier way

    You need a unit ability, damage bonus (item ability), make it 100 levels, each level with 1 damage increment

    You need a trigger that activates Trigger2

    Then

    Trigger2(disabled at start)

    Every 0.5 seconds of the game

    local int life = 0
    local real lifemissing = 0

    set lifemissing = unit maxlife - unit currentlife
    life = converttoINT(lifemissing/4)
    if (level of item damage bonus <1)
    add item damage bonus to unit
    endif
    set damage bonus of unit to life


    Hope you get it, sorry about no trigger tags =(
     
  4. turtlelink2

    turtlelink2

    Joined:
    Jun 14, 2008
    Messages:
    72
    Resources:
    0
    Resources:
    0
    could you explain that a little more clear i get what your saying but its not totaly making sence... could u do trigger tags n' stuff?
     
  5. Acutesharpness

    Acutesharpness

    Joined:
    Aug 14, 2007
    Messages:
    927
    Resources:
    3
    Maps:
    3
    Resources:
    3
    Trigger1

    A unit learn a skill

    Skill learn = Dying Rage

    Actions
    Set unit = triggering Unit
    turn Trigger2 on


    Trigger2(Initially off)
     
  6. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    That's definately not the way to do it for several reasons.
     
  7. turtlelink2

    turtlelink2

    Joined:
    Jun 14, 2008
    Messages:
    72
    Resources:
    0
    Resources:
    0
    So then what do you suggest?