Home   Help Search Login Register  

Author Topic: Health system for a Role playing game help  (Read 807 times)

0 Members and 1 Guest are viewing this topic.

DARMARUS

  • Guest
Health system for a Role playing game help
« on: 12 Jan 2003, 03:47:43 »
Hi all i need some help

Im making a mission were u are stranded and u have to hunt and fish to survive but any way. each hour or so i need  small incriment of health to disapeer so if u dont get or find food u just die. And if u get food or etc it adds to your "health pool"
Now ill i need to know is how to set this up. Any help would be greatly appreciated. and ur name would defenatly be in the mission

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Health system for a Role playing game help
« Reply #1 on: 14 Jan 2003, 18:13:41 »
1) To reduce health of a player


You can setdamage 0.1, so create a looping timedelay script that increases setdamage for every cycle
setdamage1 is death

use this to create timedelay
~10 =wait 10 seconds
~120 =wait 2 minutes

You would also have to declare a variable
We shall call it health
eg health=0

make it executed by the init.sqs using an array for every player you want affecting by it
------------------------------------------------------------------------------------
place this line in the init sqs

[] exec "posion.sqs";
---------------------------------------------------------------------------------
create an array
mylist={w1,w2,w3,w4,w5,w6}
and the script itself

health = 0
#start
;following reduces health to all players in your array
[mylist] thislist setdamage health

;following causes script to wait 2 minutes
~120

;following increases variable "health" by 0.1
health=health + 0.1
goto start

;end
-----------------------------------------------------------------------------------------------------------------------------
syntax and actual lines not correct  but something like that
I'm sure one of the scripters here could sort this out for ya :)
(I aint as those who know what they are talking about can tell, even a novice scripter)
---------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------

2) To increase a players health

a) Create a trigger that setdamage 0  

b) or have it activate a script that reduces the setdamage by 0.1
or however much is appropriate
You would have to make "health" a global variable for this to work
and create a global array also






« Last Edit: 15 Jan 2003, 10:19:18 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123