Home Forums Development discussions Questions

Tagged: , ,

Viewing 15 posts - 46 through 60 (of 95 total)
  • Author
    Posts
  • #536
    Akira_San
    Participant

    I experimented and found, that the character box must be a convex hull in order to fall on the ground. It dont touch the ground if its set to a box, is that natural? And thx, i forgot about the speed option.

    #537
    Sponk
    Keymaster

    The bounding-box != your mesh!

    The box is bigger than your mesh in certain areas to include all max and min points.
    The convex hull calculates a more sophisticated shape around your object to fit it better.
    You might want to use another box as a parent and scale the box to best fit your mesh manually since the convex hull is generally slower.

    #538
    Akira_San
    Participant

    Ok, i change the ground to triangle mesh and that works. Now the character walks on the ground. Too bad i lost some of my bookmark links after the pc upgrade…

    #540
    Sponk
    Keymaster

    That sucks big time. You should do some backups in future before upgrading. It’s not necessary most of the time but sometimes it can be quite handy.

    #542
    Akira_San
    Participant

    Yeah, will keep that in mind.

    #545
    Akira_San
    Participant

    How to parent a weapon to the hand? Looks like thats not possible, since the player gonna have to switch between them.

    #546
    Sponk
    Keymaster

    Simply create a new animation in Blender for every weapon (including your hand) and switch between those meshes.
    You need a custom animation for every different weapon anyway so this would be a viable solution.

    • This reply was modified 9 years, 5 months ago by Sponk.
    #548
    Akira_San
    Participant

    Thx, i was not planning to animate the weapon, it was just going to be parented to the hand since the perspective is isometric. I guess in the future having a support for bones in the editor will do the trick faster.

    #661
    Mury
    Participant

    Hey I have 3 questions

    1)Where can i see the src for everything that is 2D?
    2)Besides function onSceneUpdate is there something similar but for draw?
    3)I have this code:

    dofile(“SDK/Graphics2D.lua”)

    — Load a sprite
    sprite = Sprite(0,0,180,40,”maps/human.png”, “”)

    — Add sprite to the main canvas
    mainCanvas:addWidget(sprite)

    function onSceneUpdate()
    — Rotate sprite by 2° every frame
    sprite:rotate(2)
    end

    why does it not show me my little spritesheet?

    #662
    Sponk
    Keymaster

    Did you use the project manager or the editor to install the new SDK?
    It is not copied to your project by default since it is still under heavy development.

    Use the “Project > Import Lua SDK” menu to do that for your opened project.
    After that you should be able to find a new directory named “SDK” in your scripts directory.
    It should work then.

    The source code for the new API will be copied to the SDK directory, you can view and edit it there. Alternatively you could look in the git repo in “SDK/LuaApi” or on GitHub: https://github.com/Sponk/NeoEditor/tree/development/SDK/LuaApi

    About the draw function: No, there is no dedicated draw function. The reason for that is that Neo is multithreaded and Lua is not threadsafe, leading to synchronization problems. This also allows the engine to do some optimizations that would not be possible otherwise.

    #663
    Mury
    Participant

    I`m just amazed by this engine.I really need to start learn it!

    #664
    Mury
    Participant

    sprite.position.x += 1 where can i get the delta time so my player wont move like crayzie?

    #665
    Sponk
    Keymaster

    First of all: Thank you 😀

    You don’t need a delta time since onSceneUpdate is getting called at 60 Hz (every 16.6 ms) to be synchronous with physics and engine update. If you want to get the current time in ms you should use “getSystemTick()”.

    More info: http://neo-engine.de/documentation/Lua/html/files.html

    #666
    Mury
    Participant

    Im having a hard time moving sprites based on x,y.Can you provide me some examples?Because Im planning in adding some collision detection sistem

    #667
    Sponk
    Keymaster

    You can use “Widget:translate(x,y)” and “Widget:setPosition(x,y)” to do that. the Widget.position field is actually read-only. It will ignore new values written into there.

    More info: http://neo-engine.de/documentation/LuaDoc/Widget.lua.html

    Btw: Sprite is sub-classes of Widget and thus inheriting all methods 😀

Viewing 15 posts - 46 through 60 (of 95 total)
  • You must be logged in to reply to this topic.