- Joined
- Feb 11, 2008
- Messages
- 809


I have no idea what has happened because this trigger was functioning perfectly up until now and i made a few revisions using player utils to the code and afterwards its almost like the trigger event is not even firing anymore.
So then i commented out the body of the code to see if it was an error on my part but still the very first BJDebugMsg will not even appear as if the event is not firing????
EDIT*
Also before anything is said about it the dialog displays perfectly fine and the options can be clicked and the dialog that is functioning is set to Dialogs[0] which is in the trigger event here. and like i said it was working perfectly everyday for the last month up until today when i changed a few things in the loop in this trigger which should not have effected it.
EDIT**
After further testing 2 other triggers are also no longer working one dealing with entering a region and the other dealing with players leaving the game.
What could possibly break all 3 triggers events at the same time?? nothing has been changed on the other triggers so i know this is not user error but it has completely stalled my progress.
JASS:
function CheckVote takes nothing returns nothing
// Creating local variables
local button b = GetClickedButton()
local group g = CreateGroup()
local real x = 0.00
local real y = 0.00
local player tp = null
local User p = User.first
local unit u = null
call BJDebugMsg("right after locals are called")
if b == Buttons[0] then
set RemakeYes = RemakeYes + 1
set PlayerCount = PlayerCount - 1
elseif b == Buttons[1] then
set RemakeNo = RemakeNo + 1
set PlayerCount = PlayerCount - 1
endif
call BJDebugMsg("before first if statement")
/*if PlayerCount == 0 then
call BJDebugMsg("after first if statement")
call TimerDialogDisplay(td, false)
if RemakeYes >= RemakeNo then
set GameRemade = true
set PlayerCount = User.AmountPlaying
set Round = 1
set RemakeNo = 0
set RemakeYes = 0
call BJDebugMsg("i might have screwed up")
loop
exitwhen p == User.NULL
set tp = Player(p.id)
call BJDebugMsg("in the player loop")
call DisplayTextToPlayer(tp, 0, 0, "Game Remaking!")
set PlayerCheckpoint[p.id] = 0
set x = GetStartLocationX(p.id)
set y = GetStartLocationY(p.id)
if IsPlayerDead[p.id] == false then
call SetUnitPosition(PlayersHeros[p.id], x, y)
call SetUnitFacing(PlayersHeros[p.id], 0.00)
call SmartCameraPan(tp, x, y, 2.00)
if (User.fromLocal().id == p.id) then
call ClearSelection()
call SelectUnit(PlayersHeros[p.id], true)
endif
else
call ReviveHero(PlayersHeros[p.id], x, y, false)
call SetUnitFacing(PlayersHeros[p.id], 0.00)
call SetUnitPosition(PlayersGraves[p.id], RectCenterX[15], RectCenterY[15])
call SmartCameraPan(tp, x, y, 2.00)
if (User.fromLocal().id == p.id) then
call ClearSelection()
call SelectUnit(PlayersHeros[p.id], true)
endif
set IsPlayerDead[p.id] = false
set PlayersDead = PlayersDead - 1
if CamLock[p.id] == true and (User.fromLocal().id == p.id) then
call SetCameraTargetController(PlayersHeros[p.id], 0, 0, true)
endif
endif
call DisplayTextToPlayer(tp, 0, 0, RoundColors[2] + "Round|r " + "1" + RoundColors[2] + " :|r " + RoundColors[0] + RoundText[0])
set tp = null
set p = p.next
endloop
call BJDebugMsg("after the player loop")
// Setting Enemy Units Back to Normal
call GroupEnumUnitsOfPlayer(g, EnemyController, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call SetUnitMoveSpeed(u, 150.00)
call GroupRemoveUnit(g, u)
endloop
// Fading Back into the Game
call RunFade(0)
else
call ForForce(FORCE_PLAYING, function EndTheGame)
endif
endif*/
call DestroyGroup(g)
// Nulling the variables
set b = null
set g = null
set u = null
endfunction
function InitTrig_Remake_or_End_Game takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterDialogEvent(t, Dialogs[0])
call TriggerAddAction(t, function CheckVote)
set t = null
endfunction
Last edited: