Jump to content

unknown reason for Failed to construct Vector3D object error [solved]


Recommended Posts

while working on patching Unit AI component for adding support for separating rider/horse entities. I found that when ordering a rider to hunt animals that are in FOW I always get the error Failed to construct Vector3D/Vector2D object. (although in the last patch the hunt and gather works well despite the error)

these two versions of code are usually source of error (line 2136 in the component):

let cmpTargetPosition = Engine.QueryInterface(this.order.data.target, IID_Position);
let pos = cmpTargetPosition.GetPosition();

and

let cmpTargetPosition = QueryMiragedInterface(this.order.data.target, IID_Position);
let pos = cmpTargetPosition.GetPosition();

both are throwing the same error but only the first one works perfectly despite the error.

  • Like 1
Link to comment
Share on other sites

21 hours ago, vladislavbelov said:

Do you have steps to reproduce?

it would be reproduced whenever is in infinite recursion. in my case infinite state switching. when I detected the bug I fixed it and now working on fixing other bugs.

the rest of the bugs left mostly related to not having proper states. one of them caused unit motion in fleeing state to not work properly as if the detected range was increased than real range. which cause the hunt target not fleeing if hunted by rider.

 

Link to comment
Share on other sites

4 hours ago, man_s_our said:

it would be reproduced whenever is in infinite recursion. in my case infinite state switching. when I detected the bug I fixed it and now working on fixing other bugs.

In that case the error might happen because of stack overflow/out of memory. If you replace it by a loop (with the same number of steps like for the recursion) in theory it shouldn't fail.

Link to comment
Share on other sites

  • man_s_our changed the title to unknown reason for Failed to construct Vector3D object error [solved]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...