Attack direction.

Non-platform specific questions.

Attack direction.

Postby bubblemaster123987 » Wed Jan 05, 2011 10:42 pm

Hey everyone. I'm still new to GE so any help is appreciated.

I'm having some issues with making my attack actor face the same direction as my main actor. As stated, they are separate actors. The attack actor has two animations, one for each direction, and I was wondering if anyone could help me figure out how to get the attacking actor to face the same way as my main actor without having two separate attack buttons. Attacking is currently done with the following: Keydown: Left Alt: Destroy actor/Create Actor. That's for the main character. Then for the attacking actor it's: Animation Finish: Destroy Actor/Create Actor. But of course, the attacking actor only comes in facing one way no matter what direction the main actor is facing. Thanks to anyone who can help with this problem.

P.S. I'm also having an issue where when the attack button is pressed, it creates two actors instead of one, each facing a different direction, and then they disappear and leave two main actors. Again, any help appreciated.
bubblemaster123987
 
Posts: 15
Joined: Tue Jan 04, 2011 11:41 pm
Score: 0 Give a positive score

Re: Attack direction.

Postby AliceXIII » Wed Jan 05, 2011 11:04 pm

it would be much easier if you just added the attack animations to your main actors sprite sheet and just call that sprite sequence when the attack button is pressed it would solve this problem :P
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: Attack direction.

Postby bubblemaster123987 » Wed Jan 05, 2011 11:09 pm

If it wouldn't be a bother, do you think you could maybe post an example? 'Cause I'm not really getting how that works.
bubblemaster123987
 
Posts: 15
Joined: Tue Jan 04, 2011 11:41 pm
Score: 0 Give a positive score

Re: Attack direction.

Postby AliceXIII » Wed Jan 05, 2011 11:18 pm

well if you have it all on one sprite sheet the walking and fighting animations.

all you have to do is under actor control click the add sequence button and name it like attack right etc etc.. and just pick the frames out individually from the sprite sheet.
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: Attack direction.

Postby bubblemaster123987 » Wed Jan 05, 2011 11:23 pm

Okay, that part worked. Now how do I get it to only play that one direction when he's facing that direction standing still? Sorry for having to ask a bunch of questions, I'm just really bad at figuring stuff out.
bubblemaster123987
 
Posts: 15
Joined: Tue Jan 04, 2011 11:41 pm
Score: 0 Give a positive score

Re: Attack direction.

Postby AliceXIII » Wed Jan 05, 2011 11:27 pm

it is'nt a problem you get better by asking questions :P

but do you mean like if you were walking and stopped for his animation to stop in that direction?
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: Attack direction.

Postby bubblemaster123987 » Wed Jan 05, 2011 11:54 pm

Huh... I'd like to send a video to you to show you what's going on but GE forms aren't letting me so, to put it the most descriptive I can, I can walk and fly fine, and if I were facing right all the time, the attack would work, 'cause when I press the button that's what way the attacking sprite is facing. But, since I'm not always facing right, I need to make it so that he'll attack left or right depending on the direction of the actor before I press the button. And then also to get it so he returns to that same direction when the attack is over.
bubblemaster123987
 
Posts: 15
Joined: Tue Jan 04, 2011 11:41 pm
Score: 0 Give a positive score

Re: Attack direction.

Postby AliceXIII » Thu Jan 06, 2011 12:30 am

instead of posting a video we post .ged files of the current project.

but all you have to do to get him to attack in the direction you want if he's facing that direction is in the key down event for the attack you can make a script and say:
Code: Select all
if(getAnimIndex("left or right animation")
{
   ChangeAnimation("character", "battle animation", Forward or Backwards, Stopped or None);
}


and just do this for all your differnt directions should work.

and also to get the actor back to the animation of standing still in that direction after attacking
just put this after the last bracket of the if statement:
Code: Select all
ChangeAnimation("character", "the idle left or right animation", forward or backwards, stopped or none)
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: Attack direction.

Postby bubblemaster123987 » Thu Jan 06, 2011 12:56 am

Code: Select all
if(getAnimIndex ("StillRight")
{
    ChangeAnimation ("Player", "AttackRight", Forward);
}




Now I'm not sure if I got any of this right, but I just kinda, filled in what looked like it was supposed to be changed. StillRight is the name of the standing file, Player, the name of the actor, and AttackRight, the name of the attacking sequence, and I'm not sure if Forward there is right or not, so feel free to correct of course.
bubblemaster123987
 
Posts: 15
Joined: Tue Jan 04, 2011 11:41 pm
Score: 0 Give a positive score

Re: Attack direction.

Postby AliceXIII » Thu Jan 06, 2011 1:05 am

it all looks correct :D

the forward and backwards is for if your facing that way but you could put none there if you wanted to.
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: Attack direction.

Postby bubblemaster123987 » Thu Jan 06, 2011 1:12 am

Hm. Odd, it's still not working. I put in the code, and it says that there are two errors. Error line 3: Expected (, and Error line 5 (Which is odd 'cause there is no line 5 yet) Expected ;.
bubblemaster123987
 
Posts: 15
Joined: Tue Jan 04, 2011 11:41 pm
Score: 0 Give a positive score

Re: Attack direction.

Postby AliceXIII » Thu Jan 06, 2011 1:20 am

considers any line that was any symbol on it a full line so it considers the single brackets { a line.

but that means that you forgot to put this ( at the end of change animation and forgot a ; at the end of the change animation function.

should work if you correct those.
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: Attack direction.

Postby bubblemaster123987 » Thu Jan 06, 2011 1:24 am

I can't say I know exactly what you're talking about, so I'm going to give you the file and see if you can find the problem.
Attachments
Tail's Adventure part 1.ged
Here's just the file so you can see the problem, 'cause honestly, I have no clue what I'm doing.
(7.36 KiB) Downloaded 73 times
bubblemaster123987
 
Posts: 15
Joined: Tue Jan 04, 2011 11:41 pm
Score: 0 Give a positive score

Re: Attack direction.

Postby AliceXIII » Thu Jan 06, 2011 1:27 am

have to post the dat folder to the one that has the images your using or i cant see what your doing :P
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: Attack direction.

Postby bubblemaster123987 » Thu Jan 06, 2011 1:29 am

Do you think you might be able to tell me how to get to that particular file/image?
bubblemaster123987
 
Posts: 15
Joined: Tue Jan 04, 2011 11:41 pm
Score: 0 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest