Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Weird glitch  (Read 1185 times)

0 Members and 1 Guest are viewing this topic.
Weird glitch
« on: April 13, 2007, 10:35:41 pm »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1767
Ok this is whats happening:

Ok I'm working on WWA lalala added in rolling and the sword... WTF! what the hell happened to the sprites it's weird whenever you use the sword you kind of like messes up at the end of the animation it'll start to repeat then stop and go back to normal

What I've learned:


I figured out it has to do something with my rolling engine conflicting with my picking up object engine and sword engine not sure why though

The Code I'm using:

objLink:

Step Event:
Normal Goodnight Engine
Code: [Select]
if rolling
{
 if global.facing="L"{
 sprite_index=sprLinkRollL
 if place_free(x-4,y)
 x -=4}

 if global.facing="U"{
 sprite_index=sprLinkRollU
 if place_free(x,y-4)
 y-=4}

 if global.facing="R"{
 sprite_index=sprLinkRollR
 if place_free(x+4,y)
 x+=4}

 if global.facing="D"{
 sprite_index=sprLinkRollD
 if place_free(x,y+4)
 y+=4}
 }

Draw Event:
Code: [Select]
draw_sprite(sprLinkShadow,0,x,y)


var tspr;
tspr=sprite_index

if instance_exists(holding_pot)&& !rolling{ //Mask the sprite with the one of him holding it
    switch sprite_index {
    case sprLinkStandD: tspr=sprLinkCarryD; image_index=0; break;
    case sprLinkStandU: tspr=sprLinkCarryU; image_index=0; break;
    case sprLinkStandR: tspr=sprLinkCarryR; image_index=0; break;
    case sprLinkStandL: tspr=sprLinkCarryL; image_index=0; break;
    case sprLinkRunD: tspr=sprLinkCarryD; break;
    case sprLinkRunU: tspr=sprLinkCarryU; break;
    case sprLinkRunR: tspr=sprLinkCarryR; break;
    case sprLinkRunL: tspr=sprLinkCarryL; break;
    }
}


draw_sprite(tspr,-1,x,y)

draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha);
if (place_meeting(x,y,objShallowWater))
 draw_sprite_ext(sprSplash,image_index,x,y+17,image_xscale,-1,image_angle,c_white,0.5);

Z Button Event (to execute rolling):
Code: [Select]
rolling=true;

objLinkRolling:


Step Event:
Code: [Select]
if global.facing="L"{
sprite_index=sprLinkRollL
x -=5}

if global.facing="U"{
sprite_index=sprLinkRollU
y-=5}

if global.facing="R"{
sprite_index=sprLinkRollR
x+=5}

if global.facing="D"{
sprite_index=sprLinkRollD
y+=5}
depth=-y;

Animation End Event:
Create instance of objLink at postion (x,y)
Destroy Instance
Code: [Select]
view_visible[0]=true;
view_visible[1]=false;

Thats what it is basically heres a screenshot of what happens:


Notice he has 4 arms  XD I'm not sure why this is doing this but I'd be really appreciated if someone could help.


« Last Edit: April 14, 2007, 12:38:38 am by Colbydude »
Logged
  • https://colbydude.com
Re: Weird glitch
« Reply #1 on: April 13, 2007, 11:30:35 pm »
  • :D
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 151
Hmm, it seems you are not even creating objLinkRoll anywhere in your code.
Hmmm...maybe try changing

draw_sprite(tspr,-1,x,y)
 to
draw_sprite(tspr,image_index,x,y) ?

And here:
Code: [Select]
draw_sprite(tspr,-1,x,y)

draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha);
You seem to be drawing two link sprites on top of eachother.

Wait, you are doing drawing stuff in the End Animation Event? I thought that doesn't work >,>

I think you didn't post some of the code, and its confusing me.
Logged
  • Knighty Games
Re: Weird glitch
« Reply #2 on: April 14, 2007, 12:38:04 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1767
oh sorry I did accidentally label the Draw Event as the Animation End but anyways heres the Animation Event:
Code: [Select]
if instance_exists(holding_pot) or sprite_index=sprLinkThrowD or sprite_index=sprLinkThrowU or sprite_index=sprLinkThrowL or sprite_index=sprLinkThrowR
{
    switch global.facing {
    case "D": sprite_index=sprLinkStandD; break;
    case "U": sprite_index=sprLinkStandU; break;
    case "L": sprite_index=sprLinkStandL; break;
    case "R": sprite_index=sprLinkStandR; break;
    }
}
if rolling
{
 switch global.facing
 {
  case 'D': sprite_index=sprLinkStandD; break;
  case 'U': sprite_index=sprLinkStandU; break;
  case 'L': sprite_index=sprLinkStandL; break;
  case 'R': sprite_index=sprLinkStandR; break;
 }
 rolling=false;
}

Edit: Ok I tried doing what you said Knightmare it still didnt work I'll PM you the engine see whats up with it
« Last Edit: April 14, 2007, 12:41:45 am by Colbydude »
Logged
  • https://colbydude.com
Re: Weird glitch
« Reply #3 on: April 14, 2007, 01:04:03 am »
  • :D
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 151
Yeah...I got it right in my first post. You're drawing the link sprite twice.

Change:
Code: [Select]
draw_sprite(tspr,-1,x,y)

draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha);
to
Code: [Select]
draw_sprite(tspr,-1,x,y)

if(holding_pot==false){
  draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha);
}
It should work.
Logged
  • Knighty Games
Re: Weird glitch
« Reply #4 on: April 14, 2007, 01:08:13 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1767
sorry but it didnt I just tried hmm you got the PM right so yeah just edit that and get back to me (Never give a genius a simple task)
Logged
  • https://colbydude.com
Re: Weird glitch
« Reply #5 on: April 14, 2007, 01:13:45 am »
  • :D
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 151
Well, I don't know what to say then. I tried it and it works.
The code I just posted was the only thing I changed, so there's no point in
uploading it again.
It should only fix the 4-arms while carrying.

I also noticed it's possible to roll while carrying something, so you may want to change
The Z Button event to
Code: [Select]
if(holding_pot==false){
  rolling=true;
)

>,>

EDIT: You're changing the code in the objLink Draw Event, right?
« Last Edit: April 14, 2007, 01:23:03 am by Knightmare »
Logged
  • Knighty Games
Re: Weird glitch
« Reply #6 on: April 14, 2007, 01:18:52 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1767
Well you tried your best and I don't know why it's not working for me :'( maybe someone else could help...
Edit:
EDIT: You're changing the code in the objLink Draw Event, right?

Yeah I am but it's still not doing it I think I might have a solution let me try it

Edit #2: !w00t! I gots-ed-ed it finally weird I tryed doing it in another engine and it worked perfectly so now I'm gonna go crazy and start over
*Locked*
« Last Edit: April 14, 2007, 04:13:57 am by Colbydude »
Logged
  • https://colbydude.com
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.212 seconds with 52 queries.