• 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.

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

Status
Not open for further replies.
Level 6
Joined
Mar 9, 2009
Messages
175
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:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
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.
 
Level 6
Joined
Mar 9, 2009
Messages
175
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.

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
 
Level 6
Joined
Mar 9, 2009
Messages
175
Level 6
Joined
Mar 9, 2009
Messages
175
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?
 
Level 6
Joined
Mar 9, 2009
Messages
175
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:
Level 9
Joined
Nov 19, 2011
Messages
516
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.

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

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:
Level 6
Joined
Mar 9, 2009
Messages
175
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~~

  • 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)

Hey maker , I have to use this for ?
 
Last edited by a moderator:
Level 11
Joined
Nov 15, 2007
Messages
800
I think this is what you're looking for.


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

  • 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

  • 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)
 
Level 6
Joined
Mar 9, 2009
Messages
175
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:
Level 10
Joined
May 28, 2011
Messages
455
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.
 
Level 11
Joined
Nov 15, 2007
Messages
800
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

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.
 
Level 11
Joined
Nov 15, 2007
Messages
800
It isn't a variable. This is what you should be seeing.

asdf.jpg
 
Level 6
Joined
Mar 9, 2009
Messages
175
why mine cant choose triggering unit in function in the Key Handle @@?

  • (Load (Integer A) of (Key Triggering unit) from Hashtable) Greater than RealVariable
 
Status
Not open for further replies.
Top