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

Confusing Simple Character Controller (ACTIVE)

Confusing Simple Character Controller (ACTIVE)

Postby SpiderMack » 03 Dec 2016, 16:34

I open tech demo "Simple character demo Darlek"
Character we control has "Simple Character Controller" in "properties panel", it displays ,it has "SCC collisions" in properties.
If i drop a cylinder and add "Simple Character Controller" physix, in properties it has it has "SCC Flags" instead of "SCC Collisions" ?
what is going on ? :x
If i had same Lua script to my cylinder it crashes ? why ? It should run :x
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: Confusing Simple Character Controller

Postby SolarPortal » 03 Dec 2016, 21:49

Are you using the tech demos in the Gen2 build or Gen1 build.

Gen2 tech demos are not yet upgraded apart from the action attach demo, this could be why you are receiving errors.
As for the different property name, i will have too look myself as it sounds like an out of date preset or scene file that needs upgraded.
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: Confusing Simple Character Controller

Postby SpiderMack » 03 Dec 2016, 22:08

I use Gen 1.

Drop character in scene, add "Simple Character Controller" , and add Lua script below (from Character Class Api doc), run it crashes.

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, turnSpeed * td, 0)
        elseif (input.keyDown("l")==1) then entity.turn(obj, 0, -turnSpeed * td, 0)
        end

        --Requires the action property "SCC Use Simple Move" to be disabled
        --character.setMoveDirection(obj,0,0,1);

        --Simple detection based on the collision flags
        --collisionDetection();
       
        --to use the up/down gravity must be reduced for this to have an effect
        character.moveUp(obj, moveUPSpd)
        character.move(obj, moveSpd );
        character.doStrafe(obj, moveStr );
    end

    function collisionDetection()
        -- flag = 4 results when the object hits the floor
        -- flag = 2 results whent he object hits the roof
        -- flag = 5 results when the object hits a wall
        if(character.getCollisionFlag(obj) == 4) then character.invertGravity(obj,1); end
        if(character.getCollisionFlag(obj) == 2) then character.invertGravity(obj,0); end
    end

    function onCollisionDownEvent()
        --Collision when CC hits the ground
    end

    function onKeyDown( key )
        if(key=="space") then character.doJump(obj,550); end
        if(key=="1") then gvty = 1-gvty; character.enableGravity(obj,gvty); end
        if(key=="2") then inv = 1-inv; character.invertGravity(obj,inv); end
        if(key=="3") then character.setGravity(obj, 0, -0.5, 0); end
        if(key=="4") then character.setGravity(obj, 0, -10, 0); end

        if(key=="5") then
            x,y,z = character.getPosition(obj);
            sky.lprint("X:"..x.."  Y:"..y.."  Z:"..z);
        end
       
        if(key=="6") then character.setPosition(obj, 0, 10, 0); end
        if(key=="7") then character.moveUp(obj, 5); 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


Return to Active / New Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron