-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nwnx_creature #1792
Comments
Example of one of the scripts I wrote to fix monk speed.
|
Barbarian speed fix...
|
While doing all this I also realized that the vanilla NWN monk speed is completely bugged at level 15 monk. It doesn't apply the correct movement speed. Also, when you use a haste item with barbarian, and then remove the haste item, the barbarian speed isn't retained where it should be at 1.1 without haste. |
Unfortunately, none of the above fixes work when a vanilla speed increase/decrease occurs from encumberance, haste, slow, grease, acid fog, or any other thing effecting speed in the base game. I was literally in the process of rewriting everything but it's pointless when you can't do anything about encumberance. I was about to redo everything including called shot leg. |
NWNX_Creature_SetMovementRateFactorCap causes lots of bugs to happen. |
I even re-wrote the vanilla nwn haste property.
|
Am I just using these wrong? Is there a better way to do all this without running into problems? It's so bugged in so many ways that it begs the question what is this even used for? |
Need a way to replace the base games movement speed decrease with an event that uses the nwnx_creature functions to reduce the speed instead. Either that or encumbrance events are needed like ENCUMBERED_BEFORE and NOT_ENCUMBERED_AFTER. |
Does anybody know what LimitMovementSpeed = 59 is?? I was hoping it was for encumber but it's not. https://github.com/nwnxee/unified/blob/master/NWNXLib/API/Constants/Effect.hpp#L8 | |
I incorrectly stated that the vanilla NWN stuff with movement speed is bugged. It's only bugged when you increase the movement rate cap with the nwnx_creature function, NWNX_Creature_SetMovementRateFactorCap(oPC, 3.0); I thought it was vanilla NWN because I forgot to remove the cap increase. |
It would probably be simpler for you to hook GetMovementRateFactor and do your own thing there and not modify what the game thinks Here is an example in Lua from an older project: local Hook = require 'solstice.hooks'
local ffi = require 'ffi'
local C = ffi.C
local max = math.max
-- CNWSCreature::GetMovementRateFactor(void) 0x08123FD8
local Orig_GetMovementRateFactor
local function Hook_GetMovementRateFactor(obj)
local cre = Game.GetObjectByID(obj.obj.obj_id)
if cre:GetType() == OBJECT_TYPE_CREATURE then
local mo, ba, ta = 0, 0, 0
local can, level = Rules.CanUseClassAbilities(cre, CLASS_TYPE_MONK)
if can and level > 3 then
mo = 0.2
end
if cre:GetLevelByClass(CLASS_TYPE_BARBARIAN) >= 1 then
ba = 0.1
end
ta = (cre['TA_MOVE_SPEED'] or 0) / 100 -- This is where you'd add in your custom factors, I used a local var
local mr = obj.cre_move_rate
if mr > 1.5 then mr = 1.5 end
return mr + ta + max(mo, ba)
end
return Orig_GetMovementRateFactor(cre)
end
Orig_GetMovementRateFactor = Hook.hook {
name = "GetMovementRateFactor",
func = Hook_GetMovementRateFactor,
length = 5,
address = 0x08123FD8,
type = 'double (*)(CNWSCreature *)',
} |
Hi, great work on all these functions. I really appreciate what you guys did here. I'm posting because i'm having a bit of trouble understanding how i'm supposed to be using the NWNX_Creature_SetMovementRateFactor & NWNX_Creature_GetMovementRateFactor. No matter what I do I run into a laundry list of bugs. When I use these functions with the base NWN EffectMovementSpeedIncrease it causes issues with barbarian speed & monk speed among other things. They don't work well with the vanilla NWN haste property either. I literally attempted to rewrite every spell/feat, and even the haste itemproperty to make this work before realizing that I have no way of dealing with encumbrance causing a movement speed decrease which breaks everything.
The text was updated successfully, but these errors were encountered: