Hello guys.
The main problem I faced when starting learning all this stuff is that there is nowhere complete tutorial/docs that cover all of the topics
I mean advanced topics
- multithreading (it all ends with the word ExecuteFunc)
- native functions descriptions (it all ends with there signature)
- advanced elements like timers etc
Ok, wont bother you with that for now
There lots of newbies guides like of how to declare a function or how to use trigger or how to call native functions but that's preety it
All right, lets start with the actuall topic
Before we start, please consider that I am not familiar with World Editor, so some questions could be pretty silly
And actually I dont want to work in Editor, I want to work with the logic via code
At the moment Im working with a map that is a protected one. Its korean map so probably some advanced protection was used there, Im not sure
Im extracting sources from .w3x file using MPQ and trying to work with .j file
The things I want to figure out:
1)Triggers
I create map via World Editor, and add just a single trigger there with the name, for example, Test. Then I open war3map.j file and see, that this trigger is translated into 3 functions
//===========================================================================
// Trigger: Test
//===========================================================================
function Trig_Test_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
set gg_trg_Test = CreateTrigger( )
call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction
//===========================================================================
function InitCustomTriggers takes nothing returns nothing
call InitTrig_Test( )
endfunction
and one global variable
globals
// Generated
trigger gg_trg_Test = null
endglobals
When I work with korean map I can see there a bunch of global triggers starting with gg_trg like
trigger gg_trg_Init=null
trigger gg_trg_CodeKey=null
trigger gg_trg_Frame=null
trigger gg_trg_Leave=null
trigger gg_trg_GameLoad=null
trigger gg_trg_GameTime=null
etc
But there are nowhere else in the code 3 functions that are attached to each of these triggers
So, what am I missing?
2)Another triggers
There are another triggers in global variables but this time without prefix gg_trg
Again, no functions for each of them.
What's with these ones?
3)Losing data
For example, we lose that functions of the triggers and cannot restore it, only manually.
What else can be lost throw extracting sources from protected map? And how is this happening?
4)Global variables
I've read that creating global variables via World Editor and translating them into Jass leads to renaming them, this time via prefix udg_
Actually, there is no variable starting with udg_ in jass code of that map
What's here?
5)Another prefixes
Some other variables start with some other prefixes like
- LIBRARY (they are all constants and interesting that again none of them is used anywhere in the code but when I tried for example to delete all these global constants it affected the game process, but I still was able to start the game and play it)
- other prefixes
The thing is there are like blocks of global variables, each block starts with unique prefix
For example:
dialog array Command_Code_Dialog
button array Command_Kick_Button
button array Command_Code_Button
integer array Command_Enter_Code_Type
integer array Command_Code_Unit_Type
My thoughts that it is possible to group variables in World Editor, putting them in one block with the name Command this time, and the actuall names of that variables in World Editor were
Code Dialog
Kick Button
Code Button
Enter Code Type
Code Unit Type
6) .slk tables
No idea of how to ask it right. The thing is that it is probably possible to create custom user data types like STRUCT or may be ENUM via Vjass or whatever and then it translates into pure Jass via .slk tables with that data
What are your thoughts about that?
THANKS A LOT for your patience to be able to finish this
Would be thankfull for any of your thoughts
The main problem I faced when starting learning all this stuff is that there is nowhere complete tutorial/docs that cover all of the topics
I mean advanced topics
- multithreading (it all ends with the word ExecuteFunc)
- native functions descriptions (it all ends with there signature)
- advanced elements like timers etc
Ok, wont bother you with that for now
There lots of newbies guides like of how to declare a function or how to use trigger or how to call native functions but that's preety it
All right, lets start with the actuall topic
Before we start, please consider that I am not familiar with World Editor, so some questions could be pretty silly
And actually I dont want to work in Editor, I want to work with the logic via code
At the moment Im working with a map that is a protected one. Its korean map so probably some advanced protection was used there, Im not sure
Im extracting sources from .w3x file using MPQ and trying to work with .j file
The things I want to figure out:
1)Triggers
I create map via World Editor, and add just a single trigger there with the name, for example, Test. Then I open war3map.j file and see, that this trigger is translated into 3 functions
//===========================================================================
// Trigger: Test
//===========================================================================
function Trig_Test_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
set gg_trg_Test = CreateTrigger( )
call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction
//===========================================================================
function InitCustomTriggers takes nothing returns nothing
call InitTrig_Test( )
endfunction
and one global variable
globals
// Generated
trigger gg_trg_Test = null
endglobals
When I work with korean map I can see there a bunch of global triggers starting with gg_trg like
trigger gg_trg_Init=null
trigger gg_trg_CodeKey=null
trigger gg_trg_Frame=null
trigger gg_trg_Leave=null
trigger gg_trg_GameLoad=null
trigger gg_trg_GameTime=null
etc
But there are nowhere else in the code 3 functions that are attached to each of these triggers
So, what am I missing?
2)Another triggers
There are another triggers in global variables but this time without prefix gg_trg
Again, no functions for each of them.
What's with these ones?
3)Losing data
For example, we lose that functions of the triggers and cannot restore it, only manually.
What else can be lost throw extracting sources from protected map? And how is this happening?
4)Global variables
I've read that creating global variables via World Editor and translating them into Jass leads to renaming them, this time via prefix udg_
Actually, there is no variable starting with udg_ in jass code of that map
What's here?
5)Another prefixes
Some other variables start with some other prefixes like
- LIBRARY (they are all constants and interesting that again none of them is used anywhere in the code but when I tried for example to delete all these global constants it affected the game process, but I still was able to start the game and play it)
- other prefixes
The thing is there are like blocks of global variables, each block starts with unique prefix
For example:
dialog array Command_Code_Dialog
button array Command_Kick_Button
button array Command_Code_Button
integer array Command_Enter_Code_Type
integer array Command_Code_Unit_Type
My thoughts that it is possible to group variables in World Editor, putting them in one block with the name Command this time, and the actuall names of that variables in World Editor were
Code Dialog
Kick Button
Code Button
Enter Code Type
Code Unit Type
6) .slk tables
No idea of how to ask it right. The thing is that it is probably possible to create custom user data types like STRUCT or may be ENUM via Vjass or whatever and then it translates into pure Jass via .slk tables with that data
What are your thoughts about that?
THANKS A LOT for your patience to be able to finish this
Would be thankfull for any of your thoughts
Last edited: