Remove Weapon delay

Post Reply
aventinus
Posts: 13
Joined: Sat Sep 08, 2012 8:48 pm

Remove Weapon delay

Post by aventinus » Fri Jun 12, 2015 1:04 am

Is it possible to remove weapon delay to remove the delay between attacking different targets? MNKs have to wait forever between targets. Or is it possible to make the game think all weapon delays are zero for the purpose of reengaging?

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Remove Weapon delay

Post by TeoTwawki » Fri Jun 12, 2015 2:51 am

aventinus wrote:Is it possible to remove weapon delay to remove the delay between attacking different targets? MNKs have to wait forever between targets. Or is it possible to make the game think all weapon delays are zero for the purpose of reengaging?
It can be done but its a very bad idea unless your goal is to give all jobs and all weapons an attacks speed that makes hundred fists look slow.

Reducing engage delay to around 80% is much safer and is enough to almost entirely be rid of that annoying "you must wait" message. If you search the forums for "engage delay" you'll find posts talking about how to do that.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

aventinus
Posts: 13
Joined: Sat Sep 08, 2012 8:48 pm

Re: Remove Weapon delay

Post by aventinus » Fri Jun 12, 2015 3:03 am

I have seen posts about this but I do not see how to do it.

For instance, posts mention line 304 in src/map/ai/ai_char_normal.cpp. However, it does not say 'what' to change that effects delay. I have tried several times and recompiled but nothing made any difference.

Like changing any part of 304: if (m_Tick > m_LastMeleeTime + m_PChar->m_Weapons[SLOT_MAIN]->getDelay()) either breaks it or makes no difference.

Also, changing any part of 316: m_LastMeleeTime = m_Tick - m_PChar->m_Weapons[SLOT_MAIN]->getDelay() + 1500; either breaks it or makes no difference in delay.

Basically what i want to achieve is to be able to go from target to target without having to wait forever. Without increasing attack speed.

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Remove Weapon delay

Post by TeoTwawki » Fri Jun 12, 2015 9:13 am

Code: Select all

m_LastMeleeTime
This is how long ago your last attack round was

Code: Select all

getDelay
This is your weapons delay rating

Code: Select all

1500
This is 1500 ms


Code you are seeing adds combinations of these values up to decide when your next engage is allowed to happen, and in another spot when your next attack round will be. Do math unto it.

I really cannot explain how to alter it better than this. It's not programming voodoo, it's just math. The same keys you would use for the window calculator app are what you'd use here. /2 or *0.5 would cut a number in half. Enclosing 2 or more values in parenthesis let you treat them as one value: (2+6)/2 results in 4. Which if you are messing with C++ code you should be aware of already or at least reading up on.

Edited for typos/grammer.
Last edited by TeoTwawki on Fri Jun 12, 2015 10:58 am, edited 1 time in total.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

aventinus
Posts: 13
Joined: Sat Sep 08, 2012 8:48 pm

Re: Remove Weapon delay

Post by aventinus » Fri Jun 12, 2015 9:47 am

Thank You Teo. I just needed it explained in a way I understood. Thanks again.

Post Reply