zdepth slider idea

Ideas for Game Editor evolution.

zdepth slider idea

Postby JamesLeonardo32 » Mon Aug 24, 2015 3:36 pm

I thought of this idea where you have a zdepth function that can be tuned up or down at any time, like this;

Code: Select all
zdepth+=.1;


Rather than having to manually do a ChangeZdepth action.
JamesLeonardo32
 
Posts: 320
Joined: Wed Oct 13, 2010 4:57 pm
Score: 36 Give a positive score

Re: zdepth slider idea

Postby Zivouhr » Sat Oct 03, 2015 12:05 am

Hi James,

I also tried this method through studying the "Make an Actor Fade" tutorial, but am having trouble plugging the code in so it works based on the yscreen position of the characters, as in Streets of Rage or Final Fight games.

Would this code go into Create Actor/script editor:
zdepth+=.1;

And then in draw actor, some how get it to change? Zdepth being assigned as a variable named "zdepthfront" or "zdepthback"?

if(zdepthfront==1)
{
zdepth+=.1;
}


//
if(zdepth+=1)
{
Change ZDepth ("Event Actor", 0.9);
}

else

if(zdepth-=1)
{
Change ZDepth ("Event Actor", 0.1);
}

Just ideas, and the code won't actually work the way I set that up, but I'm guessing it needs some *, < > / symbols in there somehow. Need to do more research on this.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score

Re: zdepth slider idea

Postby speckford123 » Sun Oct 04, 2015 9:56 pm

Or use the brute force method and put
ChangeZDepth("Event Actor", zdepth);
into a draw actor script, then whenever you change the zdepth variable it will automatically update, hahaha
speckford123
 
Posts: 334
Joined: Fri May 05, 2006 6:33 pm
Score: 49 Give a positive score

Re: zdepth slider idea

Postby Zivouhr » Thu Oct 08, 2015 4:17 am

Interesting method, thanks Speckford. Thanks again for the cool line of script code for the range of an enemy hit zone for a fighting brawler game! That was a great tip.

Here is a really cool and effective zdepth method I discovered thanks to Skydereign recently. Foreground objects appear in front, while background objects appear behind the foreground objects.

Copy/pasted from my other post in game development of City of Rott:

SUCCESSFUL CODE FOR ZDEPTH LAYERING OF ENEMIES AND PLAYER! Streets of Rage or Side Scrolling Brawler Style: 8)
Add code to both enemy (and player) /draw actor/script editor:
Code: Select all
if(yscreen+height/2>collide.yscreen+height/2)  //I only half understand what this does. ;)
{
    ChangeZDepth("Event Actor", yscreen+height/2);   
}
else
if(yscreen+height/2<collide.yscreen+height/2)
{
    ChangeZDepth("Event Actor", yscreen-height/2);  //This is the same as above, but minus after yscreen.
}


Here's a brief "tutorial" example of how it works in action.
zdepthmoveactorTutorial.ged
(7.48 KiB) Downloaded 150 times
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest