So I'm very new at this, and I can tell that the complex stuff is way beyond me.
What I'm trying to do is simple: imagine a 10x10 square of rooms, with me starting in ne corner. I want a path/speedwalk that goes 10s, 10w, 10n, 10e...but that I can stop and restart along the way at designated places. Restarting with the same command is the key. For example, let's say I wanted to stop in se, sw, and nw corners. Ideally, I'd start the walk, it would go 10s and stop. Then, when I nod or something, it would go 10 w and stop, waiting for another nod.
Does something like this exist or can it be created? I can't find a way to do it in mudlet.
FYI, how I'm currently managing this is by having lots of aliases. For instance, "a1" to make me go 10s, then "a2" to make me go 10w, etc. It's a lot more cumbersome simply b/c I have to type the next number (e.g., a78) for each new room.
Thanks for any help for this noob!
Very simple paths?
Re: Very simple paths?
So you know where you'll want to stop each time?
If that's the case, it's not too bad. For each such path, you would make a table
Where someWalkName is a convenient name for you to remember the path set. To walk it, I would use two aliases... startPathing and cp (for continue pathing, but nice and short.. you could use anything really)
Now... I haven't tested it, but that -should- do what you want, stopping at each 'break' point. Is that what you were looking for, or am I off the mark?
If that's the case, it's not too bad. For each such path, you would make a table
Where someWalkName is a convenient name for you to remember the path set. To walk it, I would use two aliases... startPathing and cp (for continue pathing, but nice and short.. you could use anything really)
and cp:
Now... I haven't tested it, but that -should- do what you want, stopping at each 'break' point. Is that what you were looking for, or am I off the mark?
-
- Posts: 14
- Joined: Thu Jul 31, 2014 7:21 pm
Re: Very simple paths?
Thanks so much for the reply! You're totally on the mark—but this makes no sense to me. I'm reading up on the manual, as well as the specific wiki for tables (http://lua-users.org/wiki/TablesTutorial), but still am having a hard time. Can you explain this to me like I'm a 4-year-old?
First, do I start by just pasting in the content from the first box of code you shared? If so, where? Under scripts-->Add item, then just paste it in? I delete the green text about "add your lua script here," paste your code, but it gets the following bug: Lua syntax error:[string "pathing = pathing or{}..."]:2 attempt to call global "of" (a nil value).
As you can see, I'm a total noob. I think I understand the basic idea behind tables, but I don't know where to build them in Mudlet, and I don't know how to make them work. For instance, I'm trying to do the basic "foo=123" stuff in that wiki article, but it's not working at all. If someone can explain this more basically that would be super helpful. Meanwhile I'll keep trying to make this work/understand it on my end.
Thanks again for any help!
First, do I start by just pasting in the content from the first box of code you shared? If so, where? Under scripts-->Add item, then just paste it in? I delete the green text about "add your lua script here," paste your code, but it gets the following bug: Lua syntax error:[string "pathing = pathing or{}..."]:2 attempt to call global "of" (a nil value).
As you can see, I'm a total noob. I think I understand the basic idea behind tables, but I don't know where to build them in Mudlet, and I don't know how to make them work. For instance, I'm trying to do the basic "foo=123" stuff in that wiki article, but it's not working at all. If someone can explain this more basically that would be super helpful. Meanwhile I'll keep trying to make this work/understand it on my end.
Thanks again for any help!
-
- Posts: 14
- Joined: Thu Jul 31, 2014 7:21 pm
Re: Very simple paths?
OK, so as to that first string of code, I replaced "of" with "or" near the end of line 2, and that fixed the bug.
I then created the startPathing alias (Alias name: startPathing; Pattern: ^startPathing$; Substitution: I left this blank). This showed no bugs.
Now, if I type "startPathing," nothing happens (the MUD doesn't respond either). Seems like progress!
However, I created the cp alias and it's bugged. The bug reads: Lua syntax error:[string "function Alias312()..."]:5: 'end' expected (to close 'function' at line 1) near ".
I then created the startPathing alias (Alias name: startPathing; Pattern: ^startPathing$; Substitution: I left this blank). This showed no bugs.
Now, if I type "startPathing," nothing happens (the MUD doesn't respond either). Seems like progress!
However, I created the cp alias and it's bugged. The bug reads: Lua syntax error:[string "function Alias312()..."]:5: 'end' expected (to close 'function' at line 1) near ".
Re: Very simple paths?
the alias should be "^startPathing (\w+)"$" and you would call it by giving it the name of the path you want it to start, so if you have a path named "OrcRun" you would type "startPathing OrcRun" and it would do the first segment of the path.
As for the cp alias, that doesn't sound right. Try removing and remaking it, without the comment or anything?
As for the cp alias, that doesn't sound right. Try removing and remaking it, without the comment or anything?
-
- Posts: 14
- Joined: Thu Jul 31, 2014 7:21 pm
Re: Very simple paths?
WOW. All fixed. This is perfect. TY sir!
So for other walks, I would just add additional lines to the end of that first code—
pathing.walks.BrandNewWalkName = { "5nw", "2w"}
So basically this one script would be the home for all my speedwalks!
Thank you again!!
So for other walks, I would just add additional lines to the end of that first code—
pathing.walks.BrandNewWalkName = { "5nw", "2w"}
So basically this one script would be the home for all my speedwalks!
Thank you again!!
Re: Very simple paths?
Always happy to help =)
-
- Posts: 14
- Joined: Thu Jul 31, 2014 7:21 pm
Re: Very simple paths?
OK, another question: What if I want my path segments to have non-typical directions (e.g., barn, porch, etc.)?
It seems like the paths only recognize basic directional commands as directions at the moment. Is there a way to change that?
It seems like the paths only recognize basic directional commands as directions at the moment. Is there a way to change that?
-
- Posts: 14
- Joined: Thu Jul 31, 2014 7:21 pm
Re: Very simple paths?
Bumping this in case anyone has a suggestion. I tried putting non-directions in quotes but it doesn't help. I figure the main way to fix this would be to find where in mudlet is the library that knows the cardinal directions, then add additional entries for other words. Any thoughts?
Re: Very simple paths?
Have you added the directions as special exits for the rooms in your map? It seems that if those are in place, I would expect the path to be properly generated using those commands.