how do i make this mui?

AKDevil

New Member
Reaction score
1
How Do i make this MUI? just trying to make it revive dead heroes with a timer.


Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • (Player number of (Owner of (Dying unit))) Greater than or equal to 3
      • (Player number of (Owner of (Dying unit))) Less than or equal to 12
    • Actions
      • Countdown Timer - Start ReviveTimer as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 5.00) seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Your Revival.
      • Countdown Timer - Show (Last created timer window) for Player 1 (Red)
      • Set Revive_Timer[(Player number of (Owner of (Dying unit)))] = ReviveTimer
      • Wait until ((Remaining time for Revive_Timer[(Player number of (Owner of (Picked unit)))]) Equal to 0.00), checking every 1.00 seconds
      • Countdown Timer - Destroy (Last created timer window)
      • Hero - Instantly revive (Dying unit) at (Center of (Playable map area)), Show revival graphics
 

jig7c

Stop reading me...-statement
Reaction score
123
there is no Picked Unit!
Trigger:
  • Wait until ((Remaining time for Revive_Timer[(Player number of (Owner of (Picked unit)))]) Equal to 0.00), checking every 1.00 seconds



location leak
Trigger:
  • Hero - Instantly revive (Dying unit) at (Center of (Playable map area)), Show revival graphics
 

AKDevil

New Member
Reaction score
1
well i had more, then deleted some, must have forgot that, lol, but stillhow do i make it MUI, and am i on the right track?
 

Carnerox

The one and only.
Reaction score
84
Trigger:
  • set TempPoint = (center of (playable map area)


Trigger:
  • set DyingUnit[Triggering Player] = (Triggering Unit)


Trigger:
  • Wait until ((Remaining time for Revive_Timer[(Owner of (DyingUnit[Triggering player))]) Equal to 0.00), checking every 1.00 seconds


Trigger:
  • call RemoveLocation (udg_TemPoint)


Trigger:
  • Countdown Timer - Show (Last created timer window) for (Owner of (DyiningUnit[Triggering Player]))


Trigger:
  • Countdown Timer - Pause (Revive_Timer[Owner of (DyingUnit[Triggering Player]))
 

ZiggyMcjoney

Data editor?! AAAHHHHH!
Reaction score
95
Trigger:
  • set TempPoint = (center of (playable map area)

Trigger:
  • set DyingUnit[Triggering Player] = (Triggering Unit)

Trigger:
  • Wait until ((Remaining time for Revive_Timer[(Owner of (DyingUnit[Triggering player))]) Equal to 0.00), checking every 1.00 seconds

Trigger:
  • call RemoveLocation (udg_TemPoint)

Trigger:
  • Countdown Timer - Show (Last created timer window) for (Owner of (DyiningUnit[Triggering Player]))

Trigger:
  • Countdown Timer - Pause (Revive_Timer[Owner of (DyingUnit[Triggering Player]))

That isn't MUI, it is MPI. If the OP wants players to have more than one hero at a time, this will not work.
 

Carnerox

The one and only.
Reaction score
84
What makes it not work?

any way I'm not that good at MUI GUI, only jass. :(
 

ZiggyMcjoney

Data editor?! AAAHHHHH!
Reaction score
95
Set DyingUnit[Player number of (Owner of (Triggering unit))] = (Triggering unit)

If you do this, and another hero owned by the same player dies, the variable will be overwritten.

What's more is thati n your example you've used "Triggering player", which is not an integer and therefor cannot be an index, and there is no Triggering player in the event anyway.

As far as actually making the trigger MUI goes, the only way I can think of would be to use JASS.
 

Carnerox

The one and only.
Reaction score
84
JASS:
function Trig_Revive_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local player o = GetOwningPlayer(u)
    local timer t
    local timerdialog d
    local location l = GetRectCenter(GetPlayableMapRect())
    if (IsUnitType(u, UNIT_TYPE_HERO) == true) then
    if (GetConvertedPlayerId(o)) <= 12) then
    if (GetConvertedPlayerId(o)) >= 3) then
    set t = CreateTimer()
    set d = CreateTimerDialog(t)
    call TimerStart (t, (5.00 * (I2R(GetHeroLevel(u)))), false, null)
    call CreateTimerDialog (t)
    call TimerDialogSetTitle (d, "Revive Time.")
    call TimerDialogDisplay (d, true)
    loop
        exitwhen (TimerGetRemaining(t) <= 0.00 )
        call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1))
    endloop
    call DestroyTimer (t)
    call DestroyTimerDialog (d)
    call ReviveHeroLoc (u, l, true)
    endif
    endif
    endif
    set u=null
    set t=null
    set d=null
    call RemoveLocation (l)
endfunction

function InitTrig_Revive takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ (trig, EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddAction (trig, function Trig_Revive_Actions)
endfunction
 

jig7c

Stop reading me...-statement
Reaction score
123
where is
Trigger:
  • (Player number of (Owner of (Dying unit))) Greater than or equal to 3
    • (Player number of (Owner of (Dying unit))) Less than or equal to 12

in the above script?
 

Chaos_Knight

New Member
Reaction score
39
JASS:
function Trig_Revive_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local player o = GetOwningPlayer(u)
    local timer t
    local timerdialog d
    local location l = GetRectCenter(GetPlayableMapRect())
    if (IsUnitType(u, UNIT_TYPE_HERO) == true) then
    if (GetConvertedPlayerId(o)) <= 12) then
    if (GetConvertedPlayerId(o)) >= 3) then
    set t = CreateTimer()
    set d = CreateTimerDialog(t)
    call TimerStart (t, (5.00 * (I2R(GetHeroLevel(u)))), false, null)
    call CreateTimerDialog (t)
    call TimerDialogSetTitle (d, "Revive Time.")
    call TimerDialogDisplay (d, true)
    loop
        exitwhen (TimerGetRemaining(t) <= 0.00 )
        call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1))
    endloop
    call DestroyTimer (t)
    call DestroyTimerDialog (d)
    call ReviveHeroLoc (u, l, true)
    endif
    endif
    endif
    set u=null
    set t=null
    set d=null
    call RemoveLocation (l)
endfunction

function InitTrig_Revive takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ (trig, EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddAction (trig, function Trig_Revive_Actions)
endfunction

Hand written?
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
Don't use waits. Especially not for revive timers. ... I mean; you already got the timers, so why not using the expire event instead of buggy conditional waits?
 

jig7c

Stop reading me...-statement
Reaction score
123
the player index needs to be number zero, not the letter o...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top