[Plugin] RNPC - Recordfree NPCs | Control NPCs without recording | DEV

Mauzen, amazing work you got over here, thank you for such a great release but I'm having a little problem. I test my bots in a local host, they work perfectly fine. When I try them on my server they won't show up, do you know what would cause this? The server is linux
Reply

Quote:
Originally Posted by TonyII
View Post
Mauzen, amazing work you got over here, thank you for such a great release but I'm having a little problem. I test my bots in a local host, they work perfectly fine. When I try them on my server they won't show up, do you know what would cause this? The server is linux
Check correct case of all the scriptfiles, "RNPC.amx" is not the same as "rnpc.amx" in linux. Also check if you set the correct value for "maxnpcs" in the server config file.
Reply

Can it add 'OnRNPC[Take/Give]Damage'?
Reply

Quote:
Originally Posted by Mauzen
View Post
Check correct case of all the scriptfiles, "RNPC.amx" is not the same as "rnpc.amx" in linux. Also check if you set the correct value for "maxnpcs" in the server config file.
Still the same, I checked it but I couldn't see anything wrong. ;(
Reply

Anyone else is having problems with y_iterate.inc and y_hook?
Reply

I really like that you have rec file transformation I have one more suggestion and that would be the ability to specify our own rec file names. This would be really useful if your using RNPC as a rec builder for an outside plugin like FCNPC.
Reply

Quote:
Originally Posted by [uL]Pottus
View Post
I really like that you have rec file transformation I have one more suggestion and that would be the ability to specify our own rec file names. This would be really useful if your using RNPC as a rec builder for an outside plugin like FCNPC.
Okay sure, Ill also add that. Thats just a few minutes of work and can really be useful sometimes.
Reply

Quote:
Originally Posted by Mauzen
View Post
Okay sure, Ill also add that. Thats just a few minutes of work and can really be useful sometimes.
It may even be good to update the NPC mode as well to support custom playbacks as well so I hope you do that too as well.

RNPC_SetPlaybackRec(npcid, recfilename[])

Now please try and follow these ideas.

Connecting NPC's I propose to create a NPC registry system in PAWN that associates a playerid with an indexed array so it won't matter what slot a NPC gets its reference is determined by a sequential array. This will get around the trouble of the expected connection being on the wrong playerid which has always been an issue but there is more that should be done as well and I will explain some more ideas built on this idea of integrating and using RNPC with pawn.

What RNPC needs is a group connection command RNPC_GroupConnect(npcamount) it's not a very good idea from my experience to try and use NPCs dynamically the system is much easier to control when NPCs are connected statically when OnGameModeInit() is called however the function should be allowed to be called at anytime but only once.

Now that all NPCs are connected we need a watchdog to ensure that NPCs will be reconnected if one disconnects and it does happen from time to time and I don't think it is acceptable to assume that it won't happen no matter how stable things may seem with the plugin it's self there is no way to ensure the samp server it's self and NPC server won't falter.

I think all callbacks which can be triggered by NPCs should be processed in the RNPC include internally so that the gamemode will never see these messages this can cause significant issues trying to integrate NPCs into a gamemode. Furthering this concept all callbacks should use CallRemoteFunction() to call a corresponding RNPC event such as RNPC_OnPlayerSpawn(npcid).

If you are interested in seeing how these concepts can be applied I can develop a RNPC rebuild include and some other development includes such as a filterscript patch which would just cause the filterscript to ignore any NPC related callback events.
Reply

