Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
c-script health system #329153
06/18/10 04:37
06/18/10 04:37
Joined: Jan 2010
Posts: 145
Doc_Savage Offline OP
Member
Doc_Savage  Offline 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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
You need to use defines my friend laugh 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. wink


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Member
Doc_Savage  Offline 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 laugh

btw ur site is cool laugh 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: Doc_Savage] #329335
06/19/10 05:13
06/19/10 05:13
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
About letting game know, if health equals to zero, just put in your main while loop this comparison "while(my.health > 0)", so everything in main loop will run till players health more that zero, I advice you to start from AUM, there are allot of useful snippets for you my friend. I have ICQ: 581003459 contact me if you'll need any help, or just PM me, I'll be glad to help laugh Good luck


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Member
Doc_Savage  Offline 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:

Code:
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 tongue


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: Doc_Savage] #331329
07/03/10 14:22
07/03/10 14:22
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
First, hp is a define, am I right? If it is, there needs to be my.hp or better player.hp, because your starter function doesn't has any entity pointers. But, why you need to do that any way? To set health to 100 when you start, is much easier to do like this:
action player_() // inside the player action, as I told you before
{
player = my;
my.hp = 100;
////
}


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Member
Doc_Savage  Offline 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: Doc_Savage] #331369
07/03/10 20:07
07/03/10 20:07
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
that means that you've defined it wrong!
Here how it should look like:
define hp, skill1;
And it should be right before your player action!!!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Member
Doc_Savage  Offline 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.
Re: c-script health system [Re: Doc_Savage] #331388
07/03/10 22:44
07/03/10 22:44
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
How are you trying to view the health? You use panels, do you?)


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1