From: Jon Feldman Date: Tue, 23 Sep 2014 04:06:13 +0000 (-0400) Subject: Update SCRIPTINGDOC.md to be more pretty. X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=6a40db8584c64e2afa09ca00d998c8605f339508;p=vn%2Fvndc.git Update SCRIPTINGDOC.md to be more pretty. --- diff --git a/SCRIPTINGDOC.md b/SCRIPTINGDOC.md index 3c9e9f4..906094c 100644 --- a/SCRIPTINGDOC.md +++ b/SCRIPTINGDOC.md @@ -43,16 +43,16 @@ CHOICE choice presents choices to the user on screen. -` + choice ch1|ch2|ch3... -` + Each choice is separated by a '|' (pipe) character. The result of the choice is stored into a variable named 'selected', which can be queried with if. Optionally, I implement an extension of this form: -` + choice ch1|ch2|... >var -` + Instead of storing to selected, 'var' will be used instead. CLEARTEXT @@ -101,11 +101,11 @@ I have no clue how many of these VNDS implements, but I do them all. fi simply ends an if statement. -`fi` + fi Note that I am a bit smarter than vnds here. `if` and `fi` CAN be embedded. So this is valid: -` + if selected == 2 if previous >= 5 text 'You win!' @@ -114,7 +114,7 @@ Note that I am a bit smarter than vnds here. `if` and `fi` CAN be embedded. So t text 'You lose!' fi fi -` + The behavior of VNDS would be to `'if previous <= 5'` on failure of `selected == 2`. This is really not proper: vnds just conditional jumps. Frankly, a jumpeq would be far more effective. I keep an if-count instead of an in-if bool value, so there's proper control flow. @@ -174,9 +174,8 @@ G/SETVAR (variables) setvar and gsetvar are used to set variables. gsetvar specifically sets the 'global' state, that is, common to all saves. In my implementation - that is moot. Thus, gsetvar just calls setvar. -` - [g]setvar var mod value -` + setvar var mod value + gsetvar var mod value mod can be one of the following: @@ -190,17 +189,17 @@ Also, if value is not specified, you can also do this as the mod: One more thing that was not all over the place in vnds, but typically at the beginning. -` + setvar ~ ~ -` + Which means reset all vars. This ignores globals - e.g. prefixed with a lowercase `g`. As well, my extension provides the ability to set a variable to another variable. -` + [g]setvar var op var2 -` + Again, this only works in extensions mode. @@ -209,17 +208,17 @@ SOUND sound plays a sound, and optionally a number of times. -` + sound file [times] -` + `times` is implicitly 1 if not specified. Pass -1 for infinity. You can do -` + sound ~ -` + To stop all playing sounds. @@ -228,9 +227,9 @@ TEXT text is the meaty huge function. It outputs text, as you probably expect. -` + text This is text dee doo... -` + There are a bunch of variants with special meaning. I don't know why, but there are: @@ -260,9 +259,9 @@ Make sure you start up with the -b parameter, and start it from a console. Send The console should now prompt you with this; -` + [scr command] $ -` + You can enter any command above; Some won't work right. choice probably won't work properly, because mouse is disabled. @@ -299,12 +298,12 @@ SAVE FORMAT Saves are actually a script generated by the save function. So, for example, this is a save: -` + setvar selected = 2 music bgm03.ogg bgload qmrtb.jpg jump fate01-00.scr 261 -` + It restores any variables needed, loads the current music and bg, and jumps to the location we were previously at in the script.