Howdy, Stranger!

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

complex ruleset problems in harlowe

I'm trying a game with a lot of rules, and I have a problem: There is an adult character, there is a child character, and the child is supposed to go along with the adult, as long as the child is not too scared and the adult is grabbing her hand.

For some reason, when I go to get her in the starter room, grab her hand, then exit, she shows up only if I remain in the new room for a turn (if I reload). She should show up the first time the page is loaded. What should I do?

Comments

  • Can you post the code for the first room?

    My suspicion is that it has something to do with the fact that changes to variables only seem to affect text if they are set *before* the text is rendered. So in a passage like this

    (if: $dude is true)["Dude!"]

    (set: $dude to true)


    The "Dude!" will not show first time because the variable is not set until after the (if:). But if you come back to that room, the variable will have been set and it will show.



  • (if: $childplace is $selfplace)[Your daughter is with you. (if: $takechild is "yes")[(link: "Release")[(set: $takechild to "no")(goto: "child bedroom")]](else:)[(link: "Grab")[(set: $takechild to "yes")(goto: "child bedroom")]] her hand.](elseif: $childplace is not $selfplace and $takechild is "yes")[Your daughter is trying to keep up with you. She is a little slower, though.](elseif: $childplace is not $selfplace and $takechild is "no")[Your daughter is alone by herself. She must be scared.]
    
  • There is no setting of $childplace or $selfplace in there? Any changes to those variables that come after this block of conditions in the scene won't affect these conditions until the next time they're loaded.
  • Yes, they are set in the first passage, and they change in certain passages along the way, depending on what the player does (and some luck).

    I somewhat fixed it by hinting that the child is slower than the adult, but I would like to really solve this issue.
  • Ok, so the first time you enter the room it is acting as if the conditions for the first "elseif:" are fulfilled? e.g. $childplace is not $selfplace and $takechild is "yes"
  • I have it so if takechild is yes, the child keeps up with the adult. To make the child stop following, the player has to stop holding her hand, or the child/ main character must panic.
  • edited June 2015
    Without knowing the actual different combinations of $selfplace, $childplace and $takechild that are set before your example code gets executed it is hard to determine why it is failing in some instances.

    One thing to look out for is that the two (elseif:)'s are assuming that $takechild can only have two states ("yes" & "no"), if for some reason $takechild has some other value (like unassigned) then both of the (elseif:)'s will fail.

    I would suggest that you replace the two (elseif:)'s and structure the second half of the code like you did the (if:) part, that would make it easier to read and cover the case of $takechild having some other state.
    (if: $childplace is $selfplace)[Your daughter is with you. (if: $takechild is "yes")[(link: "Release")[(set: $takechild to "no")(goto: "child bedroom")]](else:)[(link: "Grab")[(set: $takechild to "yes")(goto: "child bedroom")]] her hand.](else:)[(if: $takechild is "yes")[Your daughter is trying to keep up with you. She is a little slower, though.](else:)[Your daughter is alone by herself. She must be scared.]]
    
    .. reformatted for readability
    (if: $childplace is $selfplace)[
    	Your daughter is with you.
    	(if: $takechild is "yes")[
    		(link: "Release")[
    			(set: $takechild to "no")
    			(goto: "child bedroom")
    		]
    	]
    	(else:)[
    		(link: "Grab")[
    			(set: $takechild to "yes")
    			(goto: "child bedroom")
    		]
    	]
    	her hand.
    ]
    (else:)[
    	(if: $takechild is "yes")[Your daughter is trying to keep up with you. She is a little slower, though.]
    	(else:)[Your daughter is alone by herself. She must be scared.]
    ]
    
  • Oh. I'm sorry.

    Each room is done in a different passage. To move around the "house", the players is really just visitting the passages. There are variables used to keep track of where the character is, where the child is, and where the chaser is.

    The player variable is changed depending on which passage is being used. The room where the child is depends on many things: It changes along with the adult room if the child is being guided, or stays the same if the child is left alone. It can randomly change if the child gets panicked and "flees" to another "room".
Sign In or Register to comment.