Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
The same way you can simplify the functionTrig_Ashenvale_Conditions
^But actually you don't even need this seperated condition function. Just use an if/else in the other function to make the check.
Also you don't need names anymore like function Trig_Ashenvale_Func001A... that's good point in jass, you can make it much more readable. And in the end you always get a smarter looking trigger and find bugs much faster.
I dont know why it doesnt compile, but this will never work anyways, because you pass to the call TriggerRegisterDeathEvent( gg_trg_Ashenvale, des02 ) the des2 is null and the events dont get registered again when des02 runs, you should make the trigger global and when you init you should enumerate all trees and call the function with the enumerated tree
As others pointed out, the code can be optimized greatly
I couldn't figure out what the initiation trigger was.....what I have is what was in the tutorial for scope. minus converting the trigger into a local.
Im confused
how will this check to see if there is a random number between 1 and 10.....(also I made it everything greater than 0 to check if the trigger worked)
but once I know that it works correctly I will change it to everything greater then or equal to 7 creates underground tree and everything lower than or equal to 6 will create an ashenvale tree.
Also you don't need names anymore like function Trig_Ashenvale_Func001A... that's good point in jass, you can make it much more readable. And in the end you always get a smarter looking trigger and find bugs much faster
I was trying to change one thing at a time. I know it takes longer that way but it makes it easier to find bugs for me. If I screw up and make a bunch of changes it makes it harder to find things.
I dont know why it doesnt compile, but this will never work anyways, because you pass to the call TriggerRegisterDeathEvent( gg_trg_Ashenvale, des02 ) the des2 is null and the events dont get registered again when des02 runs,
I haven't optimized it because I don't want to mess anything up beyond what I already did and partially because I some things I just don't know. For example how to get it to recognize dying trees without using getdyingtrees function. or initiate a initiation trigger how to get global triggers to initiate... how to get if then else then functions to work......
I couldn't figure out what the initiation trigger was.....what I have is what was in the tutorial for scope. minus converting the trigger into a local.
The event only registers dying destructables. Thus only dying destructables will fire the event. Also if you look at dying destructable it calls triggering destructable.
Im confused
how will this check to see if there is a random number between 1 and 10.....(also I made it everything greater than 0 to check if the trigger worked)
but once I know that it works correctly I will change it to everything greater then or equal to 7 creates underground tree and everything lower than or equal to 6 will create an ashenvale tree.
Im not good at using if then/else functions... I understand the concept but putting it into practice doesn't reap my results.
The return is used to simply return a boolean. It evaluates the conditions and returns true or false. If you need a function to do 2 or more things that are different then you need to stick with an ITE. You should check out my tutorial Converting GUI to efficient jass. It will show you some efficient methods when using jass.
I was trying to change one thing at a time. I know it takes longer that way but it makes it easier to find bugs for me. If I screw up and make a bunch of changes it makes it harder to find things.
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
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
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?
it is because you use global variables, yet you would be able to achieve the very same thing with local variables, so you dont need globals at all
initializers in order of Vexorians(standard) JassHelper:
module initializer
struct initializer
library initializer
scope initializer
InitTrig function
module and struct initializers are called via ExecuteFunc, so they run in their separate thread. Library, scope and InitTrig run in the main thread and all this code is injected into function that is marked as main, which is inaccessable by standard means
Note that Cohadar's JassHelper has different order, I think it is:
library initializer
scope initializer
struct initializer
module initializer
InitTrig function
I dont think there is event for when destructable enters map, so you either have to run periodic timer recreating the trigger with all the trees on map, or you can hook the CreateDestructable functions
initializers in order of Vexorians(standard) JassHelper:
module initializer
struct initializer
library initializer
scope initializer
InitTrig function
Note that Cohadar's JassHelper has different order, I think it is:
library initializer
scope initializer
struct initializer
module initializer
InitTrig function
Just to clarify, Cohadar's JassHelper actually has the exact same order as Vexorian's. (module > struct > library > scope > InitTrig) The only difference is that Cohadar's takes into account when one library requires another. For example, if library B requires library A:
JASS:
library A initializer Init
private function Init takes nothing returns nothing
call BJDebugMsg("A")
endfunction
endlibrary
library B requires A
private struct Example
private static method onInit takes nothing returns nothing
call BJDebugMsg("B")
endmethod
endstruct
endlibrary
In vexorian's jasshelper, it would display "B" then "A".
In cohadar's jasshelper, it would display "A" then "B".
Cohadar's version is correct for initializers. It only makes sense for the libraries that you require to have their initializers run first. Vexorian's does this when you have the same initializer (e.g. if A and B both had struct initializers, A would run before B), but the issue is that modules will always run before struct initializers, struct initializers will always run before library initializers, etc.
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.
This is a GUI tutorial so structs, libraries, scopes are useless here.
Also listing all natives is not needed as GUIers don't use them much and they can find the ones they need if they do. Plus there are to many of them. function initiators ?
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.
The tutorial does not have outdated information. I have no idea what you mean by natives are recognizable after call. BJs and Natives can be inserted into other parts of the script makes no sense either.
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
ITEs and Loops are covered in basic tutorials. Also Do nothing action is never needed. All it does is call an empty function so it cannot make something work. It can make something not work if it causes it to hit the op-limit.
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..
This is not needed as I have already had more than a few thousand say this guide helped them a lot. Also when I made this I did not know any languages besides GUI / Jass / vJass.
If you want to continue the talk on my tutorial please do it in my tutorial page so it does not clutter this thread with things that have nothing to do with this thread.
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?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.