[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  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] Refresh page


Posted by Aqueus   USA  (47 posts)  [Biography] 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.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] 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
[Go to top] top

Posted by Aqueus   USA  (47 posts)  [Biography] 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.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] 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
[Go to top] top

Posted by Aqueus   USA  (47 posts)  [Biography] 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
[Go to top] 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.


12,743 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]