[DiscordArchive] Thank you for the info Foe.
[DiscordArchive] Thank you for the info Foe.
Archived author: Sylian • Posted: 2024-05-18T16:19:32.822000+00:00
Original source
Thank you for the info Foe.
Just got a question.
So in LUA I can set the value of stats via the SetUInt32Value, and that shows up in the character window like you also said it would.
Then if I call the Update Allstats function, it resets it back to the old value.
How can that be? In the UpdateAllStats function it does a loop where it first gets a stats value and then sets it again.
So shouldn't it work when I set that stat via LUA and then update?
Archived author: Sylian • Posted: 2024-05-18T16:22:34.342000+00:00
Original source
Or would it be better to just make it a module and call the function "SetStats" inside the C++ code in my core?
Archived author: Rymercyble • Posted: 2024-05-18T16:25:14.402000+00:00
Original source
i would assume update will reevaluate everything and therefore ur change means nothing bcs core data didnt change and result is same as it was before ur change
Archived author: Sylian • Posted: 2024-05-18T16:26:16.753000+00:00
Original source
Yeah, I kind of assumed it might be just client side it changes.
Archived author: Rymercyble • Posted: 2024-05-18T16:26:56.518000+00:00
Original source
if u want to change how stats are calculated u need either hook which is part of that calculation (i dont think there are any right now) or change core
Archived author: Sylian • Posted: 2024-05-18T16:28:25.127000+00:00
Original source
I am already hooking the function that does the update of all stats and also calculates everything again.
There is a function called "SetStat" where you put the stat into it, but how would the performance be if I made so I could call the function via LUA compared to just making it a module that does it.
Archived author: Foe • Posted: 2024-05-18T16:33:34.326000+00:00
Original source
The core evaluates how many stats you have from different things, like buffs and items, adds them together and calculate all the other things like secondaries
Archived author: Foe • Posted: 2024-05-18T16:34:15.413000+00:00
Original source
You need your own path in there to add your custom stats to the pool of stats from items etc before all the calculations are done and the unit values are written
![[Image: image.png?ex=690c25d6&is=690ad456&hm=332...1ff1930f7&]](https://cdn.discordapp.com/attachments/284323424032129024/1241429253380112404/image.png?ex=690c25d6&is=690ad456&hm=33228321ac94cf2b9577206400ccede5fd2dcc9e0bcb1feb464c2e31ff1930f7&)
Archived author: Sylian • Posted: 2024-05-18T16:36:38.697000+00:00
Original source
So this function wont be enough to do it?
I thought this might be enough because it updates everything in one function
![[Image: image.png?ex=690c25d6&is=690ad456&hm=332...1ff1930f7&]](https://cdn.discordapp.com/attachments/284323424032129024/1241429253380112404/image.png?ex=690c25d6&is=690ad456&hm=33228321ac94cf2b9577206400ccede5fd2dcc9e0bcb1feb464c2e31ff1930f7&)
Archived author: Foe • Posted: 2024-05-18T16:37:26.891000+00:00
Original source
Possibly, but you need to add your stats somewhere