I wonder about this
JASS:Initailizer xxx
tell me more, Plz!!JASS:constant
initializer
. You probably know that when the map is saved a .j file is created.//***************************************************************************
//*
//* Main Initialization
//*
//***************************************************************************
//===========================================================================
function main takes nothing returns nothing
call SetCameraBounds(- 3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), - 3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), - 3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), - 3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM))
call SetDayNightModels("Environment\\DNC\\DNCAshenvale\\DNCAshenvaleTerrain\\DNCAshenvaleTerrain.mdl", "Environment\\DNC\\DNCAshenvale\\DNCAshenvaleUnit\\DNCAshenvaleUnit.mdl")
call NewSoundEnvironment("Default")
call SetAmbientDaySound("AshenvaleDay")
call SetAmbientNightSound("AshenvaleNight")
call SetMapMusic("Music", true, 0)
call CreateCameras()
call CreateAllUnits()
call InitBlizzard()
@call ExecuteFunc("jasshelper__init366")@
call InitGlobals()
call InitTrig_Initialization() // INLINED!!
call ConditionalTriggerExecute(gg_trg_Initialization) // INLINED!!
endfunction
//***************************************************************************
//*
//* Map Configuration
//*
//***************************************************************************
function config takes nothing returns nothing
call SetMapName("TRIGSTR_001")
call SetMapDescription("TRIGSTR_003")
call SetPlayers(2)
call SetTeams(2)
call SetGamePlacement(MAP_PLACEMENT_USE_MAP_SETTINGS)
call DefineStartLocation(0, 0.0, 0.0)
call DefineStartLocation(1, - 1024.0, - 384.0)
// Player setup
call InitCustomPlayerSlots()
call SetPlayerSlotAvailable(Player(0), MAP_CONTROL_USER)
call SetPlayerSlotAvailable(Player(1), MAP_CONTROL_COMPUTER)
call InitGenericPlayerSlots()
endfunction
//All initializer functions called in proper order:
function jasshelper__init366 takes nothing returns nothing
call ExecuteFunc("scopeName___xxx")
//------------------------------------
endfunction
constant
, this keyword is not vJASS; it already exists before the making of vJASS.But there are certain types of variables that can't use constant
False, however i think wc3mapoptimizer inline all constants, so something like that would be totally broken, each use of MY_GROUP would be replaced by CreateGroup(), and then a new group would be created
constant group MY_GROUP = CreateGroup()
hashtable and group are default as constants, so no need to call them as such, since
the only way for them to work is by declaring InitHashtable() and CreateGroup(), and
you can never change it...
null variables are empty, therefore doesnt work...You can change the variable to null or another object of the kind.
constant native GetTriggeringTrigger takes nothing returns trigger
could work with a constant trigger variable.constant native GetHeroLevel takes unit whichHero returns integer
native GetHeroXP takes unit whichHero returns integer
, again just as an example.GetHeroLevel
would always return 1 or 0, dependly if it's an hero or not, because afair even preplaced units are leveled up during the map init.I remember that I got an error when making a constant hashtable.
Hmm why he said that then :
Or is he wrong ?
function Trig_Check_Integer_Actions takes nothing returns nothing
local integer Int_Kill
if(udg_ScoreKills[Int_Kill] == 3)then
set udg_ScoreKills[Int_Kill] = udg_ScoreKills[Int_Kill] + 1
endif
endfunction
//===========================================================================
function InitTrig_Check_Integer takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerChatEvent( t, Player(0), "", false )
call TriggerAddAction( t, function Trig_Check_Integer_Actions )
set t = null
endfunction
wait, where did you create the global variable?