Damage Variable?

Kalder

New Member
Reaction score
1
Is there a way to set the damage of a unit or a spell into a variable? because I would like to know how to do this for my GUI Critical strike spell Attempt. Thank you for any information given on this Variable. :)
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
you cannot get the damage a unit is dealing with an attack. at least not easy and effective, there is one way but i wouldnt recommend it especially not to a newbie.
 

canons200

New Member
Reaction score
50
If there is a way to detect the event and match all the condition, there is a way to store the variable. What kind of event and condition you expect?
 

Kalder

New Member
Reaction score
1
What exactly...?

What exactly do you mean in your post canons200? What i want exactly is that when a unit learns the ability it stores them in a variable then every 0.01 seconds of game time after when they attack it will check what the attack damage of that unit stored in that variable is and then cause the attacking unit to damage the attacked unit for the the attacking units Base damage+Bonuses x the multiplier set for that level of the spell and also play an attack animation.

P.S I can post an example of my current trigger if i need to :)

So basically i just need to know how to store the attack damage of a unit or unit variable into a real or integer or some kind of variable.

P.S.S Thank you for any help on this complicated subject:thup::D:thup:
 

tommerbob

Minecraft. :D
Reaction score
110
You need a damage dection system. And you would have to distinguish between regular attack damage and your spell damage. Your trigger would look something like this:

Event
- GDD_Damage Equal to 0
Conditions
- GDD_DamageSource Equal to [your unit]
- [any other conditions you want]
Actions
- Set Temp_Damage = GDD_Damage

Now your Temp_Damage Real variable will track the current damage dealt to a unit.
 

Gwafu

Active Member
Reaction score
12
/@ tommerbob : there is no event like that

/@ Kalder : well, I used a very complicated variable setting on a map ^_^
You will need 4 Variables with array.
1 Unit - Type variable
5 Integer Variable (Damage Base, Number of Dice, Sides per die, Minimum Damage, Maximum Damage)

You will set this on the map init.
Trigger:
  • Set Unit-Type [1] = Peasant
    • Set Damage_Base [1] = (Damage base of the unit)
    • Set Number_of_Dice [1] = (Number of Dice of the unit)
    • Set Sides_Per_Die [1] = (Sides per die of the unit)
    • You will need to set this for every unit type you will do.
    • Then if for the action for your trigger.
    • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">Trigger:</div><div class="wc3trigger"><ul class="wc3" id="wc3_1">
    • <li class="lastopen"><span class="foreach">For each (Integer A) from 1 to 999, do (Actions)</span>
    • <ul>
    • <li class="lastopen"><span class="loop">Loop - Actions</span>
    • <ul>
    • <li class="lastopen"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lasttree"><span class="default">(Unit-type of (Triggering unit)) Equal to Unit-Type [Integer A]</span></li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="set">Set Minimum Damage [Integer A] = ((Damage_Base [Integer A]) + (Number_of_Dice [Integer A]))</span></li>
    • <li class="lasttree"><span class="set">Set Maximum Damage [Integer A] = ((Damage_Base [Integer A]) + ((Number_of_Dice [Integer A]) x (Sides_Per_Die [Integer A]))</span></li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </div></div>
    • Then do the rest. You&#039;ll need common sense <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue :p" loading="lazy" data-shortname=":p" />
 

Kalder

New Member
Reaction score
1
Cool!

I do agree your system is very complicated Gwafu :) but i can't seem to find the damage base or number of dice, etc. in the set variable window

@CAPSLOCKFTW:I'll check out your way now.:D
 

CAPSLOCKFTW

Member
Reaction score
5
Just incase you can't find it::)
Trigger:
  • Set DMG = ((Max life of (Attacked unit)) - (Life of (Attacked unit)))


EDIT:DMG is a real!

Then just
event - unit is attacked
condition - the unit who has critical
action - set DMG
"Create floating text at attacked unit showing "Value Of DMG""

or something like that
 

tommerbob

Minecraft. :D
Reaction score
110
@Gwafu: Yes there is an event like that. That's why he needs a damage detection system. His work will be 20 times easier once he gets it. Your system is WAY more complicated than it needs to be.

@Kalder: Go here, download the system, and follow the instructions to implement it into your map. The damage detection system is meant for the exact thing you need.

Once you have implemented the system in your map, make a new trigger that will look like this:

Trigger:
  • Events
    • GDD_Event Equal to 0.00
    • Conditions
      • GDD_DamageSource Equal to [your unit]
    • Actions
      • Set Temp_Damage [a Real variable] = GDD_Damage
      • Game - Display to (all players) the text: ((integer)Temp_Damage)


I did that freehand, so it may not be exact, but its close.

The trigger will display the damage you dealt to the unit, and you can store that damage in variables to manipulate as you want.
 

Kalder

New Member
Reaction score
1
Thx!

@CAPLOCKSFTW, Gwafu, tommerbob:Thx! but i like tommerbob's idea the most (sorry other's :D:( ) . And i have heard about GDD before and it seems like it works so tommerbob thx! and thx others and +rep ( tommerbob )
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top