' "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
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#.
Nothing to do with the wearing stuff. I like your clock idea
' "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
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.
' 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