- Joined
- Feb 11, 2011
- Messages
- 1,860
Hello guys,
I've been conducting experiments in order to find out the order that initialisers are placed in the map script. I suppose everyone else already knows this, but I didn't (it's been causing some issues for me so I wanted to check)
While checking, I discovered something interesting. First, the code:
When I run the map, this is the result (which I kind of expected):
I noticed that something weird happens with these lines:
I was just wondering why this happens. Could someone enlighten me?
Also, are there any other initialisers I am missing out?
Thanks,
Mr_Bean
I've been conducting experiments in order to find out the order that initialisers are placed in the map script. I suppose everyone else already knows this, but I didn't (it's been causing some issues for me so I wanted to check)
While checking, I discovered something interesting. First, the code:
JASS:
library LibraryTest initializer OnInit_Lib
private struct Funny
private static method onInit takes nothing returns nothing
call BJDebugMsg("Library - struct onInit")
endmethod
endstruct
private module InitLibModule
private static method onInit takes nothing returns nothing
call BJDebugMsg("Library - struct module onInit")
endmethod
endmodule
private struct InitLibStruct
implement InitLibModule
endstruct
private function OnInit_Lib takes nothing returns nothing
call BJDebugMsg("Library - initialiser function")
endfunction
endlibrary
JASS:
scope ScopeTest initializer OnInit
private struct Foo
private static method onInit takes nothing returns nothing
call BJDebugMsg("Scope - struct onInit")
endmethod
endstruct
private module InitModule
private static method onInit takes nothing returns nothing
call BJDebugMsg("Scope - struct module onInit")
endmethod
endmodule
private struct InitStruct
implement InitModule
endstruct
private function OnInit takes nothing returns nothing
call BJDebugMsg("Scope - initialiser function")
endfunction
endscope
I noticed that something weird happens with these lines:
call BJDebugMsg("Library - struct module onInit")
call BJDebugMsg("Scope - struct module onInit")
I was just wondering why this happens. Could someone enlighten me?
Also, are there any other initialisers I am missing out?
Thanks,
Mr_Bean