attck animation
Posted:
Tue Jan 02, 2007 4:21 am
by deek
how would you code an actor so a certin animation does a certin amount of damage
Posted:
Tue Jan 02, 2007 12:06 pm
by Troodon
Check animpos or animation and use a variable.
if(the checked thing)
{
AttackVar = your amount
}
Posted:
Wed Jan 03, 2007 9:34 am
by Troodon
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.
Posted:
Thu Jan 04, 2007 2:06 am
by deek
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");
}
Posted:
Thu Jan 04, 2007 8:50 pm
by Troodon
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");
}
Posted:
Fri Jan 05, 2007 3:56 pm
by deek
" //was again marked as comment "
what does that mean
Posted:
Fri Jan 05, 2007 4:01 pm
by Troodon
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".
Posted:
Fri Jan 05, 2007 8:08 pm
by deek
thanks anyway
but i still couldnt get it to work