Quest first timer with a couple questions

Batwing
I know I am a rank newbie, but I have a couple of questions. Yes, I have looked through the tutorial but have not read it all yet.
I am editing in simple mode.
I have a room I call Fence. I don't want the game to display "You are in a Fence" when it starts. Maybe "..outside a fence" or something of that sort instead.
I also want to be able to give the same result if the player touches, climbs or tries to jump the fence. Can I do this without having to individually program every possible verb a player could type? Can you do multiple verbs or some sort of wildcard?
Thanks for any pointers.

Silver
In the game setup you can turn off room titles. You can also edit the prefix/suffix in the room setup. I'm guessing you might have to come out of simple mode to get these features (I haven't used simple mode myself). You can also set the room to a room and an object. I haven't used that feature either but I guess that's what you need to do here in order to be able to interact with the fence.

Silver
Afaics you have to set up each verb individually. I just tried setting up a verb and adding others by separating them with a semi colon (which apparently works for aliases in other circumstances) but it didn't appear to work here.

The Pixie
They are various ways you can do multiple phrases. What I would suggest is creating a command for this specific room (but you will have to venture out of simple mode to do it). Go to the Scripts tab for the rooms, commands are at the bottom. Click "Add".

In the first text box you put the text to recognise; separate different phrases with a vertical bar, perhaps like this:

climb fence|jump fence|climb|jump|touch fence

jaynabonne
For the first part, you could set the alias for the Fence room to "outside a fence".

OurJud
This could all be very confusing for you, with so many different answers, but I would go down the commands route too, only not in the same way The PIxie does. Bare in mind commands are ALWAYS my back-up when I can't do something the proper way (as in The Pixie's), but I would simply right click on 'fence' >> Add command >> and then in the first box at the top, put: climb fence; jump fence; climb; jump; touch; touch fence. After this run a script which has the player do what you want.

Batwing
Thanks for the help. It is beginning to make more sense.
One more thing - is there a wildcard character? So I could make a command that compensates for the player typing "climb the fence" or "climb over the fence"; etc.
Thanks again.

Silver
I think Quest might do that automatically. As in it'll look for a matching verb and noun in a sentence.

The Pixie
Batwing wrote:Thanks for the help. It is beginning to make more sense.
One more thing - is there a wildcard character? So I could make a command that compensates for the player typing "climb the fence" or "climb over the fence"; etc.
Thanks again.

There is, but it is not straightforward. See here:
http://docs.textadventures.co.uk/quest/ ... ching.html

You would need to set pattern to "Regular expression", then try something like this:

^((climb|jump|touch) .* fence|jump|climb)&


The vertical bar separates options, ^ and $ match the start and end respectively, .* matches any text. Try it and see what

Batwing
You have all been super helpful. I managed to get that issue resolved.

Allow me to bug you again.
In the GUI is there an easy way to set up the following:
Player enters a room. Lets say there are breakable items in the room.
The player has a 50/50 chance of accidentally breaking one.
I do not need to change the state of the item between whole and broken; it doesn't matter in this scenario.
I believe I can use an IF script to control the outcome depending on the result of the player either breaking an item or not.
I just don't know how to get the program to create that 50/50 chance when the player enters the room and give me something I can use for my IF script.

Thanks again.

HegemonKhan
useful links:

http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/functions/
http://docs.textadventures.co.uk/quest/ ... tions.html (in alphabetical order)

Randomization:

