Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Questions about dummy settings with skills.

Questions about dummy settings with skills.

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Aqueus   USA  (47 posts)  Bio
Date Wed 21 Mar 2007 02:13 AM (UTC)
Message
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.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Wed 21 Mar 2007 02:16 AM (UTC)
Message
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?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Aqueus   USA  (47 posts)  Bio
Date Reply #2 on Wed 21 Mar 2007 03:29 AM (UTC)
Message
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.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Wed 21 Mar 2007 04:44 AM (UTC)
Message
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...)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Aqueus   USA  (47 posts)  Bio
Date Reply #4 on Wed 21 Mar 2007 05:40 AM (UTC)
Message
You make an excellent point. I'll look into that. Thanks. =D
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


18,202 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.