Jump to content

L B

Members
  • Posts

    967
  • Joined

  • Last visited

Everything posted by L B

  1. I could parse it all myself, only it'd be easier if I could just iterate through the children.
  2. L B

    HDR

    You don't. Full-screen effects don't have custom parameters accessible. It's not an official feature request, as no one bothers to ask for it, but it would be nice.
  3. If I could use "GetEntityKey(ent, "classname");", I could more than easily write a custom parser. But this is not the way Lua means to interact with code.
  4. 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.
  5. Macklebee, does LoadScene set your Distance Fog settings? Your water settings? If so, I have missed something obvious. I had indeed missed Josh's post. Everything is working fine and automatically now.
  6. It should. At version 1.3 I'll try to talk with Josh about getting it official.
  7. Changed post, sorry, it was indeed confusing.
  8. I have no problem getting keys, I need the class name, which is the "path" property (not key) without the extension.
  9. Will return either "Model" or "Terrain", not "environment_atmosphere", for instance.
  10. Keys work perfectly. "classname" doesn't. It used to be a key in 2.28 sandbox files, but it's not anymore in 2.3. It was there in 2.28 because of the need of a ProcessScene, but since Lua has been implemented, it must have been removed. My suggestion would be to add a function called "string GetEntityClass(TEntity entity);", which basically returns the "path" property from the SBX file without the filename extension.
  11. I'm putting it in General Programming because it isn't language specific. I can't get any value in C++ either.
  12. I'm in C#, so it's actually "Entity.GetKey(string key);"
  13. You have pretty high standards for someone who has to get his father to buy the $50 update.
  14. L B

    pak files

    Sounds interesting. Worth an entry in Feature Requests.
  15. This key seems to be gone (returns blank), and since we still need to manually parse the SBX for some reasons, it would be needed. I tried GetEntityKey("path"), but path isn't a key, it's a built-in property. Without this function, I can't make an automatic framework loading of SBX with atmosphere and waterplanes.
  16. For Josh it wouldn't, since he has access to the actual BMax members. For us, it would be quite a lot of trouble.
  17. I changed the structure to your second suggestion. Here's an example from the "Scene.Load(string path);" I'm working on: Framework.Effects.DistanceFog.Enabled = Convert.ToBoolean(int.Parse(child.GetKey("fogmode"))); Framework.Effects.DistanceFog.Color = Vector4.Parse(child.GetKey("fogcolor")); Framework.Effects.DistanceFog.SetAngles(float.Parse(child.GetKey("fogangle").Split(',')[0]), float.Parse(child.GetKey("fogangle").Split(',')[1])); Framework.Effects.DistanceFog.SetRanges(float.Parse(child.GetKey("fogrange").Split(',')[0]), float.Parse(child.GetKey("fogrange").Split(',')[1]));
  18. FreeCamera is basically a spectator, only faster to make for me. Here's the code, but I don't guarantee it's clean or efficient. It's just for my personal development use that I made it: using Leadwerks; namespace Origins { public class FreeCamera { public Camera Camera { get; set; } public float SpeedMultiplier { get; set; } private Vector3 CameraRotation { get; set; } private Vector2 MouseDelta { get; set; } private float Move { get; set; } private float Strafe { get; set; } public FreeCamera(Camera camera) { this.Camera = camera; this.SpeedMultiplier = 10.0f; this.CameraRotation = new Vector3(); this.MouseDelta = new Vector2(); this.Move = 0.0f; this.Strafe = 0.0f; Mouse.Center(); Mouse.Hide(); } public void Update() { this.MouseDelta.X = Utilities.Curve(Mouse.X - Window.Width / 2, this.MouseDelta.X, 6); this.MouseDelta.Y = Utilities.Curve(Mouse.Y - Window.Height / 2, this.MouseDelta.Y, 6); Mouse.Center(); this.CameraRotation.X += this.MouseDelta.Y / 10; this.CameraRotation.Y -= this.MouseDelta.X / 10; this.Camera.Rotation = this.CameraRotation; this.Move = Utilities.Curve(((Keyboard.KeyDown(Key.W) ? 1 : 0) - (Keyboard.KeyDown(Key.S) ? 1 : 0)) * this.SpeedMultiplier, this.Move, 20); this.Strafe = Utilities.Curve(((Keyboard.KeyDown(Key.D) ? 1 : 0) - (Keyboard.KeyDown(Key.A) ? 1 : 0)) * this.SpeedMultiplier, this.Strafe, 20); this.Camera.Move(new Vector3(this.Strafe / 10 * Timing.Speed, 0, this.Move / 10 * Timing.Speed)); } } }
  19. It wasn't a criticism, I was just wondering. I like the new system too, and although I'm not a Lua fan, I will surely enjoy the compiled Framework. The only thing I use Lua for is "prefabs" (attaching a point light to my lamp post), which could ideally be replaced by actual prefabs.
  20. I guess you could get it manually with another event hook system, but that would probably cause more trouble than anything else.
  21. Lumooja once posted a way of creating 2 objects without being instances. It was in the old forum, for a guy who tried to apply an outline shader to a model that was hovered.
  22. Because the .NET framework uses a method similar to this one. For instance, if you want to create a Bitmap object, you don't use "new Bitmap("test.bmp");". You use "Bitmap.FromFile("test.bmp");". Since LE loads objects and caches them, I thought using "Load" instead of "FromFile" was more appropriate.
  23. I chose this method because we seldom access parameters and some effects don't even have any, but I'll consider your approach.
  24. I'd rather have models in GMF than a 25% rebate on bundles.
×
×
  • Create New...