certain animation do damage

Game Editor comments and discussion.

certain animation do damage

Postby Zehper48 » Thu Jun 15, 2006 2:21 pm

is there a way i can make an attacking animation do damage and not the walking jumping ect. not do damage to the enemy? :?:
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

Postby pavel329 » Thu Jun 15, 2006 2:31 pm

i already posted that twice.and still haven't got an answer.
Drugs r bad.
Mgaay?

Image
User avatar
pavel329
 
Posts: 269
Joined: Thu May 25, 2006 2:05 pm
Location: Behind you
Score: 5 Give a positive score

Postby frodo » Thu Jun 15, 2006 5:01 pm

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
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby pavel329 » Thu Jun 15, 2006 5:04 pm

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,
Drugs r bad.
Mgaay?

Image
User avatar
pavel329
 
Posts: 269
Joined: Thu May 25, 2006 2:05 pm
Location: Behind you
Score: 5 Give a positive score

Postby frodo » Thu Jun 15, 2006 5:06 pm

either one would work(I think I know what you're talking about!)
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby pavel329 » Thu Jun 15, 2006 5:08 pm

oh and where do i put the code?draw actor or create actor?
Drugs r bad.
Mgaay?

Image
User avatar
pavel329
 
Posts: 269
Joined: Thu May 25, 2006 2:05 pm
Location: Behind you
Score: 5 Give a positive score

Postby pavel329 » Thu Jun 15, 2006 5:10 pm

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?
Drugs r bad.
Mgaay?

Image
User avatar
pavel329
 
Posts: 269
Joined: Thu May 25, 2006 2:05 pm
Location: Behind you
Score: 5 Give a positive score

Postby frodo » Thu Jun 15, 2006 5:13 pm

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);
}
User avatar
frodo
 
Posts: 127
Joined: Tue Mar 21, 2006 6:53 pm
Location: universe
Score: 2 Give a positive score

Postby pavel329 » Thu Jun 15, 2006 5:28 pm

yeeeaaahhh!!!it worked!thanx.
Drugs r bad.
Mgaay?

Image
User avatar
pavel329
 
Posts: 269
Joined: Thu May 25, 2006 2:05 pm
Location: Behind you
Score: 5 Give a positive score

Postby pavel329 » Sat Jun 17, 2006 7:58 pm

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.
Drugs r bad.
Mgaay?

Image
User avatar
pavel329
 
Posts: 269
Joined: Thu May 25, 2006 2:05 pm
Location: Behind you
Score: 5 Give a positive score

Postby pavel329 » Sat May 19, 2007 11:53 pm

i input the code and it said error line 3:undeclred identifier destroy

i put the colide actors name.What now?
Drugs r bad.
Mgaay?

Image
User avatar
pavel329
 
Posts: 269
Joined: Thu May 25, 2006 2:05 pm
Location: Behind you
Score: 5 Give a positive score

Postby Rux » Sun May 27, 2007 8:10 pm

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");
}
I'm not good at coming up with signatures...
User avatar
Rux
 
Posts: 645
Joined: Sun Apr 29, 2007 9:26 pm
Location: Sitting on your moniter invisable.
Score: 35 Give a positive score

Postby Rux » Fri Jun 08, 2007 7:55 pm

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
I'm not good at coming up with signatures...
User avatar
Rux
 
Posts: 645
Joined: Sun Apr 29, 2007 9:26 pm
Location: Sitting on your moniter invisable.
Score: 35 Give a positive score

Postby Sgt. Sparky » Sun Jun 10, 2007 3:32 pm

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
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby pixelpoop » Sun Jun 10, 2007 7:30 pm

if(key[KEY_RIGHT] == 2) ????????

is this right Sgt Sparky?

not
if(key[KEY_RIGHT] == 1) ?????
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Next

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron