NPC implementation in VCMP 0.4 Servers

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

Previous topic - Next topic

habi

#45
Quote from: Mikimon on Mar 07, 2023, 04:09 PMHabi bro, Im having an issue. This is pterodactyl panel
...
The index 'ConnectNPC' does not exist.
Hi Mikimon, i think the so called plugin 'npc04relxx' is not loaded in your panel. Did you forget to add to plugins line in server.cfg?

habi

#46
v.1.6 beta3 released on last month.
Link: Relase Notes and Downloads
Quote1.6 beta 2
*Now Vector.Length() and Vector.Normalized() functions to get magnitude and normalized copy of vector respectively.
*Added fields for SetLocalValue, GetLocalValue: V_ONFOOT_SPEED, V_AIMPOS, V_AIMDIR, V_POS, Q_CAR_ROTATION,
F_CAR_HEALTH, I_CAR_DAMAGE, V_CAR_SPEED, F_CAR_TURRETX, F_CAR_TURRETY.
*Bug fixed for function 'EnterVehicle'
*Bug fixed npc getting kicked for 'acquiring weapon' when exiting vehicle.
1.6 beta
*Supports reading and writing ServerData(Streams)
*LibRPC (Remote Procedure Calls) module available and included in npcscripts/plugins so that functions of NPC can be called from Server side( See RFC, F )
*Fixed a major bug while using ConsoleInput in linux( program would wait indefinitely unless Enter key is pressed )
*The functions of npc04relxx are exported.
*NPC dies if health set to zero from server
*NPC can attack player with guns with a single function ShootPlayer, added by the module LibAction.

Example:
RFC(0, "QuitServer")()This code is in scripts/main.nut.  It will execute the function 'QuitServer' in npc with id 0. As a result,  that npc disconnect itself. This is Remote Call Procedure.

habi

Linux plugin to connect npc's have an issue:
QuoteThe index 'ConnectNPC' does not exist.

This is fixed
Download npc04rel64.so

Kenneth Law

habi!! I'd like to say you really did a good job as you are more than making NPCs for VCMP. It contributes a lot to my plan of creating a completely new way for gameplay that has never existed in VCMP! What I mean is that does any of you still remember a mission in single-player in which Lance drives a helicopter towards Prawn Island with Tommy standing beside as a turret? Yeah that's the thing where habi's NPC system takes effect. I believe that with the help of NPC, the function can soon be made come true in my server (Extreme Racing). You guys may be curious about what the hell at all relation it has with NPC? But it's not the point. The point is that it'll soon be possible for players to experience the scene of smoothly firing from a flying helicopter regardless of any potential issues like lags, sync, etc. Thanks to habi again for his NPC system since it really plays a very important part in the process. It is expected that the project will be finished within 1 or 2 months. Hope you guys could join my server for a try the time when it's done.

Chicken

Hey habi, I used the SetMaxPlayersOut function, but I'm not sure what this function is for. Is it used to exceed the maxplayer slot? However,  I use this function, the server directly crashes.

habi

#50
Quote from: Chicken on May 20, 2023, 07:26 PMHey habi, I used the SetMaxPlayersOut function, but I'm not sure what this function is for. Is it used to exceed the maxplayer slot? However,  I use this function, the server directly crashes.
This issue was fixed. You need to download NPCHide(v3) and latest npc04relxx. Put both in plugins folder and then it will not crash.

SetMaxPlayersOut is not used to exceed the maxplayer slot, but to show it decreased in server browser.
"Suppose you have 10 npcs in server. When you hide npc from browser, it will show ( total players - 10 ) in browser. This later can create problem such as 20/30. Players cannot join because it is already 30 ( 20 + 10 npc ). To avoid these problem, we use SetMaxPlayersOut( 20 ). So 20 actual players can join 20/20.

Example:
SetMaxPlayersOut( 10 );

To change the maximum players 'as shown by the browser'.

habi

Quote from: Kenneth Law on May 20, 2023, 09:24 AMhabi!! I'd like to say you really did a good job as you are more than making NPCs for VCMP. It contributes a lot to my plan of creating a completely new way for gameplay that has never existed in VCMP! What I mean is that does any of you still remember a mission in single-player in which Lance drives a helicopter towards Prawn Island with Tommy standing beside as a turret? Yeah that's the thing where habi's NPC system takes effect. I believe that with the help of NPC, the function can soon be made come true in my server (Extreme Racing). You guys may be curious about what the hell at all relation it has with NPC? But it's not the point. The point is that it'll soon be possible for players to experience the scene of smoothly firing from a flying helicopter regardless of any potential issues like lags, sync, etc. Thanks to habi again for his NPC system since it really plays a very important part in the process. It is expected that the project will be finished within 1 or 2 months. Hope you guys could join my server for a try the time when it's done.
Thank you Kenneth Law. I wish you good luck with your project.

Chicken

Habi, I want to ask a question, if  NPC dies, I want to respawn it, but I add player.spwan(); in the event onPlayerRequestClass does not work, why? How to do?

habi

Quote from: Chicken on May 22, 2023, 01:05 PMHabi, I want to ask a question, if  NPC dies, I want to respawn it, but I add player.spwan(); in the event onPlayerRequestClass does not work, why? How to do?

Chicken, currently they do not have the function to request class and spawn. I will add these functions so that when dead, they can spawn again.



Chicken

Quote from: habi on May 23, 2023, 03:28 PM
Quote from: Chicken on May 22, 2023, 01:05 PMHabi, I want to ask a question, if  NPC dies, I want to respawn it, but I add player.spwan(); in the event onPlayerRequestClass does not work, why? How to do?

Chicken, currently they do not have the function to request class and spawn. I will add these functions so that when dead, they can spawn again.



OKay,You're great now. npc plugin is the best plugin,My friend

habi

#55
v1.6 beta4 patch2
-Now npc can select class and spawn.
Download
Windows npc_vcmp_rel006_windows_v1.6-beta4-patch2.zip
Linux npc_vcmp_rel006_linux_x64_v1.6-beta4-patch2.zip

You can use player.Spawn() from serverside also.

After spawning him, if you see health not correct like this:

Then do on server script:
//  scripts/main.nut
function onPlayerSpawn(player){if(IsPlayerNPC(player.ID))NewTimer("update",500,1,player.ID);}
function update(id){local p=FindPlayer(id);if(p)p.Pos=p.Pos;}



More information on this patch: release notes of beta4

PSL

My God, Habi brother, the NPC plugin you made is really powerful, I placed several NPCS in the city and recorded the action in advance, this effect is great, your plugin has more powerful functions, I will continue to study your plugin, to improve my server, in short, I think you are a talent.