Help with your scripting

Character controll what Class ?

Character controll what Class ?

Postby SpiderMack » 04 Dec 2016, 22:49

I have a character on floor, i add "Character simple Controller"
If i add script with code from APi it crashes, character model as right Physix character controller used with right API class, why crash :x ?
http://www.chi-ad.com/Skyline/API/Lua/html/classcontroller.html

Code: Select all
  function vector3()v3={x=0,y=0,z=0}return v3;end

        obj             = 0;
        timer_Interval1 = 1000; --( time in ms ie 1000ms = 1sec )
        walkSpeed       = 2.0
        rotDelay        = 380; -- larger for quicker move
        currentDelay    = 0;
        cYaw            = 0;
        posID           = -1;
        pos             = vector3();
        rayID = 0; 
        range = 10

        RadiusOffset = 0.4;

        function onInit(objID)
            obj = objID;
            controller.setData_Offset(0,-1.0,0);
            controller.setData_characterHeight(1.0);
            controller.setData_shapeType(0);
            controller.setData_characterWidth(0.3);
            controller.setData_stepOffset(0.4);
            controller.setData_gravityY(-4);
            controller.setData_slopeLimit(60);
            controller.setData_flipDirection(0);
            controller.setData_skinWidth(0.1);
            controller.setData_upDirectionIndex(1);
            dccID = controller.spawn(obj);
            controller.setJumpDownforce(dccID,30); 
            spawnMarker();
            rayID = physics.createRay();
            physics.rayDebugLines(rayID,1);
        end

        function spawnMarker()
            x,y,z = entity.getPosition(obj);
            posID = entity.spawn("Cylinder_BarrelSize",x,y+0.5,z,1,1,1);
            entity.setMaterialName(posID,"transparent");
            pID = physics.addBody(posID,0, 1);
            entity.setShadow(posID,0);
        end

        function onMouseDown( button, x, y )
            pos.x,pos.y,pos.z = sky.raycastToCursor();
            physics.setPosition(pID,pos.x,pos.y+0.5,pos.z);
            moveSpd = walkSpeed;
        end     

        function onUpdate( td )
            x,y,z = entity.getPosition(obj)
            dx,dy,dz = entity.getLocalOrientationByAxis( obj, 0,0,1 );
            qw,qx,qy,qz = entity.getWorldOrientation(obj)
            x=x+(dx*RadiusOffset);
            y=y+(dy*RadiusOffset)+0.8;
            z=z+(dz*RadiusOffset);
            hitID,pox,posy,posz = physics.rayFromPoint(rayID, x,y,z,qw,qx,qy,qz,-range);
           
            if(td>40) then td = 20; end
            controller.move(dccID, moveSpd );
            currentDelay = rotDelay * (td*0.001);
            trackTarget();
            if(controller.getCollisionFlag(dccID)==5 and moveSpd > 0) then
                moveSpd = 0;
                sky.trace();
            end
        end

        function trackTarget()
            entity.setRotation(obj, 0,0,0);
            yawDeg      = entity.getHeading(obj,posID);
            cYaw        = getYawLerp(cYaw, yawDeg);
            entity.yaw(obj, cYaw, 0);
        end

        -- | Get the Yaw Lerped values.
        function getYawLerp( currentYaw, yawDeg )
            if(     currentYaw > 180 ) then currentYaw = -180;
            elseif( currentYaw < -180 )then currentYaw = 180; end

            if(currentYaw >= yawDeg-currentDelay and currentYaw <= yawDeg+currentDelay )then
                currentYaw = yawDeg;
            else   
                if(currentYaw > 90 and yawDeg < -90 or currentYaw < -90 and yawDeg > 90 )then
                    if(     currentYaw > yawDeg)then    currentYaw = currentYaw + currentDelay;
                    elseif( currentYaw < yawDeg)then    currentYaw = currentYaw - currentDelay;  end
                else
                    if(     currentYaw > yawDeg)then    currentYaw = currentYaw - currentDelay;
                    elseif( currentYaw < yawDeg)then    currentYaw = currentYaw + currentDelay; end
                end
            end
            return currentYaw;
        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: Character controll what Class ?

Postby epsilonion » 04 Dec 2016, 23:43

Are you using Gen2?

If so there, we only got Gen2 dropped to us for testing a few weeks ago so there are issues and issues with the API, its is good that you are reporting issues and helps get on top of the issues around new iterations of software while its in test..

Can you zip up and upload the files below to this thread so that all of the error messages etc are available it makes tracking and finding the errors easier and faster for the development team and helps them respond to you quicker.

Files required:
(where ever you installed) a place such as:

C:\skylinegen2\skyline\win32_release\

  • Skyline_TechSupport
  • Skyline_HardwareCaps
  • Skyline.log file
  • Skyline FBX Log - Skyline FBX Converter (not required usually but good practice to send for when it is needed :lol: )


Thank you
User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: Character controll what Class ?

Postby SpiderMack » 05 Dec 2016, 01:03

Yes Gen2.
Devs should make new gameplay tutorials from scratch, setp by step, they'll find bugs.
Basics not working and crash always, so terrain devs are working on is useless for Lua users.
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: Character controll what Class ?

Postby SolarPortal » 05 Dec 2016, 11:49

That script is for a spawned controller. See the oninit function.

You say you added the Simple Character Controller action... then you need to use the character.library() :)

It shouldnt have crashed though. :)
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: Character controll what Class ?

Postby SpiderMack » 05 Dec 2016, 12:28

I made again the same test i already made using scritpt exemple from APi doc for Characeter Class, with Character Simple Controller for the 3D model character. It crashes as always.
Gen 2 is broken, try yourself , stop ignoring editor issues.
Image
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: Character controll what Class ?

Postby epsilonion » 05 Dec 2016, 12:50

Editor issues are not been ignored they are on the list if things to do.

Did you stop to think that there are other users with issues and not just you? Are you just trolling? You knew when you bought the software that it is in beta and gen2 had just dropped so there are issues..

You expect software to work 100% when it's in development and new iterations of the software have Just been released and there will be problems so why the attitude? I think maturity may be an issue here
User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: Character controll what Class ?

Postby epsilonion » 05 Dec 2016, 13:04

Sorry if I come across shitty I don't mean to its that you know there are issues with characters as I pm you with the porting from gen1 to gen2 that clearly explains that they are issues with characters and more.

Why come with attitude if you bothered to read the notes in the first place?

Like that long pm you sent me and I replied nearly all of the features you mentioned apart from 2 or 3 where already high priority tasks or already implemented, I also stated that new documentation is on its way and video tutorials etc etc

I seem to be going over the same things time and time again here..

Again sorry if I came across as been hostile it's notyour intention
User avatar
epsilonion
Skyline Lead Moderator
Skyline Lead Moderator
 
Posts: 874
Joined: 26 Feb 2015, 11:51
Location: Hull, East Yorkshire, England
Skill: Business Manager
Skill: Great creative

Re: Character controll what Class ?

Postby SolarPortal » 05 Dec 2016, 14:15

i have replicated the crash on the character and i am looking into it now :)

It also crashes without adding any actions apart from the script you first posted. It is crashing when creating the controller and setting its position for the first time. i will keep you informed :)

edit: This is the code that crashes:
Code: Select all
function spawnMarker()
            x,y,z = entity.getPosition(obj);
            posID = entity.spawn("Cylinder_BarrelSize",x,y+0.5,z,1,1,1);
            entity.setMaterialName(posID,"transparent");
            pID = physics.addBody(posID,0, 1);
            entity.setShadow(posID,0);
end
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: Character controll what Class ?

Postby SpiderMack » 05 Dec 2016, 14:32

i have replicated the crash on the character and i am looking into it now :)

It also crashes without adding any actions apart from the script you first posted. It is crashing when creating the controller and setting its position for the first time. i will keep you informed :)

You see, you try to use engine code or character controller crash, very big problem :lol:
This is what i think about Gen 2 , it's beginnings not usable , not Alpha, graphics or terrain super useless if engine can't correctly be programmed.
Work on tech demos first , make Gen 2 usable, have coding working it is more important, all tech features or terrain comes after, Lua coding and APi calls must not have bug than proper Alpha can start.
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: Character controll what Class ?

Postby SolarPortal » 05 Dec 2016, 22:44

Update: There was a shader error generated at the bottom of the "Skyline.log". can you confirm please?
This error was fixed after that update released and the crash i experienced this morning was a second hidden bug which i am searching for now. However, after the 1 crash this morning it never broke again.
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: Character controll what Class ?

Postby SpiderMack » 05 Dec 2016, 22:51

I made test again with Gen 1, same test it crashes.
I found why it doesn't work, and find a way to make it work, it's not Lua code problem ,not shader problem , not character settings.

You say it was shader problem ? Are you sure , are you are able to run my example ?
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: Character controll what Class ?

Postby SolarPortal » 06 Dec 2016, 00:09

I ran it on the free version of Gen1 and the code works fine.

Even our Gen2 seems to be behaving with it now after the finds.

You say you found a fix, would you mind sharing?
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: Character controll what Class ?

Postby SpiderMack » 06 Dec 2016, 00:13

I am not sure we are talking same issue and example test, found a big issue instead, solution is to use Micrographs.
http://www.forum.aurasoft-skyline.co.uk/viewtopic.php?f=14&t=1750
Lua crash and too much slow, bring C++ or C#
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 Lua Scripting

Who is online

Users browsing this forum: No registered users and 6 guests

cron