Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
RickVoid
Oct 21, 2010
If anyone is interested in using the ChoiceScript system for making a game, I spent a weekend reading through their online manual and tutorials (which are awful and bad and full of lovely advice), and wrote up a list of the various commands and explanations of their usages, often with an example of how it's used. I'll post it below (in code tags because otherwise the forum will interpret some of it as BBcode).

ChoiceScript is an actually good and flexible language that is unfortunately tied to a company that has made some really, really bad games.

code:
Choice of Games ChoiceScript Commands

*choice
Tells the interpreter to prompt a response from the player, from the listed options that follow.

#
Tells the interpreter that the following text string should be treated as a option for the player to click.
Pressing enter (creating a line-break in the code),
tells the interpreter to treat the next line as plain text, displayed in the event that option is chosen.
(Until it encounters the next instruction.)

[b][/b] and [i][/i]
Place around text to set it to bold or italic, respectively.

*finish
Tells the interpreter to close the current scene and move on to the next. By default the command displays a button that
says "Next Chapter" but if you place a text string after the command (EX: *finish The next morning...) will replace it
with your string.

*label <string>
Tells the interpreter treat mark the following block of code using the string following the command.

*goto <string>
Prompts the interpreter to jump to the requested labeled block of code.

*create <variable> <value>
Tells the interpreter to create a named variable, and to assign it a name and a number. The value can also be set to
True or False. Value can also be set to reference another named variable by placing the variable name in the value field
and putting it in quotes (EX: *create variable_2 "variable_1"). Value can be set to the value of another named variable
by puting the variable name in curly braces (EX *create variable_2 {variable_1}).

*set <variable> <value>
Allows you to set a named variable to a new value. Can place a +, -, *, or / in front of the number to add, subtract,
multiply or divide by the requested value. Both set and create can be used to derive new variable from the values of
others.

*if
Used to create a nested if statement. The allows you to check a particular variable and send the player down different
paths dependent on its value. The interpreter recongnizes the following operators: = (equal to), != (not equal to), >
(greater than), < (less than), >= (greater than or equal to), <= (less than or equal to), and, or, not. Also allows you
to compare a text string value in a variable to specific text string. (EX: *if name = "RickVoid") Can be followed up
with *else and *elseif.

