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. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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.

How to make, player who do more damage the unit belong to the player?

Discussion in 'World Editor Help Zone' started by o2bryan, Dec 27, 2011.

  1. o2bryan

    o2bryan

    Joined:
    Mar 9, 2009
    Messages:
    173
    Resources:
    0
    Resources:
    0
    How to make, player who do more damage on the unit,the unit belong to the player?

    New Edited**
    To Explain more clearance . Here we go , For example :

    Force 1 ( Player 1(user) and Player 2 is allied ).
    Force 2 ( Player 3(user) and Player 4 is allied ). Okay here is done .

    Next ,
    Player 1 and Player 3 is User playing but not same forces ,Player 2 and Player 4 is close/nobody ,

    so when Player 1(user) unit damage the on Neutral Hostile Unit until 40% of the Neutral Hostile Unit life left and at the same time Player 3(user) unit also damage on the Neutral Hostile Unit for another 40% , for which player dealt the more damage on the Neutral Hostile unit ,then the Neutral Hostile Unit after it dies it change belong to the player which dealt the more damage in damaging

    Last ,player 1(user) dealt the more damage on the Neutral Hostile Unit ,it change to player 2(allied). (Not Change to Player 1 ) In other meaning is Player 1(user) helping Player 2 to fight = Player 3(User) helping Player 4 to fight


    Please be noticed , my "damage" is not meant "Attack".




    Kinda complicated for me but I do need you guys help. :eekani:


    Guys please help me I am kinda dumb O__O :vw_wtf:

    Thank you ~:grin::grin:
     
    Last edited: Dec 28, 2011
  2. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,806
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    There are 2 options.
    1. Use a damage detection engine that deals bonus damage based on the damage received if the damage source is owned by the same player as the damaged unit.
    2. Give all units a separate attack for hitting friendly units with.

    I would go with 1 as being the most viable. For whosyourdaddy like damage just deal an extra 999 times received damage.
     
  3. o2bryan

    o2bryan

    Joined:
    Mar 9, 2009
    Messages:
    173
    Resources:
    0
    Resources:
    0
    Hey, hmm I would like to go with 1 but I don't know how to makes the trigger :vw_sleep: ha ha can you give me a sample ?:grin: pleasssssee
     
  4. o2bryan

    o2bryan

    Joined:
    Mar 9, 2009
    Messages:
    173
    Resources:
    0
    Resources:
    0
    Anyone can help me ??
     
  5. -Kobas-

    -Kobas-

    Joined:
    Jan 17, 2010
    Messages:
    5,894
    Resources:
    28
    Icons:
    1
    Tools:
    2
    Maps:
    10
    Spells:
    4
    Template:
    5
    Tutorials:
    6
    Resources:
    28
    Simle one:
    Events:
    - Unit is attacked
    Conditions:
    - Ower of attacking unit equal to owner of triggerting unit (attacked unit).
    Actions:
    - Deal damage to triggering unit
     
  6. o2bryan

    o2bryan

    Joined:
    Mar 9, 2009
    Messages:
    173
    Resources:
    0
    Resources:
    0
    owh is it ? okay i try .
     
  7. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,181
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Use: www.hiveworkshop.com/forums/spells-569/gui-damage-engine-201016/
    Import that one and use this trigger:
    • Untitled Trigger 003
      • Events
        • Game - DamageModifierEvent becomes Equal to 1.00
      • Conditions
        • (Owner of DamageEventSource) Equal to (Owner of DamageEventTarget)
      • Actions
        • Set DamageEventOverride = True
        • Set DamageEventAmount = (DamageEventAmount x 4.00)
     
  8. o2bryan

    o2bryan

    Joined:
    Mar 9, 2009
    Messages:
    173
    Resources:
    0
    Resources:
    0
    okay i will try ^^
     
  9. o2bryan

    o2bryan

    Joined:
    Mar 9, 2009
    Messages:
    173
    Resources:
    0
    Resources:
    0
    Hey Maker, there got 7 trigger which one should I take ?
     
  10. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,181
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Damage Engine and Unit Indexer.
     
  11. o2bryan

    o2bryan

    Joined:
    Mar 9, 2009
    Messages:
    173
    Resources:
    0
    Resources:
    0
    ohh I see , okay then how can I make it relate with my topic/problem ??

    For Example ,

    4 player-hero are attacking the unit , for who do the more damage the unit belongs to the player .

    this problem?


    Edited *
    Hey maker i found some error
    call TimerStart(udg_DmgEvTimer, 0, false, function DmgEvRemoveAbilities)
    whats that?
     
  12. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,181
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    You need to create a timer called DmgEvTimer in variable editor.
     
  13. o2bryan

    o2bryan

    Joined:
    Mar 9, 2009
    Messages:
    173
    Resources:
    0
    Resources:
    0
    okay thanks the error solved , so next what should I do?

    How to make it belong to the player who dealt more damage on the unit ?
    Because i using neutral hostile and which player dealt more damage on the neutral hostile unit , the neutral hostile unit will belongs to the player .

    Please help me i need to use it on my map Y__Y
     
    Last edited: Dec 27, 2011
  14. MajorKaza

    MajorKaza

    Joined:
    Nov 19, 2011
    Messages:
    511
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Why not just go this way:

    variables:
    target: unit;
    x:int;
    Damage[12]: R;
    ==================================================================
    trigger chekc;
    event:
    A unit is attacked;
    conditions:
    Index of (Owner of unit (Triggering unit)) = <<your noumber>>;
    acctions:
    Add [target takes damage] event to [bonus];
    Set x = Index of (Owner of unit (Triggering unit));

    trigger: bonus
    event:
    none;
    conditions:
    none;
    acctions:
    Set Damage[x] = Damage Taken;
    ==================================================================

    This triggers will let you know which player dealt more damage, but has a minor cooldown. If you wont to use it for more than one unit at the same time make variables x and target tables. 20 steps would be enought.

    This will kill unit instantly by fast pressing LPM and 'S', and all damage dealt this way will be bonus damage (no base damage).
     
    Last edited by a moderator: Dec 28, 2011
  15. o2bryan

    o2bryan

    Joined:
    Mar 9, 2009
    Messages:
    173
    Resources:
    0
    Resources:
    0
    Hello Anyone can help me to make a trigger about my question ?

    i using neutral hostile and which player dealt more damage on the neutral hostile unit , the neutral hostile unit will belongs to the player .

    please help me~~

    Hey maker , I have to use this for ?
     
    Last edited by a moderator: Dec 28, 2011
  16. Meticulous

    Meticulous

    Joined:
    Nov 15, 2007
    Messages:
    779
    Resources:
    0
    Resources:
    0
    I think this is what you're looking for.


    Trigger1
    • Hashtable
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Hashtable - Create a hashtable
        • Set Hashtable = (Last created hashtable)



    trigger2
    • Damage storage
      • Events
        • Game - DamageEvent becomes Equal to 1.00
      • Conditions
        • (Owner of DamageEventTarget) Equal to Neutral Hostile
      • Actions
        • Custom script: set udg_IntegerVariable = GetHandleId(udg_DamageEventTarget)
        • Set RealVariable = ((Load (Player number of (Owner of DamageEventSource)) of IntegerVariable from Hashtable) + DamageEventAmount)
        • Hashtable - Save RealVariable as (Player number of (Owner of DamageEventSource)) of IntegerVariable in Hashtable



    trigger3
    • Conversion
      • Events
        • Unit - A unit Dies
      • Conditions
        • (Owner of (Triggering unit)) Equal to Neutral Hostile
      • Actions
        • Set RealVariable = 0.00
        • Set PointVariable = (Position of (Triggering unit))
        • For each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Load (Integer A) of (Key (Triggering unit)) from Hashtable) Greater than RealVariable
              • Then - Actions
                • Set RealVariable = (Load (Integer A) of (Key (Triggering unit)) from Hashtable)
                • Set PlayerVariable = (Player((Integer A)))
              • Else - Actions
        • Unit - Create 1 (Unit-type of (Triggering unit)) for PlayerVariable at PointVariable facing Default building facing degrees
        • Unit - Remove (Triggering unit) from the game
        • Custom script: call RemoveLocation(udg_PointVariable)
     
  17. o2bryan

    o2bryan

    Joined:
    Mar 9, 2009
    Messages:
    173
    Resources:
    0
    Resources:
    0
    Hey Meticulous , so do I need to remove "Damage Engine" or "Indexer" ?


    • (Load (Integer A) of (Key (Triggering unit)) from Hashtable) Greater than RealVariable


    the Triggering unit is "string" or "handle" ?

    Bumps ! Hey guys i just explained more clearer please help me solve my problem check out at my main topic .

    bumps ! please read my question or problem

    bumps again , please read my problem thanks and help me Y__Y
     
    Last edited by a moderator: Dec 28, 2011
  18. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,181
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    You are only allowed to bump threads after 48 hours of inactivity.
     
  19. Heaven Editor

    Heaven Editor

    Joined:
    May 28, 2011
    Messages:
    452
    Resources:
    2
    Maps:
    2
    Resources:
    2
    That is for detecting a damage event. For example, if a unit is damage, the trigger will register so you can detect which unit had done the damage, who took it and the amount of the damage dealt.

    Here what would i do, using hashtable and unit indexer

    Detect attacker (unit), attacked (unit), and the amount of damage (real) using damage engine

    i compare the amount with the previous amount deal to the hostile unit

    if the current amount is higher, then store the attacker in hashtable

    This answer is not specific. but gives you the idea of how can you implement the damage engine.
     
  20. Meticulous

    Meticulous

    Joined:
    Nov 15, 2007
    Messages:
    779
    Resources:
    0
    Resources:
    0
    No, you need the damage engine to detect how much damage is dealt, and you need the indexer for the damage engine to work.

    Triggering unit is a handle.