Seemingly having an issue with temp variables

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.

My temp variables look like this:

*label meetings
*page_break
*temp t_facesmash false
*temp n_troll false
*temp ask_v_team false
*temp hug_v false
*temp handshake_v false
*temp reaction_d false
*temp anger_doorsmash false
*temp admit_none false
*temp lie_blind false
*temp purge false
*temp anger_n false
*temp n_second_chance false

I have them all set up, such as for example:

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.

What happens if you put your *temps at the very top of the file, instead of in the middle?

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. :slight_smile:

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.

2 Likes

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.

Move the *page_break under the creation of the *temp variables.

The *temp need to be created when the code first enters the file. You are immediately forcing them to a second page.

*label meetings
*temp t_facesmash false
*temp n_troll false
*temp ask_v_team false
*temp hug_v false
*temp handshake_v false
*temp reaction_d false
*temp anger_doorsmash false
*temp admit_none false
*temp lie_blind false
*temp purge false
*temp anger_n false
*temp n_second_chance false
*page_break

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.

1 Like

Currently, for the two variables that I have, the rest come later, I have:

*goto_scene waken meetings


*label meetings
*temp t_facesmash false
*temp n_troll false
*temp ask_v_team false
*temp hug_v false
*temp handshake_v false
*temp reaction_d false
*temp anger_doorsmash false
*temp admit_none false
*temp lie_blind false
*temp purge false
*temp anger_n false
*temp n_second_chance false

When I try to select a choice with any of said variables in it, it gives me an error.

		*set n_troll true


		*set ask_v_team true


I don’t understand why the game is doing this, as, unless I am very much mistaken, I have all the variables set up correctly, with *temp, and *set.

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.

1 Like

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.

1 Like

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.

3 Likes

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.

The one with the temps for now. You can upload a .txt file somewhere and link it after.

1 Like

How do I link the scene? It won’t let me put it into a post.

Upload the txt file on a filehost and send the link for it.

1 Like

I am going to assume that dashing Dawn will not work for this particular purpose?

It actually will :slight_smile:

3 Likes