- Joined
- Jan 17, 2010
- Messages
- 149
SOLVED
Solution:
Create a trigger you want to put the "library" in and put it above all other triggers that are to call the library functions. Any functions that are written in that library trigger will be accessible to the triggers below it. Now here is the catch, in order for it to work you absolutely have to restart the map or the compiler will whine and complain that it cannot find those library functions.
Stupid, I know, but that's how it works with the classic world editor.
Original Issue:
When you put functions in the map header, those functions will be accessible globally. This method however, can spam the map header with a lot of code and make it extremely hard to maintain and expand as more code is added in.
My question is: What are the ways of mimicking this global function sharing effect?
I know it is possible because I've seen map triggers sharing code in between triggers and their functions. But when I try to do the same thing, the compiler complains it cannot find the functions I want to call.
I've tried 5 different tutorials on JASS but none of them seemed to address map headers or "global" functions. Any help is greatly appreciated.
Solution:
Create a trigger you want to put the "library" in and put it above all other triggers that are to call the library functions. Any functions that are written in that library trigger will be accessible to the triggers below it. Now here is the catch, in order for it to work you absolutely have to restart the map or the compiler will whine and complain that it cannot find those library functions.
Stupid, I know, but that's how it works with the classic world editor.
Original Issue:
When you put functions in the map header, those functions will be accessible globally. This method however, can spam the map header with a lot of code and make it extremely hard to maintain and expand as more code is added in.
My question is: What are the ways of mimicking this global function sharing effect?
I know it is possible because I've seen map triggers sharing code in between triggers and their functions. But when I try to do the same thing, the compiler complains it cannot find the functions I want to call.
I've tried 5 different tutorials on JASS but none of them seemed to address map headers or "global" functions. Any help is greatly appreciated.
Last edited: