HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] Lightweight Node ID not found  (Read 3382 times)

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
[Resolved] Lightweight Node ID not found
« on: Sep 17, 11, 05:28:58 AM »

In the input_mouse script (default Clean Engine one)
I have this
Code: [Select]
function OnMouseClick(lmb as Boolean, rmb as Boolean, mmb as Boolean, mb4 as Boolean, mb5 as Boolean) as Boolean
 debugDrawPhysXCollisionRaycast(GetNodeUnderMouse())
return true
.
Then the function
Code: [Select]
function debugDrawPhysXCollisionRaycast(nodeToTest as NodeRef of Class HBNode)
  distanceFactor as Integer = 5
  sourcePosVec as Vector3
  sourceRotVec as Vector3
 
  headingVec as Vector3
 
  targetingRay as Vector3
 
  //Get our source node position and rotation
  GetNodePosition(nodeToTest,sourcePosVec)
  sourceRotVec = GetNodeRotation(nodeToTest)
  sourceRotVec.y = MungeHeadingDegrees( sourceRotVec.y - 90 )
  sourcePosVec.y = 0.1
  //calculate our 'heading' vector from our current rotation
  headingVec.x = -sine(sourceRotVec.y)
  headingVec.z = -cosine(sourceRotVec.y)
 
  //multiply by our 'see' distance
  headingVec *= distanceFactor
 
  //construct our collision ray from our source position, aimed in the direction our node is facing (and with a distance of distanceFactor units)
  targetingRay = (headingVec)
 
  collideIntercept as Vector3
  collideNormal as Vector3
  collideNode as NodeRef
  $Debug._drawDebugConeOuterLines(sourcePosVec,3.0,targetingRay,1,5,10.0,"#0,1,0")
.
After Clicking(Which wil run the function debugDrawPhysXCollisionRaycast) it works once.  Then if I click again. I get this error: SCRIPT ERROR: In function GetNodePostition: LightWeight Node ID not found

If I ignore that error and keep clicking it will eventually work once more. 
It works every time if I click on any other object but my character.

This used to all work before.(about a week ago) The only changes I made that could maybe be the issue, I made my own character prototype to use. With a game specific PlayerCharacter Class.
« Last Edit: Nov 02, 12, 08:54:18 PM by HE-Cooper »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Lightweight Node ID not found
« Reply #1 on: Sep 17, 11, 08:54:36 AM »

Which specific line of code produced the error?
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Lightweight Node ID not found
« Reply #2 on: Sep 17, 11, 05:57:06 PM »

 GetNodePosition(nodeToTest,sourcePosVec)
« Last Edit: Sep 17, 11, 06:14:53 PM by Jrome90 »
Logged

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: Lightweight Node ID not found
« Reply #3 on: Sep 17, 11, 06:55:23 PM »

The last publish added additional raycast targeting functionality, so just keep that in mind. No clue if that has anything to do with your current functionality changing.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Lightweight Node ID not found
« Reply #4 on: Sep 17, 11, 07:24:52 PM »

I tried this out and found it to be the case.  Seems to miss many times.  Oddly, with my standard Ranger character, even when in edit mode, I can only select it by clicking the box around his left foot, as shown in red.  Clicking anywhere else does not select him.  Perhaps something did happen to raycasting.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Lightweight Node ID not found
« Reply #5 on: Sep 17, 11, 07:29:11 PM »

I am not sure what the gray boxes are versus the yellow box (which is presumably the overall bounding box), but characters we have which only show one gray box always are clickable anywhere, so it would seem that clicking only works on one gray box of a model.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Lightweight Node ID not found
« Reply #6 on: Sep 17, 11, 07:31:06 PM »

The last publish added additional raycast targeting functionality, so just keep that in mind. No clue if that has anything to do with your current functionality changing.

Thanks, kinda what I wanted to hear..
After clicking the mouse many times here is what the results are.

Each number represents how many times I had to click on my character to get the function "GetNodeundermouse" to return a node ID ( from 1-20 times it returned a valid node ID) Of course after the # of times clicked the next click was actually the successful click.
Each click was on the characters back. (all clean engine character content)

  • 2 then it worked
  • 3 then it worked
  • 1 then it worked
  • 2 then it worked
  • 3 then it worked
  • clicked once then it worked
  • 9
  • 5
  • 3
  • 2
  • 5
  • 1
  • clicked once then it worked
  • clicked once then it worked
  • 1
  • clicked once then it worked
  • 27
  • 1
  • 1
and
  • 7
As you can see, very inconsistant
« Last Edit: Sep 17, 11, 07:32:56 PM by Jrome90 »
Logged

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Lightweight Node ID not found
« Reply #7 on: Sep 17, 11, 07:38:28 PM »

I tried this out and found it to be the case.  Seems to miss many times.  Oddly, with my standard Ranger character, even when in edit mode, I can only select it by clicking the box around his left foot, as shown in red.  Clicking anywhere else does not select him.  Perhaps something did happen to raycasting.

For me, clicking on the characters feet makes it so I can't select the character anymore. I have to deselect the ground, then click on the character anywhere but the feet.
« Last Edit: Sep 17, 11, 07:41:29 PM by Jrome90 »
Logged

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: Lightweight Node ID not found
« Reply #8 on: Sep 19, 11, 02:04:21 PM »

Jay is investigating, looks like something might have changed that should not have changed in all places possibly. Will let you know.
Logged

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Lightweight Node ID not found
« Reply #9 on: Sep 19, 11, 05:23:26 PM »

Jay is investigating, looks like something might have changed that should not have changed in all places possibly. Will let you know.

Thanks for the update
Logged

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: Lightweight Node ID not found
« Reply #10 on: Sep 19, 11, 08:48:32 PM »

Stay tuned for updates on possible brokeness and fixingness. The chain of events leading to this problem was at least entertaining to watch unfold.  :o
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Lightweight Node ID not found
« Reply #11 on: Sep 19, 11, 09:07:26 PM »

No truth to the rumors that "fixingness" is Stephen Colbert's upcoming Word. ;D
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Jrome90

  • General Accounts
  • *
  • Posts: 330
    • View Profile
Re: Lightweight Node ID not found
« Reply #12 on: Sep 25, 11, 04:54:08 PM »

Thanks to the HE staff for the quick fix.
Logged