create bots with this plugin

Started by habi, May 11, 2020, 12:49 PM

Previous topic - Next topic

EnForcer

Great work keep it up
Using it we can make an army of players and let them fight with each other :D

Anish87

Superb work habi! I like your work a lot. Another supreme dev for VCMP.

DizzasTeR

Since nobody has said it so far, I'll be the rude one

What you are doing is great sure, but its only great in the sense that VCMP does not have NPC support yet, what you are doing is something people have done before, specifically Shadow with his zombie server if anyone even remembers that.

My point: This plugin will die the moment vcmp gets a new update, sure its all fun and cool for now but unless VCMP stays dead from updates like it was for a decade like in 0.3zR2, all of you are just throwing yourselves in a pit of disappointment later on when this breaks.

It was fine till the just connect the bot part, but it seems like many of the people at this point just want to simulate NPC feature and I'd love seeing the tears later.

TL;DR
Don't work on this too much, this will break upon updates and future security enhancements updates and you are all getting yourself used to a "fake" NPC feature that won't last for too long.

Xmair

Quote from: DizzasTeR on Jun 09, 2020, 05:37 AM...
To add to this, the reason this will most probably badly break upon updates is because the netcode is changed drastically (as per update logs). It'll be up to you to re-do all of the plugin.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

MEGAMIND

Awsome work habi... & i hope u will be able to re-code this plugin after vcmp announces the new update

NicusorN5

@DizzasTeR @Xmair Many modern codebases are vulnerable to future requirements ( futureproofing). So that's a normal thing.

habi

#51
Quote from: DizzasTeR on Jun 09, 2020, 05:37 AMSince nobody has said it so far, I'll be the rude one
No problem.
Quote from: DizzasTeR on Jun 09, 2020, 05:37 AMWhat you are doing is great sure, but its only great in the sense that VCMP does not have NPC support yet, what you are doing is something people have done before, specifically Shadow with his zombie server if anyone even remembers that.
Shadow did not make a plugin i think. He made a server and client. I had read that topic before. due to some raknet issues or so, the project was abandoned.

We will see what we can do when updates come. Many cool features can be added.

habi

#52
New functions added-
1. kill_actor( int actorid, int reason, int killer_id, int body_part, bool showanim)

Examples
[spoiler]
kill_actor( actor id );
( equalent to /kill. actor will fell down. and server will show actor  felled to death )

kill_actor( actor id, reason ) ;
same, but you can give server a reason also. like explosion, suicide= reason 70, etc

kill_actor( actorid, reason, killer_id, body_part );
this will tell the server some player killed the actor. head =6, left arm =2, right arm= 3, left leg= 4,
right leg =5, torso= 1, body =0
//reason is a wep id. see weapon ids on vcmp wiki
eg. explosion = 41. reason.
kill_actor( actorid, reason, killer_id, body_part, false )
means no animations like headshot. actor will just fell down.

[/spoiler]

2. spawn_actor( actor id );
After an actor has been killed, use this command to spawn him. He will be spawned where he was last seen.

3. correct_actor_pos( actor id, float x, float y, float z );//use this before set_actor_health to show change in actor position.

4. set_actor_health( actorid, int new health );

if new health is greater than old health, before calling
this function, do player.Health=new health;

new function onActorDeath( actorid )
this gets called when an actor gets killed.
You can do something like this

function onActorDeath( actorid )
{
spawn_actor( actorid );
}

actor64.dll ( new )

You can use client side scripting, as i did in killing them.

NicusorN5


Alpays

My server crashes tried in blank server too

habi

#55
Hi Alpays, could you try this new dll file

actor64.dll

I have disabled certain functions, which interacts with server code.

List of available functions
create_actor( ... )
set_actor_angle( ... )
kill_actor(...)
spawn_actor(...)
set_port("..")
PlayFile("filename",actorid)
GetPlayerIDActor( actorid )
IsActor( int playerid )
GetActorID( int playerid )
correct_actor_pos
set_actor_health( int actorid, int newhealth )

Alpays

Quote from: habi on Jun 22, 2020, 03:04 PMHi Alpays, could you try this new dll file

actor64.dll

I have disabled certain functions, which interacts with server code.

List of available functions
create_actor( ... )
set_actor_angle( ... )
kill_actor(...)
spawn_actor(...)
set_port("..")
PlayFile("filename",actorid)
GetPlayerIDActor( actorid )
IsActor( int playerid )
GetActorID( int playerid )
correct_actor_pos
set_actor_health( int actorid, int newhealth )

Thanks you very much working now

KadirYigit





ScriptLoad
|
[spoiler] create_actor( "Barmen", 65, 466.788, -54.2886, 11.4837, 2.3 );
create_actor( "Jale", 22, 475.09, -66.3728, 9.98375, 2.3 );
create_actor( "Asli", 24, 474.805, -64.6814, 9.98375, 3.1 );
create_actor( "Mehmet", 33, 480.05, -63.8481, 9.98375, 2.1 );
create_actor( "Taksici_1", 28, 480.05, -63.8481, 9.98375, 2.1 );[/spoiler]
KadirYigit#6161

habi

we need to give some time after each create_actor function.

one second delay.

See how i fixed the problem

function onScriptLoad()
{
    // server info is printed in the console
    print( "------------------------------------" );
    print( "Server name: " + SRV_NAME );
    if( SRV_PASS != "" ) print( "Password: " + SRV_PASS );
    print( "------------------------------------" );
NewTimer("myfunction",1000,1, "Barmen", 65, 466.788, -54.2886, 11.4837, 2.3 );
NewTimer( "myfunction",2000,1,"Jale", 22, 475.09, -66.3728, 9.98375, 2.3 );
NewTimer( "myfunction",3000,1, "Asli", 24, 474.805, -64.6814, 9.98375, 3.1 );
NewTimer( "myfunction",4000,1, "Mehmet", 33, 480.05, -63.8481, 9.98375, 2.1 );
NewTimer( "myfunction",5000,1, "Taksici_1", 28, 480.05, -63.8481, 9.98375, 2.1 );
}
function myfunction(a,b,c,d,e,f)
{
create_actor(a,b,c,d,e,f);
}

and now..
i have

NicusorN5

@habi Request permission to write a Squirreil `library` to allow object oriented programming with your library.