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
astrotaz
Beginner


Joined: 09 Aug 2011
Posts: 12

PostPosted: Tue Dec 13, 2011 1:49 am   

Help needed to stop when mob present
 
I need some help finishing off my setup.


This is what I have so far.

I have a number of alias setup , each of which contains a direction I wish to travel ie:

cows1 n
cows2 e
cows3 e
cows4 n
etc...

I have an alias called gop, which I use to travel through the path by calling each cow alias and incrementing the number by 1 each time.

#EXEC %concat("cows",@stepnum)
#AD stepnum 1
#VAR skipvar 0


What I wish to do now is setup some method of being able to detect when a mob name (from a pre defined list cow rabbit rat ) is present , kill it (this could be manual), then continue (I am thinking a trigger on killing blow to invoke the gop alias to continue the walk??)

for example

I can set a trigger to capture the txt "MOB", I'm thinking I have to flag a variable to 1 if present and then reset this same variable to 0 each time I move.

If anyone could provide the code to handle this I would appreciate this..

I'm thinking something like this ---

if the trigger text MOB is found then set variable mobhere == 1 , if mobhere == 1 then turn off the gop movment alias? , kill the mob (manual) then, invoke alias gop to continue along the path (based on a killing blow trigger)
if mobhere == 0 then just invoke alias gop to continue.

I also am not sure how to incorporate if a player is present to ignore and move on.

I seem to get myself in a constant loop.


Thanks for any help in advance.

Astro
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Dec 13, 2011 5:24 pm   
 
A lot of people seem to be doing this kind of thing lately, using lots of individual aliases to define paths. This is a very poor way to do it.

Have you tried making a Cmud path and using #STEP, #PAUSE, etc. to go through it?

If that really won't work for you, then perhaps use a stringlist, e.g. cowspath={n|e|e|n...}. Then create another variable for the current route you are using. If you want to do the cows route, then do: currentroute = @cowspath. Then use %pop(@currentroute) to get the next step to take.

To help you with the specific code for handling detection of mobs and starting/stopping movement, you will have to give us a lot more information--specifically, the text from the mud that you are basing this on.
Reply with quote
astrotaz
Beginner


Joined: 09 Aug 2011
Posts: 12

PostPosted: Tue Dec 13, 2011 5:45 pm   
 
ok -- I'm open to another method, I tried the #step #pause method and that didn't work out too well , could you explain how the stringlist works .. that looks promising.

Something like...

#var position 1
#var path "n|e|s|w"

Alias to move --
#EXEC %item(@path,@position)
#add position 1

?

What code do I use to interupt this walk logic when I find a mob (in a list) , manually allow me to type kill mob, then I assume I put the alias to move in the killing blow trigger.


here is a sample room , for help with mob detection routines to start and stop along a path.

>look

-= Pasture =-

Rolling hills with a dappling of spruce trees and bright green grass
cover the expansive landscape. A red maple tree grows alone in the
field. The high sun in the sky dries the dew on the ground with its
warmth.

There are eight obvious exits: southeast, southwest, northeast,
northwest, north, south, west, east
Cow.

>

I can actually change all mobs to have any prefix, eg: MOBCow
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