'cuz I literally (was) have no idea with what is causing your error, and I chose to step away and hide at the dark corner of the room instead of giving any feedback
@Nonvita
After a careful, thorough perusal, I figured out that indeed [save_save_morebananasb] shouldnāt exist.
Instead, the one that should exist on its place (which is [save_num2]) should be [save_morebananasb].
IDK. You get that error when going to the #Go back. at check_2, isnāt it?
Edit: Iāve tried to reproduce with the bug and come up with following⦠report.
BTW, this is my code.
Code
*label first
Allright. This is just a blurb. Letās begin saving
*choice #Save
*set save_num ācheck1ā
*set save_check1 ā~hp~hp_lim~str~agi~foc~flakeā
*gosub_scene twiger_functions save
*goto back
#Return to main menu
*goto_scene startup
*label back
Youāre done saving. Letās alter some stats
*set hp 100
*set hp_lim āhaha no wayā
*set flake ā-5ā
BTW, it was HP +100, max hp āhaha no way,ā and flake -5.
I figured out that the problem with your code is that youāre lacking *set save_num "morebananas"
I mean, put it like this
*choice
#Finish.
You have ${bananas} banana@{bananas |s|s}. No more bananas for you!
*finish
#Go back.
*set save_num "morebananas" <<<<<<<<<<<<---
*gosub_scene twiger_functions load
*goto check_2
I think you still need to *set the [save_num] no matter what kind of process youāre going to get through (load/save), which isnāt a big deal by itself.
Well then, back to my own code.
@Twiger_Fluff Nah, Iāve done an experiment using *temp and *set before, and itās unlikely that the cause is the *temp.
Both of them works quite similar, it just that *temp got deleted whenever the subroutine is done.
Edit:
I think I have a question that can narrow us down the problem.
So, we have label load4 *set holder saves_string
and load7 *set {holder} saves_string
Any reason why the 7 has curly parentheses why the 4 is not?
Iāve tried put the 4 on a parentheses, and the error occurrence shifts up exactly on that line.
While removing all the parentheses makes your loading function do nothing.
Except, alas, their game design philosophy. See the āback buttonā question on the FAQ.
I can imagine that they might let it go through in a Hosted Game, but unless thereās been some reason for them to reconsider their lack of a back button, I doubt itāll ever make it to an official CoG title.
Edit ā whoops, sorry, I realize I was responding more to IvoryOwlās
Yes, that was my thought as well. Obviously they have the capabilities to produce some sort of ābackā button / checkpoint system, but they donāt. I can understand their reasoning, but I do find myself wishing all too often for one⦠(Not to avoid failure, mind you, but it happens fairly regularly that the outcome of a choice is completely unexpected for me, and isnāt something that fits with my MCās characterization.)
@Szaal Tried itāyou were right! You have to set save_num both for saving and loading. I also had to shift my code a little so I set the variables after doing the checkpoint save (duh!) but it works now! Semua pisang buat Mas
Okay, youāll hate this. I spent like 4 hours today driving to my grandparentās and another 4 back so I couldnāt really work on it today but while I was in the pool it took me three second of thinking over what you said in your last post and I found the solution/problem (hopefully)
long story short:
But in the function it takes save_num and changes it.
end of long/short story. Iāll have to test using a new *temp instead of save_num so it doesnāt get changed but I think thatās it.
@Szaal That did it! Whoo. Go swimming! Iāve updated the link with the fixed version of twiger_functions (now you can go back to setting the save_num only once). But as Iām testing @Nonvitaās banana thing I get the error bananas line 20: invalid @{} at letter 49; ābananasā is equal to 4 but there are only 3 options
You probably need to check if bananas is above 3 and then end the thing before doing the @{} thing.
Someone needs to explain to me what in the world banana@{bananas |s|s} is/does Iāve never seen @{} or |s|s
Edit: Iām look at the annoncement that explains it here. I kinda understand it but Iām still really confused on the syntax.
Changing the code to this:
2018 Best Seller "Bananas"
*label check_1
*set bananas +1
*set save_num ābananasā
*set save_bananas ā~bananasā
*gosub_scene twiger_functions save
*if (bananas < 4)
This is checkpoint 1. You have ${bananas} banana@{bananas |s|s}.
*label check_2
*set bananas +2
*set save_num āmorebananasā
*set save_morebananas ā~bananasā
*gosub_scene twiger_functions save
*if (bananas < 4)
This is checkpoint 2. You have ${bananas} banana@{bananas |s|s}.
*choice #Finish.
*if (bananas < 4)
You have ${bananas} banana@{bananas |s|s}. No more bananas for you!
*finish #Go back.
*gosub_scene twiger_functions load
*goto check_2 #Start over.
*set save_num ābananasā
*gosub_scene twiger_functions load
*goto check_1
I get the error twiger_functions line 243: Non-existent variable āā
So Iām back to T_F being goofed.
*set {holder} saves_string is now line 243 which is the one causing the error above so maybe itās not so perfect.
Welllllll taking out the {} on L243 fixes the error and randomtest passes. (quicktest doesnāt tho. Man I hate quicktest sooo much) HOWEVER the load function stops working.
note: Deleting line 243 (the *set holder after label load7) doesnāt seem to really change anything)
Explanation of why 4 and 7 are different
4 sets holder to the variables name, then by the time 7 happens, 7=the variableās value. #7 sets the variable in the list to itās original value which is why 7 must have {} so there must be another solution to the error Iām getting.
haaalllpppp please
@Szaal I think it might have something to do with this:
That might make it so the saves_string (which holder is set to) never gets a value past the initial value of āā
So I added this:
*if holder != ""
*set {holder} saves_string
But that seems to bring up the problem of the load function not doing anything. Iām still just testing the bananas thing so maybe itās just that? maybe at least two variables need to be used in the save.
@Szaal@Nonvita
You can probably just ignore that whole post above.
The long and short is I think @Nonvita was doing something wrong, like 99.9999999% sure because now that I think about it, NONE of the text appeared after starting over. And v7 of twiger_functions works 100% perfecto on my own saving tests.
@Szaal More me and my code it is, but it seems @Nonvita needs help still.
The stuff I use to test the save system:
startup.txt
*create a "alpha"
*create beta "b"
*create c "charlie"
*create delta "d"
*create e "echo"
*comment up is mysave down is uniform
*create foxtrot "f"
*create g "golf"
*create hotel "h"
*create i "indigo"
*create save_num ""
*create save_mysave "~a~delta~beta~c~e"
*create save_mysaveb ""
*create save_uniform "~g~foxtrot~i~hotel"
*create save_uniformb ""
*set save_num "mysave"
*gosub_scene twiger_functions save
mysave is ${a} ${beta} ${c} ${delta} ${e}
*line_break
*set save_num "uniform"
*gosub_scene twiger_functions save
uniform is ${foxtrot} ${g} ${hotel} ${i}
They are now both saved.
Randomnizing variables...
*rand a 0 100
*rand beta 0 100
*rand c 0 100
*rand delta 0 100
*rand e 0 100
*rand foxtrot 0 100
*rand g 0 100
*rand hotel 0 100
*rand i 0 100
mysave is now ${a} ${beta} ${c} ${delta} ${e}
*line_break
uniform is now ${foxtrot} ${g} ${hotel} ${i}
Too bad. I don't like that. I want them to go back so...
Loading saves...
*gosub_scene twiger_functions load
*set save_num "mysave"
*gosub_scene twiger_functions load
now they're back:
mysave is ${a} ${beta} ${c} ${delta} ${e}
*line_break
uniform is ${foxtrot} ${g} ${hotel} ${i}
but changed again
*rand a 0 100
*rand beta 0 100
*rand c 0 100
*rand delta 0 100
*rand e 0 100
*rand foxtrot 0 100
*rand g 0 100
*rand hotel 0 100
*rand i 0 100
mysave is now ${a} ${beta} ${c} ${delta} ${e}
*line_break
uniform is now ${foxtrot} ${g} ${hotel} ${i}
we'll load uniform again:
*set save_num "uniform"
*gosub_scene twiger_functions load
uniform is now ${foxtrot} ${g} ${hotel} ${i}
save it again:
*gosub_scene twiger_functions save
and load it again:
*gosub_scene twiger_functions load
uniform is now ${foxtrot} ${g} ${hotel} ${i}
*finish
The output (as tested in MyGame/index.htm)
mysave is alpha b charlie d echo
uniform is f golf h indigo
They are now both saved.
Randomnizing variables...
mysave is now 79 30 21 26 60
uniform is now 94 86 15 63
Too bad. I don't like that. I want them to go back so... Loading saves...
now they're back:
mysave is alpha b charlie d echo
uniform is f golf h indigo
but changed again
mysave is now 59 35 50 0 23
uniform is now 60 10 52 47
we'll load uniform again:
uniform is now f golf h indigo
save it again:
and load it again:
uniform is now f golf h indigo
@Szaal@Nonvita To clarify, I see absolutely no problem with loading the same save a hundred times with or without setting the save_num again (make sure youāre using twiger_function v0.7 as opposed to v6 as named in the first few lines)
Here is why Iām pretty sure that loading can be done all you want:
Youāre welcome for including my personal problems.
The Code
`mysave is {a} {beta} {c} {delta} {e}
*line_break
uniform is {foxtrot} {g} {hotel} ${i}
but changed again
*rand a 0 100
*rand beta 0 100
*rand c 0 100
*rand delta 0 100
*rand e 0 100
*rand foxtrot 0 100
*rand g 0 100
*rand hotel 0 100
*rand i 0 100
mysave is now {a} {beta} {c} {delta} {e}
*line_break
uniform is now {foxtrot} {g} {hotel} ${i}
and load it again:
*gosub_scene twiger_functions load
uniform is now {foxtrot} {g} {hotel} {i}
and mess it up
*set foxtrot āJane is cute.ā
*set g āJane is my friend.ā
*set hotel āJane is bi,ā
*set i " but not into me :("
uniform is now {foxtrot} {g} {hotel} {i}
and load it again:
*gosub_scene twiger_functions load
uniform is now {foxtrot} {g} {hotel} {i}
and mess it up
*set foxtrot āJane is cute.ā
*set g āJane is my friend.ā
*set hotel āJane is bi,ā
*set i " but not into me :("
uniform is now {foxtrot} {g} {hotel} {i}
and load it again:
*gosub_scene twiger_functions load
uniform is now {foxtrot} {g} {hotel} {i}
and mess it up
*set foxtrot āJane is cute.ā
*set g āJane is my friend.ā
*set hotel āJane is bi,ā
*set i " but not into me :("
uniform is now {foxtrot} {g} {hotel} {i}
and load it again:
*gosub_scene twiger_functions load
uniform is now {foxtrot} {g} {hotel} {i}
and mess it up
*set foxtrot āJane is cute.ā
*set g āJane is my friend.ā
*set hotel āJane is bi,ā
*set i " but not into me :("
uniform is now {foxtrot} {g} {hotel} {i}`
Iām sure it can load multiple times. The code itself works mostly great. Like I said it just sometimes returns that error. You can try out the code I pasted for yourself. Iām not trying to say the code is bad, Iām just reporting what I find. What I found is if I loaded several times it popped up an error. All Iām suggesting is maybe looking into the error a bitāthatās what coders/designers do, they fix bugs that pop up, not just deny that they exist.
No, people shouldnāt be reloading all the time. But when thereās a bug, it means the potential for a problem during someoneās play.
8:02am Alright, Iāll test your code for a few theories I have. The only thing that really makes your bananas testing different from my testing is you only use one variable which is pretty pointless so if it turns out that you need to have at least two (my working theory) then oh well: no need to support saving only one variable since a *temp for it would be better than two saves variables. If itās not that, Iām stumped for the time being.
8:12am Iām not getting any errors, however when I try to go back from checkpoint 2, it doesnāt change anything. No errors. No missing text. @Nonvita Do you know what order of buttons you press to get an error/problem?
Just clicking around between Continue, Go Back, and Start Over. Iāll try adding more variables (yeah, itās totally pointless with just one) and see if it still pops up. Anyway, I should probably just change my code around a bit and try out some different code with it. But my brainās been a little tooā¦bananasā¦recently, sorry.