- Joined
- May 1, 2008
- Messages
- 1,605
Moin moin =)
Since I started with vjass, there are some things, I don't know/understand, so I want ask some general questions here, to get it clear:
1) What is the difference between "(private) static method" and "(private) function"? Does warcraft calculate them different? When yes - how?
2) Why I can't use "(private) functions" in a "(private) struct" at all?
3) In vJass-spells inside the struct, I always use "static method". Does something happen, when I only type "method" in? - At least what's the meaning of this "static"?
4) Is there a difference between "static if" and a normal "if". When yes - what kind of difference and when I need to use what?
5) Why is it better, to have a "private struct" instead of a normal "struct"? Thought names of this can't be used twice anyway.
6) When I started with vJass and wrote the struct, I always wrote first the create method and under this method the periodic method. I remember that someone said it has to be the other way round, first the periodic method and under this the create method? But why that? (I never asked him)
7) Does it makes a difference when I type only "static method periodic takes nothing returns nothing" instead of
"private static method periodic takes nothing returns nothing"?
8) What can be the reasons, that triggers doesn't work in a library but in a non library? [I made a trigger, which runs when a dialog button is clicked of a dialog. I put this trigger into a library and it doesn't work. A friend said then, I should try it without the library and it works, but he said he don't know why this is so - someone else know it?]
9) What is the difference between a scope and a library?
== Not directly vJass ==
10) In a normal trigger in the init function, why the trigger doesn't work, when I use this way:
instead of this:
What makes the local thing not working (in this case)? In some other cases it works =O
Well this would be all for the moment. I want say, that my English isn't that good, so if some people feel free to answer some questions, then please don't come up with an high-quality-super-uber-English, which I don't understand anyway =)
Thanks - Greetings - Peace
Dr. Boom
Since I started with vjass, there are some things, I don't know/understand, so I want ask some general questions here, to get it clear:
1) What is the difference between "(private) static method" and "(private) function"? Does warcraft calculate them different? When yes - how?
2) Why I can't use "(private) functions" in a "(private) struct" at all?
3) In vJass-spells inside the struct, I always use "static method". Does something happen, when I only type "method" in? - At least what's the meaning of this "static"?
4) Is there a difference between "static if" and a normal "if". When yes - what kind of difference and when I need to use what?
5) Why is it better, to have a "private struct" instead of a normal "struct"? Thought names of this can't be used twice anyway.
6) When I started with vJass and wrote the struct, I always wrote first the create method and under this method the periodic method. I remember that someone said it has to be the other way round, first the periodic method and under this the create method? But why that? (I never asked him)
7) Does it makes a difference when I type only "static method periodic takes nothing returns nothing" instead of
"private static method periodic takes nothing returns nothing"?
8) What can be the reasons, that triggers doesn't work in a library but in a non library? [I made a trigger, which runs when a dialog button is clicked of a dialog. I put this trigger into a library and it doesn't work. A friend said then, I should try it without the library and it works, but he said he don't know why this is so - someone else know it?]
9) What is the difference between a scope and a library?
== Not directly vJass ==
10) In a normal trigger in the init function, why the trigger doesn't work, when I use this way:
JASS:
function InitTrig_InitTeams takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterDialogEvent(t,udg_Dialog)
call TriggerAddAction(t,function InitTeams_Actions)
set t = null
endfunction
instead of this:
JASS:
function InitTrig_InitTeams takes nothing returns nothing
set gg_trg_InitTeams = CreateTrigger()
call TriggerRegisterDialogEvent(gg_trg_InitTeams,udg_Dialog)
call TriggerAddAction(gg_trg_InitTeams,function InitTeams_Actions)
endfunction
What makes the local thing not working (in this case)? In some other cases it works =O
Well this would be all for the moment. I want say, that my English isn't that good, so if some people feel free to answer some questions, then please don't come up with an high-quality-super-uber-English, which I don't understand anyway =)
Thanks - Greetings - Peace
Dr. Boom