Compare commits
55 Commits
Author | SHA1 | Date | |
---|---|---|---|
abfa41e24d | |||
3339ff2656 | |||
a64a0cc810 | |||
9c20cf621b | |||
f667c96717 | |||
c2f86e7120 | |||
d3f2f192f0 | |||
762257ca8a | |||
e773996274 | |||
7eb6c7d246 | |||
15143dbb85 | |||
0f95ebacb8 | |||
2a20a834ec | |||
99dbe2cd87 | |||
090fc5f7a8 | |||
3258183b1c | |||
5021547734 | |||
a4e3fbb42b | |||
7c041900ff | |||
6ee4d2e2fd | |||
988d471fdb | |||
3711a8e8ad | |||
c3d3dc8323 | |||
b5fb8c7760 | |||
c366c041fb | |||
79592e6056 | |||
ca9dad8b79 | |||
5fe8aee7e2 | |||
fab64bc3ed | |||
feb573d43b | |||
d788ce7cb3 | |||
cae032eb9a | |||
d9a8ac04c4 | |||
e606af216c | |||
2972d4e497 | |||
ca0b0032eb | |||
6d9dbb262a | |||
a568042934 | |||
e3a65e892c | |||
30a9888067 | |||
4dcea05c2a | |||
168a2e621c | |||
c9f5b6cf33 | |||
3b7669dbd0 | |||
589fe63bc8 | |||
712f2c3a37 | |||
ab612e8ff6 | |||
a5b3ecc81b | |||
9c1f4552c2 | |||
91044ff842 | |||
e1326342d2 | |||
a6d663b67c | |||
e7bf74894d | |||
01dc7ea667 | |||
b1808c66ea |
21
.astylerc
Normal file
@ -0,0 +1,21 @@
|
||||
# try to mimic the original gsc provided
|
||||
mode=c
|
||||
style=allman
|
||||
|
||||
indent=tab
|
||||
lineend=windows
|
||||
|
||||
pad-oper
|
||||
pad-paren-in
|
||||
pad-header
|
||||
|
||||
# delete-empty-lines
|
||||
|
||||
break-blocks
|
||||
# remove-braces
|
||||
|
||||
indent-switches
|
||||
indent-cases
|
||||
indent-after-parens
|
||||
|
||||
remove-comment-prefix
|
11
.editorconfig
Normal file
@ -0,0 +1,11 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
indent_size = 2
|
||||
charset = latin1
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.gsx linguist-language=GSC
|
14
.gitignore
vendored
@ -3,15 +3,14 @@
|
||||
|
||||
# Files to not ignore
|
||||
!/.gitignore
|
||||
!/botnames.txt
|
||||
!/z_devserver.bat
|
||||
!/z_serverdev.bat
|
||||
!/.editorconfig
|
||||
!/.gitattributes
|
||||
|
||||
!/z_server.bat
|
||||
!/z_client.bat
|
||||
!/z_dev.bat
|
||||
|
||||
# Folder to not ignore
|
||||
!/main_shared/
|
||||
!/.vscode
|
||||
*.gsx
|
||||
!/main_shared/maps/mp/gametypes/_callbacksetup.gsx
|
||||
main_shared/maps/mp/gametypes/_globallogic.gsx
|
||||
@ -20,6 +19,11 @@ main_shared/maps/mp/gametypes/_hardpoints.gsx
|
||||
*.zip
|
||||
!/out
|
||||
|
||||
!/.astylerc
|
||||
!/z_deploy.bat
|
||||
!/deploy.bat
|
||||
!/deploy.js
|
||||
|
||||
!/main/
|
||||
/main/*
|
||||
!/main/server.cfg
|
||||
|
19
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"astyle.astylerc": "${workspaceRoot}/.astylerc",
|
||||
"astyle.additional_languages": [
|
||||
"gsc",
|
||||
"gsx"
|
||||
],
|
||||
"[gsc]": {
|
||||
"editor.defaultFormatter": "chiehyu.vscode-astyle",
|
||||
},
|
||||
"editor.quickSuggestions": {
|
||||
"other": true,
|
||||
"comments": true,
|
||||
"strings": true
|
||||
},
|
||||
"vscode-codscript.use_builtin_completionItems": false,
|
||||
"files.associations": {
|
||||
"*.gsx": "gsc"
|
||||
}
|
||||
}
|
144
README.md
@ -5,7 +5,7 @@ Bot Warfare is a GSC mod for the [CoD4x project](https://github.com/callofduty4x
|
||||
|
||||
It aims to add playable AI to the multiplayer games of CoD4.
|
||||
|
||||
You can find the ModDB release post [here](https://www.moddb.com/mods/bot-warfare/downloads/cod4x-bot-warfare-latest) and the CoD4x.me post [here](https://cod4x.me/index.php?/forums/topic/3116-release-bot-warfare/).
|
||||
You can find the ModDB release post [here](https://www.moddb.com/mods/bot-warfare/downloads/cod4x-bot-warfare-latest) and the CoD4x forum post [here](https://cod4x.ovh/index.php?/forums/topic/3116-release-bot-warfare/).
|
||||
|
||||
## <span style="color:red">Important to public dedicated servers</span>
|
||||
The ```bots_main_firstIsHost``` DVAR is enabled by default!
|
||||
@ -22,7 +22,7 @@ Make sure to disable this DVAR by adding ```set bots_main_firstIsHost 0``` in yo
|
||||
- [Credits](#Credits)
|
||||
|
||||
## Features
|
||||
- A Waypoint Editor for creating and modifying bot's waypoints of traversing the map. Have a look at [Using the Waypoint editor]().
|
||||
- A Waypoint Editor for creating and modifying bot's waypoints of traversing the map. Have a look at [Using the Waypoint editor](/main_shared/bw-assets/wpedit.md).
|
||||
|
||||
- A clean and nice menu, you can edit every bot DVAR within in-game.
|
||||
|
||||
@ -57,15 +57,15 @@ Make sure to disable this DVAR by adding ```set bots_main_firstIsHost 0``` in yo
|
||||
- ... And pretty much everything you expect a Combat Training bot to have
|
||||
|
||||
## Installation
|
||||
Using CoD4x's extended functionality requires to use their Dedicated server, as explained [here](https://cod4x.me/index.php?/forums/topic/2047-add-cod4x-server-gsc-functions-to-the-client/).
|
||||
Using CoD4x's extended functionality requires to use their Dedicated server, as explained [here](https://cod4x.ovh/index.php?/forums/topic/2047-add-cod4x-server-gsc-functions-to-the-client/).
|
||||
|
||||
You can easily setup a local LAN dedicated server for you to join and play on. Have a look at [Setting up a CoD4x server]().
|
||||
You can easily setup a local LAN dedicated server for you to join and play on. Have a look at [Setting up a CoD4x server](https://github.com/callofduty4x/CoD4x_Server/wiki/Server-setup).
|
||||
|
||||
0. Make sure that [CoD4x server + client](https://cod4x.me/) is installed, updated and working properly.
|
||||
0. Make sure that [CoD4x server + client](https://cod4x.ovh/) is installed, updated and working properly.
|
||||
- Download the [latest release](https://github.com/ineedbots/cod4x_bot_warfare/releases) of Bot Warfare.
|
||||
1. Locate your CoD4x server install folder.
|
||||
2. Move the files/folders found in 'Add to root of CoD4x server' from the Bot Warfare release archive you downloaded to the root of your CoD4x server folder.
|
||||
- The folder/file structure should follow as '.CoD4x server folder\main_shared\maps\mp\bots\_bot.gsc'.
|
||||
- The folder/file structure should follow as `.CoD4x server folder\main_shared\maps\mp\bots\_bot.gsc`.
|
||||
3. The mod is now installed, now start your server, change the DVARs and start a map.
|
||||
4. Now start your CoD4x client and connect to your server ('connect 127.0.0.1' in the console most likely) and play!
|
||||
|
||||
@ -79,88 +79,60 @@ You can easily setup a local LAN dedicated server for you to join and play on. H
|
||||
- Pressing the menu button again closes menus.
|
||||
|
||||
### DVARs
|
||||
- bots_manage_add - an integer amount of bots to add to the game, resets to 0 once the bots have been added.
|
||||
- for example: 'bots_manage_add 10' will add 10 bots to the game.
|
||||
| Dvar | Description | Default Value |
|
||||
|----------------------------------|---------------------------------------------------------------------------------------------|--------------:|
|
||||
| bots_main | Enable this mod. | true |
|
||||
| bots_main_firstIsHost | The first player to connect will be given host. | true |
|
||||
| bots_main_GUIDs | A comma separated list of GUIDs of players who will be given host. | "" |
|
||||
| bots_main_waitForHostTime | How many seconds to wait for the host player to connect before adding bots to the match. | 10 |
|
||||
| bots_main_menu | Enable the in-game menu for hosts. | true |
|
||||
| bots_main_debug | Enable the in-game waypoint editor. | false |
|
||||
| bots_main_kickBotsAtEnd | Kick the bots at the end of a match. | false |
|
||||
| bots_main_chat | The rate bots will chat at, set to 0 to disable. | 1.0 |
|
||||
| bots_manage_add | Amount of bots to add to the game, once bots are added, resets back to `0`. | 0 |
|
||||
| bots_manage_fill | Amount of players/bots (look at `bots_manage_fill_mode`) to maintain in the match. | 0 |
|
||||
| bots_manage_fill_mode | `bots_manage_fill` players/bots counting method.<ul><li>`0` - counts both players and bots.</li><li>`1` - only counts bots.</li></ul> | 0 |
|
||||
| bots_manage_fill_kick | If the amount of players/bots in the match exceeds `bots_manage_fill`, kick bots until no longer exceeds. | false |
|
||||
| bots_manage_fill_spec | If when counting players for `bots_manage_fill` should include spectators. | true |
|
||||
| bots_team | One of `autoassign`, `allies`, `axis`, `spectator`, or `custom`. What team the bots should be on. | autoassign |
|
||||
| bots_team_amount | When `bots_team` is set to `custom`. The amount of bots to be placed on the axis team. The remainder will be placed on the allies team. | 0 |
|
||||
| bots_team_force | If the server should force bots' teams according to the `bots_team` value. When `bots_team` is `autoassign`, unbalanced teams will be balanced. This dvar is ignored when `bots_team` is `custom`. | false |
|
||||
| bots_team_mode | When `bots_team_force` is `true` and `bots_team` is `autoassign`, players/bots counting method. <ul><li>`0` - counts both players and bots.</li><li>`1` - only counts bots</li></ul> | 0 |
|
||||
| bots_skill | Bots' difficulty.<ul><li>`0` - Random difficulty for each bot.</li><li>`1` - Easiest difficulty for all bots.</li><li>`2` to `6` - Between easy and hard difficulty for all bots.</li><li>`7` - The hardest difficulty for all bots.</li><li>`8` - custom (look at the `bots_skill_<team>_<difficulty>` dvars</li></ul> | 0 |
|
||||
| bots_skill_axis_hard | When `bots_skill` is set to `8`, the amount of hard difficulty bots to set on the axis team. | 0 |
|
||||
| bots_skill_axis_med | When `bots_skill` is set to `8`, the amount of medium difficulty bots to set on the axis team. The remaining bots on the team will be set to easy difficulty. | 0 |
|
||||
| bots_skill_allies_hard | When `bots_skill` is set to `8`, the amount of hard difficulty bots to set on the allies team. | 0 |
|
||||
| bots_skill_allies_med | When `bots_skill` is set to `8`, the amount of medium difficulty bots to set on the allies team. The remaining bots on the team will be set to easy difficulty. | 0 |
|
||||
| bots_skill_min | The minimum difficulty level for the bots. | 1 |
|
||||
| bots_skill_max | The maximum difficulty level for the bots. | 7 |
|
||||
| bots_loadout_reasonable | If the bots should filter bad performing create-a-class selections. | false |
|
||||
| bots_loadout_allow_op | If the bots should be able to use overpowered and annoying create-a-class selections. | true |
|
||||
| bots_loadout_rank | What rank to set the bots.<ul><li>`-1` - Average of all players in the match.</li><li>`0` - All random.</li><li>`1` or higher - Sets the bots' rank to this.</li></ul> | -1 |
|
||||
| bots_play_move | If the bots can move. | true |
|
||||
| bots_play_knife | If the bots can knife. | true |
|
||||
| bots_play_fire | If the bots can fire. | true |
|
||||
| bots_play_nade | If the bots can grenade. | true |
|
||||
| bots_play_obj | If the bots can play the objective. | true |
|
||||
| bots_play_camp | If the bots can camp. | true |
|
||||
| bots_play_jumpdrop | If the bots can jump/drop shot. | true |
|
||||
| bots_play_target_other | If the bots can target other entities other than players. | true |
|
||||
| bots_play_killstreak | If the bots can call in killstreaks. | true |
|
||||
| bots_play_ads | If the bots can aim down sights. | true |
|
||||
| bots_play_aim | If the bots can aim. | true |
|
||||
|
||||
- bots_manage_fill - an integer amount of players/bots (depends on bots_manage_fill_mode) to retain on the server, it will automatically add bots to fill player space.
|
||||
- for example: 'bots_manage_fill 10' will have the server retain 10 players in the server, if there are less than 10, it will add bots until that value is reached.
|
||||
|
||||
- bots_manage_fill_mode - a value to indicate if the server should consider only bots or players and bots when filling player space.
|
||||
- 0 will consider both players and bots.
|
||||
- 1 will only consider bots.
|
||||
|
||||
- bots_manage_fill_kick - a boolean value (0 or 1), whether or not if the server should kick bots if the amount of players/bots (depends on bots_manage_fill_mode) exceeds the value of bots_manage_fill.
|
||||
|
||||
- bots_manage_fill_spec - a boolean value (0 or 1), whether or not if the server should consider players who are on the spectator team when filling player space.
|
||||
|
||||
---
|
||||
|
||||
- bots_team - a string, the value indicates what team the bots should join:
|
||||
- 'autoassign' will have bots balance the teams
|
||||
- 'allies' will have the bots join the allies team
|
||||
- 'axis' will have the bots join the axis team
|
||||
- 'custom' will have bots_team_amount bots on the axis team, the rest will be on the allies team
|
||||
|
||||
- bots_team_amount - an integer amount of bots to have on the axis team if bots_team is set to 'custom', the rest of the bots will be placed on the allies team.
|
||||
- for example: there are 5 bots on the server and 'bots_team_amount 3', then 3 bots will be placed on the axis team, the other 2 will be placed on the allies team.
|
||||
|
||||
- bots_team_force - a boolean value (0 or 1), whether or not if the server should enforce periodically the bot's team instead of just a single team when the bot is added to the game.
|
||||
- for example: 'bots_team_force 1' and 'bots_team autoassign' and the teams become to far unbalanced, then the server will change a bot's team to make it balanced again.
|
||||
|
||||
- bots_team_mode - a value to indicate if the server should consider only bots or players and bots when counting players on the teams.
|
||||
- 0 will consider both players and bots.
|
||||
- 1 will only consider bots.
|
||||
|
||||
---
|
||||
|
||||
- bots_skill - value to indicate how difficult the bots should be.
|
||||
- 0 will be mixed difficultly
|
||||
- 1 will be the most easy
|
||||
- 2-6 will be in between most easy and most hard
|
||||
- 7 will be the most hard.
|
||||
- 8 will be custom.
|
||||
|
||||
- bots_skill_axis_hard - an integer amount of hard bots on the axis team.
|
||||
- bots_skill_axis_med - an integer amount of medium bots on the axis team.
|
||||
- bots_skill_allies_hard - an integer amount of hard bots on the allies team.
|
||||
- bots_skill_allies_med - an integer amount of medium bots on the allies team
|
||||
- if bots_skill is 8 (custom). The remaining bots on the team will become easy bots
|
||||
- for example: having 5 bots on the allies team, 'bots_skill_allies_hard 2' and 'bots_skill_allies_med 2' will have 2 hard bots, 2 medium bots, and 1 easy bot on the allies team.
|
||||
|
||||
---
|
||||
|
||||
- bots_loadout_reasonable - a boolean value (0 or 1), whether or not if the bots should filter out bad create a class selections
|
||||
|
||||
- bots_loadout_allow_op - a boolean value (0 or 1), whether or not if the bots are allowed to use jug, marty, etc.
|
||||
|
||||
- bots_loadout_rank - an integer number, bots will be around this rank, -1 is average of all players in game, 0 is all random
|
||||
|
||||
- bots_play_move - a boolean value (0 or 1), whether or not if the bots will move
|
||||
- bots_play_knife - a boolean value (0 or 1), whether or not if the bots will use the knife
|
||||
- bots_play_fire - a boolean value (0 or 1), whether or not if the bots will fire their weapons
|
||||
- bots_play_nade - a boolean value (0 or 1), whether or not if the bots will grenade
|
||||
- bots_play_obj - a boolean value (0 or 1), whether or not if the bots will play the objective
|
||||
- bots_play_camp - a boolean value (0 or 1), whether or not if the bots will camp
|
||||
- bots_play_jumpdrop - a boolean value (0 or 1), whether or not if the bots will jump shot or drop shot
|
||||
- bots_play_target_other - a boolean value (0 or 1), whether or not if the bots will target claymores, killstreaks, etc.
|
||||
- bots_play_killstreak - a boolean value (0 or 1), whether or not if the bots will use killstreaks
|
||||
- bots_play_ads - a boolean value (0 or 1), whether or not if the bots will ads
|
||||
|
||||
---
|
||||
|
||||
- bots_main - a boolean value (0 or 1), enables or disables the mod
|
||||
|
||||
- bots_main_firstIsHost - a boolean value (0 or 1), the first player to connect is considered a host
|
||||
|
||||
- bots_main_GUIDs - a list of GUIDs (comma seperated) of players who will be considered a host
|
||||
|
||||
- bots_main_waitForHostTime - a float value, how long in seconds to wait for the host player to connect before adding in bots
|
||||
|
||||
- bots_main_menu - a boolean value (0 or 1), enables or disables the menu
|
||||
|
||||
- bots_main_debug - a boolean value (0 or 1), enables or disables the waypoint editor
|
||||
|
||||
## Changelog
|
||||
- v2.1.0
|
||||
- Bot chatter system, bots_main_chat
|
||||
- Greatly reduce script variable usage
|
||||
- Improved bots mantling and stuck
|
||||
- Fix some runtime errors
|
||||
- Bots sprint more
|
||||
- Improved bots sight on enemies
|
||||
- Bots do random actions while waiting at an objective
|
||||
- Improved bots from getting stuck
|
||||
- Better bot difficulty management, bots_skill_min and bots_skill_max
|
||||
|
||||
- v2.0.1
|
||||
- Reduced bots crouching
|
||||
- Increased bots sprinting
|
||||
@ -182,7 +154,7 @@ You can easily setup a local LAN dedicated server for you to join and play on. H
|
||||
|
||||
## Credits
|
||||
- CoD4x Team - https://github.com/callofduty4x/CoD4x_Server
|
||||
- INeedGames(me) - http://www.moddb.com/mods/bot-warfare
|
||||
- INeedGames - http://www.moddb.com/mods/bot-warfare
|
||||
- PeZBot team - http://www.moddb.com/mods/pezbot
|
||||
- Ability
|
||||
- Salvation
|
||||
|
2
deploy.bat
Normal file
@ -0,0 +1,2 @@
|
||||
xcopy cod4x_bot_warfare\main_shared\maps\mp\bots main_shared\maps\mp\bots\ /Y /I /E /H /C
|
||||
xcopy cod4x_bot_warfare\main main\ /Y /I /E /H /C
|
54
deploy.js
Normal file
@ -0,0 +1,54 @@
|
||||
// nodejs 14+
|
||||
|
||||
const exec = require('util').promisify(require('child_process').exec)
|
||||
|
||||
const repo_name = 'cod4x_bot_warfare'
|
||||
const repo_url = `https://github.com/ineedbots/${repo_name}`
|
||||
const deploy_check_rate = 60000
|
||||
const title = 'CoD4x Bot Warfare Git Deployer'
|
||||
|
||||
function printToConsole(what, error = false)
|
||||
{
|
||||
log = error ? console.error : console.log
|
||||
|
||||
log(`[${new Date().toISOString()}]:`, what)
|
||||
}
|
||||
|
||||
async function doDeploy() {
|
||||
try {
|
||||
const { stdout, stderr } = await exec(`cd ${repo_name} && git fetch`)
|
||||
|
||||
if (stderr.length <= 0)
|
||||
return
|
||||
|
||||
if (stderr.startsWith('From '))
|
||||
{
|
||||
printToConsole('git fetched! Pulling...')
|
||||
await exec(`cd ${repo_name} && git pull && git submodule update --init --recursive`)
|
||||
printToConsole('Deploying...')
|
||||
await exec('deploy.bat')
|
||||
printToConsole('Deployed!')
|
||||
}
|
||||
} catch (e) {
|
||||
printToConsole(e, true)
|
||||
|
||||
if (!e.stderr.startsWith('The system cannot find the path specified'))
|
||||
return
|
||||
|
||||
printToConsole('Cloning repo...')
|
||||
try {
|
||||
await exec(`git clone ${repo_url} && cd ${repo_name} && git submodule update --init --recursive`)
|
||||
|
||||
printToConsole('Cloned!')
|
||||
printToConsole('Deploying...')
|
||||
await exec('deploy.bat')
|
||||
printToConsole('Deployed!')
|
||||
} catch (f) {
|
||||
printToConsole(f, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
process.stdout.write(`${String.fromCharCode(27)}]0;${title}${String.fromCharCode(7)}`)
|
||||
doDeploy()
|
||||
setInterval(doDeploy, deploy_check_rate)
|
@ -9,7 +9,7 @@
|
||||
/// features only available on CoD4X 1.8+ servers ///
|
||||
/// ///
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
loadplugin "httpget"
|
||||
|
||||
// Meta Information, not required
|
||||
sets _Admin "Admin"
|
||||
@ -23,15 +23,11 @@ sets _Gametype ""
|
||||
// Basics
|
||||
set sv_hostname "^1Bot ^3War^5fare ^724/7 Shipment 10x"
|
||||
set g_motd "" // Message of the day, which getting shown to every player on his 1st spawn
|
||||
set dedicated "2" // 0 = Listen, 1 = LAN, 2 = Internet ( you probably want 2 )
|
||||
set rcon_password "qazqaz" // password for remote access, leave empty to deactivate, min 8 characters
|
||||
set g_password "" // join password, leave empty to deactivate
|
||||
set sv_privateClients "" //Private Clients, number of slots that can only be changed with a password
|
||||
set sv_privatePassword "" // the password to join private slots
|
||||
set sv_authorizemode "-1" // cdkey validation
|
||||
set sv_showasranked "1" // 0 = show modded server as not ranked, 1 = shows server as ranked altough it is modded
|
||||
set sv_authtoken "12312321"
|
||||
|
||||
|
||||
// Log File
|
||||
set g_logsync "2" // 0=no log, 1=buffered, 2=continuous, 3=append
|
||||
@ -41,16 +37,14 @@ set sv_log_damage "1"
|
||||
set sv_statusfile "serverstatus.xml" // writes an xml serverstatus to disc, leave empty to disable
|
||||
|
||||
// Networking
|
||||
// set net_ip "0.0.0.0" // not necessary to be set
|
||||
// set net_port 28960 // network port
|
||||
// set sv_maxRate 25000
|
||||
|
||||
set sv_minPing "0" // minimal ping [ms] for a player to join the server
|
||||
set sv_maxPing "0" // maximal ping [ms] for a player to join the server
|
||||
set sv_timeout 40 // Seconds to keep a client on server without a new clientmessage
|
||||
set sv_connectTimeout 90 // Seconds to wait for a client which is loading a map without a new clientmessage
|
||||
set sv_zombieTime 2 // Seconds to keep a disconnected client on server to transmit the last message
|
||||
set sv_reconnectlimit 5 // Seconds to disallow a prior connected client to reconnect to the server
|
||||
set sv_timeout "40" // Seconds to keep a client on server without a new clientmessage
|
||||
set sv_connectTimeout "90" // Seconds to wait for a client which is loading a map without a new clientmessage
|
||||
set sv_zombieTime "2" // Seconds to keep a disconnected client on server to transmit the last message
|
||||
set sv_reconnectlimit "5" // Seconds to disallow a prior connected client to reconnect to the server
|
||||
|
||||
// Floodprotection is enabled by default!
|
||||
// sv_floodProtect, sv_maxRate,
|
||||
@ -58,10 +52,10 @@ set sv_reconnectlimit 5 // Seconds to disallow a prior connected client to recon
|
||||
|
||||
// Variables you should not touch :)
|
||||
// set sv_fps "20" //Server-FPS (do not change!)
|
||||
// set sv_punkbuster "0" //Punkbuster, PB is not supported on CoD4x
|
||||
// set sv_pure "1" //check IWD-data 0 = off, 1 = on
|
||||
set sv_punkbuster "0" //Punkbuster, PB is not supported on CoD4x
|
||||
set sv_pure "0" //check IWD-data 0 = off, 1 = on
|
||||
// set g_antilag "1" //0 = off, 1 = on // Anti lag checks for weapon hits
|
||||
// set ModStats 1 // 1 = use player stats file for mods (normal behaviours), 0 = use player stats file of basegame (DANGEROUS!!! as it can overwrite your stats)
|
||||
// set ModStats "1" // 1 = use player stats file for mods (normal behaviours), 0 = use player stats file of basegame (DANGEROUS!!! as it can overwrite your stats)
|
||||
|
||||
|
||||
|
||||
@ -74,23 +68,23 @@ set sv_allowAnonymous "0" // Anonymous //0 = off 1 = on
|
||||
|
||||
// Maps
|
||||
set sv_mapRotation "map mp_shipment" // maps that will be played automatically
|
||||
// set sv_randomMapRotation 1 // 0 = sv_mapRotation is randomized, 1 = sequential order of sv_mapRotation
|
||||
// set sv_randomMapRotation "1" // 0 = sv_mapRotation is randomized, 1 = sequential order of sv_mapRotation
|
||||
|
||||
set g_deadChat "1" // dead can chat // 0 = off, 1 = on
|
||||
set voice_deadChat "0" // dead can use voicechat //0 = off, 1 = on
|
||||
set g_gravity "800" //Gravity //Standard 800
|
||||
set sv_disableClientConsole "0" //deactivate console for clients //0 = no, 1 = yes
|
||||
set scr_teambalance "0" //auto-teambalance //0 = no, 1 = yes
|
||||
set scr_teambalance "1" //auto-teambalance //0 = no, 1 = yes
|
||||
set scr_team_fftype "0" //friendly-fire //0 = off, 1 = on, //2 = reflect damage, 3 = shared damage
|
||||
set scr_game_spectatetype "2" // spectator // 0 = off, 1 = only Team/player, 2 = free
|
||||
set scr_hardcore 0 //Hardcore Mode //0 = off 1 = on
|
||||
set scr_hardcore "0" //Hardcore Mode //0 = off 1 = on
|
||||
set scr_oldschool "0" //Oldschool Mode //0 = off, 1 = on
|
||||
|
||||
set g_friendlyPlayerCanBlock 0 // 1 = player collision between friendly players, 0 = collision between friendly players is disabled
|
||||
set g_FFAPlayerCanBlock 1 // same for FFA (non team based) gamemode
|
||||
set g_friendlyPlayerCanBlock "0" // 1 = player collision between friendly players, 0 = collision between friendly players is disabled
|
||||
set g_FFAPlayerCanBlock "1" // same for FFA (non team based) gamemode
|
||||
|
||||
// Less interesting Gameplay stuff
|
||||
set scr_drawfriend "1" //show team mates //0 = off, 1 = on
|
||||
set scr_drawfriend "0" //show team mates //0 = off, 1 = on
|
||||
set scr_enable_scoretext "1" //hit-message //0 = no, 1 = yes
|
||||
set scr_game_allowkillcam "1" //Killcam //0 = no, 1 = yes // Allow to play killcam after you got killed
|
||||
set scr_game_deathpointloss "0" //points-distraction when hit //0 = no, 1 = yes
|
||||
@ -126,9 +120,9 @@ set scr_war_waverespawndelay "0"
|
||||
|
||||
//Domination (dom)
|
||||
set scr_dom_scorelimit "300"
|
||||
set scr_dom_timelimit "0"
|
||||
set scr_dom_timelimit "30"
|
||||
set scr_dom_numlives "0"
|
||||
set scr_dom_playerrespawndelay "3"
|
||||
set scr_dom_playerrespawndelay "0"
|
||||
set scr_dom_roundlimit "1"
|
||||
set scr_dom_waverespawndelay "0"
|
||||
|
||||
@ -177,10 +171,10 @@ set scr_sd_waverespawndelay "0"
|
||||
set g_gametype "dom" // gamemode, one of [war, dm, sd, sab, koth]
|
||||
|
||||
// Amazing Stuff
|
||||
//set sv_autodemorecord 1 // Records demos of players on the serverside, demos are stored in "demos" folder
|
||||
set sv_autodemorecord "1" // Records demos of players on the serverside, demos are stored in "demos" folder
|
||||
//set sv_demoCompletedCmd "" // program to execute when a demo has been saved
|
||||
//set sv_screenshotArrivedCmd "" // program to execute when a screenshot was taken
|
||||
//set sv_legacyguidmode 0 // 1 = old 32 character guids are used, 0 = new cod4x guid format is used ( like steamids )
|
||||
//set sv_legacyguidmode "0" // 1 = old 32 character guids are used, 0 = new cod4x guid format is used ( like steamids )
|
||||
|
||||
///////////////////////////
|
||||
// Setup for custom maps when running a mod
|
||||
@ -190,7 +184,7 @@ seta sv_wwwDlDisconnected "1" // disconnect clients while downloading
|
||||
///////////////////////////
|
||||
|
||||
|
||||
set sv_nosteamnames 1 // 1 = Use names from steam if steam is available
|
||||
set sv_nosteamnames "1" // 1 = Use names from steam if steam is available
|
||||
|
||||
set bots_manage_add "12"
|
||||
set bots_main_firstIsHost "0"
|
||||
@ -200,3 +194,5 @@ set bots_team_force "1"
|
||||
set bots_loadout_allow_op "0"
|
||||
set bots_loadout_reasonable "1"
|
||||
set bots_manage_fill_spec "0"
|
||||
|
||||
exec config.cfg
|
||||
|
BIN
main_shared/bw-assets/console-map.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
main_shared/bw-assets/console.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
main_shared/bw-assets/editor-addwp.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
main_shared/bw-assets/editor-addwp2.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
main_shared/bw-assets/editor-link.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
main_shared/bw-assets/editor.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
BIN
main_shared/bw-assets/saved.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
99
main_shared/bw-assets/wpedit.md
Normal file
@ -0,0 +1,99 @@
|
||||
# CoD4x Bot Warfare Waypoint Editor
|
||||
First things first, Bot Warfare uses the [AStar search algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm) for creating paths for the bots to find their way through a map.
|
||||
|
||||
The AStar search algorithm requires a [set of waypoints](https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)) defining where all the paths are in the map.
|
||||
|
||||
Now if you want to modify existing or create new waypoints for CoD4x maps, this is the read for you.
|
||||
|
||||
## Contents
|
||||
- [Setting up the Waypoint Editor](#Setting-up-the-Waypoint-Editor)
|
||||
- [The Editor](#The-Editor)
|
||||
|
||||
## Setting up the Waypoint Editor
|
||||
The Bot Warfare mod comes with the Waypoint Editor out of the box, so its just a matter of telling the mod you want to use it. Its a matter of setting the `bots_main_debug` DVAR to `1`.
|
||||
|
||||
Start your server with the Bot Warfare mod.
|
||||
|
||||
In the server console, type in ```set bots_main_debug 1```.<br>
|
||||

|
||||
|
||||
Now start a match with the map you want to edit with the `devmap <mapname>` command.<br>
|
||||

|
||||
|
||||
It should be noted that waypoints load in this following order;
|
||||
1. checks the 'waypoints' folder (FS_Game\waypoints) for a csv file
|
||||
2. loads the waypoints from GSC (maps\mp\bots\waypoints)
|
||||
3. checks online at [this repo](https://github.com/ineedbots/cod4x_waypoints) for the waypoints (if httpget plugin loaded)
|
||||
|
||||
If all fail to load waypoints, there will be no waypoints and the bots will not know how to navigate the map.
|
||||
|
||||
Connect to the server with the CoD4x client, you'll be introduced to the Waypoint Editor.
|
||||
|
||||
## The Editor
|
||||
<br>
|
||||
This is the Waypoint Editor. You can view, edit and create the waypoint graph.
|
||||
- Each red number you see in the world is a waypoint.
|
||||
- The green string you see is the type of that waypoint.
|
||||
- The green list of numbers are the waypoints linked to that waypoint.
|
||||
- The pink lines show the links between the waypoints, a link defines that a bot can walk from A to B.
|
||||
- The white lines show the 'angles' that a waypoint has, these are used for grenade, claymore and tube waypoints. It's used to tell the bot where to look at when grenading/claymoring, etc.
|
||||
|
||||
---
|
||||
|
||||
Pressing any of these buttons will initiate a command to the Waypoint Editor.
|
||||
Each button has a secondary modifier button, and can be pressed shortly after pressing the primary button.
|
||||
|
||||
- SecondaryOffhand (stun) - Add Waypoint
|
||||
- Press nothing - Make a waypoint of your stance
|
||||
- ADS - Make a climb waypoint
|
||||
- Attack + Use - Make a tube waypoint
|
||||
- Attack - Make a grenade waypoint
|
||||
- Use - Make a claymore waypoint
|
||||
|
||||
- Melee - Link Waypoint
|
||||
- Press nothing - Link
|
||||
- ADS - Unlink
|
||||
|
||||
- FragButton (grenade) - Delete Waypoint
|
||||
- Press nothing - Delete Waypoint
|
||||
- Attack - Delete all waypoints
|
||||
- ADS - (Re)Load Waypoints
|
||||
|
||||
- UseButton + Attack - Save Waypoints
|
||||
- Press nothing - Save waypoints
|
||||
- ADS - Toggle autolink waypoints (links waypoints as you create them)
|
||||
|
||||
---
|
||||
|
||||
Okay, now that you know how to control the Editor, lets now go ahead and create some waypoints.
|
||||
|
||||
Here I added a waypoint.<br>
|
||||

|
||||
|
||||
And I added a second waypoint.<br>
|
||||

|
||||
|
||||
There are several types of waypoints, holding a modifier button before pressing the add waypoint button will create a special type of waypoint.
|
||||
- Types of waypoints:
|
||||
- any stance ('stand', 'crouch', 'prone') - bots will have this stance upon reaching this waypoint
|
||||
- grenade - bots will look at the angles you were looking at when you made the waypoint and throw a grenade from the waypoint
|
||||
- tube - bots will look at the angles you were looking at when you made the waypoint and switch to a launcher and fire
|
||||
- claymore - bots will look at the angles you were looking at when you made the waypoint and place a claymore or c4
|
||||
- camp ('crouch' waypoint with only one linked waypoint) - bots will look at the angles you were looking at when you made the waypoint and camp
|
||||
- climb - bots will look at the angles you were looking at when you made the waypoint and climb (use this for ladders and mantles)
|
||||
|
||||
Here I linked the two waypoints together.<br>
|
||||

|
||||
|
||||
Linking waypoints are very important, it tells the bots that they can reach waypoint 1 from waypoint 0, and vice versa.
|
||||
|
||||
Now go and waypoint the whole map out. This may take awhile and can be pretty tedious.
|
||||
|
||||
Once you feel like you are done, press the Save buttons. This will generate a [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) output to your waypoints folder!
|
||||
|
||||
That is it! The waypoints should load next time you start your game!
|
||||
|
||||
Your waypoints CSV file will be located at ```<fs_game>/waypoints/<mapname>_wp.csv```. (main folder if fs_game is blank)<br>
|
||||

|
||||
|
||||
You can share your waypoints publicly (and can be loaded by other users of Bot Warfare remotely) by making a Pull Request to the [CoD4x_Waypoints repo](https://github.com/ineedbots/cod4x_waypoints).
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
init()
|
||||
{
|
||||
level.bw_VERSION = "2.0.1";
|
||||
level.bw_VERSION = "2.1.0";
|
||||
|
||||
if ( getDvar( "bots_main" ) == "" )
|
||||
setDvar( "bots_main", true );
|
||||
@ -22,78 +22,116 @@ init()
|
||||
|
||||
if ( getDvar( "bots_main_GUIDs" ) == "" )
|
||||
setDvar( "bots_main_GUIDs", "" ); //guids of players who will be given host powers, comma seperated
|
||||
|
||||
if ( getDvar( "bots_main_firstIsHost" ) == "" )
|
||||
setDvar( "bots_main_firstIsHost", true ); //first player to connect is a host
|
||||
|
||||
if ( getDvar( "bots_main_waitForHostTime" ) == "" )
|
||||
setDvar( "bots_main_waitForHostTime", 10.0 ); //how long to wait to wait for the host player
|
||||
|
||||
if ( getDvar( "bots_main_kickBotsAtEnd" ) == "" )
|
||||
setDvar( "bots_main_kickBotsAtEnd", false ); //kicks the bots at game end
|
||||
|
||||
if ( getDvar( "bots_manage_add" ) == "" )
|
||||
setDvar( "bots_manage_add", 0 ); //amount of bots to add to the game
|
||||
|
||||
if ( getDvar( "bots_manage_fill" ) == "" )
|
||||
setDvar( "bots_manage_fill", 0 ); //amount of bots to maintain
|
||||
|
||||
if ( getDvar( "bots_manage_fill_spec" ) == "" )
|
||||
setDvar( "bots_manage_fill_spec", true ); //to count for fill if player is on spec team
|
||||
|
||||
if ( getDvar( "bots_manage_fill_mode" ) == "" )
|
||||
setDvar( "bots_manage_fill_mode", 0 ); //fill mode, 0 adds everyone, 1 just bots, 2 maintains at maps, 3 is 2 with 1
|
||||
|
||||
if ( getDvar( "bots_manage_fill_kick" ) == "" )
|
||||
setDvar( "bots_manage_fill_kick", false ); //kick bots if too many
|
||||
|
||||
if ( getDvar( "bots_team" ) == "" )
|
||||
setDvar( "bots_team", "autoassign" ); //which team for bots to join
|
||||
|
||||
if ( getDvar( "bots_team_amount" ) == "" )
|
||||
setDvar( "bots_team_amount", 0 ); //amount of bots on axis team
|
||||
|
||||
if ( getDvar( "bots_team_force" ) == "" )
|
||||
setDvar( "bots_team_force", false ); //force bots on team
|
||||
|
||||
if ( getDvar( "bots_team_mode" ) == "" )
|
||||
setDvar( "bots_team_mode", 0 ); //counts just bots when 1
|
||||
|
||||
if ( getDvar( "bots_skill" ) == "" )
|
||||
setDvar( "bots_skill", 0 ); //0 is random, 1 is easy 7 is hard, 8 is custom, 9 is completely random
|
||||
|
||||
if ( getDvar( "bots_skill_axis_hard" ) == "" )
|
||||
setDvar( "bots_skill_axis_hard", 0 ); //amount of hard bots on axis team
|
||||
|
||||
if ( getDvar( "bots_skill_axis_med" ) == "" )
|
||||
setDvar( "bots_skill_axis_med", 0 );
|
||||
|
||||
if ( getDvar( "bots_skill_allies_hard" ) == "" )
|
||||
setDvar( "bots_skill_allies_hard", 0 );
|
||||
|
||||
if ( getDvar( "bots_skill_allies_med" ) == "" )
|
||||
setDvar( "bots_skill_allies_med", 0 );
|
||||
|
||||
if ( getDvar( "bots_skill_min" ) == "" )
|
||||
setDvar( "bots_skill_min", 1 );
|
||||
|
||||
if ( getDvar( "bots_skill_max" ) == "" )
|
||||
setDvar( "bots_skill_max", 7 );
|
||||
|
||||
if ( getDvar( "bots_loadout_reasonable" ) == "" ) //filter out the bad 'guns' and perks
|
||||
setDvar( "bots_loadout_reasonable", false );
|
||||
|
||||
if ( getDvar( "bots_loadout_allow_op" ) == "" ) //allows jug, marty and laststand
|
||||
setDvar( "bots_loadout_allow_op", true );
|
||||
|
||||
if ( getDvar( "bots_loadout_rank" ) == "" ) // what rank the bots should be around, -1 is around the players, 0 is all random
|
||||
setDvar( "bots_loadout_rank", -1 );
|
||||
|
||||
if ( getDvar( "bots_loadout_prestige" ) == "" ) // what pretige the bots will be, -1 is the players, -2 is random
|
||||
setDvar( "bots_loadout_prestige", -1 );
|
||||
|
||||
if ( getDvar( "bots_play_move" ) == "" ) //bots move
|
||||
setDvar( "bots_play_move", true );
|
||||
|
||||
if ( getDvar( "bots_play_knife" ) == "" ) //bots knife
|
||||
setDvar( "bots_play_knife", true );
|
||||
|
||||
if ( getDvar( "bots_play_fire" ) == "" ) //bots fire
|
||||
setDvar( "bots_play_fire", true );
|
||||
|
||||
if ( getDvar( "bots_play_nade" ) == "" ) //bots grenade
|
||||
setDvar( "bots_play_nade", true );
|
||||
|
||||
if ( getDvar( "bots_play_obj" ) == "" ) //bots play the obj
|
||||
setDvar( "bots_play_obj", true );
|
||||
|
||||
if ( getDvar( "bots_play_camp" ) == "" ) //bots camp and follow
|
||||
setDvar( "bots_play_camp", true );
|
||||
|
||||
if ( getDvar( "bots_play_jumpdrop" ) == "" ) //bots jump and dropshot
|
||||
setDvar( "bots_play_jumpdrop", true );
|
||||
|
||||
if ( getDvar( "bots_play_target_other" ) == "" ) //bot target non play ents (vehicles)
|
||||
setDvar( "bots_play_target_other", true );
|
||||
|
||||
if ( getDvar( "bots_play_killstreak" ) == "" ) //bot use killstreaks
|
||||
setDvar( "bots_play_killstreak", true );
|
||||
|
||||
if ( getDvar( "bots_play_ads" ) == "" ) //bot ads
|
||||
setDvar( "bots_play_ads", true );
|
||||
|
||||
if ( getDvar( "bots_play_aim" ) == "" )
|
||||
setDvar( "bots_play_aim", true );
|
||||
|
||||
if ( !isDefined( game["botWarfare"] ) )
|
||||
game["botWarfare"] = true;
|
||||
|
||||
level.defuseObject = undefined;
|
||||
level.bots_smokeList = List();
|
||||
level.tbl_PerkData[0]["reference_full"] = true;
|
||||
|
||||
for ( h = 1; h < 6; h++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
level.default_perk["CLASS_CUSTOM" + h][i] = "specialty_null";
|
||||
@ -156,6 +194,11 @@ handleBots()
|
||||
wait 0.05;
|
||||
|
||||
setDvar( "bots_manage_add", getBotArray().size );
|
||||
|
||||
if ( !getDvarInt( "bots_main_kickBotsAtEnd" ) )
|
||||
return;
|
||||
|
||||
removeAllTestClients();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -183,6 +226,14 @@ onPlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHi
|
||||
self maps\mp\bots\_bot_script::onKilled( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
|
||||
}
|
||||
|
||||
self.lastAttacker = eAttacker;
|
||||
|
||||
if ( isDefined( eAttacker ) )
|
||||
{
|
||||
eAttacker.lastKilledPlayer = self;
|
||||
eAttacker notify( "killed_enemy" );
|
||||
}
|
||||
|
||||
self [[level.prevCallbackPlayerKilled]]( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
|
||||
}
|
||||
|
||||
@ -240,6 +291,7 @@ fixGamemodes()
|
||||
{
|
||||
for ( i = 0; i < level.bombZones.size; i++ )
|
||||
level.bombZones[i].onUse = ::onUsePlantObjectFix;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -332,6 +384,26 @@ connected()
|
||||
self thread onDisconnect();
|
||||
|
||||
level notify( "bot_connected", self );
|
||||
|
||||
self thread watchBotDebugEvent();
|
||||
}
|
||||
|
||||
/*
|
||||
DEBUG
|
||||
*/
|
||||
watchBotDebugEvent()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "bot_event", msg, str, b, c, d, e, f, g );
|
||||
|
||||
if ( msg == "debug" && GetDvarInt( "bots_main_debug" ) )
|
||||
{
|
||||
printToConsole( "Bot Warfare debug: " + self.name + ": " + str );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -370,12 +442,8 @@ add_bot()
|
||||
/*
|
||||
A server thread for monitoring all bot's difficulty levels for custom server settings.
|
||||
*/
|
||||
diffBots()
|
||||
diffBots_loop()
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
wait 1.5;
|
||||
|
||||
var_allies_hard = getDVarInt( "bots_skill_allies_hard" );
|
||||
var_allies_med = getDVarInt( "bots_skill_allies_med" );
|
||||
var_axis_hard = getDVarInt( "bots_skill_axis_hard" );
|
||||
@ -390,6 +458,7 @@ diffBots()
|
||||
if ( var_skill == 8 )
|
||||
{
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -435,6 +504,7 @@ diffBots()
|
||||
else if ( var_skill != 0 && var_skill != 9 )
|
||||
{
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -445,17 +515,40 @@ diffBots()
|
||||
player.pers["bots"]["skill"]["base"] = var_skill;
|
||||
}
|
||||
}
|
||||
|
||||
playercount = level.players.size;
|
||||
min_diff = GetDvarInt( "bots_skill_min" );
|
||||
max_diff = GetDvarInt( "bots_skill_max" );
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
|
||||
if ( !player is_bot() )
|
||||
continue;
|
||||
|
||||
player.pers["bots"]["skill"]["base"] = int( clamp( player.pers["bots"]["skill"]["base"], min_diff, max_diff ) );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
A server thread for monitoring all bot's difficulty levels for custom server settings.
|
||||
*/
|
||||
diffBots()
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
wait 1.5;
|
||||
|
||||
diffBots_loop();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
A server thread for monitoring all bot's teams for custom server settings.
|
||||
*/
|
||||
teamBots()
|
||||
teamBots_loop()
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
wait 1.5;
|
||||
teamAmount = getDvarInt( "bots_team_amount" );
|
||||
toTeam = getDvar( "bots_team" );
|
||||
|
||||
@ -465,6 +558,7 @@ teamBots()
|
||||
axisplayers = 0;
|
||||
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -506,6 +600,7 @@ teamBots()
|
||||
if ( abs( axis - allies ) > 1 )
|
||||
{
|
||||
toTeam = "axis";
|
||||
|
||||
if ( axis > allies )
|
||||
toTeam = "allies";
|
||||
}
|
||||
@ -514,6 +609,7 @@ teamBots()
|
||||
if ( toTeam != "autoassign" )
|
||||
{
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -533,6 +629,7 @@ teamBots()
|
||||
player thread [[level.axis]]();
|
||||
else
|
||||
player thread [[level.spectator]]();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -541,6 +638,7 @@ teamBots()
|
||||
else
|
||||
{
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -575,21 +673,25 @@ teamBots()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
A server thread for monitoring all bot's teams for custom server settings.
|
||||
*/
|
||||
teamBots()
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
wait 1.5;
|
||||
|
||||
teamBots_loop();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
A server thread for monitoring all bot's in game. Will add and kick bots according to server settings.
|
||||
*/
|
||||
addBots()
|
||||
addBots_loop()
|
||||
{
|
||||
level endon("game_ended");
|
||||
|
||||
bot_wait_for_host();
|
||||
|
||||
for(;;)
|
||||
{
|
||||
wait 1.5;
|
||||
|
||||
botsToAdd = GetDvarInt( "bots_manage_add" );
|
||||
|
||||
if ( botsToAdd > 0 )
|
||||
@ -618,6 +720,7 @@ addBots()
|
||||
spec = 0;
|
||||
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -644,6 +747,7 @@ addBots()
|
||||
alliesplayers = 0;
|
||||
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -676,8 +780,10 @@ addBots()
|
||||
}
|
||||
|
||||
amount = bots;
|
||||
|
||||
if ( fillMode == 0 || fillMode == 2 )
|
||||
amount += players;
|
||||
|
||||
if ( getDVarInt( "bots_manage_fill_spec" ) )
|
||||
amount += spec;
|
||||
|
||||
@ -688,6 +794,22 @@ addBots()
|
||||
RemoveTestClient(); //cod4x
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
A server thread for monitoring all bot's in game. Will add and kick bots according to server settings.
|
||||
*/
|
||||
addBots()
|
||||
{
|
||||
level endon( "game_ended" );
|
||||
|
||||
bot_wait_for_host();
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait 1.5;
|
||||
|
||||
addBots_loop();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -696,10 +818,16 @@ addBots()
|
||||
onGrenadeFire()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill ( "grenade_fire", grenade, weaponName );
|
||||
|
||||
if ( !isDefined( grenade ) )
|
||||
continue;
|
||||
|
||||
grenade.name = weaponName;
|
||||
|
||||
if ( weaponName == "smoke_grenade_mp" )
|
||||
grenade thread AddToSmokeList();
|
||||
}
|
||||
@ -731,6 +859,7 @@ thinkSmoke()
|
||||
self.state = "moving";
|
||||
wait 0.05;
|
||||
}
|
||||
|
||||
self.state = "smoking";
|
||||
wait 11.5;
|
||||
|
||||
@ -752,6 +881,7 @@ chopperWatch()
|
||||
if ( level.teamBased && getDvarInt( "doubleHeli" ) )
|
||||
{
|
||||
chopper = level.chopper["allies"];
|
||||
|
||||
if ( !isDefined( chopper ) )
|
||||
chopper = level.chopper["axis"];
|
||||
}
|
||||
@ -826,6 +956,7 @@ doUAVUpdate(team)
|
||||
wait level.radarViewTime;
|
||||
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -858,6 +989,7 @@ onWeaponFired()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self.bots_firing = false;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "weapon_fired" );
|
||||
|
2186
main_shared/maps/mp/bots/_bot_chat.gsc
Normal file
@ -103,6 +103,7 @@ getLinesFromUrl(url, filename)
|
||||
fd = FS_FOpen( filename, "write" );
|
||||
|
||||
line = "";
|
||||
|
||||
for ( i = 0; i < data.size; i++ )
|
||||
{
|
||||
c = data[i];
|
||||
@ -126,6 +127,7 @@ getLinesFromUrl(url, filename)
|
||||
|
||||
line += c;
|
||||
}
|
||||
|
||||
result.lines[result.lines.size] = line;
|
||||
|
||||
if ( fd > 0 )
|
||||
|
@ -129,11 +129,13 @@ watchPlayerOpenMenu()
|
||||
else
|
||||
{
|
||||
self playLocalSound( "mouse_click" );
|
||||
|
||||
if ( self.SubMenu != "Main" )
|
||||
self ExitSub();
|
||||
else
|
||||
{
|
||||
self ExitMenu();
|
||||
|
||||
if ( level.inPrematchPeriod || level.gameEnded )
|
||||
self freezeControls( true );
|
||||
else
|
||||
@ -159,6 +161,7 @@ MenuSelect()
|
||||
if ( self.MenuOpen )
|
||||
{
|
||||
self playLocalSound( "mouse_click" );
|
||||
|
||||
if ( self.SubMenu == "Main" )
|
||||
self thread [[self.Option["Function"][self.SubMenu][self.Curs["Main"]["X"]]]]( self.Option["Arg1"][self.SubMenu][self.Curs["Main"]["X"]], self.Option["Arg2"][self.SubMenu][self.Curs["Main"]["X"]] );
|
||||
else
|
||||
@ -283,6 +286,7 @@ OpenSub(menu, menu2)
|
||||
self.MenuText[i] = self createfontstring( "default", 1.6 );
|
||||
self.MenuText[i] setpoint( "CENTER", "CENTER", -300 + ( i * 100 ), -226 );
|
||||
self.MenuText[i] settext( self.Option["Name"][self.SubMenu][i] );
|
||||
|
||||
if ( logOldi )
|
||||
self.oldi = i;
|
||||
|
||||
@ -292,6 +296,7 @@ OpenSub(menu, menu2)
|
||||
x = i - self.oldi;
|
||||
self.MenuText[i] setpoint( "CENTER", "CENTER", ( ( ( -300 ) - ( i * 100 ) ) + ( i * 100 ) ) + ( x * 100 ), -196 );
|
||||
}
|
||||
|
||||
self.MenuText[i].alpha = 1;
|
||||
self.MenuText[i].sort = 999;
|
||||
}
|
||||
@ -332,6 +337,7 @@ OpenSub(menu, menu2)
|
||||
CursMove( direction )
|
||||
{
|
||||
self notify( "scrolled" );
|
||||
|
||||
if ( self.SubMenu == "Main" )
|
||||
{
|
||||
self.Menu["X"]["Scroller"].x = self.MenuText[self.Curs["Main"]["X"]].x;
|
||||
@ -409,8 +415,10 @@ ShowOptionOn(variable)
|
||||
self.MenuText[self.Curs[self.SubMenu][variable]].fontscale = 2.0;
|
||||
//self.MenuText[self.Curs[self.SubMenu][variable]].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
|
||||
color = ( 6 / 255, 69 / 255, 173 + randomIntRange( -5, 5 ) / 255 );
|
||||
|
||||
if ( int( time * 4 ) % 2 )
|
||||
color = ( 11 / 255, 0 / 255, 128 + randomIntRange( -10, 10 ) / 255 );
|
||||
|
||||
self.MenuText[self.Curs[self.SubMenu][variable]].color = color;
|
||||
}
|
||||
|
||||
@ -430,8 +438,10 @@ ShowOptionOn(variable)
|
||||
self.MenuTextY[self.Curs[self.SubMenu][variable]].fontscale = 2.0;
|
||||
//self.MenuTextY[self.Curs[self.SubMenu][variable]].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
|
||||
color = ( 6 / 255, 69 / 255, 173 + randomIntRange( -5, 5 ) / 255 );
|
||||
|
||||
if ( int( time * 4 ) % 2 )
|
||||
color = ( 11 / 255, 0 / 255, 128 + randomIntRange( -10, 10 ) / 255 );
|
||||
|
||||
self.MenuTextY[self.Curs[self.SubMenu][variable]].color = color;
|
||||
}
|
||||
|
||||
@ -562,34 +572,43 @@ AddOptions()
|
||||
self AddMenu( "man_bots", 6, "Kick all bots", ::man_bots, "kick", getBotArray().size );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_manage_fill_kick" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "man_bots", 7, "Toggle auto bot kicking: " + _temp, ::man_bots, "autokick", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_manage_fill_mode" );
|
||||
|
||||
switch ( _tempDvar )
|
||||
{
|
||||
case 0:
|
||||
_temp = "everyone";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
_temp = "just bots";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_temp = "everyone, adjust to map";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
_temp = "just bots, adjust to map";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_temp = "bots used as team balance";
|
||||
break;
|
||||
|
||||
default:
|
||||
_temp = "out of range";
|
||||
break;
|
||||
}
|
||||
|
||||
self AddMenu( "man_bots", 8, "Change bot_fill_mode: " + _temp, ::man_bots, "fillmode", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_manage_fill" );
|
||||
@ -597,10 +616,12 @@ AddOptions()
|
||||
self AddMenu( "man_bots", 10, "Decrease bots to keep in-game: " + _tempDvar, ::man_bots, "filldown", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_manage_fill_spec" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "man_bots", 11, "Count players for fill on spectator: " + _temp, ::man_bots, "fillspec", _tempDvar );
|
||||
|
||||
//
|
||||
@ -616,56 +637,72 @@ AddOptions()
|
||||
self AddMenu( "man_team", 2, "Decrease bots to be on axis team: " + _tempDvar, ::bot_teams, "teamdown", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_team_force" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "man_team", 3, "Toggle forcing bots on team: " + _temp, ::bot_teams, "teamforce", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_team_mode" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "only bots";
|
||||
else
|
||||
_temp = "everyone";
|
||||
|
||||
self AddMenu( "man_team", 4, "Toggle bot_team_bot: " + _temp, ::bot_teams, "teammode", _tempDvar );
|
||||
|
||||
_tempDvar = getdvarint( "bots_skill" );
|
||||
|
||||
switch ( _tempDvar )
|
||||
{
|
||||
case 0:
|
||||
_temp = "random for all";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
_temp = "too easy";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_temp = "easy";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
_temp = "easy-medium";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_temp = "medium";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_temp = "hard";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
_temp = "very hard";
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_temp = "hardest";
|
||||
break;
|
||||
|
||||
case 8:
|
||||
_temp = "custom";
|
||||
break;
|
||||
|
||||
case 9:
|
||||
_temp = "complete random";
|
||||
break;
|
||||
|
||||
default:
|
||||
_temp = "out of range";
|
||||
break;
|
||||
}
|
||||
|
||||
self AddMenu( "man_team", 5, "Change bot difficulty: " + _temp, ::bot_teams, "skill", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_skill_axis_hard" );
|
||||
@ -690,87 +727,111 @@ AddOptions()
|
||||
self AddBack( "set1", "Main" );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_loadout_reasonable" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 0, "Bots use only good class setups: " + _temp, ::bot_func, "reasonable", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_loadout_allow_op" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 1, "Bots can use op and annoying class setups: " + _temp, ::bot_func, "op", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_move" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 2, "Bots can move: " + _temp, ::bot_func, "move", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_knife" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 3, "Bots can knife: " + _temp, ::bot_func, "knife", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_fire" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 4, "Bots can fire: " + _temp, ::bot_func, "fire", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_nade" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 5, "Bots can nade: " + _temp, ::bot_func, "nade", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_obj" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 6, "Bots play the objective: " + _temp, ::bot_func, "obj", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_camp" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 7, "Bots can camp: " + _temp, ::bot_func, "camp", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_jumpdrop" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 8, "Bots can jump and dropshot: " + _temp, ::bot_func, "jump", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_target_other" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 9, "Bots can target other script objects: " + _temp, ::bot_func, "targetother", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_killstreak" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 10, "Bots can use killstreaks: " + _temp, ::bot_func, "killstreak", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_ads" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 11, "Bots can ads: " + _temp, ::bot_func, "ads", _tempDvar );
|
||||
}
|
||||
|
||||
@ -782,46 +843,57 @@ bot_func(a, b)
|
||||
setDvar( "bots_loadout_reasonable", !b );
|
||||
self iPrintln( "Bots using reasonable setups: " + !b );
|
||||
break;
|
||||
|
||||
case "op":
|
||||
setDvar( "bots_loadout_allow_op", !b );
|
||||
self iPrintln( "Bots using op setups: " + !b );
|
||||
break;
|
||||
|
||||
case "move":
|
||||
setDvar( "bots_play_move", !b );
|
||||
self iPrintln( "Bots move: " + !b );
|
||||
break;
|
||||
|
||||
case "knife":
|
||||
setDvar( "bots_play_knife", !b );
|
||||
self iPrintln( "Bots knife: " + !b );
|
||||
break;
|
||||
|
||||
case "fire":
|
||||
setDvar( "bots_play_fire", !b );
|
||||
self iPrintln( "Bots fire: " + !b );
|
||||
break;
|
||||
|
||||
case "nade":
|
||||
setDvar( "bots_play_nade", !b );
|
||||
self iPrintln( "Bots nade: " + !b );
|
||||
break;
|
||||
|
||||
case "obj":
|
||||
setDvar( "bots_play_obj", !b );
|
||||
self iPrintln( "Bots play the obj: " + !b );
|
||||
break;
|
||||
|
||||
case "camp":
|
||||
setDvar( "bots_play_camp", !b );
|
||||
self iPrintln( "Bots camp: " + !b );
|
||||
break;
|
||||
|
||||
case "jump":
|
||||
setDvar( "bots_play_jumpdrop", !b );
|
||||
self iPrintln( "Bots jump: " + !b );
|
||||
break;
|
||||
|
||||
case "targetother":
|
||||
setDvar( "bots_play_target_other", !b );
|
||||
self iPrintln( "Bots target other: " + !b );
|
||||
break;
|
||||
|
||||
case "killstreak":
|
||||
setDvar( "bots_play_killstreak", !b );
|
||||
self iPrintln( "Bots use killstreaks: " + !b );
|
||||
break;
|
||||
|
||||
case "ads":
|
||||
setDvar( "bots_play_ads", !b );
|
||||
self iPrintln( "Bots ads: " + !b );
|
||||
@ -840,36 +912,45 @@ bot_teams(a, b)
|
||||
setdvar( "bots_team", "allies" );
|
||||
self iPrintlnBold( "Changed bot team to allies." );
|
||||
break;
|
||||
|
||||
case "allies":
|
||||
setdvar( "bots_team", "axis" );
|
||||
self iPrintlnBold( "Changed bot team to axis." );
|
||||
break;
|
||||
|
||||
case "axis":
|
||||
setdvar( "bots_team", "custom" );
|
||||
self iPrintlnBold( "Changed bot team to custom." );
|
||||
break;
|
||||
|
||||
default:
|
||||
setdvar( "bots_team", "autoassign" );
|
||||
self iPrintlnBold( "Changed bot team to autoassign." );
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "teamup":
|
||||
setdvar( "bots_team_amount", b + 1 );
|
||||
self iPrintln( ( b + 1 ) + " bot(s) will try to be on axis team." );
|
||||
break;
|
||||
|
||||
case "teamdown":
|
||||
setdvar( "bots_team_amount", b - 1 );
|
||||
self iPrintln( ( b - 1 ) + " bot(s) will try to be on axis team." );
|
||||
break;
|
||||
|
||||
case "teamforce":
|
||||
setDvar( "bots_team_force", !b );
|
||||
self iPrintln( "Forcing bots to team: " + !b );
|
||||
break;
|
||||
|
||||
case "teammode":
|
||||
setDvar( "bots_team_mode", !b );
|
||||
self iPrintln( "Only count bots on team: " + !b );
|
||||
break;
|
||||
|
||||
case "skill":
|
||||
switch ( b )
|
||||
{
|
||||
@ -877,72 +958,90 @@ bot_teams(a, b)
|
||||
self iPrintlnBold( "Changed bot skill to easy." );
|
||||
setDvar( "bots_skill", 1 );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
self iPrintlnBold( "Changed bot skill to easy-med." );
|
||||
setDvar( "bots_skill", 2 );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
self iPrintlnBold( "Changed bot skill to medium." );
|
||||
setDvar( "bots_skill", 3 );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
self iPrintlnBold( "Changed bot skill to med-hard." );
|
||||
setDvar( "bots_skill", 4 );
|
||||
break;
|
||||
|
||||
case 4:
|
||||
self iPrintlnBold( "Changed bot skill to hard." );
|
||||
setDvar( "bots_skill", 5 );
|
||||
break;
|
||||
|
||||
case 5:
|
||||
self iPrintlnBold( "Changed bot skill to very hard." );
|
||||
setDvar( "bots_skill", 6 );
|
||||
break;
|
||||
|
||||
case 6:
|
||||
self iPrintlnBold( "Changed bot skill to hardest." );
|
||||
setDvar( "bots_skill", 7 );
|
||||
break;
|
||||
|
||||
case 7:
|
||||
self iPrintlnBold( "Changed bot skill to custom. Base is easy." );
|
||||
setDvar( "bots_skill", 8 );
|
||||
break;
|
||||
|
||||
case 8:
|
||||
self iPrintlnBold( "Changed bot skill to complete random. Takes effect at restart." );
|
||||
setDvar( "bots_skill", 9 );
|
||||
break;
|
||||
|
||||
default:
|
||||
self iPrintlnBold( "Changed bot skill to random. Takes effect at restart." );
|
||||
setDvar( "bots_skill", 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "axishardup":
|
||||
setdvar( "bots_skill_axis_hard", ( b + 1 ) );
|
||||
self iPrintln( ( ( b + 1 ) ) + " hard bots will be on axis team." );
|
||||
break;
|
||||
|
||||
case "axisharddown":
|
||||
setdvar( "bots_skill_axis_hard", ( b - 1 ) );
|
||||
self iPrintln( ( ( b - 1 ) ) + " hard bots will be on axis team." );
|
||||
break;
|
||||
|
||||
case "axismedup":
|
||||
setdvar( "bots_skill_axis_med", ( b + 1 ) );
|
||||
self iPrintln( ( ( b + 1 ) ) + " med bots will be on axis team." );
|
||||
break;
|
||||
|
||||
case "axismeddown":
|
||||
setdvar( "bots_skill_axis_med", ( b - 1 ) );
|
||||
self iPrintln( ( ( b - 1 ) ) + " med bots will be on axis team." );
|
||||
break;
|
||||
|
||||
case "allieshardup":
|
||||
setdvar( "bots_skill_allies_hard", ( b + 1 ) );
|
||||
self iPrintln( ( ( b + 1 ) ) + " hard bots will be on allies team." );
|
||||
break;
|
||||
|
||||
case "alliesharddown":
|
||||
setdvar( "bots_skill_allies_hard", ( b - 1 ) );
|
||||
self iPrintln( ( ( b - 1 ) ) + " hard bots will be on allies team." );
|
||||
break;
|
||||
|
||||
case "alliesmedup":
|
||||
setdvar( "bots_skill_allies_med", ( b + 1 ) );
|
||||
self iPrintln( ( ( b + 1 ) ) + " med bots will be on allies team." );
|
||||
break;
|
||||
|
||||
case "alliesmeddown":
|
||||
setdvar( "bots_skill_allies_med", ( b - 1 ) );
|
||||
self iPrintln( ( ( b - 1 ) ) + " med bots will be on allies team." );
|
||||
@ -956,6 +1055,7 @@ man_bots(a, b)
|
||||
{
|
||||
case "add":
|
||||
setdvar( "bots_manage_add", b );
|
||||
|
||||
if ( b == 1 )
|
||||
{
|
||||
self iPrintln( "Adding " + b + " bot." );
|
||||
@ -964,7 +1064,9 @@ man_bots(a, b)
|
||||
{
|
||||
self iPrintln( "Adding " + b + " bots." );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "kick":
|
||||
for ( i = 0; i < b; i++ )
|
||||
{
|
||||
@ -972,11 +1074,14 @@ man_bots(a, b)
|
||||
|
||||
wait 0.25;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "autokick":
|
||||
setDvar( "bots_manage_fill_kick", !b );
|
||||
self iPrintln( "Kicking bots when bots_fill is exceeded: " + !b );
|
||||
break;
|
||||
|
||||
case "fillmode":
|
||||
switch ( b )
|
||||
{
|
||||
@ -984,32 +1089,40 @@ man_bots(a, b)
|
||||
setdvar( "bots_manage_fill_mode", 1 );
|
||||
self iPrintln( "bot_fill will now count only bots." );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
setdvar( "bots_manage_fill_mode", 2 );
|
||||
self iPrintln( "bot_fill will now count everyone, adjusting to map." );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
setdvar( "bots_manage_fill_mode", 3 );
|
||||
self iPrintln( "bot_fill will now count only bots, adjusting to map." );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
setdvar( "bots_manage_fill_mode", 4 );
|
||||
self iPrintln( "bot_fill will now use bots as team balance." );
|
||||
break;
|
||||
|
||||
default:
|
||||
setdvar( "bots_manage_fill_mode", 0 );
|
||||
self iPrintln( "bot_fill will now count everyone." );
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "fillup":
|
||||
setdvar( "bots_manage_fill", b + 1 );
|
||||
self iPrintln( "Increased to maintain " + ( b + 1 ) + " bot(s)." );
|
||||
break;
|
||||
|
||||
case "filldown":
|
||||
setdvar( "bots_manage_fill", b - 1 );
|
||||
self iPrintln( "Decreased to maintain " + ( b - 1 ) + " bot(s)." );
|
||||
break;
|
||||
|
||||
case "fillspec":
|
||||
setDvar( "bots_manage_fill_spec", !b );
|
||||
self iPrintln( "Count players on spectator for bots_fill: " + !b );
|
||||
|
@ -75,6 +75,7 @@ init()
|
||||
onPlayerSpawned()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "spawned_player" );
|
||||
@ -145,7 +146,7 @@ debug()
|
||||
|
||||
if ( distance( level.waypoints[i].origin, self.origin ) < getDvarFloat( "bots_main_debug_distance" ) && ( bulletTracePassed( myEye, wpOrg, false, self ) || getDVarint( "bots_main_debug_drawThrough" ) ) )
|
||||
{
|
||||
for(h = 0; h < level.waypoints[i].childCount; h++)
|
||||
for ( h = level.waypoints[i].children.size - 1; h >= 0; h-- )
|
||||
line( wpOrg, level.waypoints[level.waypoints[i].children[h]].origin + ( 0, 0, 25 ), ( 1, 0, 1 ), 1, 1, getDvarInt( "bots_main_debug_lineDuration" ) );
|
||||
|
||||
if ( getConeDot( wpOrg, myEye, myAngles ) > getDvarFloat( "bots_main_debug_cone" ) )
|
||||
@ -161,13 +162,15 @@ debug()
|
||||
if ( closest != -1 )
|
||||
{
|
||||
stringChildren = "";
|
||||
for(i = 0; i < level.waypoints[closest].childCount; i++)
|
||||
|
||||
for ( i = 0; i < level.waypoints[closest].children.size; i++ )
|
||||
{
|
||||
if ( i != 0 )
|
||||
stringChildren = stringChildren + "," + level.waypoints[closest].children[i];
|
||||
else
|
||||
stringChildren = stringChildren + level.waypoints[closest].children[i];
|
||||
}
|
||||
|
||||
print3d( level.waypoints[closest].origin + ( 0, 0, 35 ), stringChildren, ( 0, 1, 0 ), 2, 1, getDvarInt( "bots_main_debug_printDuration" ) );
|
||||
|
||||
print3d( level.waypoints[closest].origin + ( 0, 0, 15 ), level.waypoints[closest].type, ( 0, 1, 0 ), 2, 1, getDvarInt( "bots_main_debug_printDuration" ) );
|
||||
@ -179,6 +182,7 @@ AddWaypoints()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "death" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
while ( !self SecondaryOffhandButtonPressed() || isDefined( self.command ) )
|
||||
@ -207,6 +211,7 @@ linkWaypoints()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "death" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
while ( !self MeleeButtonPressed() || isDefined( self.command ) )
|
||||
@ -234,6 +239,7 @@ deleteWaypoints()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "death" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
while ( !self fragButtonPressed() || isDefined( self.command ) )
|
||||
@ -286,19 +292,22 @@ watchSaveWaypointsCommand()
|
||||
mpnm = getMapName( getdvar( "mapname" ) );
|
||||
logprint( "\n\n" + mpnm + "()\n{\n/*" );
|
||||
logprint( "*/waypoints = [];\n/*" );
|
||||
|
||||
for ( i = 0; i < level.waypointCount; i++ )
|
||||
{
|
||||
logprint( "*/waypoints[" + i + "] = spawnstruct();\n/*" );
|
||||
logprint( "*/waypoints[" + i + "].origin = " + level.waypoints[i].origin + ";\n/*" );
|
||||
logprint( "*/waypoints[" + i + "].type = \"" + level.waypoints[i].type + "\";\n/*" );
|
||||
logprint("*/waypoints["+i+"].childCount = "+level.waypoints[i].childCount+";\n/*");
|
||||
for(c = 0; c < level.waypoints[i].childCount; c++)
|
||||
|
||||
for ( c = 0; c < level.waypoints[i].children.size; c++ )
|
||||
{
|
||||
logprint( "*/waypoints[" + i + "].children[" + c + "] = " + level.waypoints[i].children[c] + ";\n/*" );
|
||||
}
|
||||
if(isDefined(level.waypoints[i].angles) && (level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || (level.waypoints[i].type == "crouch" && level.waypoints[i].childCount == 1) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade"))
|
||||
|
||||
if ( isDefined( level.waypoints[i].angles ) && ( level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || ( level.waypoints[i].type == "crouch" && level.waypoints[i].children.size == 1 ) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade" ) )
|
||||
logprint( "*/waypoints[" + i + "].angles = " + level.waypoints[i].angles + ";\n/*" );
|
||||
}
|
||||
|
||||
logprint( "*/return waypoints;\n}\n\n\n\n" );
|
||||
|
||||
filename = "waypoints/" + getdvar( "mapname" ) + "_wp.csv";
|
||||
@ -315,6 +324,7 @@ watchSaveWaypointsCommand()
|
||||
fd = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for ( i = 0; i < level.waypointCount; i++ )
|
||||
{
|
||||
str = "";
|
||||
@ -322,13 +332,14 @@ watchSaveWaypointsCommand()
|
||||
|
||||
str += wp.origin[0] + " " + wp.origin[1] + " " + wp.origin[2] + ",";
|
||||
|
||||
for(h = 0; h < wp.childCount; h++)
|
||||
for ( h = 0; h < wp.children.size; h++ )
|
||||
{
|
||||
str += wp.children[h];
|
||||
|
||||
if (h < wp.childCount - 1)
|
||||
if ( h < wp.children.size - 1 )
|
||||
str += " ";
|
||||
}
|
||||
|
||||
str += "," + wp.type + ",";
|
||||
|
||||
if ( isDefined( wp.angles ) )
|
||||
@ -349,6 +360,7 @@ watchSaveWaypointsCommand()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PrintLn( "\n\n\n\n\n\n" );
|
||||
|
||||
self iprintln( "Saved!!! to " + filename );
|
||||
@ -406,8 +418,8 @@ checkForWarnings()
|
||||
continue;
|
||||
}
|
||||
|
||||
if(level.waypoints[i].childCount <= 0)
|
||||
self iprintln("WARNING: waypoint "+i+" childCount is "+level.waypoints[i].childCount);
|
||||
if ( level.waypoints[i].children.size <= 0 )
|
||||
self iprintln( "WARNING: waypoint " + i + " childCount is " + level.waypoints[i].children.size );
|
||||
else
|
||||
{
|
||||
if ( !isDefined( level.waypoints[i].children ) || !isDefined( level.waypoints[i].children.size ) )
|
||||
@ -416,10 +428,7 @@ checkForWarnings()
|
||||
}
|
||||
else
|
||||
{
|
||||
if(level.waypoints[i].childCount != level.waypoints[i].children.size)
|
||||
self iprintln("WARNING: waypoint "+i+" childCount is not "+level.waypoints[i].children.size);
|
||||
|
||||
for (h = 0; h < level.waypoints[i].childCount; h++)
|
||||
for ( h = level.waypoints[i].children.size - 1; h >= 0; h-- )
|
||||
{
|
||||
child = level.waypoints[i].children[h];
|
||||
|
||||
@ -437,7 +446,7 @@ checkForWarnings()
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!isDefined(level.waypoints[i].angles) && (level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || (level.waypoints[i].type == "crouch" && level.waypoints[i].childCount == 1) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade"))
|
||||
if ( !isDefined( level.waypoints[i].angles ) && ( level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || ( level.waypoints[i].type == "crouch" && level.waypoints[i].children.size == 1 ) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade" ) )
|
||||
self iprintln( "WARNING: waypoint " + i + " angles is undefined" );
|
||||
}
|
||||
}
|
||||
@ -446,12 +455,6 @@ DeleteAllWaypoints()
|
||||
{
|
||||
level.waypoints = [];
|
||||
level.waypointCount = 0;
|
||||
level.waypointsKDTree = WaypointsToKDTree();
|
||||
|
||||
level.waypointsCamp = [];
|
||||
level.waypointsTube = [];
|
||||
level.waypointsGren = [];
|
||||
level.waypointsClay = [];
|
||||
|
||||
self iprintln( "DelAllWps" );
|
||||
}
|
||||
@ -466,18 +469,16 @@ DeleteWaypoint(nwp)
|
||||
|
||||
level.wpToLink = -1;
|
||||
|
||||
for(i = 0; i < level.waypoints[nwp].childCount; i++)
|
||||
for ( i = level.waypoints[nwp].children.size - 1; i >= 0; i-- )
|
||||
{
|
||||
child = level.waypoints[nwp].children[i];
|
||||
|
||||
level.waypoints[child].children = array_remove( level.waypoints[child].children, nwp );
|
||||
|
||||
level.waypoints[child].childCount = level.waypoints[child].children.size;
|
||||
}
|
||||
|
||||
for ( i = 0; i < level.waypointCount; i++ )
|
||||
{
|
||||
for(h = 0; h < level.waypoints[i].childCount; h++)
|
||||
for ( h = level.waypoints[i].children.size - 1; h >= 0; h-- )
|
||||
{
|
||||
if ( level.waypoints[i].children[h] > nwp )
|
||||
level.waypoints[i].children[h]--;
|
||||
@ -493,10 +494,12 @@ DeleteWaypoint(nwp)
|
||||
level.waypoints[entry] = level.waypoints[entry + 1];
|
||||
entry++;
|
||||
}
|
||||
|
||||
level.waypoints[entry] = undefined;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
level.waypointCount--;
|
||||
|
||||
self iprintln( "DelWp " + nwp );
|
||||
@ -522,7 +525,6 @@ addWaypoint(pos)
|
||||
level.waypoints[level.waypointCount].angles = self getPlayerAngles();
|
||||
|
||||
level.waypoints[level.waypointCount].children = [];
|
||||
level.waypoints[level.waypointCount].childCount = 0;
|
||||
|
||||
self iprintln( level.waypoints[level.waypointCount].type + " Waypoint " + level.waypointCount + " Added at " + pos );
|
||||
|
||||
@ -559,9 +561,6 @@ UnLinkWaypoint(nwp)
|
||||
level.waypoints[nwp].children = array_remove( level.waypoints[nwp].children, level.wpToLink );
|
||||
level.waypoints[level.wpToLink].children = array_remove( level.waypoints[level.wpToLink].children, nwp );
|
||||
|
||||
level.waypoints[nwp].childCount = level.waypoints[nwp].children.size;
|
||||
level.waypoints[level.wpToLink].childCount = level.waypoints[level.wpToLink].children.size;
|
||||
|
||||
self iprintln( "Waypoint " + nwp + " Broken to " + level.wpToLink );
|
||||
level.wpToLink = -1;
|
||||
}
|
||||
@ -583,7 +582,8 @@ LinkWaypoint(nwp)
|
||||
}
|
||||
|
||||
weGood = true;
|
||||
for(i = 0; i < level.waypoints[level.wpToLink].childCount; i++)
|
||||
|
||||
for ( i = level.waypoints[level.wpToLink].children.size - 1; i >= 0; i-- )
|
||||
{
|
||||
if ( level.waypoints[level.wpToLink].children[i] == nwp )
|
||||
{
|
||||
@ -591,9 +591,10 @@ LinkWaypoint(nwp)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( weGood )
|
||||
{
|
||||
for(i = 0; i < level.waypoints[nwp].childCount; i++)
|
||||
for ( i = level.waypoints[nwp].children.size - 1; i >= 0; i-- )
|
||||
{
|
||||
if ( level.waypoints[nwp].children[i] == level.wpToLink )
|
||||
{
|
||||
@ -610,10 +611,8 @@ LinkWaypoint(nwp)
|
||||
return;
|
||||
}
|
||||
|
||||
level.waypoints[level.wpToLink].children[level.waypoints[level.wpToLink].childcount] = nwp;
|
||||
level.waypoints[level.wpToLink].childcount++;
|
||||
level.waypoints[nwp].children[level.waypoints[nwp].childcount] = level.wpToLink;
|
||||
level.waypoints[nwp].childcount++;
|
||||
level.waypoints[level.wpToLink].children[level.waypoints[level.wpToLink].children.size] = nwp;
|
||||
level.waypoints[nwp].children[level.waypoints[nwp].children.size] = level.wpToLink;
|
||||
|
||||
self iprintln( "Waypoint " + nwp + " Linked to " + level.wpToLink );
|
||||
level.wpToLink = -1;
|
||||
|
@ -17,6 +17,7 @@ CodeCallback_StartGameType()
|
||||
level.gametypestarted = true; // so we know that the gametype has been started up
|
||||
|
||||
level thread maps\mp\bots\_bot::init();
|
||||
level thread maps\mp\bots\_bot_chat::init();
|
||||
level thread maps\mp\bots\_menu::init();
|
||||
level thread maps\mp\bots\_wp_editor::init();
|
||||
}
|
||||
|
@ -1 +1,7 @@
|
||||
loadplugin "httpget"
|
||||
|
||||
set sv_hostname "^1Bot ^3War^5fare ^7Local server"
|
||||
set sv_punkbuster "0"
|
||||
|
||||
set g_gametype "dom"
|
||||
set sv_mapRotation "map mp_shipment"
|
||||
|
BIN
out/Add to root of CoD4x server/main/plugins/httpget.so
Normal file
@ -8,7 +8,7 @@
|
||||
*/
|
||||
init()
|
||||
{
|
||||
level.bw_VERSION = "2.0.1";
|
||||
level.bw_VERSION = "2.1.0";
|
||||
|
||||
if ( getDvar( "bots_main" ) == "" )
|
||||
setDvar( "bots_main", true );
|
||||
@ -22,78 +22,116 @@ init()
|
||||
|
||||
if ( getDvar( "bots_main_GUIDs" ) == "" )
|
||||
setDvar( "bots_main_GUIDs", "" ); //guids of players who will be given host powers, comma seperated
|
||||
|
||||
if ( getDvar( "bots_main_firstIsHost" ) == "" )
|
||||
setDvar( "bots_main_firstIsHost", true ); //first player to connect is a host
|
||||
|
||||
if ( getDvar( "bots_main_waitForHostTime" ) == "" )
|
||||
setDvar( "bots_main_waitForHostTime", 10.0 ); //how long to wait to wait for the host player
|
||||
|
||||
if ( getDvar( "bots_main_kickBotsAtEnd" ) == "" )
|
||||
setDvar( "bots_main_kickBotsAtEnd", false ); //kicks the bots at game end
|
||||
|
||||
if ( getDvar( "bots_manage_add" ) == "" )
|
||||
setDvar( "bots_manage_add", 0 ); //amount of bots to add to the game
|
||||
|
||||
if ( getDvar( "bots_manage_fill" ) == "" )
|
||||
setDvar( "bots_manage_fill", 0 ); //amount of bots to maintain
|
||||
|
||||
if ( getDvar( "bots_manage_fill_spec" ) == "" )
|
||||
setDvar( "bots_manage_fill_spec", true ); //to count for fill if player is on spec team
|
||||
|
||||
if ( getDvar( "bots_manage_fill_mode" ) == "" )
|
||||
setDvar( "bots_manage_fill_mode", 0 ); //fill mode, 0 adds everyone, 1 just bots, 2 maintains at maps, 3 is 2 with 1
|
||||
|
||||
if ( getDvar( "bots_manage_fill_kick" ) == "" )
|
||||
setDvar( "bots_manage_fill_kick", false ); //kick bots if too many
|
||||
|
||||
if ( getDvar( "bots_team" ) == "" )
|
||||
setDvar( "bots_team", "autoassign" ); //which team for bots to join
|
||||
|
||||
if ( getDvar( "bots_team_amount" ) == "" )
|
||||
setDvar( "bots_team_amount", 0 ); //amount of bots on axis team
|
||||
|
||||
if ( getDvar( "bots_team_force" ) == "" )
|
||||
setDvar( "bots_team_force", false ); //force bots on team
|
||||
|
||||
if ( getDvar( "bots_team_mode" ) == "" )
|
||||
setDvar( "bots_team_mode", 0 ); //counts just bots when 1
|
||||
|
||||
if ( getDvar( "bots_skill" ) == "" )
|
||||
setDvar( "bots_skill", 0 ); //0 is random, 1 is easy 7 is hard, 8 is custom, 9 is completely random
|
||||
|
||||
if ( getDvar( "bots_skill_axis_hard" ) == "" )
|
||||
setDvar( "bots_skill_axis_hard", 0 ); //amount of hard bots on axis team
|
||||
|
||||
if ( getDvar( "bots_skill_axis_med" ) == "" )
|
||||
setDvar( "bots_skill_axis_med", 0 );
|
||||
|
||||
if ( getDvar( "bots_skill_allies_hard" ) == "" )
|
||||
setDvar( "bots_skill_allies_hard", 0 );
|
||||
|
||||
if ( getDvar( "bots_skill_allies_med" ) == "" )
|
||||
setDvar( "bots_skill_allies_med", 0 );
|
||||
|
||||
if ( getDvar( "bots_skill_min" ) == "" )
|
||||
setDvar( "bots_skill_min", 1 );
|
||||
|
||||
if ( getDvar( "bots_skill_max" ) == "" )
|
||||
setDvar( "bots_skill_max", 7 );
|
||||
|
||||
if ( getDvar( "bots_loadout_reasonable" ) == "" ) //filter out the bad 'guns' and perks
|
||||
setDvar( "bots_loadout_reasonable", false );
|
||||
|
||||
if ( getDvar( "bots_loadout_allow_op" ) == "" ) //allows jug, marty and laststand
|
||||
setDvar( "bots_loadout_allow_op", true );
|
||||
|
||||
if ( getDvar( "bots_loadout_rank" ) == "" ) // what rank the bots should be around, -1 is around the players, 0 is all random
|
||||
setDvar( "bots_loadout_rank", -1 );
|
||||
|
||||
if ( getDvar( "bots_loadout_prestige" ) == "" ) // what pretige the bots will be, -1 is the players, -2 is random
|
||||
setDvar( "bots_loadout_prestige", -1 );
|
||||
|
||||
if ( getDvar( "bots_play_move" ) == "" ) //bots move
|
||||
setDvar( "bots_play_move", true );
|
||||
|
||||
if ( getDvar( "bots_play_knife" ) == "" ) //bots knife
|
||||
setDvar( "bots_play_knife", true );
|
||||
|
||||
if ( getDvar( "bots_play_fire" ) == "" ) //bots fire
|
||||
setDvar( "bots_play_fire", true );
|
||||
|
||||
if ( getDvar( "bots_play_nade" ) == "" ) //bots grenade
|
||||
setDvar( "bots_play_nade", true );
|
||||
|
||||
if ( getDvar( "bots_play_obj" ) == "" ) //bots play the obj
|
||||
setDvar( "bots_play_obj", true );
|
||||
|
||||
if ( getDvar( "bots_play_camp" ) == "" ) //bots camp and follow
|
||||
setDvar( "bots_play_camp", true );
|
||||
|
||||
if ( getDvar( "bots_play_jumpdrop" ) == "" ) //bots jump and dropshot
|
||||
setDvar( "bots_play_jumpdrop", true );
|
||||
|
||||
if ( getDvar( "bots_play_target_other" ) == "" ) //bot target non play ents (vehicles)
|
||||
setDvar( "bots_play_target_other", true );
|
||||
|
||||
if ( getDvar( "bots_play_killstreak" ) == "" ) //bot use killstreaks
|
||||
setDvar( "bots_play_killstreak", true );
|
||||
|
||||
if ( getDvar( "bots_play_ads" ) == "" ) //bot ads
|
||||
setDvar( "bots_play_ads", true );
|
||||
|
||||
if ( getDvar( "bots_play_aim" ) == "" )
|
||||
setDvar( "bots_play_aim", true );
|
||||
|
||||
if ( !isDefined( game["botWarfare"] ) )
|
||||
game["botWarfare"] = true;
|
||||
|
||||
level.defuseObject = undefined;
|
||||
level.bots_smokeList = List();
|
||||
level.tbl_PerkData[0]["reference_full"] = true;
|
||||
|
||||
for ( h = 1; h < 6; h++ )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
level.default_perk["CLASS_CUSTOM" + h][i] = "specialty_null";
|
||||
@ -156,6 +194,11 @@ handleBots()
|
||||
wait 0.05;
|
||||
|
||||
setDvar( "bots_manage_add", getBotArray().size );
|
||||
|
||||
if ( !getDvarInt( "bots_main_kickBotsAtEnd" ) )
|
||||
return;
|
||||
|
||||
removeAllTestClients();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -183,6 +226,14 @@ onPlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHi
|
||||
self maps\mp\bots\_bot_script::onKilled( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
|
||||
}
|
||||
|
||||
self.lastAttacker = eAttacker;
|
||||
|
||||
if ( isDefined( eAttacker ) )
|
||||
{
|
||||
eAttacker.lastKilledPlayer = self;
|
||||
eAttacker notify( "killed_enemy" );
|
||||
}
|
||||
|
||||
self [[level.prevCallbackPlayerKilled]]( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration );
|
||||
}
|
||||
|
||||
@ -240,6 +291,7 @@ fixGamemodes()
|
||||
{
|
||||
for ( i = 0; i < level.bombZones.size; i++ )
|
||||
level.bombZones[i].onUse = ::onUsePlantObjectFix;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -332,6 +384,26 @@ connected()
|
||||
self thread onDisconnect();
|
||||
|
||||
level notify( "bot_connected", self );
|
||||
|
||||
self thread watchBotDebugEvent();
|
||||
}
|
||||
|
||||
/*
|
||||
DEBUG
|
||||
*/
|
||||
watchBotDebugEvent()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "bot_event", msg, str, b, c, d, e, f, g );
|
||||
|
||||
if ( msg == "debug" && GetDvarInt( "bots_main_debug" ) )
|
||||
{
|
||||
printToConsole( "Bot Warfare debug: " + self.name + ": " + str );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -370,12 +442,8 @@ add_bot()
|
||||
/*
|
||||
A server thread for monitoring all bot's difficulty levels for custom server settings.
|
||||
*/
|
||||
diffBots()
|
||||
diffBots_loop()
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
wait 1.5;
|
||||
|
||||
var_allies_hard = getDVarInt( "bots_skill_allies_hard" );
|
||||
var_allies_med = getDVarInt( "bots_skill_allies_med" );
|
||||
var_axis_hard = getDVarInt( "bots_skill_axis_hard" );
|
||||
@ -390,6 +458,7 @@ diffBots()
|
||||
if ( var_skill == 8 )
|
||||
{
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -435,6 +504,7 @@ diffBots()
|
||||
else if ( var_skill != 0 && var_skill != 9 )
|
||||
{
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -445,17 +515,40 @@ diffBots()
|
||||
player.pers["bots"]["skill"]["base"] = var_skill;
|
||||
}
|
||||
}
|
||||
|
||||
playercount = level.players.size;
|
||||
min_diff = GetDvarInt( "bots_skill_min" );
|
||||
max_diff = GetDvarInt( "bots_skill_max" );
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
|
||||
if ( !player is_bot() )
|
||||
continue;
|
||||
|
||||
player.pers["bots"]["skill"]["base"] = int( clamp( player.pers["bots"]["skill"]["base"], min_diff, max_diff ) );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
A server thread for monitoring all bot's difficulty levels for custom server settings.
|
||||
*/
|
||||
diffBots()
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
wait 1.5;
|
||||
|
||||
diffBots_loop();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
A server thread for monitoring all bot's teams for custom server settings.
|
||||
*/
|
||||
teamBots()
|
||||
teamBots_loop()
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
wait 1.5;
|
||||
teamAmount = getDvarInt( "bots_team_amount" );
|
||||
toTeam = getDvar( "bots_team" );
|
||||
|
||||
@ -465,6 +558,7 @@ teamBots()
|
||||
axisplayers = 0;
|
||||
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -506,6 +600,7 @@ teamBots()
|
||||
if ( abs( axis - allies ) > 1 )
|
||||
{
|
||||
toTeam = "axis";
|
||||
|
||||
if ( axis > allies )
|
||||
toTeam = "allies";
|
||||
}
|
||||
@ -514,6 +609,7 @@ teamBots()
|
||||
if ( toTeam != "autoassign" )
|
||||
{
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -533,6 +629,7 @@ teamBots()
|
||||
player thread [[level.axis]]();
|
||||
else
|
||||
player thread [[level.spectator]]();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -541,6 +638,7 @@ teamBots()
|
||||
else
|
||||
{
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -575,21 +673,25 @@ teamBots()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
A server thread for monitoring all bot's teams for custom server settings.
|
||||
*/
|
||||
teamBots()
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
wait 1.5;
|
||||
|
||||
teamBots_loop();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
A server thread for monitoring all bot's in game. Will add and kick bots according to server settings.
|
||||
*/
|
||||
addBots()
|
||||
addBots_loop()
|
||||
{
|
||||
level endon("game_ended");
|
||||
|
||||
bot_wait_for_host();
|
||||
|
||||
for(;;)
|
||||
{
|
||||
wait 1.5;
|
||||
|
||||
botsToAdd = GetDvarInt( "bots_manage_add" );
|
||||
|
||||
if ( botsToAdd > 0 )
|
||||
@ -618,6 +720,7 @@ addBots()
|
||||
spec = 0;
|
||||
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -644,6 +747,7 @@ addBots()
|
||||
alliesplayers = 0;
|
||||
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -676,8 +780,10 @@ addBots()
|
||||
}
|
||||
|
||||
amount = bots;
|
||||
|
||||
if ( fillMode == 0 || fillMode == 2 )
|
||||
amount += players;
|
||||
|
||||
if ( getDVarInt( "bots_manage_fill_spec" ) )
|
||||
amount += spec;
|
||||
|
||||
@ -688,6 +794,22 @@ addBots()
|
||||
RemoveTestClient(); //cod4x
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
A server thread for monitoring all bot's in game. Will add and kick bots according to server settings.
|
||||
*/
|
||||
addBots()
|
||||
{
|
||||
level endon( "game_ended" );
|
||||
|
||||
bot_wait_for_host();
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait 1.5;
|
||||
|
||||
addBots_loop();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -696,10 +818,16 @@ addBots()
|
||||
onGrenadeFire()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill ( "grenade_fire", grenade, weaponName );
|
||||
|
||||
if ( !isDefined( grenade ) )
|
||||
continue;
|
||||
|
||||
grenade.name = weaponName;
|
||||
|
||||
if ( weaponName == "smoke_grenade_mp" )
|
||||
grenade thread AddToSmokeList();
|
||||
}
|
||||
@ -731,6 +859,7 @@ thinkSmoke()
|
||||
self.state = "moving";
|
||||
wait 0.05;
|
||||
}
|
||||
|
||||
self.state = "smoking";
|
||||
wait 11.5;
|
||||
|
||||
@ -752,6 +881,7 @@ chopperWatch()
|
||||
if ( level.teamBased && getDvarInt( "doubleHeli" ) )
|
||||
{
|
||||
chopper = level.chopper["allies"];
|
||||
|
||||
if ( !isDefined( chopper ) )
|
||||
chopper = level.chopper["axis"];
|
||||
}
|
||||
@ -826,6 +956,7 @@ doUAVUpdate(team)
|
||||
wait level.radarViewTime;
|
||||
|
||||
playercount = level.players.size;
|
||||
|
||||
for ( i = 0; i < playercount; i++ )
|
||||
{
|
||||
player = level.players[i];
|
||||
@ -858,6 +989,7 @@ onWeaponFired()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self.bots_firing = false;
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "weapon_fired" );
|
||||
|
@ -103,6 +103,7 @@ getLinesFromUrl(url, filename)
|
||||
fd = FS_FOpen( filename, "write" );
|
||||
|
||||
line = "";
|
||||
|
||||
for ( i = 0; i < data.size; i++ )
|
||||
{
|
||||
c = data[i];
|
||||
@ -126,6 +127,7 @@ getLinesFromUrl(url, filename)
|
||||
|
||||
line += c;
|
||||
}
|
||||
|
||||
result.lines[result.lines.size] = line;
|
||||
|
||||
if ( fd > 0 )
|
||||
|
@ -129,11 +129,13 @@ watchPlayerOpenMenu()
|
||||
else
|
||||
{
|
||||
self playLocalSound( "mouse_click" );
|
||||
|
||||
if ( self.SubMenu != "Main" )
|
||||
self ExitSub();
|
||||
else
|
||||
{
|
||||
self ExitMenu();
|
||||
|
||||
if ( level.inPrematchPeriod || level.gameEnded )
|
||||
self freezeControls( true );
|
||||
else
|
||||
@ -159,6 +161,7 @@ MenuSelect()
|
||||
if ( self.MenuOpen )
|
||||
{
|
||||
self playLocalSound( "mouse_click" );
|
||||
|
||||
if ( self.SubMenu == "Main" )
|
||||
self thread [[self.Option["Function"][self.SubMenu][self.Curs["Main"]["X"]]]]( self.Option["Arg1"][self.SubMenu][self.Curs["Main"]["X"]], self.Option["Arg2"][self.SubMenu][self.Curs["Main"]["X"]] );
|
||||
else
|
||||
@ -283,6 +286,7 @@ OpenSub(menu, menu2)
|
||||
self.MenuText[i] = self createfontstring( "default", 1.6 );
|
||||
self.MenuText[i] setpoint( "CENTER", "CENTER", -300 + ( i * 100 ), -226 );
|
||||
self.MenuText[i] settext( self.Option["Name"][self.SubMenu][i] );
|
||||
|
||||
if ( logOldi )
|
||||
self.oldi = i;
|
||||
|
||||
@ -292,6 +296,7 @@ OpenSub(menu, menu2)
|
||||
x = i - self.oldi;
|
||||
self.MenuText[i] setpoint( "CENTER", "CENTER", ( ( ( -300 ) - ( i * 100 ) ) + ( i * 100 ) ) + ( x * 100 ), -196 );
|
||||
}
|
||||
|
||||
self.MenuText[i].alpha = 1;
|
||||
self.MenuText[i].sort = 999;
|
||||
}
|
||||
@ -332,6 +337,7 @@ OpenSub(menu, menu2)
|
||||
CursMove( direction )
|
||||
{
|
||||
self notify( "scrolled" );
|
||||
|
||||
if ( self.SubMenu == "Main" )
|
||||
{
|
||||
self.Menu["X"]["Scroller"].x = self.MenuText[self.Curs["Main"]["X"]].x;
|
||||
@ -409,8 +415,10 @@ ShowOptionOn(variable)
|
||||
self.MenuText[self.Curs[self.SubMenu][variable]].fontscale = 2.0;
|
||||
//self.MenuText[self.Curs[self.SubMenu][variable]].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
|
||||
color = ( 6 / 255, 69 / 255, 173 + randomIntRange( -5, 5 ) / 255 );
|
||||
|
||||
if ( int( time * 4 ) % 2 )
|
||||
color = ( 11 / 255, 0 / 255, 128 + randomIntRange( -10, 10 ) / 255 );
|
||||
|
||||
self.MenuText[self.Curs[self.SubMenu][variable]].color = color;
|
||||
}
|
||||
|
||||
@ -430,8 +438,10 @@ ShowOptionOn(variable)
|
||||
self.MenuTextY[self.Curs[self.SubMenu][variable]].fontscale = 2.0;
|
||||
//self.MenuTextY[self.Curs[self.SubMenu][variable]].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
|
||||
color = ( 6 / 255, 69 / 255, 173 + randomIntRange( -5, 5 ) / 255 );
|
||||
|
||||
if ( int( time * 4 ) % 2 )
|
||||
color = ( 11 / 255, 0 / 255, 128 + randomIntRange( -10, 10 ) / 255 );
|
||||
|
||||
self.MenuTextY[self.Curs[self.SubMenu][variable]].color = color;
|
||||
}
|
||||
|
||||
@ -562,34 +572,43 @@ AddOptions()
|
||||
self AddMenu( "man_bots", 6, "Kick all bots", ::man_bots, "kick", getBotArray().size );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_manage_fill_kick" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "man_bots", 7, "Toggle auto bot kicking: " + _temp, ::man_bots, "autokick", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_manage_fill_mode" );
|
||||
|
||||
switch ( _tempDvar )
|
||||
{
|
||||
case 0:
|
||||
_temp = "everyone";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
_temp = "just bots";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_temp = "everyone, adjust to map";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
_temp = "just bots, adjust to map";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_temp = "bots used as team balance";
|
||||
break;
|
||||
|
||||
default:
|
||||
_temp = "out of range";
|
||||
break;
|
||||
}
|
||||
|
||||
self AddMenu( "man_bots", 8, "Change bot_fill_mode: " + _temp, ::man_bots, "fillmode", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_manage_fill" );
|
||||
@ -597,10 +616,12 @@ AddOptions()
|
||||
self AddMenu( "man_bots", 10, "Decrease bots to keep in-game: " + _tempDvar, ::man_bots, "filldown", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_manage_fill_spec" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "man_bots", 11, "Count players for fill on spectator: " + _temp, ::man_bots, "fillspec", _tempDvar );
|
||||
|
||||
//
|
||||
@ -616,56 +637,72 @@ AddOptions()
|
||||
self AddMenu( "man_team", 2, "Decrease bots to be on axis team: " + _tempDvar, ::bot_teams, "teamdown", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_team_force" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "man_team", 3, "Toggle forcing bots on team: " + _temp, ::bot_teams, "teamforce", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_team_mode" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "only bots";
|
||||
else
|
||||
_temp = "everyone";
|
||||
|
||||
self AddMenu( "man_team", 4, "Toggle bot_team_bot: " + _temp, ::bot_teams, "teammode", _tempDvar );
|
||||
|
||||
_tempDvar = getdvarint( "bots_skill" );
|
||||
|
||||
switch ( _tempDvar )
|
||||
{
|
||||
case 0:
|
||||
_temp = "random for all";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
_temp = "too easy";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
_temp = "easy";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
_temp = "easy-medium";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
_temp = "medium";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
_temp = "hard";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
_temp = "very hard";
|
||||
break;
|
||||
|
||||
case 7:
|
||||
_temp = "hardest";
|
||||
break;
|
||||
|
||||
case 8:
|
||||
_temp = "custom";
|
||||
break;
|
||||
|
||||
case 9:
|
||||
_temp = "complete random";
|
||||
break;
|
||||
|
||||
default:
|
||||
_temp = "out of range";
|
||||
break;
|
||||
}
|
||||
|
||||
self AddMenu( "man_team", 5, "Change bot difficulty: " + _temp, ::bot_teams, "skill", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_skill_axis_hard" );
|
||||
@ -690,87 +727,111 @@ AddOptions()
|
||||
self AddBack( "set1", "Main" );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_loadout_reasonable" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 0, "Bots use only good class setups: " + _temp, ::bot_func, "reasonable", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_loadout_allow_op" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 1, "Bots can use op and annoying class setups: " + _temp, ::bot_func, "op", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_move" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 2, "Bots can move: " + _temp, ::bot_func, "move", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_knife" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 3, "Bots can knife: " + _temp, ::bot_func, "knife", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_fire" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 4, "Bots can fire: " + _temp, ::bot_func, "fire", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_nade" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 5, "Bots can nade: " + _temp, ::bot_func, "nade", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_obj" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 6, "Bots play the objective: " + _temp, ::bot_func, "obj", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_camp" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 7, "Bots can camp: " + _temp, ::bot_func, "camp", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_jumpdrop" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 8, "Bots can jump and dropshot: " + _temp, ::bot_func, "jump", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_target_other" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 9, "Bots can target other script objects: " + _temp, ::bot_func, "targetother", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_killstreak" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 10, "Bots can use killstreaks: " + _temp, ::bot_func, "killstreak", _tempDvar );
|
||||
|
||||
_tempDvar = getDvarInt( "bots_play_ads" );
|
||||
|
||||
if ( _tempDvar )
|
||||
_temp = "true";
|
||||
else
|
||||
_temp = "false";
|
||||
|
||||
self AddMenu( "set1", 11, "Bots can ads: " + _temp, ::bot_func, "ads", _tempDvar );
|
||||
}
|
||||
|
||||
@ -782,46 +843,57 @@ bot_func(a, b)
|
||||
setDvar( "bots_loadout_reasonable", !b );
|
||||
self iPrintln( "Bots using reasonable setups: " + !b );
|
||||
break;
|
||||
|
||||
case "op":
|
||||
setDvar( "bots_loadout_allow_op", !b );
|
||||
self iPrintln( "Bots using op setups: " + !b );
|
||||
break;
|
||||
|
||||
case "move":
|
||||
setDvar( "bots_play_move", !b );
|
||||
self iPrintln( "Bots move: " + !b );
|
||||
break;
|
||||
|
||||
case "knife":
|
||||
setDvar( "bots_play_knife", !b );
|
||||
self iPrintln( "Bots knife: " + !b );
|
||||
break;
|
||||
|
||||
case "fire":
|
||||
setDvar( "bots_play_fire", !b );
|
||||
self iPrintln( "Bots fire: " + !b );
|
||||
break;
|
||||
|
||||
case "nade":
|
||||
setDvar( "bots_play_nade", !b );
|
||||
self iPrintln( "Bots nade: " + !b );
|
||||
break;
|
||||
|
||||
case "obj":
|
||||
setDvar( "bots_play_obj", !b );
|
||||
self iPrintln( "Bots play the obj: " + !b );
|
||||
break;
|
||||
|
||||
case "camp":
|
||||
setDvar( "bots_play_camp", !b );
|
||||
self iPrintln( "Bots camp: " + !b );
|
||||
break;
|
||||
|
||||
case "jump":
|
||||
setDvar( "bots_play_jumpdrop", !b );
|
||||
self iPrintln( "Bots jump: " + !b );
|
||||
break;
|
||||
|
||||
case "targetother":
|
||||
setDvar( "bots_play_target_other", !b );
|
||||
self iPrintln( "Bots target other: " + !b );
|
||||
break;
|
||||
|
||||
case "killstreak":
|
||||
setDvar( "bots_play_killstreak", !b );
|
||||
self iPrintln( "Bots use killstreaks: " + !b );
|
||||
break;
|
||||
|
||||
case "ads":
|
||||
setDvar( "bots_play_ads", !b );
|
||||
self iPrintln( "Bots ads: " + !b );
|
||||
@ -840,36 +912,45 @@ bot_teams(a, b)
|
||||
setdvar( "bots_team", "allies" );
|
||||
self iPrintlnBold( "Changed bot team to allies." );
|
||||
break;
|
||||
|
||||
case "allies":
|
||||
setdvar( "bots_team", "axis" );
|
||||
self iPrintlnBold( "Changed bot team to axis." );
|
||||
break;
|
||||
|
||||
case "axis":
|
||||
setdvar( "bots_team", "custom" );
|
||||
self iPrintlnBold( "Changed bot team to custom." );
|
||||
break;
|
||||
|
||||
default:
|
||||
setdvar( "bots_team", "autoassign" );
|
||||
self iPrintlnBold( "Changed bot team to autoassign." );
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "teamup":
|
||||
setdvar( "bots_team_amount", b + 1 );
|
||||
self iPrintln( ( b + 1 ) + " bot(s) will try to be on axis team." );
|
||||
break;
|
||||
|
||||
case "teamdown":
|
||||
setdvar( "bots_team_amount", b - 1 );
|
||||
self iPrintln( ( b - 1 ) + " bot(s) will try to be on axis team." );
|
||||
break;
|
||||
|
||||
case "teamforce":
|
||||
setDvar( "bots_team_force", !b );
|
||||
self iPrintln( "Forcing bots to team: " + !b );
|
||||
break;
|
||||
|
||||
case "teammode":
|
||||
setDvar( "bots_team_mode", !b );
|
||||
self iPrintln( "Only count bots on team: " + !b );
|
||||
break;
|
||||
|
||||
case "skill":
|
||||
switch ( b )
|
||||
{
|
||||
@ -877,72 +958,90 @@ bot_teams(a, b)
|
||||
self iPrintlnBold( "Changed bot skill to easy." );
|
||||
setDvar( "bots_skill", 1 );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
self iPrintlnBold( "Changed bot skill to easy-med." );
|
||||
setDvar( "bots_skill", 2 );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
self iPrintlnBold( "Changed bot skill to medium." );
|
||||
setDvar( "bots_skill", 3 );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
self iPrintlnBold( "Changed bot skill to med-hard." );
|
||||
setDvar( "bots_skill", 4 );
|
||||
break;
|
||||
|
||||
case 4:
|
||||
self iPrintlnBold( "Changed bot skill to hard." );
|
||||
setDvar( "bots_skill", 5 );
|
||||
break;
|
||||
|
||||
case 5:
|
||||
self iPrintlnBold( "Changed bot skill to very hard." );
|
||||
setDvar( "bots_skill", 6 );
|
||||
break;
|
||||
|
||||
case 6:
|
||||
self iPrintlnBold( "Changed bot skill to hardest." );
|
||||
setDvar( "bots_skill", 7 );
|
||||
break;
|
||||
|
||||
case 7:
|
||||
self iPrintlnBold( "Changed bot skill to custom. Base is easy." );
|
||||
setDvar( "bots_skill", 8 );
|
||||
break;
|
||||
|
||||
case 8:
|
||||
self iPrintlnBold( "Changed bot skill to complete random. Takes effect at restart." );
|
||||
setDvar( "bots_skill", 9 );
|
||||
break;
|
||||
|
||||
default:
|
||||
self iPrintlnBold( "Changed bot skill to random. Takes effect at restart." );
|
||||
setDvar( "bots_skill", 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "axishardup":
|
||||
setdvar( "bots_skill_axis_hard", ( b + 1 ) );
|
||||
self iPrintln( ( ( b + 1 ) ) + " hard bots will be on axis team." );
|
||||
break;
|
||||
|
||||
case "axisharddown":
|
||||
setdvar( "bots_skill_axis_hard", ( b - 1 ) );
|
||||
self iPrintln( ( ( b - 1 ) ) + " hard bots will be on axis team." );
|
||||
break;
|
||||
|
||||
case "axismedup":
|
||||
setdvar( "bots_skill_axis_med", ( b + 1 ) );
|
||||
self iPrintln( ( ( b + 1 ) ) + " med bots will be on axis team." );
|
||||
break;
|
||||
|
||||
case "axismeddown":
|
||||
setdvar( "bots_skill_axis_med", ( b - 1 ) );
|
||||
self iPrintln( ( ( b - 1 ) ) + " med bots will be on axis team." );
|
||||
break;
|
||||
|
||||
case "allieshardup":
|
||||
setdvar( "bots_skill_allies_hard", ( b + 1 ) );
|
||||
self iPrintln( ( ( b + 1 ) ) + " hard bots will be on allies team." );
|
||||
break;
|
||||
|
||||
case "alliesharddown":
|
||||
setdvar( "bots_skill_allies_hard", ( b - 1 ) );
|
||||
self iPrintln( ( ( b - 1 ) ) + " hard bots will be on allies team." );
|
||||
break;
|
||||
|
||||
case "alliesmedup":
|
||||
setdvar( "bots_skill_allies_med", ( b + 1 ) );
|
||||
self iPrintln( ( ( b + 1 ) ) + " med bots will be on allies team." );
|
||||
break;
|
||||
|
||||
case "alliesmeddown":
|
||||
setdvar( "bots_skill_allies_med", ( b - 1 ) );
|
||||
self iPrintln( ( ( b - 1 ) ) + " med bots will be on allies team." );
|
||||
@ -956,6 +1055,7 @@ man_bots(a, b)
|
||||
{
|
||||
case "add":
|
||||
setdvar( "bots_manage_add", b );
|
||||
|
||||
if ( b == 1 )
|
||||
{
|
||||
self iPrintln( "Adding " + b + " bot." );
|
||||
@ -964,7 +1064,9 @@ man_bots(a, b)
|
||||
{
|
||||
self iPrintln( "Adding " + b + " bots." );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "kick":
|
||||
for ( i = 0; i < b; i++ )
|
||||
{
|
||||
@ -972,11 +1074,14 @@ man_bots(a, b)
|
||||
|
||||
wait 0.25;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "autokick":
|
||||
setDvar( "bots_manage_fill_kick", !b );
|
||||
self iPrintln( "Kicking bots when bots_fill is exceeded: " + !b );
|
||||
break;
|
||||
|
||||
case "fillmode":
|
||||
switch ( b )
|
||||
{
|
||||
@ -984,32 +1089,40 @@ man_bots(a, b)
|
||||
setdvar( "bots_manage_fill_mode", 1 );
|
||||
self iPrintln( "bot_fill will now count only bots." );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
setdvar( "bots_manage_fill_mode", 2 );
|
||||
self iPrintln( "bot_fill will now count everyone, adjusting to map." );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
setdvar( "bots_manage_fill_mode", 3 );
|
||||
self iPrintln( "bot_fill will now count only bots, adjusting to map." );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
setdvar( "bots_manage_fill_mode", 4 );
|
||||
self iPrintln( "bot_fill will now use bots as team balance." );
|
||||
break;
|
||||
|
||||
default:
|
||||
setdvar( "bots_manage_fill_mode", 0 );
|
||||
self iPrintln( "bot_fill will now count everyone." );
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "fillup":
|
||||
setdvar( "bots_manage_fill", b + 1 );
|
||||
self iPrintln( "Increased to maintain " + ( b + 1 ) + " bot(s)." );
|
||||
break;
|
||||
|
||||
case "filldown":
|
||||
setdvar( "bots_manage_fill", b - 1 );
|
||||
self iPrintln( "Decreased to maintain " + ( b - 1 ) + " bot(s)." );
|
||||
break;
|
||||
|
||||
case "fillspec":
|
||||
setDvar( "bots_manage_fill_spec", !b );
|
||||
self iPrintln( "Count players on spectator for bots_fill: " + !b );
|
||||
|
@ -75,6 +75,7 @@ init()
|
||||
onPlayerSpawned()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "spawned_player" );
|
||||
@ -145,7 +146,7 @@ debug()
|
||||
|
||||
if ( distance( level.waypoints[i].origin, self.origin ) < getDvarFloat( "bots_main_debug_distance" ) && ( bulletTracePassed( myEye, wpOrg, false, self ) || getDVarint( "bots_main_debug_drawThrough" ) ) )
|
||||
{
|
||||
for(h = 0; h < level.waypoints[i].childCount; h++)
|
||||
for ( h = level.waypoints[i].children.size - 1; h >= 0; h-- )
|
||||
line( wpOrg, level.waypoints[level.waypoints[i].children[h]].origin + ( 0, 0, 25 ), ( 1, 0, 1 ), 1, 1, getDvarInt( "bots_main_debug_lineDuration" ) );
|
||||
|
||||
if ( getConeDot( wpOrg, myEye, myAngles ) > getDvarFloat( "bots_main_debug_cone" ) )
|
||||
@ -161,13 +162,15 @@ debug()
|
||||
if ( closest != -1 )
|
||||
{
|
||||
stringChildren = "";
|
||||
for(i = 0; i < level.waypoints[closest].childCount; i++)
|
||||
|
||||
for ( i = 0; i < level.waypoints[closest].children.size; i++ )
|
||||
{
|
||||
if ( i != 0 )
|
||||
stringChildren = stringChildren + "," + level.waypoints[closest].children[i];
|
||||
else
|
||||
stringChildren = stringChildren + level.waypoints[closest].children[i];
|
||||
}
|
||||
|
||||
print3d( level.waypoints[closest].origin + ( 0, 0, 35 ), stringChildren, ( 0, 1, 0 ), 2, 1, getDvarInt( "bots_main_debug_printDuration" ) );
|
||||
|
||||
print3d( level.waypoints[closest].origin + ( 0, 0, 15 ), level.waypoints[closest].type, ( 0, 1, 0 ), 2, 1, getDvarInt( "bots_main_debug_printDuration" ) );
|
||||
@ -179,6 +182,7 @@ AddWaypoints()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "death" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
while ( !self SecondaryOffhandButtonPressed() || isDefined( self.command ) )
|
||||
@ -207,6 +211,7 @@ linkWaypoints()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "death" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
while ( !self MeleeButtonPressed() || isDefined( self.command ) )
|
||||
@ -234,6 +239,7 @@ deleteWaypoints()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "death" );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
while ( !self fragButtonPressed() || isDefined( self.command ) )
|
||||
@ -286,19 +292,22 @@ watchSaveWaypointsCommand()
|
||||
mpnm = getMapName( getdvar( "mapname" ) );
|
||||
logprint( "\n\n" + mpnm + "()\n{\n/*" );
|
||||
logprint( "*/waypoints = [];\n/*" );
|
||||
|
||||
for ( i = 0; i < level.waypointCount; i++ )
|
||||
{
|
||||
logprint( "*/waypoints[" + i + "] = spawnstruct();\n/*" );
|
||||
logprint( "*/waypoints[" + i + "].origin = " + level.waypoints[i].origin + ";\n/*" );
|
||||
logprint( "*/waypoints[" + i + "].type = \"" + level.waypoints[i].type + "\";\n/*" );
|
||||
logprint("*/waypoints["+i+"].childCount = "+level.waypoints[i].childCount+";\n/*");
|
||||
for(c = 0; c < level.waypoints[i].childCount; c++)
|
||||
|
||||
for ( c = 0; c < level.waypoints[i].children.size; c++ )
|
||||
{
|
||||
logprint( "*/waypoints[" + i + "].children[" + c + "] = " + level.waypoints[i].children[c] + ";\n/*" );
|
||||
}
|
||||
if(isDefined(level.waypoints[i].angles) && (level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || (level.waypoints[i].type == "crouch" && level.waypoints[i].childCount == 1) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade"))
|
||||
|
||||
if ( isDefined( level.waypoints[i].angles ) && ( level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || ( level.waypoints[i].type == "crouch" && level.waypoints[i].children.size == 1 ) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade" ) )
|
||||
logprint( "*/waypoints[" + i + "].angles = " + level.waypoints[i].angles + ";\n/*" );
|
||||
}
|
||||
|
||||
logprint( "*/return waypoints;\n}\n\n\n\n" );
|
||||
|
||||
filename = "waypoints/" + getdvar( "mapname" ) + "_wp.csv";
|
||||
@ -315,6 +324,7 @@ watchSaveWaypointsCommand()
|
||||
fd = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for ( i = 0; i < level.waypointCount; i++ )
|
||||
{
|
||||
str = "";
|
||||
@ -322,13 +332,14 @@ watchSaveWaypointsCommand()
|
||||
|
||||
str += wp.origin[0] + " " + wp.origin[1] + " " + wp.origin[2] + ",";
|
||||
|
||||
for(h = 0; h < wp.childCount; h++)
|
||||
for ( h = 0; h < wp.children.size; h++ )
|
||||
{
|
||||
str += wp.children[h];
|
||||
|
||||
if (h < wp.childCount - 1)
|
||||
if ( h < wp.children.size - 1 )
|
||||
str += " ";
|
||||
}
|
||||
|
||||
str += "," + wp.type + ",";
|
||||
|
||||
if ( isDefined( wp.angles ) )
|
||||
@ -349,6 +360,7 @@ watchSaveWaypointsCommand()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PrintLn( "\n\n\n\n\n\n" );
|
||||
|
||||
self iprintln( "Saved!!! to " + filename );
|
||||
@ -406,8 +418,8 @@ checkForWarnings()
|
||||
continue;
|
||||
}
|
||||
|
||||
if(level.waypoints[i].childCount <= 0)
|
||||
self iprintln("WARNING: waypoint "+i+" childCount is "+level.waypoints[i].childCount);
|
||||
if ( level.waypoints[i].children.size <= 0 )
|
||||
self iprintln( "WARNING: waypoint " + i + " childCount is " + level.waypoints[i].children.size );
|
||||
else
|
||||
{
|
||||
if ( !isDefined( level.waypoints[i].children ) || !isDefined( level.waypoints[i].children.size ) )
|
||||
@ -416,10 +428,7 @@ checkForWarnings()
|
||||
}
|
||||
else
|
||||
{
|
||||
if(level.waypoints[i].childCount != level.waypoints[i].children.size)
|
||||
self iprintln("WARNING: waypoint "+i+" childCount is not "+level.waypoints[i].children.size);
|
||||
|
||||
for (h = 0; h < level.waypoints[i].childCount; h++)
|
||||
for ( h = level.waypoints[i].children.size - 1; h >= 0; h-- )
|
||||
{
|
||||
child = level.waypoints[i].children[h];
|
||||
|
||||
@ -437,7 +446,7 @@ checkForWarnings()
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!isDefined(level.waypoints[i].angles) && (level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || (level.waypoints[i].type == "crouch" && level.waypoints[i].childCount == 1) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade"))
|
||||
if ( !isDefined( level.waypoints[i].angles ) && ( level.waypoints[i].type == "claymore" || level.waypoints[i].type == "tube" || ( level.waypoints[i].type == "crouch" && level.waypoints[i].children.size == 1 ) || level.waypoints[i].type == "climb" || level.waypoints[i].type == "grenade" ) )
|
||||
self iprintln( "WARNING: waypoint " + i + " angles is undefined" );
|
||||
}
|
||||
}
|
||||
@ -446,12 +455,6 @@ DeleteAllWaypoints()
|
||||
{
|
||||
level.waypoints = [];
|
||||
level.waypointCount = 0;
|
||||
level.waypointsKDTree = WaypointsToKDTree();
|
||||
|
||||
level.waypointsCamp = [];
|
||||
level.waypointsTube = [];
|
||||
level.waypointsGren = [];
|
||||
level.waypointsClay = [];
|
||||
|
||||
self iprintln( "DelAllWps" );
|
||||
}
|
||||
@ -466,18 +469,16 @@ DeleteWaypoint(nwp)
|
||||
|
||||
level.wpToLink = -1;
|
||||
|
||||
for(i = 0; i < level.waypoints[nwp].childCount; i++)
|
||||
for ( i = level.waypoints[nwp].children.size - 1; i >= 0; i-- )
|
||||
{
|
||||
child = level.waypoints[nwp].children[i];
|
||||
|
||||
level.waypoints[child].children = array_remove( level.waypoints[child].children, nwp );
|
||||
|
||||
level.waypoints[child].childCount = level.waypoints[child].children.size;
|
||||
}
|
||||
|
||||
for ( i = 0; i < level.waypointCount; i++ )
|
||||
{
|
||||
for(h = 0; h < level.waypoints[i].childCount; h++)
|
||||
for ( h = level.waypoints[i].children.size - 1; h >= 0; h-- )
|
||||
{
|
||||
if ( level.waypoints[i].children[h] > nwp )
|
||||
level.waypoints[i].children[h]--;
|
||||
@ -493,10 +494,12 @@ DeleteWaypoint(nwp)
|
||||
level.waypoints[entry] = level.waypoints[entry + 1];
|
||||
entry++;
|
||||
}
|
||||
|
||||
level.waypoints[entry] = undefined;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
level.waypointCount--;
|
||||
|
||||
self iprintln( "DelWp " + nwp );
|
||||
@ -522,7 +525,6 @@ addWaypoint(pos)
|
||||
level.waypoints[level.waypointCount].angles = self getPlayerAngles();
|
||||
|
||||
level.waypoints[level.waypointCount].children = [];
|
||||
level.waypoints[level.waypointCount].childCount = 0;
|
||||
|
||||
self iprintln( level.waypoints[level.waypointCount].type + " Waypoint " + level.waypointCount + " Added at " + pos );
|
||||
|
||||
@ -559,9 +561,6 @@ UnLinkWaypoint(nwp)
|
||||
level.waypoints[nwp].children = array_remove( level.waypoints[nwp].children, level.wpToLink );
|
||||
level.waypoints[level.wpToLink].children = array_remove( level.waypoints[level.wpToLink].children, nwp );
|
||||
|
||||
level.waypoints[nwp].childCount = level.waypoints[nwp].children.size;
|
||||
level.waypoints[level.wpToLink].childCount = level.waypoints[level.wpToLink].children.size;
|
||||
|
||||
self iprintln( "Waypoint " + nwp + " Broken to " + level.wpToLink );
|
||||
level.wpToLink = -1;
|
||||
}
|
||||
@ -583,7 +582,8 @@ LinkWaypoint(nwp)
|
||||
}
|
||||
|
||||
weGood = true;
|
||||
for(i = 0; i < level.waypoints[level.wpToLink].childCount; i++)
|
||||
|
||||
for ( i = level.waypoints[level.wpToLink].children.size - 1; i >= 0; i-- )
|
||||
{
|
||||
if ( level.waypoints[level.wpToLink].children[i] == nwp )
|
||||
{
|
||||
@ -591,9 +591,10 @@ LinkWaypoint(nwp)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( weGood )
|
||||
{
|
||||
for(i = 0; i < level.waypoints[nwp].childCount; i++)
|
||||
for ( i = level.waypoints[nwp].children.size - 1; i >= 0; i-- )
|
||||
{
|
||||
if ( level.waypoints[nwp].children[i] == level.wpToLink )
|
||||
{
|
||||
@ -610,10 +611,8 @@ LinkWaypoint(nwp)
|
||||
return;
|
||||
}
|
||||
|
||||
level.waypoints[level.wpToLink].children[level.waypoints[level.wpToLink].childcount] = nwp;
|
||||
level.waypoints[level.wpToLink].childcount++;
|
||||
level.waypoints[nwp].children[level.waypoints[nwp].childcount] = level.wpToLink;
|
||||
level.waypoints[nwp].childcount++;
|
||||
level.waypoints[level.wpToLink].children[level.waypoints[level.wpToLink].children.size] = nwp;
|
||||
level.waypoints[nwp].children[level.waypoints[nwp].children.size] = level.wpToLink;
|
||||
|
||||
self iprintln( "Waypoint " + nwp + " Linked to " + level.wpToLink );
|
||||
level.wpToLink = -1;
|
||||
|
@ -1 +1 @@
|
||||
start "" "%~dp0cod4x18_dedrun.exe" +set dedicated "1" +set sv_maxclients "64" +set sv_punkbuster "0" +set net_port "28965" +set fs_game "mods/bots" +exec localbotserver.cfg +loadplugin httpget +map_rotate
|
||||
start "" "%~dp0cod4x18_dedrun.exe" +set dedicated "1" +set sv_maxclients "64" +set net_port "28965" +set fs_game "mods/bots" +exec localbotserver.cfg +map_rotate
|
||||
|
@ -1,4 +1,4 @@
|
||||
# CoD4x Bot Warfare
|
||||
# CoD4x Bot Warfare v2.1.0
|
||||
Bot Warfare is a GSC mod for the CoD4x project.
|
||||
|
||||
It aims to add playable AI to the multiplayer games of CoD4.
|
||||
@ -12,7 +12,7 @@ Make sure to disable this DVAR by adding 'set bots_main_firstIsHost 0' in your s
|
||||
|
||||
## Installation
|
||||
0. Make sure that CoD4x server + client is installed, updated and working properly.
|
||||
- Go to https://cod4x.me/ and download the Windows Server zip file. Move the contents of 'cod4x-windows-server' into your CoD4 game folder.
|
||||
- Go to https://cod4x.ovh/ and download the Windows Server zip file. Move the contents of 'cod4x-windows-server' into your CoD4 game folder.
|
||||
1. Locate your CoD4x server install folder.
|
||||
2. Move the files/folders found in 'Add to root of CoD4x server' from the Bot Warfare release archive you downloaded to the root of your CoD4x server folder.
|
||||
- The folder/file structure should follow as '.CoD4x server folder\main_shared\maps\mp\bots\_bot.gsc'.
|
||||
@ -30,6 +30,17 @@ Make sure to disable this DVAR by adding 'set bots_main_firstIsHost 0' in your s
|
||||
- Pressing the menu button again closes menus.
|
||||
|
||||
## Changelog
|
||||
- v2.1.0
|
||||
- Bot chatter system, bots_main_chat
|
||||
- Greatly reduce script variable usage
|
||||
- Improved bots mantling and stuck
|
||||
- Fix some runtime errors
|
||||
- Bots sprint more
|
||||
- Improved bots sight on enemies
|
||||
- Bots do random actions while waiting at an objective
|
||||
- Improved bots from getting stuck
|
||||
- Better bot difficulty management, bots_skill_min and bots_skill_max
|
||||
|
||||
- v2.0.1
|
||||
- Reduced bots crouching
|
||||
- Increased bots sprinting
|
||||
|
BIN
out/ss.jpg
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
out/ss.png
Before Width: | Height: | Size: 3.6 MiB |
@ -1 +0,0 @@
|
||||
start "" "%~dp0iw3mp.exe" +set r_fullscreen "1" +set cg_drawlagometer "0" +set cg_drawfps "0" +set cg_drawsnapshot "0" +set r_mode "1920x1080" +set r_monitor "0"
|
1
z_deploy.bat
Normal file
@ -0,0 +1 @@
|
||||
start "" "node" deploy.js
|
@ -1 +0,0 @@
|
||||
start "" "%~dp0iw3mp.exe" +set r_fullscreen "0" +set cg_drawlagometer "1" +set developer "1" +set developer_script "1" +set logfile "2" +set cg_drawfps "3" +set cg_drawsnapshot "1" +set scr_game_spectatetype "2" +set r_mode "1024x768" +set thereisacow "1" +set sv_cheats "1" +set fs_game "mods/dev" +devmap mp_shipment
|
@ -1 +0,0 @@
|
||||
start "" "%~dp0iw3mp.exe" +set r_fullscreen "0" +set cg_drawlagometer "1" +set developer "1" +set developer_script "1" +set logfile "2" +set cg_drawfps "3" +set cg_drawsnapshot "1" +set scr_game_spectatetype "2" +set r_mode "1024x768" +set thereisacow "1" +set fs_game "mods/dev" +set sv_cheats "1" +connect 127.0.0.1
|
31
z_server.bat
@ -1 +1,30 @@
|
||||
start "" "%~dp0cod4x18_dedrun.exe" +set dedicated "2" +set sv_maxclients "64" +set sv_punkbuster "0" +set net_port "28960" +set fs_game "mods/bots" +exec server.cfg +loadplugin httpget +map_rotate
|
||||
@echo off
|
||||
::Paste the server key from https://platform.plutonium.pw/serverkeys here
|
||||
set key=
|
||||
::RemoteCONtrol password, needed for most management tools like IW4MADMIN and B3. Do not skip if you installing IW4MADMIN.
|
||||
set rcon_password=
|
||||
::Name of the config file the server should use.
|
||||
set cfg=server.cfg
|
||||
::Name of the server shown in the title of the cmd window. This will NOT bet shown ingame.
|
||||
set name=CoD4x Bot Warfare
|
||||
::Port used by the server (default: 28960)
|
||||
set port=28969
|
||||
::What ip to bind too
|
||||
set ip=0.0.0.0
|
||||
::Mod name (default "")
|
||||
set mod=
|
||||
::Only change this when you don't want to keep the bat files in the game folder. MOST WON'T NEED TO EDIT THIS!
|
||||
set gamepath=%cd%
|
||||
::Max clients in your server
|
||||
set maxclients=64
|
||||
|
||||
title CoD4x MP - %name% - Server restarter
|
||||
echo Visit plutonium.pw / Join the Discord (a6JM2Tv) for NEWS and Updates!
|
||||
echo Server "%name%" will load "%cfg%" and listen on port "%port%" UDP with IP "%ip%"!
|
||||
echo To shut down the server close this window first!
|
||||
echo (%date%) - (%time%) %name% server start.
|
||||
|
||||
:server
|
||||
start /wait /abovenormal "%name%" "%~dp0cod4x18_dedrun.exe" +set dedicated "2" +set sv_authtoken "%key%" +set net_ip "%ip%" +set net_port "%port%" +set rcon_password "%rcon_password%" +set fs_game "%mod%" +set sv_maxclients "%maxclients%" +exec "%cfg%" +map_rotate
|
||||
echo (%date%) - (%time%) WARNING: %name% server closed or dropped... server restarts.
|
||||
goto Server
|
||||
|
@ -1 +0,0 @@
|
||||
start "" "%~dp0cod4x18_dedrun_dbg.exe" +set dedicated "1" +set developer "1" +set developer_script "1" +set logfile "2" +set scr_game_spectatetype "2" +set thereisacow "1" +set sv_cheats "1" +set sv_maxclients "64" +set fs_game "mods/dev" +set bots_manage_add "12" +set sv_punkbuster "0" +set scr_war_scorelimit "0" +set net_port "28960" +devmap mp_shipment
|