NPC/Bots implementation in VCMP 0.4 Servers

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

Previous topic - Next topic

habi2

#165
Quote from: MEGAMIND on Nov 14, 2024, 10:01 PMhey @habi2 sup man, ok so i was trying to give it a more like gta vc npc feeling but i saw in the plugin that only SendCommand("_npc_skin_request 211");
    SendCommand("_npc_weapon_request 24");
were available from npcscripts but what about if we want like anims or alot more can be asked like to send commands from npc side to server..
Hi Megamind, there is an RFC in npcscripts side also.
You can execute commands serverside. As you can read in link, npc.IsAdmin=true is required for this.

I will come up with examples later on.

It is nice to know people interacting with your chatgpt a.i.

Please read examples(under See Also)  in wiki like setting cash. There is also one about setting weapon. good luck.

MEGAMIND

@habi2 hi i was testing some local npc running in server at different points randomnly where  i thought how about to hide it so looked at https://npc-for-vcmp.sourceforge.io/wikiw/index.php/NPCHide even downloaded the plugin i faced this Plugin error >> LoadLibrary() 'plugins/npc.dll' failed: Code 126
Failed to load plugin: npc

if the plugin istn the way out to hide can u make me a snippet where the playernames gets hidden from browser and from ingame server

habi2

Quote from: MEGAMIND on Nov 15, 2024, 12:16 PM@habi2 hi i was testing some local npc running in server at different points randomnly where  i thought how about to hide it so looked at https://npc-for-vcmp.sourceforge.io/wikiw/index.php/NPCHide even downloaded the plugin i faced this Plugin error >> LoadLibrary() 'plugins/npc.dll' failed: Code 126
Failed to load plugin: npc
Hi megamind, the name of the plugin associated for hiding npc in browser is npchide. For 64-bit, 64 is suffixed. Please verify that name of plugin in server.cfg is same as the name of dll in plugins directory.

MEGAMIND

#168
Quote from: habi2 on Nov 15, 2024, 04:20 PM
Quote from: MEGAMIND on Nov 15, 2024, 12:16 PM@habi2 hi i was testing some local npc running in server at different points randomnly where  i thought how about to hide it so looked at https://npc-for-vcmp.sourceforge.io/wikiw/index.php/NPCHide even downloaded the plugin i faced this Plugin error >> LoadLibrary() 'plugins/npc.dll' failed: Code 126
Failed to load plugin: npc
Hi megamind, the name of the plugin associated for hiding npc in browser is npchide. For 64-bit, 64 is suffixed. Please verify that name of plugin in server.cfg is same as the name of dll in plugins directory.

i use this in server.cfg npchide64
plugins squirrel04rel64 sqlatestfeatures04rel64 xmlconf04rel64 announce04rel64 ini04rel64 sqlite04rel64 sockets04rel64 hashing04rel64 mysql04rel64 rcon04rel64 vcmp-squirrel-mmdb-rel64 logfile64 webnet64 appchat04rel64 json04rel64 httprequest04rel64 npc04rel64 npchide64

and this is what i get
 Vice City Multiplayer Server
 -------------------------------
 v0.4, (c) 2007-2024 VC:MP Team

Loaded plugin: squirrel04rel64

Loaded plugin: sqlatestfeatures04rel64

Loaded plugin: xmlconf04rel64

Loaded plugin: announce04rel64

Loaded plugin: ini04rel64

Loaded plugin: sqlite04rel64

Loaded plugin: sockets04rel64

Loaded plugin: hashing04rel64

Loaded plugin: mysql04rel64

Loaded plugin: rcon04rel64

Loaded plugin: vcmp-squirrel-mmdb-rel64

Loaded plugin: logfile64

Loaded plugin: webnet64

Loaded plugin: appchat04rel64

Loaded plugin: json04rel64

Loaded plugin: httprequest04rel64

Loaded plugin: npc04rel64

Plugin error >> LoadLibrary() 'plugins/npc.dll' failed: Code 126
Failed to load plugin: npc

** Started VC:MP 0.4 Server **
 Port: 5192
 Max players: 100
even though if i remove 64 still same occurs im using npchide v3

habi2

#169
Omg you have 17 plugins loaded!. Try to remove some unnecessary ones and try-again. I remember having some problem when total plugins go above 16.

Edit: About calling server-side functions from npcscripts, i give you one example:
RFC(F("compilestring")("FindPlayer(1).Skin=0"))()
RFC(F("compilestring")("FindPlayer(1).SetWeapon(27,66)"))()

MEGAMIND

#170
Quote from: habi2 on Nov 15, 2024, 05:22 PMOmg you have 17 plugins loaded!. Try to remove some unnecessary ones and try-again. I remember having some problem when total plugins go above 16.

