I hope you don't mind all these noob questions, but a short one this time . . . Can you hide variables from being displayed in the game box?
Can you display a variable amount in the main text window? Example: The variable Gold Coins = how much money the character has. In a chapter could I write, "you have {Gold Coins} gold coins?"
The small showcase i wrote got published, i think it displays a way how to work around this issue in a limited way when displaying the current attributes https://chyoa.com/chapter/Begin-Character-Creation.266931 Basically you could write something like the following, and make it as detailed as you like, with a lot of work. Code: {if Gold Coins > 1000}You have more than 1000 gold coins {elseif Gold Coins > 100}You have more than 100 gold coins {elseif Gold Coins > 10}You have more than 10 gold coins {elseif Gold Coins > 1}You have more than 1 gold coins {else] You have no gold coins left {endif} Of course it would be much easier, if the functionally to simply display the value would be implemented, as you suggested
Dings, that bit of scripting actually helped a great deal for something else I am trying, thanks! I accidentally published the story I am using as a trial and error, and all your advice has really helped, especially for character creation. https://chyoa.com/story/Red-Monika.9913 Question (of course there had to be a question): Can you add html code to the main text window? For example, I would love to turn off the auto paragraph function in some places in order to have single spacing.
I was also wondering about HTML, but I think you can also achieve single spaced lines by Shift+Return.
The same thing happened to me yesterday on the new story i am currently working on. I contacted Friedman via private message and asked nicely, and he was able to revert its status to "not published". Now i will take special attention when editing the story itself to not hit that wrong button by mistake again ;-)
I thought about doing the same thing, but when I realized the chance of me making the same mistake is very likely, I decided to live with it.
Hmm, I wish the Conditional Branch statements had more options. Currently, nesting is a real pain. Simple "and/or" commands would make a life a lot easier. For example: If G=1 AND K>2 then "show this statement."
If you start a new chapter, you can do those things. I guess one just has to come up with creative ways to work with the limitations. To a certain extent, I also appreciate the simplicity. A lot of authors seem not to be ready for even those small steps. I also like it a lot how active the small group in this thread is, though. I hope we see some great stories coming out of this.
New stories need approval of a moderator. Some note "Please don't publish" may prevent unintended publishing. Well... if "cond1" AND "cond2" should be possible, there would probably also the need for "cond1" AND ("cond2" OR "cond3" AND "cond4") OR ("cond5" AND "cond6") I think this would be problematic to implement with the current way of processing (kind of text replacement). (A real parser should be better for that issue.)
There are some great writers on this site, the problem, for me, is that no one ever completes a story. And now that we can make game-like stories, this will be even more of an issue. (Yes, I know, I am being a total hypocrite.)
I am still stuck in my old Basic language days. I would kill for those old, yet wonderfully simple command lines. (If X then Y, Goto X, Gosub X, etc.)
Let me give you a current example of a simple ifthen function that is puzzling me: I want a text to say "Monika is a jack of all trades" only if all her skills (Charisma, Combat, Gambling, Sex & Stealth) are below 60%. How would I create a branch that would do this? I wish I could write: {if Charisma < 60 AND Combat < 60 AND Gambling < 60 AND Sex < 60 and Stealth < 60} Monika is a jack of all trades. {endif} I tried the following, but it doesn't work: {if Charisma Skill < 60} {elseif Combat Skill < 60} {elseif Gambling Skill < 60} {elseif Sex Skill < 60} {elseif Stealth Skill < 60} {else} Monika is a jack of all trades. {endif} I have the feeling I am missing something obvious.
If you want the chapter to be only view-able if the player meets the requirements, you can simply set the conditions to view the chapter accordingly (simply enter all of the values). If you want to display it within a chapter itself, when the requirements are not certain to be met, you need to nest quite a lot of statements like this, not with "elseif", but with several "if" statements: Code: {if Charisma Skill < 60} {if Combat Skill < 60} {if Gambling Skill < 60} {if Sex Skill < 60} {if Stealth Skill < 60} Monika is a jack of all trades. {endif} {endif} {endif} {endif} {endif} The logic will check for the first IF, and only if that is met for the second IF, and so on. Basically this is your AND combination, only really ugly ;-) What your example does, is to check for the "Charisma Skill < 60". And if that condition is met, it will display some text (however there is none in your example), and not check for anything else. That way, the {elseif x} statements will not be processed and the statement will finish and go to the {endif} right away. In your example "Monika is a jack of all trades." will only be displayed, if none of the conditions are met, i.e. if all of her skills are at least 60
As an alternative, I think flipping around the inequalities should work. If you had: Code: {if Charisma Skill > 59} {elseif Combat Skill > 59} {elseif Gambling Skill > 59} {elseif Sex Skill > 59} {elseif Stealth Skill > 59} {else} Monika is a jack of all trades. {endif} then Chyoa will check to see if any of Monika's skills are greater-than-or-equal-to 60, and if not, will display "Monika is a jack of all trades." Which I think is the behaviour you want. This should be logically equivalent to dingsdongs's nested code. Edit: Oh, there is a slight logical difference between the two. In Game Mode they both behave identically. But outside of Game Mode, my version will display the {else} statement "Monika is a jack of all trades." whereas dingsdongs version has no {else} and so will display nothing. That might be important if you're worried about what non-game mode readers will see.