*selectable_if 
Tells the interpreter to only allow the player to select the choice that follows if the conditional statement is True.
(EX: *selectable_if name = "RickVoid" #"I'm the bloody author of this mess, I'm writing you out of this story!") The
option will apear in the list, but the player will not be able to select it if the statement is False. Can be used to
give the player hints on how to be able to choose that option. Simply using the *if command will still offer the player
the option if the condition is True, but the player will not see the option if the condition is False.

*hide_reuse, *disable_reuse
Used in the event that you want the player to explore alternate option in a scene, but want to prevent them from using a
choice again. *hide_reuse hides the option, *disable_reuse displays the choice, but won't let the player select it. Can
be placed at the start of each scene to apply the setting to all choices in the scene, allowing individual options to be
toggled with the *allow_reuse command.

*scene_list
Used in startup.txt to create an ordered list of scenes that make up the game. The *finish command tells the game to go
back to this list and start the next scene.

*ending
Used in the final scene (or death scene, or anytime the player has ended or otherwise lost the game) to prompt the
interpreter to insert the "Play Again" menu.

*goto_scene
Used to call a specific scene. Allows you to jump the player to a scene that otherwise does not appear in the scene
list. Allows you to create scenes that may not appear in all games.

Startup.text
The following Commands must appear at the top of this file:
*title (sets the title of the game)
*author (that's you, idiot)
*scene_list
*create (???)

*comment
Allows you write notes in the code that the interpreter will ignore and not display to the player. All text following
the command will be ignored until the interpreter reaches another line break.

*page_break
Tells the game to prompt the player to press a "Next" button before moving on to the next line of code. Typing a text
string after the command (EX: *page_break GET OUT OF THE WAY!) will replace the text in the "Next" button with the
string.

*input_text <variable>
Prompts a text string from the player to proceed, and assigns whatever they put in the box to that variable.

*input_number <value>
Same as above, but only accepts numberical values.

*rand
Sets a variable to a random value. (EX: *rand treasure_roll 1 6. This generates a random integer between 1 and 6.)

${variable}
Allows you to display the value of a certain variable to the player. $!{variable} will capitalize the first letter and
$!!{variable} will capitalize the whole word.

*fake_choice
A bullshit garbage command that allows you to offer the player a list of options to choose from, none of which effect
the story whatsoever, wasting everyone's time. Every choice should make a difference somewhere, or there's no point in
asking for the players input. NEVER loving USE THIS poo poo.

Fairmath
%+ or %-, used with set <variable> <value> commands to prevent a variable's value from going over 100. This should
typically be used when modifying a variable that is being treated as a percentage. Fairmath tells the interpreter to
increase small values and decrease large values much more than to decrease small values and increase large values. Value
increases and decreases tend to stall out in the 80's and 20's respectively.

*image
Inserts a specified image file. It is automatically placed centrally, but you can put left or right after the initial
command (EX: *image hello.jpg left) to justify the image left or right.

*line_break
Allows you to place a single line break in your displayed text. By default the interpreter will recognize a paragraph
break but will glue single break text together.

*setref
This one is complicated. It lets you assign a value to a variable using another variable that has the first variable as
its value. (EX: The value for variable Virtue_1 is set to Honesty (by using command *set Virtue_1 "Honesty", the quotes
tell it that the value is actually a variable), so we can just use the variable Virtue_1, using the *setref command, to
set values to variable Honesty, when Virtue_1 could have been set to Courage instead, preventing you from having to
write a dozen if statements to cover all possible variable values for Virtue_1. Useful, but requires a ridiculous
explanation like this. Choice of Games did it poorly.)

*stat_chart
Creates a table of stats (a list of certain variables), that displays when the player clicks the "Show Stats" button.
This command is used in the choicescript_stats.txt file. Placing either the word text or percent will display the value
of the variable as either text or a percentage (although percentage only works if the value IS a numeral).
(EX:
*stat_chart
	text name
	percent leadership
	percent strength)
How you type the name of the variable being called is how it will appear to the player, letting you captalize a variable
that you didn't internally. You can also have the game display a different name for the variable by writing the name you
want it to use after the actual variable name.
(EX:
*stat_chat
	text name Apellation
	percent leadership Juice
	percent strength Fist)
Stats can also be displayed as opposed pairs, even if we are only using one variable for both values.
(EX:
*stat_chart
	opposed_pair Brutality
		Finesse
	opposed_pair Cunning
		Honor
	opposed_pair Disdain
		Vigilance)
Or, if we need to rename the first variable:
(EX:
*stat_chart
	opposed_pair attack_style
		Brutality
		Finesse
	opposed_pair virtue
		Cunning
		Honor
	opposed_pair give_a_fuck
		Disdain
		Vigilance)
You can make the title displayed for a variable... variable.
(EX:
*temp title "Strength"
*if poetic
    *set title "Thews and Sinews"
*stat_chart
    percent strength ${title})
If the variable poetic is set to true, then the Strength variable will display as Thews and Sinews. If false, it will
just display as strength. Can be used to hide what a particular stat is actually tracking until later, but still show
the player that something is being tracked. You can also use if statement and boolean values to determine whether or not
a particular stat is displayed on the stat chart at all. Multiple stat charts can be displayed by using the *page_break
command (to view them one after the other)(LAZY OPTION) or the *choice command (to allow the player to jump to a
specific stat screen)(BEST OPTION). Can combine the *choice command option with the *gosub command to allow the player
to jump to any stat screen from any other stat screen.
*tables slightly less broken.

RickVoid fucked around with this message at 14:37 on Mar 17, 2016

Adbot
ADBOT LOVES YOU

RickVoid
Oct 21, 2010

Potsticker posted:

Thanks for this writeup, it does look interesting and it answers some questions I had about how the Choice Of games were scripted.

Their tutorials are similarly enlightening. The section on fakechoice almost literally says "use this to artificially pad out your game" and it down plays using the more advanced functions "because the player will neither notice nor care". Really explains the design philosophy behind some of the games their studio put out.

RickVoid
Oct 21, 2010

SimonChris posted:

http://store.steampowered.com/app/726870/Anchorhead/

Anchorhead is coming to Steam on 31 January, with original illustrations.

Anchorhead is pretty good. There was a really good LP here a while back, with original art from the LPer, and he was offered to do the art for this, but IIRC it fell through for varipus reasons. Pretty sure that's the case cause that art is definently not the goon artist's style. Too bad.

RickVoid
Oct 21, 2010

Megazver posted:

Ryan Veeder's new game, The Lurking Horror II: The Lurkening is a fun short puzzler. You're a student at an eldritch university, stuck in a time loop nine turns until a Great Old One eats the universe. It may or may not be your fault. So you try to solve this mini-puzzle or that in nine turns, to get a new spell, then you restart the game and you're back at the start of the time loop, but on that piece of paper in front of you, there's one more spell you can use on a new puzzle now!

It's pretty good.

This works on my phone.

I'm playing IF on my phone, I cannot express to you how goddamned happy this makes me.

RickVoid
Oct 21, 2010
That would be a good patch, yes. I've found 6 words thus far, two of which I have yet to find a practical use for and one of which appears to be of dubious use only. Also that two of the spells do a thing when cast together? A possibly useless thing.

I also just got the joke in the Eldest Horrors name. Well done.

Adbot
ADBOT LOVES YOU

RickVoid
Oct 21, 2010

Megazver posted:

There are... eleven words, I believe. At least, that's what I have written down in my notebook. If you get stuck as I did, make sure to check the foundation pit north of the Alchemy Lab building. I thought it was scenery for the longest time, until I got stuck hard and started just examining everything.

Thanks for the hint, it's the only place I haven't really looked at yet/where progress is potentially not blocked off?

  • Locked thread