Anyway i can make this work?

francisstokes
16 Mar 2005, 11:34
!include <net.lib>

define game <Runescape--The text adventure!>
asl-version <350>
gametype multiplayer
start <MainLand>
game author <Francis Stokes>
game info <Created with QDK 3.53 - UNREGISTERED EVALUATION VERSION.>
startscript msg <*RunescapE*>
player startscript msg <Welcome,$name(%userid%)$!!>
define variable <Health>
type numeric
scope global
value <100>
display <Health: ! / 100>
onchange if ( %Health% <= 0 ) then goto <deadroom>
end define
define variable <Lv>
type numeric
scope global
value <1>
display <Lv.!>
end define
define variable <gold>
type numeric
scope global
value <0>
display <Gold: !>
end define
define variable <Exp>
type numeric
scope global
value <0>
display <Exp - 0 >
end define
end define

define options
login on
register on
end define

define type <Sword>
Attack_value
Defence_Value
end define

define type <Enemy_lv1>
Attack_value
Defence_value
end define

define synonyms
end define

define room <MainLand>
alias <Main Land>
prefix <The>
look <You stand on a hill looking over the main land.This will almost certainly be a huge adventure for you!>
indescription <You are on:>
script give <Stats>
command <Hit #@Enemy#> msg <You hit the #@Enemy#!>

define object <Stats>
look <|crAttack:|cl %Att%|n|crDefence:|cl%Def%>
take
end define

define object <Basic Sword>
look <A shiny sword.>
take <You take the sword.>
examine <Its made of tin.>
prefix <a>
displaytype <Weapon>
article <it>
gender <it>
type <Sword>
type <giveable>
properties <Attack_Value=10; Defence_Value=0>
end define

define object <Goblin>
type <Enemy_lv1>
properties <attack_value=5; defence_value=5>
action <hit> dec <Health; 5>
end define

if ( %mood% = 2 ) then set string <mood2; mild>
if ( %mood% = 3 ) then set string <mood2; raining>
if ( %mood% = 4 ) then set string <mood2; snowing>
end define

define room <deadroom>
alias <Dead Room>
look <If you are here you have died.You must disconect and log on again to start playing.>
end define

define text <intro>

end define

define text <win>

end define

define text <lose>

end define

define text <stats>
|crAttack Points: %att%|nDefence Points: %Def%|n
end define


i cant work out how object properties or hit commands work.Please help me!!!!!!!!!!!!!!!!!!!!!!

Cryophile
17 Mar 2005, 20:52
http://www.axeuk.com/quest/developer/asl/questnet.htm
Read this.

When a user connects to your game they are given a number. This number is stored in the numeric variable %userid%. Each variable in the game is defined for each player with the variable %variable[userid]%

If you want to run a script that only applies to one player you use the command with.
Straight from the manual:

command <attack #@player#> {
with <#player#> {
dec <health[userid]; 5>
background <red>
}
inc <money[userid]; 100>
}


francisstokes
17 Mar 2005, 22:28
i tried this,and i know it works by the screen going red,but,it doesn't decrease the health status variable I replaced the names of the var's with my own and checked for caps etc..

:( again,can any one work this one out?!

Cryophile
18 Mar 2005, 18:06
Your code isn't using the Health[userid] or similar. Otherwise it's a universal variable and not character specific.

francisstokes
19 Mar 2005, 22:47
i still don't get it.Im sorry, this is probably really but this is my first quest net game and i did undertake a HUGE project,but i really thought i could do it.im not gonna give up though.How can i fix my attacking problem?

francisstokes
20 Mar 2005, 16:19
I'm such a retard! :oops: I relised that i was using Global var's insted of local ones!Now the game works fine,but i still have loads and loads to do on it.My next obstacal,Attacking NPC's!!