Questions about dummy settings with skills.

Posted by Aqueus on Wed 21 Mar 2007 02:13 AM — 5 posts, 19,068 views.

USA #0
Ok, my problem is:

I want to make some dummy sets of data so that I can change the way skills are being handled. Basically I'm rewriting a good chunk of the skills system. 'Cept I can't figure out how or where to go about making some dummy tags for the 'code' section so that when the skill is interpreted it checks the 'code' section, (which I'll probably make it so that it no longer shows obligatorily [assuming that's a real word]) and execute the code that way...

Damn, now that I think about it I guess I can't use dummy values, like strings, it'll have to be something that can be referenced later. So should I just register it as a do_ function?

The idea is so that something like "NORMAL_SKILL" would be used and that would execute a generic skill function when that skill was used. "MULTI_HIT_SKILL" would call a function that operates slightly differently the skill hits multiple times but typically does less damage per hit.
USA #1
Are you trying to do something like for spells where there is a generic spell function that takes the spell parameters and turns them into effects?

I'm not sure I really understand what exactly you're trying to do... What is a dummy tag, and what is it for?
USA #2
Ah, but you fully understand. It'd be just like the spell functions of SMAUG.

And a dummy tag would just be a string or something that held a particular word, as in the example "NORMAL_SKILL" would be used, then a switch-case structure would determine based on that. It's dumb, hence the 'dummy tag', a 'smart' method would be to create a struct and then constrain the attribute to only accept and modify the parameter if it met one of the values in the struct, like you see often in build.c.
USA #3
Oh, I see.

The problem with registering this as a do_function is that you will lose the name of the skill being invoked, unless you detect it when interpreting the command and prepend it to the argument string.

As for being able to dynamically specify the effects of the skill, that's non-trivial; I would suggest doing something like what the spell_smaug function does.
(Of course, it might be worth your while to disguise these generic skills as spells, so that you don't have to duplicate everything. Then, naturally, you'd have to make the mana requirements and so forth go away, but this might be a lot easier than replicating the entire generic spell structure...)
USA #4
You make an excellent point. I'll look into that. Thanks. =D