#Bonus

1 messages · Page 1 of 1 (latest)

twilit oak
#

CDOTA_BaseNPC Server
C_DOTA_BaseNPC Client
Add your custom method to any client file

old oriole
#

Also, health is calculated when:

  • Unit takes damage
  • Unit stats change
  • Unit gains or loses a modifier.

If you want to force a stat calculation, you can call CalculateGenericBonuses() on your unit.

twilit oak
#

addon_game_mode.lua

#

create any file and include it in IsClient conditional

#

also you can do it in addon_init.lua

#

did you remove IsServer condition into C_DOTA_BaseNPC :GetBlessCount()?

#

no, has modifier works on both side

twilit oak
#

add some print to client file to make sure it is included

fickle pelican
# twilit oak check again

before this, in console: attempt to index a nil value. Now: attempt to call method 'GetBlessCount' (a nil value).

twilit oak
#

define GetBlessCount on client

fickle pelican
#

I found out what the problem is in GetSpecialValue, I wrote a regular number and everything works kinda like

twilit oak
#

make prints at every step, this is the only way to debug

old oriole
# fickle pelican i did so in Require, as you said

Just requiring is not enough. You need to make sure clients (players) are aware of this value.

I suggest doing something entirely different from what @twilit oak is suggesting - use stacks. Stacks is the number inside the modifier that you see in a lot of modifiers that Valve use.

When you get a modifier, set its stack count (SetStackCount()) to be equal to the blessings count. When a new blessing is given, increment the count using IncrementStackCount() for all modifiers that utilize blessings.

Then, replace the GetBlessingCount() to GetStackCount() and it should work. No need for IsServer() checks as well.

The reason it works is that stacks are automatically sent to all clients when they are set on the server.