Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

1,670 Excellent


About AggrorJorn

  • Rank
  • Birthday 12/18/1989

Profile Information

  • Gender
  • Location
    The Netherlands

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. AggrorJorn

    Headshot Kills?

    When you shoot you perform a pick. If it is an enemy the Hurt function is called right? Pass along the pick position with this hurt function. Inside the hurt function, you need to have a reference to this box. You can do this by creating entity properties, or by looping over the entities children until you find the name of your headshot box. (note that when you loop, the pivot might not have been called yet and the box could possibly not exist.)
  2. AggrorJorn

    Headshot Kills?

    Can you show a screen of your enemy in the scene tree? When the pick takes place, you get back the entity it picks. Since this is the enemy with (I assume) the AI script, you call its Hurt() function. You can pass along the hitposition with that function. In the hurt function you start looking for bones or boxes that represent body parts like the head. It would be even better if the references to the boxes are there before the Hurt function is called. Enemey (AI script) BodyHead BodyLeftArm etc
  3. AggrorJorn

    Headshot Kills?

    A cheap way to determine if it is a headshot is by creating a box that covers the head. When you do a succesful pick on the enemy, you get an entity and a pick position back. The entity (enemy) should have a reference to the headBox. Now simply check if the picked position is in the bounds of the entities headbox. Another basic way is iterating over the enemies bones and see which one is the closest. If the bone has the name 'head' (or whatever it is called), you register it as a headshot. This might give some false positives in some situations depending on the bone structure.
  4. AggrorJorn

    Function on Lua

    Put them in a separate lua file and the in main.lua use import "myscript.lua"
  5. AggrorJorn

    Massive FPS Drop

    That looks pretty good too.
  6. AggrorJorn

    Massive FPS Drop

    A second way is to draw a texture that represent 1 % of a filled healthbar. Then use @macklebee rotate image shader for every percentage of health, you draw the image with a given rotation. A third way is having a spreadsheet with all the possible health statusses and draw the one that matches your percentage.
  7. AggrorJorn

    Massive FPS Drop

    I think the best way would be an image of a circle and a custom shader which cuts away part of the circle based on the angle you specify. Maybe someone has posted a shader for this on the forum.
  8. AggrorJorn

    Massive FPS Drop

    You are drawing 4000 rectangles every frame.
  9. AggrorJorn

    Variables in other scripts?

    Just for reference sake:
  10. AggrorJorn


    I recall that when you import a file a second time, it is ignored since you have already loaded that file. This is stored internally in a cache somewhere.
  11. AggrorJorn

    Need SaveGame Help

    No need to go with C++ as you can do the same things with just writing to a file using the build in leadwerks commands. Alternatively you can load in a lua to json library to make things a little easier. This one for instance: https://github.com/rxi/json.lua Remember to turn of sandbox lua in the editor settings. As for the scripts you are using, you can try altering the code so that it doesn't just use the entities name as a key, but also adds a pre/postfix. So if you have 2 oilbarrels, they would be saved as oilbarrel_1, oilbarrel_2. When loading the data, you can remove the _1 etc from the name again.
  12. AggrorJorn

    Shortcuts for Transform, Rotate, Scale

    It has been a while, but I believe you can use the 1,2 and 3 keys to switch between transform, rotate and scale.
  13. AggrorJorn

    Getting troubles with drawText (invisible)

    Try setting the same color as when drawing the FPS. You currently draw with an almost black color.
  14. AggrorJorn

    Map Loading, Materials, Shaders, and other Details

    If we can do that on a separate thread/async, that would be great.
  15. AggrorJorn

    Map Loading, Materials, Shaders, and other Details

    I am curiously awaiting the demo. Would it be feasible to have a build in loadingprogress percentage?