Stats, variables... I need a miracle

So! I’ve been at this for days… I have tried every possible solution that I could think of, but nothing seems to work.
First of all. I want to create a system that would allow the player to change a variable in the stats that would take effect in the main game. But it doesn’t seem to be working. I searched for a bit in the forum, and found out that choicescript only registers the “variable change” after it goes through a page break in the main game (at least that’s how I think it works).

But I wanted immediate effect, so I found out about *redirect_scene.

Now I have this:

*label phone
You pull out your phone.
*label phoneoptions
*choice
  #Call someone
    You search through your contacts.
    *goto contacts
*goto navigation_menu

*label contacts
*choice
  *if (meettrevor) #Trevor
    *redirect_scene trevorcallsevents

This is in the stats.
Then it goes to this page:

*label trevorcalls
*if (trevorphoneend)
  You tried calling him but he doesn't pick up.
  *page_break
  [DEAL WITH THIS LATER]
*if (phone1alone)
  *set phone1aloneactivate true
  *goto_scene alone phone1

And if everything goes well:

*label phone1
*if (phone1aloneactivate)
  *set phone1aloneactivate true
  The phone rings…
  *page_break
  *set phonetrevor true
  [BLAH BLAH CONVERSATION]
      *if (nolocation)
      *label 1alone
      *choice
      *hide_reuse #Ask about a way to trace a call
        [BLAH BLAH CONVERSATION]
        *goto 1alone
      *hide_reuse #Ask what work is he doing
        [BLAH BLAH CONVERSATION]  
        *goto 1alone
      #Time to hang up
        *set trevorphoneend true
        *set phonetrevor false
        “Thank you, Trevor. I’m going to hang up now.” You say. He hums.

        “Yes, hope to see you again.”
 
        “You too.” And you pull the phone away from your ear and hang up. 
        *page_break
        *goto phone1finish

 
*label phone1finish

Actually... you really didn't need anyone. This was just a simple meeting, and if you told anyone down at the agency that you purposely got involved with a case that you weren't supposed
to, they would be angry at you. Especially Trevor, he would probably 'fire' you.

This page is the main game page. I don’t know how to explain it well, but this whole event is triggered in this page at this moment. Then if the player goes to the stats, calls on the phone, they’ll end up on the same page as they were before. This time with this event.
After the label of “phone1finish” that’s the actual game without the event.

My problem is. During the “call/event”, if the player decides to go to the stats and then presses “return to game”, they’ll skip the whole event and go to the rest of the game (after the label “phone1finish”).

I don’t understand why and I would greatly appreciate help. I feel like I’m going crazy with this.

1 Like

You’re not meant to change any stats or variables in the stats screen. It will mess up.
I’d recommend a fake stats screen, like a choice that has “check your stats” or something similar.
Then you can just make it *gosub to a scene where you can change your stats and then *return.

2 Likes

I believe that’s what I have. But correct me if I’m wrong. The changes in the variables are not in the stats screen but in another page.

Return to Game bugs out when there’s a redirect scene in play, I believe?

2 Likes

So there’s really no solution?

I totally get what you’re trying to do from the stats menu and I think it’s awesome but as to a solution you might have to ask @dfabulich.

As for a workaround, just try the same thing you’re doing, but not from the stats menu.

#Call someone
    You search through your contacts.
    *goto contacts

The above might have to be a persistent option in your choices, wherever it is appropriate.

2 Likes

Yeah I know and thank you for answering. It makes me sad and frustrated that I won’t be able to do what I want to do. I’ll probably do what you suggested even though I wish it wasn’t an obvious choice (I was thinking more like a bonus event).

Even so thank you so much!

1 Like