These are where you post a new bug you find in the engine and will responded to asap.

Code crash (ACTIVE)

Code crash (ACTIVE)

Postby SpiderMack » 03 Dec 2016, 12:39

I added Simbar model on level, added Simple Character Physix, added script below.

Add line "entity.turn(obj, 0, 1 * td, 0) " make crash when run game.

Code: Select all
 obj             = 0;
    walkSpeed       = 30;
    turnSpeed       = 0.3;
    upSpeed         = 20;
    inv             = 1;
    gvty            = 1;

    function onInit(objID)
        obj = objID;
        character.setJumpDownforce(obj,850);
        character.setGravity(obj, 0, -10, 0);
    end

    function onUpdate( td )
        moveSpd     = 0;
        moveStr     = 0;
        moveUPSpd   = 0;
       
        if(input.keyDown("i")==1)  then moveSpd     = walkSpeed; end
        if(input.keyDown("k")==1)  then moveSpd     = -walkSpeed; end
        if(input.keyDown("u")==1)  then moveStr     = walkSpeed; end
        if(input.keyDown("o")==1)  then moveStr     = -walkSpeed; end
        if(input.keyDown("y")==1)  then moveUPSpd   = upSpeed; end
        if(input.keyDown("h")==1)  then moveUPSpd   = -upSpeed; end

       if (input.keyDown("j")==1) then
         entity.turn(obj, 0, 1 * td, 0)
        end
    end
 
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter

Re: Code crash

Postby SolarPortal » 03 Dec 2016, 12:42

ok, thanks will have to check this one out.

To move an entity that has a simple character controller, then use the character.library() in lua.
If you spawn a dcc(dynamic character controller) in lua, then you need to use controller.library().

If you are trying to move simple physics rigidbodies, then use the phyiscs.library() where the force commands are.

If you have no physics at all and its a plain entity, then use the entity.library() movement commands. The entity commands are still usable but the ones that handle translation have to use their specific libraries.

Hope this helps :D
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Code crash

Postby SpiderMack » 03 Dec 2016, 12:48

I use example from official API doc :x

http://www.chi-ad.com/Skyline/API/Lua/html/classcharacter.html

Code: Select all
   function onInit(objID)
        obj = objID;
        character.setJumpDownforce(obj,850);
    end


Call character.setJumpDownforce make it crash. Script don't know what is character object.
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter

Re: Code crash

Postby SolarPortal » 03 Dec 2016, 12:50

Gen2 scripting may have bugs in certain commands as changing rendersystem, models, materials affected how alot of things work especially from script. Keep reporting broken lua commands and we will get them fixed :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Code crash

Postby SpiderMack » 03 Dec 2016, 13:09

You need to make stable before new graphics. Users need stable engine whatever graphics.
Code: Select all
To move an entity that has a simple character controller, then use the character.library() in lua.
If you spawn a dcc(dynamic character controller) in lua, then you need to use controller.library().

Why you not test basic functionnalities ? it's more important.

1) make empty level, add character model, add "Simple Character Controller" Action, calling Lua script
"character.setJumpDownforce(obj,850); " make crash , what is the problem ?

2) examples from SDK uses characters without Actions, but Lua code works and know what is "controller"
Code: Select all
controller.setData_Offset(0,-1.0,0);
controller.setData_characterHeight(1.0);
controller.setData_shapeType(0);
controller.setData_characterWidth(0.3);

This is confusing , why ? Is controller part of Entity base class ?
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter


Return to Active / New Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron