Page 1 of 1

Help with Hp or Health and Export games

PostPosted: Sat Jan 21, 2012 2:56 am
by FlareTheDragon
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?

Re: Help with Hp or Health and Export games

PostPosted: Sat Jan 21, 2012 8:31 am
by skydereign
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.

Re: Help with Hp or Health and Export games

PostPosted: Sat Jan 21, 2012 9:14 pm
by FlareTheDragon
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.

Re: Help with Hp or Health and Export games

PostPosted: Sat Jan 21, 2012 9:17 pm
by Fojam
set a create actor event on view and change hp to whatever number you want
for example:
Code: Select all
hp=5;

Re: Help with Hp or Health and Export games

PostPosted: Sat Jan 21, 2012 10:06 pm
by FlareTheDragon
Still Dosent Work

Re: Help with Hp or Health and Export games

PostPosted: Sat Jan 21, 2012 10:33 pm
by Fojam
upload your game in a zip ill take a look