Ultimate Noob Coding

You just need to insert it for your dashingdon version. *sm_init works in tandem with the checkbox thing in the site.

In your case, your error only comes up in your local version as you don’t have something to checkbox.

1 Like

I’d also like to add that you make sure that *sm_init goes after all the *create and *achievement lines in startup. Otherwise it’ll produce an error.


1 Like

Ah, that’s the issue. First I put it before everything, then after title but in the middle of the create list. It needs to literally be right above the start of the story I take it?

@Szaal I was testing it off the Dashingdon, for the brief time I had the version with the code uploaded. Does that mean it will prevent me testing locally though?

If you want the feature to present in your local version, there’s more things to do. You can check it out on the saving plugin thread, but in the mean time, I’m at outside.

I’ll try to do something once I get back.

1 Like

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

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
1 Like

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.


I can dig it. Thanks guys! I should be able to fix that up.


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? :confused:

1 Like

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)

You have duplicate specialization = "Battle Magic".
Oh, wait. My bad, my eyes bad.

1 Like

Er, isn’t it Elemental Magic and Battle Magic? :sweat_smile:

You’re lacking one more set of parentheses, to group both Battle and Ele.

1 Like

Ah, okay, thanks! I guess I didn’t realize that any “or” has to be connected with its own enclosed parenthesis!

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.


Got it—thank you so much!