Page 1 of 2

certain animation do damage

PostPosted: Thu Jun 15, 2006 2:21 pm
by Zehper48
is there a way i can make an attacking animation do damage and not the walking jumping ect. not do damage to the enemy? :?:

PostPosted: Thu Jun 15, 2006 2:31 pm
by pavel329
i already posted that twice.and still haven't got an answer.

PostPosted: Thu Jun 15, 2006 5:01 pm
by frodo
do this:

Code: Select all
if ( animindex == getAnimIndex("fight animation") )
{
     your actions here;
}


sorry, pavel329 that you didn't get an answer.
replace "fight animation" with the name of your fighting animation

PostPosted: Thu Jun 15, 2006 5:04 pm
by pavel329
ah it's ok.i got it now though thanx.but in the part where it says put action wat exactly do i put there?do i put "collission on any side of actor enemy destroy actor enemy"?or do i put collision,enemy,destroy actor,enemy,

PostPosted: Thu Jun 15, 2006 5:06 pm
by frodo
either one would work(I think I know what you're talking about!)

PostPosted: Thu Jun 15, 2006 5:08 pm
by pavel329
oh and where do i put the code?draw actor or create actor?

PostPosted: Thu Jun 15, 2006 5:10 pm
by pavel329
i was talking about the part where you said place actions.wat do i put if i want that one animation to destroy an actor enemy if it collides with him?

PostPosted: Thu Jun 15, 2006 5:13 pm
by frodo
on you player actor do collision on any side of enemy and do this code:

Code: Select all
if ( animindex == getAnimIndex("fight animation") )
{
     destroy actor(collide actor);
}

PostPosted: Thu Jun 15, 2006 5:28 pm
by pavel329
yeeeaaahhh!!!it worked!thanx.

PostPosted: Sat Jun 17, 2006 7:58 pm
by pavel329
how do i use key down function in script editor?wat i'm trying to do is make it where mario only jumps left if i'm facing or running left.or vice versa.

PostPosted: Sat May 19, 2007 11:53 pm
by pavel329
i input the code and it said error line 3:undeclred identifier destroy

i put the colide actors name.What now?

PostPosted: Sun May 27, 2007 8:10 pm
by Rux
If you copied the script, from Frodo's example then the problem is there is no space in destroyactor, this is what it should look like.
Code: Select all
DestroyActor("Collide Actor");

And so the whole code looks like this,
Code: Select all
if ( animindex == getAnimIndex("fight animation"))
{
     DestroyActor("Collide Actor");
}

PostPosted: Fri Jun 08, 2007 7:55 pm
by Rux
I think this is how to do the key down function.

Code: Select all
 char* key=GetKeyState();
if(key[KEY_(YOUR KEY)])
{
     (Your Action);
}


Replace: YOUR KEY with the key of your choice in caps only.
Replace: Your Action with the action you want to happen.

Hope this helps. :D

PostPosted: Sun Jun 10, 2007 3:32 pm
by Sgt. Sparky
pavel329 wrote:how do i use key down function in script editor?wat i'm trying to do is make it where mario only jumps left if i'm facing or running left.or vice versa.

key down event of your jump key:
Code: Select all
char*key=GetKeyState();
if(key[KEY_LEFT] == 1)
{
    YOUR CODE HERE.;
}
if(key[KEY_RIGHT] == 2)
{
    YOUR CODE HERE.;
}

:D

PostPosted: Sun Jun 10, 2007 7:30 pm
by pixelpoop
if(key[KEY_RIGHT] == 2) ????????

is this right Sgt Sparky?

not
if(key[KEY_RIGHT] == 1) ?????