Axe Software Forums
  Quest Developer Forum
  Making exit's appear and object (character) propeties!


Author Topic:   Making exit's appear and object (character) propeties!
Computer Whizz posted 17-07-2001 22:01 GMT     
Right:
Two questions for you below:
1) Is it possible to "create" an exit after doing an action? I know Al's way of moving the character to a different location, but what about having the game "create" an exit after using an item? I don't like the way I'd have to code the game twice with different rooms just to have hidden exits pop up....... I know this will be on the "to do list" already but there should be a "hide" setting inside the exit properties, as well as Al's "destroy" setting :) LOL.... destroy!

2) How do you set and access the object (character) properties? Can some people post some examples of HP accessing, maybe something along those lines?
Thanx for your help!

--CW

Wizard posted 18-07-2001 03:10 GMT          
CW, I think I can help you with this one. Please note that I am using Beta 3.0 and I am not sure if this will work with other versions.

Question #1
Here is an example: lets say if you use the key on the lock it will open an exit to the west to the house. Here is the code.

define room <porch>
define object <lock>
use <key> {
create exit west <house>}
end define
end define

Note that this method will create an exit not a place. You may travel to the house by going west but the house will not appear as a place.

Question #2
To my knowledge you cannot assign properties to characters, only objects and rooms. Here is what I did to get around that.

I created an object with the exact same name as the character and keep it in the same room as the character. Hide the object so that only the character is visible. Assign the properties that you will to track to the object and adjust them as needed.

Here is the code to assign attributes to an object that has the same name as a character

define object <orc>
hidden
properties <life=20; type=monster; str=10; weapon=Mace>
end define
define character <Orc>
end define

I hope this helps, Wizard

MaDbRiT posted 18-07-2001 10:22 GMT          
Just a note regarding properties assigned to characters:-

I posted this on another thread - characters are officially not the way to do things in Quest 3.0 - they only exist for backward compatability, we are now advised to code everything as an object.

Al

Wizard posted 18-07-2001 15:22 GMT          
Yes I am still coverting my 210 code to 284. The answer to question #2 will work for 210. For 284 it would be:

define object <orc>
properties <life=20; type=monster; str=10; weapon=Mace>
end define


Hope this helps, Wizard

Computer Whizz posted 18-07-2001 19:06 GMT          
Yes, I know everything in ASL 3 is objects, that's why I put character in brackets, to suggest the function for the character, but using an object....... if that makes sense!

Thanks, so you just put properties <blah blah>........ right now how do you access them for different objects? Say you want to have 2 enemies in the room, having different HP/weapons, ect... now how would you access the different properties?

--CW
grrr, wizard, you nicked my old sig!
Hope this helps
--CW..... grrrrrr, I'm mad now!
:)

Computer Whizz posted 18-07-2001 22:41 GMT          
...........wait a minute!
Sorry about that wizard! I must have used that sig line somewhere else :(
Sorry.....

--CW

Wizard posted 19-07-2001 07:37 GMT          
CW wrote

quote:

Thanks, so you just put properties <blah blah>........ right now how do you access them for different objects? Say you want to have 2 enemies in the room, having different HP/weapons, ect... now how would you access the different properties?

There is two main ways to keep track of what you are describing. The easiest and the way I recommend are to define two separate objects to be the two enemies. Of course they would have different names. Each one can have its own set of properties that can be referenced separately (life, str, etc.).

Here is a way to have an undetermined number of monsters available for any room.
1. Define all your monsters in one room for storage. (An inaccessible room)
2. Populate an array with the names of all the monster objects.
3. Randomly pick a number and reference that name in the array.
4. Move that object to the current room.

You can repeat this for as many monsters as you want in the room. You will need to make sure you do not duplicate monsters that are already in the room.

The second is to have one object but multiple sets of properties (life1; life2; str1; str2) that refer to multiple creatures. This gets messy.

I think you all ready know how to put values into properties, change them and retrieve them. So I wont go there.

Does this answer your question, or did I miss the point?

Wizard

Computer Whizz posted 19-07-2001 20:52 GMT          
Hey, wizard...... you REALLY know what your doing!
I was going to use a similar system, but move the character into a "battle room", like the FF series! There I'd have the battle, have it randomise a number and that number determine the number of moves untill the next battle, some of the areas would dis allow battles and turn the variable to "0". Meaning when it was "1" it would go into battle....... ANYWAY!
I'm turning away from that and going into the "survival horror" way of things, I'm doing it so there will be a certain number of monsters in the room, and a time limit on varius monsters (to illustrate distance). It will update saying "Zombie1 === 2 metres" ect... in the collectable pane (if possible!) and so on!

In response to my own post: LOOK AT PAGES 25 AND 46 OF AL'S HELPFULL PDF TUTORIAL!
........there!

--CW