Author |
Message |
Darlos9D
Joined: Mon Jul 16, 2007 9:50 am Posts: 1512 Location: Tallahassee, FL
|
Adding Terrain
Simple question: how does one use Lua to add some new terrain to the scene? I'm not sure what Create function to call, nor am I sue which Add function to call.
|
Wed May 27, 2009 12:01 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Adding Terrain
As far as I know from looking at docs, there's no actual function to add terrain. However, you should be able to force an MO to auto settle within one sim update with a few of the MOSprite functions.
|
Wed May 27, 2009 1:54 am |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
Re: Adding Terrain
There is SceneMan:AddTerrainObject() but I'm not sure how to create a terrain object in the first place.
|
Wed May 27, 2009 1:56 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Adding Terrain
Do it the same way as create functions?
bunkermodule = SceneMan:CreateTerrainObject("Closed Tomb"); bunkermodule.Pos = Vector(2000,1000); SceneMan:AddTerrainObject(bunkermodule);
Absolutely no idea if that'd work but it's worth a shot, I guess.
|
Wed May 27, 2009 2:01 am |
|
|
Darlos9D
Joined: Mon Jul 16, 2007 9:50 am Posts: 1512 Location: Tallahassee, FL
|
Re: Adding Terrain
Grif wrote: Do it the same way as create functions?
bunkermodule = SceneMan:CreateTerrainObject("Closed Tomb"); bunkermodule.Pos = Vector(2000,1000); SceneMan:AddTerrainObject(bunkermodule);
Absolutely no idea if that'd work but it's worth a shot, I guess. Tried that already. Didn't work out. On a somewhat related note, SceneManager:AddSceneObject() tends to crash the game a couple seconds after you use it to add something. You definitely want to stick to using specific MovableManager:Add functions.
|
Wed May 27, 2009 2:16 am |
|
|
Daman
Joined: Fri Jan 26, 2007 3:22 am Posts: 1451
|
Re: Adding Terrain
Darlos9D wrote: Grif wrote: Do it the same way as create functions?
bunkermodule = SceneMan:CreateTerrainObject("Closed Tomb"); bunkermodule.Pos = Vector(2000,1000); SceneMan:AddTerrainObject(bunkermodule);
Absolutely no idea if that'd work but it's worth a shot, I guess. Tried that already. Didn't work out. On a somewhat related note, SceneManager:AddSceneObject() tends to crash the game a couple seconds after you use it to add something. You definitely want to stick to using specific MovableManager:Add functions. Well, movablemanager doesn't include bunker modules. AddSceneObject allows you to.
|
Wed May 27, 2009 1:18 pm |
|
|
Darlos9D
Joined: Mon Jul 16, 2007 9:50 am Posts: 1512 Location: Tallahassee, FL
|
Re: Adding Terrain
I said "on a somewhat related note." AddSceneObject() crashes the game seconds after calling it no matter what you use it for, which blows and needs to be fixed. Which just makes adding terrain that much more impossible.
|
Wed May 27, 2009 4:20 pm |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Adding Terrain
Grif wrote: As far as I know from looking at docs, there's no actual function to add terrain. However, you should be able to force an MO to auto settle within one sim update with a few of the MOSprite functions. ^ Is the best option.
|
Thu May 28, 2009 5:32 am |
|
|
|