It is currently Wed Oct 15, 2008 10:59 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Syshook: AttackDelay
PostPosted: Sun Mar 02, 2008 5:25 pm 
Offline
User avatar

Joined: Fri Feb 10, 2006 12:15 am
Posts: 223
I know mobile.delay_mod exists.

As far as I'm concerned, during combat, if mobile has an opponent, core calculates time to actually do the hit: this delay is based on mobile.delay_mod, weapon's speed, dexterity, at least. What I'm suggesting, is AttackDelayHook, which, if exists, is called every time core is about to do the above calculation. Needed parameters would be attacker and defender. Needless to say, should the script exist, it's return value would be used as delay before the swing (making the core's calculation unnecessary).

Having hook like this would make it easier to create more dynamic combat situations and strategies, like: if you don't move between hits, your delay between hits will slowly decrease. Or, should this be affected by stamina? That could be easily done. Using mobile.delay_mod is possibility, but management of all instances that could affect it's value would soon become hard. What if attacker switched his/her weapon? Drank a dexterity potion? Died? -- Using hook the value would not be needed to be managed in scripts, as it would be re-evaluated every now and then.

This, I understand, would be somewhat CPU intensive hook, but being optional it should not harm no-one - and comparing to attack hook, this should have close to no impact in overall. Still, it would be nice if somehow (config setting?) this could be set to affect PCs only. NPCs would be nice to have but way less important, if so happens that this drains the last cycles out of my CPU.

Is there something wrong in the idea or did I overlook some very special thing? You tell me.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 06, 2008 7:03 am 
Offline

Joined: Sun Feb 05, 2006 4:35 pm
Posts: 160
Location: Poland
I'm waiting for that feature. Reducing Archery delay after moving character would me much easier. Anyway anybody know how to do it?

_________________
Shutdown();


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 11, 2008 2:26 am 
Offline
User avatar

Joined: Fri Feb 10, 2006 8:08 am
Posts: 327
Location: Myrtle Beach, South Carolina
I highly doubt this would effect cpu usage. My attackhook is so damn ridiculously large I sometimes want to slit my wrists because I know I am going to have to eventually rewrite it. But it doesn't effect much cpu usage at all, if any.


Top
 Profile  
 
 Post subject: Re: Syshook: AttackDelay
PostPosted: Thu Aug 21, 2008 4:53 am 
Offline

Joined: Fri Aug 31, 2007 2:25 pm
Posts: 67
ncrsn was talking about his idea in the irc channel some days ago, very good one.

But don't need a syshook to that does it? just a function like => RoundDelay(delay_in_ms) <= is enough in my opinion.

This function could just set the "next swing delay".

But for me there isn't much difference between them, just think a function call would be simpler (for scripters at least) than an syshook.

Anyway, very good ideia, it could be implement.

:smile: :grin:

_________________
Hello from Brazil :)


Top
 Profile  
 
 Post subject: Re: Syshook: AttackDelay
PostPosted: Sun Oct 05, 2008 8:02 am 
Offline

Joined: Fri Aug 31, 2007 2:25 pm
Posts: 67
bringing it back to live...

I've though of something here to simulate that function I've talked about in the previous message of mine.

You could use the formula that returns the swing delay and multiply it to -1, then assign the result to delay_mod, that way you'd remove any swing delay, right after that (in the next line of code or so), one could add a number, returned by a swing delay calculation function, and this number would be the new swing delay.

So:

Code:
pc.delay_mod := -1 * calc_swing_delay(weapon_speed, char_dex);
pc.delay_mod := 300;


I think this is a good way of solving this problem, but I've tried a few times (5 or 6) implementng that, adding those lines at the end of my attack hook, it didn't work, POL CORE was "ignoring" it (in fact it was setting it to 0 before using it), I've started a thread about it (viewtopic.php?f=11&t=2391), and I'm not sure if I'm coding it wrong or if it's really a bug.

But if anyone here knows how to overcome that "bug", you could post here and this swing delay issue may be solved.

_________________
Hello from Brazil :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl