(done) Attack methods (and other stuff)

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

(done) Attack methods (and other stuff)

Post 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...)
What Is Your Quest ?
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Post 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 !
Last edited by Joramun on Tue May 08, 2007 6:06 pm, edited 1 time in total.
What Is Your Quest ?
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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...
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post 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:
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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!
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post 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.
Post Reply