animation script

Non-platform specific questions.

animation script

Postby Behdadsoft » Tue May 15, 2012 11:48 am

Hi. I want make a game like mortal kombat. I maked a kabal character that is some animation fo example Kick, Box , .... and I want So write script for any animation that Is the easiest way. In other words how to write a script for Each animation?
for example i want write kabal.kick=1 run kick animation and etc.Overall I need a Variable Structure.

Image
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: animation script

Postby skydereign » Tue May 15, 2012 4:22 pm

That isn't how animations work (you don't write scripts for animations). Animations are changed with the ChangeAnimation function and you can use a different variable to store what the player is doing (kicking or similar). You could even use the animindex variable to determine what the actor is doing, but I suggest creating your own variable for this. You should look into the state method, it should be able to do what you want. http://game-editor.com/State_Method
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: animation script

Postby Behdadsoft » Tue May 15, 2012 6:48 pm

Thank you for your help :D
I'll read it and asked if I was still a question. :wink:
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: animation script

Postby Fojam » Tue May 15, 2012 10:47 pm

im making a game with that sort of style (its a super smash bros) and basically the best thing to do is make a variable called attacksHolder or something, and have different numbers represent different attacks. and when the animation finishes, reset the attacksHolder variable to 0. that way, when you collide with your enemy, you can check if attacks holder is a certain number, deal x amount of damage to the enemy and make him go x distance
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: animation script

Postby Behdadsoft » Wed May 16, 2012 7:57 am

I want when once press a key run animation and when hold it repeat animation. i maked this script but don't work good.
Code: Select all
if (K_highbox==0)
{

    ChangeAnimation("Event Actor", "K_highbox", FORWARD);
    Kabal.xvelocity=0;
}
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: animation script

Postby skydereign » Wed May 16, 2012 4:54 pm

Change FORWARD to NO_CHANGE. FORWARD will constantly try to start the animation from the beginning, NO_CHANGE will let the animation continue, but it changes it to the proper animation if it isn't the same.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: animation script

Postby Behdadsoft » Wed May 16, 2012 7:47 pm

Thanx, very good. :D

for select screen : I want when select kabal, in game play with it and when select Smoke play with Smoke.

Please Guide ME.

Image
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: animation script

Postby Fojam » Wed May 16, 2012 9:32 pm

could you post your source?
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: animation script

Postby Behdadsoft » Wed May 16, 2012 9:47 pm

Sorry I can't. :|
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: animation script

Postby skydereign » Wed May 16, 2012 11:55 pm

All you need to do is have a filled region actor, and on the mouse button down event, create the actor you want the player to play as.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: animation script

Postby Behdadsoft » Thu May 17, 2012 6:26 am

You can leave a sample?
I have a 2 different .ged file and don't know How do I do it.
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: animation script

Postby skydereign » Thu May 17, 2012 3:52 pm

I prefer not to. With something like this, it isn't complex enough that providing a ged would help.
Behdadsoft wrote:I have a 2 different .ged file and don't know How do I do it.

Does this mean one ged is the character select, and one is the actual game? If so, you'll need to set a variable and save it before loading the game version. From there, in the view's create actor, you can use loadVars, and then create the proper player (depending on the value of the variable). For instance, when you press down on kabal's filled region, it sets the player_selected variable to 1 and uses saveVars to save it. Lastly it loads the other game with LoadGame.

In the other game's view actor, you would add something like this. Load the variable file created from the saveVars (remember save groups need to be named the same as well as the variables) and then have a switch statement or similar.
Code: Select all
switch(player_selected)
{
    case 1:
    // Create kabal
    break;
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: animation script

Postby Behdadsoft » Thu May 17, 2012 7:29 pm

Thank you.

in Switch code :

Code: Select all
switch(player_selected)
{
    case 1:
    // Create kabal
    break;
}


We have two Players, when select One of them How create Kabal or smoke?
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: animation script

Postby skydereign » Thu May 17, 2012 10:33 pm

I'm pretty sure you can figure that out if you think about it. If two players are selectable, then you could use two variables to determine which each player picks. Or, if only first player picks, and the second player must always be the other choice, then that is even simpler. The value 1 in that switch stands for the player choosing kabal (so you can change the comment to call CreateActor for kabal). You can also have another value (perhaps 2) which stands for smoke.

The important thing to understand is not exactly what code I provide, but understand what I'm saying. If you can understand the idea behind the method I am suggesting, you should be able to figure these things out without having to ask a new question for everything.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: animation script

Postby Behdadsoft » Fri May 18, 2012 9:31 am

Thank You.

I understand your statements and I'm trying to solve this problem. :D
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron