Welcome to the Builder Academy

Question Specialized guildmaster spec-proc

More
17 Dec 2017 16:05 #7258 by Sascha
So I'm looking to do several things with guildmasters and their related practices in an effort to refine the immersion of my game. This is a "help, how do I?" post.

First, I'd like to make it so the guildmasters only teach the skills related to their class. For example, the warrior guildmaster to only teach warrior skills.

Then, I'd like the guildmasters to teach same-class skills at a lower practice cost than cross-class skills. For example, if a warrior comes to the warrior guildmaster to learn kick, the prac cost to do so would be different than if a rogue wanted to learn kick at the warrior guildmaster.

Finally, I would like to have some guildmasters teach tiered skills. For example, all rogues could learn sneak at a generic rogue guildmaster, but to learn pick they'd have to find a specific guildmaster.

I found a suggestion regarding some of this related to scripts and some code changes to reflect the skill learned via the script when typing 'practice' but my intuition tells me there's more to it than that. Can anyone help me break this down?

Will you stand against the coming Storm? After the Breaking: STORMRIDERS MUD - atbmud.dune.net port 4000

Please Log in or Create an account to join the conversation.

More
17 Dec 2017 23:10 #7263 by WhiskyTest
My thoughts on how to achieve this:

1.) Guildmaster will only teach the skills of their class
The mob needs to be given a class
-or-
The mob needs to be given skills it can teach

2.) Guildmaster teaches these skills to other classes at a different cost
The mob needs to be given a class
-or-
The skills need to be assigned to a specific class somehow

3.) Certain skills require specialized guildmaster
The mob needs to be given skills it can teach, and only teaches those skills

Based solely off your description I would go with setting a class for the guildmaster, and assigning skills to the guildmaster.

The code changes for this would be:
allow Mobs to be given classes and skills, medit changes for builders, save and read to disk.
Changes to the 'practice' command to alter the costs, and to check if the guildmaster knows the skill that is being learnt.

Decent amount of work, but you can tackle it in parts. I'd suggest starting by adding classes to mobs and see how you get on with that.

Please Log in or Create an account to join the conversation.

More
18 Dec 2017 23:36 #7272 by Parnassus
Well, Fizban always said something like most code could be replaced with triggers. I don't know how difficult the code would be but a trigger is possible. It would have to be a pretty long trigger or a large group of triggers. However, you'd be able to have a trigger check for class and give a cost depending on the class. I think a "nop" payment would work better than a bribe trigger. You'd need to enter in each skill (that's the long part), do an ifcheck or case to see if that class is allowed to learn the skill and set a price. I'd do this using "set" along with the cost of the skill.
Forum trigger code (won't work in the game):
Code:
switch %skill.name% case kick if %actor.class% == warrior set kick 100 elseif %actor.class% == rogue set kick 200 else set kick 0 endif break nop %actor.gold (%kick%)% %set% %actor.skill% whateverpercentage
I don't know if the skills are set up this way so this might need to be coded. The syntax is actually:
skillset <name> '<skill>' <value>
but I don't know if that would work in a trigger.

You've mentioned that you want builders to be able to add a spec-proc without needing a coder. Using triggers would work with this.

Please Log in or Create an account to join the conversation.

More
19 Dec 2017 14:16 - 19 Dec 2017 14:17 #7273 by Sascha
Could be a way to approach it, absolutely. Thank you so much! I don't mind spec-procs overall; they execute quickly. In a prior mud what I (and other Imms would do) was create a mob, add the SPEC flag, and then a list would come up of existing spec-procs and ask which one to add. For me, that was a lot easier than having to go into the code to designate a mob with a spec-proc in there and then wait for reboot for it to take effect. That's what I was hoping could be done here, actually, and bypass triggers altogether because otherwise I have to double-check the triggers written by builders, make sure they're in line with balance, design plans, etc. and so forth - which could be a time sink for me in the long run which could delay in expansion roll-outs.

Will you stand against the coming Storm? After the Breaking: STORMRIDERS MUD - atbmud.dune.net port 4000
Last edit: 19 Dec 2017 14:17 by Sascha.

Please Log in or Create an account to join the conversation.

More
20 Dec 2017 04:22 #7275 by WhiskyTest
The challenge with adding spec-procs to mobs at runtime is then loading them back from disk.
It's easy enough to add a spec-proc to a mob, but as soon as you copyover the change is lost. I gett error messages about attempting to assign specials to non existant mobs.

I think it's because spec-procs are added to the mob_index once all mobs are loaded, rather than during index booting for mobs. I'm not very familiar with that part of the code which doesn't help.

Maybe there is a way to re-read all the mob files again during the assigning_functions phase, but that would be double handling...

Further thinking required

Please Log in or Create an account to join the conversation.

More
20 Dec 2017 23:05 #7276 by WhiskyTest
OK I have a work around for this.
It turns out that rooms are cycled through during assign_rooms() so I don't feel so bad about my implementation.

The patch includes additions to medic so builders can add a Spec-Proc on the fly.
It saves the spec-proc number to disk using a new mob_special value called spec_proc.
During boot time interpret_espec() will look for "SpecProc" and save the value to the prototype.

When assign_mobiles() runs, it checks through the mob_index and if the spec_proc value is anything other than -1 it will assign the spec_proc to the mobile.

Note: it is entirely possible to assign object and room spec_procs to mobiles, so I don't know what the consequences of that will be. There doesn't seem to be any way to distinguish which spec_procs are for mobs/objs/rooms.

If anyone has any cleaner way of implementing this, or bug fixes etc, please post them up.
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.204 seconds