z depth bug

Non-platform specific questions.

z depth bug

Postby j2graves » Sat Oct 13, 2007 2:26 pm

I'm trting to make a background that will follow the view, but if I make it a child actor of the main actor or the view actor, It gets the same z depth as the parent actor. so it ends up in front of everything. I tried to put the action "change z depth" on "draw actor" event, but even so, it stays in front of everything!
can someone please help me out here?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: z depth bug

Postby Kalladdolf » Sat Oct 13, 2007 2:32 pm

let me explain your bug first:
the child actor is ALWAYS in front of the parent actor, no matter what u do.
The best way to make the backround pic follow the player is to change the view's z depth to behind everything and make the view follow the player some other way .
there are many turtorials about that.
for example for the view goes:
draw actor->script editor->
Code: Select all
x=player.x;
y=player.y;
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: z depth bug

Postby j2graves » Sat Oct 13, 2007 2:41 pm

Thanks. I'll try it out.
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: z depth bug

Postby j2graves » Sat Oct 13, 2007 4:26 pm

Thank you! but I still have one more problem. how do you stop the background from shaking?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: z depth bug

Postby j2graves » Sat Oct 13, 2007 4:43 pm

I have another problem now, when my main actor lands on a moving platform, the background disappears. could this have anything to do with the "change parent" action I put on the "collision on top side of moving_platform" event?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: z depth bug

Postby Kalladdolf » Sat Oct 13, 2007 4:53 pm

if the backround image changes the parent to <none>, it automatically goes back to the position where it was createt.
why would you change it's parent, anyway?
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: z depth bug

Postby j2graves » Sat Oct 13, 2007 5:02 pm

I changed the parent of the main actor to moving_platform. I did nothing to the background. It just did that on it's own. If you have any other way of getting the main actor to follow the moving platform when he's on top of it, could you please tell me?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: z depth bug

Postby Kalladdolf » Sat Oct 13, 2007 6:51 pm

Oh, that's what u mean!!!
could u post a ge file? (that sounds odd)
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: z depth bug

Postby DilloDude » Sat Oct 13, 2007 10:39 pm

The child actror's x and y coordinates are relative to the parent actor. To fix this problem, use xscreen and yscreen (which are always relative to the view).
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: z depth bug

Postby j2graves » Mon Oct 15, 2007 11:34 am

What exactly do you mean by, "ge file"?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: z depth bug

Postby j2graves » Wed Oct 17, 2007 10:49 am

do you mean a game editor file attachment?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: z depth bug

Postby tufif » Wed Oct 17, 2007 7:36 pm

Why not try just having it follow the view with a script?

Code: Select all
x = view.x;
y = view.y;
tufif
 
Posts: 22
Joined: Sat Oct 13, 2007 3:00 am
Score: 2 Give a positive score

Re: z depth bug

Postby j2graves » Fri Oct 19, 2007 11:09 am

You mean have it follow the view instead of the player? I tried that already, and the background was at the top left corner of the screen.
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: z depth bug

Postby DilloDude » Fri Oct 19, 2007 11:19 pm

Wellk, then it would be
Code: Select all
x = view.x + 512;
y = view.y + 384;

That would be for 1024 by 768 resolution. Change the numbers to half the view's size.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: z depth bug

Postby j2graves » Sun Oct 21, 2007 9:49 am

Thank you!how do I give you a point?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron