Group description
katronix
13 Jul 2015, 08:37Hi all,
New to Quest system, and trying to figure out how to do something but first some background info:
In one of my rooms there will be 3 mathematical problems telling you which 3 of the 50 keys you require.
Later on you will find a door with 3 locks labeled x, y and Z.
I'd prefer not to have to add 50 different keys that all say the same thing for description: "This is a key with the number x on it."
Is there an easy way to do this?
Thanks in advance,
Kat
New to Quest system, and trying to figure out how to do something but first some background info:
In one of my rooms there will be 3 mathematical problems telling you which 3 of the 50 keys you require.
Later on you will find a door with 3 locks labeled x, y and Z.
I'd prefer not to have to add 50 different keys that all say the same thing for description: "This is a key with the number x on it."
Is there an easy way to do this?
Thanks in advance,
Kat

XanMag
13 Jul 2015, 12:06Can you just copy-paste the first key you make 50x? Is that what you mean?
katronix
13 Jul 2015, 15:56Would that be the most efficient way of doing it?

XanMag
13 Jul 2015, 16:18I copied about 40 rooms in the maze part of the game and it worked out well. Took me all of 10 minutes from start to finish.
Make one just the way you want it. DON'T FORGET ANYTHING!! It sucks to paste all those items and realize you forgot something! =)
Click the first key you made. Click the copy button (4th button from the left at the top).
Go to wherever you want the keys located (I'd suggest an inaccessible room first (you can move them around later)) and click paste (5th button from the left at the top), paste, paste, paste, paste, paste, paste, paste, paste, paste... until you get to desired number of keys.
Go through and change the one letter that appears on each key from a to b to c to d, etc...
Then drag each key to whatever room(s) you want those keys to be found in. That's what I would do anyway. Or put them all in a room called 'key room' (inaccessible of course) and move whichever key you want to move to a certain spot after an event occurs - entering a room for the first time, solving a puzzle, talking to an NPC, open a chest, etc. Just depends on how accessible you want the keys to be.
Good luck!
Make one just the way you want it. DON'T FORGET ANYTHING!! It sucks to paste all those items and realize you forgot something! =)
Click the first key you made. Click the copy button (4th button from the left at the top).
Go to wherever you want the keys located (I'd suggest an inaccessible room first (you can move them around later)) and click paste (5th button from the left at the top), paste, paste, paste, paste, paste, paste, paste, paste, paste... until you get to desired number of keys.
Go through and change the one letter that appears on each key from a to b to c to d, etc...
Then drag each key to whatever room(s) you want those keys to be found in. That's what I would do anyway. Or put them all in a room called 'key room' (inaccessible of course) and move whichever key you want to move to a certain spot after an event occurs - entering a room for the first time, solving a puzzle, talking to an NPC, open a chest, etc. Just depends on how accessible you want the keys to be.
Good luck!
katronix
13 Jul 2015, 16:43Actually perhaps this will clarify it, I want the keys to be easily accessible. In another room there will be 3 math problems, and in yet another room a door with 3 locks labeled X, Y, and Z. You will need the right key for the right lock to open the door.
Each key would have its own value (from 1 to 50) would you still do it this way?
Each key would have its own value (from 1 to 50) would you still do it this way?

XanMag
13 Jul 2015, 17:53Do the keys appear as a result of solving the math problem? Or are the keys part of solving the math problem (thus the value)?
Are the keys used as part of solving a math problem... like math problem 1: x + 37 = 51 and key 14 has to be added (used in some way) to the problem to solve it for Lock X. ... and 108 - y = 68 and key 40 has to be added to solve for Lock Y?
If you are just using the keys (with their values) in some way, the short answer is yes, I would still do it that way.
I guess I don't fully understand the puzzle. Feel free to PM me with more details if you don't want to post a spoiler here and I'll help. Or post here and I (or someone more knowledgeable to solving your goal) will help. Good Luck!
EDIT: After re-reading your first post... I think I get it. I think you will have a room with fifty possible keys laying out for the taking. The answer to the math problem will tell the player which three keys are needed to open the three locks on the door. If this is the case, I would absolutely do it that way. I'd create a machine that deposits keys on request or have a board hanging on the wall with your fifty keys and keep them all in one place. Easy-peasy for what you want. Of course, when the wrong key is taken and tried to use on the lock, you'll either want to return that key magically to where it came from or remove it entirely from the game.
I'm taking a break from my Xanadu - part 2 and I might throw a bit of code together for you to check out.
Are the keys used as part of solving a math problem... like math problem 1: x + 37 = 51 and key 14 has to be added (used in some way) to the problem to solve it for Lock X. ... and 108 - y = 68 and key 40 has to be added to solve for Lock Y?
If you are just using the keys (with their values) in some way, the short answer is yes, I would still do it that way.
I guess I don't fully understand the puzzle. Feel free to PM me with more details if you don't want to post a spoiler here and I'll help. Or post here and I (or someone more knowledgeable to solving your goal) will help. Good Luck!
EDIT: After re-reading your first post... I think I get it. I think you will have a room with fifty possible keys laying out for the taking. The answer to the math problem will tell the player which three keys are needed to open the three locks on the door. If this is the case, I would absolutely do it that way. I'd create a machine that deposits keys on request or have a board hanging on the wall with your fifty keys and keep them all in one place. Easy-peasy for what you want. Of course, when the wrong key is taken and tried to use on the lock, you'll either want to return that key magically to where it came from or remove it entirely from the game.
I'm taking a break from my Xanadu - part 2 and I might throw a bit of code together for you to check out.
katronix
13 Jul 2015, 18:01The keys will be numbered 1 to 50 (for the 50 rooms in a hotel). The math problems would be something like:
x+5 = 9
x+y = 25
3z=x+y
Once you have the 3 keys representing the values of x, y and z you could then open the door which will require the 3 keys to do so.
x+5 = 9
x+y = 25
3z=x+y
Once you have the 3 keys representing the values of x, y and z you could then open the door which will require the 3 keys to do so.

XanMag
13 Jul 2015, 18:22Got it. Going to work on a short script now.
HegemonKhan
13 Jul 2015, 19:23There's more fancy ways to do it via scripting, but here's probably the simpliest way for what you want (well least character size that is hopefully 'simple' enough for you to do it ~ depends on how good~bad this post is of mine as a guide for you, lol):
Quest's 'Groups~Classes' are known as 'Object Types'
http://docs.textadventures.co.uk/quest/ ... /type.html (Object Types)
http://docs.textadventures.co.uk/quest/types.html (Object Types)
http://docs.textadventures.co.uk/quest/ ... types.html (using Object Types and their 'Inherited' Attributes Tutorial Guide)
left side's 'tree of stuff', click on the '+' for 'Advanced' to show its subcategories, click on 'Object Types', and click on 'Add', (see below)
Object Type Name: key_object_type (for this post~example only, as the name can be whatever you want)
'key_object_type' Object Type -> Attributes -> Add -> (see below)
Attribute Name: look
Attribute Type (there's a little drop down box below, it's currently selected as a 'string', but change it to a script): script
Attribute Value: (your scripting: 'add new script~s' circle button, your script~s, see below)
add new script -> output -> 'print a message' Script -> [message ~ this is for text only] or [expression ~ this is for text + VARIABLES] -> (write your message ~ if you need help with what you want to do for your message, well if you want to do a dynamic~VARIABLE message, let me know and I can help you with it, as you'll need to use 'this' for your VARIABLE's Object's name, and will likely need help with using VARIABLES)
etc script~s
-------------------
then on (each~every~all of) your 'key' Objects, for an example:
'key_1' Object -> 'Attributes' Tab -> Inherited Types -> Add -> (either scroll down looking for your 'key_object_type' Object Type, or just re-type in the name of your Object Type, in this example: key_object_type, instead of trying to find it, lol)
-------------------------------
Object Types can hold Attributes (just like an Object can hold Attributes) and also other Object Types (but we'll ignore this, so not to confuse you).
so, conceptually this is what you're doing:
you create an Object Type, which you give it the 'look' Script Attribute (which is your non-room Object description), and you likely will want to set it up to be a generalized message (as its going to be used by all of your 50 'key' Objects).
then you give each~every~all of your 50 'key' Objects, this Object Type (via as a 'Inherited' Attribute)
now... using an Object Type, for just a single Attribute is a waste, but you can have the Object Type hold more Attributes, and then it's not a waste!
-----
here's the usefulness (efficiency: less character~symbol length, less typing, less file size) of Object Types, as seen via directly in code:
vs *NOT* using Object Types (yuck! much more work~typing, more character~symbols, more file size):
Quest's 'Groups~Classes' are known as 'Object Types'
http://docs.textadventures.co.uk/quest/ ... /type.html (Object Types)
http://docs.textadventures.co.uk/quest/types.html (Object Types)
http://docs.textadventures.co.uk/quest/ ... types.html (using Object Types and their 'Inherited' Attributes Tutorial Guide)
left side's 'tree of stuff', click on the '+' for 'Advanced' to show its subcategories, click on 'Object Types', and click on 'Add', (see below)
Object Type Name: key_object_type (for this post~example only, as the name can be whatever you want)
'key_object_type' Object Type -> Attributes -> Add -> (see below)
Attribute Name: look
Attribute Type (there's a little drop down box below, it's currently selected as a 'string', but change it to a script): script
Attribute Value: (your scripting: 'add new script~s' circle button, your script~s, see below)
add new script -> output -> 'print a message' Script -> [message ~ this is for text only] or [expression ~ this is for text + VARIABLES] -> (write your message ~ if you need help with what you want to do for your message, well if you want to do a dynamic~VARIABLE message, let me know and I can help you with it, as you'll need to use 'this' for your VARIABLE's Object's name, and will likely need help with using VARIABLES)
etc script~s
-------------------
then on (each~every~all of) your 'key' Objects, for an example:
'key_1' Object -> 'Attributes' Tab -> Inherited Types -> Add -> (either scroll down looking for your 'key_object_type' Object Type, or just re-type in the name of your Object Type, in this example: key_object_type, instead of trying to find it, lol)
-------------------------------
Object Types can hold Attributes (just like an Object can hold Attributes) and also other Object Types (but we'll ignore this, so not to confuse you).
so, conceptually this is what you're doing:
you create an Object Type, which you give it the 'look' Script Attribute (which is your non-room Object description), and you likely will want to set it up to be a generalized message (as its going to be used by all of your 50 'key' Objects).
then you give each~every~all of your 50 'key' Objects, this Object Type (via as a 'Inherited' Attribute)
now... using an Object Type, for just a single Attribute is a waste, but you can have the Object Type hold more Attributes, and then it's not a waste!
-----
here's the usefulness (efficiency: less character~symbol length, less typing, less file size) of Object Types, as seen via directly in code:
<object name="dragon_1">
<inherit name="fire_dragon_object_type" />
</object>
<object name="dragon_2">
<inherit name="fire_dragon_object_type" />
</object>
<object name="dragon_3">
<inherit name="fire_dragon_object_type" />
</object>
<object name="dragon_4">
<inherit name="water_dragon_object_type" />
</object>
<object name="dragon_5">
<inherit name="water_dragon_object_type" />
</object>
<object name="dragon_6">
<inherit name="water_dragon_object_type" />
</object>
<type name="fire_dragon_object_type">
<alias>fire dragon</alias>
<attr name="elemental_string_attribute" type="string">fire</attr>
<attr name="strength_integer_attribute" type="int">75</attr>
<attr name="endurance_integer_attribute" type="int">75</attr>
<attr name="dexterity_integer_attribute" type="int">75</attr>
<attr name="agility_integer_attribute" type="int">75</attr>
<attr name="speed_integer_attribute" type="int">75</attr>
<attr name="luck_integer_attribute" type="int">75</attr>
<attr name="intelligence_integer_attribute" type="int">75</attr>
<attr name="spirituality_integer_attribute" type="int">75</attr>
<attr name="mentality_integer_attribute" type="int">75</attr>
<attr name="perception_integer_attribute" type="int">75</attr>
<look type="script">
msg ("The {this.alias} is vulnerable to water damage, but absorbs fire damage.")
</look>
</type>
<type name="water_dragon_object_type">
<alias>water dragon</alias>
<attr name="elemental_string_attribute" type="string">water</attr>
<attr name="strength_integer_attribute" type="int">50</attr>
<attr name="endurance_integer_attribute" type="int">50</attr>
<attr name="dexterity_integer_attribute" type="int">50</attr>
<attr name="agility_integer_attribute" type="int">50</attr>
<attr name="speed_integer_attribute" type="int">50</attr>
<attr name="luck_integer_attribute" type="int">50</attr>
<attr name="intelligence_integer_attribute" type="int">50</attr>
<attr name="spirituality_integer_attribute" type="int">50</attr>
<attr name="mentality_integer_attribute" type="int">50</attr>
<attr name="perception_integer_attribute" type="int">50</attr>
<look type="script">
msg ("The {this.alias} is vulnerable to fire damage, but absorbs water damage.")
</look>
</type>
vs *NOT* using Object Types (yuck! much more work~typing, more character~symbols, more file size):
<object name="dragon_1">
<alias>fire dragon</alias>
<attr name="elemental_string_attribute" type="string">fire</attr>
<attr name="strength_integer_attribute" type="int">75</attr>
<attr name="endurance_integer_attribute" type="int">75</attr>
<attr name="dexterity_integer_attribute" type="int">75</attr>
<attr name="agility_integer_attribute" type="int">75</attr>
<attr name="speed_integer_attribute" type="int">75</attr>
<attr name="luck_integer_attribute" type="int">75</attr>
<attr name="intelligence_integer_attribute" type="int">75</attr>
<attr name="spirituality_integer_attribute" type="int">75</attr>
<attr name="mentality_integer_attribute" type="int">75</attr>
<attr name="perception_integer_attribute" type="int">75</attr>
<look type="script">
msg ("The fire dragon is vulnerable to water damage, but absorbs fire damage.")
</look>
</object>
<object name="dragon_2">
<alias>fire dragon</alias>
<attr name="elemental_string_attribute" type="string">fire</attr>
<attr name="strength_integer_attribute" type="int">75</attr>
<attr name="endurance_integer_attribute" type="int">75</attr>
<attr name="dexterity_integer_attribute" type="int">75</attr>
<attr name="agility_integer_attribute" type="int">75</attr>
<attr name="speed_integer_attribute" type="int">75</attr>
<attr name="luck_integer_attribute" type="int">75</attr>
<attr name="intelligence_integer_attribute" type="int">75</attr>
<attr name="spirituality_integer_attribute" type="int">75</attr>
<attr name="mentality_integer_attribute" type="int">75</attr>
<attr name="perception_integer_attribute" type="int">75</attr>
<look type="script">
msg ("The fire dragon is vulnerable to water damage, but absorbs fire damage.")
</look>
</object>
<object name="dragon_3">
<alias>fire dragon</alias>
<attr name="elemental_string_attribute" type="string">fire</attr>
<attr name="strength_integer_attribute" type="int">75</attr>
<attr name="endurance_integer_attribute" type="int">75</attr>
<attr name="dexterity_integer_attribute" type="int">75</attr>
<attr name="agility_integer_attribute" type="int">75</attr>
<attr name="speed_integer_attribute" type="int">75</attr>
<attr name="luck_integer_attribute" type="int">75</attr>
<attr name="intelligence_integer_attribute" type="int">75</attr>
<attr name="spirituality_integer_attribute" type="int">75</attr>
<attr name="mentality_integer_attribute" type="int">75</attr>
<attr name="perception_integer_attribute" type="int">75</attr>
<look type="script">
msg ("The fire dragon is vulnerable to water damage, but absorbs fire damage.")
</look>
</object>
<object name="dragon_4">
<alias>water dragon</alias>
<attr name="elemental_string_attribute" type="string">water</attr>
<attr name="strength_integer_attribute" type="int">50</attr>
<attr name="endurance_integer_attribute" type="int">50</attr>
<attr name="dexterity_integer_attribute" type="int">50</attr>
<attr name="agility_integer_attribute" type="int">50</attr>
<attr name="speed_integer_attribute" type="int">50</attr>
<attr name="luck_integer_attribute" type="int">50</attr>
<attr name="intelligence_integer_attribute" type="int">50</attr>
<attr name="spirituality_integer_attribute" type="int">50</attr>
<attr name="mentality_integer_attribute" type="int">50</attr>
<attr name="perception_integer_attribute" type="int">50</attr>
<look type="script">
msg ("The water dragon is vulnerable to fire damage, but absorbs water damage.")
</look>
</object>
<object name="dragon_5">
<alias>water dragon</alias>
<attr name="elemental_string_attribute" type="string">water</attr>
<attr name="strength_integer_attribute" type="int">50</attr>
<attr name="endurance_integer_attribute" type="int">50</attr>
<attr name="dexterity_integer_attribute" type="int">50</attr>
<attr name="agility_integer_attribute" type="int">50</attr>
<attr name="speed_integer_attribute" type="int">50</attr>
<attr name="luck_integer_attribute" type="int">50</attr>
<attr name="intelligence_integer_attribute" type="int">50</attr>
<attr name="spirituality_integer_attribute" type="int">50</attr>
<attr name="mentality_integer_attribute" type="int">50</attr>
<attr name="perception_integer_attribute" type="int">50</attr>
<look type="script">
msg ("The water dragon is vulnerable to fire damage, but absorbs water damage.")
</look>
</object>
<object name="dragon_6">
<alias>water dragon</alias>
<attr name="elemental_string_attribute" type="string">water</attr>
<attr name="strength_integer_attribute" type="int">50</attr>
<attr name="endurance_integer_attribute" type="int">50</attr>
<attr name="dexterity_integer_attribute" type="int">50</attr>
<attr name="agility_integer_attribute" type="int">50</attr>
<attr name="speed_integer_attribute" type="int">50</attr>
<attr name="luck_integer_attribute" type="int">50</attr>
<attr name="intelligence_integer_attribute" type="int">50</attr>
<attr name="spirituality_integer_attribute" type="int">50</attr>
<attr name="mentality_integer_attribute" type="int">50</attr>
<attr name="perception_integer_attribute" type="int">50</attr>
<look type="script">
msg ("The water dragon is vulnerable to fire damage, but absorbs water damage.")
</look>
</object>

XanMag
13 Jul 2015, 19:53Two things I'm trying to work on here... and I am probably making this more complicated than it should be.
1. I assume katronix does NOT want the option of being able to take ALL of the keys and carry all fifty keys around to be tested on the three locks on the door. So... how can you limit the player to only carrying 3 object types at a time. I was trying to create a container that the keys had to be carried in when picking them up. So, I ran a script to move them immediately to the box (which was a limited container of 3 objects), but the 'add object to' script overrides the full container message I had set up. I assume once this problem is solved I could just apply the limited object types to the player and eliminate the box all together. I think you have to run an 'If/Then' to code for it... something like 'if' keycount is greater than 2, 'then' 'print msg' "You are already carrying the maximum number of keys allowed." and an 'else' to add key to inventory. But, I could not figure out the correct code for that.
2. Also, and this should be easy... how do you refer to an object's name in the description with an expression? I was trying to run an expression in the look at box that was something like this: "It is a magic key with " + object.name + "emblazoned on its surface."
Thanks. And sorry katronix... I got in over my head here, but at least I'll hopefully learn something!! =)
1. I assume katronix does NOT want the option of being able to take ALL of the keys and carry all fifty keys around to be tested on the three locks on the door. So... how can you limit the player to only carrying 3 object types at a time. I was trying to create a container that the keys had to be carried in when picking them up. So, I ran a script to move them immediately to the box (which was a limited container of 3 objects), but the 'add object to' script overrides the full container message I had set up. I assume once this problem is solved I could just apply the limited object types to the player and eliminate the box all together. I think you have to run an 'If/Then' to code for it... something like 'if' keycount is greater than 2, 'then' 'print msg' "You are already carrying the maximum number of keys allowed." and an 'else' to add key to inventory. But, I could not figure out the correct code for that.
2. Also, and this should be easy... how do you refer to an object's name in the description with an expression? I was trying to run an expression in the look at box that was something like this: "It is a magic key with " + object.name + "emblazoned on its surface."
Thanks. And sorry katronix... I got in over my head here, but at least I'll hopefully learn something!! =)
HegemonKhan
13 Jul 2015, 20:26@ XanMag,
(when you got the time, lol)
actually, making Objects to put Objects into, (hint) using the Object's Attributes (the hard part), and (hint) the scripting for it (the hard part), is a good challenge for you (which I think you're capable of doing), example of what I mean below:
inventory organization (reducing Objects cluttering up the inventory pane during game play):
and some hints for the Attributes and Scripting:
(when you got the time, lol)
actually, making Objects to put Objects into, (hint) using the Object's Attributes (the hard part), and (hint) the scripting for it (the hard part), is a good challenge for you (which I think you're capable of doing), example of what I mean below:
inventory organization (reducing Objects cluttering up the inventory pane during game play):
'player' Player Object
'storage_object' Object
'items_storage_object' Object
'keys_storage_object' Object
'dungeon_keys_storage_object' Object
'castle_keys_storage_object' Object
'equipment_storage_object' Object
'weapon_storage_object' Object
'sword_storage_object' Object
'claymore_object' Object
'katana_object' Object
'armor_storage_object' Object
'chest_storage_object' Object
'steel_full_plate_mail_object' Object
'iron_full_plate_mail_object' Object
'magic_storage_object' Object
'fire_spells_storage_object' Object
'fireball_object' Object
'water_spells_storage_object' Object
'tsunami_object' Object
and some hints for the Attributes and Scripting:
<object name="key_1">
<alias>key</alias>
<drop />
<take />
<attr name="xxx" type="string">xxx</attr>
<xxx type="script>
if (HasAttribute (this, "xxx") {
if (this.xxx = "xxx") {
this.parent = xxx
} else if (this.xxx = "xxx") {
this.parent = xxx
}
// etc 'else if' Scripts
}
</xxx>
</object>
<object name="katana_1">
<alias>katana</alias>
<drop />
<take />
<attr name="xxx" type="string">xxx</attr>
<xxx type="script>
if (HasAttribute (this, "xxx") {
if (this.xxx = "xxx") {
this.parent = xxx
} else if (this.xxx = "xxx") {
this.parent = xxx
}
// etc 'else if' Scripts
}
</xxx>
</object>
<object name="fire_spell_1">
<alias>fireball</alias>
<drop />
<take />
<attr name="xxx" type="string">xxx</attr>
<xxx type="script>
if (HasAttribute (this, "xxx") {
if (this.xxx = "xxx") {
this.parent = xxx
} else if (this.xxx = "xxx") {
this.parent = xxx
}
// etc 'else if' Scripts
}
</xxx>
</object>
magano
18 Jul 2015, 14:48I think you can fuse all of the keys into one, but the keys must be in the same room
If I seemed to misunderstood your purpose, sorry to waste your time in advance
1. In the room where you wanted to put the keys in, put a suitable description of the keys ("Around 50 keys are hanging on the walls, gleaming in silver")
2. Create one instance of the key and name it in plural
3. Prepare the following: A flag to indicate whether the key was taken, a variable to store the key number
4. In the key's Object Tab (if I'm not mistaken)=>Look at description=>Run script=>If, add a condition when the taken flag is present (Object has flag=>key=>flag name=>...)
5. In Then, Run an expression and fill it with your key description when it was taken.
Example: "The silver key reflected the sun's shine. Printed on it was the number " + key.(number variable)
6. In Else, Run an expression and fill it with your key description when it was not taken yet (Probably deleting the 'Printed on it...' part)
7. In the key's Take property, ask an option that asked the player for which number to take and store that in the number variable. Also, set the key's taken flag
8. Do the exact opposite for the Drop property
9. Activate the key's Use/Give function and run the script for the evaluation of the key and the lock (If correct key was used on correct lock, unlock the lock)
That's the big picture of my idea, just try that out
PM me if you need more details
If I seemed to misunderstood your purpose, sorry to waste your time in advance
1. In the room where you wanted to put the keys in, put a suitable description of the keys ("Around 50 keys are hanging on the walls, gleaming in silver")
2. Create one instance of the key and name it in plural
3. Prepare the following: A flag to indicate whether the key was taken, a variable to store the key number
4. In the key's Object Tab (if I'm not mistaken)=>Look at description=>Run script=>If, add a condition when the taken flag is present (Object has flag=>key=>flag name=>...)
5. In Then, Run an expression and fill it with your key description when it was taken.
Example: "The silver key reflected the sun's shine. Printed on it was the number " + key.(number variable)
6. In Else, Run an expression and fill it with your key description when it was not taken yet (Probably deleting the 'Printed on it...' part)
7. In the key's Take property, ask an option that asked the player for which number to take and store that in the number variable. Also, set the key's taken flag
8. Do the exact opposite for the Drop property
9. Activate the key's Use/Give function and run the script for the evaluation of the key and the lock (If correct key was used on correct lock, unlock the lock)
That's the big picture of my idea, just try that out
PM me if you need more details