| 05-14-2007, 06:09 PM | #1 |
Can I put this in the map header: JASS:globals constant unit u = gg_unit_U001_0000 //A unit that's already on the map endglobals and then using it in triggers so I don't have to write gg_unit_U001_0000 all the time? Or if that doesn't work, is there a way to do it? EDIT: It works for strings, but I don't think it works for units |
| 05-14-2007, 06:23 PM | #2 |
You can use a preprocessor (JassHelper, though you might want to see newgen instead) and make that possible. The preprocessor can move your global declarations to the globals block at the beginning of the script which is the only place you can actually define them. The alternate solution, what a lot of people do, would be something like JASS:constant function myunit takes nothing returns unit return gg_unit_U001_0000 endfunction |
| 05-15-2007, 05:43 AM | #3 |
Thanks a lot, I think I'll use the alternate method (but I have JassNewGenPack) Why does it work for strings and not for units? |
