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
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Tue Sep 09, 2003 9:00 pm   

Zmud auto finding questman script
 
Hi,i have been trying to get a script so i can use my character to find the questman and ask a quest to him.

I have tryed several ways of doing so,and i think i surrender,i got no ideas left :|

For all examples lets say there are 6 room names where the questman can be:
1,2,3,4,5,6
Rooms are that way:
2-4-4-4-3-4-4-4-2
1-------5-------6
And,whenever i write, where questman,i can read: the questman is on (roomname)

Frist try,was,i write where questman,from recall,and in case questman was on 1,2,3,5,or 6,then #walk 1,2,3,5 or 6.
in case questman was on 4,i got an alarm,every 15 seconds writting where questman,so:

#trigger {the questman is on 4} {#CASE @variable {#walk the middle one of 4's on left;escan} {#walk the middle one of 4's on right;escan};#math variable @variable+1}
and a trigger:
#tr {the questman is on east from you} {east}

The problem of that try,is,in one hand, that there are many more rooms than 4,and in the other hand,whenever I stepped into a room,when description matched,it ordered character to go next,while questman could be there,and then the #trigger {questman is here} {ask for a quest} ran my character crazy.

So,i decided to change it another way.
Now,i got same alarm,but with 20 seconds,of where questman.
When i get where questman is,i use next alias to find out the room and set thoose rooms vnums into a variable:

#alias {findquestman} {#var wherequestman "";#CALL %mapfilter(%concat("(Name LIKE '",%-1,"')));#LOOP 1,%numrooms() {#ADDITEM wherequestman {%mapvnum(%i)}};#CALL %mapfilter("")}

When i got rooms where questman can be,then i order to go one by one this way:
#walk %item( @wherequestman , 1)
And then,i get an alias,on this class,which is:
#alias {Onwalkend} {#delnitem wherequestman 1;#walk %item( @wherequestman , 1)}

then,like i got almost same problem as earlyer,i did next:
#alias {onroomenter} {#pause;#ala {+1} {#step}}

And now,onwalkend doesnt work,because there is no walkend,walkend is stopped,in order to be able to see questman and ask him for a quest,so...

Im getting crazy,anyone got any wonderfull idea of how to solving that???

Thank you for your help,Droid
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Sep 10, 2003 1:33 am   
 
On basically every mud I have ever played on the prompt is the last thing seen in a room. Normally however the mapper sends the next movement command on first line of description or room name. My way around this is to #STOP the walk onroomenter then #STEP when the prompt has triggerred, this allows other triggers to activate and set states that I would want to preclude a step.
#AL onroomenter {#IF (%inwalk) {#STOP;WasWalking=1} {#IF (%trigger(AutoMapper)=0) {#IF (%roomnum=0) {#NOOP %maplocked(0);study}}}}
The else clause there checks to see that I am not currently mapping and whether I have recorded the proper vNum for the room, when I haven't I obviously want to correct that, and it would be bad to do so while trying to run somewhere.
Next the state checks in one alias:
#AL WalkHandler {#IF ((@DoorDetected)&(%trigger(Automapper))) {@DoorDetected} {#IF (@WasWalking) {#IF (!(@InCombat)) {#IF (@curMV>10) {WasWalking=0;#STEP}}}}}
I still haven't gotten around to writing too many states into this. DoorDetected is set with the direction of a door when I walk into one. Again this checks whether I am currently mapping or not, if I am not mapping then the trigger that deteced the door won't be able to fix it, and I have to take personal action (in this case check over another script to find out why it wasn't recorded as a door when I was mapping.)
Finally the prompt trigger just records prompt data, preforms actions I want taken on that data, then finally does "WalkHandler"

I ofcourse do not guarantee anything since I have never finished writing any script, there is almost always 16 variables hanging out waiting for some other portion to be written; however this is better then the alternative of writing your own slow walker. I did that once, then the mud closed and I threw out the whole thing, didn't even have zMud installed for 6 months.
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Wed Sep 10, 2003 4:34 pm   
 
Wow that post did really help me a lot!!
Now there is 1 problem left [:I]

Lets say i got 4 rooms on variable wherequestman.
I got 2 aliases,onwalkend,and onroomenter,that way:

#alias {onwalkend} {#if %class(questask)=1 {#alarm {+1} {#delnitem wherequestman 1;#walk %item( @wherequestman, 1)} questask} {}}

#alias {onroomenter} {#IF (%inwalk=1) {#stop;#alarm {+1} {#if (%class(questask)=1) {#step}} questask} {}}

And a trigger,which sends character to first room of the wherequestman list.

Then,the question is,Why does the mapper imputs the slowwalk command just after 1st description line whenever im going to the 1st room of the list (#walk 1stroomvnum),and then,when it arrives,goes stepping on room by room just as id like it to do allways,waiting 1 sec until all description,exits,and possible mobs are ready,and then step??
How to get mapper wait allways?? [xx(]

Thank you for your help [^]
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Sep 10, 2003 10:20 pm   
 
Because when you enter the first one you are no longer %inwalk, the walk ends right there. Your best bet for this situation is to record a path that hits all the possible rooms, then just walk em with the delay, until you find the guy. Sometime simplicity is better then elegance.
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Thu Sep 11, 2003 12:49 am   
 
Actually,i wanted to use this script to go to do the quest too so...
I got an idea of how to solve that:
Would it be possible/usefull to get into a variable the full path from room where i am,like a list of vnums,to the destiny room 1,and from it to destiny 2,and so on,so i get an alias like:
#alias {onwalkend} {alarm {+1} {#delnitem wherequestman 1;#walk %item( @wherequestman, 1)}}
Would it get crashes because of so much rooms handing on the variable,or is this a probably usefull way of doing that?

Does anyone got any better idea for doing so?

Thanks once more :)
Reply with quote
Droid
Novice


Joined: 28 Aug 2003
Posts: 49

PostPosted: Thu Sep 11, 2003 2:42 pm   
 
Ok,another way could be next...
Zmud realices questman is on the room when it has already ordered next step,so:
#trigger {questman is here} {#var lastone %lastdir;#stop;%reversedir(%item( @lastone,1 ));ask quest}

Shouldnt that work? Why does it doesnt? :|
Which is the best option of bough?
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