Find route to NPC from current room #28
unix5
started this conversation in
Script help
Replies: 2 comments
-
You could try:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A quest requires me to visit an NPC whose name has been given. I want to find the way from the current room to the room where the NPC is standing, and save the way as a variable, such as $my_route. I'd like use Map to do this: I write NPC's name as ROOMNOTE of a room. For example, now the quest tolds me the name of the NPC I should visit is Beck. I can do this:
#var {npc_name} {Beck};
#map list {roomnote}{$npc_name}{variable}{npc_room_vnum}; // get the roomvnum of the NPC's room.
#map find $npc_room_vnum; // find the shortest path from my current room to the NPC's room and store it in #path.
#path save forward my_route; // save the path to variable $my_route.
That works well. But if there are more than 1 NPC in the same room, it will be different. For example, the ROOMNOTE of a room is:
{1}{Anie}{2}{Old Fisherman}
If the quest requires me to visit Old Fisherman, how to get the route and save it in $my_route? Or is there any better way?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions