This is where fixed bugs can be seen. Please do not post new bugs into this forum, it is purely to see what has been fixed and most topics will be locked.

Random "RAYCASTING failed to find ray" error

Random "RAYCASTING failed to find ray" error

Postby Shando » 28 Aug 2015, 10:23

Hi All,

I'm trying to get a UI to appear when the FPS Player walks into the bounds of an AI Sensor attached to a model (Sinbad seems to work fine, but Jaiqua and Ninja have this error).

The error I'm getting is:

Code: Select all
ERROR::RAYCASTING failed to find ray
LUA ERROR: Entity ID [ -1 ] was not found or it is invalid?


This error happens *most* of the time, but not always??

The code I'm using is:

Code: Select all
objJ = 0
bSensorJ = false;

function onInit ( objID )
   objJ = objID;
   sensor.enableVisibilityCheck ( objJ, 1 );
   anim.setEnabled ( objJ, "Walk", 1);
   anim.setLooped ( objJ, "Walk", 1 );
   anim.playAnimation ( objJ, "Walk", 0, 0);
end

function onSensorContact_Stay ( targetID, distance )
   if ( not bSensorJ ) then
      local sTgt = entity.getTagFromID ( targetID );

      if ( sTgt == "Player" ) then
         local isVisible = sensor.isTargetVisible ( objJ );

         if ( isVisible == 1 ) then
            if ( distance < 5 ) then
               bSensorJ = true;

               local tmpTalk = tonumber ( sky.getVar ( "talking" ) );

               if ( tmpTalk == 0 ) then
                  entity.lookatObject ( objJ, targetID, 1, 0, 0, 1 );

                  gui.show ( "Chat_HUD", "textCell9" );
                  gui.setText ( "Chat_HUD", "lbl_talk_C", "Press E to talk" );
                  sky.setVar ( "talking", 1 );
                  sky.setVar ( "talkingto", objJ );
               end
            end
         end
      end
   end
end


which is almost identical for Sinbad, Jaiqua & Ninja.

Any help would be greatly appreciated.

Regards

Shando
Ryzen 7 4800H 16GB GTX1650 Win 11 64
Love, Hope, Strength http://www.lovehopestrength.co.uk
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: Random "RAYCASTING failed to find ray" error

Postby SolarPortal » 28 Aug 2015, 12:39

i not following as much as there is no raycast in that code? Plus looking at that code i cannot see any errors.

Perhaps the error is outside of the code. The way i found the previous error was commenting out most of the code and slowly add things back into play until it stops working.

Is the error from the FPS player or from the other NPC's.

I will have a look in the scene files as well to see if i can find a problem.

Edit: The first time i ran it, both the ninja and jaiqua picked up the chat. Then the second time they stopped working and threw that raycast error.

Also, my mistake and i understand what you are meaning now with the raycast.

Edit2: The error appears when entering the AI Sensors

Edit3: I am now looking in the sensor as i think the error is internal at the moment
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: Random "RAYCASTING failed to find ray" error

Postby SolarPortal » 28 Aug 2015, 15:16

So it turns out that this is due to the Raycast being stored with the sensor is being cleared off when the game stops. This is because you enabled the visibilty Check in code i believe. Normally this wouldn't happen.
But i managed to figure out why it was happening and now i have to hunt why the ninja is not displaying.

Have you tried working without this:
Code: Select all
sensor.enableVisibilityCheck ( objJ, 1 );

for now to continue until the next patch :)

I believe this feature is too only retrieve the id when the character is in visible sight and say not behind a wall.
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: Random "RAYCASTING failed to find ray" error

Postby SolarPortal » 28 Aug 2015, 15:36

I have found out the reason why the ninja doesnt work where the Jaiqua does.

Code: Select all
Line 30: entity.lookatObject ( objS, targetID, 1, 0, 0, 1 );


The "objS" doesnt exist and needs to be "objN".

This will then work with the previous fix for you to continue for now until the next release. You will then be able to use the visibility check.
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: Random "RAYCASTING failed to find ray" error

Postby Shando » 29 Aug 2015, 00:47

Hi SP,

Thanks for all this :D

I'll get rid of the "enableVisibilityCheck" for now, it's only for a demo, so shouldn't cause too many issues.

The "objS" doesnt exist and needs to be "objN".


aaggghhhh!!!! I even checked for exactly this twice and still managed to miss one :oops: That'll teach me to copy and paste!!!!

Shando
Ryzen 7 4800H 16GB GTX1650 Win 11 64
Love, Hope, Strength http://www.lovehopestrength.co.uk
User avatar
Shando
Skyline Moderator
Skyline Moderator
 
Posts: 560
Joined: 06 Mar 2013, 22:35
Location: Moffat Beach, Queensland
Skill: Programmer
Skill: Scripter
Skill: Level Designer

Re: Random "RAYCASTING failed to find ray" error

Postby SolarPortal » 29 Aug 2015, 11:56

lol :P copy and paste and make some days very difficult :)
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


Return to Fixed Bugs

Who is online

Users browsing this forum: No registered users and 2 guests