Alright I learned a little bit of jass about 4 months ago and then I dropped off the wc3 radar for a bit, and now I'm back. I am using JNGP to grow my vJass knowledge. I am pretty competent in making spells, they are usualy pretty straight-forward but right now I am trying to create the trigger that does everything I need to be done at map init. Here is what I have so far:
I looked for natives to replace the BJ's, but I couldn't find any so I assume that is the best way to go about those? As for that timer, I am not very sure of my timer knowledge, but I think I did that correctly as well. But the compiler seems to be having trouble with his line:
Throwing the error: Cannot convert integer to code. Does anyone know whats wrong with that?
Edit: When I try and tack on "constant" before those location variables it throws all sorts of various errors, why cant I make those constant?
(I realize some of this stuff is pretty annoyingly simple to answer but bear with me) I suppose the real question behind all of these ^ is, is this code written in the fastest/most efficient, and correct way? (I'm gonna take a shot in the dark and say no =p, thats why I am here though)
(I will keep using this thread to ask questions, that will vary a lot, but all be vJass related as oppose to flooding the whole forum with threads. So make sure to check back every now and then.)
JASS:
scope Init initializer Init
private function spawnCreeps takes nothing returns nothing
call CreateNUnitsAtLoc(5, 'nban', Player(11), TLWS, 90)
call CreateNUnitsAtLoc(5, 'nban', Player(11), BLWS, 90)
call CreateNUnitsAtLoc(5, 'nban', Player(11), MLWS, 90)
call CreateNUnitsAtLoc(5, 'nban', Player(11), TRWS, 90)
call CreateNUnitsAtLoc(5, 'nban', Player(11), BRWS, 90)
call CreateNUnitsAtLoc(5, 'nban', Player(11), MRWS, 90)
call BJDebugMsg("Units should have spawned if so, hurray! If not, bug the forums")
endfunction
private function Actions takes nothing returns nothing
local timer creepwave = CreateTimer()
call ModifyGateBJ( bj_GATEOPERATION_OPEN, gg_dest_B000_0298 )
call ModifyGateBJ( bj_GATEOPERATION_OPEN, gg_dest_B000_4544 )
call SetDestructableInvulnerableBJ( gg_dest_DTg6_1783, true )
call PolledWait(120.00)
call TimerStart(creepwave, 35, true, spawnCreeps)
call BJDebugMsg("Actions Completed, timer should have started..")
endfunction
//===========================================================================
function Init takes nothing returns nothing
local trigger InitTrg = CreateTrigger()
call TriggerAddAction( InitTrg, function Actions )
globals
location TLWS = Location(-8315.1,1944.3)
location BLWS = Location(-8344.3,-891.7)
location MLWS = Location(-7231.6,556.9)
location TRWS = Location(8219.5,1978.9)
location BRWS = Location(8256.9,-847)
location MRWS = Location(7277.7,556.3)
endglobals
endfunction
endscope
I looked for natives to replace the BJ's, but I couldn't find any so I assume that is the best way to go about those? As for that timer, I am not very sure of my timer knowledge, but I think I did that correctly as well. But the compiler seems to be having trouble with his line:
JASS:
call TimerStart(creepwave, 35, true, spawnCreeps)
Edit: When I try and tack on "constant" before those location variables it throws all sorts of various errors, why cant I make those constant?
(I realize some of this stuff is pretty annoyingly simple to answer but bear with me) I suppose the real question behind all of these ^ is, is this code written in the fastest/most efficient, and correct way? (I'm gonna take a shot in the dark and say no =p, thats why I am here though)
(I will keep using this thread to ask questions, that will vary a lot, but all be vJass related as oppose to flooding the whole forum with threads. So make sure to check back every now and then.)