Updates to variables not saved within Stats

Hey everyone.

Thanks in advance for any help that can be provided.

My issue is quite extensive and I’m scratching my brain to wonder if the underlying theory is the flaw. I’ve spent the last few weeks working on designing and building my inventory and equipment systems. These are nested within ChoiceScript_Stats as is customary and needed. For these two systems to pass data, they work with subroutines, nested within subroutines. Per the Wiki, that’s fine.

I finally reached the point of actually fully testing the equipping loop tonight. You’ll equip one weapon, it’ll bounce to a subroutine file, run the subroutine, and bounce back while finishing updating some variables.

Below is the initial trigger.

  #Equip Weapon
                *if (wep_harbingerofdoom_equip = true)
                    Your mind emerges from a cloudy haze, realizing this weapon was already in your primary holster.
                    *page_break Slip of the mind.
                    *goto harbingerofdoom
                *if (wep_harbingerofdoom_equip = false)
                    *gosub_scene equipping_subroutine weapon_swap
                    *set wep_harbingerofdoom_equip true
                    *set equipwep_player_name "Harbinger of Doom"
                    *goto harbingerofdoom

The subroutine file involves this code, thus far.

*label weapon_swap
*if (wep_furyofthefirst_equip = true)
    Testing…
    *set wep_furyofthefirst_equip false
    *return

*if (wep_harbingerofdoom_equip = true)
    Testing…
    *set wep_harbingerofdoom_equip false
    *return*

Everything works without an error. At first, I thought I was completely fine. Until I left the Stats page altogether.

Upon doing so, it’s like the changes to variables never happened. The data magically wipes itself out to the original state.

I’m trying to troubleshoot and am worried I’ve ran into a critical engine/language limitation. I figured I’d run it by each of you.

Thanks.
~Zach

EDIT: I should also note, I am using CSIDE.

Changing variables in the stats menu is not the best way to do it if you can get around it. Usually you have to advance a page in the main game to get anything changed in the stat menu to stick. If you go out of the stat menu and then straight back again, it will blank the changes made. You can do it, you will just have to tell people they can’t go back to the stat menu straight away.

Example: What I’ve needed to do to get character customisation via the stat menu to stick in Raishall:

1 Like

Here’s the explanation for why changing stats in the stats page doesn’t work well:

Worth reading all of Dan’s comments on that thread, really. The final-for-now resolution, leading to what jacic described, is here.

3 Likes

Thank you both so much for your time and for providing some resources.

I’ve got a general idea on a path forward, it’ll just take some retooling based on what I already have.

Once again, I deeply appreciate your help.
~Zach

2 Likes

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.