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


Joined: 15 Oct 2000
Posts: 29
Location: USA

PostPosted: Sat Aug 24, 2002 3:22 am   

moving on map using zmud vnums
 
Is it possible to make triggers to run from one room to another using the zmud generated vnums. What im trying to do is make my char run to a saferoom from anywhere in that area should i be attacked or something.

Broadnax
Reply with quote
broadnax
Beginner


Joined: 15 Oct 2000
Posts: 29
Location: USA

PostPosted: Sat Aug 24, 2002 3:36 am   
 
I see that i can use recall to do this, however i want to throw a kink in it, if there are more than one safe room in the area, i want to run to the one that is the closest.

Broadnax
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat Aug 24, 2002 4:11 am   
 
From here:
quote:

You could use %walk to return the speedwalk to the room and compare the speedwalk to each other to see which one is shortest. The problem is that zMUD will only return the speedwalk to the first room it encounters that has the name "bank".

You may be able, however, to store the names of all the different banks in a stringlist (like bank1|bank2|bank|etc.) and you could have a zone script for each zone to load the appropiate list into a variable when you enter that zone.

Otherwise, the other solution I'm thinking of involves the beta version, COM scripting and ADO. However, this way, it starts to get somewhat messy.

Kjata



That or define the closest safe room in the zone scripts.

Ton Diening
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Aug 24, 2002 12:49 pm   
 
The part from my post that would apply to this case is the one about comparing the speedwalk returned by %walk of each room. To do this, you would have a stringlist containing all of the different vnums for the safe rooms and the go through the list doing a %walk on each one of them. zMUD then returns a speedwalk like:
.5n2swn

By analyzing this speedwalk we can compare it to the others and find out that, for example, this path is shorter:
.s3enesw

However, I'm not sure how %walk would hold up to this because in previous scripts I've done using %walk, I find out that you can't depend on exact timing when using it and it sometimes won't return a path, when there really is one.

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Aug 24, 2002 4:47 pm   
 
If you need to get to a safe room, it's probably more important to get moving towards any of them than to decide which room to go to. The time zMUD spends analyzing paths to pick the nearest room may well be just long enough to allow the final blow that kills you.

LightBulb
Senior Member
Reply with quote
broadnax
Beginner


Joined: 15 Oct 2000
Posts: 29
Location: USA

PostPosted: Sun Aug 25, 2002 7:40 am   
 
I think I found a way to do what i wanted, altho it is a little time consuming. In each room in the zone, I am going to put a room script that allows me to load that room vnum into @vnum, so every room I walk into will load that rooms vnum into the variable. Then, I will have zmud compare my current location to the two safe rooms, using some math,( room 50 might be my current room and the safe rooms are 70 and 110) using some math i think I should be able to determine the which room to go to, and #walk to that room.

Broadnax
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Aug 25, 2002 9:20 am   
 
If you're going to take the time to do room-scripts in every room, you should go ahead and decide now which is the closest saferoom. Then you can have your room script put the number of the nearest saferoom in @saferoom, so it's instantly available when you want it.

LightBulb
Senior Member
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