Data Realms Fan Forums http://45.55.195.193/ |
|
Creating terrain using lua http://45.55.195.193/viewtopic.php?f=73&t=25540 |
Page 1 of 1 |
Author: | Grif [ Fri Sep 16, 2011 7:07 pm ] |
Post subject: | Re: Creating terrain using lua |
Assuming you've got a background file defined for the scene (which has to cover every pixel of terrain you place, otherwise it'll become scrap and be useless) then you could try settling MOSRotatings. Just spawn in a probably 24px square MOSR that is set to settle immediately. That should work, from what I remember from working on the Constructor, but it may not. I can't think of anything that would be any better than a per-pixel addition process, except maybe carving out a mostly-dirt map. |
Author: | Mehman [ Sat Sep 17, 2011 11:15 am ] |
Post subject: | Re: Creating terrain using lua |
Thanks, I tried the one pixel at a time method and if well optimized it isn't that laggy, but now I have another problem: I can't settle MOPixels properly: even with ToSettle = true they still refuse to settle in mid air(they just do when they touch already existing terrain), Why is that? Is there a way to counter it? |
Author: | carriontrooper [ Sat Sep 17, 2011 1:14 pm ] |
Post subject: | Re: Creating terrain using lua |
Mehman wrote: Thanks, I tried the one pixel at a time method and if well optimized it isn't that laggy, but now I have another problem: I can't settle MOPixels properly: even with ToSettle = true they still refuse to settle in mid air(they just do when they touch already existing terrain), Why is that? Is there a way to counter it? 1-pixel thick line as floor. After filling the surface area, 'delete' parts of it for caves. |
Author: | Mehman [ Sat Sep 17, 2011 2:32 pm ] |
Post subject: | Re: Creating terrain using lua |
Isn't there a way to force a particle to settle? Edit: Nevermind, found a way. |
Author: | Mehman [ Sun Sep 18, 2011 3:50 pm ] |
Post subject: | Re: Creating terrain using lua |
New problem: How do I prevent settled terrain from being too easily destroyed, as in if you destroy one pixel it will destroy a line of 25 pixels above it? |
Author: | Grif [ Sun Sep 18, 2011 6:32 pm ] |
Post subject: | Re: Creating terrain using lua |
Terrain needs to have a Background defined behind it. In Scenes, that's handled by the MAT file. In the case of bunkermodules, whatever is in the BG file will add itself to the scene's overall Background mask. There's absolutely no way around the problem. It's an issue with IsScrap, which is auto-set by the engine in order to keep dropship debris and etc from piling up too heavily. |
Author: | Mehman [ Sun Sep 18, 2011 6:47 pm ] |
Post subject: | Re: Creating terrain using lua |
Then can I create bunker modules using lua? In the wiki the description of SceneMan:AddSceneObject() states: Quote: Takes any scene object and adds it to the scene in the appropriate way. If it's a TerrainObject, then it gets applied to the terrain, if it's an MO, it gets added to the correct type group in MovableMan. which implies there is a way to create and/or modify TerrainObjects with lua, how do I do that? |
Author: | Grif [ Sun Sep 18, 2011 6:50 pm ] |
Post subject: | Re: Creating terrain using lua |
I think that, unfortunately, AddTerrainObject is still an engine-only function. I've never found a way to get it to work, and I did some fairly extensive experimentation, as did TLB. This was the main problem I had with my Constructor mod. Really the only way around it for your application, that is, reloading a saved scene, would be to make the entire background of the scene a flat BG in the actual Scene .bmp files. I can't think of any other reliable way to do it, because there's really no way to force bunker module construction at any point. Unfortunately. |
Author: | Mehman [ Sun Sep 18, 2011 7:25 pm ] |
Post subject: | Re: Creating terrain using lua |
Then I guess I'll just have to make the script write a .BMP of the terrain, and use it as a MAT file for the loaded scene. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |