Prototype/Dev Thread: Choose-your-own-adventure in Twine

Today was a pretty big day.

  1. I figured out how to generate Fluffies on the fly; basically in situations where the Human meets Fluffies to potential abduct adopt, or Fluffies meet other Fluffies, I’d need to potentially generate characters, along with qualities like mane/skin colors, races, and four stats I’ve chosen (more on this later). I’ve made a macro called <<newFluffy>> which, when called, will roll a bunch of stats and store them in an array to reference later.

  2. I found out how to replace CSS names for things, so blue becomes dodgerblue; I wanted this for ease of use, because some colors are just easier to read on my background.

  3. This also has a double benefit because all my “rolls” pools. So for instance, the possible Fluffy skin colors, for now, are "white", "brown", "black", "tan", "grey", "pink", "cream", "gold", "chocolate", "beige"; each one of these can also be referenced as a CSS color, which will change colors of text appropriately.


    (This isn’t going to be a permanent thing; I just figured I’d do it in situations like this, where it’s a “first meeting.”) Also, in this text passage, “earthie” is also pulled from their “character sheet” dynamically. I’m likely going to have the ratio between Alicorn:others be 1:3:3:3 (Alicorn:Earthie:Pegasus:Unicorn). Maybe I can tweak to 1:5:2:2 or something.

  4. I’ve set up a similar macro system for gender; basically while writing, I use <<f0they>>, <<f0them>> and <<f0their>> in text (referencing “the Fluffy in slot 0” of the array) and it’ll automatically change their pronouns. For instance, if Fluffy0 is a girl, and Fluffy1 is a boy:

    <<f0they>> licked <<f1their>> mane clean. will automatically get changed to She licked his mane clean. This means that situations can be automatically interchangeable with a lot less if/then coding. Also, if I still want to do gender-specific scenarios, I can do something like

    <<if $fluffies[0].gender is "female">>
    Snippet for girl fluffies.
    <<else>>
    Snippet for boy fluffies.
    <</if>>
    

    to hide or show text based on Fluffy0’s gender.

  5. I set up a very simple choice in the Human Forest scenario: you can choose to wait to see if a Fluffy comes out, or you can spend $5 from your budget on a candy bar. If you do, three Fluffies will generate to choose from, rather than two. Again, I use my “dotted orange underline” from earlier to tooltip this.

  6. I majorly organized and renamed all my files.

  7. I finally figured out why my StoryInit passage wasn’t being passed to the rest of my story.

  8. I made a decision for my two “pairs” of starting stats: Obedience and Impulsiveness, and Caution and Ignorance. Both will have a total number of points that caps at 10, which can’t be exceeded: a Fluffy can have 7 Obedience and 3 Impulsiveness, but not 7 and 4 (because that exceeds 10). I figure this is an easy way to do bonuses, because a roll or check that would get a bonus from Impulsiveness would get a -4 in this case (3 Impulsiveness - 7 Obedience =-4 Result). I’m open to more here.

  9. Once a player chooses a Fluffy, all the “pooled” Fluffies will be discarded to keep code bloat down, and all the variables will be formally “set” to $playerFirstFluffy or something.

  10. Coding aside, I added a bit of story text to the Forest section of the Human branch as a test bed for this. Now that it’s figured out, I can use the same generation methods for Fluffmart, the Shelter, and the City.

1 Like