Unlimited party, improved damage formula, better healing system, comprehensive highlighting and more.
Post Reply
Cyrus
Posts: 59
Joined: Tue Nov 20, 2018 12:34 pm

Knockback not working correctly

Post by Cyrus » Mon Nov 09, 2020 3:28 am

Today I was testing knockback and noticed that despite me setting max_knockback value to -1 in fo2tweaks.ini nothing was causing knockback. I did a bunch of test, but finally I decided to completely remove fo2tweaks.dat from the mods folder. Suddenly the problem was fixed.


I looked at the code. On line 14 of gl_g_knockback.ssl it says:

    if max_knockback then begin
      register_hook_proc(HOOK_COMBATDAMAGE, combat_damage_hook);
      ndebug("initialized");
    end



Seems like -1 is considered a TRUE value and therefore the hook is being registered and -1 is being passed as maximum knockback, which disables all knockback.

You need to write the check different. Ex:

if max_knockback > -1 then...



 

Cyrus
Posts: 59
Joined: Tue Nov 20, 2018 12:34 pm

Re: Knockback not working correctly

Post by Cyrus » Mon Nov 09, 2020 3:47 am

I just set max_knockback to 10, and its still not working.

There seems to be some other problem as well.

Anyway, the script seems to be stuck on 0 knockback. needs fixin.


To test just give your character some extra melee damage and start swinging. No knockback

Cyrus
Posts: 59
Joined: Tue Nov 20, 2018 12:34 pm

Re: Knockback not working correctly

Post by Cyrus » Mon Nov 09, 2020 3:52 am

Ok the problem is

fo2tweaks_setting(sec_main, set_max_knockback)

The actual setting is called max_knockback, not set_max_knockback.


***** EDIT

NOPE. That's not fixed it either. I don't know where the problem comes from but when I removed the scripts dat everything starts to work.

 

User avatar
Magus
Site Admin
Posts: 281
Joined: Mon Nov 21, 2016 9:13 am
Contact:

Re: Knockback not working correctly

Post by Magus » Mon Nov 09, 2020 4:41 am

do you have a save?
(also, fo2tweaks.ini and debug.log)
Please do not PM or email me about my mods and projects. Use forums. Also, see our talk channels.

Cyrus
Posts: 59
Joined: Tue Nov 20, 2018 12:34 pm

Re: Knockback not working correctly

Post by Cyrus » Mon Nov 09, 2020 6:17 am

Its the same save I posted last time. But here it is again. I didn't provide any more data because honestly there was nothing special to report on. I am using

V12.2 with sfall 4.2.8.1 with RPU16.

I tried increasing weapon damages, then I tried increasing melee, then I tried giving extra hth bonus perks. All the same.

When the script fottweaks.dat is present, knockback doesn't work. I did not isolate scripts one at a time, difficult with being packed in dat.

I turn all features fo2tweak features off except for inventory size. Changing ini settings didn't help. Only when I remove the dat file it gets fix.

I think the script is loading the wrong value somehow, but I cant say. Just try any weapon on unarmed and do more than 10 damage. Where there should be knockback there isn't any.

Have you tried this on your rig? does it work for you at all? Cause it doesnt work for me at all.

 
Attachments
ini log.zip
(6.05 KiB) Downloaded 18 times
SLOT06.zip
(1.7 MiB) Downloaded 11 times

User avatar
Magus
Site Admin
Posts: 281
Joined: Mon Nov 21, 2016 9:13 am
Contact:

Re: Knockback not working correctly

Post by Magus » Mon Nov 09, 2020 7:08 am

OK, I found and fixed the issues.
One, as you noted, is a wrong setting check, the other was re-declaring a var.
I didn't notice it because I usually play with knockback disabled.

A new release is pushed.

(And for the future reference, you can disable scripts in dats surgically by creating empty files with the same names in "data/scripts").
Please do not PM or email me about my mods and projects. Use forums. Also, see our talk channels.

Cyrus
Posts: 59
Joined: Tue Nov 20, 2018 12:34 pm

Re: Knockback not working correctly

Post by Cyrus » Mon Nov 09, 2020 7:40 am

Magus wrote:
Mon Nov 09, 2020 7:08 am
I didn't notice it because I usually play with knockback disabled.

😏 I figured.
 
Magus wrote:
Mon Nov 09, 2020 7:08 am
creating empty files with the same names in "data/scriptos"

oh that's right. Only if all the tricks would stick to memory.

Post Reply