Help with Hp or Health and Export games

You must understand the Game Editor concepts, before post here.

Help with Hp or Health and Export games

Postby FlareTheDragon » Sat Jan 21, 2012 2:56 am

I'm a newbie and i'm in desperate need of help. I'm trying to make it so that I use a text actor for health. And when the player is an certain animation, He Invincible from attacks. If you can help me, put a step by step. also when I export a file to Window Excitable, nothing happens. Is I because I don't have the source code in my game?
User avatar
FlareTheDragon
 
Posts: 9
Joined: Mon Jan 16, 2012 9:15 pm
Score: 0 Give a positive score

Re: Help with Hp or Health and Export games

Postby skydereign » Sat Jan 21, 2012 8:31 am

Since you are dealing with hp, you'll need an hp variable. Now the invincibility part is only handled in the code that would lower the hp, usually a collision event.
player -> Collision with Enemy -> Script Editor
Code: Select all
if(animindex!=getAnimIndex("invincibility"))
{
    hp-=1;
}

Replace invincible with the name of the animation you want to be the invincible frame. An actor's current animation is held via an index variable called animindex. The getAnimIndex function takes an animation name and returns the index equivalent of the animation. So by comparing the two, and saying to trigger the code if they are not equal, then you have exactly what you want (dealing damage when the player is not invincible).

For the text health actor, just have a text actor (give it a font file) and have this code.
hp_disp -> Draw Actor -> Script Editor
Code: Select all
textNumber=hp;


As for your exporting problems, the most likely case is that your bin directory is messed up. Make sure the directory where your gameEditor file that you run to start gE has another directory in it called bin. If not, you'll need to redownload gE, and try using that.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Help with Hp or Health and Export games

Postby FlareTheDragon » Sat Jan 21, 2012 9:14 pm

Thanks. I was able to fix the export problem, but now whenever I play the game in game mode, The Health automaticly turns to 000 or 0000. How do I fix this.
User avatar
FlareTheDragon
 
Posts: 9
Joined: Mon Jan 16, 2012 9:15 pm
Score: 0 Give a positive score

Re: Help with Hp or Health and Export games

Postby Fojam » Sat Jan 21, 2012 9:17 pm

set a create actor event on view and change hp to whatever number you want
for example:
Code: Select all
hp=5;
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: Help with Hp or Health and Export games

Postby FlareTheDragon » Sat Jan 21, 2012 10:06 pm

Still Dosent Work
User avatar
FlareTheDragon
 
Posts: 9
Joined: Mon Jan 16, 2012 9:15 pm
Score: 0 Give a positive score

Re: Help with Hp or Health and Export games

Postby Fojam » Sat Jan 21, 2012 10:33 pm

upload your game in a zip ill take a look
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron