1 registered members (TipmyPip),
18,633
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
c-script health system
#329153
06/18/10 04:37
06/18/10 04:37
|
Joined: Jan 2010
Posts: 145
Doc_Savage
OP
Member
|
OP
Member
Joined: Jan 2010
Posts: 145
|
i need some help, im trying to make a health system like in aum 12, but i want to make it so it dosent need templates, so i need a variable for player_health or whatever.
i know what needs to be done, but i dont know the language very well yet. i dont know how to write it out. im not asking for hand-outs. i dont want it done for me. (thats only a last resort) can someone just nudge me in the right direction? help me figure out how to write it out? or possibly another health system tutorial? if i can figure this out itd be great. it will open my eyes as to how the rest can be done.
Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
|
|
|
Re: c-script health system
[Re: Doc_Savage]
#329155
06/18/10 05:27
06/18/10 05:27
|
Joined: May 2009
Posts: 5,377 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,377
Caucasus
|
You need to use defines my friend  like this: define health, skill1; So, after that you can add health to any entity like this: my.health = 100; And my small advice for you my friend, start from LITE-C. There is no much differences between C-SCRIPT and LITE-C, but the second one works much faster and easier. 
|
|
|
Re: c-script health system
[Re: 3run]
#329162
06/18/10 07:22
06/18/10 07:22
|
Joined: Jan 2010
Posts: 145
Doc_Savage
OP
Member
|
OP
Member
Joined: Jan 2010
Posts: 145
|
defines! oh why didnt i think of that.. ok ive got that set up. now, how can i let the game know that when i say "my.health = 0" it ends the game? im guessing a function right? and also ill probably need a function to make the hud as well? hm... as for lite c, that sounds like a good way to do things, but id rather get it done in c script first, then decide whether or not to switch. only because c script is a tad easier for me to understand atm btw ur site is cool  you have msn or somthin?
Last edited by Doc_Savage; 06/18/10 07:28.
Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
|
|
|
Re: c-script health system
[Re: 3run]
#331287
07/03/10 06:34
07/03/10 06:34
|
Joined: Jan 2010
Posts: 145
Doc_Savage
OP
Member
|
OP
Member
Joined: Jan 2010
Posts: 145
|
ok i need some new help, i have some code for health working but i need a starter to set the health to 100 when i start. and i cant figure it out.. heres what i have so far:
starter set_health(){
if(hp < 100){hp = 100;}
}
"hp" is the variable for health... what am i doing wrong? i have to call the function to add or subtract health to make the health panels visible. if you understand that also, when i call the function to subtract health enough to get it to 0, it dosent exit the game, (thats what i told it to do for now), but wen i call the function to ibcrease health to over 100, it exits the game... i think somthing is backwards... if you need more help understanding anything i will tell you what you need to know, but any help would be appreciated.
Last edited by Doc_Savage; 07/03/10 06:37.
Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
|
|
|
Re: c-script health system
[Re: 3run]
#331361
07/03/10 19:01
07/03/10 19:01
|
Joined: Jan 2010
Posts: 145
Doc_Savage
OP
Member
|
OP
Member
Joined: Jan 2010
Posts: 145
|
ok i tried that, it just says "parameter unkown hp parameter, even though its defined in another script!.....wat?
Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
|
|
|
Re: c-script health system
[Re: 3run]
#331377
07/03/10 20:49
07/03/10 20:49
|
Joined: Jan 2010
Posts: 145
Doc_Savage
OP
Member
|
OP
Member
Joined: Jan 2010
Posts: 145
|
ok that works, but the hp panel for 100 is still not showing up, which means somthing else is wrong too...
Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
|
|
|
|