ZMUD/CMUD scripts
Vertas
Posts: 1245
6/6/2024, 2:02:43 AM
Look I've done a bit of due diligence with google, racking my memory, and scouring these forums and failed... I seem to remember a script for creating a variable for weapons/shields being worn and then when disarms happened to get weapon/shield and wear it. Anyone know what I'm talking about?
Davairus
Posts: 10674
6/6/2024, 4:14:19 AM
a trigger?
Vertas
Posts: 1245
6/6/2024, 4:58:52 AM
I know its a trigger to set a variable, I just have no idea how to go about setting that
Merlandox
Posts: 302
6/6/2024, 7:59:14 AM
How i do it is...
I have the following variables
Main_hand
Off_hand
Current_mainhand
Current_offhand
So when i use an alias to swap weapons. I have
Wear @main_hand
#var @current_mainhand @main_hand
Dual @off_hand
#var @current_offhand @off_hand
Disarm triggers
Get @current_mainhand
Remove @current_offhand
Wear @current_mainhand
Dual @current_offhand
This is because the offhand will switch over to the mainhand if u get disarmed.
Then i have a style to check whether defensive offensive or dual wield so that the inputs are slightly diff. But conceptually this is how i do it. Not the best but good enough for me.
Alternatively you can create a script that triggers on what you wear to capture the name of the weapon you are using to set it as the @current_mainhand so it covers manual input when you key in wear icicle instead of using your alias/variables. I like my scripts simple so yeah good enough for me.
I have the following variables
Main_hand
Off_hand
Current_mainhand
Current_offhand
So when i use an alias to swap weapons. I have
Wear @main_hand
#var @current_mainhand @main_hand
Dual @off_hand
#var @current_offhand @off_hand
Disarm triggers
Get @current_mainhand
Remove @current_offhand
Wear @current_mainhand
Dual @current_offhand
This is because the offhand will switch over to the mainhand if u get disarmed.
Then i have a style to check whether defensive offensive or dual wield so that the inputs are slightly diff. But conceptually this is how i do it. Not the best but good enough for me.
Alternatively you can create a script that triggers on what you wear to capture the name of the weapon you are using to set it as the @current_mainhand so it covers manual input when you key in wear icicle instead of using your alias/variables. I like my scripts simple so yeah good enough for me.
Davairus
Posts: 10674
6/6/2024, 9:00:05 AM
Vertas I don't think you'd want a trigger to set a variable generally. Use an alias to set a variable and have variables in triggers. It would look something like this in any reasonable language.
#alias {wield} {wear $1;#var @wield $1}
Now @wield is set, ready for use in triggers.
Since you are using cmud / zmud, you probably just set that up through menu windows instead of a command line interface. Everything you need should be in their windows >help documentation inside the mud client.
Also, if you have never tried mudlet out, let me go ahead and recommend having a peek, whereas if you are going to stick with cmud then get olyn's plugin instead.
#alias {wield} {wear $1;#var @wield $1}
Now @wield is set, ready for use in triggers.
Since you are using cmud / zmud, you probably just set that up through menu windows instead of a command line interface. Everything you need should be in their windows >help documentation inside the mud client.
Also, if you have never tried mudlet out, let me go ahead and recommend having a peek, whereas if you are going to stick with cmud then get olyn's plugin instead.
Olyn
Posts: 3281
6/25/2024, 6:46:17 PM
Hey, Vertas. Sorry I've been away from forums a little longer than usual, but I'd be happy to help you implement anything like this that you want on zMUD/CMUD. You can hit me up on Discord or PM me here if you need me. Have you found the CMUD plugin yet?
Link: https://abandonedrealms.com/forum/viewtopic.php?t=10229
Link: https://abandonedrealms.com/forum/viewtopic.php?t=10229
Vertas
Posts: 1245
6/5/2025, 11:52:16 PM
I somehow missed all of these replies my bad... I really enjoy the CMUD plugin, its really great having all that info in one screen. I'll send you a message in disc Olyn, in case anyone is ever interested in doing this I'll explain what my feeble non-technical inclined mind came up with.
Initially I was against using an alias, because I didn't want to wear a helmet and not notice that a helmet was showing up as the variable. The easy fix for that is using wield as the command instead of wear. So now that I understand Dav's reasoning I can just get used to typing in wield dagger...
My initial thought was to have the "You begin wielding a training staff." response after wearing an item be the trigger to create the variable. Using the alias is a better option because it messes up with dual wield or ridiculously long named stuff, vs an alias would end up being just what I typed in there, dag/dagger/whatever and I wouldn't have to worry about if something is glowing or whatever throwing off the code...
Initially I was against using an alias, because I didn't want to wear a helmet and not notice that a helmet was showing up as the variable. The easy fix for that is using wield as the command instead of wear. So now that I understand Dav's reasoning I can just get used to typing in wield dagger...
My initial thought was to have the "You begin wielding a training staff." response after wearing an item be the trigger to create the variable. Using the alias is a better option because it messes up with dual wield or ridiculously long named stuff, vs an alias would end up being just what I typed in there, dag/dagger/whatever and I wouldn't have to worry about if something is glowing or whatever throwing off the code...