LisHz
386
If you add the *sm_init command, it will not work when you test locally.
Here is what I do, when I want to test locally, I comment out the command. So mine reads:
*comment sm_init llg_tz | 3
*finish
The llg_tz is a quick nickname for my draft and the | 3 is for how many save slots I want to offer.
I included the *finish so that you can see where I place this in my startup file–all the way at the end.
Then, when I upload to Dashingdon, I delete “comment” and save. Then I upload that version.
*sm_init llg_tz | 3
*finish
1 Like
Minnow
387
The simple solution would be to *comment out (or temporarily delete) the command before running local tests, then restore it before uploading. That said, it is possible to run it locally. As @Szaal said, that process is detailed in the topic for the save plugin, but here’s what I remember of it:
- First, you download two additional
.js files, and place them in the same folder as the other .js files.
- Then you edit one of the
index.html files, so that the new .js files will be called when the original .js files are called.
- Then you use the
*sm_init command.
It’s probably more trouble than it’s worth to implement it locally, but the option exists.
Edit: This should be the post with the relevant downloads and instructions, if you decide to implement it locally.
2 Likes
I can dig it. Thanks guys! I should be able to fix that up.
2 Likes
Okay, so I did a variable with values 1-11 for activity choices in my story. All well and good, but how late in the game I want to add another choice, and I can’t make it number 12 because it is a physical activity, and the physical ones were 1-5 and the mental ones were 6-11. Can I make a variable=5.5, or will that screw everything up?
I think so.
Also, what does your code look like that ‘or (x =12)’ isn’t possible?
1 Like
Mostly just don’t want to change all the times I used (x < 6) to split the two categories up. I figure in this case those will still play. Might have to change a few (x > 5) options, but that’s only half the work, right?
mhnnn… search and replace?
It’s very tempting to use numerics for this sort of thing but I wouldn’t do it personally. I prefer strings, then you can just add to them. Start with “1” then “1.1”, “1.1.1”, “1.2”, etc… There’s no limit. It does mean you have to do more work to sort them out in following passages but the flexibility it gives you is enormous.
Course, that’s not much help if you’re already started… You can certainly use 5.5 or any other number though.
Can you make it x = 0, or are you already using 0 for something else? 
1 Like
rinari
395
Hey guys, I’m driving myself crazy trying to figure out what parentheses I’m missing here, even though I’m sure it’s obvious and I’m being dumb…
*if ((compassionate <= 45) and (astral >= 20)) or (specialization = "Battle Magic") or (specialization = "Elemental Magic")
ERROR: invalid expression at 41, expected no more tokens, found: [)]
I’m working off of the ChoiceScript wiki example for this and it seems pretty much the same to me, so I’m not sure what I’m doing wrong…
*if ((var1 > 10) and (var2 > 20)) or (var1 > 70)
Szaal
396
You have duplicate specialization = "Battle Magic".
Oh, wait. My bad, my eyes bad.
1 Like
rinari
397
Er, isn’t it Elemental Magic and Battle Magic? 
Szaal
398
You’re lacking one more set of parentheses, to group both Battle and Ele.
1 Like
rinari
399
Ah, okay, thanks! I guess I didn’t realize that any “or” has to be connected with its own enclosed parenthesis!
Szaal
400
Well, CScript is just that kinky when it comes to conditional checks. It must give true/false result of all the pairings, and if something isn’t paired, it will give you error.
2 Likes
rinari
401
Got it—thank you so much!
Such a great (and scintillating) way to put it.
1 Like
rinari
403
Actually… adding the second pair of parentheses didn’t work, either! 
*if ((compassionate <= 45) and (astral >= 20)) or ((specialization = "Battle Magic") or (specialization = "Elemental Magic"))
I’m still getting the same error!
Oh WAIT I think I need a third parenthesis around the whole thing??
Edit: Okay yes thank goodness it works!
Szaal
404
Huh, that’s odd. I never need to use a whole-wrapper thing and my game’s running fine, unless the check is used to lock choice #options. Speaking of which, is your check used in choice #options?
1 Like
rinari
405
…yes, it was…
I did not know that made a difference! Good to know!
1 Like