Changes

Jump to navigation Jump to search
2,517 bytes added ,  08:09, 20 March 2018
Added $q/$r/$p example
Line 149: Line 149:  
| Gives the player a random item, from the pool of item IDs within the brackets.
 
| Gives the player a random item, from the pool of item IDs within the brackets.
 
|}
 
|}
 +
 +
====Question example====
 +
To understand how $q, $r, and $p work, an example may be helpful.  Consider this excerpt from Haley's dialogue file.
 +
 +
<source lang="yaml">
 +
    summer_Sat: "Farming sounds so boring...#$q 42/43 summer_Sat_old#What do you even do all day?#$r 42 10 summer_Sat_12#Care for plants#$r 42 10 summer_Sat_12#Explore the caves#$r 43 -10 summer_Sat_13#Snoop around in your room#$r 42 10 summer_Sat_12#Dig for treasure" #!String
 +
    summer_Sat_old: "#$p 43#Hey, you better not be snooping around in my room anymore!$a|But I guess it could get you in pretty good shape." #!String
 +
    summer_Sat_12: "Hmm... sounds like a lot of work." #!String
 +
    summer_Sat_13: "What? You'd better not be doing that!$a" #!String
 +
</source>
 +
 +
The first time the <code>summer_Sat</code> dialogue is chosen, neither response 42 nor 43 will have been given (because this question is the only one which has them as responses), so Haley will say, "Farming sounds so boring... What do you even do all day?"  The player can select among these responses:
 +
 +
* Care for plants
 +
* Explore the caves
 +
* Snoop around in your room
 +
* Dig for treasure
 +
 +
The third response, <code>$r 43 -10 summer_Sat_13#Snoop around in your room</code>, sets response ID 43, reduces Haley's friendship by 10 points, and brings up the dialogue <code>summer_Sat_13</code> (Haley says, "What? You'd better not be doing that!").  All of the other responses set response ID 42, increase Haley's friendship by 10 points, and bring up the dialogue <code>summer_Sat_12</code> ("Hmm... sounds like a lot of work.").
 +
 +
The next time <code>summer_Sat</code> is chosen, one of the response IDs listed in the <code>$q</code> command will have been given (either 42 or 43).  Therefore, the <code>$q</code> and everything after is scrapped, and dialogue <code>summer_Sat_old</code> is put in its place.  This new dialogue uses the <code>$p</code> command to change Haley's dialogue based on whether or not you gave response ID 43 to any previous question.  If you answered "Snoop around your room," everything before the <code>|</code> will be used, so Haley will now say, "Farming sounds so boring... Hey, you better not be snooping around in my room anymore!"  If response ID 43 has not been given (in this case, you must have given response ID 42, i.e. one of the other three responses to the previous question), everything after the <code>|</code> will be used, so Haley will instead say, "Farming sounds so boring... But I guess it could get you in pretty good shape."
    
===Replacer commands===
 
===Replacer commands===

Navigation menu