Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Starving from lack of food

Author
Message
chorelan
13
Years of Service
User Offline
Joined: 9th Dec 2010
Location: trolling in a forum near you!
Posted: 16th Jan 2011 15:39
Ok the description tells it all. is there any way to to make it so if i dont eat or drink anything for too long i die? heres wat i think i have to put in a triggor zone or do-nothing entity

....oh yea i suck at scripting. well i do realize it'll require a timer (two one to count down till next hungerpains, two for pain to hit while im hungry.)

i just dont understand globa variables enough, if you can write a script and explain it i will be very



bhawkgames.blogspot.org
Ched80
13
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 16th Jan 2011 18:27
I think this should be reasonably easy to do using global variables.

I'll have a go and post the script soonish.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
Ched80
13
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 16th Jan 2011 20:14
Try this as the MAIN script of a random entity like a blood splat:


And try this as the MAIN script for your drink entity:



Make sure you set the blood splat as a dynamic entity or it won't work.

You'll also need to modify it to get the balancing your want between rate of thirst and how long a drink keeps you alive for.

If you need anything explained let me know.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
chorelan
13
Years of Service
User Offline
Joined: 9th Dec 2010
Location: trolling in a forum near you!
Posted: 17th Jan 2011 00:19
thx man u kick ass

bhawkgames.blogspot.org
chorelan
13
Years of Service
User Offline
Joined: 9th Dec 2010
Location: trolling in a forum near you!
Posted: 17th Jan 2011 00:43
uhh ok i dont get this could u explain how to make it so u get thirsty after 5 minutes, but id like to keep that damage thing u get when ur thirsty

bhawkgames.blogspot.org
Ched80
13
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 17th Jan 2011 06:45
Sure. The script is set up so that the player's drink level starts from 100 and reduces by 10 every second. This is defined in the lines:

:state=0:globalvar=1,setvar=100 - sets drink level to "100"
...
:state=1,etimergreater=1000,vargreater=9:decvar=10 - reduces drink level by 10 every 1000 ms.

To make the player thirsty after 5 minutes we need to adjust the starting drink level and/or and rate of thirst.

An easy way, would be to set the drink level to 300 (equal to 300 seconds) and change decvar=10 to decvar=1.

I spotted an error in my Drink Entity script - hudhide=0 should be hudhide=1.

These scripts can also be easily used for the hunger part. Simply change globalvar=1 to globalvar=2 and adjust the starting food level and hunger rate as explained here.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
Ched80
13
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 17th Jan 2011 06:49
One more thing, if you do go ahead with a starting level of 300 and a thirst rate of -1 every 1 s, remember to change vargreater=9 to vargreater=0, otherwise you will never get thirsty.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
chorelan
13
Years of Service
User Offline
Joined: 9th Dec 2010
Location: trolling in a forum near you!
Posted: 17th Jan 2011 23:57
ok thanks it works perfectly and i love this whole thing, but just one more thing, is there any way to show how hungry you are in say a bar, rather than a number on the screen?

bhawkgames.blogspot.org
Design Runner
13
Years of Service
User Offline
Joined: 16th Oct 2010
Location: In my own little world.
Posted: 18th Jan 2011 00:49
you need a custom animated hud
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 18th Jan 2011 03:01
I don't think an animated HUD woul dbe the best approach to making a bar.

There have been many threads made here about making health bars and whatnot, you can use the same idea from those for making your bar, just use a variable instead of info from the player's health.


The one and only,


Only those who sow the seeds of their desires will reap their benefits later.
However, I have seeds of my own to tend to. I don't have time to be someone else's watering can.

Login to post a reply

Server time is: 2024-04-28 11:01:55
Your offset time is: 2024-04-28 11:01:55