Jump to content

tipforeveryone

Members
  • Posts

    382
  • Joined

  • Last visited

Posts posted by tipforeveryone

  1. Some textures which I found from workshop have no source image files therefore I can't modify or make normal map for them.

     

    My trick is open tex files in Leadwerks > maximize texture editor window > Print screen > Paste screenshot to Gimp > Edit, save. But this is only good for textures below 512 x 512, above 1024 x 1024 can't be zoomed big enough to do this trick.

     

    Is there any tool or method too get images from tex files

  2. Hi everyone,

     

    I have a character model with an animated arm.

    I want character's neck bone to rotate following my mouse look rotation.

    Everything seems to be ok if I don't use entity:SetAnimationFrame, character head rotates nicely.

    But when I apply entity:SetAnimationFrame to animate the arm, I can't control neck bone anymore.

    Animation of character's arm is normal.

     

    How can I seperate animated arm bone from neck bone to use both animation and manual control

  3. Hi everyone, please help

     

    I want to make a small 3D icon above my object and I can see it through wall, wherever I am

    Example: a NPC is running around in my map then I can track the icon to find him

     

    Notice that It should be a 3D object biggrin.png not 2D. I wanna make it rotate too

    post-16833-0-48092800-1465218346_thumb.png

  4. Hello everybody,

    yesterday I read an email from steam about workshop item sale to 50%

    Then I bought BloodDecal by using my steam wallet

    After that I did not find any BloodDecal in my inventory, even I display "View in your inventory"

    Anyone tell me where is my bought item ?

    and how to use it in my game ?

     

    Thanks

  5. Hi everyone,

     

    Here is my custom FPS player concept with leaning ability (Figure 1)

    This concept includes 1 camera, 2 boxes (box1 and box2), very simple

     

    Expected:

    • I can control the camera by mouselook script - DONE (It is easy)
    • Box1:SetCollisionType(Collision.Character)
    • Box1:SetPhysicsMode(Entity.CharacterPhysics)
    • Assign WDAS control to Box1, Box1 can turn on Y Axis, following camera rotation - DONE (It is easy too, using Entity:SetInput() in Script:UpdateWorld())
    • camera:SetParent(box2) so that when box 2 rotates, camera will be rotated too (Figure 2)
    • Press Q/E to rotate (Entity:Turn) box 2 on Z Axis

    Problem:

    • Leaning is ok when I don't change camera rotation, just leave the mouse there and press Q or E, my camera will move well, the result is I can peek out the wall.
    • When I move mouse to look around, Box1 (player base)'s direction changes too, but Box2 is standing still. the result is I can't lean as the right way (Figure 3)

    My failed solutions:

    • Solution1: Using Box2:SetRotation(camera:GetRotation(true)) in Script:UpdateWorld(), this can make Box2 rotate as camera's rotation, but I can't use Q or E to turn Box2 anymore. Just because its Z axis was "locked" by Entity:SetRotation()
    • Solution2: Create a local Target = Model:Box() and place right on the line of sight from camera, so that when camera turn around, Target will move too, then use Box2:Pick(Target,2) to align Box2's Z axis with a hope that I can use Q or E again but no help, it was locked too by Entity:Pick()
    • Solution3: Using Box2:AlignToVector() but it acts so weird, I can't use Q or E too.

    Finally, I think I need my Box2 can be rotated only on Y axis (follow camera rotation in global) but Z axiz is still free to be turned

     

    Any idea for my concept ? Please show me a better one or give me some advices to use a right function, I will appreciate smile.png

    post-16833-0-54254600-1457147650_thumb.jpg

  6. Hi, My name is Tip. I am from Vietnam, 28 years old. I bought Leadwerks just because... I like its name (the greatest reason haha) Making a game is my dream too.

     

    I was so confused when making a choice for game engines. I saw Leadwerks supports Linux, then that was it. I bought it.

     

    Nice to meet all of you guys smile.png you are soo amazing !! I don't expect a full game of mine, but I enjoy the progress of making it sooo much !! So satisfied..

    • Upvote 1
  7. Yes, you would need an animated (or at the very least rigged) mesh. I static mesh isn't going to be very useful for this.

     

    You don't need to recode anything. You just need to call FindChild() to get a reference of them in code and set the position and rotation of each of them to the corresponding ragdoll you made in the video. The model will still be allowed to animate, you just need to not set set the position or rotation while it's doing this.

     

    1 week passed and finally, I have done this "Bones and Mesh"

    Here it is, the combination of mesh's original bones from blender and my own bones system, they work with eachother perfectly.

     

     

    I find out how to dismember character's limbs too. WIP thank you so much nick.ace!!

  8. Yeah sure. You need to call FindChild() from your mesh, and that function takes in a string where you can specify a bone. This bone is an entity, so you can call SetPosition() and SetRotation() on it to the position and rotation of the joints of the ragdoll (GetPosition() and GetRotation()). Make sure you set the global flag to true though. You should be all set with this, but it'll end up being a lot of copy/pasting code since you have to do this with each joint.

    I feel a bit confused now. It will be nice to use FindChild() but I have some problems with my exported mesh. It was made in Blender and exported by "Exporter for Leadwerks" addon to .mdl and .mat files.

    I open Leadwerks Model editor and find out that all of my character's bones were removed. So here are my questions

     

    1. If I use Addon to export from Blender, is it possible to attach my ragdoll bone to the exported mesh (with no bones from Blender) ?

    2. If I export to .FBX, yes, all of original bones are still there, showed in Leadwerks's model editor, do I need to "recode" them? And my model's skinning is still operational ?

  9. Sorry, I forgot you are doing dismemberment. If you were just doing a normal ragdoll, I'd say you could keep the mesh as one whole. If you are dismemberment, then I don't really know the best way.

     

    Still waiting on that Lua support though.

     

    Yes, I want a violent gameplay muahahha... Then I think I will find out how to do that smile.png

    But, can you give me more instruction about attaching my bones to mesh? maybe a function in API Library which I did not notice or a small step by step tutorial, links, anything...

     

    Thank you wink.png

  10. Mmm... will you share the code with us?.. happy.png

    Yes of course, I edited my topic with a small instruction part smile.png Feel free to download my .lua files

     

    I wonder if you can go through each child joint on a model and change it to that type, is that even possible?

    I will give it a try :D

     

    Oops, just noticed, you are probably using LUA, as you wrote things like "Model:Box()". No idea, whether you can do something like this in LUA. sad.png

    Thanks for your reply!

    It is ok rolleyes.gif I have lived with that 1 weeks anyway, hehe.

  11. How did you get the ragdoll physics to work so well? I remember spending hours only to find out that the joints are super-elastic when I tried to do it.

     

    Attaching isn't too difficult. All you do is get the model's children and set the position of each bone to the ragdoll's limbs (you don't have to parent all the bones though). One issue I remember having though is that sometimes the model will disappear because it's bounding box kind of gets messed. I don't remember how to fix that part, but one thing that can help a little is to reposition the mesh to the torso of the ragdoll and manipulate the bones there.

     

    Thanks for your reply, nick.ace

     

    You said exactly, those bones connection is so elastic. I spent a whole day to find out that too, It seems to be no solution, then I decided to live with this.

     

    Created bones by Joint:Ball and Joint:Hinge will be ok if I leave it "free", I mean no picking or interaction after dropping all bones for free falling, set collision type of bones to "Debris". Otherwise, they will be pulled out like hell...

     

    All of my ragdoll's bones were created by code (Model:Box()). You mean I need to cut my model's body parts into pieces (sperated legs, arms, hands, head, torso etc) then attach each of them to corresponding bone ?

    • Like 1
  12. After 1 week learning LUA Script in Leadweeks, with asistance from our mighty members (macklebee, Josh, Brutile), I have created a test ragdoll and a gun to shoot it. Ragdoll's limbs are dismemberable too. These are videos about my work smile.png

     

    (this one has a better quality)

     

    I feel so excited now. I want to go further... I mean How can I "attach" this ragdoll skeleton to my character Mesh?

     

    I used Blender Export Addon for Leadwerks, after that I only got a .mdl file with out any bones in it. I created bones for my character in blender. I noticed that bones are still remain with exported FBX file but I don't know how to use those bones

     

    Can anyone give me some suggestions about my question ? smile.png Just show me the right way. I will follow hehe. Thank you guys

     

    ==========================================

    (Edited in 160222)

    ==========================================

    This part is for members who want to refer my ragdoll code. I know these codes are not perfect and surely need more development. You are free to adjust my code. If you find out any better method to improve it, please reply in this topic. I know I am still new with LUA Script and game programming.

     

    Here is the instructions:

    • Create a new Map then a Box for a ground.
    • Create a Pivot, place it right on top of the ground box, name it "Ragdoll spawner" or whatever you like. Attach "RagdollChest.lua" to this Pivot.

    You can change any parameters of Ragdoll, everything will be auto adjusted to produce a desired ragdoll form in your map's scene.
    • Create a Camera then attach "CustomFPSPlayer.lua" to it, Drag above "Ragdoll spawner" into "Target ragdoll" and choose "fire sound" in Script tab.

    You should change the default weapon model (around lines 46 - 48)
    • That is all !! Press F5 and have fun.

    Control:

    • Left Mouse = Shoot
    • Right Mouse = Iron Sight
    • Middle Mouse = Reset Ragdoll
    • ADSW = Movement control
    • X = FreeBone Style1
    • C = FreeBone Style2 (default for bullet impact on ragdoll)

    RagdollChest.lua

    CustomFPSPlayer.lua

    post-16833-0-98999500-1456157680_thumb.jpg

    • Upvote 2
  13. Hello, I want to create my own Player in Lua, here is my code for its body

     

    body = Model:Box()
    body:SetShape(Shape:Box())
    body:SetMass(20)
    body:SetCollisionType(Collision.Character)
    body:SetPhysicsMode(Entity.CharacterPhysics)

     

    Then I create a Camera and SetParent(body), add some movement controls (AWDS) too.

    In debug mode, I use SetDebugPhysicsMode(true) to display physics

     

    Compare to Default FPSPlayer, its cylinder physic is so accurate when I move close to an object (Collision.Prop). My character body sometime goes through other objects and its cylinder physic is not accurate.

     

    When I release my control key (ex W key), if cylinder physic intersect with an object, my character body will be pushed back a long distance from that object.

     

    Can you show me how to make my character body be same as Default FPSPlayer's, to be so accurate

    post-16833-0-58043000-1456080125_thumb.jpg

    post-16833-0-44789100-1456080134_thumb.jpg

  14. I used to know how to do this, but don't remember exactly how. You need to create a second 'World' that only your gun goes in. The second world needs to only draw the gun, not anything else, including any background. That will prevent the gun going through walls, but won't fix the camera clipping issue. To fix that you either need to reduce the near range of the camera, or just move the gun further away. Creating a second world just for the gun will mean that the gun can be as big as you need it to be and it will still look normal. Hope this points you in the right direction

     

    Thanks Brutile, I will give this a try. :)

    Hope others give me more idea too :D

  15. I created all objects in Editor and rename them

    I want to access them from anywhere without using

    Script.variableName = "" --entity "Label"

     

    Example: I press Q key to make an entity disappear

    ìf window:KeyDown(Key.Q) then
    GetSomeThingByNameFunction("EntityName"):DoSomeThingFunction()
    end
    

     

    Just simple like that smile.png I need to put this code to main.lua so that I can't use the '--entity' method I guess

  16. This is my Scene Tree

     

    If I attach a script to "CSCDSoldier" then I can write something to do to its child (ex: mp5sd) by using

     

    self.entity:FindChild("mp5sd"):GetPosition()

     

    or in case, script is attached to "mp5sd", I still can get "CSCDSoldier" by using

     

    self.entity:GetParent():GetPosition()

     

    But how can I get "CSCDSoldier" even "mp5sd" from script which I attached to "Player"

     

    I did not find anything like

     

    self.entity:GetSiblings("CSCDSoldier"):GetChild("mp5sd")

     

    in the API Reference Library

     

    Please show me how. Thanks smile.png

    post-16833-0-04255300-1455435156.png

×
×
  • Create New...