From 3b784ab9024764ad1870926a5e60c3c1a5703a55 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 May 2016 06:55:43 -0400 Subject: [PATCH] Update docs --- Format.vndc.txt | 206 ++++++++++++++++++++++++++---------------------- TODO.md | 23 ++++-- 2 files changed, 129 insertions(+), 100 deletions(-) diff --git a/Format.vndc.txt b/Format.vndc.txt index a8228a8..047f1dd 100644 --- a/Format.vndc.txt +++ b/Format.vndc.txt @@ -7,25 +7,25 @@ Script format documentation (VNDC and VNDS) ====================================================== Contents. - 1a. bgload - 2b. choice - 3c. cleartext - 4d. delay - 5e. if and fi - 6f. goto and label - 7g. jump - 8h. music - 9i. random - 10j. setimg - 11k. setvar and gsetvar - 12l. sound - 13m. text - 14n. debug commands - 14n1. help - 14n2. resume - 14n3. quit - 14n4. save - 15o. Save format + 1a. bgload + 2b. choice + 3c. cleartext + 4d. delay + 5e. if and fi + 6f. goto and label + 7g. jump + 8h. music + 9i. random + 10j. setimg + 11k. setvar and gsetvar + 12l. sound + 13m. text + 14n. debug commands + 14n1. help + 14n2. resume + 14n3. quit + 14n4. save + 15o. Save format = 1a. ================================================ @@ -33,20 +33,23 @@ bgload sets a background image. bgload takes two arguments, one of which is optional. - bgload bg [fadeout] + bgload bg [fadeout] The parameter 'bg' should be a file in backgrounds. The second parameter, 'fadeout', should be a length in frames to fade into the new background. +NOTE: fadeout is currently ignored in the current +version. + The game always operates at 60fps. = 2b. ================================================ choice presents choices to the user on screen. - choice ch1|ch2|ch3... + choice ch1|ch2|ch3... Each choice is separated by a '|' (pipe) character. The result of the choice is stored into a variable @@ -54,7 +57,7 @@ named 'selected', which can be queried with if. Optionally, I implement an extension of this form: - choice ch1|ch2|... >var + choice ch1|ch2|... >var Instead of storing to selected, 'var' will be used instead. @@ -63,22 +66,24 @@ instead. cleartext clears all of the text on-screen. - cleartext [mod] + cleartext [mod] A modifier can be specified with mod. This is supposed to -be fadeout or something. +be fadeout or something. It isn't documented for vnds. Strangely, this command does not actually appear in the -conversion of fate-stay night. +conversion of fate-stay night or any other weaboo.nl +onverters. It's likely unused. -Also, I ignore mod. It seems to be useless...maybe. +NOTE: mod is ignored, due to lack of docs on what is +actually supposed to do. = 4d. ================================================ delay will sit around and wait a certain number of frames. - delay frames + delay frames 'frames' is the number of frames to delay. Again, we operate at 60fps. @@ -89,88 +94,89 @@ Technically, two commands. if and fi are used for execution control. if the result of if is true, all statements are executed until a matching fi. - if var op val + if var op val 'var' is a variable name. This can be a setvar, choice etc. op should be one of the following: - < - less than - <= - less than or equal - == - equal - != - not equal - >= - more than or equal - > - more than + < - less than + <= - less than or equal + == - equal + != - not equal + >= - more than or equal + > - more than I have no clue how many of these VNDS implements, but -I do them all. +vndc implements them all. - - - - + - - - fi simply ends an if statement. - fi + fi -Note that I am a bit smarter than vnds here. if and fi +Note that vndc is 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!' - fi - if previous <= 5 - text 'You lose!' - fi - fi + if selected == 2 + if previous >= 5 + text 'You win!' + fi + if previous <= 5 + 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 jumps. I keep an if-count instead of -an in-if bool value. +an in-if bool value, so the result is as expected. = 6f. ================================================ goto finds a label and continues execution from there. - goto label + goto label -In my implementations, label is actually completely -non-existent as a script command. Instead, goto -finds labels by re-seeking through the file. +In vndc, label is actually non-existent as a script +command. Instead, goto triggers a rewind and seek for +the label within the current file. = 7g. ================================================ jump transfers control to another script file: - jump script + jump script My implementation provides an extra form of jump: - jump script [line] + jump script [line] Which goes directly to line in the file. This -is utilized for saving. As such, you can't -turn off that extension. Period. +is utilized mainly for saving. As such, this extension +cannot be disabled. Unfortunately, this allows a vnds +game to detect the use of vndc as the interpreter. = 8h. ================================================ music loads a audio file from sound, and plays it in a loop as music. - music file + music file -You can pass '~' as file to stop playing all music +You can pass '~' as file to stop playing music like so: - music ~ + music ~ = 9i. ================================================ random saves a random number to a variable. - random var low high + random var low high low and high are the range the random number is in, inclusive. @@ -180,32 +186,40 @@ inclusive. setimg displays an image from foreground at a position specified. - setimage file x y + setimage file x y + +Note that coordinates are based on the Nintendo DS; +if you have a 640x480 display, you do not use 320 0 +to display at the middle for example. = 11k. =============================================== 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. +to all saves. + +In the current state of the code, there's no difference +between the two due to lack of multiple save support. + Thus, gsetvar just calls setvar. - [g]setvar var mod value + [g]setvar var mod value -mod can be one of the following: +'mod' can be one of the following: - = Set var to value - + Add value to var - - Subtract value from var + = Set var to value + + Add value to var + - Subtract value from var Also, if value is not specified, you can also do this as the mod: - ~ Reset to 0. + ~ Reset to 0. One more thing that was not all over the place in vnds, but typically at the beginning. - setvar ~ ~ + setvar ~ ~ Which means reset all vars. This ignores globals - e.g. prefixed with a lowercase 'g'. @@ -213,7 +227,7 @@ 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 + [g]setvar var op var2 Again, this only works in extensions mode. @@ -221,44 +235,50 @@ Again, this only works in extensions mode. sound plays a sound, and optionally a number of times. - sound file [times] + sound file [times] times is implicitly 1 if not specified. Pass -1 for infinity. You can do - sound ~ + sound ~ To stop all playing sounds. +Zero results in no sound being played. + = 13m. =============================================== text is the meaty huge function. It outputs text, as you probably expect. - text This is text dee doo... + text This is text dee doo... There are a bunch of variants with special meaning. I don't know why, but there are: - text - (no params) Clear screen - text ! - Wait for input and clear all. - text ~ - Clears all text (like cleartext) - text @... - Don't wait for click after text - is spit. + text - (no params) Clear screen + text ! - Wait for input and clear all. + text ~ - Clears all text (like cleartext) + text @... - Don't wait for click after text + is spit. I've implemented a few extensions that help generally with NVL games. - --- - At the beginning of a line, - clears before text output. - " - In the sound function - if lookahead finds a text - with quotes, it's assumed - that sound is a voice and - linked to the text. AKA - smart voice stopping. + --- - At the beginning of a line, + clears before text output. + + " - In the sound function - + if lookahead finds a text + with quotes, it's assumed + that sound is a voice and + linked to the text. AKA + smart voice stopping. + + This is heuristic and can + get it wrong. = 14n. =============================================== @@ -266,14 +286,14 @@ I've implemented a few debug commands to help out and just generally be useful (cheats? :P) Make sure you start up with the -b parameter, and -start it from a console. Send it a SIGINT (^C). +start it from a console. Send vndc a SIGINT (^C). The console should now prompt you with this; - [scr command] $ + [scr command] $ You can enter any command above; Some won't work right. choice, if, and jump probably won't work -properly. +properly for their own reasons. No commands run in this state will advance the program, but flags set will affect it. @@ -297,7 +317,7 @@ the form of a console command. save will save to a mandatory file specified; - save file + save file See section 15 for info on what the a save actually is. @@ -307,10 +327,10 @@ actually is. 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 + 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 diff --git a/TODO.md b/TODO.md index 2babe54..708b35d 100644 --- a/TODO.md +++ b/TODO.md @@ -1,11 +1,20 @@ -What needs to be done -===== +What needs to be done (now) +----- - - Stop using dirty rendering completely. + - Rip out this shitty build system in favor of platform-specific makefiles and autotools for everything else. Let's be honest; it sucks and I know it. + - Remove all remaining direct SDL calls in code, move to zero. + - I've done heavy overhauling on zero in my private code, so merging it back with fixups will happen first. + - Port to 3DS. Yes, there's an existing vnds port. It sucks. + - Namely, it doesn't have support for proper control flow - same as the original VNDS. + - Port to android. It's about damned time I get things working. + +What needs to be done (eventually) +----- + + - Stop using dirty rendering. - Make a better debug-console/menu system. - - Implement a proper save menu with highlighting. - - Also, op_choice. It's terrible and hackish. - - Change all direct SDL uses to call Zero instead - since that will be backend-independent. - - Rework op_text to use newlined buffers instead of dirty text renders + - Implement a proper save menu. + - op_choice is terrible and hackish. + - Rework op_text to use newlined buffers instead of dirty text renders. - After reworking op_text, make current text on-screen restored with saves - Also, find an inventive way to save screenshots and current sfx. -- 2.39.5