Gah!
Heya, I've been using a lot of custom script in my triggers (still making the transition to JASS), and I've run across a small hitch in one of my triggers.
In my trigger I have a slew of locals.
local location l= null
being one of them. And further down the line I have a little If/Then/Else, with a bunch of conditions that use the local "l". But every time I tried to save my NewGen World Edit kept saying something like 'variable "l" undeclared', but the way the quotes are just for highlighting purposes.
Then I flipped the trigger over to full custom script and I found that the If/Then/Else conditions were in a seperate function.
From this I deduced that locals do not apply to the whole triggery thing, they exist only in their seperate functions (which in the overall scheme makes sense).
My question/problem is... how can I make the conditions in the seperate function take the "l" from the other function so they can recognise the point I'm talking 'bout?
I was wondering if there was some way just to stick that seperate condition function inside the main function thingy? Dad calls it a recursive function. That's the only way I can think of to get the locals to apply to the whole lot. And no I don't want to use globals, they won't work for the spell trigger.
And besides the conditions in the seperate function, there is also an action (also from the If/Then/Else) that uses the "l" as well, so the local does need to apply to both.
Heya, I've been using a lot of custom script in my triggers (still making the transition to JASS), and I've run across a small hitch in one of my triggers.
In my trigger I have a slew of locals.
local location l= null
being one of them. And further down the line I have a little If/Then/Else, with a bunch of conditions that use the local "l". But every time I tried to save my NewGen World Edit kept saying something like 'variable "l" undeclared', but the way the quotes are just for highlighting purposes.
Then I flipped the trigger over to full custom script and I found that the If/Then/Else conditions were in a seperate function.
From this I deduced that locals do not apply to the whole triggery thing, they exist only in their seperate functions (which in the overall scheme makes sense).
My question/problem is... how can I make the conditions in the seperate function take the "l" from the other function so they can recognise the point I'm talking 'bout?
I was wondering if there was some way just to stick that seperate condition function inside the main function thingy? Dad calls it a recursive function. That's the only way I can think of to get the locals to apply to the whole lot. And no I don't want to use globals, they won't work for the spell trigger.
And besides the conditions in the seperate function, there is also an action (also from the If/Then/Else) that uses the "l" as well, so the local does need to apply to both.