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


Joined: 30 Jun 2011
Posts: 23

PostPosted: Tue Apr 03, 2012 3:54 am   

Mapper & Speedwalking
 
Greetings.

I'm wondering how to go about setting some rooms to be ignored as viable route rooms when speedwalking, based on a variable. Specifically, there are some rooms that are have non-walkable terrain and require a boat for example.

What I've got so far is triggers setting a variable with my character's status, be it walking or sailing. I'm just not sure how to proceed from here.. What I'd like is for a check to happen when I try to speedwalk and if for example I'm walking, not to try and go through water-based rooms even if it's the shorter distance.

Open to any and all suggestions!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Tue Apr 03, 2012 3:04 pm   
 
There is an option in room properties to set room as do not enter.
That will prevent that room from being used in the pathing functions.

Proper placement can bottleneck a certain area (water zones) even if the do not enter room is not in the water zone.
_________________
Discord: Shalimarwildcat
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Apr 03, 2012 4:52 pm   
 
A variation on that is to set the Room Cost of the room. When the mapper tries to find the "shortest" path, it calculates the total "cost" of every possible path and finds the path with the lowest cost. By default, every room has a cost of 1. You can set the cost of a room higher than that. By setting the costs of rooms, you can fine-tune the paths the mapper will take, letting it go through a room if the alternative paths are too long. This is useful in muds that have movement points for entering difficult terrain.

Marking the checkbox for Do Not Enter is a shorthand for setting the room cost to the maximum possible value.
Reply with quote
form2function
Beginner


Joined: 30 Jun 2011
Posts: 23

PostPosted: Wed Apr 04, 2012 1:02 am   
 
Aha, sounds exactly like what I need.

It's good to know that we can play with the actual costs. In this case, setting it at max value (do not enter) or near that via room cost is ideal, as given the distances it still might seem viable at a lower-than-max number.

My next question then would be, how can I toggle this lovely property automatically? In fact what is it even called, code-wise, and is it manually set only? I definitely don't want it no-enter at all times, as I -do- speedwalk through that terrain, just not on foot.

Like I said, right now I have a variable in place that's changed via triggers to update the status of my character. How can I utilize that in combination with the room property to toggle the cost of sea terrain accordingly?

Definitely on the right path, but I need a touch more guidenace I'm afraid. :)

Edit: Additionally, I've already seperated most of the water terrain on its own zone. Any way this might help and/or can be useful?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Apr 04, 2012 1:51 am   
 
The function %roomcost() can set or return the cost of a room. To do what you want, you could either keep a stringlist of room numbers that you want to toggle costs on, or you could do a %mapquery() to grab a list of rooms that match an SQL query. The SQL query could look at Zoneid, or some other value that identifies your water terrrain. However, making changes to large numbers of rooms might take a noticeable amount of time. I wouldn't expect it to be more than a few seconds, but can't really predict it.

There was a feature request a couple years ago for a more elaborate way of determining room cost, one which would depend on variable characteristics, perhaps using a scripted function. That would be perfect for your purpose, but does not exist at this time.
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