Sliding Skeleton!

Non-platform specific questions.

Sliding Skeleton!

Postby Hblade » Thu Sep 08, 2011 3:51 pm

Code: Select all
if (transp==0) {
    if (distance(x, y, COLBOX.x, COLBOX.y)<325) {
        timer++; if (timer==1 || timer==11) {
                     CreateActor("TEST", "Skeloton 1 Shot - Sprite Sheet", "(none)", "(none)", 0, 0, false);
                                                      }
                          if (timer==100) {
                              timer=0; }
            if (enhp<2 && yvelocity<2 && timer2==0) {
            if (x<COLBOX.x) {
                x+=1;
                ChangeAnimation("Event Actor", "WalkRight", NO_CHANGE);
                            }
            if (x>COLBOX.x) {
                x-=1;
                ChangeAnimation("Event Actor", "WalkLeft", NO_CHANGE);
                            }
                    }
            if (enhp>=2) {
                ChangeAnimation("Event Actor", "Death", NO_CHANGE);
                CreateActor("Explosions", "FIRE", "(none)", "(none)", rand(14)-7, rand(14)-7, false);
                         }
                         if (timer2==20) {
                 timer2=0; }
                              yvelocity+=.4;

                                  }
            if (timer2>=1) {
                timer2++;
                           }
}
r+=50;
g+=50;
b+=50;
if (RESPAWN==1) {
    transp=0;
    enhp=0;
    timer=0;
    timer2=0;
    timer3=0;
    xvelocity=0;
    yvelocity=0;
    SKELIACTIVE=0;
    x=SKELYX;
    y=SKELIY; }


Alright so heres my problem, the skeleton SLIDES when moving right! This happened out of noware too! Last night it was perfectly fine, now I open up game editor this morning to play test it (Didn't even LOOK AT any code), and suddenly the skeletons Spaz out when walking left! not right but left! Any help?... This is the skeletons AI code.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Sliding Skeleton!

Postby NERDnotGEEK » Thu Sep 08, 2011 5:06 pm

Looking at your code it seems sound.
I made a small game and used your code in it, it seemed to work fine. can you define spazzing out? :)
NERDnotGEEK
 
Posts: 75
Joined: Sat Oct 30, 2010 1:48 am
Score: 12 Give a positive score

Re: Sliding Skeleton!

Postby ikarus » Thu Sep 08, 2011 5:17 pm

Does it do it exported?
>>>>>>>>>>>>>>>>>>>>> http://www.code1011.com <<<<<<<<<<<<<<<<<<<<<<<
ikarus
 
Posts: 143
Joined: Fri Aug 12, 2011 3:06 am
Score: 11 Give a positive score

Re: Sliding Skeleton!

Postby Hblade » Thu Sep 08, 2011 5:19 pm

Yeah it does it exported too. I can't figure it out. Sometimes he will just face left and slide, sometimes he will repeatedly and rapidly change animation.

Like I said It was working fine last night, (saved the game, all that) and this morning I go to play test it without even bothering any actors at all, and boom it glitches.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Sliding Skeleton!

Postby NERDnotGEEK » Thu Sep 08, 2011 5:40 pm

is this the only piece of code that attempts to change the skeletons animation?
NERDnotGEEK
 
Posts: 75
Joined: Sat Oct 30, 2010 1:48 am
Score: 12 Give a positive score

Re: Sliding Skeleton!

Postby Hblade » Thu Sep 08, 2011 7:35 pm

Yes it is. strangely.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Sliding Skeleton!

Postby NERDnotGEEK » Thu Sep 08, 2011 9:12 pm

well its late so my brain has stopped working :)
you are aware that your change animation direction setting is set to NO CHANGE right? if when you refer to the skeleton sliding do you mean the animation is not playing?

send me the ged and ill be able to get a better understanding of what exactly is going wrong and ill be able to try some things to fix it if you like :)

