AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Submissions (https://forums.alliedmods.net/forumdisplay.php?f=35)
-   -   [New] Bots Using Keydown Powers (https://forums.alliedmods.net/showthread.php?t=334899)

heliumdream 10-25-2021 18:28

[New] Bots Using Keydown Powers
 
Our bots now use keydown super powers!
You can see bots using powers, live on the server in my sig!

This is a bit unprecedented! The lead developer of the SH mod can be quoted as saying this wasn't possible. Well, a new user picked up the superheroes code, created a server, made innovations and in the last two years figured out how to do it.

Credits to evileye / iburai / landfall.
https://github.com/ibiruai/cstrike-superhero-server

His implementation took advantage of the new dev version of amx 1.9, instead of the stable 1.8.2 build. This allowed him to use amxclient_cmd to fake key presses and trigger plugin command hooks.

This is a clever workaround, but I figured out that the bots don't need to bother faking the keypress, all the bots_use_powers code is written as an include and packaged inside the main superheromod; so I went ahead and copied the keydown and keyup functions and created duplicate functions for the bots to use.

And voila, ~400 lines of code later and we have support for the following heroes:
The Hulk
Meteorix
Megaman
Bass
Aquaman
Human Torch
Dazzler
Electro
Storm
Goku's Kaioken
Neo Reloaded
Shadow the Hedgehog
Yoda
Yuna

AI is rudimentary, with the following logic determining how often a power is invoked;
random_num(1, 6) > N)
Lower values for N increase the frequency of use for a power!

It also includes some new amx commands in the playground include file that help you control which bots have which slot occupied by which power.

Bots still select heroes the same way they always did, at random, but I may write some logic on my server to be a bit more choosey about which heroes they take, letting them take full advantage of this new system.

Unbelievable; a feature the community has wanted and dreamed about since its inception finally realized!!!

---

Code available at:
https://github.com/heliumdream/db-cs...er/keydownbots

Unsupported release - You hopefully already know what you're doing.

*Notes:
my shnvault is additionally modded to support SH Show Damage Anubis, a new Cooldown Display System, and my custom version of Protoman // ibiruai's shnvault also has additional modifications, and has #defines that clearly outline the mods and tidy include files - his code is certainly cleaner. they were both authored to support specific gameplay and features we wanted in our respective servers. they arent quite the same, so examine them closely to figure out what they even offer and if you want to bother implementing anything for yourself. Best of luck!


All times are GMT -4. The time now is 15:15.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.