Question about Attributes

blueorc
Hello! This is my first post here, and I need some help. If this is has been asked before, I apologize.

I have been reading the Squiffy documentation, and I'm not sure how to do this:

1) I want to increase an attribute and have the 'player' automatically go to a new section when this attribute reaches a certain number. I feel like this is crucial for IF / Gamebooks, but I'm not sure exactly how to do it. I'm doing a training system for my mother, and she needs to start by asking questions (to customers). Her job only allows for three questions, and while the honor system is nice, it would hamper the entire process. I need for the system to re-route her to the next appropriate [[Section]].

2) I want to have choices that have already been clicked to be eliminated. IE if [[How are you doing?]] and [[How is the Weather?]] are choices under [[Ask Questions]]:, I want to have [[How are you doing?]] and [[How is the Weather?]] go back to the "[[Ask Questions]]" list, but only show the un-clicked/explored sections/choices.

I've played "Fighting Fantasy" and I know that seeing a choice to talk to someone who has died often breaks immersion, and I feel like there is a simple answer to my questions. I'm sorry if I posted in the wrong section or this has been asked!

bgbg
See the "Reading Attributes" section of "attributes" documentation here: http://docs.textadventures.co.uk/squiff ... butes.html

The example is

You can conditionally display text depending on the value of an attribute using "if" inside curly brackets. You can also use "else":

{if gender=male:You are a man.}{else:You are a woman.}



And also see "Tracking which sections and passages have been seen" here: http://docs.textadventures.co.uk/squiffy/seen.html

Example:

You can also conditionally display text:

You can see a [cupboard]. Maybe you should [open] it?
[open]:
You open the cupboard.
[cupboard]:
The cupboard is {if seen open:open, and there are empty bottles
inside}{else:closed}.




So you could do something like this:

@set questions_asked=0

[[Begin.]](AskQuestions)

[[AskQuestions]]:
{if not seen Doing:[[How are you doing?]](Doing)}

{if not seen Weather:[[How is the weather?]](Weather)}

[[Doing]]:
@inc questions_asked

{if questions_asked=2: [[Finish.]](YouWin)}{else: [[Ask another question.]](AskQuestions)}

[[Weather]]:
@inc questions_asked

{if questions_asked=2: [[Finish.]](YouWin)}{else: [[Ask another question.]](AskQuestions)}

[[YouWin]]:
You successfully asked two questions.


I'm not sure if that's exactly what you are looking for, but I hope it helps.

blueorc
Thank you! I am going to study this a little later. It's not 'natural' to my brain yet. If I run into any issues I'll reply :)

HegemonKhan
while the syntax is different than how its done with squiffy, you can look at the text adventure forums, to understand better how Attributes/Scripts/coding works/looks, it seems more scary than it actually is, which can help you better, at least understand the idea of it, and only would have to study how squiffy does its code stuff.

I'd even say that the code stuff is the easier part, the harder part is indeed training your brain to think in terms of 'code/if' logic, regardless of whether you use code or not, as this 'if' mindset is required for game making. It's not natural, and it takes time to train your brain to think in this 'if/code logic' way.

an example of 'if/code logic' mentality that hopefully will make sense for you:

(this is the Text Adventure code's syntax)

<object name="animal_1">
<attr name="type" type="string">lion</attr>
</object>

<object name="animal_2">
<attr name="type" type="string">zebra</attr>
</object>

// some Script/Verb/Function:

if (this.type = "lion") {
msg ("Oh... %@$@#.... I can't outrun it and I don't have any weapon/protection.... $#@$@#!")
msg ("The hungry lion easily chases you down, tears you to shreds, and gobbles you up.")
msg ("GAME OVER")
finish
} else if (this.type = "zebra") {
msg ("You admire the beautifully white and black striped zebra.")
}


// --------------------------------------------

<object name="player">
<attr name="cash" type="int">100</attr>
</object>

<object name="shop_owner">
</object>

<object name="sword">
<attr name="parent" type="object">shop_owner</attr>
<attr name="price" type="int">50</attr>
</object>

// some Script/Verb/Function:

if (player.cash >= sword.price) {
player.cash = player.cash - sword.price
sword.parent = player
msg ("You bought the sword.")
} else {
msg ("You don't have enough cash to buy the sword.")
}

This topic is now closed. Topics are closed after 180 days of inactivity.

Support

Forums