|
Axe Software Forums
Quest Developer Forum Now about my fairy....
|
Author | Topic: Now about my fairy.... |
Shadow |
posted 09-02-2003 01:40 GMT
I have figured out how to make my fairy *poof* appear out of nowhere in the first room and how to enter the player name etc BUT (and that is a big but) how do I make it run another scrift after the character/player answers with their name? Yes, I know all of you are getting tired of my neverending questions but until al decides to marry me and teach me all his coding genius I need help! lol...Here is my coding! ' Created with QDK 3.12 define game <> define type <door> define synonyms define room <Character Creation: The Border of Reality> define object <a plain wooden door> define object <Felia, the tiny glowing fairy> end define define room <Character Creation: The Gallery> define text <intro> end define define text <win> end define define text <lose> end define |
MaDbRiT |
posted 09-02-2003 11:32 GMT
Hi Shadow Here's a way to alter your script to do what you want. I've added a bit of formatting so that the words of the Fairy 'stand out' on the screen, rather than getting lost in the body description. Here's the changed script:- quote: Apologies for slightly tweaking your descriptions, but I think you do need to re-inforce the fact that the next input apter the script is expected to be your reply to the Fairy's question. You can always change it back of course! You also might like to consider having the fairy simply hover annoyingly until the player speaks to her and initiates a conversation, that automatically puts the player in a 'conversational' frame of mind. :-) Good luck! Al |
MaDbRiT |
posted 09-02-2003 11:44 GMT
Hi (again) Shadow The point of the above code is to show how, providing you stay inside the original 'script' brackets you can nest as many commands/scripts as you need. There are now 3 "msg" commands, two "say" commands and a couple of "miscellaneous" commands all between the script { and the closing } brace. I probably didn't make that very clear Al |
Shadow |
posted 09-02-2003 00:21 GMT
Al, you are a doll :D |
Shadow |
posted 09-02-2003 00:55 GMT
The next question the fairy asks is "are you a male or a female?" how do I keep people from entering a gender that is not male or female? As in, if you type in your name in the gender line it will show up as your gender being your name instead, how do you prevent it? Always full of questions, shadow |
Shadow |
posted 09-02-2003 15:37 GMT
I have another one...actually I have several...I am hoping that this game that I am making is eventually going to be a multiplayer rpg type game (with races, classes, guilds, etc). I am eventually (and hopefully soon) going to need to make a sit/stand command for the players. There are going to be objects such as chairs that a player can sit in...and of course the players are going to be able to sit on the ground if no object is specified. And I don't what the players to be able to do things such as go to another room while sitting. Gah! My brain hurts from all this thinking and planning but I am enjoying it lol. I am sure I will have a few more in the next few days....no wait...I have another one. I am going to have races with certain stats such as halflings, and elves, and dwarves...is this d&d all over again?...how would I make a race that has stats I know I will have to use a #race# thingy but that is about all that I know :-s. |
MaDbRiT |
posted 09-02-2003 18:53 GMT
Hi again Shadow wrote: quote: You can either test the players input in a loop until they either type 'male' or 'female', or you could use a menu to force then to choose between the two options on offer. Personally I tend to fight shy of using menus, but this is a classic example of a very good place to use one - so I've coded an example doing just that. Because the room script is growing a bit too big for comfort I have written the menu as a procedure and called it from the script, which makes things neater. Obviously you also need to define a menu. First things first though, here's the script as before, but with the call to the new procedure inserted.
quote: This procedure calls the menu 'choosesex' with choose <playersex> - the menu is defined like so. quote: Notice how I use the menu item chosen to set a variable (playersex) which is then read in the 'asksex' procedure and used so that the Fairy can follow up by commenting on the player's sex. You may put the procedure & selection definitions pretty much where you like in your code, I tend to put them right at the end before the obligatory trio of text sections for Intro, win & lose. As regards more questions, it's probably best to ask questions individually as they arise and relate to a specific issue, rather than us trying to guess what you might want to do ;-) As regards your 'races', 'guilds' etc, these will probably be best implemented as Quest types, that way all the properties relevant to a particular 'class' can be assigned simply by setting an individual object to be a member of the type. Al |
MaDbRiT |
posted 09-02-2003 18:58 GMT
OOPS - Missed a bracket there - so that last posting looks a mess, try again! Hi again
quote: You can either test the players input in a loop until they either type 'male' or 'female', or you could use a menu to force then to choose between the two options on offer. Personally I tend to fight shy of using menus, but this is a classic example of a very good place to use one - so I've coded an example doing just that. Because the room script is growing a bit too big for comfort I have written the menu as a procedure and called it from the script, which makes things neater. Obviously you also need to define a menu. First things first though, here's the script as before, but with the call to the new procedure inserted. quote: The only change is the last line do <asksex>, that calls the procedure 'asksex' which looks like this... quote: This procedure calls the menu 'choosesex' with choose <playersex> - the menu is defined like so. quote: Notice how I use the menu item chosen to set a variable (playersex) which is then read in the 'asksex' procedure and used so that the Fairy can follow up by commenting on the player's sex. You may put the procedure & selection definitions pretty much where you like in your code, I tend to put them right at the end before the obligatory trio of text sections for Intro, win & lose. As regards more questions, it's probably best to ask questions individually as they arise and relate to a specific issue, rather than us trying to guess what you might want to do ;-) As regards your 'races', 'guilds' etc, these will probably be best implemented as Quest types, that way all the properties relevant to a particular 'class' can be assigned simply by setting an individual object to be a member of the type. Al |
Shadow |
posted 09-02-2003 19:40 GMT
how do I do a loop? *ish searching through the manuel* Thankyou so much again Al, you are God! |
Shadow |
posted 09-02-2003 23:48 GMT
Well now that all went offline I have another question *le sigh* I don't want my little nekkid fairy to leave the room until after the player/character opens the door...and I don't want the player/character to be able to leave the room until the fairy does. How can I do it? |
MaDbRiT |
posted 10-02-2003 08:11 GMT
Shadow wrote: quote: As usual there are several different ways to do this, and no 'right way'. So here's one solution which will work :-) In the room script set a numeric variable to 0, call it 'fairypleased' or something such. This is going to be used as what we call a 'flag', ( before you let the player open the door you test it to see if the fairy is pleased, so it is, so it is a 'flag' that indicates her mood.) Here's how it looks... quote: O.K. now you need to alter the door opening code to test if the fairy is happy before you let the player open the door. This is a little trickier because you have used a door 'type', that applies to all doors, whereas we only want the one in this room restricted by the fairy. The solution is to give this door its own 'open' action (just cut n' paste it from the type definition) and then alter it. This means that the door type will still remain unaltered and work for all the other closed doors in the game, while this door will have a slightly different variation. This specific door definition should now look like so: quote: Now that needs to be altered to take account of the fairy's mood. All you need to do is read the fairypleased 'flag' and allow the player to open the door or not. The code would become something like this: quote: This uses a nested test (i.e. a test inside a test) and takes a bit of following logically :-) As it stands, the player will now not be able to open the door. All you need to do is set the 'fairypleased' numeric variable (a.k.a. flag) to 1 once your fairy is happy and/or leaves, and the door becomes openable by the player. Here, I've coded so that once the Fairy has the player's name and gender, she is happy and leaves, and the door becomes usable. quote: That should do the trick. Oh, it might be a good idea (before you go to far) to shorten all the obect names in your game to one-word descriptions and use aliases etc to display more detailed names, you will find it makes your code a lot less difficult to read and hence less error-prone! Al |
Shadow |
posted 10-02-2003 00:04 GMT
I love you al! lol *starts looking for those other pictures* |
Shadow |
posted 10-02-2003 00:51 GMT
I keep getting an error 9, subscript out of range when I try to open one of my rooms to edit. What am I doing wrong? |
Alex |
posted 11-02-2003 11:38 GMT
It could be a bug in QDK - if you could please email your ASL file to me at [email protected], I'll take a look into it. |
Shadow |
posted 11-02-2003 14:18 GMT
Thankyou alex but my baby Al fixed it for me already lol. He deserves a cookie! :D |
Alex |
posted 11-02-2003 17:19 GMT
What was the problem? If you could let me know (and tell me how you fixed it), I can try and get QDK to display more meaningful error messages in the future and not bomb out when it finds something it doesn't expect. |
Shadow |
posted 11-02-2003 18:22 GMT
I think it was just the fact that I had left out some {} somewhere in the coding. I am not exactly quite sure but I am sure that Al could tell you. I am not the best coder :S that's for sure so I continue to forget the little important things and then I have no idea what is going wrong. |
MaDbRiT |
posted 11-02-2003 20:01 GMT
Alex wrote:
quote: it was a mismatch of bracket types, a couple of (manually added I think) 'if' statements were coded quote: Al |
Evelsvia |
posted 15-02-2003 00:20 GMT
now THIS, is a confusing post lol. i have no idea how to code at all. is there a manual on how to code for quest net? i have 2 computers infront of me (6 on the network) and i can use one as the server, then connect to it using this computer to test my online games. but that will only be helpful if i knew how to code online games. please help me |
MaDbRiT |
posted 16-02-2003 10:30 GMT
Elsevia wrote: quote: Back in the distant days of Quest 2.1x, I wrote a "how to write ASL code the manual way" tutorial, which Alex distributed with the later V2.1x install packages. Now version 311 of Quest ASL is a completely different animal from the earlier product, being MUCH more powerful. As a result the old tutorial is effectively redundant and is no longer available. (Actually that isn't strictly true, it is still available from my website but irrelevant now). I did begin writing an equivalent manual/tutorial for Quest's "ASL 311", but as it seemed most people were happy to use the Quest GUI (a.k.a. Q.D.K.) to make Quest games anyway, I shelved the idea to concentrate on making a better extension library. The extension library is now finished, and so I've moved on to developing a game to demonstrate what it can do. This game also serves as the world's best library debugging tool, there is no substitute for actually using the thing! So, (finally) here's the point of this ramble. IF there is any level of interest in coding Quest ASL the manual way, I will take on the task and write a new 'manual / tutorial' - assuming Alex isn't already doing something. My previous tutorial assumed absolutely no coding knowledge at all, being aimed at complete beginners and so really taught basic coding principles along the way. It is my opinion that this is an appropriate approach, because if you can code already, Quest ASL is very easy to pick up. I've taken the liberty of starting a new topic with a duplication of this post, because it really is something of a diversion from the main subject of the original topic. Al |