Exide
I am amazingly focused right now!
- Reaction score
- 448
As the title says, I messed this one up.
Probably some condition or something responsible.
I have this GUI trigger; and tried to optimize it a little:
The idea is to tell the players how many crabs they've killed, and when they killed 10 the trigger turns itself off, and runs another trigger instead.
This one works, but the following doesn't. Again, I think I removed a condition or something too many, somewhere:
Any ideas?
Help appriciated.
Thank you.
Probably some condition or something responsible.
I have this GUI trigger; and tried to optimize it a little:
Code:
Crabs Killed Copy
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying unit)) Equal to Giant Seacrab
Or - Any (Conditions) are true
Conditions
(Owner of (Killing unit)) Equal to Player 1 (Red)
(Owner of (Killing unit)) Equal to Player 2 (Blue)
(Owner of (Killing unit)) Equal to Player 3 (Teal)
(Owner of (Killing unit)) Equal to Player 4 (Purple)
(Owner of (Killing unit)) Equal to Player 5 (Yellow)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Death_Counter Equal to 9
Then - Actions
Set Quest_Hero = (Killing unit)
Set Location = (Center of Andrew Lumber <gen>)
Unit - Order Andrew (Jones' Nephew) 0008 <gen> to Move To Location
Custom script: call RemoveLocation(udg_Location)
Trigger - Turn off Crabs Respawn <gen>
Trigger - Turn off (This trigger)
Skip remaining actions
Else - Actions
Set Death_Counter = (Death_Counter + 1)
Game - Display to All_Players for 3.00 seconds the text: <Empty String>
Game - Display to All_Players for 3.00 seconds the text: ((|cff32cd32 + (String(Death_Counter))) + /10 crabs killed!|r)
The idea is to tell the players how many crabs they've killed, and when they killed 10 the trigger turns itself off, and runs another trigger instead.
This one works, but the following doesn't. Again, I think I removed a condition or something too many, somewhere:
JASS:
function Trig_Crabs_Killed_Func006C takes nothing returns boolean
local integer id = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
return id<5
endfunction
function Trig_Crabs_Killed_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 039;n003039; ) ) then
return false
endif
if ( not Trig_Crabs_Killed_Func006C() ) then
return false
endif
return true
endfunction
function Trig_Crabs_Killed_Actions takes nothing returns nothing
local location loc = GetRectCenter(gg_rct_Andrew_Lumber)
if ( (udg_Death_Counter >= 9) ) then
set udg_Quest_Hero = GetKillingUnit()
set udg_Location = GetRectCenter(gg_rct_Andrew_Lumber)
call IssuePointOrderLocBJ( gg_unit_h005_0008, "move", loc )
call DisableTrigger( gg_trg_Crabs_Respawn )
call DisableTrigger( GetTriggeringTrigger() )
return
endif
call RemoveLocation(loc)
set loc = null
set udg_Death_Counter = ( udg_Death_Counter + 1 )
call DisplayTimedTextToForce( udg_All_Players, 3.00, " " )
call DisplayTimedTextToForce( udg_All_Players, 3.00, ( ( "|cff32cd32" + I2S(udg_Death_Counter) ) + "/10 crabs killed!|r" ) )
endfunction
//===========================================================================
function InitTrig_Crabs_Killed takes nothing returns nothing
set gg_trg_Crabs_Killed = CreateTrigger( )
call DisableTrigger( gg_trg_Crabs_Killed )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Crabs_Killed, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Crabs_Killed, Condition( function Trig_Crabs_Killed_Conditions ) )
call TriggerAddAction( gg_trg_Crabs_Killed, function Trig_Crabs_Killed_Actions )
endfunction
Any ideas?
Help appriciated.
Thank you.