|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Mon Sep 13, 2010 11:42 pm
[3.26] Pathing? |
Code: |
$nextmove=%item(%pathexpand(%pathfrom(%roomnum, %roomkey(%mapvnum(@destination)))),1) |
I used to use the above code to find the next single step in a path from current room to room x, but it no longer works for me.
Any clue as to why? |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Sep 14, 2010 1:09 pm |
Can you give a bit more detail than "it no longer works"?
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Wed Sep 15, 2010 12:37 am |
alright, it returns a null value
Specifically
#SAY %roomkey(%mapvnum(@destination))
and #SAY %roomkey
are giving the same values even thought the room i am in is not @destination
also the two rooms do in fact have a different %mapvnum |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Sep 15, 2010 2:46 am |
As with all %room functions, it depends upon the setting for your %roommode. CMUD uses that to determine whether to use the vNum or the Room Key. From the %roomvnum docs:
Quote: |
Note: Returns room key if %roommode is set. |
There is already a known bug regarding %roommode and the new vNum GMCP code, so I'm sure that is related to your problem.
From the %roomkey docs:
Quote: |
The first parameter is vNum irregardless of roomode. |
So, this means %roomkey ALWAYS wants a vNum. But the %roomvnum function only returns a vNum with %roommode turned off (set to zero). So you need to be careful with this. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Wed Sep 15, 2010 5:41 pm |
This is not in a GMCP mud as far as I know.
As I said in the original post, this was working properly before.
will leaving the map in %roommode(0) be detrimental? this is the only script i have dealing with it.
In the end it doesn't matter, even with %roommode(0) its not working |
|
_________________ Discord: Shalimarwildcat |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Sat Sep 18, 2010 8:00 pm |
still an issue in 3.27
seems to be %pathfrom that is returning a %null now |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Sep 20, 2010 5:07 pm |
I am not seeing any problem here. When %roommode(1) is set, I can use the room keys in %pathfrom and it returns a proper path. When %roommode(0) is set, I can use vNum values in %pathfrom and it returns a proper path.
So I suggest you look at your script a bit more and check your %roommode. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Tue Sep 21, 2010 3:09 pm |
I see the trouble, rooms marked to not enter are keeping a path from being formed even when no other options are available but to run through the do not enter room.
Otherwise, this is working great in 3.28 |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Sep 21, 2010 4:25 pm |
If a room is marked as "do not enter", then CMUD will *never* create a path through that room. So it sounds like it is working as designed. If you just want the room to be unlikely to be entered, just set it's Room Cost to a high value. Then it will only create a path through the room if there is no other choice.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Tue Sep 21, 2010 4:39 pm |
I thought that all the do not enter flag did was set it to a high cost and draw an X through the room.
Regardless, my script is working again and that's what really matters. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Sep 21, 2010 5:21 pm |
Yes, "do not enter" sets the cost to the largest possible value, but the CMUD mapper treats that large value as a special value of essentially infinity and prevents any movement into the room.
|
|
|
|
|
|