declare the variable "face" and try this code in your codes place, just added in a small part to stop any bugging out of left and right, worth a try if you have yet to fix it :)
Code: Select all
if (transp==0) {
    if (distance(x, y, COLBOX.x, COLBOX.y)<325) {
        timer++; if (timer==1 || timer==11) {
                     CreateActor("TEST", "Skeloton 1 Shot - Sprite Sheet", "(none)", "(none)", 0, 0, false);
                                                      }
                          if (timer==100) {
                              timer=0; }
            if (enhp<2 && yvelocity<2 && timer2==0) {
            if (x<COLBOX.x) {
                face = 1;
                            }
            if (x>COLBOX.x) {
                face = 2;
                            }
                    }
            if (enhp>=2) {
                ChangeAnimation("Event Actor", "Death", NO_CHANGE);
                CreateActor("Explosions", "FIRE", "(none)", "(none)", rand(14)-7, rand(14)-7, false);
                         }
                         if (timer2==20) {
                 timer2=0; }
                              yvelocity+=.4;

                                  }
            if (timer2>=1) {
                timer2++;
                           }
}
if (face == 1)
{
                    x+=1;
                ChangeAnimation("Event Actor", "WalkRight", NO_CHANGE);
}
if (face == 2)
{
                    x-=1;
                ChangeAnimation("Event Actor", "WalkLeft", NO_CHANGE);
}
r+=50;
g+=50;
b+=50;
if (RESPAWN==1) {
    transp=0;
    enhp=0;
    timer=0;
    timer2=0;
    timer3=0;
    xvelocity=0;
    yvelocity=0;
    SKELIACTIVE=0;
    x=SKELYX;
    y=SKELIY; }
NERDnotGEEK
 
Posts: 75
Joined: Sat Oct 30, 2010 1:48 am
Score: 12 Give a positive score

Re: Sliding Skeleton!

Postby Hblade » Thu Sep 08, 2011 11:15 pm

That didn't work either. And for some reason, when you pass ONE of them, they all work fine (left and right) but when your on the left side of the first skeleton, they stop working again...
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Sliding Skeleton!

Postby lcl » Fri Sep 09, 2011 5:17 am

Is COLBOX the player actors collision box?
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Sliding Skeleton!

Postby skydereign » Fri Sep 09, 2011 7:55 am

Ok, well, I found your problem, and it indeed is a problem with gE. You are relying on sequences. Currently in gE 1.4 versions, sequences are broken. Every clone using them will increase all of their frames. So, if you have two of them, with an animation at 1fps, then they will move at 2fps, and so on. It just happened to be that you have just enough clones that are facing left, that you wouldn't see an animation change. Same goes for your right moving animation. I reported this a while back, and as far as I know has not been fixed, but it is a pretty major problem. The only fix is to use actual animations.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Sliding Skeleton!

Postby akr » Fri Sep 09, 2011 12:57 pm

Sky, I am happy that u found the problem. Thanks a lot! I saw a ticket some time ago about this. Can u point me to or give me the number?

thx
andreas
Co-Developer of GE engine

If u are interrested in new features of apple or android ge engines check the engine support website game-editor.net regulary.
akr
 
Posts: 453
Joined: Thu Feb 25, 2010 7:56 pm
Location: Germany, Ulm
Score: 40 Give a positive score

Re: Sliding Skeleton!

Postby Jagmaster » Fri Sep 09, 2011 2:03 pm

Shoot, I'm using animation sequences as well.
Hblade, by sliding, do you mean the animation kind of stops and then goes at twice the fps? if so, that's the same problem I'm having. :lol: (These are on clones that are parented to a collision block.)
Well, I guess I'll try replacing them with regular old animation strips. I have a question Sky, do you think it will glitch out the same way if I had a single animation with multiple files?
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Sliding Skeleton!

Postby Hblade » Fri Sep 09, 2011 3:08 pm

Thank you so much sky! :) Thank goodness the sequences work fine for the player O-o
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Sliding Skeleton!

Postby skydereign » Fri Sep 09, 2011 10:34 pm

akr, it is ticket number 35. http://sourceforge.net/apps/trac/game-editor/ticket/35

And, Jagmaster, multiple filed animations work fine.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Sliding Skeleton!

Postby Jagmaster » Fri Sep 09, 2011 11:00 pm

Thanks for clearing that up Sky.
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest