Page 1 of 1

How to make a infinite backgorund.

PostPosted: Sun Jun 07, 2015 5:23 pm
by mindcontrol
Hi, i want to make a Yume nikki's like backgrounds\maps, for who doesn't know, it work in this way: You can go in one direction forever, but at a certain point you find yorself at the beginning (but it seems the map just keep)

Re: How to make a infinite backgorund.

PostPosted: Mon Jun 08, 2015 1:05 pm
by koala
Place a "Filled Region" at the end of the map. When "Actor" Collides with it, change "Actor's" coordinates. Does this help?

Re: How to make a infinite backgorund.

PostPosted: Mon Jun 08, 2015 1:46 pm
by MrJolteon
Or just make a really long level. And I mean seriously long. So long it wraps around the edge of the 2 000 000x2 000 000 pixel area.

It's probably easier if you listen to koala.
(ninja edit: 2000th post!)

Re: How to make a infinite backgorund.

PostPosted: Mon Jun 08, 2015 1:55 pm
by DeltaLeeds
If you want the actor to go back to the beginning after a certain limit, like x=9000.
Go to the actor and Draw Actor->Script Editor
Code: Select all
if(x>9000)//Returns the actor to 0 when the actor's x is over 9000, which makes it impossible to go over 9000!!!! (see what I did there?)
{
    x=0;
}
else if(x<0)//Returns the actor to 9000 if the actor's x is less than 0.
{
    x=9000;
}

MrJolteon wrote:ninja edit: 2000th post!

Congratz for 2k posts Jolt!

Re: How to make a infinite backgorund.

PostPosted: Tue Jun 09, 2015 1:30 am
by Zivouhr
Good tips! 8)

For the most accurate transport to any location, I usually use the "Move to" move, instead of the X Y coords.

Move to/Event Actor/Relative to Game Center/Avoid (None)/ Position x 0, y 0 /Velocity: 9999999

or

Code: Select all
MoveTo( "Event Actor", 0.00, 0.00, 9999999.0, "Game Center", "");


In Tomb of Twelve, when I used the X= Y= set up to move the character when a certain event triggered it, sometimes the character would end up in the wrong spot. With the MoveTo code, it solved all the frustration instantly. The X, Y position can be seen in the far right side of the top menu panel, to the right of HELP.

Re: How to make a infinite backgorund.

PostPosted: Tue Jun 09, 2015 5:33 am
by lcl
Zivouhr wrote:In Tomb of Twelve, when I used the X= Y= set up to move the character when a certain event triggered it, sometimes the character would end up in the wrong spot. With the MoveTo code, it solved all the frustration instantly.

That sounds weird. For me, directly setting an actors x and y coordinates has always worked as it should, and MoveTo has caused issues, because it actually makes the actor travel that distance, not just teleport to the new position. Were you using Activation Regions in that game? Because that's the only reason I'd understand for setting x and y acting weird, I recall something like that happening when I was working with Dimension 55355 and I used Activation Regions. The problem was probably caused by the part of the level not being loaded when I teleported my character there, and when the view actor was also moved there, causing that part of the level to load, the actor would be in a wrong position, if I remember correctly.

Generally I consider it a much better practise to just set the actors x and y, and so teleport the actor to the new position.

Re: How to make a infinite backgorund.

PostPosted: Tue Jun 09, 2015 1:43 pm
by mindcontrol
hmm thanks but it's not what I need, I don't know how to explain it, but seems like the map continue, not like the a 'teleport' wich move you at the beginning.. if you can see yume nikki, you'll understand (the part I mean are the dream's rooms). However between some days i'll try to post a video to explain it.
Ps. I'm not using activation regions, becouse i don't know what they are :D

Re: How to make a infinite backgorund.

PostPosted: Tue Jun 09, 2015 3:22 pm
by lcl
If you just want to make your background image to loop infinitely, click the open the Actor Control -panel and click the [Normal] button and select Infinite / x Infinite / y Infinite depending on what you want to achieve.

Re: How to make a infinite backgorund.

PostPosted: Wed Jun 10, 2015 11:45 am
by mindcontrol
lcl wrote:If you just want to make your background image to loop infinitely, click the open the Actor Control -panel and click the [Normal] button and select Infinite / x Infinite / y Infinite depending on what you want to achieve.



i already tried, but i have two problems.
1 I should make infinite all the actor, not only the background.
2 I need do make more maps\level, but only one level can be done in this way (becouse it's infinite and ovelay all the GE space)

Re: How to make a infinite backgorund.

PostPosted: Wed Jun 10, 2015 12:29 pm
by koala
You can make one .ged file for one level and load that file/level using LoadGame("file_name.ged").

Re: How to make a infinite backgorund.

PostPosted: Thu Jun 11, 2015 12:47 am
by Zivouhr
lcl wrote:
Zivouhr wrote:In Tomb of Twelve, when I used the X= Y= set up to move the character when a certain event triggered it, sometimes the character would end up in the wrong spot. With the MoveTo code, it solved all the frustration instantly.

That sounds weird. For me, directly setting an actors x and y coordinates has always worked as it should, and MoveTo has caused issues, because it actually makes the actor travel that distance, not just teleport to the new position. Were you using Activation Regions in that game? Because that's the only reason I'd understand for setting x and y acting weird, I recall something like that happening when I was working with Dimension 55355 and I used Activation Regions. The problem was probably caused by the part of the level not being loaded when I teleported my character there, and when the view actor was also moved there, causing that part of the level to load, the actor would be in a wrong position, if I remember correctly.

Generally I consider it a much better practise to just set the actors x and y, and so teleport the actor to the new position.


Thanks. No activation regions only because I had to allow for instant teleportation to any map zone where another warp door was. WIth activation regions, it would be an empty area he'd appear in, so I had to resort to other methods. I was using the X, Y and he'd appear in the wrong spot sometimes, ending up in fatal situations by mistake after losing a life. When I switched to Move To, all those problems disappeared.

Re: How to make a infinite backgorund.

PostPosted: Thu Jun 11, 2015 9:05 am
by mindcontrol
koala wrote:You can make one .ged file for one level and load that file/level using LoadGame("file_name.ged").



Seems good, but how to make infinite other actor too (enemy,object,doors ect)?

Re: How to make a infinite backgorund.

PostPosted: Thu Jun 11, 2015 1:16 pm
by bat78
mindcontrol wrote:
koala wrote:You can make one .ged file for one level and load that file/level using LoadGame("file_name.ged").



Seems good, but how to make infinite other actor too (enemy,object,doors ect)?


On the same way, make them "x Infinite"

You can constantly create new actors with the CreateActor function.