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


Joined: 11 Oct 2002
Posts: 21

PostPosted: Thu Jun 12, 2003 5:47 pm   

#Slow Flee Script Help
 
Hello, i hope someone can help me with this, basically i have the following set up:

These aren't the exact values and names of mobs, iv just made them up from memory to show you the context of what i am after.

#path moving n3es2en2wd2w2n

#slow moving

#trigger {^A mob that likes to flee is here$} {#pause;#t- carnage;kill mobname;#t+ follower}

All the kill triggers are in a class called "carnage" and "follower" class , has triggers in to follow the animal and re engage in battle if it flee's. e.g:

#class {follower}
#TRIGGER {A mob that likes to flee (%w).} {%1}
#TRIGGER {A mob is dead! R.I.P.} {#t+ carnage;look;#step}

Now heres my problem, as u see it re enables carnage (reason it disables it when it engages a mob is to stop un needed commands going through if theres more of one mob in a room) it then re enables thw #slow walk, but ahh, problem because it has chased a mob maybe east, it has gone off route, or maybe its chased it 2 east.

So i need a variable that can record how much rooms it went off course chasing the mob, walk back to its starting point after the mob is dead then obviously check for other mobs to kill in origional room and finally to carry on the slow walk.


Apologies for lack of punctuation or formatting.
Reply with quote
Dan_Bradley
Beginner


Joined: 11 Oct 2002
Posts: 21

PostPosted: Thu Jun 12, 2003 11:17 pm   
 
*bump* I could really use some help on this one guys.. *Dan Impishly Grins up at you* how adorable! How can you resist now?

#TRIGGER {A mobname leaves (%w)est.} {goback = .%1}

It adds West or East to the variable go back but only works for one direction. Also, would i be able to just do GOBACK and it would do the directions back to where i was, after the animal ripped?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jun 13, 2003 1:26 am   
 
When you toggle to the follow mode save your path to a backup, and start recording a new one:

PausedPaths=%push(%secs,@PausedPaths);#PATH backup%item(@PausedPaths,1);#MARK

Then when you finally kill the mob, if you have chased him:

#RETRACE

then clean out the backup:

#SLOW backup%item(@PausedPaths,1);#UNALIAS {.backup%pop(PausedPaths)}

All of these are little code tidbits that you can figure where to integrate into the little tidbit of script you posted.
Reply with quote
Dan_Bradley
Beginner


Joined: 11 Oct 2002
Posts: 21

PostPosted: Fri Jun 13, 2003 2:39 am   
 
ooh

well i acomplished it like this :

#TRIGGER {A mobname leaves east.} {east;#if (@goback) {#add goback ";w"} {#var goback "w"}}

#TRIGGER {A mobname is dead! R.I.P.} {@goback;goback ="";#t+ carnage;look;#step}

then i did one for each direction...
Reply with quote
dime
Novice


Joined: 15 Dec 2002
Posts: 35

PostPosted: Fri Jun 13, 2003 9:22 am   
 
i forgot the command, but i remember there was a command that would give you the logical opposite of the direction you went..


for example.. #trigger {a mobname leaves (%w)} {%1;#if (@goback) {#add goback ";?"} {#var goback "?"}}

where ? would the the command to go east if %1 was west, north if %1 was south, etc...
would eliminate the need for 4 or 6 triggers..
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jun 13, 2003 11:49 am   
 
Look at the %reversedir functon in the help, I believe it is what you want.
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