Edit: About calling server-side functions from npcscripts, i give you one example:
RFC(F("compilestring")("FindPlayer(1).Skin=0"))()
RFC(F("compilestring")("FindPlayer(1).SetWeapon(27,66)"))()
yes figured out like this, and it worked too,RFC(F("compilestring")("FindPlayer("+GetMyID()+").SetAnim(0,152)"))()all are neccessary to what my server includes  ;D but ur right it did worked, but there names are still visible ingame but not in browser how can i hide ingame?

also can we hide few npcs? and few not? if yes example pls

habi2

Quote from: MEGAMIND on Nov 15, 2024, 05:49 PMbut there names are still visible ingame but not in browser how can i hide ingame?
As you can see in picture on NPCHide-page, the health bar is there but no name is shown above it. It is because the client does not know actual name of the players. Actual name of npcs were replaced by " " (space string). Also the F5 screen is pretty neat.
I think by default it hides npc from browser only. If you want your npc to look like those in picture, you can issue a plugin command
0x10001001, "NPCHIDE_SETVAL 0" //ref: wiki
Unfortunately this plugin has not imported squirrel. You can send plugin-commands easily using this.

MEGAMIND

#172
@habi2 hi i encountered 2 things today

1. today npcs were woking fine when suddenly at evening i just restarted my server i found out that npc were conencting only, like just conencted with there id and if i try to povoke them they were not shooting bullets just a shooting anim was triggered, conencted to tdcs server was also not showing  (also during this the npc also shot me but no bullets were coming out), to fix this i tried idk many stupid stuff but at the end i had to redownload the npc.exe file and then it worked again as normal.
2. npc is shooting at me but my health is not draining

 also during this i found some random stuff going on console

Warning: LibRPC is compiled for API: 1.8. But the current API is 1.6
        LibRPC module loaded
 Loaded plugin: rpclib
 Loaded plugin: z-finder
        Warning: LibAction is compiled for API: 1.8. But the current API is 1.6
        LibAction module loaded
 Loaded plugin: actionlib
 Loaded plugin: npcmodule
 Loaded 4 plugins.
npc-ai: running
Connecting to 127.0.0.1: 5192. Connected. ID 0 [A.I]ChatGPT // here i dont get my servername anymore

//after redownloading the exe of npc it resolved

[process exited with code 3221225477 (0xc0000005)]
You can now close this terminal with Ctrl+D, or press Enter to restart.
i didnt had these warnings before

and now i get these sometimes

failure read
1450[SCRIPT]

failure read
534[SCRIPT]
no wonder what are these

habi2

Hi Megamind,
Quotenpcclient v1.8 beta 4 = API 1.8
v1.8 beta 3 = API 1.6
So you are running v1.8 beta 3 or before. But plugins (rpclib, actionlib,..) are newer. So  npcclient.exe version is different. Here is the latest version of npcclient as of now. Also i think name of server output in console in beta 4 and not before. So you was running an older version of npcclient.

Also npc shoots and bullet not coming is an issue with 0.4.7.1 fixed in beta 4.

Could you get a screenshot of failure read [SCRIPT] next time if it comes?

MEGAMIND

Quote from: habi2 on Nov 17, 2024, 04:20 AMHi Megamind,
Quotenpcclient v1.8 beta 4 = API 1.8
v1.8 beta 3 = API 1.6
So you are running v1.8 beta 3 or before. But plugins (rpclib, actionlib,..) are newer. So  npcclient.exe version is different. Here is the latest version of npcclient as of now. Also i think name of server output in console in beta 4 and not before. So you was running an older version of npcclient.

Also npc shoots and bullet not coming is an issue with 0.4.7.1 fixed in beta 4.

Could you get a screenshot of failure read [SCRIPT] next time if it comes?
oki doki ill check this version, and if any bugs comes out ill get back to u  ;D

MEGAMIND

#175
@habi2 Si Gracias amigo it worked

zainraza1789

Brother I Need /explode <player name> cmd Please Give me I Also Subscribe Your Channel DG-Code
Thanks

MEGAMIND

Quote from: zainraza1789 on Nov 19, 2024, 09:15 AMBrother I Need /explode <player name> cmd Please Give me I Also Subscribe Your Channel DG-Code
Thanks
first of all this is not a place to ask for something that is not relevant to the topic.. u can ask them in the specific boards..

secondly use wiki

MEGAMIND

@habi2 hi, so far so good projectis going well, so i noticed these 2 things

1. npc kills me it gets a health back automatically example its health was 78 went upto 100 and it got kicked
(how to make it stop from increasing its health)
2. if it gets disconnected how can we connect it back without closing/reopening the server?