character slots
xordevoreaux
17 Aug 2007, 01:58I've read a few posts here about people wanting to specify how things are worn on various parts of the body. I've tried an approach and am curious as to what you think.
I've only been using Quest for about a week or so, and my total amount of time dabbling is probably 15 hours, but I have found a way using properties to build body slots, so that you can test to see if a particular kind of item already is present for a given part of the body. I had seen the suggestion about using rooms to do that, but something about that technique somehow seemed less than stellar so I sought to try something else.
Anyway, I have an object called playerslots with properties of head, neck, torso, etc., and then an object type called type_armor. My one object, a helmet, has a property of slot = head, and then when the player says "wear helm", if it's in the room and the player doesn't have it, I give it to the player, then test to see if the object is of type type_armor.
If it is, I then check to see what the value of the property called slot is via a case statement. If it is head, and the player slot property head is null, then I assign the alias of the object to the player slot property called head. I have overriden the default drop command to basically clear the player slot property if the alias of the object matches the object's given slot type.
I have only built the one object, but there's enough in my template program from those case statements that I could sit there and copy the case statements in notepad and modify the asl that way. I built everything below exclusively through the QDK. I kind of like it. More versatile than Adrift and more rapid to build content with than TADS.
From the first room in the game, which is the only room visible to the player in my template, type "test" and that'll get you to my template's test environment where the helm exists. The warehouse, which is a room where I'll put everything I could clone for the player into other rooms, is empty (this is just going to be my template game file when I'm done so the warehouse in the template will always be empty).
Part of what I like about the way I've approached this is that I can turn right around and make type_attire, for such things as cloaks, etc., so that clothing can be layered, and all I need to do to get that to happen is add more properties to body playerslots object for head_attire, torso_attire, etc. So I could have a tunic and a cuirass on the torso slot, pauldrons and a cloak on the shoulders slot, an aventail and a scarf or pendant on the neck slot, etc.
Commands I either crafted over overridden are drop, wear, and inventory.
I've only been using Quest for about a week or so, and my total amount of time dabbling is probably 15 hours, but I have found a way using properties to build body slots, so that you can test to see if a particular kind of item already is present for a given part of the body. I had seen the suggestion about using rooms to do that, but something about that technique somehow seemed less than stellar so I sought to try something else.
Anyway, I have an object called playerslots with properties of head, neck, torso, etc., and then an object type called type_armor. My one object, a helmet, has a property of slot = head, and then when the player says "wear helm", if it's in the room and the player doesn't have it, I give it to the player, then test to see if the object is of type type_armor.
If it is, I then check to see what the value of the property called slot is via a case statement. If it is head, and the player slot property head is null, then I assign the alias of the object to the player slot property called head. I have overriden the default drop command to basically clear the player slot property if the alias of the object matches the object's given slot type.
I have only built the one object, but there's enough in my template program from those case statements that I could sit there and copy the case statements in notepad and modify the asl that way. I built everything below exclusively through the QDK. I kind of like it. More versatile than Adrift and more rapid to build content with than TADS.
From the first room in the game, which is the only room visible to the player in my template, type "test" and that'll get you to my template's test environment where the helm exists. The warehouse, which is a room where I'll put everything I could clone for the player into other rooms, is empty (this is just going to be my template game file when I'm done so the warehouse in the template will always be empty).
Part of what I like about the way I've approached this is that I can turn right around and make type_attire, for such things as cloaks, etc., so that clothing can be layered, and all I need to do to get that to happen is add more properties to body playerslots object for head_attire, torso_attire, etc. So I could have a tunic and a cuirass on the torso slot, pauldrons and a cloak on the shoulders slot, an aventail and a scarf or pendant on the neck slot, etc.
Commands I either crafted over overridden are drop, wear, and inventory.
' "template"
' Created with QDK Pro 4.02
!include <stdverbs.lib>
define game <template>
asl-version <400>
gametype singleplayer
start <loc_intro>
game author <Mark Taylor aka xordevoreaux>
game version <00.01>
game info <Created with QDK Pro 4.02>
default fontname <Courier New>
default fontsize <10>
description {
msg <[#@quest.currentroom#]|n#quest.lookdesc#>
if not ( #quest.doorways.dirs# = ) then msg <You can travel #quest.doorways.dirs#.> else msg <You see no obvious exits.>
if not ( #quest.objects# = ) then msg <|nYou see #quest.objects#.>
}
command <wear #@object#> {
if not got <#object#> and here <#object#> then {
give <#object#>
msg <You pick up #(object):prefix# #(object):alias#.> }
if not type <#object#; type_armor> then msg <You cannot wear the #@object#.> else {
select case <#(object):slot#> {
case <head> {
if ( #playerslots:head# = ) then {
property <playerslots; head=#@object#>
msg <You put a #(object):alias# on your head.> } else msg <You are already wearing something on your head.>}
} }
}
command <i; inven; inventory> {
exec <inventory; normal>
exec <>
if not ( #playerslots:head# = ) then msg <There is a #playerslots:head# on your head.>
}
command <drop #@object#> {
exec <drop #@object#; normal>
if type <#object#; type_armor> then {
select case <#(object):slot#> {
case <head> {
if ( #playerslots:head# = #(object):alias# ) then {
property <playerslots; head=>
msg <You are no longer wearing #(object):prefix# #(object):alias#.> }}
} }
}
define variable <clock>
type numeric
value <1200>
display <Time of Day: !>
end define
end define
define options
debug on
panes on
end define
define type <type_armor>
slot
end define
define room <loc_warehouse>
alias <loc_warehouse>
look <|nLocation of objects to be spawned in the game go here. This room is intentionally not accessible by players.>
define object <playerslots>
displaytype <Object>
article <it>
gender <it>
properties <head; neck; torso; shoulders; arms; hands; waist; legs; feet; left ear; right ear; primary; secondary; first ring; second ring>
end define
end define
define room <loc_intro>
alias <Introduction>
look <loc_intro (Introduction) is the default first room in the game.|nTo move to the test environment, type: test|nTo return here from the test environment, type either: home or intro>
command <test> goto <loc_test_01>
end define
define room <loc_test_01>
alias <Test Room One>
look <This is test room one.>
east <loc_test_02>
command <home; intro> goto <loc_intro>
define object <obj_armor_head_01>
alias <helm>
look <There is nothing particularly interesting about the helm. It is made of leather.>
take
prefix <a>
displaytype <Object>
detail <small leather>
article <it>
gender <it>
type <type_armor>
properties <slot=head>
end define
end define
define room <loc_test_02>
alias <Test Room Two>
look <This is test room two.>
west <loc_test_01>
command <home; intro> goto <loc_intro>
end define
define timer <ticktock>
interval <10>
action if ( %clock% = 2300 ) then set numeric <clock; 0> else inc <clock; 25>
disabled
end define
define text <intro>
Welcome to Game Template. This text is the first text that a player sees when a game starts. The text block is accessible in QDK from Tools, Text Blocks...
This is the "intro" text block.
end define
paul_one
17 Aug 2007, 09:33Hello.
I welcome anyone who is willing to provide open code to everyone, and congratulate you in doing a fine start after such a short period of time.
I don't know about you - but I don't like code duplication.. And it seems to me that those select cases will cause you to copy the if's, messages and properties all the time.
Quite how to get away from it, and still have the variety you offer is quite difficult though - I can only get around it using a generic statement for the already wearing:
I don't know if you meant it - but you are assigning the object alias to the head property of playerslots...
#@object# will take the variable (object) and depending on it's contents will give you the alias or real name.
There's no need to type #(object):alias# - you can just type #@object#.
I welcome anyone who is willing to provide open code to everyone, and congratulate you in doing a fine start after such a short period of time.
I don't know about you - but I don't like code duplication.. And it seems to me that those select cases will cause you to copy the if's, messages and properties all the time.
Quite how to get away from it, and still have the variety you offer is quite difficult though - I can only get around it using a generic statement for the already wearing:
command <wear #@object#> {
if not got <#object#> and here <#object#> then {
give <#object#>
msg <You pick up #(object):prefix# #(object):alias#.> }
if not type <#object#; type_armor> then msg <You cannot wear the #@object#.> else {
if ( $objectproperty(playerslots; #(object):slot# )$ = ) then _
select case <#(object):slot#> {
case <head> {
property <playerslots; head=#@object#>
msg <You put a #(object):alias# on your head.>
} } _
else msg <You are already wearing a $objectproperty(playerslots; #(object):slot# )$.>
}
}
I don't know if you meant it - but you are assigning the object alias to the head property of playerslots...
#@object# will take the variable (object) and depending on it's contents will give you the alias or real name.
There's no need to type #(object):alias# - you can just type #@object#.
Elexxorine
17 Aug 2007, 10:15Wolcome, xordevoreaux. You've got some nice code there. Two things:
1) A suggestion: have a room like the inventory room for stuff you're wearing as the inventery saying 'you have a helm. you're wearing a helm' can be confusing as to whether it is the same helm or there are two. Cy'll be very easy to change your code to do it and it'll look better, maybe make things easier for checking, etc.
2) Nothing to do with the wearing stuff. I like your clock idea, I did a very different system which had variables for hour, second1 and second2 (so when it was say 12:02, it said that and not 12:2 if you just have hour and secend variables). I liked your idea. Your time though is sot to 'disabled' though which means time is stopped.
You're doing really well for just starting. Tr0n and me are the two major helpers at the moment, we're both really good but if you need help on how to do stuff in QDK I can give instructions.
1) A suggestion: have a room like the inventory room for stuff you're wearing as the inventery saying 'you have a helm. you're wearing a helm' can be confusing as to whether it is the same helm or there are two. Cy'll be very easy to change your code to do it and it'll look better, maybe make things easier for checking, etc.
2) Nothing to do with the wearing stuff. I like your clock idea, I did a very different system which had variables for hour, second1 and second2 (so when it was say 12:02, it said that and not 12:2 if you just have hour and secend variables). I liked your idea. Your time though is sot to 'disabled' though which means time is stopped.
You're doing really well for just starting. Tr0n and me are the two major helpers at the moment, we're both really good but if you need help on how to do stuff in QDK I can give instructions.
Cryophile
17 Aug 2007, 15:34Should I start providing some of my code? 