GetRandomInt (min_value, max_value) ~ ( http://docs.textadventures.co.uk/quest/ ... omint.html )
GetRandomDouble () ~ ( http://docs.textadventures.co.uk/quest/ ... ouble.html )
RandomChance (0 to 100) ~ ( http://docs.textadventures.co.uk/quest/ ... hance.html )
DiceRoll (string dicetype*) ~ ( http://docs.textadventures.co.uk/quest/ ... eroll.html )

*Format dicetype: [number of dice]d[number of sides]

-------------

in the GUI~Editor:

run as script -> add a~new script -> scripts -> 'if' Script -> [EXPRESSION] -> (see above and~or below, lol)

and also (for the 'RollDice' Function)

run as script -> add a~new script -> variables -> 'set a variable or attribute' script -> (see below)

terminology in quest:

VARIABLES:
-> Variables
-> Attributes

Local Usage:
Variable: variable_string_name = DiceRoll ("#d#")
example1: result = DiceRoll ("1d6") ~ normal 1 dice (6 sided) roll
example2: value = DiceRoll ("1d6")
example3: y = DiceRoll ("1d6")
example4: dice_roll_result = DiceRoll ("1d6")

Global Usage (so long as the Object exists, of course):
Attribute: Object_name.Attribute_name = DiceRoll ("#d#")
example1: game.dice_roll_result = DiceRoll ("1d6")
example2: player.dice_roll_result = DiceRoll ("1d6")
example3: HK.dice_roll_result = DiceRoll ("1d6")
example4: orc.dice_roll_result = DiceRoll ("1d6")

-------------

for a 50% chance:

in code:

//simplified~shortened syntax:
if (RandomChance (50) ) {
-> Object_name.Boolean_Attribute_name = true
} else {
-> Object_name.Boolean_Attribute_name = false
}

or

if (GetRandomInt (0,1) = 0) {
-> Object_name.Boolean_Attribute_name = true
} else if (GetRandomInt (0,1) = 1) {
-> Object_name.Boolean_Attribute_name = false
}

or

if (GetRandomInt (1,2) = 1) {
-> Object_name.Boolean_Attribute_name = true
} else if (GetRandomInt (1,2) = 2) {
-> Object_name.Boolean_Attribute_name = false
}

or

if (GetRandomInt (99,100) = 99) {
-> Object_name.Boolean_Attribute_name = true
} else if (GetRandomInt (99,100) = 100) {
-> Object_name.Boolean_Attribute_name = false
}

or

result = DiceRoll ("1d2")
if (result = 1) {
-> Object_name.Boolean_Attribute_name = true
} else if (result = 2) {
-> Object_name.Boolean_Attribute_name = false

jaynabonne
Nope. These do not work:

if (GetRandomInt (0,1) = 0) {
-> Object_name.Boolean_Attribute_name = true
} else if (GetRandomInt (0,1) = 1) {
-> Object_name.Boolean_Attribute_name = false
}

or

if (GetRandomInt (1,2) = 1) {
-> Object_name.Boolean_Attribute_name = true
} else if (GetRandomInt (1,2) = 2) {
-> Object_name.Boolean_Attribute_name = false
}

or

if (GetRandomInt (99,100) = 99) {
-> Object_name.Boolean_Attribute_name = true
} else if (GetRandomInt (99,100) = 100) {
-> Object_name.Boolean_Attribute_name = false
}


Here is where an insistence on not using simple "else" blocks has actually caused a bug. As GetRandomInt will not return the same value a second time (or will only randomly), you should get rid of all the "else ifs" and just make them "elses", so that the branching is keyed off the same value. Otherwise, you will likely end up in a state where it's not set to either true or false when the second call to GetRandomInt varies. (In the first block, what happens if the first call to GetRandomInt(0,1) returns 1 and the second returns 0?) In those code blocks, you have a 1/4 chance of the variable not being set to anything at all.

//simplified~shortened syntax:
if (RandomChance (50) ) {
-> Object_name.Boolean_Attribute_name = true
} else {
-> Object_name.Boolean_Attribute_name = false
}

This is one actually works. You should have stopped with "simple". :)
You can also just put:

Object_name.Boolean_Attribute_name = RandomChance (50)

and make it really simple.

(Edited: because I was confused about DiceRoll)

Batwing
Wow! That's a lot to process for someone is not a programmer. I will print all this out and go over it.
Thanks for all the help.

HegemonKhan
oops, thanks Jay for spotting those errors with the logic~math of not putting the 'GetRandomInt' outside~before~above the 'if' code line or in not using just the 'else' instead, as I wasn't thinking as I did those (mindlessly following the pattern of using the 'RandomChance' Function block, and also didn't realize that the 'RandomChance' returns 'true' or 'false', ... but, actually it doesn't matter:

if (RandomChance (50) ) {
-> Object_name.Boolean_Attribute_name = true
} else {
-> Object_name.Boolean_Attribute_name = false
}

vs (it's the same, attribute lines + if lines):

Object_name.Boolean_Attribute_name = RandomChance (50)
if (Object_name.Boolean_Attribute_name) {
-> script1
} else {
-> script2
}

--------------------

here's the corrected 'GetRandomInt' code blocks:

result = GetRandomInt (0,1)
if (result = 0) {
-> Object_name.Boolean_Attribute_name = true
} else if (result = 1) {
-> Object_name.Boolean_Attribute_name = false
}

or

result = GetRandomInt (1,2)
if (result = 1) {
-> Object_name.Boolean_Attribute_name = true
} else if (result = 2) {
-> Object_name.Boolean_Attribute_name = false
}

or

result = GetRandomInt (99,100)
if (result = 99) {
-> Object_name.Boolean_Attribute_name = true
} else if (result = 100) {
-> Object_name.Boolean_Attribute_name = false
}

or

if (GetRandomInt (0,1) = 0) {
-> script1
] else {
-> script2
}

or

if (GetRandomInt (1,2) = 1) {
-> script1
] else {
-> script2
}

or

if (GetRandomInt (0,1) = 1) {
-> script1
] else {
-> script2
}

or

if (GetRandomInt (1,2) = 2) {
-> script1
] else {
-> script2
}

or

if (GetRandomInt (99,100) = 99) {
-> script1
] else {
-> script2
}

or

if (GetRandomInt (99,100) = 100) {
-> script1
] else {
-> script2
}


------------------

@batwing:

just do this:

run as script -> add a~new script -> scripts -> 'if' script -> [EXPRESSIONS] -> (type in the below, here)

RandomChance (50)

so, it should look like this INSTRUCTIONALLY for how to do it in the GUI~Editor:

run as script -> add a~new script -> scripts -> 'if' script -> [EXPRESSIONS] -> RandomChance (50)
-> then, -> add a script -> (whatever script you want)
else
-> add a script -> (whatever script you want)

~~ haha, Jay beat me to it, laughs.

jaynabonne
Batwing wrote:Wow! That's a lot to process for someone is not a programmer. I will print all this out and go over it.
Thanks for all the help.


Well the simple answer is:

if (RandomChance (50) ) {
// do one thing
} else {
// do the other thing
}

Put that in your "on enter room" script and put the two choices into the "if" and the "else".

Silver
I'm commenting because this is another thread I need to archive, lest I forget.

jaynabonne
You can subscribe to or bookmark topics using the wrench tool at the bottom. :)

Batwing
Yah!! It works! Thanks a bunch.

Silver
jaynabonne wrote:You can subscribe to or bookmark topics using the wrench tool at the bottom. :)


duh! cheers! :D

Marzipan
The Pixie wrote:
There is, but it is not straightforward. See here:
http://docs.textadventures.co.uk/quest/ ... ching.html

You would need to set pattern to "Regular expression", then try something like this:

^((climb|jump|touch) .* fence|jump|climb)&


The vertical bar separates options, ^ and $ match the start and end respectively, .* matches any text. Try it and see what


How dare you hide something this insanely useful in this random thread I almost didn't even look in. :D

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

Support

Forums