Hey, so im tryign to get some crit hit triggers in my map and tryin to make it easy to edit/change if needed for balance instead of havign to edit the whole thing all over, so i have a general gameplay settings trigger which sets those vars at the beggining of the match
CritBase = 2.5
HSbase = 1.5
BlockBase = 5.0
and here when i come to my CritStrike Trigger, heres wat it looks like
EVENT
any unit takes dmg and w/e
LOCAL VARS
Crit_Rand_Num = 0
Crit_Damage = 0
CONDITIONS
Unit type of damaging unit is hero == true
ACTIONS
Variable - set (Crit_Rand_Num) to random between 0.0 and 100.0
======NOW HERES THE FIRST PROBLEM
I need to compare stuff like this
IF (Crit_Rand_Num) <= (CritBase) ========== Later on will come different modifiers that will add to the base crit chance, but right now i just wanna get this to work
THEN ===========HERE COMES THE SECOND PROBLEM
I cant get to simply add a modifier to the damage value, i could get to compare the damage value with something in conditions, but in actions i cant find no way to get the damage value and simply do like 1.5*Damage or somethign liek this, so i had to go with a very poor way to do this which goes like this (very poor way to do this and may turn out very buggy)
Set property [life] of [triggering unit] to arithemtic [property [current] [life] of [triggering unit]] - real 25
this is a very poor way to implement critical hits and will always make critical hits deal 25 extra damage, i would love to implement it so that it does the maximum weapon damage + 0.5 * maximum weapon damage, but i would easiely settle to simply modify it to 1.5*damage
Why can't you use If Then Else action? I don't understand the problem of comparison. Explain it more, please.
i can, im using if/then/else, but i cant compare my variable with a variable i set in another trigger
i set CritBase (which is the base % to crit) in my gameplay trigger on map initialization
and then i have a trigger for crit that needs to compare a random number (Crit_Rand_Num in this case) to my other var (CritBase)
but i cant reahc the var i set up at the beggining in my Crit trigger
TRIGGER EDITOR
MAP INITIALIZATION
-EVENT game starts
-LOCAL VARS CritBase = 0
-CONDITONS
-ACTIONS set (CritBase = Real 2.5)
CRITICAL HITS
-EVENT any unit takes any dmg
-LOCAL VARS Crit_Rand_Num = 0
-CONDITIONS Source of damage is Hero == True
-ACTIONS
-()-set Crit_Rand_Num = Random Real between 0.0 and 100.0
-()-IF [Crit_Rand_Num] <= [CritBase] + [CritBonus] ~~~~~ here i cant compare it, becaus ei cant get CritBase sinc ei set it in another trigger, any way to actually get it, without having to add it to local variables and restting it to 0?
-()-THEN Extra damage
-()-ELSE Do nothing
... this thing where it always do bold if u do 2* and crossed text if u do 2- is annoyign is there anyway to deactivate that?
Apparently you're using local variables... Every time the trigger runs, its own local variables are created, and when it finishes, the local variables are destroyed. you need to create GLOBAL variables - Theyre supposed to be in the same place where your triggers and folders are. Global variables can be used in all triggers and dont get wiped after the trigger runs.
And for the damage amount... First, create a dummy damage effect in the data editor (just make it do 0 damage, and thats it). Then as the action use the new "deal damage" action, and set its bonus to something like triggering damage * what you need (this is bonus to the already dealt damage, if you want your hits to do 150% total damage, then multiply by 0.5)
Hey, so im tryign to get some crit hit triggers in my map and tryin to make it easy to edit/change if needed for balance instead of havign to edit the whole thing all over, so i have a general gameplay settings trigger which sets those vars at the beggining of the match
CritBase = 2.5
HSbase = 1.5
BlockBase = 5.0
and here when i come to my CritStrike Trigger, heres wat it looks like
EVENT
any unit takes dmg and w/e
LOCAL VARS
Crit_Rand_Num = 0 Crit_Damage = 0
CONDITIONS Unit type of damaging unit is hero == true
ACTIONS
Variable - set (Crit_Rand_Num) to random between 0.0 and 100.0
======NOW HERES THE FIRST PROBLEM
I need to compare stuff like this
IF (Crit_Rand_Num) <= (CritBase) ========== Later on will come different modifiers that will add to the base crit chance, but right now i just wanna get this to work
THEN ===========HERE COMES THE SECOND PROBLEM
I cant get to simply add a modifier to the damage value, i could get to compare the damage value with something in conditions, but in actions i cant find no way to get the damage value and simply do like 1.5*Damage or somethign liek this, so i had to go with a very poor way to do this which goes like this (very poor way to do this and may turn out very buggy)
Set property [life] of [triggering unit] to arithemtic [property [current] [life] of [triggering unit]] - real 25
this is a very poor way to implement critical hits and will always make critical hits deal 25 extra damage, i would love to implement it so that it does the maximum weapon damage + 0.5 * maximum weapon damage, but i would easiely settle to simply modify it to 1.5*damage
ELSE do nothing
You can just take damage taken that takes the amount of damage dealt to the unit.
@saumee: Go
Why can't you use If Then Else action? I don't understand the problem of comparison. Explain it more, please.
i can, im using if/then/else, but i cant compare my variable with a variable i set in another trigger
i set CritBase (which is the base % to crit) in my gameplay trigger on map initialization
and then i have a trigger for crit that needs to compare a random number (Crit_Rand_Num in this case) to my other var (CritBase)
but i cant reahc the var i set up at the beggining in my Crit trigger
TRIGGER EDITOR
MAP INITIALIZATION
-EVENT game starts
-LOCAL VARS CritBase = 0
-CONDITONS
-ACTIONS set (CritBase = Real 2.5)
CRITICAL HITS
-EVENT any unit takes any dmg
-LOCAL VARS Crit_Rand_Num = 0
-CONDITIONS Source of damage is Hero == True
-ACTIONS
-()-set Crit_Rand_Num = Random Real between 0.0 and 100.0
-()-IF [Crit_Rand_Num] <= [CritBase] + [CritBonus] ~~~~~ here i cant compare it, becaus ei cant get CritBase sinc ei set it in another trigger, any way to actually get it, without having to add it to local variables and restting it to 0?
-()-THEN Extra damage
-()-ELSE Do nothing
... this thing where it always do bold if u do 2* and crossed text if u do 2- is annoyign is there anyway to deactivate that?
Apparently you're using local variables... Every time the trigger runs, its own local variables are created, and when it finishes, the local variables are destroyed. you need to create GLOBAL variables - Theyre supposed to be in the same place where your triggers and folders are. Global variables can be used in all triggers and dont get wiped after the trigger runs.
And for the damage amount... First, create a dummy damage effect in the data editor (just make it do 0 damage, and thats it). Then as the action use the new "deal damage" action, and set its bonus to something like triggering damage * what you need (this is bonus to the already dealt damage, if you want your hits to do 150% total damage, then multiply by 0.5)
@TheAlmaity: Go
i dont see any place to create global variables O.o
or would they be the 'Condition Definition'?
Just right-click the area where you create triggers and select new variable
@Kueken531: Go
ohh lol never noticed that -.- thx
Crits should really be done in data.