When i ran Crash Detect, ive seen some errors coming from rnpc.inc..
Code:
[11:05:39] [debug] Server crashed while executing Zombie_RNPC.amx
[11:05:39] [debug] AMX backtrace:
[11:05:39] [debug] #0 native RNPC_CreateBuild () [62de1920] from RNPC.dll
[11:05:39] [debug] #1 000af6e8 in ?? (0x00000045, 0x44e4c91d, 0xc4dfd928, 0x415b24dd, 0x3ac49ba6, 0x00000000) from Zombie_RNPC.amx
[11:05:39] [debug] #2 000b00a4 in public RNPC_OnRNPCDetectTarget (0x00000045, 0x00000013, 0x00000000, 0x44a68d2b, 0x00000000) from Zombie_RNPC.amx
[11:05:39] [debug] #3 native CallLocalFunction () [00472ef0] from samp-server.exe
[11:05:39] [debug] #4 000681b8 in public CheckNPC (0x00000045) from Zombie_RNPC.amx
[11:05:39] [debug] Native backtrace:
[11:05:39] [debug] #0 0040315d in ?? () from samp-server.exe
[11:05:39] [debug] #1 62de194f in ?? () from plugins\RNPC.dll
[11:05:39] [debug] #2 004010b6 in ?? () from samp-server.exe
[11:05:39] [debug] #3 5d3349ca in AmxCallback () from plugins\crashdetect.dll
[11:05:39] [debug] #4 5d33681f in amx_Exec () from plugins\crashdetect.dll
[11:05:39] [debug] #5 5d329b84 in CrashDetect::DoAmxExec () from plugins\crashdetect.dll
[11:05:39] [debug] #6 5d334a1a in AmxExec () from plugins\crashdetect.dll
[11:05:39] [debug] #7 004731fe in ?? () from samp-server.exe
[11:05:39] [debug] #8 004010b6 in ?? () from samp-server.exe
[11:05:39] [debug] #9 5d3349ca in AmxCallback () from plugins\crashdetect.dll
[11:05:39] [debug] #10 5d33681f in amx_Exec () from plugins\crashdetect.dll
[11:05:39] [debug] #11 5d329b84 in CrashDetect::DoAmxExec () from plugins\crashdetect.dll
[11:05:39] [debug] #12 5d334a1a in AmxExec () from plugins\crashdetect.dll
[11:05:39] [debug] #13 0047f648 in ?? () from samp-server.exe
[11:05:39] [debug] #14 0048bc2a in ?? () from samp-server.exe
[11:05:39] [debug] #15 00487e6f in ?? () from samp-server.exe
[11:05:39] [debug] #16 004969a1 in ?? () from samp-server.exe
[11:05:39] [debug] #17 004969b1 in ?? () from samp-server.exe
It happens when i restart the server (Without reconnecting them) and then createbuild ( for any purpose such as: creating movement build)

EDIT: I notice something, Createbuild crash the server after restarting the server (/rcon gmx) everything work great when you start the server, but not after restarting.
I tried to kick then and connect them again after the restart, same results.. server will crash at the end.
Reply

Hop, new version out which covers something from my include, gotta take it a look... I might change some function directly accessed to the plugin (hook ofc)..
Reply

Quote:
Originally Posted by TheArcher
View Post
Hop, new version out which covers something from my include, gotta take it a look... I might change some function directly accessed to the plugin (hook ofc)..
Your include needs to be re-written it has the right idea but doesn't address all of the issues.
Reply

Quote:
Originally Posted by TheArcher
View Post
Hop, new version out which covers something from my include, gotta take it a look... I might change some function directly accessed to the plugin (hook ofc)..
I wouldnt start immediatelly with that
Right now Im working on some bigger internal updates that might change some RNPC syntaxes, so maybe the inlcude wouldnt be compatible. Im always trying to keep new versions compatible so people dont need to rewrite their whole script, but this time I cant tell if I can keep it that way

Quote:
Originally Posted by [D]ry[D]esert
View Post
When i ran Crash Detect, ive seen some errors coming from rnpc.inc..
It happens when i restart the server (Without reconnecting them) and then createbuild ( for any purpose such as: creating movement build)

EDIT: I notice something, Createbuild crash the server after restarting the server (/rcon gmx) everything work great when you start the server, but not after restarting.
I tried to kick then and connect them again after the restart, same results.. server will crash at the end.
That server restart thing has always been an issue with RNPC. I havent seen crashes yet, mostly the NPCs just get "stupid" and wont be doing anything, sometimes they dont even spawn. Im also looking at that, hopefully this is a fixable problem, and not a general NPC bug.

Quote:
Originally Posted by [uL]Pottus
View Post
It may even be good to update the NPC mode as well to support custom playbacks as well so I hope you do that too as well.

RNPC_SetPlaybackRec(npcid, recfilename[])

Now please try and follow these ideas.

Connecting NPC's I propose to create a NPC registry system in PAWN that associates a playerid with an indexed array so it won't matter what slot a NPC gets its reference is determined by a sequential array. This will get around the trouble of the expected connection being on the wrong playerid which has always been an issue but there is more that should be done as well and I will explain some more ideas built on this idea of integrating and using RNPC with pawn.

