[DGD]Arrays and call others

mtaylor mtaylor at ntlworld.com
Sat Jun 23 15:14:43 CEST 2001


Thanks for the help John and Zell :)

I think I'll probably tweak it a little so that I am using variables rather
than doing so many call others. I perhaps should have posted the whole thing
.. 


The actual function the code came from is a match_reference_name function.
Basically any object that can be seen, got etc. has an array of reference
names that apply to that object. Like for "Long Steel Sword" it could be
"Steel Sword", "Long Sword" etc.
In each object's code there is a function that can be called querying those
reference names (it returns a copy of the array) and this is dealt with by a
match_reference_name function. One that tries to match user input to a
reference name for an object.
So in our room code for example:

The function match_reference_names is called when someone tries to get an
object ("sword" for example). It searches the inventory of the room for all
objects with the reference name "sword" and returns an array of those
objects (which can then be dealt with by the calling function) - so for the
get function it can deal with someone trying to get "the second sword" or
"all the swords" ...

Thanks again ...

Are there no Mac Users out there ;)

I'm still having probs with compiling DGD with the ansi patch due to not
owning Symantec C and not sure how to compile it with anything else ...

*hopeful* ;)

Matt


List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list