How to stop models from replicating in infinite_terrain?

Posted By: FutureRaptor

How to stop models from replicating in infinite_terrain? - 02/03/11 03:07

Hi recently when I was looking into the infinite terrain example in a8, it looks very good except that when I convert it for my own my game, my models seem to be replicating at the edge of the terrain. That works fine with grass and everything in the example but for me that doesnt really work since all I want is infinite terrain, not infinite or extra models. Please help me out so I can stop the engine from replicating my models also. Thanks!
Posted By: Logan

Re: How to stop models from replicating in infinite_terrain? - 02/03/11 06:29

The good news is, invisible models will be duplicated too. I'd suggest putting some invisible trigger models near the edge of the terrain. If the player passes these invisible models, you know he is onto the next "square" of the terrain, and so remove or set INVISIBLE|PASSABLE those objects you don't want carried over.

You'd have to do it cleverly because I'd imagine you want him to be able to return to the original "square" and see all the objects there just as they were. So maybe you can develop a makeshift grid system... lemme whip something up in MSPaint, hold on....
Posted By: Logan

Re: How to stop models from replicating in infinite_terrain? - 02/03/11 06:37



So each trigger would say, change the value of the coordinates of what square the player is in, and go through all the entites in the level (ent_next-- skip the player though) and if their given coordinates are equal to the current square, reset INVISIBLE|PASSABLE, otherwise set INVISIBLE|PASSABLE.

For entities you want to appear in every square, maybe set their grid square to a fractional value, and tell the trigger functions that if they encounter a fractional value to skip to the next object.

I hope this is what your looking for. I got kinda excited about this idea. As you can maybe tell.
Posted By: Superku

Re: How to stop models from replicating in infinite_terrain? - 02/03/11 15:17

You could set the entities' FLAG1 and set NOFLAG1 for every additional view except the camera view.
© 2024 lite-C Forums