Jump to content

Rick

Members
  • Posts

    7,936
  • Joined

  • Last visited

Everything posted by Rick

  1. I already told you how to do it and it is 1 function http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/collision-r778 self.enitty:SetCollisionType(Collision.None) Collision.None reverts to just a number. You can put whatever number that isn't already defined in the above doc and it'll do the same thing since no collisions are setup for numbers that aren't defined in the above doc.
  2. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/asset/ http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/prefab/prefabload-r622 I want each prefab to have their own materials AND to load scripts. I switch materials on prefabs that I shoot and I don't want all the others to have their materials switched. local bomb = Prefab:Load(self.BombPrefab, Asset.Unmanaged or Asset.LoadScripts) 1) How do we do bitwise operations in Lua to get this? 2) What is the constant variable names for both of these? Asset.LoadScripts doesn't seem to work
  3. I know C++ has the function to setup collision response for collision types. Where is that for Lua? If it's not exposed can we get it exposed so we have finer control over this? I know this C++ this is a supported feature.
  4. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitysetcollisiontype-r35 Set it to like 50 or something. Collision types are just numbers and the engine has built-in collisions between certain numbers. If you use a number that isn't defined then you won't get any collisions at all. http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/collision-r778 These are the predefined constants (which just relate to numbers) that the engine has setup certain types of physics responses. I think there are 2 responses: Cause physical collision & register collision but no physical (triggers). If no response it setup (there should be a function for this somewhere. I know it's in C++ but not sure if it's exposed to Lua) then nothing should happen.
  5. @YouGroove Good point. I'm so used to doing things in code forgot about this. I'll play around with it as I need it to angle itself based on where I shoot.
  6. The last time I downloaded that player I didn't see a bone for the pistol. Could you add a bone at the end of the gun so that we can find it in code with FindChild() and use it as the starting place for bullets/laser like you have? That way we wouldn't have to manually adjust anything but just use that as the starting point. I'd love to see your code for that laser too. I'd like to put it in my mini-game!
  7. The only way csg objects can be seen individually is by either giving a csg object mass or attaching a script. Without those 2 ways all csg gets collapsed into the same object. Providing 1 of those 2 things to a csg object makes it more like a model/entity in your game where you can find it and do things with it.
  8. I think that was more to say if you didn't want any gravity set it to 0 instead of saying just physics in general.
  9. Good idea on the laser like this! I do figure out the distance my bullet tracer needs to do, so that can be used directly with this to figure out the length.
  10. Bombkiller alpha version http://www.leadwerks.com/werkspace/files/file/492-bombkiller/
  11. Not that this is the issue, but you don't have to set the name key in your script. The name key automatically gets the name from the editor, but it doesn't hurt and shouldn't cause this issue, just something to point out. I'm using this technique for your bomb models when they collide with the player so it does work. What you have looks right so the problem must be somewhere else. I just made a "type" key instead but below is what I have attached to the bomb models which are character controllers for physics: function Script:Collision(entity, position, normal, speed) if self.Alive == false then return end local type = entity:GetKeyValue("type", "") if type == "player" then self:Explode(true) entity.script:Hurt() end end
  12. Yep. On the toolbar on the left there is a cube with 1 side highlighted red. This is the face selection tool for csg and just like in 3D world studio you can then apply textures to each face. In LE 3 you'd drag the material to one of the sides with that face selection tool selected and it'll just do that face. You also have the offsetting/fit etc functionality like 3D World Studio.
  13. I think if you left the mdl and just put in the new fbx, LE automatically converts it and overwrites the mdl and everything stays the same. I think the suggested workflow is to actually have you fbx pointed to the LE directory. Open and modify that one in blender and each time you export/save it LE automatically updates/converts. By deleting the original you removed that reference, but I think if you just let LE do the conversion the reference to the model stays.
  14. entitty:GeyKeyValue("name", "") 2nd param is the value if no key exists
  15. I just downloaded a new font and it worked in PostRender() for me without a problem. Are you using the beta version from Steam of LE 3.1 though because that's what I"m using.
  16. You didn't mention specifically at what time it wasn't nil so was just making sure you tried that. I'll be working with fonts here in the next hour or so, so I'll see what comes of it and let you know.
  17. And you are sure that in PostRender() self.font is not nil? I just want to make sure you didn't just check it in Start() after it was loaded. Also check it in PostRender() before it renders it. That might at least help figure something out. My guess would be it has to be nil in PostRender() to crash the engine.
  18. You would find the bone that is your attachment bone: local gunAttachmentBone = self.entity:FindChild("gunAttachmentBoneName") Then you would set that as the parent for you weapon: myweapon:SetParent(gunAttachmentBone) Now that gun/gear/whatever will move with that bone during animations
  19. This seems to be working now. Although it means I have to rethink how to structure things. In my bomb script I play the explosion sound when collided, and I also release itself. This causes the sound to not play anymore (since the object gets deleted). I might have to just set a flag and then not release the object until the sound is finished playing. Though I remember you said something about this being specific to the collision function so guessing I won't be able to release itself in the update function.
  20. Downloaded the update, but no difference. I still just get "Failed to copy folder "Material" to project directory error. Would be ideal to have all these steps print out to some kind of log file so we can see what is happening step by step. Would be easier for you to see exactly where stuff is failing too I would think. [edit] Nevermind I see you sent this to the console. Had to close project manage and go back. Here is what it says: Error: Failed to copy file "E:/Steam/steamapps/common/Leadwerks Indie Edition/Templates/Common/Materials\Sky\sky_texture.tex.meta" to "E:/GameProjects/AnimationTutorial/Materials\Sky\sky_texture.tex.meta". Why do the slashes reverse after /Materials? I can manually copy it over. It prompts me for overwrite, but it works if I manually do that one file above.
  21. hmm I get the map file version error when I run from the editor, but if I run directly the exe I don't get that. So whatever it did with copying it didn't complete it.
  22. I never got any sort of windows copying dialog so not sure how I could tell this.
  23. Failed to copy folder "Materials" to project directory. I noticed someone on the steam forums got this also. The game seems to run without error though.
×
×
  • Create New...