I am having weird bug where my mod crashes for only one of my playtesters. It always happens when one of my custom NPCs tries to pick up a physics object.
The object carrying code is similiar to the one of dog's except with few changes. First of all, unlike Dog, my NPC will often move while holding his object. I am updating the shadow position to the one of the NPCs (just like dog did) in the think function of the NPC. I also wanted to avoid the object from going inside walls. In the think function I added a hull trace that detects this and adjusts the local origin of the prop. I have been trying changing the order of the calls to create the shadow controllers and set the move types and parents. With some of those changes I was able to avoid another crash that would happen if the NPC would be standing on the object when trying to pick it up. If I tried to update the vphysics position with SetPosition in the think function it would crash for my playtesters right away, but without it would only crash when the NPC would drop the object. The dump files direct me to, a lot of times to just vphysics.dll files and what have you, and some times to the SetMoveType function. Looking at SetMoveType and other similiar functions like CollisionRulesChanged I see that when you set SetMoveType you already need to have shadow controller or it will give a warning message. How do Shadow Controllers work exactly? In my SetShadow function should I set allowPhysicsMovement and allowPhysicsRotation to true? Should I UpdateShadow to the position of the NPC or the prop? I was looking at the CBaseEntity teleportation code and I noticed the g_Notify->ReportTeleportEvent() call. Would adding something similiar to this, or call to CBaseEntity::Teleport on my DropObject() function help with the crash?
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders