Writing multiple stories vs *if statements

I’m working on a game. I was considering making 3 different “stories”

  1. you and friend
  2. you, friend, stranger
  3. you, friend, stranger, and another stranger

In this case, I would write the first “story” (you and friend) and copy paste the key parts of the story that aren’t revolved around you and friend, copy paste that to the other stories, and then write stories 2 and 3 according to their situation.

*if statements can’t be used inline and if I wanted to add the option to save npc’s and have an additional group, i could write different scenes for each of them and I wouldn’t have to do something like
*if npc1_alive = true
and you’re with ${npc1_name}, too.

Not to mention having people in your group can drastically change the events.

I would try doing the easiest version of the story first. I often get lost in the variables and *if statements and the like when writing and it slows down my progress by A LOT. Try going for the simpler route first, even if it’s linear. Just do the bulk, the meaty chunk of it and see if you’re still willing to add in all the extra variables.

2 Likes

While it’s true that you cannot use *if statements inline the way you would have preferred to best suit the story you want to write, ChoiceScript is however flexible enough to offer other possibilities worth consideration. For example, you could create a template if / elseif / else complete with the required conditions, which you would just copy-paste where needed and then add the story narrative as required, e.g.

*if (conditions for you & friend)
    blah blah
*elseif (conditions for you, friend & stranger)
    blah blah
*elseif (conditions for you, friend & two strangers)
    blah blah
*else
    No specific conditions - useful in the event player is solo for a while, etc.

Where entire paragraphs of narrative are essentially the same in two or more cases, you could either copy-paste the actual text into each section or, to avoid duplication (i.e. be easier for later editing) you could simply place that narrative in a subroutine and use gosub / return to include it wherever you want to use it.

Personally, although you could write the three different “stories” entirely separately, if it were me I’d write them together at the same time, using some sort of if / elseif / else template throughout and making good use of gosub / return along the way to keep later editing much simpler.

Then again, one of the advantages of ChoiceScript is that there are often different ways to achieve the same end result, so just do whatever works best for you!

3 Likes

Good question @SoulsOfTheDamned : )

I found writing different stories then copy pasting key parts, while a good idea in theory, to be much more irritating in practice - mainly due to increased difficulty with revision and the tracking the code.

This isn’t to say you shouldn’t write a solid chunk of one path during a few hours of inspiration. Only that in my very limited experience, you’d be saving yourself aggravation later if you then divide what you’ve written into frequent, short *if arrays in the manner recommended by @Vendetta.

@EmperorHeartless’s advice on leaving the variables till later is good too, and all the easier to apply at a later date (both for game balancing and simply reminding you what’s going one) with nice short blocks of: [quote=“Vendetta, post:3, topic:20286”]
*if (conditions for you & friend)
blah blah
*elseif (conditions for you, friend & stranger)
blah blah
*elseif (conditions for you, friend & two strangers)
blah blah
*else
No specific conditions - useful in the event player is solo for a while, etc.
[/quote]

2 Likes

There is a reason the Choice of games guidelines have this under common problems and suggest against it.

Building the Party:
Problem: An ensemble cast, where the player can choose the members. This introduces an unmanageable level of complexity, because you have to write every scene in multiple ways to take into account the different number and assortment of characters that might be present. For instance, we struggled with this in Choice of the Rock Star. Are there three, four, five, six, or seven people in the band? Are the four people a guitar, bass, singer, and keyboard? Two guitars, keyboard, and horn? Two singers, bass, keyboard? Etc. etc. etc.

Solution: If at all possible, have a fixed number of people in each scene. Trust us!

If you really want to do this I’d suggest buying Zombie Exodus (if you haven’t already) and reading the code. Particularly the hugely complicated code near the end.

3 Likes

Thank you for your feedback, everyone. What I think I’m going to do is hold off on extra parties for now. I think it’s a bit complex especially for me, as this is my first game. Maybe in the future I will revisit it, and use the *if, *elseif, *else that @Vendetta suggested.

3 Likes