Jump to content

Yue

Members
  • Posts

    2,291
  • Joined

  • Last visited

Everything posted by Yue

  1. I think this might help. https://www.leadwerks.com/learn?page=Tutorials_Editor_Materials
  2. What you have to do, and what I understand is this. -You import the model to Leadwerks. -You create the materials from leadwerks with the texture for that material. (The same name of the material creating in the modeling program, example Blender) -This material is assigned to the different surfaces of the model. -Then when you update the import, those materials are already glued to the model.
  3. Here you can display the materials that have been assigned to the mesh.
  4. I don't know what textures are embedded (I use the translator), what happens is that when you are creating the model from the mesh modeling program, you assign a material to that mesh, therefore this material may or may not contain textures. In the import process you have to send everything, the mesh and the texture and so on the basis of that texture the material is created. Once inside leadwerks, you can open the texture to modify certain parameters. Translated with www.DeepL.com/Translator
  5. Inside the engine you create the materials, and assign them to the model, this automatically recognizes the coordinates of the model to apply the material with its textures. Edit: Remember that the material must have the same name as the one applied to the mesh modeler. So every time you import the template, these materials are applied to the template automatically.
  6. The biggest problem is, to put aside my perception of things and understand that it's just a game, as Johs mentioned, physics doesn't have to be real, it's just a game, but sometimes I have the craze that everything has to be as real as possible and this slows down the project, its goal of making a video game. So here I am again, asking for your help to be able to pass this challenge successfully. And my player already carries a box, in the head, of course an animation will be made to make it look better. Box.mp4 Now the thing is, I want to use a single key for the player to interact with the scenario, the boxes and other elements, but initially I have the key that kicks the boxes, the E key, and I would like to know if there is any way for this key to react to kick the box and at the same time take the box, and then leave it. I appreciate the suggestions. local cajaT = false function Script:Collision(entity, position, normal, speed) if cajaT == false then if entity:GetKeyValue("name") == "Caja" then entity:SetMass(0) entity:SetShape(nil) entity:SetKeyValue("name","TCaja") entity:SetRotation(self.entity:GetRotation(true)) entity:SetParent(self.entity) entity:SetPosition(0,12,0) cajaT = true end end end
  7. The engine really is great, it does 80% magic, the rest is 20% gameplay and create a game.
  8. Yue

    Kicking Boxes

    Unbelievable, if it works, the most horrible confusion is that first goes Force and then position. That's what the help says. Today I will be able to sleep peacefully. Thanks You!! function Script:UpdateWorld() local mundo = World:GetCurrent() local ventana = Window:GetCurrent() local pick = PickInfo() col = mundo:Pick(self.player:GetPosition(true), Vec3(self.entity:GetPosition(true).x, self.entity:GetPosition(true).y,self.entity:GetPosition(true).z),pick, 0, false ) local force = Vec3(0, 500, -10500) force = Transform:Vector(force, self.player, nil) if col then if pick.entity:GetKeyValue("name") == "Caja" then pick.entity:SetDamping(0,0) pick.entity:SetFriction(100,100) if ventana:KeyHit(Key.E ) then pick.entity:AddPointForce( force,pick.entity:GetPosition(true)) end end end end Ok..mp4
  9. Yue

    Kicking Boxes

    No work. function Script:UpdateWorld() local mundo = World:GetCurrent() local ventana = Window:GetCurrent() local pick = PickInfo() col = mundo:Pick(self.player:GetPosition(true), Vec3(self.entity:GetPosition(true).x, self.entity:GetPosition(true).y,self.entity:GetPosition(true).z),pick, 0, false ) local anglePlayer = self.player:GetRotation(true).y local xP = Math:Sin(anglePlayer) local zP = Math:Sin(anglePlayer) if col then if pick.entity:GetKeyValue("name") == "Caja" then pick.entity:SetDamping(0,0) pick.entity:SetFriction(100,100) if ventana:KeyHit(Key.E ) then pick.entity:AddPointForce( pick.entity:GetPosition(), Vec3(xP,0,zP), true) --pick.entity:AddForce(Vec3(0,0,1000),false) --pick.entity:SetOmega(Vec3(0,0,0)) end end end System:Print(xP)
  10. How are they implemented in Leadwerks?
  11. Yue

    Kicking Boxes

    TEMP 31_03_2019 17_54_27.mp4 I don't really understand, I can't make it point to the right place. pick.entity:AddPointForce(self.entity:GetPosition(false), Vec3(0,0,550), true)
  12. Yue

    Kicking Boxes

    I'm confused, the translator doesn't help much, the help says that the first three parameters are to apply force, the rest is the position of some entity, but this continues to release the box sometimes correctly and sometimes incorrectly.
  13. Yue

    Kicking Boxes

    pick.entity:AddPointForce(pick.entity:GetPosition(true),Vec3(0,200,300),true) This is what I have to kick the box, but I don't know how to make it go in the right direction. That is to say that the box is flying in the direction where the player is looking, but sometimes the exit path of the box is incorrect. Any suggestions?
  14. Yue

    Kicking Boxes

    I think this is trial and error and I changed the order of the scripts and I think it looks better. Continuing with the box, trying to understand how to make the box be thrown in the direction the player is looking, because sometimes it goes the other way. Kick Box.mp4
  15. Yue

    Kicking Boxes

    Here we have the same approach, only that the ray comes from the bone of the right foot, and the new thing is that with the key E, active that the box that touches disappears, in this point I think that the of the bones is unnecessary, would only be to establish that the ray comes out of the player to the height of his feet, and when this near of the box, the key E is pressed of a kick and the box is kicked. Test Ray Pick Key E.mp4
  16. Yue

    Kicking Boxes

    In the learning process I have taken up the problem from another perspective, the use of a ray, which comes from the bone of the head at the height of the eyes of the character, this is interesting because through this method you can establish a range of visualization of the character and in this simple example I have a ray that comes out of the eyes and destroys things, it is only a prototype. In this case you can evaluate what the ray touches and therefore establish what happens to that object. Translated with www.DeepL.com/Translator Test Pick Ray.mp4
  17. Yue

    Kicking Boxes

    function Script:Collision(entity, position, normal, speed) if entity:GetKeyValue("name") == "Caja" then entity:AddPointForce(position,Vec3(0,5,12),true) entity:SetOmega(Vec3(0,0,0)) end end Today, trying to implement this, I have the following problem. Initially a collision is checked, so the box is propelled no matter what collides with the boxes, in this case the player's controller is colliding before the bone in the right foot. This implies that the boxes are thrown with force when touching the player's controller, my question: How do I associate that this only happens when the right foot bone touches the box, in this way when making this collision throw the boxes away. This is because the kick should only be activated when the player or the mesh performs the animation of the kick, this implies that the foot touches the box. Translated with www.DeepL.com/Translator
  18. Yue

    Kicking Boxes

    Test Box Kick.mp4 Always something new to learn.
  19. Yue

    Kicking Boxes

    The thing is that the boxes fly away like crazy, I do not know what parameters to move so that the kick does not have so much force.
×
×
  • Create New...