• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

a good codeing style

Status
Not open for further replies.
Level 4
Joined
Jan 20, 2011
Messages
65
hi

i am trying to find a good way of makeing clean code structure
like in visual c++ you can make many files and use #include and use headers and stuff to make it more clean

im useing the out of the box wc3 editor currently, u probably guna suggest me something new^^
i used to use newgen editor but i stopped useing it as it has many bugs with the newest wc3 version

so i came up with makeing new triggers insite categorys, they like files in visual c++!!
but i encounterd some problems
firstly the compiler required me to leave the init_ function there, np i allways put it at bottom
but then there is really bad ass problem!!
its todo with the tree structure of the code
since there are no prototypes for functions u need to allways maintain the correct order of the functions beeing called
but when one trigger is haveing an error and thus getting deactivated, it somehow messes up the order in the script and causeing troubles to triggers above which are dependant to one another
the annoyance in this is that u have to activate all the triggers which got deactivated by this again by hand, and they wont just activate again either, u must remove the functions which makes the trigger dependant to others, then enable it, then paste the functions back in.....

any solution to that?
i prefer not to use some fancy newgen or anything since it allways causeing bugs and screwing up my whole map^^
 
Level 6
Joined
Jun 16, 2007
Messages
235
i used to use newgen editor but i stopped useing it as it has many bugs with the newest wc3 version

Here is a tip: Use the latest version of NewGen.

Latest version of NewGen has 11999 downloads.
I can't even imagine what is the total download count over the years.
Thousands of maps have been made with it and they all work fine.

i prefer not to use some fancy newgen or anything since it allways causeing bugs and screwing up my whole map^^

I prefer not to troll people but you really are asking for it, please stop.
 
Level 4
Joined
Jan 20, 2011
Messages
65
ah ok ty nice tip

the version i used and messed up my map was 1.5d
which one is the latest and where to get it? cant seem to find anything later then 1.5d
 
Level 4
Joined
Jan 20, 2011
Messages
65
ok i have newgen 5d now and updated the jasshelper
the thing bugged my map was this force properties under szenario
in newgen it bugged it, had to use normal editor to set it straight
so i just not guna use force properties

the deactivation of triggers is fixed
but i have new thing

when u switch triggers around, the code in the map script is not moved
u need to restart or reload the map to set it straight
any way of doing this without haveing to restart?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Never had problems with the force properties, at least not because of JNGP. You may alter it via code though with a custom config function, see //! inject in JassHelper Manual or I believe there is an extra .w3i file that is read out before you host a game, before game lobby.

For your moving of code, vJass offers to enclose code in libraries that you can set to require other libraries, so the requirement is automatically sent above. Alternatively, I use structs. When calling their methods from above, JassHelper creates prototype triggers for these methods and executes them in place to call lower stuff. This is more expensive, of course. You could also just have a free stack of empty pages, so you do not need to reload everytime, or you edit your code outside of the WE first.
 
Status
Not open for further replies.
Top