By the way + rep for everyone even the guys that helped me out in converting a local into a unit in my other thread.
You should check out my tutorial Converting GUI to efficient jass.
Ok this will be a long list of things
Main Ideas
1. Ultimate Guide to Coding
2. Tutorial interpretation
3. How to improve.
4. My understanding of how code worked
5. ways of learning.
7. my understanding of
8. debugging
9. explanation of most guides.
Tutorial Interpretation
My interpretation of your tutorial is that it is unfinished. It explains information I already know and information I don't know lacking data that would help me understand.
For example I already know about the functions. Maybe link to another guide that already covers that. Also your explanation of Functions is kind of lacking. You just say function name without stating that or how the name can be manipulated. I don't get that what ever name I put in call action trigger (function "what ever I want to call it")
has to be the same Function "what ever I called it in the action trigger"
How to Improve
I find that lacking in alot of guides actually. The perfect set of guides would state how information can be manipulated and how material within the editor interact. Instead of just giving examples to copy.
The perfect guide would list all natives, and how they can be manipulated.
List all Bjs and how they should be manipulated and when to use them and when not to. How to get rid of any leaks/desyncs that they would produce
List all variable types and how and when to convert, manipulate, use, etc.
Compile together in one guide structs, functions, libraries, scopes, etc and list how they should be manipulated.
List all trigger initiators and how to get them to function the way you want them to what every possibility is. Also work arounds. For example, the guy below gave me code for getting trees to revive on presets from initiation but it doesn't explain how to get all trees to revive how I want them too.
Learning Styles
Also keep in mind peoples learning styles, the ultimate set of guides would keep peoples learnings styles in mind. Currently, most guides only use one or two learning styles.
Debugging
A good guide would tell you how to debug yourself. And when to come for help. How to recoginize when something is leaking, or desyncing. Basically how did you come up with that information.
Misinformation
Also a list of other guides to start with. Because atm alot of the guides are alot to read through and some of them are outdated or misinformative. For example one guide told me that any native is recognizable if it comes after "call"
and also I didn't know BJs and Natives could be insterted into other parts of the script. I thought Bjs and Natives were just the actions. again thats how it was explained to me.
Like I said a thorough explanation of all natives and bjs would be helpful and also how each code interacts.
Further reading
A guide could be made for explaining the further where other guides didn't go.
Loop and If then/else
If then else isn't explained to well in guides. It just says
If Condition
Then
Action
else action
or If condition
Then action
else if condition
then action
else
action
that bit of code is more complicated then that. I've found out through experimenting that sometimes do nothing is needed to make the code work. Or sometimes certain and ite need to be placed inside another ite to work. Or placed inside a loop.
Guides don't explain this bit of information and it would be helpful to have an indepth explanation of the if/then else and loops
What needs to be done?
four or five experienced people should get together to make guides but they should also bring along 30 to 40 unexperienced coders to make sure everything is clear. Half are Totally inexperienced / the other Half are Inexperienced at world editor but experienced at other languages.
Then they should write a comprehensive guide series to explain all the nuts and bolts of coding. I imagine that this would branch off into two routes. One for each newbie group.
why so many test readers and contributers.
Four or five contributers would help make sure that the code is flexible enough to include different styles of coding. While 30 to 40 people should be. done like this
test guide one 5 people
if they find faults fix
test on the same 5 people
repeat steps with another group of 5
repeat steps until no more inexperienced people are left.
I don't know another language so a lower amount might be needed for the group having those prereqs..
you shouldnt use most of the globals, some of them are fine, many of them leak handle Ids and some of them leak objects, one of them even desyncs the game
the way you have to set this up is around this:
JASS:
scope myScope initializer init
globals
private trigger tr = CreateTrigger()
endglobals
private function onLoadEnum takes nothing returns nothing
call TriggerRegisterDeathEvent(tr, GetEnumDestructable())
endfunction
private function init takes nothing returns nothing
call EnumDestructablesInRect(GetWorldBounds(), null, function onLoadEnum)
call TriggerAddCondition(tr, ...)
call TriggerAddAction(tr, ...)
endfunction
the code is incomplete, I left out your part of the code, but this is roughly how it should be
Please note that this does not work for trees that are created after map has been initialized(CreateDestructable... is called)
how would I get it to work for trees created after the map is initialized? Also I thought Inits couldn't be included in scope?
Lastly, How come your use of globals are ok but mine are not?