CSIDE Freezing, no error code

I’m having trouble with CSIDE freezing when I’m playing through my WIP. It worked just fine - multiple times! Then at about 3 o’clock this morning it starting freezing. When it does this, I can’t place my cursor in the center pane or select anything. I also can’t close CSIDE unless I go into my Task Manager. No error code pops up at the bottom of the right panel, so I can’t see what is causing this error. I hadn’t made any changes to this section of story/code when the freezing started. This is what my code looks like:

*label bbSell
*choice
    
    #I'm going to sell everything.
        *temp guild true
        *goto bbSell1
    #I'm going to sell some stuff and keep the rest.
        *temp guild false
        *goto bbSell2
    #Never mind, I'm keeping everything.
        *temp guild false
        *goto bbKeep1

If anyone sees what might suddenly be causing this please let me know. I’m seriously losing sleep over this :frowning:

Thank you!
Lessa

I don’t know about your CSIDE error, but I see an issue with your code. You should only be using the *temp command once (*temp works like *create, the only difference being their permanence, or lack thereof). After that, you should use *set to change the temporary variable’s value.

Best practice would be to put the *temp at the top of your scene file.

Okay first thing drawing my attention:
You are ‘creating’ temp files in a choice.

try moving their creation to the TOP of the file, before any other text for the scene and *set the variable in the choices.

I.E.:

*temp guild false
TEXT

*label bbSell
*choice  
    #I'm going to sell everything.
        *set guild true
        *goto bbSell1
    #I'm going to sell some stuff and keep the rest.
        *goto bbSell2
    #Never mind, I'm keeping everything.
        *goto bbKeep1

Also you can remove the empty lines under *choice etc

edit: Also keep in mind that *temp creates a variable ONLY for that scene.

Thank you so much at looking at this for me @MeltingPenguins :slight_smile: It’s still freezing, or looping. I’m going to keep hammering away at it though!

Thank you also for making sure I know about the *temp variable only being used in a scene. Actually, thinking about it I can see where this one may be useful elsewhere, different merchants, different towns, so I think I’ll go ahead and set it in the setup. (For this character path going to this merchant is a necessity at this particular point and I don’t want them to be able to go straight back if they choose to sell everything right now, only if they choose to either sell part of their haul or none of it since I’m not planning to put in a buyback option :stuck_out_tongue: )

Mhnnn…
With the *temp out of the way but things still freezing…

  1. What does the code below look like?
  2. Where and when are the temp variables called?
  3. Is there a spot that goes back to the choice?

The code for the first option is a bit of a mess, I’m sure there’s got to be a better way to do it but I’m brand new to writing in Choice Script so I don’t know it…yet! The second option leads to a blank label right now. The third option is just to a text block, then on to a different label. The temp option is called in an entirely different section that isn’t called by any of these three options. All three of these were working fine last night, before the freezing started. There isn’t a spot that goes back to that choice anywhere.

This is the code for the first option:

*label bbSell1
"Selling it all huh? All right. Lemme see whatcha got." You set the bag up on the counter. She grabs a pair of gloves and begins pulling parts out. After a bit of grunting and swearing she has a count for you. 

"You've got ${bbFang} fangs, ${bbClaw} claws, and ${bbHide} hide. You also have ${bbBlood} blood vials here. Nice." She does some math based on the parts you've brought in.
*set fangGold bbFang *10
*set clawGold bbClaw * 5
*set hideGold bbHide * 7
*set bloodGold bbBlood *15
*set saleGold (fangGold + clawGold) + (hideGold + bloodGold)
*set gold + saleGold
*set bbFang 0
*set bbClaw 0
*set bbHide 0
*set bbBlood 0
*set fangGold 0
*set clawGold 0
*set hideGold 0
*set bloodGold 0
*set saleGold 0

"Gives you a total of ${saleGold}. Sound good?" You thank the Guildhead as you walk out.
*goto warriorHead1

This is the code for the third option:

*label bbKeep1

The Guildhead slowly nods at you. "Well you know where I am if you change your mind." she says as you walk out the door. 
*goto warriorHead1

I know, that first bit is a mess :frowning: . If you see anything (or have any tips on cleaning that up a bit lol) please let me know.

Thank you
Lessa

OK, I don’t know how or why, but it’s working fine now. I copy/pasted the part that was giving me fits elsewhere and took it out entirely, then copied it back in and now it works. Technology gremlins plaguing my life, I guess :slight_smile:

Aside from the other issues mentioned in this thread, I can tell you from my own experience that CSIDE sometimes goes into an infinite lock/freeze when there’s an unresolved loop.

Often, this looks like a *gosub or *gosub_scene that is missing a *return to end it. CSIDE will not identify these as errors or give you a pop-up message during play. You can, sometimes, however, get a heads up on what might be wrong by running the Quicktest from inside CSIDE.

If that fails, I recommend activating the Step function to “Start Stepping.” That way, you can see exactly what lines the code is trying to execute.

3 Likes

@Sam_Ursu , thank you :slight_smile:

1 Like

What -might- cause an issue might be that you are setting the gold all in one go, so maybe it is stumbling over that. it should execute the sets in order, but maybe that’s what initially cause it and might cause it again.

maybe shove the *set bbfang 0 etc under a page_break?

like

*set gold + saleGold
*page_break Some Calculating Later
*set bbfang 0
etc

"gives you..."

That could be, I did go ahead and restructure it slightly after if fixed itself. Here’s what I have now:

*label bbSell1
"Selling it all huh? All right. Lemme see whatcha got." You set the bag up on the counter. She grabs a pair of gloves and begins pulling parts out. After a bit of grunting and swearing she has a count for you. 

"You've got ${bbFang} fangs, ${bbClaw} claws, and ${bbHide} hide. You also have ${bbBlood} blood vials here. Nice." She does some math based on the parts you've brought in.
*set fangGold (bbFang *10)
*set clawGold (bbClaw * 5)
*set hideGold (bbHide * 7)
*set bloodGold (bbBlood *15)
*set saleGold (fangGold + clawGold) + (hideGold + bloodGold)
*set gold + saleGold

"Gives you a total of ${saleGold}. Sound good?" You thank the Guildhead as you walk out.
*set bbFang 0
*set bbClaw 0
*set bbHide 0
*set bbBlood 0
*set fangGold 0
*set clawGold 0
*set hideGold 0
*set bloodGold 0
*set saleGold 0
*set guild true
*goto warriorHead1

I think I will throw a page_break in there, I’m trying to avoid the dreaded “Wall of Text” :slight_smile:

:slight_smile: the page_break needs to go before the shopkeepers answer, to not have possible shenanigans.

basically it’s like this:
everything that is set is set on the page it is on. for example, when you have something random at a page, roll the *rand at the start of the scene before anything else, as when you do it in the text it will rerole each time the page is loaded anew (by switching to stats for example)

so, in this case this could get weird with your finances. could, not necessarily will

@MeltingPenguins Yikes! I’d figured that was the correct location for the page_break, it just looks better to me. Thank you for all of your help, you have no idea how much I appreciate it!

1 Like

i share the knowledge I got.

:slight_smile: I aspire to learn.

1 Like