SA-MP Forums [Plugin] FCNPC - Fully Controllable NPC
 New Account Members List Search Today's Posts Mark Forums Read

 11/03/2018, 01:20 PM #3541 jop9888 Big Clucker   Join Date: Mar 2009 Posts: 140 Reputation: 4 Re: FCNPC - Fully Controllable NPC So, i've put some more intensive logging into place and see that when they become invisible, they instantly call FCNPC_OnReachDestination when you use FCNPC_goto on them: Code: `[14:07:09] [FCNPC_OnReachTaskDest] Gangbot[0][9]: X: 2415.91, Y: -1223.22, Z: 24.62` Code: ```[14:07:11] [HandleFCNPCGangBotExitVeh] Gangbot[0][9]: X: NaN, Y: NaN, Z: 24.48 [14:07:11] Calculating route to Node 9 from Node 0 for GangBot_0_9``` Code: ```[14:07:11] [HandleFCNPCGangBotExitVeh] Gangbot[0][9]: X: NaN, Y: NaN, Z: 24.48 [14:07:11] Calculating route to Node 9 from Node 0 for GangBot_0_9 [14:07:11] Path finding algorithm stopped, path found for destination node: 9 [14:07:11] Path: 0, 1, 11, 10, total dist: 34.00 [14:07:11] Path calculate time: 0:00.3``` Hence, it should take at least a minute before the NPC walked though those nodes, but instantly FCNPC_OnReachDestination got called several times as if the NPC is instantly at the desired location. Code: ```[14:07:11] GangBot_0_9 reached his destination, setting up new route... [14:07:11] Calculating route to Node 36 from Node 21 for GangBot_0_9 [14:07:11] Path finding algorithm stopped, path found for destination node: 36 [14:07:11] Path: 21, 18, 5, 6, 15, 14, 8, 16, total dist: 104.00 [14:07:11] Path calculate time: 0:00.3```
 11/03/2018, 01:49 PM #3542 jop9888 Big Clucker   Join Date: Mar 2009 Posts: 140 Reputation: 4 Re: FCNPC - Fully Controllable NPC Ok so i found the part of code that is causing the bug, but i have no clue why though: Thanks to NaS i've found my way around the quaternions, so i'am adjusting them for NPC's in vehicles with FCNPC_SetQuaternion. When i comment the one line where i adjust the quaternions the bug is gone, but i dont adjust the quaternions during the exit time: Code: ```[14:40:31] Quaternions adjusted for gangbot[0][0] [14:40:33] [FCNPC_OnReachTaskDest] Gangbot[0][0]: X: 2415.91, Y: -1223.43, Z: 24.61 [14:40:35] [HandleFCNPCGangBotExitVeh] Gangbot[0][0]: X: NaN, Y: NaN, Z: 24.47```
 11/03/2018, 02:17 PM #3543 jop9888 Big Clucker   Join Date: Mar 2009 Posts: 140 Reputation: 4 Re: FCNPC - Fully Controllable NPC Ok i found it, since it didn't happen to all the NPC's i found a relation. It happends to NPC's that drive a greater distance to their last node, then when FCNPC_OnReachDestionation gets called they still have alot of speed and sort of jump out of the vehicle. Then they get bugged. I've had more problems with this, as it seems FCNPC_OnReachDestination gets called to early, when you stop a NPC that reaches a node in a vehicle, he stops quite a distance before the node itself. Setting the quarternion of the vehicle makes it crash because i suppose the OnReachDestination got called to early and the NPC's jump out of a vehicle with quarternions set or something? The problems are gone now i added an extra node close to the end node, so the NPC's don't jump out of their vehicle.
 15/03/2018, 09:50 PM #3544 beybedragon Little Clucker   Join Date: Dec 2013 Posts: 24 Reputation: 1 Re: FCNPC - Fully Controllable NPC Dependencies link please!
15/03/2018, 11:08 PM   #3545
Freaksken
Gangsta

Join Date: Mar 2009
Location: Belgium
Posts: 560
Reputation: 236
Re: FCNPC - Fully Controllable NPC

Quote:
See this wiki page.
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.

[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like co-op mission - [Other] List of all my work

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post [Include] Controllable NPC Lorenc_ Includes 101 02/06/2014 06:08 AM [LCK]Chris Plugin Development 82 16/05/2014 02:16 PM HighPitchedVoice Scripting Help 5 25/05/2012 09:38 PM Qeux Help Archive 3 17/03/2011 02:24 AM Andreq Русский/Russian 5 25/10/2010 07:57 AM

All times are GMT. The time now is 05:02 AM.

 -- (EN) English -- (RU) Русски Contact Us - SA-MP - Archive - Top