I'm starting to learn JASS, but when I try something that I think is right it crashes! I found out what crashes its the first thing I inputed. Anyone help? and give an explaination on why it crashed? The Synttax checker says that it's udg_PlayerRace is an undecleared variable
JASS:
function Trig_Building_Hall_Func002C takes nothing returns boolean
if ( not ( GetResearched() == 'R000' ) ) then
return false
endif
return true
endfunction
//function CreateWorkers takes nothing returns nothing
//if (udg_PlayerRace == "Orc") then
//else
//endif
//endfunction
function Trig_Building_Hall_Actions takes nothing returns nothing
local unit u = GetResearchingUnit()
local player p = GetOwningPlayer(u)
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local timer t = CreateTimer()
local string sfxmdl = "units\\undead\\Abomination\\Abomination.mdl" //playerholder
if ( Trig_Building_Hall_Func002C() ) then
set udg_PlayerRace[GetPlayerId(p)] = "Orc"
call RemoveUnit(u)
call CreateUnit(p,'ogre',x,y,270)
// call TimerStart(t, .5, true, function CreateWorkers)
call TriggerSleepAction(2.00)
//call DestroyTimer(t)
else
endif
endfunction
//===========================================================================
function InitTrig_Building_Hall takes nothing returns nothing
set gg_trg_Building_Hall = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Building_Hall, EVENT_PLAYER_UNIT_RESEARCH_FINISH )
call TriggerAddAction( gg_trg_Building_Hall, function Trig_Building_Hall_Actions )
Last edited: