HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Triggers in every map in my mod

05-02-2004, 09:28 PM#1
35263526
In my mod I have some triggers in JASS that are needed in all the maps (they control a large number of abilities and game systems). I'd like the mod to work with any warcraft III map.

What's the best way to make this work?
05-02-2004, 09:56 PM#2
weaaddar
Well if you want to join the Works on everything and its mother cause of Drag and Drop or DT4a. You first need to make sure you move all references to unit types, ability ids, item types to functions or variables. (i suggest functions). If you are using anything preplaced then thats a really big problem. Remove those references as well. (Don't move them to funcs or variables just remove them period).

Next you need to get rid of useless variables and arrays. Now, if you want even further portability make sure to move all variables and arrays that are requisite to gamecache.

Too further make it more useful would be to make it object oriented, either by player or unit. Multi-instancibility is what makes a system from not too shabby to outstanding. Make sure to move everything to handle or string derived functionality.

Another step (one that even I haven't taken) is to make sure that your object oriented classes derive what they encapsulate. I.e. your Hero class uses the same reference identifier as unit. This is an incredibly cool thing to do, but has some flaws when you'd like to be lazy and allow for quick transferring of your own.

Then ofcourse another step could be to abstract simmilar methods or make them exist only on a base class. (I.e. NextBagPage and NextBookPage could be abstracted in context to become some third method NextPage which depending on if you pass a book of bag object will do both jobs in one.)

but your final code should require no variables for the user to create, should have an extremely stupidly easy constructor method or initilizier method and should be heavily encapsulated so no body would be stupid enough to touch your code and mess everything up.