Jump to content

Daimour

Members
  • Posts

    191
  • Joined

  • Last visited

Posts posted by Daimour

  1. Ok so here is the source code that matters.

    I asked about LUA-script which invokes "scripts/class". How does it do? With require command? It must be somewhere in your attached to model "gate.lua" file I suppose.

     

    I can assume only that this two cases use LUA environment with different states. And search path may be changed. You can check search path in than lua script:

    
    

    AppLog(package.path)

     

    Add this line right before "scripts/class" invoking. And watch the LOG-file. For both cases.

    • Upvote 1
  2. 1. If you want to disappear dead body it's good approach to FreeEntity(). If it crashes you are doing something wrong. Remember C has no garbage collector so you need to manage carefully all references and pointers.

     

    2. If want just to stop sliding body without disappearing it depends of causes that make it sliding.

     

    If it slides because of physics forces you'll need probably reduce that forces and/or increase friction.

     

    If it slides because of error in your character controller moving algorithm you need to fix it.

  3. And should you change your mind about the rest of the title screen being black...

    You should make second picture with black background for comparing. Because when people are not designers they can't make such decision without visual comparing. And I think here is the question more about technical capabilities rather then aesthetic things.

  4. I Have same problem as you expect with my "ragdolls" they disappear in close range. :/ Same LOD problem?

     

    The most likely.

     

    I hadn't much time to manage this issue. So I don't know is it solvable or not.

  5. Well.. i don't really know LUA.

    LUA is not far from BlitzMax. It has variables and functions. And it has the same functions from Leadwerks API.

     

    Compare:

     

    BlitzMax:

    bodyp:tbody=createbodysphere(.35)
    positionentity bodyp,entityposition(body,1)
    setbodymass bodyp,1.0
    entitytype bodyp,1
    'rotateentity(bodyp, vec3(0,0,0))
    'positionentity(bodyp, vec3(0,0,0))
    entityparent body,bodyp
    setbodymass bodyp,1
    SetBodyElasticity bodyp,0
    

     

    And LUA-code:

    bodyp=CreateBodySphere(0.35)

    PositionEntity(bodyp,EntityPosition(body,1))

    SetBodyMass(bodyp,1.0)

    EntityType(bodyp,1)

    --RotateEntity(bodyp, Vec3(0,0,0))

    --PositionEntity(bodyp, Vec3(0,0,0))

    EntityParent(body,bodyp)

    SetBodyMass(bodyp,1)

    SetBodyElasticity(bodyp,0)

     

    Moreover, you don't need to read whole that file. Just find calls for function CreateJoint() and look around.

    I doubt someone will tune up your bones and physics bodies. It's hard hard work. May be you could find needed digits in my example if you would read it.

     

    When i made them smaller they go through terrain.

    Try to use SweptCollision() for bodies.

  6. I can share how I did it with LUA (file in attachment).

     

    But it doesn't work totally properly. Because of LODs...

    You can watch this video for details about the problem:

     

     

     

    Sorry for dirty code.

    soldier.lua

  7. Blending is another thing I don't fully understand.

    Blending means you can play 2 different animations simultaneously. Yes, they will be mixed. And you'll get something between them. But with "blending" parameter you can express one animation more then the second. So you can change "blending" from 0 to 1 through the time and your character will change one animation to the second seamlessly.

  8. Request for getting back the wiki part of documentation.

     

    That was very helpful for those who programming with LUA (and may be Blitzmax). Because sometimes functions have different names and parameters in different languages. And sometimes there was more information and examples in wiki then in documentation.

  9. 1. Check type of your picked entity. It can be animated model with LODs or terrain or vegetation or something else. You need to drill down to real mesh.

     

    2. Try to not add decal to mesh for awhile. Leave it as separate entity.

  10. Here is working example.

     

    Material file:

    texture0="abstract::bullethole.dds"
    shader="abstract::mesh_diffuse_bumpmap.vert","abstract::mesh_diffuse_bumpmap.frag"
    overlay=1
    blend=alpha
    zsort=1
    clamp0=1,1,0
    clamp1=1,1,0
    

     

    LUA-code:

    
    

    bulletholeMat = LoadMaterial("abstract::bullethole.mat")

     

    picked = CameraPick(camera, Vec3(GraphicsWidth() / 2, GraphicsHeight() / 2, 100), 0);

    bullethole = CreateDecal(picked.surface, TFormPoint(picked.position, nil, picked.entity), 1.0/16.0, 32);

     

    EntityParent(bullethole, mesh, 0)

    PaintEntity(bullethole, bulletholeMat)

    AddMesh(bullethole, picked.entity)

    FreeEntity(bullethole)

     

    And video:

     

    LUA-script and files in attachment.

    Bullethole 2012-10-06.rar

    • Upvote 5
×
×
  • Create New...