Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Is it possible to make status effects in twine?

So like you end dialogue and get a question wrong, adding fear x1. After getting 4 fears status effect of hate or something.

PS. Is there a way to make screen changes like color or anything

Comments

  • Yes, use twine variables. Ssomething like
    <<set $fear=$fear+1>>
    
    Also you can use css to change almost everything. Go to edit story stylesheet and add something like
    body {
    background-color:green;
    }
    
  • @MakusuTM
    You need to state the name and full version number of the Story Format you are using, as answers can be different for each one.
  • edited July 2017
    My answer will work for Twine 2.1.3 and Sugarcube 2.18.0, but every other story format has ways of accomplishing the same thing, all of which you can probably find in the basic tutorials.

    This is a variable:
    $myVariable
    

    You can use variables to store values, like strings, numbers and booleans. Usually you'll want to set up you're variables in a passage called StoryInit like this:
    <<set $name = "Thomas">>
    <<set $hp = 20>>
    <<set $poisoned = false>>
    

    You can change the values of these variables later in the story using <<set>>, like @gellyfisher212 already pointed out. You can also combine this with a so called Setter Link:
    [["Give me your money, dweeb!"|extortion][$fear += 1]]
    

    This will create a link called "Give me your money, dweeb!", which sends the player to a passage called extortion, all the while adding 1 to $fear.

    If you work with a lot of variables, it might be good to organize them using objects:
    $npc_one = {
    name: "Thomas",
    fear: 0,
    status: "friendly"
    }
    

    To change the fear of our newly created NPC "Thomas", we would type something like this:
    <<set $npc_one.fear += 1>>
    

    To then check, whether this change of fear would create a change in Thomas' status, we would use an <<if>> statement:
    <<if $npc_one.fear > 3>>
            <<set $npc_one.status = "hate">>
    <</if>>
    

    You can also combine all of this with a link, using a structure such as this:
    <<link [["Give me your money, dweeb!"|extortion]]>>
            <<set $npc_one.fear += 1>>
            <<if $npc_one.fear > 3>>
                    <<set $npc_one.status = "hate">>
            <</if>>
    <</link>>
    
Sign In or Register to comment.