PCS Game Hosting
 
  Forum Index    Search    Usergroups    Edit your profile    Members    Arcade    Ranks

 Reputation    Medals    Staff    Statistics    Board Rules    Forum FAQ    Private MessagesLogin, Check Messages    Log in 

Search for at
Soldier Of Fortune 2 Advanced Search



Post new topicReply to topicprinter-friendly viewThank Post
   Soldier Of Fortune 2 Forum Index » SOF2 Tutorials » [ROCMOD CODING] - FAKE PINGS FOR BOTS
 View previous topic :: View next topic  
Author Message
BuLLy
Administrator
Administrator



Joined: Jun 29, 2015
Last Visit: Jan 15, 2018
Posts: 23

United Kingdom(Great Britain).png 
Reputation: 948
Medals: None

Status: Offline
PostPosted: Fri Dec 22, 2017 4:56 pm
PostPost subject: No icon [ROCMOD CODING] - FAKE PINGS FOR BOTS
Reply with quote

Just a simple snippet of code and a new cvar to add a fake ping to BOTS.

Files required : g_cmds.c, g_local.h, and g_main.c.

Open g_cmds.c and find the DeathmatchScoreboardMessage function.

Search for the following code and replace with the following :

Code:
      if ( cl->pers.connected == CON_CONNECTING )
      {
         ping = -1;
      }
      // Give BOTS a fake ping -- BuLLy
      else if ( (g_entities[cl->ps.clientNum].r.svFlags & SVF_BOT) && g_fakepings.integer == 1 )
      {
         ping = Q_irand(40, 75);
      }      
      // End BOTS fake ping -- BuLLy
      else
      {
         ping = cl->ps.ping <999>ps.ping : 999;
      }


Now you need to register your new CVAR in local and main.

Open g_main.c and add the following lines (I'm assuming you will already know where)

Code:
vmCvar_t   g_fakepings;


And

Code:
{ &g_fakepings, "g_fakepings", "1", CVAR_ARCHIVE, 0, qfalse },


Open up g_local.h and add the following code:

Code:
extern vmCvar_t      g_fakepings; // Add fake pings to bots -- BuLLy


That's it, all done.

Compile, upload and enjoy.

To control whether they are on or off use /rcon g_fakepings 1/0

BuLLy
Back to top
View user's profile Send private message
Sponsor
purp
Pro Poster
Pro Poster



Joined: Sep 18, 2016
Last Visit: Jan 15, 2018
Posts: 20

Denmark.png 
Reputation: 497
Medals: None

Status: Offline
PostPosted: Mon Jan 08, 2018 8:45 pm
PostPost subject: No icon Re: [ROCMOD CODING] - FAKE PINGS FOR BOTS
Reply with quote

Props for what you can do m8 but this is cancer lol. Tricking people into joining a server is foul play Laughing
Back to top
View user's profile Send private message
BuLLy
Administrator
Administrator



Joined: Jun 29, 2015
Last Visit: Jan 15, 2018
Posts: 23

United Kingdom(Great Britain).png 
Reputation: 948
Medals: None

Status: Offline
PostPosted: Tue Jan 09, 2018 12:07 am
PostPost subject: No icon Re: [ROCMOD CODING] - FAKE PINGS FOR BOTS
Reply with quote

Ha I totally agree, It would be nice if there were players to trick into joining nowadays lol
Back to top
View user's profile Send private message
Punisher
Administrator
Administrator


In Game: The Punisher
Gender: Gender:Male
Joined: May 04, 2012
Last Visit: Jan 11, 2018
Age: 20
Posts: 718

Netherlands.png 
Reputation: 3348
votes: 3
Medals: 2 (View more...)
Distinguished Uploader (Amount: 1)

Status: Offline
PostPosted: Wed Jan 10, 2018 9:40 pm
PostPost subject: No icon Re: [ROCMOD CODING] - FAKE PINGS FOR BOTS
Reply with quote

Maybe make a csgo mod that just downloads sof2 and launches a random sof2 server. Would boost up some traffic for a while. :P

Anyhow i hate the bot with pings, and usually leave within 20 min whenever i'm not getting a proper non-automated response back, or just see them walking like bots. I remember House of Boom having them, and Ozzy's Playhouse or something on Gold. Barely joined those servers cuz of that. Rather play with 3 real players then with 10 bots. Even tho i'm the leader of a server with mainly bots in them. :P

Question out of curiousity tho, what ping would the bots get? Would it require to be added in the bot file, as a custom command, or are they assigned automatically whenever the cvar is set to 1? Wouldn't it be better to have it set randomly between 1 and 200 or so, maybe even make em jump up after every x min to make em even more realistic.
Maybe adding some "Responses" at certain key words, e.g. "How are you doing?" responses into a list of "I'm fine. How are you?", "Not very good, just got killed by this bastard.". etc... etc... Im going a little off-topic. rofl


Website: House of Pain Server - Website
Serverlist: House of Pain Server - Serverlist

<a><img></a>

<a><img></a>
Back to top
View user's profile Send private message
Sponsor
BuLLy
Administrator
Administrator



Joined: Jun 29, 2015
Last Visit: Jan 15, 2018
Posts: 23

United Kingdom(Great Britain).png 
Reputation: 948
Medals: None

Status: Offline
PostPosted: Thu Jan 11, 2018 2:45 am
PostPost subject: No icon Re: [ROCMOD CODING] - FAKE PINGS FOR BOTS
Reply with quote

The bots are assigned a random ping between 40 and 75 it fluctuates just as it would a normal player.

They are automatically assigned a ping then the CVAR is set to 1

No need to add anything else to the bot files.

I personally hate bots so have no interest in making them more realistic, I just didn't like seeing the 0 ping lol.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic printer-friendly viewThank Post
Soldier Of Fortune 2 Forum Index »  SOF2 Tutorials
 
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts [VIDEO] - How to add colour to your name in SoF2 2 BuLLy 212 Sat Sep 23, 2017 4:07 am
BuLLy View latest post
No new posts how to add your own gameover song (code) 3 kingsfloo 1562 Fri Apr 10, 2015 10:43 am
abdouraoui View latest post
No new posts TIP: Add your STEAM Profile! 0 Teo 1158 Thu Feb 26, 2015 5:59 pm
Teo View latest post
No new posts how i add bots to my server? 5 abdouraoui 4049 Fri Jan 02, 2015 10:13 pm
Punisher View latest post
 




Back to Top

SOF2.ORG Multiplayer Community © 2018 All times are UTC + 2 Hours [DST enabled]
 

Copyright ©