Axe Software Forums
  Quest Developer Forum
  help!


Author Topic:   help!
Gwerradon posted 27-05-2003 13:56 BST     
When i start the game in questnet, the Team Selection procedure keeps repeating itselg rapidly....

somebody please check my code to see what's wrong....

This is the First part....

' "Capture the Flag"
' Created with QDK 3.12

define game <Capture the Flag>
asl-version <311>
start <>
game author <Ste J Edwards>
game version <1.0 BETA>
game info <1.0 BETA>
default fontname <Arial>


player startscript {
set string <teamselect; none>
set numeric <bluescore; 0>
set numeric <redscore; 0>
msg <|jc|s20|cr|bCapture|cb The|cl Flag |cbTB|s00|xb|jl|n>
do <Team Selection>
}

------------------------------------------

This is the Procedure...

define procedure <Team Selection>
msg <Select a team....|n|n|b|crRED: |xb|cb%redscore%|n|b|clBLUE: |xb|cb%bluescore%>
enter <teamselect>
if ( #teamselect# = red ) then {
give <redkit>
goto <red base10>
}
else {
if ( #teamselect# = blue ) then {
give <bluekit>
goto <blue base10>
}
else {
msg <|bINVALID TEAM...|xb|n>
do <Team Selection>
}
}

end define

thanks.

I think Im Back posted 27-05-2003 16:35 BST          
This answer applies to the demo I made in another post as well. Coding things for QuestNet and coding things for Quest have a few drastic differences. The main difference is a lot of things aren't yet implemented in QuestNet, this is what is causing your problem. QuestNet doesn't support the "enter <thisvariable>" piece of code, that's one of your problems here. The other is that there is no start room. The procedure isn't necessary, and also you should set numeric's in the server start script which is coded as just...
"startscript {
blah blah blah
}"
... Otherwise everytime a player joins it would reset the scores which is kind of pointless.

' "Capture the Flag"
' Created with QDK 3.12

define game <Capture the Flag>
asl-version <311>
start <start>
game author <I think Im Back>
game version <1.0 WORKING BETA>
game info <1.0 WORKING BETA by I think Im Back>
default fontname <Arial>


startscript {
set numeric <b-score; 0>
set numeric <r-score; 0>
set string <score; |n|n|b|crRED: |xb|cb%r-score%|n|b|clBLUE: |xb|cb %b-score%>
}

player startscript {
msg <Capture The Flag>
}

end define

define room <start>
look <Please choose a Team by using the JOIN command to JOIN either RED or BLUE.>
script {
msg <#score#>
}
command <join red> {
msg <Joining Red Team...>
give <redkit>
goto <redbase10>
}
command <join blue> {
msg <Joining Blue Team...>
give <bluekit>
goto <bluebase10>
}
end define

I think Im Back posted 27-05-2003 16:37 BST          
That's still a shoddy piece of code and there are a million ways to do it better, but it works. It doesn't actually make the player a team member, because you hadn't put anything to do that in there. This would require player properties, and I've explained them to you before, don't feel like doing it again.

Next time I won't post code I'll just explain what to do and let you figure it out. I tire of fixing one persons work over and over again.

Gwerradon posted 27-05-2003 19:08 BST          
poor you. i bet you feel like a one man customer support service. lol. but thanks ;)