So, I have some temp variables in my game, but the game seems to be throwing up flags about them. Not sure if I am somehow doing something wrong, but here goes.
However, when I run it, it gives me this:
waken line 455: non-existant variable n_troll
As well as this:
waken line 1458 says: non-existent variable ask_v_team
Not sure whatâs going on here, and since that doesnât seem to happen when I put them in permanent variables, I assume itâs something to do with the temps, although I am not sure if I am doing something wrong, or what.
The meetings label is currently at the top of the file. I just wasnât sure if the page break was messing with it or something, although no matter where I put said, as in the page break and not the temporary variables it still gives me the same error.
If *label meetings, is one that you will be returning to more than once, then it means that cs will run the *temp lines multiple times. Either creating them multiple times, and making them âfalseâ, or just crashing outright. So if you put them above the label, then they will only be created once. Hope this helps.
What I am trying to do, is put all the temp variables at the top of my scene file, although below the star meetings label and then depending on the choices made, set said temp variables as true, and then depending on whether or not X variable is true or not, have a *if block, with various gotos depending on which star if block is triggered. If that makes sense.
If nothing else, I could make them permanent variables, although I would rather not do that as the way itâs looking now my variables are going to be cluttered enough as it is without having to put what are essentially temp variables in there as well.
So basically what I have is the star meetings label at the top of the scene file, and then my page underline break, and then my temp variables, and then the scene itself actually starts.
I am unsure why the temp variables are acting the way they are, as in the game seem to think that they do not exist, as I have set them up, I have checked to make sure that they are spelled the same multiple times, which they are, and yeah. Right now Iâve put a WIP in front of the choices that make the game crash because of the temp variables, although I would very much like to get this fixed as soon as possible.
Do you use *goto_scene to access this scene anywhere? If so, you should check whether or not you *goto_scene to a label thatâs below the temp vars, since they wonât be created then.
*page_break shouldnât affect the initiation of temp vars afaik.
The way the thing works in this case is, I have a goto to that label, meetings, from a previous scene file, but itâs still not seeing the variables. I even put in some text below, just to make sure that wasnât the reason, and itâs still acting like the dam variables donât exist.
Is it necessary to put the *label meetings line before the *temp commands? You could move the *label down to prevent the game from looping (as Loopylazy72 said), and then use *set to change the temp variables afterwards if you need to.
Alternatively you could try putting all the *temp at the very top of the file.
Sometimes, yes. I have found that when you use *goto_scene to jump to a label like: *goto_scene meetings. The *temp needs to be right after that *label or else it does not create the variables because it is skipping the rest of the code to go directly to where it was told to go. Even if the *temp is as the top of the file you would need have the *temp directly under the *label if you are jumping immediately to a *label.
My experience with *temp variables has teach me that every time I âexitâ from a scene file it will âuncreateâ any temp variable I had run before. And, unless I re-declare each one when I come back to the former scene, the program will act as if these variables doesnât exist.
The opposite is also valid, I once create a sub routine that âset upâ and initialized a bunch of temporary variables for me to use across that same scene, as long as I stay in said scene, the variables continued to be treated as âexistentâ even after the program had passed by the *return command, as it returned to another part of the same scene file. But if I âexitâ the scene f.ex. returning to the startup.txt or any other scene.txt⌠The program acts as if said *temp variables never existed.
If I am not mistaken, thatâs how temp variables are supposed to work.
However, in my case, I am still in the scene when all of this is happening, apart from the *goto_scene, which I just put there for context, and itâs still flagging it as non-existant. Also, I re-wrote the variables to see if that was the reason, and itâs still doing it.
Can you link the whole scene here? Iâm pretty certain it has something to do with goto/labels, but canât tell you for sure without seeing the whole thing.
Just for clarification, do you mean the scene where the temps are, or the scene that is just before said?
Also I should be able to, but itâs going to be a long post.