RE: CHARACTERS
Joe90secretagent
03 Jan 2009, 12:12Hi folks. Have just purchased quest pro online as I want to learn how to create adventure games. I have used other programs and I wanted to compare quest with other applications. Quest looks pretty versatile with what you can do but what I want to know is this:
There seems to be not much support in quest for creating characters. In other text adventure applications like C.A.T you can create characters with ease and you can have them move around in your world to different locations and also randomly.
Quest does not seem to have anything regarding character momement. For instance in quest I want to create a character and then have him move around like a real person would do. Is it possible to do this in quest?
I know you can script in quest and i guess you could script to do this but isnt this a bit tedious. Surely there must be a way of moving characters in your world with ease but quest does not seem to support this.
If anyone can help me out there id be very grateful. If you could explain how i can move characters in my adventure or maybe send me some code so i can see how its done that would be great.
Many thanks
Joe
There seems to be not much support in quest for creating characters. In other text adventure applications like C.A.T you can create characters with ease and you can have them move around in your world to different locations and also randomly.
Quest does not seem to have anything regarding character momement. For instance in quest I want to create a character and then have him move around like a real person would do. Is it possible to do this in quest?
I know you can script in quest and i guess you could script to do this but isnt this a bit tedious. Surely there must be a way of moving characters in your world with ease but quest does not seem to support this.
If anyone can help me out there id be very grateful. If you could explain how i can move characters in my adventure or maybe send me some code so i can see how its done that would be great.
Many thanks
Joe
Elexxorine
05 Jan 2009, 00:01There's nothing built in to do character moving. This means you can make the movement work exactly how you want though. I'll post some code up soon on how to do it, if you wish.
Joe90secretagent
05 Jan 2009, 09:24Yes please. If you could give me some code on how to move a character that would be great.
Elexxorine
05 Jan 2009, 14:00Alright, now that it's not the middle of the night, I've whipped you up some code. This is from scratch but I remembered the method I used before.
The code should work, if you put it in right; but it is untested as I don't have quest on this computer. If you have any problems, or are unsure how to add it in, then just post here. It'll be helpful if this is the case, if you attach your asl to the post, just click 'upload attachment' below the box where you type your text and the rest should be obvious.
EDIT: opps, forgot to say you must add 'do <character.mover>' to your after turn script, prolly easiest to add that via QDK unless you've already added a after-turn script.
Silly me...
define procedure <character.mover>
for each object in game {
if property <#quest.thing#; character> then {
if property <#quest.thing#; movable> {
if property <#quest.thing#; moving> then {
do <find.directions($locationof(#quest.thing#)$; #quest.thing#)>
}
}
}
}
end define
define procedure <find.directions>
set string <room.now; $parameter(1)$>
for <i; 0; 9> set string <room.dir[i];>
set numeric <room.dirs; 0>
for <i; 0; 9> {
if property <#room.now#; #directions[i]#> then {
set string <room.dir[i]; #directions[i]#>
inc <room.dirs>
}
}
if ( %room.dirs% > 0 ) then {
dec <room.dirs>
set numeric <dir.goingn; $rand(0; %room.dirs%)$>
set string <dir.goings; #room.dir[dir.goingn]#>
set numeric <dir.comingn; %dir.goingn% + 5>
set string <dir.comings; #room.dir[dir.comingn]#>
set string <room.after; $objectproperty(#room.now#; #dir.goings#)$>
do <character.mover2($parameter(2)$; #room.now#; #dir.goings#; #dir.comings#; #room.after#)>
}
end define
define procedure <character.mover2>
set string <character; $parameter(1)$>
set string <room.now; $parameter(2)$>
set string <dir.going; $parameter(3)$>
set string <dir.coming; $parameter(4)$>
set string <room.after; $parameter(5)$>
move <#character#; #room.after#>
if ( #quest.currentroom# = #room.now# ) then msg <$capfirst(#(character):alias#)$ moves #dir.going#.>
if ( #quest.currentroom# = #room.after# ) then {
if ( #dir.gonig# = up) then {
msg <$capfirst(#(character):alias#)$ enters above.>
}
else if ( #dir.going# = down ) then {
msg <$capfirst(#(character):alias#)$ enters from below.>
}
else msg <$capfirst(#(character):alias#)$ enters from the #dir.coming#.>
}
end define
Dump the above at the end of your asl. To make characters mover they need the properties 'character', 'movable' and 'moving'. The following goes inside the 'define game' block, if you already have some start script then end it inside there.startscript {
set string <directions[0]; north>
set string <directions[1]; northeast>
set string <directions[2]; east>
set string <directions[3]; southeast>
set string <directions[4]; up>
set string <directions[5]; south>
set string <directions[6]; southwest>
set string <directions[7]; west>
set string <directions[8]; northwest>
set string <directions[9]; down>
}
This should work nicely and print grammatically correct text to tell you they're moved. Characters can move where-ever they are in the game, not just in the same room as the player.The code should work, if you put it in right; but it is untested as I don't have quest on this computer. If you have any problems, or are unsure how to add it in, then just post here. It'll be helpful if this is the case, if you attach your asl to the post, just click 'upload attachment' below the box where you type your text and the rest should be obvious.
EDIT: opps, forgot to say you must add 'do <character.mover>' to your after turn script, prolly easiest to add that via QDK unless you've already added a after-turn script.

Joe90secretagent
07 Jan 2009, 11:00Hi there. Thankyou very much for the code. Looks interesting however I am a complete novice to quest and scripting. Please could you tell me exactly where the code goes.
I am using QDK until i get used to scripting. I think when you say part of code goes in the define game block do i edit the asl file in notepad and put it at the top where it says define game and finish the code before it says end define.
Also i dont know where to put the code in the start script. Where is that on qdk exactly?? And i dont know what is the after turn script. Where do i place this code???
As I said before thanks very much for yoru code. You are very helpful. Just need a bit more help as to where to place the code. Thanks
Kind REgards
Joe
I am using QDK until i get used to scripting. I think when you say part of code goes in the define game block do i edit the asl file in notepad and put it at the top where it says define game and finish the code before it says end define.
Also i dont know where to put the code in the start script. Where is that on qdk exactly?? And i dont know what is the after turn script. Where do i place this code???
As I said before thanks very much for yoru code. You are very helpful. Just need a bit more help as to where to place the code. Thanks
Kind REgards
Joe
Elexxorine
07 Jan 2009, 13:54Right, don't have quest installed here and only used the newer QDK twice. You should be able to change the startscript and after turn script through the game object, at the top of the left list. flip through the tabs til you see it, it's somewhere in there (sorry i can't be more help). easiest thing to do would be it clickedit on each then tell it to print a message and then go look for that message in the asl (should be 'msg <(your message)>'). Replace that line with my script. For the afterturn, using QDK add a 'run procedure' and select 'character.mover'. Procedures go after that 'end define' (add them before doing the script stuff i jsut said), paste them right right right at the end of the asl.
If you attach your asl file like i said in the last post i can put them in for you and then you can see the difference.
If you attach your asl file like i said in the last post i can put them in for you and then you can see the difference.