• 🏆 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!

Loop question

Status
Not open for further replies.
Level 5
Joined
Mar 24, 2020
Messages
80
Hello Hive,

I'm getting back into map making, so apologies about the noob question as I can't remember the best way of doing this.

Basically, trigger 1 sets the value of an ability based on hero attributes. Trigger 2 loops a floating text showing the heals received on top of the unit.
Trigger 1 fires trigger 2, but it only works for player 1 currently and only if the ability is used once at a time.

I need help making trigger 2 uniquely work for each time the ability is cast. I know this can be linked with a damage machine and a floating text system, but i would like to learn better how to create loops that work uniquely.

Let me know if you can help! Cheers.


  • Trigger 1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Regeneration
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Regeneration for (Casting unit)) Equal to 1
        • Then - Actions
          • Ability - Set Ability: (Unit: (Casting unit)'s Ability with Ability Code: Regeneration )'s Real Level Field: Hit Points Gained ('Rej1') of Level: 0 to (((Real((Intelligence of (Triggering unit) (Include bonuses)))) x 1.00) x 5.00)
          • Set VariableSet TempString = (String(((Intelligence of (Casting unit) (Include bonuses)) x 1)))
          • Set VariableSet RegenerationUnit[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
          • Set VariableSet Regeneration[(Player number of (Owner of (Triggering unit)))] = 0
          • Trigger - Run Regeneration Floating <gen> (checking conditions)
        • Else - Actions

  • Trigger 2 - Floating Text Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (RegenerationUnit[1] is alive) Equal to True
              • Regeneration[1] Less than 5
            • Then - Actions
              • Set VariableSet TempPoint = (Position of RegenerationUnit[1])
              • Floating Text - Create floating text that reads TempString at TempPoint with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
              • Floating Text - Hide (Last created floating text) for (All players)
              • Floating Text - Show (Last created floating text) for (All players)
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
              • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Set VariableSet Regeneration[1] = (Regeneration[1] + 1)
            • Else - Actions
              • Trigger - Turn off (This trigger)
        • Else - Actions

Cheers!
 
Status
Not open for further replies.
Top