| 12-17-2006, 05:59 PM | #2 |
Learn JASS. GUI merely removes you from actual code. The if statement is in a different function. Use a global, or use JASS. Don't use locals in GUI unless you know what you are doing. |
| 12-17-2006, 06:10 PM | #3 |
Why the hell are you even using a local there? It has no purpose. |
| 12-17-2006, 09:02 PM | #4 |
Doh I added the local variable because of all the triggers flying around triggering each other and screwing up the globals. This trigger was firing off from some actions in another trigger using the global i variable and I didn't what it to get changed. But now that I look at the triggering trigger it seems I don't use udg_i after this one gets called. Maybe I needed it at some point but I guess I don't now. |
| 12-17-2006, 10:50 PM | #5 |
you only need locals where there is some kind of wait or delay involved. |
| 12-18-2006, 12:00 AM | #6 | |
Quote:
That's not true. And apparently I do need that variable to be local, it is changing around as the trigger runs for who knows what reason. Phoenix, consider this example that can screw up globals with no waits (too lazy to make some real triggers): Code:
Trigger 1 Event: -Unit does something Action: -Set udg_u = triggering unit -Stop unit from doing aforementioned thing. -move udg_u someplace Trigger 2 Event: -Unit stops doing something Action: -Set udg_u = some crazy unit When trigger 1 stops the unit trigger 2 will immediately fire and change udg_u to "some crazy unit" and then trigger 1 will end up moving "some crazy unit" instead of the original unit. |
