[DiscordArchive] So do you think it would be fine enough to just add to it right after that has been called?
[DiscordArchive] So do you think it would be fine enough to just add to it right after that has been called?
Archived author: Sylian • Posted: 2024-05-18T16:59:18.604000+00:00
Original source
So do you think it would be fine enough to just add to it right after that has been called?
Archived author: Sylian • Posted: 2024-05-18T16:59:27.245000+00:00
Original source
Like the first part where it sets it?
Archived author: Sylian • Posted: 2024-05-18T16:59:52.920000+00:00
Original source
Then I add my own function and it calls that, where I them do the loop with the stats I would want to add.
Archived author: Foe • Posted: 2024-05-18T17:00:02.853000+00:00
Original source
You want to hook that function, or the subsequent functions, to add your own stats to the total stat pool being set by SetStat
Archived author: Sylian • Posted: 2024-05-18T17:04:10.638000+00:00
Original source
So that would require me to create a module right? Or am I able to do something where I can make it work in LUA?
Archived author: Foe • Posted: 2024-05-18T17:07:05.588000+00:00
Original source
You can do it in Lua, just hook GetTotalStatValue (or in between that function call and SetStat), send the stat value and stat type to the hook, then allow a return value to override the stat before SetStat is called
Archived author: Sylian • Posted: 2024-05-18T17:08:43.842000+00:00
Original source
Is performance a problem if I choose to do it via LUA or would that be the same as a new module?
Also, you got any guide for how to do such hooking?
Archived author: Sylian • Posted: 2024-05-18T17:09:03.893000+00:00
Original source
I am looking around and finding some where its in a module
Archived author: Foe • Posted: 2024-05-18T17:11:05.135000+00:00
Original source
Same way you're doing a hook now, just with a return value. Yes, writing the whole system in Lua is going to be slower than C++, whether it matters or not is impossible to say before it actually becomes a problem, and that's when you refactor
Archived author: Rymercyble • Posted: 2024-05-18T17:11:36.408000+00:00
Original source
but also like if u plan to have 10 players u dont need to care