Endless Looping Landscape

Post » Mon Nov 23, 2009 9:30 am

Alright, so what I'm trying to do for this is to simulate a moving environment around the player while they stand on top of a moving platform, basically have ruins and things whisk by the player, repeating ever so often, to give the impression that the player is moving.

Now, how would this be done, my guess is a script that moves them a certain point then resets their position, but I've no idea how to go about doing it.
User avatar
jasminĪµ
 
Posts: 3511
Joined: Mon Jan 29, 2007 4:12 am

Post » Sun Nov 22, 2009 11:27 pm

Asuming you want something like objects moving past the window of a train, making the trees & stuff outside activators & applying a script like so should do it. It will probably want errors fixed & a bit of tweeking.

begin NI_scenery_movementshort  initDonefloat   xLimitfloat   xStartfloat   xNow;get starting position & set limitif ( initDone == 0 )   set xStart to getPos X   set xLimit to xStart + 1000 ;assuming that the scene is 1000 units long   set initDone to 1endIf;move the scener itemmove x, 30set xNow to getPos X;loop back to start when the end is reached.if ( xNow > xLimit)   set xNow to xLimit - 1000   setPos X xNowendIfend


edit: To prevent the objects from warping within view the objects that are initially paced in the player's view field could use a variation of the script that initially sets the limit to it's original position + 500. You can also randomize the y position & scale & x position when warping the object to provide a less apparently looping trip:

begin NI_scenery_movement2short  initDonefloat   xLimitfloat   xStartfloat   xNowfloat   randomize;get starting position & set limitif ( initDone == 0 )   set xStart to getPos X   set xLimit to xStart + 500 ;assuming that the scene is 1000 units long these objects warp when out of view   set initDone to 1endIf;move the scener itemmove x, 30set xNow to getPos X;loop back to start when the end is reached.if ( xNow > xLimit)   set xNow to xLimit - 1000   setPos X xNow   set randomize  to random 50   setPos Y to ( getPos Y + randomize - 25)   set randomize to random 40   set randomize to ( randomize / 100 )   setScale to 1.2 - randomizeendIfend

User avatar
Kelly Osbourne Kelly
 
Posts: 3426
Joined: Sun Nov 05, 2006 6:56 pm

Post » Mon Nov 23, 2009 7:52 am

I know this is the CS forums but how about an animated texture?
User avatar
Sara Johanna Scenariste
 
Posts: 3381
Joined: Tue Mar 13, 2007 8:24 pm


Return to III - Morrowind