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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
albo
Apprentice


Joined: 27 Mar 2008
Posts: 106

PostPosted: Tue Mar 03, 2009 11:26 pm   

Help with multiple mobs in the same room..
 
I walk into the room and there are say, 7, of the same mob there. I want to kill all of these, but I would like to do it one by one. Is there a way to make a trigger that will upon entering a room, count the number of mobs in there and start killing them one by one? It would be nice if the trigger would delete the most recent kill from the list, as well as issue a couple of other commands with the command to kill the mob.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Mar 03, 2009 11:54 pm   
 
What happens if you try to kill a mob that isn't there? Let's say you count 7, kill 1, 1 leaves, kill 5 more, then what do you get when you try to kill the 7th that isn't there? Another scenario is you count 7, kill 4, 2 arrive, kill 3, what happens to the other 2? Do they attack you automatically? Is this going to mess up your script?

Generally it is much simpler to record a list of names for the mobs, issue kill orders for the first name. When a trigger catches that you have killed something it orders a kill of the first name on the list. When a trigger catches that nothing by that name is there it removes that name and issues a kill order for the new first name; or when there are no names left it veryfies the contents of the room to see if anything arrived (look).
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
albo
Apprentice


Joined: 27 Mar 2008
Posts: 106

PostPosted: Thu Mar 05, 2009 8:43 pm   
 
The mobs on our mud don't move around. So none of that would be a problem.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Mar 05, 2009 9:54 pm   
 
Yes.. but you could still run into the issue if, for example, someone else kills one of those mobs.
_________________
Asati di tempari!
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Thu Mar 05, 2009 10:16 pm   
 
It really isn't that hard to do.

You enter a room, there are 7 mobs present there. Lets say, for simplicity's sake, they all share the same name (one you use for attacking). You record them all to a string list. You attack the first one. Given there's some sort of message signaling the mob is dead
(exp gained, dead message etc), you make that as a trigger to pop one off the string list. Then you do the same another 6 times.

Now lets say, someone enters the room, isn't kind and starts killing one of the mobs. Lets suggest that when someone attacks
the mob, there's a message, say "Someone attacks mob!" or something like that. Then you use that line to pop one off your list so that
you wouldn't revisit a mob that no longer exists. If there's no such message, then perhaps there's one when the mob dies by the hand
of another. Same deal applies.

I haven't coded nor really used CMud/ZMud extensively for ages, so I can't really give any hard code here. Only the general food for the thought.
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Mar 06, 2009 8:19 pm   
 
If you can get those mobs into a stringlist, the combat system I posted to scripts will assign them to the f-keys, then you can press f-keys to pick and choose. I briefly tested it online as a memory based targeting system, not a predictive one, and found myself healing instead so its still rude. That stringlist of yours would be called my_group and you would execute directly from the f-keys rewritten with your kill command. Anyway if you message me I can help you set up and tweak (my grey past focus display is suited to group activity IMO). Also my explanation of that needs more thought I think.
Reply with quote
albo
Apprentice


Joined: 27 Mar 2008
Posts: 106

PostPosted: Mon Mar 09, 2009 9:46 pm   
 
With hundreds, even thousands, of levels to gain on the mud I play I really just like to sit back and hit in aliases that take me to the rooms with the mobs. I would much prefer zmud to kill the mobs once i get there and handle all the keyboard heavy commands.

Progonoi Has the right of it. The mobs would have the same keyword to attack, and there is a message if the mob isn't there, or is killed by another player, so popping them off the list in those instances would be easy.

A bluff faced, stocky man with thick gray hair sits at a writing table.
this is an example mob in the mud.

Perhaps that will help.
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Tue Mar 10, 2009 11:45 am   
 
I was confused.

You want a damn robot, what's worse is you want somebody else to make it.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Mar 10, 2009 4:41 pm   
 
Now, now, calm down, Leitia. There're MUDs out there at allow bots, and if the OP's doesn't then that's his problem.

Trouble is (and I seem to say this a lot) writing a bot is probably the most complex thing you can do in zMUD (unless you're Viji, anyway :P). It requires a lot of interaction between a lot of different systems (moving, fighting, chasing, fleeing, curing) and that requires not only a thorough knowledge of the way your MUD works but also a lot of effort to write. You're unlikely to find someone who has both these things and is also willing to write a bot for you.

So, with that said, you're probably going to have to write this yourself. There're a number of threads on the forums that deal with writing bots and have example code as well as discussions about how to go about it. The forum search is here.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Tue Mar 10, 2009 5:17 pm   
 
apologies, I felt played.
Reply with quote
rhombur
Beginner


Joined: 13 Oct 2005
Posts: 24
Location: Illinois

PostPosted: Thu Mar 19, 2009 3:59 pm   
 
another option, maybe a bit more messy than these other options is to use whatever command you use to look in the room, have all the mobs you're wanting to kill in its own class, each with the trigger to attack it and turn off the class until it's dead. then the death string turn the class back on. While the class is off, you won't attack the mobs you're not fighting. and it won't send 7 commands to kill them all.
_________________
Niax Rhasu
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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