HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Depleting Health, restoring Health & poisoning

View previous topic View next topic Go down 
AuthorMessage
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 22
Location : Australia

PostSubject: Depleting Health, restoring Health & poisoning   Tue Dec 17, 2013 10:23 am

Is there a way to set a trigger that restores the character's health without using cures? e.g. you perform a different action, emote, you stand somewhere specific, you click on something (like a health potion) etc.

Also,
is there a way to set a timer that slowly depletes or restores your health, for example you lose/gain 5 points health every 5 minutes

Aaaaand, separately, a way to "poison" characters where it slowly depletes health for a specific time; e.g. 25 points damage to health per second for 7 seconds (or until an "Anti-Poison" skill is used, or death) after being attacked by a poisonous creature or swimming in toxic water.

if there is, could you possibly point me in the right direction?

I'm trying to create a separate Hunger bar which slowly increases (from 0 to 100) over time and allow the character to 'feed' on certain prey to reduce the hunger bar or the character starts losing health and dies, but apart from duplicating the health bar and mucking around with numbers I am not sure where to go.
Back to top Go down
Worthis
Coder
Coder
avatar

Game username : Worthis
Server : Impressive Space
Male Posts : 157
Join date : 2012-09-29
Age : 28
Location : Russian Federation

PostSubject: Re: Depleting Health, restoring Health & poisoning   Tue Dec 17, 2013 10:33 am

you can add a variable for timer, add some code to any update function
(for example MagixPlayer.h - void update(const FrameEvent &evt, MagixExternalDefinitions *def, const Quaternion &camOrientation=Quaternion::ZERO))

add variable to the MagixPlayer class:
float hpchangetimer;

in the update funtion:

hpchangetimer -= evt.timeSinceLastFrame;
if(hpchangetimer < 0)
{
hpchangetimer = 5;  // your time
hp -= 5; // your hp change factor;
}
Back to top Go down
http://cl001.dc.stnetix.com
Dead Stars

avatar

Game username : DyingStar
Server : Dragon heart and Dragon heart 2 (being made)
Female Posts : 292
Join date : 2013-01-30
Age : 19
Location : Knoxville, TN

PostSubject: Re: Depleting Health, restoring Health & poisoning   Tue Dec 17, 2013 9:14 pm

Wow, I want to know how to add hunger too!
Back to top Go down
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 22
Location : Australia

PostSubject: Re: Depleting Health, restoring Health & poisoning   Thu Jan 09, 2014 11:06 am

Worthis wrote:
you can add a variable for timer, add some code to any update function
(for example MagixPlayer.h - void update(const FrameEvent &evt, MagixExternalDefinitions *def, const Quaternion &camOrientation=Quaternion::ZERO))

add variable to the MagixPlayer class:
float hpchangetimer;

in the update funtion:

hpchangetimer -= evt.timeSinceLastFrame;
if(hpchangetimer < 0)
{
hpchangetimer = 5;  // your time
hp -= 5; // your hp change factor;
}

I never thanked you properly Worthis,
it works, thank you Very Happy
Back to top Go down
Sponsored content




PostSubject: Re: Depleting Health, restoring Health & poisoning   

Back to top Go down
 
Depleting Health, restoring Health & poisoning
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: DOWNLOADABLE CONTENT :: Programming Features-
Jump to: