Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Haldrik
Wanderer


Joined: 03 Sep 2007
Posts: 88

PostPosted: Fri May 01, 2009 10:04 pm   

Finding a specific mobs/items in an area. Best way?
 
I created some code to track down mobs/items in a certain area. I just don't like it very much. It seems a bit slow and I couldn't upgrade it very effectively.

The problem i had was if I wanted to track 3 mobs, and they were all in the same room, I had massive headaches. I could handle 2, but not three.

I setup a massive path for the whole area. i.e. .2w4e3s

And every room it either does #OK or #PAUSE depending on whether the mob is in the room. The script would then trigger off the mob name. I was able to fix the second mob issue by creating a TEMP value, I.e . #if (@jack = 1 && @tempmob = 1) . The issue i was having was when three mobs or items were in the same room.


Mobnames:

a vial
Jack
Jill
Exits: N S E W


Basically, I'm looking for a more efficient way to search an area and to be able to find/do multiple things to multiple mobs/items in the same room. I lost my original code so I can't give you my exact code, but I'd rather not recode my old stuff unless I can't find a better/more efficient way.

Any thoughts?
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Sat May 02, 2009 2:11 am   
 
Try using a string list or a DB record, they you can add as many mobs as you like to your list. you could set up a trigger to give option add/remove names from list or DB record if they arn't in the list, and use a 2n'd to record mob location or what ever you need to keep track of.

To get started I'ld recommend using/reading help files for:

#additem #delitem #delnitem for lists

#addkey #delkey %db for DB records
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net