So… I don’t know if I’m about to say something stupid here,
but couldn’t local variables somehow work per instance?
For example, they could be used inside a Repeat for Each to get around the Trigger Once for Each issue, since you’d have a temporary variable that changes immediately without cluttering the object variables.
But that’s just one example.
I think they could be really useful in single events too… kind of like how the old undeclared variables worked.
I don’t know… am I saying something completely stupid here?
Has this already been discussed? (cos i haven t find any thread on this)
Is it just not feasible?
Because I cant believe this is something that hasn’t been talked about before.
Sometimes I’m a bit out of the loop on the forum, so it’s pretty easy for me to miss things.
At end..i could do Local ready=1 instead…i guess..
It would only change the fact that I wouldn’t have to declare it permanently, since I only need it for that particular event…(btw this is a random example)…I mean i know they’re there..but they’re not in my variables lists..since it’s a 1 use vars
Again, I think it would basically be the same thing we were doing before the variable changes.
I don’t know what this would actually lead to or whether it would work, but in my project I could see a use for it…
Yes, that could be the case… I think so too, actually. But at this point I need some clarification: when I declare local variables, they go into the scene variable list, right? If I’m wrong, please correct me.
here in the wiki i’ve this .
The following event…
…can be replicated using variables:
This example demonstrates how the “trigger once” condition functions. However, this is primarily to help understand its limitations, as explained in the next section.
BUT these are scene variables.
that is idd what i did in my example in op but per object..
I’m asking if we could have something per object..so i don’t need to add another var in the obj var list to just execute a 1 time event across the whole project.
If, for example, I want this event to work for the object, is the local variable scene-level, or does it work per object/instance? Because otherwise I’m asking for something that already exists.
Sorry, but I can’t guess what “this” and “that” mean for you.
You can always experiment on your end and come back when you have a clearer idea of how local variables actually work.
using something like local per obj ..without adding a 1 time usevar in the obj.vars list…but any other method would be.
EDIT: I definitely will… even though the wiki doesn’t really answer the question. The thing is, I tried using it per object, and that event stopped working, so I came here to ask. At this point, I’ll move it to “How do I?” until I figure out what’s actually going on.
What your example is doing is to exclude objects that have already been linked. You can’t do this if you forget everything as soon as you leave the loop (which is what local variables do).
HAHA, I realized the next day that I had asked something silly… and I probably didn’t even choose a very good example to use. In the end, I think such a request wouldn’t really have any practical use, because the local variable would rightly be forgotten after the event.
Sorry for bringing such stupid matter to your attention.Sometimes my brain just short-circuits.