no define game block!!!!!!!

Elexxorine
13 Jun 2005, 12:47
ok i've checked and checked, it says define game at the top and after the variable's there's the extra end define, yet it still doesn't work!!! here's the code:
' "miningdemo"
' Created with QDK 3.53 - UNREGISTERED VERSION

define game <miningdemo>
asl-version <350>
gametype singleplayer
start <start room>
game author <elexxorine>
game version <1, demo>
game info <Created with QDK 3.53 - UNREGISTERED EVALUATION VERSION.>
default fontname <MS Sans Serif>
default fontsize <14>
background <black>
foreground <green>
beforeturn do <encumber>
command <stats> msg <~STATS:|nhp: %hp%/%mhp%|nenergy: %energy% |npicval: %picval%.|n|n~SKILLS:|nmining: %mininglvl%, (% miningexp%)|n|n~CURRENT PIC: %eqpic%|n|nany?:% have_anypic%.|n|n~ITEMS:|nPICS:|ncrap: % have_crappic%.|nbronze: %have_bronzepic%.|niron: % have_ironpic%.|nsteel: %have_steelpic%.|nmithrel: % have_mitherlpic%.|nunknown: %have_unknownpic%.|n|nORES: |ncopper: %have_copperore%.|ntin: %have_tinore%.|nclay: % have_rawclay%.|niron: %have_ironore%|nsilver: % have_silverore%.|ncoal: %have_coal%.|ngold: % have_goldore%.|nmithrel: %have_mithrelore%.|nunknown: % have_unknownore%.>
command <rest> set <status1; 1>
command <wake> set <status1; 0>
command <stand> set <status1; 0>
command <#command1#, #command2#> {
exec <#command1#>
exec <#command2#>
}
command <mine coal> {
if here <coal rock> then {
if ( have_anypic > 0 ) then {
msg <you swing your pic at the rock...>
if ( mininglvl + miningbonus + picval + $rand (-3;3)$ - 9 > 24 ) then {
msg <you get some coal.>
set <have_coal; %have_coal% + 1>
set <miningexp; %miningexp% + 24>
}
else {
msg <you fail to get some coal.>
set <miningexp; %miningexp% + 24>
}
}
else msg <you don't have a pic.>
}
else msg <you can't mine that here.>
}
command <eq #@object#> {
if ( #object# = crappic ) and ( have_crappic > 0 ) then set <picval; 1> else msg <you don't have that.>
if ( #object# = bronzepic ) and ( have_bronzepic > 0 ) then set <picval; 2> else msg <you don't have that.>
if ( #object# = ironpic ) and ( have_ironpic > 0 ) then set <picval; 3> else msg <you don't have that.>
if ( #object# = steelpic ) and ( have_steelpic > 0 ) then set <picval; 4> else msg <you don't have that.>
if ( #object# = mithrelpic ) and ( have_mithrelpic > 0 ) then set <picval; 5> else msg <you don't have that.>
if ( #object# = unknownpic ) and ( have_unknownpic > 0 ) then set <picval; 6> else msg <you don't have that.>
}
define variable <mininglvl>
type numeric
value <1>
display <mining: ! (%miningexp% exp)>
end define
define variable <miningexp>
type numeric
value <0>
display <mining: %mininglvl% (%miningexp%)>
onchange {
if ( mingexp > ((mininglvl * mininglvl ) * 35) - 35 ) then {
set <miningexp; miningexp - (((mininglvl * mininglvl) * 35) - 35)>
set <mininglvl; mininglvl + 1>
msg <|crDING!!!|n|nYOU HAVE GAINED A LEVEL IN MINING!!!|nYOU ARE NOW LEVEL %mininglvl%.|cb>
}
}
end define
define variable <gold>
type numeric
value <150>
display <gold:!gp>
end define
define variable <have_crappic>
type numeric
value <0>
end define
define variable <have_brozepic>
type numeric
value <0>
end define
define variable <have_ironpic>
type numeric
value <0>
end define
define variable <have_steelpic>
type numeric
value <0>
end define
define variable <have_mithrelpic>
type numeric
value <0>
end define
define variable <have_unknownpic>
type numeric
value <0>
end define
define variable <have_copperore>
type numeric
value <0>
end define
define variable <have_tinore>
type numeric
value <0>
end define
define variable <have_clayore>
type numeric
value <0>
end define
define variable <have_silverore>
type numeric
value <0>
end define
define variable <have_coal>
type numeric
value <0>
end define
define variable <have_goldore>
type numeric
value <0>
end define
define variable <have_mithrelore>
type numeric
value <0>
end define
define variable <have_unknownore>
type numeric
value <0>
end define
define variable <miningbonus>
type numeric
value <0>
end define
define variable <eqpic>
type numeric
value <0>
end define
define variable <picval>
type numeric
value <0>
end define
define variable <have_goldpieces>
type numeric
value <0>
end define
define variable <have_anypic>
type numeric
value <0>
end define
end define

define synonyms
sleep = rest
version = updates
end define

define room <startingthingy>
end define

define room <start room>
look <|n|n|jcWELCOME TO ELEXXORINE'S MINING DEMO.|n|jcyou can mine coal, smith it, sell it, and buy stuff, as well as level in skills.|n|jl|nnorth: |cr|cb.|nsouth: |cr|cb.|neast: |crmining room|cb.|nwest: |crshop room|cb.>
east <mining room>
west <shop room>
north
south
west
end define

define room <mining room>
look <this is the mining room, you can mine coal here, but you'll need a picaxe.>
west <start room>
script move <crap pic; mining room>

define object <coal rock>
alt <coal>
look <it is a pile f dark coloured rock, you think it's coal.>
displaytype <minable>
properties <coal>
end define

define object <crap pic>
look <it is seriously crap, you should get a better one.>
take {
set <have_crappic; %have_crappic% + 1>
move <crap pic; storage>
msg <you pick up the crap pic.>
}
use on <coal rock> {
if here <coal rock> then {
if ( have_anypic > 0 ) then {
msg <you swing your pic at the rock...>
if ( mininglvl + miningbonus + picval + $rand (-3;3)$ - 9 > 24 ) then {
msg <you get some coal.>
set <have_coal; %have_coal% + 1>
set <miningexp; %miningexp% + 24>
}
else {
msg <you fail to get some coal.>
set <miningexp; %miningexp% + 24>
}
}
else msg <you don't have a pic.>
}
else msg <you can't mine that here.>
}
end define

end define

define room <shop room>
look <this is the shop room. you can buy supplies here.>
east <start room>

define object <shop keeper>
alt <shoppie; shopkeeper; shopkeep>
look <he smiles at you.>
displaytype <shopkeeper>
article <him>
gender <he>
end define

end define

define room <quest room>
look <you can get quests here....>

define object <guy>
look <???>
speak <if you have any coal, i'll be glad to get it off your hands. how 10gp a piece sound?>
end define

end define

define room <storage>

define object <coal>
look <it is very dull.>
take
end define

end define


define timer <onesectimer>
interval <1>
action {
set <have_anypic; %have_crappic% + %have_bronzepic% + % have_ironpic% + %have_steelpic% + %have_mithrelpic% + %have_unknownpic%>
if ( have_crappic < 0 ) then set <have_crappic; 0>
if ( have_ironpic < 0 ) then set <have_ironpic; 0>
if ( have_steelpic < 0 ) then set <have_steelpic; 0>
if ( have_bronzepic < 0 ) then set <have_bronzepic; 0>
if ( have_mithrelpic < 0 ) then set <have_mithrelpic; 0>
if ( have_unknownpic < 0 ) then set <have_unknownpic; 0>
if ( have_ < 0 ) then set <have_crappic; 0>
if ( have_copperore < 0 ) then set <have_copperore; 0>
if ( have_tinore < 0 ) then set <have_tinore; 0>
if ( have_clayore < 0 ) then set <have_clayore; 0>
if ( have_silverore < 0 ) then set <have_silverore; 0>
if ( have_coal < 0 ) then set <have_coal; 0>
if ( have_goldore < 0 ) then set <have_goldore; 0>
if ( have_mithrelore < 0 ) then set <have_mithrelore; 0>
if ( have_unknownore < 0 ) then set <have_unknownore; 0>
}
enabled
end define

define text <intro>

end define

define text <win>

end define

define text <lose>

end define





sorry it's so long, lol. please please please some-body help me!!!!!! :cry:

MaDbRiT
13 Jun 2005, 13:42
elexxorine

Quest is throwing an error because your "stats" command is chock-full of spurious spaces and variable references split over two lines. This confuses the Quest engine completely and it gives up trying to work out where your game block ends.

I cut n pasted the code you posted and (having cleaned up your "stats" command) the game started OK.

You might like to consider breaking that HUGE 'stats' command down into more easily checkable and manageable parts!

Al (MaDbRiT)

Elexxorine
13 Jun 2005, 14:06
but what about the variable's? i kinda need loads of them to do my inventory system work.....

MaDbRiT
13 Jun 2005, 15:11
Elexxorine wrote

but what about the variables



What indeed! :lol:

You aren't reading them properly in your code, whenever you need to read a numeric variable you MUST put its name between % characters...

e.g.

 if ( #object# = crappic ) and ( have_crappic > 0 ) then   


will not work, the correct syntax is

 if ( #object# = crappic ) and ( %have_crappic% > 0 ) then   


I've been through your code - and with the exception that you misspell "bronzepic" in your declaration of it, adding the required % characters clears up all the asl errors.

There are other basic errors though - you have an object called 'crap pic' and are testing for an object called crappic - Quest is fussy about this - it sees "crap pic" and "crappic" as two different objects, something to watch out for.

I really think you ought to consider other ways to code this thing though.
Use of a simple variable 'PicType' and a corresponding array of names to hold the type of pick in use would be a much cleaner (and easier to do) approach.

Al (MaDbRiT)