I had been quite impressed when I added that small bit of code that made Lua work magically:
IntPtr lua = Core.GetLuaState();
Core.lua_pushobject(lua, Framework.Pointer);
Core.lua_setglobal(lua, "fw");
Core.lua_pop(lua, 1);
This is the C# equivalent of the C++ code in the C/C++ forum that Josh posted.
I was quite happy because I now saw the waterplane and the skybox from my test scene directly in my program.
Although I noticed something:
It just takes the Lua scripts, not the SBX file
It renders the parameters it feels like taking into account.
Lua not SBX examples (suggestions):
Add a water plane in the Editor. Set its "Softness" value to 4, let's say. Try it in your code. There will be a water plane, but with Softness at 1, the default value. Now edit the water plane script, and change the default value of Softness to 10, if you wish, and save the script. Run your code, the softness will be at 20. In this case, we see that the code interaction does not use the custom parameters of the objects, only their default ones.
Add an atmosphere in the Editor. If you have a custom skybox, change it to yours. You will see your new skybox material perfectly in the editor. Now go in your code: You'll see an atmosphere and a skybox, yes, but with the default FullSkies_Clear081284791 material. Now go back in the editor, and change the Lua script of the skybox material to have your custom skybox material as a default. To be adventurous, let's even change the property of our atmosphere instance to the default skybox. Now go back to your program, and you'll see it now has the custom skybox material. Why? Because it only takes the one from the Lua script, not from the SBX file.
Selective rendering examples (suggestions):
If you still have that atmosphere instance, try setting the default value, in Lua, of "fogmode" to "1" (we already saw that setting it in properties don't work, so if we expect results, better change it directly in the Lua). Now just to be sure, also enable it on your instance of the atmosphere. Go back to your program: the fog isn't there. For some reason, it doesn't render the distance fog.
Same goes with Saturation/Brightness/Contrast, if you feel like exploring.
My questions are: Is this normal? Do I have to manually parse the SBX? If so, what is the point of the few code lines mentioned above? And if I have to parse the SBX myself, could I please get back the "classname" key?
On a side note: Is submersion now bugged? Can't get it to work since the last sync.