Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,758 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Need help . . . #306039
01/19/10 08:08
01/19/10 08:08
Joined: Dec 2009
Posts: 24
DirtyDhan Offline OP
Newbie
DirtyDhan  Offline OP
Newbie

Joined: Dec 2009
Posts: 24
Im totally at lost at what to do, I have this code
====================================================
if (my.STATE == 1)
{

my.ANIMATION += 10 * time_step;
ent_animate(my, "idle", my.ANIMATION, ANM_CYCLE);
if (key_cur - key_cul)
{
my.ANIMATION = 0;
my.STATE = 2 ;
}
if(key_z)
{
my.ANIMATION = 0;
my.STATE = 4;
}
}
if(my.STATE == 4)
{
my.ANIMATION += 10 * time_step;
ent_animate(my, "firstpunch", my.ANIMATION, ANM_CYCLE);
my.ANIMATION = 0;
my.STATE = 4;
}

if(my.STATE == 4)
{
if(key_z)
{
my.ANIMATION = 0;
my.STATE = 5;
}
else
{
my.ANIMATION = 0;
my.STATE = 1;
}
}
if(my.STATE == 5)
{
my.ANIMATION += 10 * time_step;
ent_animate(my, "secondpunch", my.ANIMATION, ANM_CYCLE);
my.ANIMATION = 0;
my.STATE = 6;
}
if (my.STATE == 6)
{
my.ANIMATION = 0;
my.STATE = 1;
}
=========================================================
the first time the z button is pressed, it should execute an attack. But then if I press the z button, for some reason the animation is like restraining it self to punch. it doesnt complete the punch animation.


Last edited by DirtyDhan; 01/19/10 08:38.

If you do not know where you are . . .
Ask a villager.
Re: Need help . . . [Re: DirtyDhan] #306045
01/19/10 09:50
01/19/10 09:50
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
can you please make one topic for your problems, they are all related to the same piece of code...

anyway, what happens here is that when you press z, in one frame it think you are already doing the second punch, and when it comes to secondpunch, it immediatly jumps back to idle...

I havent tested the following, but should atleast get you started:
Code:
if (my.STATE == 1)
{
   my.ANIMATION += 10 * time_step;
   ent_animate(my, "idle", my.ANIMATION, ANM_CYCLE);

   if (key_cur - key_cul)
   {
      my.ANIMATION = 0;
      my.STATE = 2;
   }
   if(key_z)
   {
      my.ANIMATION = 0;
      my.STATE = 4;
   }
}
if(my.STATE == 4)
{
   while(my.ANIMATION < 99) {
      my.ANIMATION += 10 * time_step;
      ent_animate(my, "firstpunch", my.ANIMATION, ANM_CYCLE);
      wait(1);
   }
   
   if(key_z)
   {
      my.ANIMATION = 0;
      my.STATE = 5;
   }
   else
   {
      my.ANIMATION = 0;
      my.STATE = 1;
   }
}
if(my.STATE == 5)
{
   while(my.ANIMATION < 99) {
      my.ANIMATION += 10 * time_step;
      ent_animate(my, "secondpunch", my.ANIMATION, ANM_CYCLE);
      wait(1);
   }
   
   my.ANIMATION = 0;
   my.STATE = 1;
}



2 things; if you hold z, it will also already do 2 punches (in a row though laugh ), and, it stops your player from doing anything but animate while punching...

again, this is only a rough start, and nowhere near pretty code... good luck with this.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Need help . . . [Re: Helghast] #306085
01/19/10 15:51
01/19/10 15:51
Joined: Dec 2009
Posts: 24
DirtyDhan Offline OP
Newbie
DirtyDhan  Offline OP
Newbie

Joined: Dec 2009
Posts: 24
hehe, gee thx. I've already finished all of the controls a while ago. now I'm working on collisions. thx a lot 4 tis ^^


If you do not know where you are . . .
Ask a villager.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1