Page 1 of 1
health drain
Posted: Wed Apr 20, 2016 12:13 am
by ZombieMooose
I have an idea for a mod, and I'm having trouble figuring it out. I want a slow, constant health drain on the player (multiplayer friendly) that takes about an hour to fully drain your health. Or possibly override the automatic health gain after taking damage. Or better yet both.
I looked at the mod called Stamina, and I can't figure it out. I'm such a newb.
Anyway any help would be great, I have an idea for a small mod based on this mechanic.
Thanks for any help you can give.
Re: health drain
Posted: Wed Apr 20, 2016 12:34 am
by Adil
I believe you can even put negative regeneration in prototype definition.
Re: health drain
Posted: Wed Apr 20, 2016 12:42 am
by ZombieMooose
Adil wrote:I believe you can even put negative regeneration in prototype definition.
I found a lua/entityprototype called healing_per_tick that does it, but it requires you to take damage first. How do I set this up to start automatically at game start? maybe add an activation item that damages you for 1 health?
To be honest this seems easier than I thought lol
Re: health drain
Posted: Wed Apr 20, 2016 7:49 am
by prg
You can cause damage to an entity with
entity.damage().
Re: health drain
Posted: Sun Apr 24, 2016 10:21 pm
by ZombieMooose
so would I create some event that started whenever the players health was full and then cause a health drain?
how would I do that?
Re: health drain
Posted: Sun Apr 24, 2016 10:56 pm
by ZombieMooose
okay I found the on tick thing, which should work for what I'm doing - just set a number of ticks and such but as I said I'm new to coding so where would I go to find out how this looks?
Re: health drain
Posted: Mon Apr 25, 2016 1:23 pm
by Adil
diongham wrote:okay I found the on tick thing, which should work for what I'm doing - just set a number of ticks and such but as I said I'm new to coding so where would I go to find out how this looks?
How what looks?
I would giuess my signatures and modding guides. Would be a nice place to start. Also Klonan does some simple
mods which are great learning exmples.