Jump to content

Hgawmphdmph

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by Hgawmphdmph

  1. Oh brilliant. I've been looking out for news of it's release! Cheers, C
  2. Hi Josh, 3 years work on Leadwerks 4 - can I get Leadwerks 5 yet? And how upwards compatible is my existing code? Cheers, C
  3. Hello all, [ Before my question, I'd just like to say that this community is brilliant. Thanks to how good the Leadwerks 4 API and documentation are, I've only ever had to ask a handful questions on here during the 3 or so years I've been writing the framework for my game, and every time got a great, helpful answer. 🙂 Can't wait for LW5! ] My question is : Is there any way to save maps from code? I've looked at the Map.h file and obviously found the various Load functions but can't see a Save one. ( The reason I ask is that as a solo developer, producing the levels/maps I need is gonna be a challenge. But I've been developing a little tool that helps me partially generate maps using "Roguelike" procedural generation techniques - though I don't t want to randomly generate levels at run time. But what I'm trying to do is export data from my little map generator tool, then read it from within some LW C++/Lua code and using stuff like the Brush::Box build the skeleton of my level. (This part already works). Then I want tweak all the details and add further stuff within the LW editor. But for this to fly I would need to be able to save my built skeleton map after generating it in C++/Lua. ) I hope all the above makes sense. Sorry if it's a bit tldr! As always, I would be very grateful for any help or advice. Thanks all! Colin
  4. Hi reepblue, Ok thanks. I'll try adding a hinge joint in place of the bone. But then that makes me think - what would happen then with a character or NPC? They are animated with bones and if their physics mesh doesn't move with them then surely collisions and picks with them would be off? Cheers, Colin
  5. Hi, I've modelled a simple crate in Blender and imported it to Leadwerks. This lid is a simple mesh with a single bone to swing it open. The problem I'm having is that the physics doesn't seem to move with the mesh, as in the attached image. I'm using an animated model shader but the physics system seems to stay put. That means that when the lid opens, I can't access the inside because attemps to "pick" things inside hit the lid physics which are still in place. (Presumably, if I do the same thing with a door, I'm not going to be able to walk through it?) Am I doing something wrong? Thanks in advance for any help. Colin
  6. Can I use can MSVS community 2022 with Leadwerks? Just had to buy a new PC, been happily using MSVS Comm 2019 for ages but they won't let me have it anymore. Thx.
  7. Hi Josh, That's brilliant, thanks so much for such a quick reply. (Absolutely love Leadwerks by the way. Best engine I've ever used.) Cheers, Colin
  8. Hi all, I'm in the process of converting key parts of my partially written framework using Leadwerks from Lua into C++ and I have a question about loaded assets and memory management. Looking at things like the CreateNew load parameter, the Asset path attribute and the Copy function, I'm guessing that if I load the same asset more than once, the API will just return a pointer to the existing instance already loaded, in order to save memory - is that correct? If so, my real question is, what happens if I load a Texture from C++ and then load the same one again from my Lua code. Will the API return a Lua table pointing to the original asset? Alternatively, is there some way of accessing a C++ loaded asset or entity from Lua or Lua table of an asset or entity from C++? Last time I tried this I got an access violation. Cheers and thanks in advance, Colin
  9. Thanks Rick. I ran a bunch more tests and I think I understand it now. I tried saving an identical, but differently named asset and that got converted into a new .mdl file, which avoids the instancing issue. Thanks for the help.
  10. I have what may be some kind of instancing issue. I have a model created in Blender and imported to Leadwerks. I opened a new empty map, dragged in the model, attached a lua script, and saved the result as a prefab. I then opened another new empty map, dragged in the model again, attached a different lua script and saved the result as a second prefab. The model has no material. Both of the scripts create their own new material and attach it to their associated entity. Each then make changes to it's material - one uses a buffer to write and draw graphics to its associated material, the other switches the textures of its material to produce animation. If I add one instance of each prefab to any empty level, at runtime the same output appears on both objects. The script attached to the last prefab dragged in, draws to both objects. (To be clear, these are instances of two DIFFERENT prefabs.) If I remove the script whose output is showing from it's associated entity, the script attached to the other object draws to BOTH objects. If I remove the object whose script is showing everywhere, the other one starts showing what would be expected from its own attached script. If I drag in further instances of the model, the current dominant script output is drawn to those also. If I drag new instances of one of the prefabs into the scene, the last one dominates and its associated script affects ALL objects with this model, whether standalone model instances or instances of either prefab. It's as if a model is always instanced and shared, between different prefabs and even between different standalone versions of the model. Is this the case? Can anyone help with what on Earth is going on? Thanks all.
  11. Awesome, that makes life so much easier. Thanks!
  12. Hi all, In the sample FPSGun.lua code I see this: e:SetLoopMode(false,true) where e is an Emitter instance. The docs only list one parameter for SetLoopMode(). Can someone tell me what the second parameter does? Thanks.
  13. I should also mention that looking again in the model editor and even in the scene graph pane in the LW editor, I can now see that I have a "cube" object parented to a STATIC_MESH object, so the fact that the loaded mesh was parented is completely self evident. I just wasn't looking at it properly! Duh!
  14. Absolutely spot on, thank you. I hadn't occurred to me that the model would get parented to an empty one when loaded. I can now find the triangles list and everything. Is there some way I need to mark this as the right answer like in some other forums? Thanks again! Really appreciate the help.
  15. Hi, I'm trying to programmatically get model info in lua. I have imported a simple cube model with the same texture on all 6 faces. In the model editor it is shown as having a single surface, index 0 with the expected material. However, when I try to access this from code I can't find the surfaces. In a script attached to the entity I've tried: local surfaces = self.entity:CountSurfaces() and local model = tolua.cast(self.entity, "Model") local surfaces = model:CountSurfaces() All of which show indicate there are zero surfaces. I've scoured the documentation but can't work out what I'm doing wrong. And ideas? Thanks in advance.
  16. Hello folks, Can anyone tell me how LW chooses what texture or material to use on a newly created brush by default? Thanks and regards, Colin
×
×
  • Create New...