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

[Trigger] Minor trigger issue, floating text not working properly.

Status
Not open for further replies.
Level 1
Joined
Sep 10, 2008
Messages
1
Hi!

The following trigger is supposed to create a floating text over a unit every 10 seconds, but only as long as the unit is on the map. For some reason the floating text is created in the center of the map in the beginning of the game, even though the condition isn't fulfilled (nobody has got the unit yet). As soon as a player gets the unit, where the text is supposed to be, the problem is solved and the text is displayed at the correct position.

  • Eriks Tower
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Group = (Units of type Gåård's Cubade Morsa (Erik))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Playable map area) contains (Random unit from Temp_Group)) Equal to True
        • Then - Actions
          • Floating Text - Create floating text that reads Eriks_Tower[(Random integer number between 1 and 14)] above (Random unit from Temp_Group) with Z offset 0.00, using font size 7.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Wait 5.00 seconds
          • Floating Text - Destroy (Last created floating text)
        • Else - Actions
          • Do nothing
      • Custom script: call DestroyGroup (udg_Temp_Group)
Guess that the condition isn't working properly. Anyone who can tell me what's wrong or what condition I should pick?

Regards,

McLovin
 
Last edited by a moderator:
Level 18
Joined
Aug 23, 2008
Messages
2,319
Try placing the condition under
  • Conditions
instead of in the If/Then/Else command.

If that doesn't work, destroy the floating text at the Melee Initialization or the beginning of the trigger you posted if it returns every 10 seconds.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
  • Create Text
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units of type Footman) and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Playable map area) contains (Picked unit)) Equal to (==) True
            • Then - Actions
              • Floating Text - Create floating text that reads blah above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
            • Else - Actions
This will generally do what you want. Will work for one unit and for as much as you want.
 
Status
Not open for further replies.
Top