Name variable only sets in one scene, reverts to startup value in the next one?

So for some reason, my name variable won’t stay whatever I set it to in the first chapter of my WIP. I’ve run Quicktest in CSIDE and gone through it myself with no error messages, so I’m a bit lost on how to fix this.

The code to set your name in the last scene of the first chapter looks like this:

*fake_choice
    #[i]"Mira!"[/i]
        *set name "Mira"
    #[i]"Celeste!"[/i]
        *set name "Celeste" 
    #[i]"Gideon!"[/i]
        *set name "Gideon" 
    #[i]"Oliver!"[/i]
        *set name "Oliver"  
    #[i]"Fox!"[/i]
        *set name "Fox"
    #[i]"Reese!"[/i]
        *set name "Reese" 
    #Something else. 
        I shout… 
        *input_text name

"[i]$!{name}![/i]" I shout. "My name is… $!{name}." 

*set learnedname true

The scene then ends. I had previously used the *finish tag, but removed it thinking maybe it was messing with the code, but no change. In the last bit of dialogue, the name that is set in the previous fake_choice does show up as it is set. But, after going to the next chapter…

unknown

Which is what the name variable is initially set to in startup.

*create name "Unknown"

Pretty much all other string variables that I bothered to test work between scenes. So if I set genderword to “man” right after I set learnedname to true, and then have it show up in the text in the next scene, it does. It seems to only be an issue with *set name.

Which I guess means I could just change the variable to something like mc_name, but, like… I don’t want to? I’ve already used it quite a bit and gotten used to using it. I didn’t start having this issue until yesterday, anyway, and have been working on this for about a week.

Well, I am using the ‘name’ variable and has never had any issues with it, so it’s probably not that. -ponders-

Edit: That code should work, it’s not that different from what I use. One thing you can check is so you don’t have any *temp name variables in the document anywhere.

4 Likes

I have a *temp initial, but that’s about it.

I Don’t know much about code, but maybe the problem is in the *fake_choice? It should be just *choice, no?

I tried switching to *choice, put a *label learnedname above the whole “xyz! my name is xyz!” bit, set that whole bit up, but same issue. *fake_choice is what you use when the choice you make doesn’t branch and just goes straight to the next lines after it instead of going to a specific label, so it’s useful for setting variables and not having to create a bunch of labels or *goto tags, which are mandatory for *choice tags.

Any chance you could dump the entire project somewhere? Or PM it me?
Like everyone else, I can’t reproduce this with the small snippet you’ve given.

Also, what version of CSIDE are using (check the settings tab)?

I can PM it to you after I get back from work in a few hours. Not sure what version I’m using but I do know it updated a few days ago.

I’m using the fake_choice and name combo without issue either, so it’s probably not that.

Is there any difference whether you pick one of the preset names or use the text_input?

1 Like

could you upload the txt files (to dashingdon maybe) that should be the easiest way to check the whole code.

Y’all I figured it out, I had a typo in one one of my temp variables where it was meant to be name3, but it was just name instead. I was so annoyed with *set name not working that I didn’t even notice my tempt variable wasn’t showing up lol. Looks like @malinryden was correct on that one, so thank you!

4 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.