Page 1 of 1

What script is used for healing character?

PostPosted: 21 Oct 2015, 07:01
by LiamM32
I have started looking into this game again recently. Although I haven't used Lua before (and little experience programming in general), I have been figuring out how things work by looking over the Lua scripts. I'm playing around with modifying the game.

I'm trying to figure out which script causes the health to gradually increase until reaching maximum. I assume that mana/willpower would work the same way. Could someone please tell me which script causes this?

I want to try making another variable for hunger, but it will be connected to healing. Maybe stamina as well. I also want to make factors that effect the healing speed. If it works well, then I could offer it for the official repository of the game.

Re: What script is used for healing character?

PostPosted: 25 Sep 2016, 15:40
by xenodora
The script you're interested in is:
{l Code}: {l Select All Code}
data/lipsofsuna/core/server/stats.lua
which is a Lua class for a creature's stats.

By default, the Stats.new() constructor creates a health and willpower stat, both with a 20 max and a regeneration rate of 0.5 per second.

The actual regeneration happens in Stats.update()

From a cursory inspection, I can't see any examples of the regen rate being modified, so overriding it may require new features.