CMUD System Creating Question

by Unknown

Back to Mechanic's Corner.

Unknown2009-07-29 23:30:11
Does anyone know if it is possible in CMUD to create an alias which would look at a variable, then create folders within a pre-determined folder and triggers in those folders, where the code of the triggers are based on what the variable looked at was?

While I've got years of zmud experience, I never typed my triggers in from the prompt, I always used the GUI, so I'm a little lost here. I would think that it would be possible, but if anyone can help to point me in the right direction or give other related information that would be great smile.gif Thank you.
Unknown2009-07-30 02:32:05
The pros just make multiple sets of triggers in different classes (groups) and dynamically enable/disable the classes.
Unknown2009-07-30 13:02:26
QUOTE (Zarquan @ Jul 30 2009, 03:32 AM) <{POST_SNAPBACK}>
The pros just make multiple sets of triggers in different classes (groups) and dynamically enable/disable the classes.

Oh I know, but I don't think you understand what I'm asking. I don't want to do this to alter the way my system works on the fly, I want to do it to make the initial task of system creation easier. Rather than clicking through the GUI and essentially making the same trigger in certain places over and over again, I could just type in an aliases like "createaff dizziness" and it would make a folder in the smoke & eat folder called dizziness for me, then create a variable in that folder called @mydizziness, and create three triggers with the appropriate code in them and text to fire being "infliction message here", "diag message here", "cure message here".... you see what I mean? content.gif

Edit: Ok, I'm putting those over-priced lawyerly research skills to use and think I'm getting somewhere. If this goes well I'd probably put it up on the forum as I think it's a fairly god idea, turns system creation (or at least the most basic parts of it) into just cutting and pasting lines.

Edit2: Ok it's possible. Here's the foundation and if anyone is curious I'll probably have the final version up a few days from now.

QUOTE (CMUD Script from an alias...)
1. #echo attempting to make a trig...
2. #TRIG {^ Infliction messages goes here, remember to start with ^} {#echo win} "System Creation/"@affname
3. #VAR my@affname 0 0 "System Creation/"@affname


So what this would do is you add to the alias to set the variable @affname to say, powerleech. Type into cmud: caff powerleech. It will create a folder called powerleech, put a trigger in that folder, and create a variable called mypowerleech in that folder with the value and default value of 0. You change {#echo win} in the alias to be your default curing system code and tell it to make two more triggers (obviously this isn't complete yet but you should see where it's going) and all you need to do then is paste in the appropriate messages. You only have to type out your healing system code once, from then on it's there for you without even having to copy/paste!

I think this'll speed my system creation process greatly and might help other people to do the same. Any thoughts?
Unknown2009-07-30 14:03:03
My thought is that you're actually making it more difficult in a roundabout way, not to mention that you'll end up writing some really screwy code to handle all the special cases in Lusternia.

Still, I'll be curious to see how far you get with this idea. smile.gif
Unknown2009-07-30 14:12:28
QUOTE (Zarquan @ Jul 30 2009, 03:03 PM) <{POST_SNAPBACK}>
My thought is that you're actually making it more difficult in a roundabout way, not to mention that you'll end up writing some really screwy code to handle all the special cases in Lusternia.

Still, I'll be curious to see how far you get with this idea. smile.gif

Well, how do you usually create a system? Because previously for me I would type out (or cut and paste and then change parts of) the same zmud code over and over again for each new affliction. This prevents me from having to do that for the simpler affs, and in theory I could create a similar way of dealing with the more complicated ones when I get to them too.
Unknown2009-07-30 16:17:11
I made an alias for adding an affliction to a data record variable (or you can use separate variables, like what Thorgal used to do) and a similar alias for removing an affliction. The triggers just add/remove afflictions/defenses/etc through these aliases. Then, you have another set of aliases for scanning the various healing methods and executing what you need to cure all of what you have at that time. Separate your tracking from your healing logic and things become easier to build and maintain.
Unknown2009-07-30 16:21:19
That's a good idea, I was thinking about using aliases kind of like functions in other programs for ease of organizational purposes. But how did you create the aliases for each affliction, and the code saying what the cure for them is? A system for creating them in the first place is what I'm trying to develop here wink.gif
Unknown2009-07-31 22:29:11
So I have a new CMUD question that I've had some trouble figuring out... when it comes to changing things in the editor, my CMUD won't save my toolbar changes. Anyone else had this problem or know how to make it save them? Thank you smile.gif