Step By Step Health Scripting

Non-platform specific questions.

Step By Step Health Scripting

Postby gamloth » Tue Aug 26, 2008 9:01 pm

Help With Health Scripting with a player
Well Heres what my game is.
I have a "Character" that i can't get him to die i build the health actor put a set health by variable = variable terms
but i can't get him to die at 0 health.
is that better...
Last edited by gamloth on Wed Aug 27, 2008 6:36 pm, edited 1 time in total.
Gamloth
gamloth
 
Posts: 1
Joined: Fri Feb 22, 2008 2:09 am
Location: New York
Score: 0 Give a positive score

Re: Step By Step Health Scripting

Postby BlarghNRawr » Wed Aug 27, 2008 2:26 am

what type of health scripting...
more info plz
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Step By Step Health Scripting

Postby Bee-Ant » Thu Aug 28, 2008 12:46 pm

make the healthbar actor use the sprite like this
healthbar.PNG
healthbar.PNG (491 Bytes) Viewed 748 times

make a global variable called "hp"
...
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Step By Step Health Scripting

Postby tlah » Thu Sep 04, 2008 8:45 pm

Bee-Ant wrote:make the healthbar actor use the sprite like this
healthbar.PNG

make a global variable called "hp"
...

alright, try making each bar a separate picture in microsoft paint or whatever. next create an actor called "hp" or what you want the hitpoints to be called. go to your main character's actor control, add a create actor, go to script editor. add this code:
Code: Select all
int hp = 7;
go add a collision with your enemy or whatever hurts your character. in collision,change the animation of the hp bar to one hp less. then in a collision (same factors), go to script editor. type:
Code: Select all
hp = hp - 1;
if(hp = 0)
{
     (replace withwhatever you want to happen);
     (replace with whatever you want to happen [takes at least 2 lines]);
}
User avatar
tlah
 
Posts: 66
Joined: Sun Apr 06, 2008 12:10 pm
Location: In your head, readin' ur mind
Score: 2 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron