- Joined
- Jul 10, 2009
- Messages
- 12
I am in the process of creating a simple threat system using only the game's script (no custom), but have run into a wall... for some reason the integer won't set itself to the damage dealt, instead it puts out a one (using a trigger i utilized a health-changing arithmatic function of health = (Damage dealt) + 1; this only allowed the unit 2 health, no matter which type of attack i attacked the opponent with). I've determined that multiplying the equation by 10 still yields a one, that weapon/attack type doesn't seem to matter, and that the trigger seems to be affecting the right units.
Could someone tell me why exactly this isn't working? I'm SURE it's my inexperience with variables. Any help would be appreciated and give +rep.
~Edit 1: Followed Pharaoh's suggestion and removed an event, although the problem still persists.
~edit 2: Two reasons; number one, bumping the thread, number two is that i *finally* thought of something. Ok, does the computer continue attacking its last target before going to a different target? IE: does it follow through with an attack, and until that attack is done won't issue another order? (sort of a trigger que i suppose)
-
Threat
-
Events
-
Unit - Footman 0000 <gen> Takes damage
-
-
Conditions
-
(Attacking unit) Equal to Rifleman 0001 <gen>
-
-
Actions
-
Set threatP1prevalue = ThreatP1
-
Set ThreatP1 = (threatP1prevalue + (Damage taken))
-
Unit - Set life of Knight 0008 <gen> to (1.00 + ThreatP1)
-
-
-
attackp2
-
Events
-
Time - Every 4.00 seconds of game time
-
-
Conditions
-
Actions
-
If (ThreatP1 Greater than threat2) then do (Unit - Move Footman 0000 <gen> instantly to (Center of TopGunp1 <gen>)) else do (If (threat2 Greater than ThreatP1) then do (Unit - Move Footman 0000 <gen> instantly to (Center of BottomBowp2 <gen>)) else do (Do nothing))
-
-
Could someone tell me why exactly this isn't working? I'm SURE it's my inexperience with variables. Any help would be appreciated and give +rep.
~Edit 1: Followed Pharaoh's suggestion and removed an event, although the problem still persists.
~edit 2: Two reasons; number one, bumping the thread, number two is that i *finally* thought of something. Ok, does the computer continue attacking its last target before going to a different target? IE: does it follow through with an attack, and until that attack is done won't issue another order? (sort of a trigger que i suppose)
Last edited: