Swapping objects or swapping rooms.
EagleWing
11 Sept 2004, 17:49I'm totally new to Quest (like today!). I have a room with very lively vicious rats. If they are fed they should become sleepy and allow the player to get an object.
In another system I once used you had the sleepy rats hidden away in a store room and swapped them for the vicious ones when appropriate.
I imagine an alternative is to have another room and move the player into it. I would prefer the former method.
How could I write a "swap" command (or does one exist somewhere)?
In another system I once used you had the sleepy rats hidden away in a store room and swapped them for the vicious ones when appropriate.
I imagine an alternative is to have another room and move the player into it. I would prefer the former method.
How could I write a "swap" command (or does one exist somewhere)?
007bond
11 Sept 2004, 21:49I wouldn't mind a swap command either. However, there is a more complex way to do this. What you need are two objects: one called "vicious rats", the other called "sleepy rats". When the game starts, make the sleepy rats invisible. Once you feed the rats, show the sleepy rats and make the vicious ones invisible. Also, set a flag to on. Now make it so that when you try to take the object, check if the flag is on. If so, give the object to the player.
That's one way of doing things, and yes, the ability to change the name of an object mid-game, or a swap command, would be great too.
Glad I could help
That's one way of doing things, and yes, the ability to change the name of an object mid-game, or a swap command, would be great too.
Glad I could help
Anonymous
11 Sept 2004, 21:56Hi guys
I think all you need is a simple flag called (say) "rats_fed"... you can test this in code to describe the rats, and a similar test will decide whether your player should be able to get the goodies...
Always look for the easy way! ( Look in the Quest manual under 'flags' and all should become clear. )
Al (MaDbRiT)
I think all you need is a simple flag called (say) "rats_fed"... you can test this in code to describe the rats, and a similar test will decide whether your player should be able to get the goodies...
Always look for the easy way! ( Look in the Quest manual under 'flags' and all should become clear. )
Al (MaDbRiT)
EagleWing
12 Sept 2004, 00:29I'm still convinced it ought to be possible to write a swap command and I've discovered a page in the manual entitled "Changing objects and rooms during the game". Now all I have to do is understand it!!
It's way past my bedtime so, like the rats, I'm sleepy and not making much sense.
Thanks again
Frank
Anonymous
12 Sept 2004, 08:24Hi again...
Can't quite see why you actually WANT a swap command really, but it is a complete doddle to do should you insist on it
I'm assuming at some point you want to make 'object b' replace 'object a' in the current location. Assuming both already exist and item b is in some limbo room the player never sees you'd use the following ASL:
move <object a;#name_of_limbo_room#>
move <object b;#quest.currentroom#>
You could make it a procedure if you wanted, but it is such a minor piece of code it seems hardly worth the bother...
Al (MaDbRiT)
Can't quite see why you actually WANT a swap command really, but it is a complete doddle to do should you insist on it
I'm assuming at some point you want to make 'object b' replace 'object a' in the current location. Assuming both already exist and item b is in some limbo room the player never sees you'd use the following ASL:
move <object a;#name_of_limbo_room#>
move <object b;#quest.currentroom#>
You could make it a procedure if you wanted, but it is such a minor piece of code it seems hardly worth the bother...
Al (MaDbRiT)
EagleWing
12 Sept 2004, 08:50Hi, Al
I probably don't really need it. It's just that when you've got used to doing something a certain way it gives you a false sense of secuity to be able to do it that way.
Anyway thanks for your replies and I really will try all methods.
I'll get to grips with it all soon, I hope. In the meantime it's good to have people like you willing to help a very old dog learn some very new tricks.
Frank
I probably don't really need it. It's just that when you've got used to doing something a certain way it gives you a false sense of secuity to be able to do it that way.
Anyway thanks for your replies and I really will try all methods.
I'll get to grips with it all soon, I hope. In the meantime it's good to have people like you willing to help a very old dog learn some very new tricks.
Frank
Anonymous
12 Sept 2004, 09:29Hi Frank
"If it ain't broke, don't fix it"
Thats my motto - how you actually do it doesn't matter so long as it works!
Al
"If it ain't broke, don't fix it"
Thats my motto - how you actually do it doesn't matter so long as it works!
Al