NPC/Bots implementation in VCMP 0.4 Servers

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

Previous topic - Next topic

Mikimon

Hello Habi. Im facing an issue when I start server with a recording which i made using a custom weapon. Seems when the NPCs receives the custom wep they got disconnected. Do you have any clue? :'(

https://imgbb.com/YNHCRf3

habi

Quote from: Mikimon on Dec 20, 2022, 07:35 AMHello Habi. Im facing an issue when I start server with a recording which i made using a custom weapon. Seems when the NPCs receives the custom wep they got disconnected. Do you have any clue? :'(
It is because npc is sending packets to server containing weapon which was not allocated to it by Server. You can add the custom weapon id 100 in the npc's class (server.conf or AddPlayerClass). Or try player.SetWeapon on onPlayerSpawn or onPlayerRequestSpawn.

Gulk

@Mikimon another option would be adding the line

anticheat 0

to server.cfg

habi

#33
I have built a patch for npc's not remaining inside vehicle as passengers.
Now, the npc program will understand server's PutInVehicleSlot command and sends passenger sync. It also updates npc's position (locally so that it can be get inside npcscripts) (server will update npc's position to that of vehicle once the sync arrives).

also it no more returns 'null' on player.Vehicle


Now npc remain seated inside the vehicle as passenger and do not go back.

It took me to examine the passenger sync packets of server/client, the intervals in which they are send.

Once again, now passenger syncs are automatically send. However two new functions are added 'SendPassengerSyncData' and 'SetPSLimit' through which you can disable automatic passenger syncing and specify manual if necessary( for high accuracy maybe ).

Other changes
Better health and armour syncing
OnPlayerUpdate gets called for PLAYERUPDATE_PASSENGER
Team and SkinIds of players can be get.

Downloads links
Windows npcclient-v1.5-patch1-setup.exe (sourceforge.net 12.0 MB ) (includes VC_redist.x86.exe)
Linux x64 npc_vcmp_linux_x64_v1.5_patch1.tar.gz ( "
 802 KB)
Linux x86 npc_vcmp_linux_x86_v1.5_patch1.tar.gz ( " 876 KB)

If you have version 1.5, it is enough to download the new binary below:
npc_vcmp_binaries_v1.5_patch1.zip (Contains npcclient.exe and recupdate.exe) (262 KB Dropbox)

npc_vcmp_binaries_v1.5_patch1_linux_x64.zip (732 KB " )

npc_vcmp_binaries_v1.5_patch1_linux_x86.zip (806KB " )

Yyg


habi

#35
A quick patch for getting console inputs.


Note that the following functions have an additional parameter (true/false) to enable console input now.
ConnectNPC, ConnectNPCEx

The npcscripts have callback
function OnConsoleInput( text ){ }

Binaries (only) - npc-vcmp-1.5-patch2-all-binaries.zip (linux, windows, x86, x64) (4MB Dropbox)

Sebastian


habi

Another version has been released few days back. V 1.6 alpha( view release notes )

QuoteWhat is new?
>Support for both rel004 and rel006 servers
>NPC now can send vehicle syncs (as driver)
>Introduced npc-plugins which can be loaded with the program.
>Added Vector, Quaternion classes and updated parameters of few functions which are using them.

chit-chat
My idea of plugins is to create three plugins- one of them will automatically reduce health of npc if a player shoots him, another will add function like ShootPlayer (or set_npc_kill_player ) to the npcscript or serverscript so that npc attacks player without the use of timers and all. However, all this needs another update since in this alpha version, squirrel vm (the famous, HSQUIRRELVM v was not exported.)

Chicken

Good Plugins habi,but  It would be great if this plugin can be used without occupying Max player, and I think less than 100 NPCs is not enough to satisfy developers

habi

Thanks Chicken. However, there is no way to save player slots.

Npcs can be hidden from the VCMP Browser. see here


Sebastian

Quote from: habi on Jan 14, 2023, 12:44 PMThanks Chicken. However, there is no way to save player slots.

Npcs can be hidden from the VCMP Browser. see here

This is truly cool! Now server owners cannot be accused for faking players count anymore :o

Chicken

Quote from: habi on Jan 14, 2023, 12:44 PMThanks Chicken. However, there is no way to save player slots.

Npcs can be hidden from the VCMP Browser. see here


I have tried, using the HideNPC plugin, NPC will not display it on the browser, but it will still be counted as a player in the server

habi

#42
Quote from: Sebastian on Jan 14, 2023, 07:21 PMThis is truly cool! Now server owners cannot be accused for faking players count anymore :o
Thanks and in the next version of npc04relxx, it can set the max player in browser, to an integer.

Quote from: Chicken on Jan 14, 2023, 09:36 PMI have tried, using the HideNPC plugin, NPC will not display it on the browser, but it will still be counted as a player in the server
Mm. But if you are good at GUI, you can make your own GUI on F5. (Keybinding). Also, disabling nametags (and probably creating custom one for players). Death messages and connection messages also could be disabled and manual one used.

habi

#43
Small update..Introduction of a module
It is weird that when you hit an npc with fists, hammer, baseball bat, etc nothing happens to npc. So i made something - a dll that it automatically takes care of it.

Put the file npcmodule.dll in npcscripts/plugins folder ( Create plugins folder if not exists )

and

ConnectNPC("[npc]tk123", "", false, "", "npcmodule");
The module take care of attack to npc from other players. It also sends a command /iamunderattack pid where pid is the id of the player who attacked, to the server. 

If npc is attacked with a gun, still it sends the message(command), but i have decided to avoid decrease of health as it is very complicated. You can do it in server side if you wish.


Module and binary (You must have 'v1.6 alpha' beforehand): npc-vcmp-1.6-alpha-patch.zip (4.15 MB)

module source: npcmodule.zip

Changelog v1.6-alpha-patch
There is no change, except in plugin header. It can be viewed from module source. Squirrel VM is now exported.
Note: In Linux, the command to connect changes to
ConnectNPC("[npc]some_guy", "", false, "", "npcmodule64.so");  //extension .so is required

Mikimon

Habi bro, Im having an issue. This is pterodactyl panel



Can you help me pls?  ::)