Jump to content

Rick

Members
  • Posts

    7,936
  • Joined

  • Last visited

Blog Comments posted by Rick

  1. I agree with Guppy. The effect would be nice to be able to apply to our own planes so that we can make multiple water sources instead of just the 1 giant ocean. I mean creating a giant ocean sort of implies you want big outdoor scenes but that's not where LE excels in terms of performance and indie people being able to populate such a scene. So given the focus of LE pushes people towards smaller indoor scenes why wouldn't that be the focus for water?

    • Upvote 4
  2. Well that's certainly a new way to do that smile.png.

     

    I didn't know lua didn't require ()'s when calling functions and then returning a table and calling a function on that without needing ()'s is a pretty neat trick to make it look like a normal OO language.

     

    Would be cool if you didn't have to pass the class name as a string but could as a variable that would be nil (obviously) but could some how get the sending variable name and use that.

     

    While the underlying way of doing this is fairly messy and not as neat as the method Josh uses in some of this scripts, the usage is much closer to other OO languages so I love that.

     

    Also, when you instantiate the class you shouldn't have to refer to it as a string right? Because you create a table from the string when you define the class so you can have a much more OO way by just using the table directly at that point like:

     

    myInstance = new MyClass

     

     

    With that I guess an alternative approach to using string class names when defining your class could be something like

     

    class Person = {}

     

    class NPC = {} : extends Person

  3. I wonder if LUA supports static types?

     

    If you define a variable local but outside of any functions it'll only be visible to that file. You can then make functions in that file that manipulate that variable.

     

     

    So to simulate C++ I generally make "classes" in Lua like Josh does with the AnimationManager.lua file. Then outside of all the function/class stuff I define the local variable and now it'll be accessible by all instances of that class inside that file but not outside just like static variables.

  4. Any chance on getting a function call that returns how many entities are in the map without actually loading them? Just the number? This would allow people to make an accurate progress bar while loading if they put draw and update/flip code inside the map callback.

    • Upvote 1
  5. So there should be a callback function to the map load function. I believe this will be called as entities are being loaded. If you put your drawing updating inside this where you draw to the screen (the stuff that's inside App::Loop()) then you should be able to have a loading screen that updates as your map is loading. It might not be the smoothest but it could be something.

     

    I believe anything you do with LE entities needs to be on the same thread that LE was initialized on.

  6. That's interesting in the example above. So all that's really stored in your workshop item is a link to his workshop item, and then the settings you changed? What if I added a particle effect of sparks as a child to his and make it a prefab. Does that work for me to make that a workshop item then and my workshop item would have all the information needed to reproduce the prefab from his item?

  7. I subscribed to the item, and used the model and sound to make my own Workshop item here

     

    This isn't use and reuse, it's use and modify and redistribute. So what you just said is a little confusing to people. I assume it means we can modify certain LE settings but not the source files. We can use it in another prefab and distribute that new prefab, but not modify the source files right?

    • Upvote 1
  8. So how does this work them. I put the barrel model in the scene, made a csg as it's child, marked it as shape hint. If it gets set as the shape then I think you should copy the mass and collision type and all that stuff too. When I set the mass of the csg the barrel doesn't fall so I assume you aren't copying those values to the shape you make.

     

    [Edit]

     

    If I give the child csg mass it doesn't get deleted. It shows up at what seems to be the origin and starts falling. Thought it got deleted or is the whole mass or script section of the LE library preventing the deletion?

×
×
  • Create New...