Page 1 of 1

(done) Attack methods (and other stuff)

Posted: Tue May 08, 2007 5:17 pm
by Joramun
How can I make a weapon that changes its attack
methods with the level of the character ?
(e.g. "Swing" replaced by "Slash" when fighter level is craftman etc.)

Actually, I would also like to have methods dynamically replaced
during the game, whenever I want.

(like meeting a Sword Master that teaches one of your char a special attack that works with all sword-type weapons...)

Posted: Tue May 08, 2007 5:21 pm
by beowuuf
You have to have swaps through a relay when a character equips and unequips a weapon to ensure ti is the right character

For the swappign options dynamically, then you will need to swap all sword type weapon when you meet the swordsmaster I guess

Posted: Tue May 08, 2007 5:25 pm
by Joramun
I can contend with adding a class "SWORD" for the last example,
but I believe creating new archetypes just for changing
attack methods is not the simplest solution, especially if
I need a lot of character-dependant attack methods.

EDIT : hey, Beo, weren't you thinking 'RTC' ?
Things work differently in DSB !

Posted: Tue May 08, 2007 6:05 pm
by beowuuf
I didn't say it was the simplest, I simply said it was the one you'd be able to do right now :D

Not sure how the action activations work, if you can have a weapon auto-launch an external action window then that would be the easiest way - whether RTC can do that just now I don't know I'm afraid

However, option windows come from item options anyway, so you'd need to create the variants for your party and learning skills. Hmm...

Posted: Tue May 08, 2007 6:07 pm
by Sophia
beowuuf wrote:whether RTC can do that just now I don't know I'm afraid
RTC?! Did you notice what forum you're in? :wink:

Posted: Tue May 08, 2007 7:05 pm
by beowuuf
And here was me wondering where you got the time to do two dungeons :D

That'll teach me to be doing stuff quickly at work :oops:

Sophia, if you want to erase my posts and make Joramund look liek a nut, gop right ahead!

Posted: Tue May 08, 2007 7:17 pm
by Sophia
beowuuf wrote:if you want to erase my posts and make Joramund look liek a nut
No, I'd rather make you look like a nut. ;)

Anyway...
There are ways to do this now, but none of them are very good.
What I'll add for 0.16 is the ability to specify an arch's attack methods as a function returning a table.

So, you could do something like:
(Consider this Lua-pseudocode, I haven't really tested it)

Code: Select all

obj.some_sword.methods = method_func
and elsewhere:

Code: Select all

function method_func(id, who)
    return { {"SWING", 0, 0, some_func}, {"CHOP", 0, 0, some_func} }
end
... or whatever. :wink: :D
The point being that the return value doesn't need to be constant, so, you could query the character's experience level, or whatever else, and return appropriate methods. If it's level-based, specifying the level and skill in the method are superfluous, but, it might not be, and to change the format would be more trouble than just keeping it constant, so, they'll remain.