attck animation

Talk about making games.

attck animation

Postby deek » Tue Jan 02, 2007 4:21 am

how would you code an actor so a certin animation does a certin amount of damage
deek
 
Posts: 48
Joined: Wed Dec 20, 2006 6:52 am
Score: 0 Give a positive score

Postby Troodon » Tue Jan 02, 2007 12:06 pm

Check animpos or animation and use a variable.

if(the checked thing)
{
AttackVar = your amount
}
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby deek » Wed Jan 03, 2007 5:03 am

i dont get it
deek
 
Posts: 48
Joined: Wed Dec 20, 2006 6:52 am
Score: 0 Give a positive score

Postby Troodon » Wed Jan 03, 2007 9:34 am

Sorry, I'll try to explain better.
Write in draw actor -> script editor:
Code: Select all
if (animindex == 0)
{
//your effect
}

if (animindex == 1)
{
//your effect for 2nd animation
}


The first animation's index is 0, 2nd 1, 3rd 2 etc.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby deek » Thu Jan 04, 2007 2:06 am

Hmmmm....
I couldnt ge it to work, but this is what i got so far

Code:

if (animindex == 0)
{
//NGoku_HealthBar.animpos+=2;
DestroyActor("Collide Actor");
if(NGoku_HealthBar.animpos>9)
{
DestroyActor("Event Actor");
CreateActor("Explosion", "Explosion_01", "(none)", "(none)", 0, 0, false);
DestroyActor("NGkou_HealthBar");
}









}

if (animindex == 1)
{
//NGkou_HealthBar.animpos+=2;
DestroyActor("Collide Actor");
if(NGoku_HealthBar.animpos>9)
{
DestroyActor("Event Actor");
CreateActor("Explosion", "Explosion_01", "(none)", "(none)", 0, 0, false);
DestroyActor("NGkou_HealthBar");
}
deek
 
Posts: 48
Joined: Wed Dec 20, 2006 6:52 am
Score: 0 Give a positive score

Postby Troodon » Thu Jan 04, 2007 8:50 pm

Hmm...I'm now writing in a hurry, but I found some strange things in the code:
Code: Select all

if (animindex == 0)
{
NGoku_HealthBar.animpos+=2;     //it was marked as comment
DestroyActor("Collide Actor");
}      //this was missing
if(NGoku_HealthBar.animpos>9)
{
    DestroyActor("Event Actor");
    CreateActor("Explosion", "Explosion_01", "(none)", "(none)", 0, 0, false);
    DestroyActor("NGkou_HealthBar");
}

}

if (animindex == 1)
{
NGkou_HealthBar.animpos+=2;    //was again marked as comment
DestroyActor("Collide Actor");
}           //this was missing
if(NGoku_HealthBar.animpos>9)
{
    DestroyActor("Event Actor");
    CreateActor("Explosion", "Explosion_01", "(none)", "(none)", 0, 0, false);
    DestroyActor("NGkou_HealthBar");
}
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby deek » Fri Jan 05, 2007 3:56 pm

" //was again marked as comment "

what does that mean
deek
 
Posts: 48
Joined: Wed Dec 20, 2006 6:52 am
Score: 0 Give a positive score

Postby Troodon » Fri Jan 05, 2007 4:01 pm

I mean that when you add
//
in front of your script, it makes it a comment and GE is not reading it.
You had two code lines with //in front so I wrote in the first one
"marked as comment"
and in the 2nd one "marked again as comment".

:)
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby deek » Fri Jan 05, 2007 7:59 pm

ok
deek
 
Posts: 48
Joined: Wed Dec 20, 2006 6:52 am
Score: 0 Give a positive score

Postby deek » Fri Jan 05, 2007 8:08 pm

thanks anyway

but i still couldnt get it to work
deek
 
Posts: 48
Joined: Wed Dec 20, 2006 6:52 am
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest