• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] UI threat system issue

Status
Not open for further replies.
Level 2
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.
  • 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))
The current reason for the "move" and the health modifications are to allow me to "see" the values. Unfortunately they are failing on both the visible and internal levels it seems... also note the pre-value stuff isn't the issue, it happens with or without that. All the variables are real and set to the default value of zero until triggers are applied

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:
Level 2
Joined
Jul 10, 2009
Messages
12
Okay, but with or without that it still refuses to work >.< Thanks for the advice anyway though... at least there is one less (possible) issue now
 
Status
Not open for further replies.
Top