|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Thu May 08, 2008 2:05 pm
Walking using the num-pad |
so I simply love being able to walk using the num-pad... you know, 2 is south, 8 is north and all that... so I thought: how nice would it be if I could configure alternate walking modes, like a caravan walking mode for Imperian...
so yeah, my coding-nub ass would like to ask, is it possible to assign, and then enable/disable different kinds of walking modes to the num-pad? and if yes, anyone mind telling me how that would work? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu May 08, 2008 2:12 pm |
It's entirely possible. The easiest way would be to remove the English Keypad package from your session entirely and set up your own Numpad macros. The script of these macros would be something like:
Code: |
#switch (@WalkMode)
("caravan") {lead caravan east}
("swim") {swim east}
("tackle") {tackle east}
("leap") {leap east}
{east} |
See also.
You might also want to remove the english directions package and create your own directions as well (you could just copy the ones from the English Directions package as a starting point). You'll see that the command list for these directions is something like "e|east" - if you add these extra walk types, like "e|east|swim east|tackle east" then the mapper should be able to follow you (and even map new rooms) when you move with those other walk modes. |
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 09, 2008 1:47 pm |
however annoying as this may sound... but could you possibly give me something a little more in-depth (like which menus to use, variables to set if any, and so on)? as I've said before, I'm a complete newb when it comes to setting anything up myself, and I have zero experience on macros...
edit: on an unrelated note, the "package" my settings and such are in (i.e., the one I managed to import from my old laptop through conversion from zmud to cmud there) are marked as "read only"... I can force a save, but I can't delete anything (such as the walkmode macro I tried and failed to create in an operational state)... also, windows explorer tells me the files -aren't- marked as "read only"... any way I can ditch the "read only" thingamajig from this imperian.pkg package? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 09, 2008 1:57 pm |
To copy the directions and macros:
1) Load your session (offline if you prefer) and open the Package Editor.
2) On the View menu, choose Show Default Packages.
3) On the English Keypad tab that appears, highlight the English Keypad module and press Ctrl+V
4) Move back to the tab you were on originally (probably called YourMudName)
5) Press Ctrl+V and the English Keypad module (and the macros it contains) should appear in this new package.
6) Repeat for English Directions
Now, to remove packages:
1) Close CMUD and open it again. On the sessions dialogue (the one that opens when CMUD first starts), rclick your session and choose edit session.
2) On the Package Files tab, locate the list of packages at the bottom. English Keypad and English directions should be listed.
3) Highlight them each in turn and press the minus button.
You could do this directly in the package editor, but I find this way easier.
Now, when you go back into your session and into the package editor, you should see no English Keypad and English Directions packages (tabs) even with the View Default Packages option on. But their modules will be in the YourMudName package. Now you can edit the macros and directions in there to your heart's content.
Editing directions should be simple - you click on them, and you'll see the list of commands I talked about. You add your extra commands and you're finished.
Editing macros is a bit more complex and talked about in detail here, but in short - the key is the button you press, and the script is what it does when you press it. #switch is explained in the help (it's basically a big if chain), but the example I gave will check the variable "walkmode" to see if it's any of the special modes it knows about. If it's not a mode, it'll move normally, else it'll move however you've told it to. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Fri May 09, 2008 2:05 pm |
Only variable you would need to set in his example is @WalkMode
walkmode=swim
walkmode=tackle
walkmode-caravan
walkmode=""
the macroes would then cover the rest, although i would suggest using
Code: |
#EVENT onMove {#switch (@WalkMode)
("caravan") {lead caravan %params}
("swim") {swim %params}
("tackle") {tackle %params}
("leap") {leap %params}
{%params}
} |
That way each macro just needs to do a '#RAISE onMove east' or whatever the direction happens to be |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 09, 2008 2:27 pm |
either I'm stupid, or something's messed up, but I still can't figure out how to do this...
Fang, when you say "module", do you mean the XML code, or something else?
if you mean the XML, do I simply copy the code, and paste it into the imperian package? cause if I do that, the code keeps changing into something I can't make sense out of...
edit: the imperian package in my cmud is still read-only... could that be messing with this? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 09, 2008 3:02 pm |
Packages are .pkg files. Packages contain modules and windows. Modules and windows are settings containers - windows have a GUI component, modules don't. Packages are represented in the editor by tabs. Windows and modules are shown in the treeview for the package they're part of. Windows have a window icon, and modules have a yellow capsule icon thing.
On the English Directions tab, you'll see one of those yellow icons with the name English Directions - that's the one you want. Inside, you'll see ten or so direction settings. Just highlight the English Directions module in the tree and press Ctrl+C. If you paste into a text editor, you'll see that it's the XML that's on the clipboard, but the package editor is smart. If you go to the Imperian (I thought I recognised your name from somewhere :P) tab and press Ctrl+V, the English Directions module should appear again.
The read-only thing is a bug. Make sure you're using the latest version (2.25) which has fixed it. Then go into the Package Properties (I believe it's on the View menu) and uncheck the Read Only box.
If it's still not working, we'll need more information on this code you can't make sense of. Screenshots, copy and paste, whatever. |
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 09, 2008 3:21 pm |
installing the update would be easier if I knew where it went after cmud downloaded it... -_-
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 09, 2008 3:51 pm |
did the search thing, turned up with nothing...
downloaded 2.25, installed it, and it tells me I need to enter my license key again... I do so, -exactly- the way I did it before (open the e-mail, CTRL+A, CTRL+C, cmud loads name and license key), and the damn thing keeps telling me the name I entered is wrong!
I'm starting to get really fed up with this crap -_- |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Fri May 09, 2008 3:55 pm |
depending on how long it has been since the initial time of purchase, you may need to log into the zuggsoft shop, go to your order history, and request a new key
this is entirely free
wait for the new email and use that info |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 09, 2008 4:15 pm |
It's strange that it's asking for your key again, though. Did you uninstall the old version, or just install the new one on top?
|
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 09, 2008 4:20 pm |
license code issue solved...the 2.25 I had installed was cmud... my 2.18 version is cmud-pro >_< getting 2.25 of -pro solved -that- particular problem...
but it still tells me my imperian package is read-only -_-
anyway... moving the packages worked now, so thanks for explaining how to do that properly...
now, on setting up that alias (yes, I'll say it again, I'm a newb, and I'll worship any of you if you'll just provide me with what I want)... the name obviously is "walkmode"... but how do I do the rest? >_>
last note: any chance I could add "in" and "out" as directions to this whole thingamajig? Imperian uses these two frequently, yet they weren't included on the english keypad/directions packages...
disclaimer: feel free to give up on me if I'm getting too annoying |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 09, 2008 5:39 pm |
#alias walkmode {#if (%1 and %1!="none") {walkmode=""} {walkmode=%1}}
Will set the walk mode. You can use walkmode on its own, or walkmode none to clear it. The macros you create should have the script I gave you above, but you haven't given enough detail for me to do that for you. Just put a line in like the ones I have there for each walkmode. |
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 09, 2008 6:12 pm |
ok, and -that- isn't enough for my newb ass to completely work it out while keeping whatever semblance of sanity I have left... what would you need? >_>
on that note, I did manage to add in the #switch section you gave me above for each direction key... which'll now of course prevent me from doing any walking until I define "walkmode"...
and again, -is- it possible to add "in" and "out" as directions, based on the code the english directions/keypad packages use (which you probably have yourself to peek at to confirm)? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 09, 2008 8:40 pm |
Corthono wrote: |
which'll now of course prevent me from doing any walking until I define "walkmode" |
You're talking the crazy talk. See at the bottom of the switch where it says {east}? That means if walkmode doesn't have a value that it understands, it'll default to just sending "east".
To do it for you, I'd need a list of keywords you want to use for each different walk mode (for use with the walkmode alias, like "caravan"), and the command you need to send to walk that way (like "lead caravan east").
You just need to do
#dir io in n
#dir oi out s
Where n and s are the direction you want them to be mapped in when you move that way (they're optional - if you don't include them, they'll use the "other" direction that's represented by a dot next to the room). |
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 09, 2008 9:04 pm |
... yeah, that became obvious when I thought about it a little after posting it... was too lazy to edit it out, though :P
anyway... mainly I wanted a walkmode for doing caravans on Imperian, which is done by doing "lead caravan direction"... though, I think if set up right, the switching could be done automatically (triggers, bwahahaha)
so yeah, keywords...
modeword: caravan
command: lead caravan (direction)
modeword: swimming
command: swim (direction)
modeword: leaping
command: leap (direction)
and if there's a simple enough explanation tagging along, I could probably add in any future stuff I want to toss into it myself...
P.S.: yeah, I'm -that- Corthono ;) |
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 16, 2008 1:06 pm |
sooo... not to be nagging or anything, but did anyone here had the time to write up that walkmode alias? cause I still have no clue how to do so myself... :-/
sidenote... this is the codeline for a direction... based on -that-, how would I add in "in" and "out"? cause Fang's previous explanation on it was gibberish to my coding-n00b ass...
Code: |
<dir name="d" reverse="u" dir="d" id="1046">d|down|lead caravan down</dir>
|
also, since I forgot where I saw this... how does the assigning of a key to a macro work again? |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri May 16, 2008 2:54 pm |
For adding a new direction:
Open the Package Editor, open up the folder containing your other directions.
Click New|New Direction
It will open up a form to create the new direction. Fill it out similarly to the other directions.
For instance, you might have:
Name--i
Reverse--o
Value--in|leap in|swim in (and any other commands or abbreviations that mean "in" in your mud)
Dir--Other |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 16, 2008 4:50 pm |
Thanks for bumping this. I occasionally browse the forums at work, but I don't have CMUD there, so I can't test code, so I don't like to post it. And if the thread's marked as read, I'll probably miss it. Anyway:
Code: |
#switch (@WalkMode)
("caravan") {lead caravan east}
("swim") {swim east}
("leap") {leap east}
{east} |
Is the code you should need for the macros, and I gave the alias above. Here's it in a macro - you can paste this a bunch of times and then edit them so that they've got all the directions you need:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<macro key="KEY6" copy="yes">
<value>#switch (@WalkMode)
("caravan") {lead caravan east}
("swim") {swim east}
("tackle") {tackle east}
("leap") {leap east}
{east}</value>
</macro>
</cmud> |
Just copy all of that, go to the right place in the treeview and hit Ctrl+V a bunch of times. |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Fri May 16, 2008 5:26 pm |
It'd be easier if you made an alias that contained that #SWITCH and accepted a direction as it's argument.
|
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 16, 2008 7:05 pm |
thanks for that, Rahab... looks easy enough :)
and Fang, thanks for all the effort you put into my request so far, but I'm afraid I still need to ask one crucial little thingy... where does that line you gave above go? in the value box or somewhere else? :S
also, I think I already inserted the last bit of code you supplied into every macro key present for walking...
lastly, Larkin, I think that's what Fang tried to give me at first, and I think it's needed given the code he fed me, but I'm too much of a n00b with coding to figure it out for myself >_< |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 16, 2008 8:00 pm |
Nah, that's not what I did. It'd be too much hassle to explain. But you're welcome to, Larkin! ;)
Which line above? |
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 16, 2008 8:08 pm |
#alias walkmode {#if (%1 and %1!="none") {walkmode=""} {walkmode=%1}}
that line... how do I input that using the script text window for creating a new alias? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 16, 2008 8:52 pm |
Paste it on the command line, hit enter. Job done.
|
|
|
|
|
|