• 🏆 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] How to make MUI

Status
Not open for further replies.
Level 9
Joined
Aug 1, 2008
Messages
453
How would i make this trigger MUI so it wouldn't bug if you click on more than 1 mine at a time. And i know it leaks.


  • Detonate Mine
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Goblin Land Mine
      • (Owner of (Triggering unit)) Equal to (Owner of (Triggering unit))
    • Actions
      • Unit - Add a 3.00 second Generic expiration timer to (Triggering unit)
      • Selection - Select Player[(Player number of (Triggering player))]
      • Floating Text - Create floating text that reads 3 at ((Position of (Triggering unit)) offset by (0.00, 0.00)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
      • Wait 1.00 seconds
      • Floating Text - Change text of (Last created floating text) to 2 using font size 10.00
      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
      • Wait 1.00 seconds
      • Floating Text - Change text of (Last created floating text) to 1 using font size 10.00
      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
      • Wait 1.00 seconds
      • Floating Text - Destroy (Last created floating text)
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
EDIT: Remade whole trigger.

Copy this into your Map Custom Script
JASS:
function TimerTag takes unit target, integer time returns nothing
    local integer i = 0        
    local texttag q = CreateTextTag()
    call SetTextTagPosUnit(q, target, 10.00)
    call SetTextTagPermanent( q, false )
    call SetTextTagColor(q, 255, 155, 100, 255)
    call SetTextTagLifespan(q, time)
    call SetTextTagVisibility(q, true)
    loop
    exitwhen i==time
        call SetTextTagText(q, I2S(time - i), 0.046)
        call PolledWait(1)
        set i = i + 1
    endloop
    call SetWidgetLife(target, -1)
    set q = null
endfunction

  • FloatingText
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • -------- Add whatever Conditions you need --------
      • -------- You can call TimerTag function like this; First argument is unit which will get his text while second is his lifespan --------
      • Custom script: call TimerTag(GetTriggerUnit(), 3)
 
Last edited:
Status
Not open for further replies.
Top