paul_one
17 Aug 2007, 17:16To be honest Slayer, I wish everyone would supply different area's of code sometimes, as it would benefit everyone.
A rather simple wiki or some sort of 'depository' for libraries, examples, etc would be good...
I understand Steve/Elle started doing that a while ago, and I wish the site had been simple and to the point.
Allow people to request an account. This needs to be approved by someone (anyone who's already a member.. this is audited of course) and then they have access to their projects and those they have access to (but only to update files - not delete).
I'm sure there's gotta be something like this already out there.. I think I may just take a week out sometime, just become a hermit and code (and drink) heavily!
Anyway, back on subject..
Elle, When you do the inventory - surely you'd just have something like:
You are carrying:
helm (wearing)
socks
shirt (wearing)
sword (holding)
gun
key
Which should be fine.. Plus the fact he is doing it the easy way, and he said about not liking the room idea (I only like thinking that way as a last resort myself - very messy).
[EDIT]
Not to your IF-comp game though Slayer!
A rather simple wiki or some sort of 'depository' for libraries, examples, etc would be good...
I understand Steve/Elle started doing that a while ago, and I wish the site had been simple and to the point.
Allow people to request an account. This needs to be approved by someone (anyone who's already a member.. this is audited of course) and then they have access to their projects and those they have access to (but only to update files - not delete).
I'm sure there's gotta be something like this already out there.. I think I may just take a week out sometime, just become a hermit and code (and drink) heavily!
Anyway, back on subject..
Elle, When you do the inventory - surely you'd just have something like:
You are carrying:
helm (wearing)
socks
shirt (wearing)
sword (holding)
gun
key
Which should be fine.. Plus the fact he is doing it the easy way, and he said about not liking the room idea (I only like thinking that way as a last resort myself - very messy).
[EDIT]
Not to your IF-comp game though Slayer!
Elexxorine
17 Aug 2007, 20:19lol. No my code's horriable beyond anything you want to show a newbie, they'd die of shock, seriously. Anyway I'll start a wiki thing if people want and we can all help in it... Yes, a wiki with method's and codes to help people... yes...
http://axeuk.pbwiki.com/?l=S
yes....
http://axeuk.pbwiki.com/?l=S
yes....
xordevoreaux
18 Aug 2007, 13:10Thanks for the kind words, and as far as sharing code, I'm not quitting my day job anytime soon with hopes of economic prosperity hanging on building quest games, so I'm totally fine with sharing code. If I actually created a game that I thought people would sub$cribe to, infrastructure costs to do it right (thousands of users online at once) is probably a bit beyond Quest's server engine right now not to mention my budget (I'm thinking of Simutronic's Gemstone III - Gemstone IV at gemstone.net). I used to play Gemstone III exclusively, even to the point of paying almost $40 a month to play, but then kind of fell out of that and started playing EQ. That's kind of getting old, too.
For the template here, I'm trying to craft it carefully so that I can just pull the template off the shelf and have a lot of the lower-level stuff already in place.
Yeah, I'll have to revisit that. I tried a direct reference originally and it wasn't working so I probably gummed up the works somewhere.
Thanks. You're more than welcome to use if you like. I had built it for the first game that I had started, and then I didn't really like how the game was going, but I liked the clock, so when I decided that I should probably create a template first, get all the bugs worked out, etc., I added the clock to the template. I should reset it to 0 at 2375 or 2400 not 2300, i'm robbing players of an hour.
There will be lots of things like that in the template that are inactive. Things like that will be there just in case I need them for a real game, and I left the variable with a display to remind me that it's there. I might play with the interval a bit, lengthen it from 10 to 30, not sure. All depends how fast I want to force players to find shelter before nightfall when all the creepies come out.
On a slightly different topic, as far as room descriptions go, I have half a mind to create scripts rather than just direct descriptions for some if not all locations, because unless there is particularly strong moonlight, you're not going to see how "leaves from the overarching branches create an interestingly dappled pattern on the path before you" at night. That would be a lot of work as well, so I might go half and half, with a generic, time-free, weather-free description, and then add more narrative for day vs. night, rain, etc., where it makes sense to do so.
For the template here, I'm trying to craft it carefully so that I can just pull the template off the shelf and have a lot of the lower-level stuff already in place.
I don't know if you meant it - but you are assigning the object alias to the head property of playerslots...
#@object# will take the variable (object) and depending on it's contents will give you the alias or real name.
There's no need to type #(object):alias# - you can just type #@object#.
Yeah, I'll have to revisit that. I tried a direct reference originally and it wasn't working so I probably gummed up the works somewhere.
Nothing to do with the wearing stuff. I like your clock idea
Thanks. You're more than welcome to use if you like. I had built it for the first game that I had started, and then I didn't really like how the game was going, but I liked the clock, so when I decided that I should probably create a template first, get all the bugs worked out, etc., I added the clock to the template. I should reset it to 0 at 2375 or 2400 not 2300, i'm robbing players of an hour.
There will be lots of things like that in the template that are inactive. Things like that will be there just in case I need them for a real game, and I left the variable with a display to remind me that it's there. I might play with the interval a bit, lengthen it from 10 to 30, not sure. All depends how fast I want to force players to find shelter before nightfall when all the creepies come out.
On a slightly different topic, as far as room descriptions go, I have half a mind to create scripts rather than just direct descriptions for some if not all locations, because unless there is particularly strong moonlight, you're not going to see how "leaves from the overarching branches create an interestingly dappled pattern on the path before you" at night. That would be a lot of work as well, so I might go half and half, with a generic, time-free, weather-free description, and then add more narrative for day vs. night, rain, etc., where it makes sense to do so.
xordevoreaux
25 Aug 2007, 17:55The technique isn't working out as I hoped. When I assign the actual name of the object to the property's string, I've no way to coerce the playerslots:head property to be used as an object (which is why I was orginally assigning the alias to the property rather than the object name itself).
What I need is the ability to refer to the property in an object reference.
So on my object playerslots, with properties of head, torso, neck, etc., if I assign obj_armor_head_01 (which is my helm in the example posted) what I get when I display what's in the playerslot's property for the head (the "slot" for the head) I get "There is a obj_amor_head_01 on your head" and since I'm referring to that property string rather than running through any array of objects (working entirely within QDK right now for learning purposes I'm not able to exploit arrays).
So, when the player uses my customized inventory function, I would like to somehow use the playerslot:head property to refer back to the actual object, especially so I can pick up the details property of the object to use that as well ("small leather") but I can't seem to be able to refer to an object via another objecty's property string.
I somehow need #(object):prefix# and #(object):details# in my description to be "There is a small leather helm on your head"
I tried assigning the actual object name to the playerslots:head property, rather than the alias like I had been doing, and then using:
#({playerslot:head}):prefix# and the same for details and alias, but didn't work, just got the !
I think I've engineered myself into a corner. It would have been nice to use this trick but from the looks of it I'll have to fall back to somelthing clunkier.
What I need is the ability to refer to the property in an object reference.
So on my object playerslots, with properties of head, torso, neck, etc., if I assign obj_armor_head_01 (which is my helm in the example posted) what I get when I display what's in the playerslot's property for the head (the "slot" for the head) I get "There is a obj_amor_head_01 on your head" and since I'm referring to that property string rather than running through any array of objects (working entirely within QDK right now for learning purposes I'm not able to exploit arrays).
So, when the player uses my customized inventory function, I would like to somehow use the playerslot:head property to refer back to the actual object, especially so I can pick up the details property of the object to use that as well ("small leather") but I can't seem to be able to refer to an object via another objecty's property string.
I somehow need #(object):prefix# and #(object):details# in my description to be "There is a small leather helm on your head"
I tried assigning the actual object name to the playerslots:head property, rather than the alias like I had been doing, and then using:
#({playerslot:head}):prefix# and the same for details and alias, but didn't work, just got the !
I think I've engineered myself into a corner. It would have been nice to use this trick but from the looks of it I'll have to fall back to somelthing clunkier.
xordevoreaux
25 Aug 2007, 19:18Ok, I've reworked it. Just storing either the actual object handle or the alias wasn't enough. I've created a piece that tests for two properties, objectref and display, where objectref is the #object# name and the display is a concatenation of prefix, detail, and alias.
When a player tries to drop something that's worn, if the #object# in the drop command matches the string in the objectref property of the new head object that I made, then the properties are cleared and the default drop command invoked.
That should address Elexxorine's point about wanting to distinguish between multiple items. With the default inventory command embedded in my version, the object is still shown as both carried and worn, and unfortunately I guess I have to shove the worn object into another room as originally suggested, which is just so... so.... I don't know. Less than stellar but I guess there's no way around that, especially if you want the drop command to work with that.
When a player tries to drop something that's worn, if the #object# in the drop command matches the string in the objectref property of the new head object that I made, then the properties are cleared and the default drop command invoked.
That should address Elexxorine's point about wanting to distinguish between multiple items. With the default inventory command embedded in my version, the object is still shown as both carried and worn, and unfortunately I guess I have to shove the worn object into another room as originally suggested, which is just so... so.... I don't know. Less than stellar but I guess there's no way around that, especially if you want the drop command to work with that.
' "template"
' Created with QDK Pro 4.02
!include <stdverbs.lib>
define game <template>
asl-version <400>
gametype singleplayer
start <loc_intro>
game author <Mark Taylor aka xordevoreaux>
game version <00.01>
game info <Created with QDK Pro 4.02>
default fontname <Courier New>
default fontsize <10>
description {
msg <[#@quest.currentroom#]|n#quest.lookdesc#>
if not ( #quest.doorways.dirs# = ) then msg <You can travel #quest.doorways.dirs#.> else msg <You see no obvious exits.>
if not ( #quest.objects# = ) then msg <|nYou see #quest.objects#.>
}
command <wear #@object#> {
if not got <#object#> and here <#object#> then {
give <#object#>
msg <You pick up #(object):prefix# #@object#.> }
if not type <#object#; type_armor> then msg <You cannot wear the #@object#.> else {
select case <#(object):slot#> {
case <head> {
if ( #bodyslot_head:objectref# = ) then {
property <bodyslot_head; objectref=#object#>
property <bodyslot_head; display=#(object):prefix# #(object):detail# #@object#>
msg <You put #bodyslot_head:display# on your head.> } else msg <You are already wearing something on your head.>}
} }
}
command <i; inven; inventory> {
exec <inventory; normal>
if not ( #bodyslot_head:objectref# = ) then msg <There is #bodyslot_head:display# on your head.>
}
command <drop #@object#> {
if type <#object#; type_armor_head> and ( #object# = #bodyslot_head:objectref# ) then {
msg <Attempting to remove #bodyslot_head:display#.>
property <bodyslot_head; objectref=>
property <bodyslot_head; display=> }
exec <drop #@object#; normal>
}
define variable <clock>
type numeric
value <1200>
display <Time of Day: !>
end define
end define
define options
debug on
panes on
end define
define type <type_armor>
end define
define type <type_armor_head>
type <type_armor>
end define
define type <type_armor_neck>
type <type_armor>
end define
define type <type_armor_torso>
type <type_armor>
end define
define type <type_armor_arms>
type <type_armor>
end define
define type <type_armor_legs>
type <type_armor>
end define
define type <type_armor_hands>
type <type_armor>
end define
define type <type_armor_feet>
type <type_armor>
end define
define room <loc_warehouse>
alias <loc_warehouse>
look <|nLocation of objects to be spawned in the game go here. This room is intentionally not accessible by players.>
end define
define room <loc_intro>
alias <Introduction>
look <loc_intro (Introduction) is the default first room in the game.|nTo move to the test environment, type: test|nTo return here from the test environment, type either: home or intro>
command <test> goto <loc_test_01>
end define
define room <loc_test_01>
alias <Test Room One>
look <This is test room one.>
east <loc_test_02>
command <home; intro> goto <loc_intro>
define object <obj_armor_head_01>
alias <helm>
look <There is nothing particularly interesting about the helm. It is made of leather.>
take
prefix <a>
displaytype <Object>
detail <small leather>
article <it>
gender <it>
type <type_armor>
type <type_armor_head>
properties <slot=head>
end define
end define
define room <loc_test_02>
alias <Test Room Two>
look <This is test room two.>
west <loc_test_01>
command <home; intro> goto <loc_intro>
end define
define room <playerbody>
define object <bodyslot_head>
displaytype <Object>
article <it>
gender <it>
properties <objectref; display>
end define
end define
define timer <ticktock>
interval <10>
action if ( %clock% = 2300 ) then set numeric <clock; 0> else inc <clock; 25>
disabled
end define
define text <intro>
Welcome to Game Template. This text is the first text that a player sees when a game starts. The text block is accessible in QDK from Tools, Text Blocks...
This is the "intro" text block.
end define
Elexxorine
25 Aug 2007, 20:45You could try insteed of having another room:
command <inventory; i> {
for each object in <inventory> {
if property <#quest.thing#; slot=head> then msg <#@quest.thing# (head)>
' etc...
if not property <#quest.thing#; slot=head> then msg <#@quest.thing#>
}
}
You can expand this for more slots by copying and changing the line above 'etc', changing the slots and expanding the last line to in include 'and not property' for all the others too. This creates a list of the inventory showing if anything is held without printing an itmes twice.paul_one
26 Aug 2007, 04:37Yeeech.....
Step back for a second and thing about what's going on there for a second.
Everything should be totally fine with the object properties as 'slots'.
You can't have curly brackets inside of variables like that - unless Alex has slipped a new feature in without me spotting it in the help file.
I'm gonna knock some code up and reply in a few minutes..
Step back for a second and thing about what's going on there for a second.
Everything should be totally fine with the object properties as 'slots'.
You can't have curly brackets inside of variables like that - unless Alex has slipped a new feature in without me spotting it in the help file.
I'm gonna knock some code up and reply in a few minutes..
paul_one
26 Aug 2007, 05:04Right, see here:
This code works, but I don't see why you have to have the details outside of the alias..
The alias should be the "nice mushy look-nice" stuff, while you put all the references the user can type into the alt <> tag.
The benefit to this is that you can also very easily put it into a small loop to go through the objects in your slots.... Or vice versa.
It's very simple, cuts down on the number of objects you use/create, etc.
Oh - also #@object# checks to see if the object is in the current room or in your inventory and disambiguates for you too.. So no need to check if it's in the current room.
This code works, but I don't see why you have to have the details outside of the alias..
The alias should be the "nice mushy look-nice" stuff, while you put all the references the user can type into the alt <> tag.
The benefit to this is that you can also very easily put it into a small loop to go through the objects in your slots.... Or vice versa.
It's very simple, cuts down on the number of objects you use/create, etc.
Oh - also #@object# checks to see if the object is in the current room or in your inventory and disambiguates for you too.. So no need to check if it's in the current room.
' Edited by Tr0n
!include <stdverbs.lib>
define game <template>
asl-version <400>
gametype singleplayer
start <loc_intro>
game author <Mark Taylor aka xordevoreaux>
game version <00.01>
game info <Created with QDK Pro 4.02>
default fontname <Courier New>
default fontsize <10>
description {
msg <[#@quest.currentroom#]|n#quest.lookdesc#>
if not ( #quest.doorways.dirs# = ) then msg <You can travel #quest.doorways.dirs#.> else msg <You see no obvious exits.>
if not ( #quest.objects# = ) then msg <|nYou see #quest.objects#.>
}
command <wear #@object#> {
if not got <#object#> then {
give <#object#>
msg <You pick up #(object):prefix# #@object#.> }
if not type <#object#; type_armor> then msg <You cannot wear the #@object#.> else {
select case <#(object):slot#> {
case <head> {
if ( #game:head# = ! ) then {
property <game; head=#object#>
' property <bodyslot_head; display=#(object):prefix# #(object):detail# #@object#>
property <game; head_display=#(object):prefix# #(object):detail# #@object#>
msg <You put #game:head_display# on your head.> } else msg <You are already wearing something on your head.>}
} }
}
command <i; inven; inventory> {
exec <inventory; normal>
if not ( #game:head# = ) then msg <There is #game:head_display# on your head.>
}
command <drop #@object#> {
if type <#object#; type_armor_head> and ( #object# = #game:head# ) then {
msg <Attempting to remove #game:head_display#.>
property <game; head=>
property <game; head_display=> }
exec <drop #@object#; normal>
}
define variable <clock>
type numeric
value <1200>
display <Time of Day: !>
end define
end define
define options
debug on
panes on
end define
define type <type_armor>
end define
define type <type_armor_head>
type <type_armor>
end define
define type <type_armor_neck>
type <type_armor>
end define
define type <type_armor_torso>
type <type_armor>
end define
define type <type_armor_arms>
type <type_armor>
end define
define type <type_armor_legs>
type <type_armor>
end define
define type <type_armor_hands>
type <type_armor>
end define
define type <type_armor_feet>
type <type_armor>
end define
define room <loc_warehouse>
alias <loc_warehouse>
look <|nLocation of objects to be spawned in the game go here. This room is intentionally not accessible by players.>
end define
define room <loc_intro>
alias <Introduction>
look <loc_intro (Introduction) is the default first room in the game.|nTo move to the test environment, type: test|nTo return here from the test environment, type either: home or intro>
command <test> goto <loc_test_01>
end define
define room <loc_test_01>
alias <Test Room One>
look <This is test room one.>
east <loc_test_02>
command <home; intro> goto <loc_intro>
define object <obj_armor_head_01>
alias <helm>
look <There is nothing particularly interesting about the helm. It is made of leather.>
take
prefix <a>
displaytype <Object>
detail <small leather>
article <it>
gender <it>
type <type_armor>
type <type_armor_head>
properties <slot=head>
end define
end define
define room <loc_test_02>
alias <Test Room Two>
look <This is test room two.>
west <loc_test_01>
command <home; intro> goto <loc_intro>
end define
define timer <ticktock>
interval <10>
action if ( %clock% = 2300 ) then set numeric <clock; 0> else inc <clock; 25>
disabled
end define
define text <intro>
Welcome to Game Template. This text is the first text that a player sees when a game starts. The text block is accessible in QDK from Tools, Text Blocks...
This is the "intro" text block.
end define