What RNPC needs is a group connection command RNPC_GroupConnect(npcamount) it's not a very good idea from my experience to try and use NPCs dynamically the system is much easier to control when NPCs are connected statically when OnGameModeInit() is called however the function should be allowed to be called at anytime but only once.

Now that all NPCs are connected we need a watchdog to ensure that NPCs will be reconnected if one disconnects and it does happen from time to time and I don't think it is acceptable to assume that it won't happen no matter how stable things may seem with the plugin it's self there is no way to ensure the samp server it's self and NPC server won't falter.

I think all callbacks which can be triggered by NPCs should be processed in the RNPC include internally so that the gamemode will never see these messages this can cause significant issues trying to integrate NPCs into a gamemode. Furthering this concept all callbacks should use CallRemoteFunction() to call a corresponding RNPC event such as RNPC_OnPlayerSpawn(npcid).

If you are interested in seeing how these concepts can be applied I can develop a RNPC rebuild include and some other development includes such as a filterscript patch which would just cause the filterscript to ignore any NPC related callback events.
You already can play any recordings
RNPC_StartPlayback(npcid, rec[])
It was bugged in the earlier versions, but now with 0.3.3 it should work again.

"Isolating" Npcs from the normal players as you say might have some advantages. That would match my earlier ideas about having a streamable "npc pool" without the need to connect and disconnect them all the time.
But it also has some disadvantages. Working with custom indexes instead of the playerids is slower. Not a lot, but when having a lot of NPCs that also are controlled a lot, this might already be a noticeable difference.
To get around the ID problems, as long as the NPCs are connected on server start, the current version is absolutely fine. It may only return wrong IDs now, if another player connects in the small timeframe between ConnectRNPC and the connections. Thats just a matter of a few milliseconds. Very unlikely, but I also got some ideas on how to avoid even this problem.
Also there are scenarios where you dont want NPCs to be that isolated. Sometimes NPCs should be treated like any other player, e.g. for weapon and damage systems. Blocking NPCs from normal callbacks is a matter of one line, but once they are all blocked, and you want them to be considered by a callback again, you got a problem. Having custom RNPC_OnWhatever callbacks for everything would be a way around that though, but IMO with all the current callbacks, rnpc would explode and get even more confusing than it already is.

RNPC is meant to offer maximum scripting possibilities and freedom, so right now I wouldnt like to limit it that drastically. But Ill reconsider your idea.
Reply

Any date is up to know when the "big" update is coming?:P
Reply

Well, how about I develop all my ideas for you to review then so you can see for yourself
Reply

Quote:
Originally Posted by [uL]Pottus
View Post
I don't know why you guys insist on trying to get your server to use gmx it's too buggy to be reliable use a starter script instead and rcon exit.
What do you mean exactly?
Reply

Quote:
Originally Posted by [D]ry[D]esert
View Post
What do you mean exactly?
Not use 'gmx' - Better close the server (samp-server.exe) and reopen.
Reply

Quote:
Originally Posted by EnzoMetlc
View Post
Not use 'gmx' - Better close the server (samp-server.exe) and reopen.
That is so stupid, closing it will result to kick all of the connected players..
Who wants to do that?
Reply

I dont think I can fix the gmx problems. Gamemode restart has always been a buggy thing, not only for npcs but for a lot of other scripting stuff.
However, restarts shouldnt be done frequently anyways. If youre updating the server daily, you could use some watchdog that simply closes and restarts the server when its empty. Or simply give the players some time to prepare for the restart, most of them wont have a problem woth reconnecting to the server. And if some guys really get pissed off because they need to spend 20 seconds for reconnecting, be happy if they dont come back.


@first post: I added the debug version of the 0.3.3 windows include. If youre having trouble with server crashes, use this plugin and crashdetect, it will give more detailled crash infos that will help me to fix the problem
However it might be slower so I dont recommend using it for anything but testing and debugging, and switch back to the normal one when its working.
Reply

Quote:
Originally Posted by [D]ry[D]esert
View Post
That is so stupid, closing it will result to kick all of the connected players..
Who wants to do that?
Not really as mentioned we KNOW using gmx is very buggy particularly for the client so if your going to restart it's always best to use rcon exit and completely restart the server that is why you would want to do that.
Reply

Crash the server and use a auto restarter. Easiest way and done by most people.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)