//! textmacro boo
//! runtextmacro hi()
//! endtextmacro
//! textmacro hi
//! endtextmacro
module Init takes ho, boo, yo
implement Init(x, y, z)
CPP preprocessor has been removed due to lack of public support.Add some docs on the new preprocessor directives (#bigdef for example).
No it would not, it would be ugly and dangerous. This will never happen.It would be really nice if you could nest macro calls
Useless.modules with parameters (something vex has been planning but has yet to do).
module Init takes ho, boo, yo
implement Init(x, y, z)
Learn to use notepad++ regular expressions.Also, it would be excellent if you assumed that all code inside of an external block was Lua so that we wouldn't need the mass //! i anymore. Typing that all out is annoying as hell, so please.
This is a job for optimizer not for the compiler.Also, it'd be cool if the vjass optimizer removed inlined global constants ^)^.
No it would not, it would be ugly and dangerous. This will never happen.
Nice try, but I don't hook that easily.About as ugly and dangerous as recursive function calling?
This never crossed my mind because I don't use GUI variables.The function InitGlobals for GUI globals variables is called after the vJass initalizers in the function main.
I don't see a good reason for it.
...
But you are unable to use a GUI global value inside a vJass initializer
InitTrigger
as an InitTrig
function. InitTrig
in scopes and libraries.Also, you've fixed the init order - does it mean if I replace my old JH with this one I'll have to rewrite everything, or old things would still work?
//! import "luajass.WmW_Masters.j"
Nice of you to report it.//! import "luajass.WmW_Masters.j"
considering imports don't work, I can't use this -.-, soooo gg
It is only in Init triggers, in spells you can use them all you want.and you can't read GUI vars from JASS...
This is an example of a bad bug report.and the entire main function is now broken.. it gave me undeclared function InitSounds()... seriously?
It is only in Init triggers, in spells you can use them all you want.
Blame Vex for this, not me. (I am trying to find a solution atm)
No, they don't.they work in official jasshelper just fine?
//===========================================================================
function main takes nothing returns nothing
call SetCameraBounds(- 1280.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), - 1536.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 1280.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 1024.0 - GetCameraMargin(CAMERA_MARGIN_TOP), - 1280.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 1024.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 1280.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), - 1536.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM))
call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl")
call NewSoundEnvironment("Default")
call SetAmbientDaySound("LordaeronSummerDay")
call SetAmbientNightSound("LordaeronSummerNight")
call SetMapMusic("Music", true, 0)
call InitBlizzard()
call ExecuteFunc("jasshelper__initstructs15888592") // <----------<<
call InitGlobals() // <----------<<
call InitCustomTriggers()
call RunInitializationTriggers()
endfunction
//===========================================================================
function main takes nothing returns nothing
call SetCameraBounds(- 1280.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), - 1536.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 1280.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 1024.0 - GetCameraMargin(CAMERA_MARGIN_TOP), - 1280.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 1024.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 1280.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), - 1536.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM))
call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl")
call NewSoundEnvironment("Default")
call SetAmbientDaySound("LordaeronSummerDay")
call SetAmbientNightSound("LordaeronSummerNight")
call SetMapMusic("Music", true, 0)
call InitBlizzard()
call ExecuteFunc("jasshelper__initstructs1260") // <----------<<
call InitGlobals() // <----------<<
call InitCustomTriggers()
call RunInitializationTriggers()
endfunction
globals
integer I = udg...
endglobals
globals
boolean udg_Bool = false
...
endglobals
function InitGlobals takes nothing returns nothing
set udg_Bool = true
...
endfunction
function InitGlobals takes nothing returns nothing
local integer i= 0
set udg_x=123
set i=0
loop
exitwhen ( i > 8190 )
set udg_a[i]=0
set i=i + 1
endloop
endfunction
I'm using preplaced rects (and a few buildings) too, and with the old JASSHelper (0.A.2.B). A one-shot timer with "0." expiration time works perfectly for me.
library Paths uses Path, Testing
struct Paths extends array
private static Path array leftp
private static Path array rightp
static method operator [] takes integer pid returns thistype
return pid/3
endmethod
method operator left takes nothing returns Path
return leftp[this]
endmethod
method operator right takes nothing returns Path
return rightp[this]
endmethod
private static method onInit takes nothing returns nothing
local Path topLeft = Path.create()
local Path topRight = Path.create()
local Path bottomLeft = Path.create()
local Path bottomRight = Path.create()
set leftp[0] = bottomLeft
set rightp[0] = bottomRight
set leftp[1] = topLeft
set rightp[1] = topRight
call topLeft.add(gg_rct_Middle_Center_Top_Left)
call topLeft.add(gg_rct_Middle_Top_Left)
call topLeft.add(gg_rct_Top_Left)
call topLeft.add(gg_rct_Top_Center)
call topLeft.add(gg_rct_Load_Top)
call topRight.add(gg_rct_Middle_Center_Top_Right)
call topRight.add(gg_rct_Middle_Top_Right)
call topRight.add(gg_rct_Top_Right)
call topRight.add(gg_rct_Top_Center)
call topRight.add(gg_rct_Load_Top)
call bottomLeft.add(gg_rct_Middle_Center_Bottom_Left)
call bottomLeft.add(gg_rct_Middle_Bottom_Left)
call bottomLeft.add(gg_rct_Bottom_Left)
call bottomLeft.add(gg_rct_Bottom_Center)
call bottomLeft.add(gg_rct_Load_Bottom)
call bottomRight.add(gg_rct_Middle_Center_Bottom_Right)
call bottomRight.add(gg_rct_Middle_Bottom_Right)
call bottomRight.add(gg_rct_Bottom_Right)
call bottomRight.add(gg_rct_Bottom_Center)
call bottomRight.add(gg_rct_Load_Bottom)
endmethod
endstruct
endlibrary
function main takes nothing returns nothing
call SetCameraBounds(- 7680.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), - 7680.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 7168.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 7168.0 - GetCameraMargin(CAMERA_MARGIN_TOP), - 7680.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 7168.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 7168.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), - 7680.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM))
call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl")
call NewSoundEnvironment("Default")
call SetAmbientDaySound("SunkenRuinsDay")
call SetAmbientNightSound("SunkenRuinsNight")
call SetMapMusic("Music", true, 0)
call InitSounds()
call CreateRegions() // <--------<< rects are created here
call CreateAllDestructables()
call CreateAllUnits()
call InitBlizzard()
call ExecuteFunc("jasshelper__initstructs5502") // <------<< vJass inits
call InitGlobals() // <------<< GUI global variables
call InitCustomTriggers()
call RunInitializationTriggers()
endfunction
It's all about 'initializer', in the older JH, it just compile and show no error, but still didn't work, also, if you want it to work, you need to do it at some 'normal onInit' (not module) and/or call it from the init function.