Forum

> > CS2D > Scripts > Bots fake ping/Latency ?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Bots fake ping/Latency ?

3 replies
To the start Previous 1 Next To the start

old Re: Bots fake ping/Latency ?

DC
Admin Off Offline

Quote
The bots in CS2D are fully Lua-scripted. You can find the scripts in the "bots"-folder in your CS2D folder. Of course it depends on what you mean with "fake latency" but if you're talking about just delaying stuff it's easily possible. Actually the code is already full of little timers/countdowns to artificially delay stuff. Otherwise the bots would simply be too good. Well... at least in aiming and shooting. Of course they are still pretty stupid and predictable because the AI code is very basic and simple.

Hint: Change the bot skill (backspace in-game and then "Change Skills") if you want to try higher (low skills) or lower (high skills) delays.

Edit: Oh... I'm not sure if the skills actually make much difference... They don't seem to be used in the script. Maybe in the API functions which are called by the script...

old Re: Bots fake ping/Latency ?

GeoB99
Moderator Off Offline

Quote
High latency for bots in networking terms is absolutely impossible as they're AI and handled by some APIs and CPU. But you can perform the phenomenon of delay moving typical of laggy players (which you seem to go backwards by few tiles) to bots. Firstly, you must create two variables as Xpos and Ypos and assign them with math.random. Now, use cs2d lua cmd player and check if the player (see the player function reference) is truly a bot.

Afterwards, use cs2d cmd setpos, the X position parameter must be assigned with Xpos and Y with Ypos. Of course, those positions mustn't be pretty random (like teleporting in random places of a map) so I guess you should take a look at the Math Library for further functions and such.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview