NPC/Bots implementation in VCMP 0.4 Servers

Started by habi, Apr 01, 2022, 05:37 PM

Previous topic - Next topic

habi

#75
Hi PSL, i thought so much but still could not figure where is the problem.

Can you provide me dumpfile.pcap which i can analyse to findout the cause of the kick?

It is simple process. I will explain step by step. I hope it will not trouble you.
1. Download and install Loopback Adapter from https://npcap.com/ (Downloads-> Npcap 1.77 installer for Windows )
(while installing just click next, next and finish )
2. This great tool https://www.netresec.com/?page=RawCap which will capture traffic.
3. Now open command prompt and navigate to the folder containing rawcap.exe
rawcap 127.0.0.1 dumpfile.pcap-127.0.0.1 is always the address of Loopback adapter
-This will start sniffing
4.
Do not press Ctrl+C yet
5. Start VCMP Server. NPC will connect and will get kicked.( if npc is not kicked, you can restart server again )
6. Now npc is kicked, close the server and comeback to rawcap console and press Ctrl+C
7. Hopefully you get a file dumpfile.pcap which contains cause of kicking npc.
Share dumpfile.pcap with me and i will examine the traffic towards npc to find out the problem.


Also could you check if this fixes the problem:
Quotefunction onPlayerRequestClass(player,classID,team,skin)
{
    if(state[player.ID].isnpc==true)return true;
}
function onPlayerRequestSpawn(player)
{
    if(state[player.ID].isnpc==true)return true;
}

function onPlayerSpawn(player)
{
    if(state[player.ID].isnpc==true) onNPCSpawn(player.ID);
}

PSL

Hi Habi, I did what you told me to do, and I was lucky enough to catch a kick the first time. I hope this was helpful.
Not only armor, increasing health will also result in being kicked, because I set up, after killing people to increase health, NPC health increased from 94 to 100, the NPC was kicked, the increase in health is done in the server onPlayerKill event.
I will try to catch this health increase kicked error, if there is I will change this post.
File link: https://file.io/yomPhPTtRbob

habi

#77
Thank you PSL, i am happy that you were able to record the traffic.
That will contain enough information. I will be working on it soon. thank you again

habi

Oh God, when i closely examined the file, the bug was before my eyes. It took me one minute only to fix it.

Here is a fixed version for you. Please replace the executable with the following one and tell me if the problem is fixed.
npcclient-fix.7z

thank you.

PSL

HI Habi, Thank you very much, I used the version without timer, that is, I originally sent the code to be kicked, after using this did not happen to be kicked, the NPC was never kicked from the beginning to the end, the problem has been fixed.

habi

You're welcome! I'm glad to hear that the issue has been resolved and that the NPC is no longer getting kicked.

habi

#81
NPC v1.7 Beta 3 Released - Changelog

QuoteFixed NPC getting kicked when setting armor/health/weapon from server-side

Download Links:
rel006
Windows:    Windows-installer           binary-zip

Linux x64    Linux x86    source   

rel004
Windows+Linux: binaries 


Release Notes: V1.7 Beta 3 Release Notes

It's not a major release, but the significant bug has been fixed.

habi

#82



Introducing the 'NPC Playback File Editor' - Your Ultimate .REC File Tool!

Dear Community,

We are thrilled to present the 'NPC Playback File Editor,' your essential Windows tool for playback recording files (.rec files). This playback file are usually created by StartRecordingPlayerData. This software lets you effortlessly view, edit, modify, export to Excel, and import .rec files with a simple drag-and-drop feature.

Key Features:

  • View Recordings: Seamlessly view .rec files and gain insights into your recorded data.
  • Edit and Modify: Easily fine-tune and adjust your recordings.
  • Export to Excel: Analyze your data with precision using Excel.
  • Drag and Drop: Simplify your workflow by dragging and dropping .rec files into the editor.
Unlock the full potential of your recorded data with the 'NPC Playback File Editor.'

How to Get Started:

  • Download the 'NPC Playback File Editor' from our
  • Launch the program and start editing, modifying, exporting, and importing your .rec files with ease.

Download now and elevate your .rec file handling!

Best Regards,
habi

PSL

Well done, Habi That'll be can see clearly.

PSL


habi

Thankyou PSL, it was database problem and is now solved.

PSL

Hello, habi. Can you update the save location of the recording file?  I want to save it directly in the npcscripts/recordings folder, so that it can be played back directly, without manually copying the past.

vitovc

Quote from: PSL on Feb 03, 2024, 05:39 AMHello, habi. Can you update the save location of the recording file?  I want to save it directly in the npcscripts/recordings folder, so that it can be played back directly, without manually copying the past.
Simple create a link https://en.wikipedia.org/wiki/Ln_(Unix)
...::: vice city :::...
Useful things for vcmp: Relative position and finding an angle (in 3d), 3d line (like laser)

PSL