136 Commits

Author SHA1 Message Date
0b50f51ed4 Release 2.1.0 2022-05-05 10:34:52 -06:00
6755cc3b43 adjust some values 2022-05-05 10:01:03 -06:00
c21f2d5a38 fixed bombs 2022-05-02 15:26:41 -06:00
cae7c993f5 check for nuke killstreak 2022-04-28 17:06:36 -06:00
119f9bccf9 All chat stubs 2022-04-26 12:46:58 -06:00
918bb4020a pick up guns 2022-04-25 11:19:10 -06:00
f64ba9cccf Small opti 2022-04-20 12:58:45 -06:00
f3b58c5966 add 2022-04-19 18:01:36 -06:00
a51fa98d02 fix 2022-04-19 18:00:37 -06:00
5392d3152e Air drop changes for chat 2022-04-19 16:41:29 -06:00
c372229b6a less 2022-04-18 18:58:03 -06:00
ae2b16fb47 debug listener 2022-04-18 17:11:51 -06:00
d9c5cbac3e more chatter! 2022-04-18 17:08:17 -06:00
16c813ed53 More chatter 2022-04-18 16:50:00 -06:00
27422d01a5 equ, nade and jav chatter 2022-04-18 16:25:54 -06:00
9984878a25 rename to bot events 2022-04-18 16:12:49 -06:00
05bb24f587 follow chat 2022-04-18 16:10:27 -06:00
6ff815d10e camp chat 2022-04-18 16:06:32 -06:00
7a9e28f03d bot_chat_follow_threat_watch 2022-04-18 16:02:41 -06:00
5f44a7b455 A lot of chat stuff 2022-04-18 15:58:21 -06:00
f58e91b762 Stop move on game end 2022-04-18 15:01:42 -06:00
835b3d597c Fix dev script setPlayerData errors 2022-04-18 15:01:33 -06:00
17e36e08c7 Fix scr errors with missing perk in table 2022-04-18 15:00:49 -06:00
89c2abb5f1 Fix switch on float error 2022-04-18 15:00:37 -06:00
e71722bbe9 a lot 2022-04-17 14:32:30 -06:00
15ec54bfd4 Better approach 2022-04-17 13:35:24 -06:00
b6e06f73f4 Some bot chatter foundations 2022-04-17 13:15:38 -06:00
551e01326d Update 2022-04-17 12:27:30 -06:00
d851ad1ebc Small vip fix, added chat notifications 2022-04-17 12:27:12 -06:00
d740ae15f6 Added bots_skill_min max 2022-04-17 12:26:53 -06:00
8ee6e9888c better stuck 2022-04-08 23:56:38 -06:00
78cba84b75 Read me 2022-04-08 21:11:26 -06:00
5e2c90b1d2 Bots do random action at obj 2022-04-08 21:03:32 -06:00
ebfba23513 Merge pull request #42 from Boxhead78/master
Improve bot camping
2022-04-06 15:05:15 -06:00
569388324b Update wps 2022-04-06 15:03:49 -06:00
cc30a756cb Update wps 2022-04-06 15:03:05 -06:00
0690a9703d Add warnings if waypoint unreachable 2022-04-06 15:03:01 -06:00
a06c33823b Improve bot camping
- They camp longer
- They stop camping if 1 minute game time is remaining
2022-04-05 08:10:23 +02:00
e73c553308 Bots play vip 2022-04-04 19:41:54 -06:00
c42a72f742 fix vip 2022-04-04 19:41:45 -06:00
f234ef2023 common_mp 2022-04-04 13:22:09 -06:00
d8dbd975db remove 2022-04-03 18:23:04 -06:00
7664f491de better 2022-04-03 18:20:14 -06:00
9b8627ba4b Bots crouch with riot 2022-04-03 14:33:16 -06:00
fd5d1272fe fix scr error on ffa 2022-03-31 09:14:54 -06:00
a015aed62a new dvar 2022-03-24 16:19:57 -06:00
395a991b6f github supports gsc 2022-03-23 11:49:38 -06:00
9ac9df8db1 They play arena now 2022-03-20 16:08:43 -06:00
94142d7aa9 Fix the watchdog 2022-01-22 21:51:18 -06:00
a28db1e2fd better 2021-12-21 21:51:11 -06:00
c4bf34d1ff better code complete 2021-12-21 21:45:17 -06:00
26d2d487b8 fix 2021-11-27 00:05:13 -06:00
893dfa5bf0 Revert "fix"
This reverts commit 590d5091fa.
2021-11-27 00:04:46 -06:00
590d5091fa fix 2021-11-26 23:58:03 -06:00
1706cef05e nukes 2021-11-23 12:03:54 -06:00
ea39456fd9 dvars 2021-11-14 15:53:20 -06:00
72d9223f48 oen more 2021-11-11 23:54:56 -06:00
97236e2e5f more script fixes 2021-11-11 23:13:37 -06:00
18c67cb334 one more... 2021-11-10 16:29:42 -06:00
ea14b71f5b one more 2021-11-10 16:10:12 -06:00
9fc6a8b56b fix another 2021-11-10 16:04:34 -06:00
d34c33e74b fix up errors 2021-11-10 15:54:34 -06:00
9fa8506daf Remove test 2021-10-24 02:17:34 -06:00
af35ec3a8f Update to use findstr 2021-10-24 02:17:14 -06:00
7b667f511d oops 2021-10-23 17:54:04 -06:00
79aa5963d5 use games_mp 2021-10-23 17:52:53 -06:00
81c3c0e5e9 Fix 2021-10-23 17:37:27 -06:00
c23d556d9e Added for other servers 2021-10-23 17:15:51 -06:00
d4220bd70d add watchdog scripts 2021-10-23 17:05:34 -06:00
a512fcbf45 again 2021-09-14 15:46:51 -06:00
ca2f3c8f7c fix error 2021-09-14 15:46:34 -06:00
e0ad486ee0 formatting 2021-09-09 12:41:02 -06:00
fe5f775a71 Tablify dvars 2021-09-09 12:32:53 -06:00
f7816d351c editorconfig and gitattr 2021-09-09 11:27:04 -06:00
039b2a6aca fix 2021-09-04 23:34:50 -06:00
3898e17925 Configs 2021-09-04 23:30:02 -06:00
5ffd3b793a cleanup 2021-09-04 23:13:53 -06:00
c45ee94ff5 cleanup 2021-09-04 23:13:26 -06:00
f8a2f020f5 Added vscode settings 2021-09-03 11:02:32 -06:00
f7016cd704 toggle onemanarmy flare 2021-09-01 21:21:54 -06:00
562d7f5cf5 hasperk 2021-08-27 12:10:27 -06:00
fa14c3d77c Added bot_aim dvar 2021-08-26 10:41:55 -06:00
44075bbfdb Fix bots changing classes 2021-08-25 12:37:25 -06:00
3d314cf267 fix returning flag oneflag 2021-08-25 11:01:37 -06:00
53441151a8 Update README.md 2021-08-06 19:32:55 -06:00
ef21c631e0 if behind 2021-08-02 16:23:11 -06:00
d4480b7246 improved sprinting 2021-07-29 13:54:42 -06:00
a6d7dae5b9 added oneflag 2021-07-27 14:50:20 -06:00
f8719a3b3e revive and fixs 2021-07-25 23:11:21 -06:00
b76ed0995b test 2021-07-25 20:48:40 -06:00
91a7d462e1 gtnw 2021-07-25 15:05:28 -06:00
339c6ed864 better 2021-07-24 20:40:02 -06:00
3e406c5492 show speed 2021-07-24 20:36:03 -06:00
0a5cf7b895 4 para 2021-07-13 19:50:02 -06:00
6c031612ce target through glass 2021-07-13 18:52:39 -06:00
a202d2bba9 splash 2021-07-07 15:58:26 -06:00
d755d3be01 swap the colors 2021-07-07 15:24:41 -06:00
4d3bd2603d chnge color 2021-07-07 14:53:00 -06:00
b7053cba21 pen 2021-07-07 14:22:44 -06:00
d00e230c58 dvars 2021-07-01 13:10:38 -06:00
46cd853c21 triple cap script 2021-07-01 12:59:46 -06:00
cc4c29c515 Update deploy script 2021-06-18 13:53:52 -06:00
27be561a42 Format all scripts 2021-06-18 13:27:21 -06:00
4eced4bc93 Set title 2021-06-18 00:34:10 -06:00
cda0902e1e Merge branch 'master' of https://github.com/ineedbots/mw2_bot_warfare 2021-06-18 00:29:57 -06:00
59903db458 Add deploy scripts 2021-06-18 00:29:49 -06:00
ebce2ef641 Update README.md 2021-06-17 23:30:48 -06:00
a2f9f1f9ee Update README.md 2021-06-17 22:56:04 -06:00
143b03ccf8 Update 2021-06-17 22:10:10 -06:00
bd346f2df9 small change 2021-06-17 22:06:32 -06:00
39136e195b More accurate styling 2021-06-17 21:58:19 -06:00
b272ded713 Add astylerc 2021-06-17 21:31:44 -06:00
dcbee17c25 Fixed thirdperson 2021-06-16 16:09:47 -06:00
fe4e761c64 Sync with iw5 changes 2021-06-14 13:13:05 -06:00
b4bade0106 Fix bots walking around with a killstreak 2021-06-13 21:21:10 -06:00
d443aab063 more sprintage 2021-06-13 19:07:12 -06:00
22fcb5f990 Fixed bot target exploits 2021-06-13 13:50:17 -06:00
f109ab8fbb Reduce var usage 2021-06-04 14:15:21 -06:00
a18aa4c446 up 2021-06-02 23:29:08 -06:00
c115a01ea7 Some future stuff 2021-06-02 23:17:54 -06:00
ee356e9b2c fix dist remote 2021-06-02 10:50:44 -06:00
ca239187f4 Change up sum weaps 2021-06-02 10:20:44 -06:00
00ca687083 prevent stuck crouch 2021-05-27 14:15:56 -06:00
06bedd0df9 Greatly reduce var usage 2021-05-27 14:14:49 -06:00
40d5b03bcf Reduce var usage no kd tree 2021-05-27 11:18:39 -06:00
6c1b6218a6 some fix up 2021-05-26 12:48:48 -06:00
c81a4e2472 Fix up Salvage 2021-05-23 13:34:40 -06:00
1f131d72b4 improved favela wps 2021-05-20 10:36:47 -06:00
e14196e3fc Added low memory mode 2021-05-19 20:07:04 -06:00
7a0dc3b7f9 Improved aiming 2021-05-19 15:23:53 -06:00
c2c7b94c79 Fix up some mantling issues 2021-05-19 13:08:10 -06:00
5a5f5dec58 Improved mantling 2021-05-19 12:20:36 -06:00
56bf257976 Merge pull request #10 from IKennyAgain/master
Updated
2021-05-19 11:40:38 -06:00
953d694a74 Updated
Bots are now mantling in "stand" stance, that prevents them from stuck.
2021-05-19 15:10:34 +03:00
a2ef57ff50 Better print damage 2021-05-18 20:26:46 -06:00
ba24e61852 Fix possible runtime errors 2021-05-18 15:02:43 -06:00
50 changed files with 14353 additions and 8198 deletions

21
.astylerc Normal file
View 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
View 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

19
.gitignore vendored
View File

@ -1,16 +1,18 @@
# Ignore everything in repository root
# Ignore everything in repository root
/*
# Files to not ignore
!/.vscode
!/.gitignore
!/z_devserver.bat
!/z_dev.bat
!/z_serverdev.bat
!/.editorconfig
!/.gitattributes
!/z_server.bat
!/z_bots.bat
!/z_client.bat
!/z_server_watchdog.bat
!/z_server_pvbrust.bat
!/z_server_pvbrust_watchdog.bat
!/z_server_pvbvote.bat
!/z_server_pvbvote_watchdog.bat
# Folder to not ignore
!/userraw
@ -22,6 +24,11 @@
!/README.md
!/out
!/.astylerc
!/z_deploy.bat
!/deploy.bat
!/deploy.js
*.zip
*.log
*.stat

15
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,15 @@
{
"astyle.astylerc": "${workspaceRoot}/.astylerc",
"astyle.additional_languages": [
"gsc"
],
"[gsc]": {
"editor.defaultFormatter": "chiehyu.vscode-astyle",
},
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
"vscode-codscript.use_builtin_completionItems": false
}

376
README.md
View File

@ -1,196 +1,180 @@
![GitHub Logo](/userraw/bw-assets/bw-logo.png)
# IW4x Bot Warfare
Bot Warfare is a GSC mod for the [IW4x project](https://github.com/XLabsProject/iw4x-client).
It aims to add playable AI to the multiplayer games of Modern Warfare 2.
You can find the ModDB release post [here](https://www.moddb.com/mods/bot-warfare/downloads/iw4x-bot-warfare-latest).
## Contents
- [Features](#Features)
- [Installation](#Installation)
- [Documentation](#Documentation)
- [Changelog](#Changelog)
- [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](/userraw/bw-assets/wpedit.md).
- A clean and nice menu, you can edit every bot DVAR within in-game.
- Everything can be customized, ideal for both personal use and dedicated servers. Have a look at [Documentation](#Documentation) to see whats possible!
- This mod does not edit ANY stock .gsc files, meaning EVERY other mod is compatible with this mod. Mod doesn't add anything unnecessary, what you see is what you get.
- Loading waypoints from CSV files, and if the CSV file is missing, will download the CSV from [this repo](https://github.com/ineedbots/iw4x_waypoints) automatically.
- Adds AI clients to multiplayer games to simulate playing real players. (essentially Combat Training for MW2)
- Bots move around the maps with native engine input. (all normal maps, most to all custom maps)
- Bots press all the buttons with native engine input (ads, sprint, jump, etc)
- Bots play all gamemodes/objectives, they capture flags, plant, defuse bombs, etc. ( all normal modes, most custom modes)
- Bots use all killstreaks. Including AC130 and chopper gunner.
- Bots target killstreaks, use stingers and other weapons to take out all killstreaks. ( even sentry guns)
- Bots can capture and steal care packages.
- Bots target equipment, and can even camp TIs.
- Bots can camp randomly or when about to use the laptop.
- Bots can follow others on own will.
- Bots have smooth and realistic aim.
- Bots respond smartly to their surroundings, they will go to you if you shoot, uav, etc.
- Bots use all deathstreaks, perks and weapons. (including javelin)
- Bots difficulty level can be customized and are accurate. (hard is hard, easy is easy, etc.)
- Bots each all have different classes, traits, and difficulty and remember it all.
- Bots switch from between primaries and secondaries.
- Bots can grenade, place claymores and TIs, they even use grenades and tubes in preset map locations.
- Bots use grenade launchers and shotgun attachments.
- Bots can melee people and sentry guns.
- Bots can run!
- Bots can climb ladders!
- Bots jump shot and drop shot.
- Bots detect smoke grenades, stun grenades, flashed and airstrike slows.
- Bots will remember their class, killstreak, skill and traits, even on multiround based gametypes.
- Bots can throwback grenades.
- ... And pretty much everything you expect a Combat Training bot to have
## Installation
0. Make sure that [IW4x](https://xlabs.dev/support_iw4x_client.html) is installed, updated and working properly. (IW4x v0.6.1+)
- Download the [latest release](https://github.com/ineedbots/iw4x_bot_warfare/releases) of Bot Warfare.
1. Locate your IW4x install folder.
2. Move the files/folders found in 'Move files to root of IW4x folder' from the Bot Warfare release archive you downloaded into the root of your IW4x install folder.
- The folder/file structure should follow as '.IW4x game folder\mods\bots\z_svr_bots.iwd'.
3. The mod is now installed, now run your game.
- If you are a dedicated server, you will need to set the DVAR 'fs_game' to 'mods/bots'
- If you are not a dedicated server, open the 'Mods' option from the main menu of the game and select 'bots' and then 'Launch'.
4. The mod should be loaded! Now go start a map and play!
## Documentation
### Menu Usage
- You can open the menu by pressing the Action Slot 2 key (default '5').
- You can navigate the options by pressing your movement keys (default WASD), and you can select options by pressing your jump key (default SPACE).
- 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.
- 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 (like no miniuzi bling with acog rapidfire and hardline for example)
- bots_loadout_allow_op - a boolean value (0 or 1), whether or not if the bots are allowed to use deathstreaks, noobtubes, rpg, laststand, 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_loadout_prestige - an integer number, bots will be this prestige, -1 is the same as player, -2 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_take_carepackages - a boolean value (0 or 1), whether or not if the bots will take carepackages
- 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 separated) 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.0.1
- Reduced bots crouching
- Increased bots sprinting
- Improved bots mantling, crouching and knifing glass when needed
- Fixed possible script runtime errors
- Fixed demolition spawn killing
- Improved domination
- Bots use explosives more if they have it
- Fixed bots moving their player when using remote
- Bots aim slower when ads'ing
- Fixed bots holding breath
- Bots are more smart when waiting for carepackages
- Improved and fixed various waypoints for maps
- Fixed bots rubberbanding movement when their goal changes
- Added bots quickscoping with snipers
- Added bots reload canceling and fast swaps
- Bots use C4
- Improved revenge
- Bots can swap weapons on spawn more likely
- v2.0.0
- Initial reboot release
## Credits
- IW4x Team - https://github.com/XLabsProject/iw4x-client
- CoD4x Team - https://github.com/callofduty4x/CoD4x_Server
- INeedGames(me) - http://www.moddb.com/mods/bot-warfare
- tinkie101 - https://web.archive.org/web/20120326060712/http://alteriw.net/viewtopic.php?f=72&t=4869
- PeZBot team - http://www.moddb.com/mods/pezbot
- apdonato - http://rsebots.blogspot.ca/
- Ability
- Salvation
- VicRattlehead - https://www.moddb.com/members/vicrattlehead
Feel free to use code, host on other sites, host on servers, mod it and merge mods with it, just give credit where credit is due!
-INeedGames/INeedBot(s) @ ineedbots@outlook.com
![GitHub Logo](/userraw/bw-assets/bw-logo.png)
# IW4x Bot Warfare
Bot Warfare is a GSC mod for the [IW4x project](https://github.com/XLabsProject/iw4x-client).
It aims to add playable AI to the multiplayer games of Modern Warfare 2.
You can find the ModDB release post [here](https://www.moddb.com/mods/bot-warfare/downloads/iw4x-bot-warfare-latest).
## Contents
- [Features](#Features)
- [Installation](#Installation)
- [Documentation](#Documentation)
- [Changelog](#Changelog)
- [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](/userraw/bw-assets/wpedit.md).
- A clean and nice menu, you can edit every bot DVAR within in-game.
- Everything can be customized, ideal for both personal use and dedicated servers. Have a look at [Documentation](#Documentation) to see whats possible!
- This mod does not edit ANY stock .gsc files, meaning EVERY other mod is compatible with this mod. Mod doesn't add anything unnecessary, what you see is what you get.
- Loading waypoints from CSV files, and if the CSV file is missing, will download the CSV from [this repo](https://github.com/ineedbots/iw4x_waypoints) automatically.
- Adds AI clients to multiplayer games to simulate playing real players. (essentially Combat Training for MW2)
- Bots move around the maps with native engine input. (all normal maps, most to all custom maps)
- Bots press all the buttons with native engine input (ads, sprint, jump, etc)
- Bots play all gamemodes/objectives, they capture flags, plant, defuse bombs, etc. ( all normal modes, most custom modes)
- Bots use all killstreaks. Including AC130 and chopper gunner.
- Bots target killstreaks, use stingers and other weapons to take out all killstreaks. ( even sentry guns)
- Bots can capture and steal care packages.
- Bots target equipment, and can even camp TIs.
- Bots can camp randomly or when about to use the laptop.
- Bots can follow others on own will.
- Bots have smooth and realistic aim.
- Bots respond smartly to their surroundings, they will go to you if you shoot, uav, etc.
- Bots use all deathstreaks, perks and weapons. (including javelin)
- Bots difficulty level can be customized and are accurate. (hard is hard, easy is easy, etc.)
- Bots each all have different classes, traits, and difficulty and remember it all.
- Bots switch from between primaries and secondaries.
- Bots can grenade, place claymores and TIs, they even use grenades and tubes in preset map locations.
- Bots use grenade launchers and shotgun attachments.
- Bots can melee people and sentry guns.
- Bots can run!
- Bots can climb ladders!
- Bots jump shot and drop shot.
- Bots detect smoke grenades, stun grenades, flashed and airstrike slows.
- Bots will remember their class, killstreak, skill and traits, even on multiround based gametypes.
- Bots can throwback grenades.
- ... And pretty much everything you expect a Combat Training bot to have
## Installation
0. Make sure that [IW4x](https://xlabs.dev/support_iw4x_client.html) is installed, updated and working properly. (IW4x v0.6.1+)
- Download the [latest release](https://github.com/ineedbots/iw4x_bot_warfare/releases) of Bot Warfare.
1. Locate your IW4x install folder.
2. Move the files/folders found in 'Move files to root of IW4x folder' from the Bot Warfare release archive you downloaded into the root of your IW4x install folder.
- The folder/file structure should follow as '.IW4x game folder\mods\bots\z_svr_bots.iwd'.
3. The mod is now installed, now run your game.
- If you are a dedicated server, you will need to set the DVAR 'fs_game' to 'mods/bots'
- If you are not a dedicated server, open the 'Mods' option from the main menu of the game and select 'bots' and then 'Launch'.
4. The mod should be loaded! Now go start a map and play!
## Documentation
### Menu Usage
- You can open the menu by pressing the Action Slot 2 key (default '5').
- You can navigate the options by pressing your movement keys (default WASD), and you can select options by pressing your jump key (default SPACE).
- Pressing the menu button again closes menus.
### DVARs
| Dvar | Description | Default Value |
|----------------------------------|---------------------------------------------------------------------------------------------|--------------:|
| bots_main | Enable this mod. | true |
| bots_main_firstIsHost | The first player to connect will be given host. | false |
| 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_loadout_prestige | What prestige to set the bots.<ul><li>`-1` - Same as host player in the match.</li><li>`-2` - All random.</li><li>`0` or higher - Sets the bots' prestige 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_take_carepackages | If the bots can take carepackages. | 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 |
## Changelog
- v2.1.0
- Bot chatter system, bots_main_chat
- Greatly reduce script variable usage
- Fix bots slowly reacting in remote streaks
- Improved bots mantling and stuck
- Improved bots aim
- Fix some runtime errors
- Fixed bots aim in third person
- Bots sprint more
- Improved bots sight on enemies
- Bots play hidden gamemodes like one-flag and arena
- 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
- Improved bots mantling, crouching and knifing glass when needed
- Fixed possible script runtime errors
- Fixed demolition spawn killing
- Improved domination
- Bots use explosives more if they have it
- Fixed bots moving their player when using remote
- Bots aim slower when ads'ing
- Fixed bots holding breath
- Bots are more smart when waiting for carepackages
- Improved and fixed various waypoints for maps
- Fixed bots rubberbanding movement when their goal changes
- Added bots quickscoping with snipers
- Added bots reload canceling and fast swaps
- Bots use C4
- Improved revenge
- Bots can swap weapons on spawn more likely
- v2.0.0
- Initial reboot release
- TODOs
- A variable leak in _menu (script)
- Recoil for bots (engine, maybe script)
- Use proper activate button for bombs, carepackages, etc (script, use +activate)
- Proper weapon swaps, including altmode (engine, then script)
- Use static turrets in maps (script)
- Proper use of pred missile (script and engine)
- Fix testclient view angle clamping (messes with ac130 and chopper gunner) (engine)
## Credits
- IW4x Team - https://github.com/XLabsProject/iw4x-client
- CoD4x Team - https://github.com/callofduty4x/CoD4x_Server
- INeedGames - http://www.moddb.com/mods/bot-warfare
- tinkie101 - https://web.archive.org/web/20120326060712/http://alteriw.net/viewtopic.php?f=72&t=4869
- PeZBot team - http://www.moddb.com/mods/pezbot
- apdonato - http://rsebots.blogspot.ca/
- Ability
- Salvation
- VicRattlehead - https://www.moddb.com/members/vicrattlehead
Feel free to use code, host on other sites, host on servers, mod it and merge mods with it, just give credit where credit is due!
-INeedGames/INeedBot(s) @ ineedbots@outlook.com

6
deploy.bat Normal file
View File

@ -0,0 +1,6 @@
xcopy iw4x_bot_warfare\userraw\maps userraw\maps\ /Y /I /E /H /C
xcopy iw4x_bot_warfare\userraw\scripts userraw\scripts\ /Y /I /E /H /C
xcopy iw4x_bot_warfare\userraw\waypoints userraw\waypoints\ /Y /I /E /H /C
xcopy iw4x_bot_warfare\userraw\mp userraw\mp\ /Y /I /E /H /C
xcopy iw4x_bot_warfare\main main\ /Y /I /E /H /C
xcopy iw4x_bot_warfare\userraw\bots.txt userraw\ /Y /I /H /C

54
deploy.js Normal file
View File

@ -0,0 +1,54 @@
// nodejs 14+
const exec = require('util').promisify(require('child_process').exec)
const repo_name = 'iw4x_bot_warfare'
const repo_url = `https://github.com/ineedbots/${repo_name}`
const deploy_check_rate = 60000
const title = 'IW4x 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)

View File

@ -3,7 +3,7 @@
///////////////////////////////////////////////////
//This config best view with Notepad++ OR //
//Other non-windows notepad of your choice. //
///////////////////////////////////////////////////
///////////////////////////////////////////////////
//////////////////////////////////////////////////
// SERVER NAME & COLORS TIPS //
@ -48,7 +48,6 @@ set sv_wwwDownload "1"
// NON-GAMEPLAY CONFIGURATION //
//////////////////////////////////////////////////
set rcon_password "qazqaz" // Access to your server to change stuff remotely or ingame. empty disabled
set sv_securityLevel "23" // Configures the servers security level.
set sv_customTextColor "" // custom color for ^;
set g_password "" // Password Protected Server. Leave blank if you want players to join
@ -114,10 +113,10 @@ set scr_classic "0" // Enable IW3 killstreak system
// //
// DO NOT ABUSE! Some people like to rank. //
// DON'T BE A DICK! Warn HIGH XP via hostname. //
// Don't know what you doing? Don't touch it! //
// Don't know what you doing? Dont touch it! //
//////////////////////////////////////////////////
set scr_xpscale "10" // IW's way of Double XP.
set scr_xpscale "10" // IWs way of Double XP.
//set scr_war_score_kill "0" // Amount of XP by each kill.
//set scr_war_score_headshot "0" // Amount of XP by each headshot.
@ -155,7 +154,7 @@ set scr_xpscale "10" // IW's way of Double XP.
// higher weights increase selection chance //
//////////////////////////////////////////////////
// set scr_airdrop_ac130 "3"
// set scr_airdrop_ac130 "3"
set scr_airdrop_ammo "15"
// set scr_airdrop_counter_uav "15"
set scr_airdrop_emp "2"
@ -203,32 +202,32 @@ set scr_airdrop_mega_nuke "1"
//////////////////////////////////////////////////
set scr_dm_scorelimit "10000" // Score limit to win the game.
set scr_dm_timelimit "10" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_dm_timelimit "10" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_dm_playerrespawndelay "0" // How long player will wait until respawn.
set scr_dm_numlives "0" // Number of lives per player 0 for unlimited.
set scr_dm_roundlimit "1" // Rounds per game.
set scr_dm_winlimit "1" // amount of wins needed to win a round-based game
set scr_dm_promode "0"
set scr_dm_promode "0"
//////////////////////////////////////////////////
// TEAM DEATHMATCH GAMETYPE SETTINGS //
//////////////////////////////////////////////////
set scr_war_scorelimit "25600" // Score limit to win the game.
set scr_war_timelimit "10" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_war_timelimit "10" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_war_playerrespawndelay "0" // How long player will wait until respawn.
set scr_war_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_war_numlives "0" // Number of lives per player 0 for unlimited.
set scr_war_numlives "0" // Number of lives per player 0 for unlimited.
set scr_war_roundlimit "1" // Rounds per game.
set scr_war_winlimit "1" // amount of wins needed to win a round-based game
set scr_war_promode "0"
set scr_war_promode "0"
//////////////////////////////////////////////////
// DOMINATION GAMETYPE SETTINGS //
//////////////////////////////////////////////////
set scr_dom_scorelimit "300" // Score limit to win the game.
set scr_dom_timelimit "30" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_dom_timelimit "30" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_dom_playerrespawndelay "0" // How long player will wait until respawn.
set scr_dom_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_dom_numlives "0" // Number of lives per player per game. 0 is unlimited.
@ -241,7 +240,7 @@ set scr_dom_promode "0"
//////////////////////////////////////////////////
set scr_dd_scorelimit "1" // Score limit needed to win.
set scr_dd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_dd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_dd_playerrespawndelay "0" // How long player will wait until respawn.
set scr_dd_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_dd_numlives "0" // Number of lives per player per game. 0 is unlimited.
@ -257,7 +256,7 @@ set scr_dd_promode "0"
//////////////////////////////////////////////////
set scr_sd_scorelimit "1" // Score limit required to win the game.
set scr_sd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_sd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_sd_playerrespawndelay "0" // How long player will wait until respawn.
set scr_sd_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_sd_numlives "1" // Number of lives per player per game.
@ -276,7 +275,7 @@ set scr_sd_promode "0"
//////////////////////////////////////////////////
set scr_sab_scorelimit "0" // Score limit to win the match.
set scr_sab_timelimit "20" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_sab_timelimit "20" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_sab_bombtimer "30" // Duration in seconds the bomb takes to detonate.
set scr_sab_defusetime "5" // Time taken to defuse the bomb.
set scr_sab_hotpotato "0" // One bomb that the teams must fight over. One defending and one have to plant at the site.
@ -294,7 +293,7 @@ set scr_sab_promode "0"
//////////////////////////////////////////////////
set scr_ctf_scorelimit "0" // Target score before the round ends.
set scr_ctf_timelimit "10" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_ctf_timelimit "10" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_ctf_numlives "0" // Number of lives per player 0 for unlimited.
set scr_ctf_halftime "1" // Half-Time
set scr_ctf_roundlimit "1" // How many rounds match would last.
@ -308,7 +307,7 @@ set scr_ctf_promode "0"
//////////////////////////////////////////////////
set scr_oneflag_scorelimit "1" // Target score before the round ends.
set scr_oneflag_timelimit "3" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_oneflag_timelimit "3" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_oneflag_numlives "0" // number of lives per player 0 for unlimited.
set scr_oneflag_playerrespawndelay "0" // Respawn wait in seconds.
set scr_oneflag_roundlimit "1" // How many rounds match would last.
@ -321,7 +320,7 @@ set scr_oneflag_promode "0"
//////////////////////////////////////////////////
set scr_koth_scorelimit "250" // Score limit to win the game.
set scr_koth_timelimit "15" // Duration in minutes the game will continue if the score isn't reached.
set scr_koth_timelimit "15" // Duration in minutes the game will continue if the score isnt reached.
set scr_koth_numlives "0" // Number of lives per game. 0 for unlimited.
set scr_koth_playerrespawndelay "0" // Players respawn wait.
set scr_koth_roundlimit "1" // Rounds to be played.
@ -335,7 +334,7 @@ set scr_koth_promode "0"
//////////////////////////////////////////////////
set scr_arena_scorelimit "1" // Score limit to win the game.
set scr_arena_timelimit "2.5" // Duration in minutes the game will continue if the score isn't reached.
set scr_arena_timelimit "2.5" // Duration in minutes the game will continue if the score isnt reached.
set scr_arena_numlives "1" // Number of lives per game 0 for unlimited.
set scr_arena_roundlimit "0" // Rounds to be played.
set scr_arena_roundswitch "3" // Rounds before the teams switch sides.
@ -348,7 +347,7 @@ set scr_arena_promode "0"
//////////////////////////////////////////////////
set scr_gtnw_scorelimit "101" // Score limit to win the game.
set scr_gtnw_timelimit "10" // Duration in minutes the game will continue if the score isn't reached.
set scr_gtnw_timelimit "10" // Duration in minutes the game will continue if the score isnt reached.
set scr_gtnw_numlives "0" // Number of lives per game 0 for unlimited.
set scr_gtnw_playerrespawndelay "0" // Players respawn wait.
set scr_gtnw_roundlimit "1" // Rounds to be played.
@ -491,10 +490,11 @@ set iw4x_onelog ""
// CUSTOM
set bot_pvb_helper_noPlayersOnTeam "axis"
set bot_pvb_helper_customBotClassTeam ""
set bot_pvb_helper_customBotClassTeam "allies"
set scr_showHP "1"
set scr_allowFPSBooster "1"
set bot_sniperCheck "1"
set dom_lastFlagUseTimeMulti "4.0"
// _class
// set scr_allow_ "0"
@ -529,12 +529,12 @@ set bots_manage_fill_kick "1"
set bots_team "axis"
set bots_team_amount "0"
set bots_team_force "1"
set bots_team_mode "0"
set bots_skill "0"
set bots_team_mode "1"
set bots_skill "8"
set bots_skill_axis_hard "0"
set bots_skill_axis_med "0"
set bots_skill_axis_med "4"
set bots_skill_allies_hard "0"
set bots_skill_allies_med "0"
set bots_skill_allies_med "4"
set bots_loadout_reasonable "0"
set bots_loadout_allow_op "0"
set bots_loadout_rank "-1"
@ -553,7 +553,7 @@ set bots_play_ads "1"
// iw4madmin
set sv_printradarupdates "1"
set sv_printradarupdates "0"
// _killcam
@ -592,6 +592,7 @@ set scr_deleteNadeOnTeamChange "1"
// _perkfunctions
set combathighIsJuiced "1"
set onemanarmyRefillsTubes "1"
set fix_onemanarmyFlareBug "0"
// _killstreaks
set scr_killstreak_rollover "1"

View File

@ -48,7 +48,6 @@ set sv_wwwDownload "1"
// NON-GAMEPLAY CONFIGURATION //
//////////////////////////////////////////////////
set rcon_password "qazqaz" // Access to your server to change stuff remotely or ingame. empty disabled
set sv_securityLevel "23" // Configures the servers security level.
set sv_customTextColor "" // custom color for ^;
set g_password "" // Password Protected Server. Leave blank if you want players to join
@ -114,10 +113,10 @@ set scr_classic "0" // Enable IW3 killstreak system
// //
// DO NOT ABUSE! Some people like to rank. //
// DON'T BE A DICK! Warn HIGH XP via hostname. //
// Don't know what you doing? Don't touch it! //
// Don't know what you doing? Dont touch it! //
//////////////////////////////////////////////////
set scr_xpscale "10" // IW's way of Double XP.
set scr_xpscale "10" // IWs way of Double XP.
//set scr_war_score_kill "0" // Amount of XP by each kill.
//set scr_war_score_headshot "0" // Amount of XP by each headshot.
@ -203,7 +202,7 @@ set scr_airdrop_mega_nuke "1"
//////////////////////////////////////////////////
set scr_dm_scorelimit "10000" // Score limit to win the game.
set scr_dm_timelimit "10" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_dm_timelimit "10" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_dm_playerrespawndelay "0" // How long player will wait until respawn.
set scr_dm_numlives "0" // Number of lives per player 0 for unlimited.
set scr_dm_roundlimit "1" // Rounds per game.
@ -215,7 +214,7 @@ set scr_dm_promode "0"
//////////////////////////////////////////////////
set scr_war_scorelimit "25600" // Score limit to win the game.
set scr_war_timelimit "10" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_war_timelimit "10" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_war_playerrespawndelay "0" // How long player will wait until respawn.
set scr_war_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_war_numlives "0" // Number of lives per player 0 for unlimited.
@ -228,7 +227,7 @@ set scr_war_promode "0"
//////////////////////////////////////////////////
set scr_dom_scorelimit "300" // Score limit to win the game.
set scr_dom_timelimit "30" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_dom_timelimit "30" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_dom_playerrespawndelay "0" // How long player will wait until respawn.
set scr_dom_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_dom_numlives "0" // Number of lives per player per game. 0 is unlimited.
@ -241,7 +240,7 @@ set scr_dom_promode "0"
//////////////////////////////////////////////////
set scr_dd_scorelimit "1" // Score limit needed to win.
set scr_dd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_dd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_dd_playerrespawndelay "0" // How long player will wait until respawn.
set scr_dd_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_dd_numlives "0" // Number of lives per player per game. 0 is unlimited.
@ -257,7 +256,7 @@ set scr_dd_promode "0"
//////////////////////////////////////////////////
set scr_sd_scorelimit "1" // Score limit required to win the game.
set scr_sd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_sd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_sd_playerrespawndelay "0" // How long player will wait until respawn.
set scr_sd_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_sd_numlives "1" // Number of lives per player per game.
@ -276,7 +275,7 @@ set scr_sd_promode "0"
//////////////////////////////////////////////////
set scr_sab_scorelimit "0" // Score limit to win the match.
set scr_sab_timelimit "20" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_sab_timelimit "20" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_sab_bombtimer "30" // Duration in seconds the bomb takes to detonate.
set scr_sab_defusetime "5" // Time taken to defuse the bomb.
set scr_sab_hotpotato "0" // One bomb that the teams must fight over. One defending and one have to plant at the site.
@ -294,7 +293,7 @@ set scr_sab_promode "0"
//////////////////////////////////////////////////
set scr_ctf_scorelimit "0" // Target score before the round ends.
set scr_ctf_timelimit "10" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_ctf_timelimit "10" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_ctf_numlives "0" // Number of lives per player 0 for unlimited.
set scr_ctf_halftime "1" // Half-Time
set scr_ctf_roundlimit "1" // How many rounds match would last.
@ -308,7 +307,7 @@ set scr_ctf_promode "0"
//////////////////////////////////////////////////
set scr_oneflag_scorelimit "1" // Target score before the round ends.
set scr_oneflag_timelimit "3" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_oneflag_timelimit "3" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_oneflag_numlives "0" // number of lives per player 0 for unlimited.
set scr_oneflag_playerrespawndelay "0" // Respawn wait in seconds.
set scr_oneflag_roundlimit "1" // How many rounds match would last.
@ -321,7 +320,7 @@ set scr_oneflag_promode "0"
//////////////////////////////////////////////////
set scr_koth_scorelimit "250" // Score limit to win the game.
set scr_koth_timelimit "15" // Duration in minutes the game will continue if the score isn't reached.
set scr_koth_timelimit "15" // Duration in minutes the game will continue if the score isnt reached.
set scr_koth_numlives "0" // Number of lives per game. 0 for unlimited.
set scr_koth_playerrespawndelay "0" // Players respawn wait.
set scr_koth_roundlimit "1" // Rounds to be played.
@ -335,7 +334,7 @@ set scr_koth_promode "0"
//////////////////////////////////////////////////
set scr_arena_scorelimit "1" // Score limit to win the game.
set scr_arena_timelimit "2.5" // Duration in minutes the game will continue if the score isn't reached.
set scr_arena_timelimit "2.5" // Duration in minutes the game will continue if the score isnt reached.
set scr_arena_numlives "1" // Number of lives per game 0 for unlimited.
set scr_arena_roundlimit "0" // Rounds to be played.
set scr_arena_roundswitch "3" // Rounds before the teams switch sides.
@ -348,7 +347,7 @@ set scr_arena_promode "0"
//////////////////////////////////////////////////
set scr_gtnw_scorelimit "101" // Score limit to win the game.
set scr_gtnw_timelimit "10" // Duration in minutes the game will continue if the score isn't reached.
set scr_gtnw_timelimit "10" // Duration in minutes the game will continue if the score isnt reached.
set scr_gtnw_numlives "0" // Number of lives per game 0 for unlimited.
set scr_gtnw_playerrespawndelay "0" // Players respawn wait.
set scr_gtnw_roundlimit "1" // Rounds to be played.
@ -490,11 +489,12 @@ set iw4x_onelog ""
// CUSTOM
set bot_pvb_helper_noPlayersOnTeam "allies"
set bot_pvb_helper_customBotClassTeam "axis"
set bot_pvb_helper_noPlayersOnTeam "axis"
set bot_pvb_helper_customBotClassTeam ""
set scr_showHP "1"
set scr_allowFPSBooster "1"
set bot_sniperCheck "1"
set dom_lastFlagUseTimeMulti "4.0"
// _class
// set scr_allow_ "0"
@ -521,20 +521,20 @@ set bots_main "1"
set bots_main_GUIDs ""
set bots_main_firstIsHost "0"
set bots_main_waitForHostTime "10"
set bots_manage_add "10"
set bots_manage_fill "10"
set bots_manage_add "9"
set bots_manage_fill "9"
set bots_manage_fill_spec "0"
set bots_manage_fill_mode "1"
set bots_manage_fill_kick "1"
set bots_team "custom"
set bots_team_amount "1"
set bots_team "axis"
set bots_team_amount "0"
set bots_team_force "1"
set bots_team_mode "1"
set bots_team_mode "0"
set bots_skill "8"
set bots_skill_axis_hard "1"
set bots_skill_axis_med "0"
set bots_skill_axis_hard "0"
set bots_skill_axis_med "3"
set bots_skill_allies_hard "0"
set bots_skill_allies_med "3"
set bots_skill_allies_med "0"
set bots_loadout_reasonable "0"
set bots_loadout_allow_op "0"
set bots_loadout_rank "-1"
@ -592,6 +592,7 @@ set scr_deleteNadeOnTeamChange "1"
// _perkfunctions
set combathighIsJuiced "1"
set onemanarmyRefillsTubes "1"
set fix_onemanarmyFlareBug "0"
// _killstreaks
set scr_killstreak_rollover "1"

View File

@ -48,7 +48,6 @@ set sv_wwwDownload "1"
// NON-GAMEPLAY CONFIGURATION //
//////////////////////////////////////////////////
set rcon_password "qazqaz" // Access to your server to change stuff remotely or ingame. empty disabled
set sv_securityLevel "23" // Configures the servers security level.
set sv_customTextColor "" // custom color for ^;
set g_password "" // Password Protected Server. Leave blank if you want players to join
@ -114,10 +113,10 @@ set scr_classic "0" // Enable IW3 killstreak system
// //
// DO NOT ABUSE! Some people like to rank. //
// DON'T BE A DICK! Warn HIGH XP via hostname. //
// Don't know what you doing? Don't touch it! //
// Don't know what you doing? Dont touch it! //
//////////////////////////////////////////////////
set scr_xpscale "10" // IW's way of Double XP.
set scr_xpscale "10" // IWs way of Double XP.
//set scr_war_score_kill "0" // Amount of XP by each kill.
//set scr_war_score_headshot "0" // Amount of XP by each headshot.
@ -203,7 +202,7 @@ set scr_airdrop_mega_nuke "1"
//////////////////////////////////////////////////
set scr_dm_scorelimit "10000" // Score limit to win the game.
set scr_dm_timelimit "10" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_dm_timelimit "10" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_dm_playerrespawndelay "0" // How long player will wait until respawn.
set scr_dm_numlives "0" // Number of lives per player 0 for unlimited.
set scr_dm_roundlimit "1" // Rounds per game.
@ -215,7 +214,7 @@ set scr_dm_promode "0"
//////////////////////////////////////////////////
set scr_war_scorelimit "25600" // Score limit to win the game.
set scr_war_timelimit "10" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_war_timelimit "10" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_war_playerrespawndelay "0" // How long player will wait until respawn.
set scr_war_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_war_numlives "0" // Number of lives per player 0 for unlimited.
@ -228,7 +227,7 @@ set scr_war_promode "0"
//////////////////////////////////////////////////
set scr_dom_scorelimit "300" // Score limit to win the game.
set scr_dom_timelimit "30" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_dom_timelimit "30" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_dom_playerrespawndelay "0" // How long player will wait until respawn.
set scr_dom_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_dom_numlives "0" // Number of lives per player per game. 0 is unlimited.
@ -241,7 +240,7 @@ set scr_dom_promode "0"
//////////////////////////////////////////////////
set scr_dd_scorelimit "1" // Score limit needed to win.
set scr_dd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_dd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_dd_playerrespawndelay "0" // How long player will wait until respawn.
set scr_dd_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_dd_numlives "0" // Number of lives per player per game. 0 is unlimited.
@ -257,7 +256,7 @@ set scr_dd_promode "0"
//////////////////////////////////////////////////
set scr_sd_scorelimit "1" // Score limit required to win the game.
set scr_sd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_sd_timelimit "2.5" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_sd_playerrespawndelay "0" // How long player will wait until respawn.
set scr_sd_waverespawndelay "0" // Duration is seconds before the first respawn in each round.
set scr_sd_numlives "1" // Number of lives per player per game.
@ -276,7 +275,7 @@ set scr_sd_promode "0"
//////////////////////////////////////////////////
set scr_sab_scorelimit "0" // Score limit to win the match.
set scr_sab_timelimit "20" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_sab_timelimit "20" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_sab_bombtimer "30" // Duration in seconds the bomb takes to detonate.
set scr_sab_defusetime "5" // Time taken to defuse the bomb.
set scr_sab_hotpotato "0" // One bomb that the teams must fight over. One defending and one have to plant at the site.
@ -294,7 +293,7 @@ set scr_sab_promode "0"
//////////////////////////////////////////////////
set scr_ctf_scorelimit "0" // Target score before the round ends.
set scr_ctf_timelimit "10" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_ctf_timelimit "10" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_ctf_numlives "0" // Number of lives per player 0 for unlimited.
set scr_ctf_halftime "1" // Half-Time
set scr_ctf_roundlimit "1" // How many rounds match would last.
@ -308,7 +307,7 @@ set scr_ctf_promode "0"
//////////////////////////////////////////////////
set scr_oneflag_scorelimit "1" // Target score before the round ends.
set scr_oneflag_timelimit "3" // Duration in minutes for the game to end if the score limit isn't reached.
set scr_oneflag_timelimit "3" // Duration in minutes for the game to end if the score limit isnt reached.
set scr_oneflag_numlives "0" // number of lives per player 0 for unlimited.
set scr_oneflag_playerrespawndelay "0" // Respawn wait in seconds.
set scr_oneflag_roundlimit "1" // How many rounds match would last.
@ -321,7 +320,7 @@ set scr_oneflag_promode "0"
//////////////////////////////////////////////////
set scr_koth_scorelimit "250" // Score limit to win the game.
set scr_koth_timelimit "15" // Duration in minutes the game will continue if the score isn't reached.
set scr_koth_timelimit "15" // Duration in minutes the game will continue if the score isnt reached.
set scr_koth_numlives "0" // Number of lives per game. 0 for unlimited.
set scr_koth_playerrespawndelay "0" // Players respawn wait.
set scr_koth_roundlimit "1" // Rounds to be played.
@ -335,7 +334,7 @@ set scr_koth_promode "0"
//////////////////////////////////////////////////
set scr_arena_scorelimit "1" // Score limit to win the game.
set scr_arena_timelimit "2.5" // Duration in minutes the game will continue if the score isn't reached.
set scr_arena_timelimit "2.5" // Duration in minutes the game will continue if the score isnt reached.
set scr_arena_numlives "1" // Number of lives per game 0 for unlimited.
set scr_arena_roundlimit "0" // Rounds to be played.
set scr_arena_roundswitch "3" // Rounds before the teams switch sides.
@ -348,7 +347,7 @@ set scr_arena_promode "0"
//////////////////////////////////////////////////
set scr_gtnw_scorelimit "101" // Score limit to win the game.
set scr_gtnw_timelimit "10" // Duration in minutes the game will continue if the score isn't reached.
set scr_gtnw_timelimit "10" // Duration in minutes the game will continue if the score isnt reached.
set scr_gtnw_numlives "0" // Number of lives per game 0 for unlimited.
set scr_gtnw_playerrespawndelay "0" // Players respawn wait.
set scr_gtnw_roundlimit "1" // Rounds to be played.
@ -591,6 +590,7 @@ set scr_deleteNadeOnTeamChange "1"
// _perkfunctions
set combathighIsJuiced "1"
set onemanarmyRefillsTubes "1"
set fix_onemanarmyFlareBug "0"
// _killstreaks
set scr_killstreak_rollover "1"

View File

@ -1,4 +1,4 @@
# IW4x Bot Warfare v2.0.0
# IW4x Bot Warfare v2.1.0
Bot Warfare is a GSC mod for the IW4x project.
It aims to add playable AI to the multiplayer games of Modern Warfare 2.
@ -23,6 +23,21 @@ You can find the GitHub containing more info at https://github.com/ineedbots/iw4
- Pressing the menu button again closes menus.
## Changelog
- v2.1.0
- Bot chatter system, bots_main_chat
- Greatly reduce script variable usage
- Fix bots slowly reacting in remote streaks
- Improved bots mantling and stuck
- Improved bots aim
- Fix some runtime errors
- Fixed bots aim in third person
- Bots sprint more
- Improved bots sight on enemies
- Bots play hidden gamemodes like one-flag and arena
- 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
@ -46,6 +61,16 @@ You can find the GitHub containing more info at https://github.com/ineedbots/iw4
- v2.0.0
- Initial reboot release
- TODOs
- A variable leak in _menu (script)
- Recoil for bots (engine, maybe script)
- Use proper activate button for bombs, carepackages, etc (script, use +activate)
- Proper weapon swaps, including altmode (engine, then script)
- Use static turrets in maps (script)
- Proper use of pred missile (script and engine)
- Fix testclient view angle clamping (messes with ac130 and chopper gunner) (engine)
## Credits
- IW4x Team - https://github.com/XLabsProject/iw4x-client
- CoD4x Team - https://github.com/callofduty4x/CoD4x_Server

BIN
out/ss.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 MiB

View File

@ -1,26 +1,26 @@
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
bota
botb
botc
botd
bote
botf
botg
both
boti
botj
botk
botl
botm
botn
boto
botp
botq
botr
bots
bott
botu
botv
botw
botx
boty
botz

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,125 +1,127 @@
/*
_bot_http
Author: INeedGames
Date: 09/26/2020
The HTTP module to use with IW4X's gsc funcs
*/
#include maps\mp\bots\_bot_utility;
/*
Does the version check, if we are up too date
*/
doVersionCheck()
{
remoteVersion = getRemoteVersion();
if (!isDefined(remoteVersion))
{
PrintConsole("Error getting remote version of Bot Warfare.\n");
return false;
}
if (level.bw_VERSION != remoteVersion)
{
PrintConsole("There is a new version of Bot Warfare!\n");
PrintConsole("You are on version " + level.bw_VERSION + " but " + remoteVersion + " is available!\n");
return false;
}
PrintConsole("You are on the latest version of Bot Warfare!\n");
return true;
}
/*
Will attempt to retreive waypoints from the internet
*/
getRemoteWaypoints(mapname)
{
url = "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/" + mapname + "_wp.csv";
filename = "waypoints/" + mapname + "_wp.csv";
PrintConsole("Attempting to get remote waypoints from " + url + "\n");
res = getLinesFromUrl(url, filename);
if (!res.lines.size)
return;
waypointCount = int(res.lines[0]);
waypoints = [];
PrintConsole("Loading remote waypoints...\n");
for (i = 1; i <= waypointCount; i++)
{
tokens = tokenizeLine(res.lines[i], ",");
waypoint = parseTokensIntoWaypoint(tokens);
waypoints[i-1] = waypoint;
}
if (waypoints.size)
{
level.waypoints = waypoints;
PrintConsole("Loaded " + waypoints.size + " waypoints from remote.\n");
}
}
/*
Returns the version of bot warfare found on the internet
*/
getRemoteVersion()
{
request = httpGet( "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/version.txt" );
if (!isDefined(request))
return undefined;
request waittill( "done", success, data );
if (!success)
return undefined;
return strtok(data, "\n")[0];
}
/*
Returns an array of each line from the response of the http url request
*/
getLinesFromUrl(url, filename)
{
result = spawnStruct();
result.lines = [];
request = httpGet( url );
if (!isDefined(request))
return result;
request waittill( "done", success, data );
if (!success)
return result;
fileWrite(filename, data, "write");
line = "";
for (i=0;i<data.size;i++)
{
c = data[i];
if (c == "\n")
{
result.lines[result.lines.size] = line;
line = "";
continue;
}
line += c;
}
result.lines[result.lines.size] = line;
return result;
}
/*
_bot_http
Author: INeedGames
Date: 09/26/2020
The HTTP module to use with IW4X's gsc funcs
*/
#include maps\mp\bots\_bot_utility;
/*
Does the version check, if we are up too date
*/
doVersionCheck()
{
remoteVersion = getRemoteVersion();
if ( !isDefined( remoteVersion ) )
{
PrintConsole( "Error getting remote version of Bot Warfare.\n" );
return false;
}
if ( level.bw_VERSION != remoteVersion )
{
PrintConsole( "There is a new version of Bot Warfare!\n" );
PrintConsole( "You are on version " + level.bw_VERSION + " but " + remoteVersion + " is available!\n" );
return false;
}
PrintConsole( "You are on the latest version of Bot Warfare!\n" );
return true;
}
/*
Will attempt to retreive waypoints from the internet
*/
getRemoteWaypoints( mapname )
{
url = "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/" + mapname + "_wp.csv";
filename = "waypoints/" + mapname + "_wp.csv";
PrintConsole( "Attempting to get remote waypoints from " + url + "\n" );
res = getLinesFromUrl( url, filename );
if ( !res.lines.size )
return;
waypointCount = int( res.lines[0] );
waypoints = [];
PrintConsole( "Loading remote waypoints...\n" );
for ( i = 1; i <= waypointCount; i++ )
{
tokens = tokenizeLine( res.lines[i], "," );
waypoint = parseTokensIntoWaypoint( tokens );
waypoints[i - 1] = waypoint;
}
if ( waypoints.size )
{
level.waypoints = waypoints;
PrintConsole( "Loaded " + waypoints.size + " waypoints from remote.\n" );
}
}
/*
Returns the version of bot warfare found on the internet
*/
getRemoteVersion()
{
request = httpGet( "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/version.txt" );
if ( !isDefined( request ) )
return undefined;
request waittill( "done", success, data );
if ( !success )
return undefined;
return strtok( data, "\n" )[0];
}
/*
Returns an array of each line from the response of the http url request
*/
getLinesFromUrl( url, filename )
{
result = spawnStruct();
result.lines = [];
request = httpGet( url );
if ( !isDefined( request ) )
return result;
request waittill( "done", success, data );
if ( !success )
return result;
fileWrite( filename, data, "write" );
line = "";
for ( i = 0; i < data.size; i++ )
{
c = data[i];
if ( c == "\n" )
{
result.lines[result.lines.size] = line;
line = "";
continue;
}
line += c;
}
result.lines[result.lines.size] = line;
return result;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1460,7 +1460,7 @@ Callback_PlayerDamage_internal( eInflictor, eAttacker, victim, iDamage, iDFlags,
if ( attackerIsNPC && isDefined( eAttacker.gunner ) )
damager = eAttacker.gunner;
else if( level.extraDamageFeedback && isDefined( eAttacker.owner ) )
else if( level.extraDamageFeedback && isDefined( eAttacker ) && isDefined( eAttacker.owner ) )
damager = eAttacker.owner;
else
damager = eAttacker;
@ -1592,17 +1592,62 @@ Callback_PlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, s
}
doPrintDamage(dmg, hitloc, flags)
{
self endon( "disconnect" );
huddamage = newclienthudelem(self);
huddamage.alignx = "center";
huddamage.horzalign = "center";
huddamage.x = 10;
huddamage.y = 235;
huddamage.fontscale = 1.6;
huddamage.font = "objective";
huddamage setvalue(dmg);
if ((flags & level.iDFLAGS_RADIUS) != 0)
huddamage.color = (0.25, 0.25, 0.25);
if ((flags & level.iDFLAGS_PENETRATION) != 0)
huddamage.color = (1, 1, 0.25);
if (hitloc == "head")
huddamage.color = (1, 0.25, 0.25);
huddamage moveovertime(1);
huddamage fadeovertime(1);
huddamage.alpha = 0;
huddamage.x = randomIntRange(25, 70);
val = 1;
if (cointoss())
val = -1;
huddamage.y = 235 + randomIntRange(25, 70) * val;
wait 1;
if ( isDefined( huddamage ) )
huddamage destroy();
}
finishPlayerDamageWrapper( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime, stunFraction )
{
if( level.allowPrintDamage )
{
if ( isDefined( eAttacker ) && isPlayer( eAttacker ) && eAttacker.printDamage )
eAttacker iPrintLnBold( iDamage );
if ( !isDefined( eAttacker ) )
{
if ( !isDefined( eInflictor ) && self.printDamage )
self thread doPrintDamage( iDamage, sHitLoc, iDFlags );
}
else if ( isPlayer( eAttacker ) && eAttacker.printDamage )
eAttacker thread doPrintDamage( iDamage, sHitLoc, iDFlags );
else if( isDefined( eAttacker.owner ) && isPlayer( eAttacker.owner ) && eAttacker.owner.printDamage )
eAttacker.owner iPrintLnBold( iDamage );
eAttacker.owner thread doPrintDamage( iDamage, sHitLoc, iDFlags );
}
if( level.extraDamageFeedback )
if( isDefined( eAttacker ) && level.extraDamageFeedback )
{
if( sWeapon == "nuke_mp" )
{
@ -1618,7 +1663,7 @@ finishPlayerDamageWrapper( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeat
if( sHitLoc == "head" || sHitLoc == "helmet" )
{
if ( isDefined( eAttacker ) && isPlayer( eAttacker ) )
if ( isPlayer( eAttacker ) )
eAttacker playLocalSound( "bullet_impact_headshot_2" );
else if( isDefined( eAttacker.owner ) && isPlayer( eAttacker.owner ) )
eAttacker.owner playLocalSound( "bullet_impact_headshot_2" );

View File

@ -16,15 +16,15 @@ init()
initBufferedStats()
{
self.bufferedStats = [];
self.bufferedStats[ "totalShots" ] = self getPlayerData( "totalShots" );
self.bufferedStats[ "accuracy" ] = self getPlayerData( "accuracy" );
self.bufferedStats[ "misses" ] = self getPlayerData( "misses" );
self.bufferedStats[ "hits" ] = self getPlayerData( "hits" );
self.bufferedStats[ "timePlayedAllies" ] = self getPlayerData( "timePlayedAllies" );
self.bufferedStats[ "timePlayedOpfor" ] = self getPlayerData( "timePlayedOpfor" );
self.bufferedStats[ "timePlayedOther" ] = self getPlayerData( "timePlayedOther" );
self.bufferedStats[ "timePlayedTotal" ] = self getPlayerData( "timePlayedTotal" );
self.bufferedStats[ "totalShots" ] = self getPlayerData( "totalShots" );
self.bufferedStats[ "accuracy" ] = self getPlayerData( "accuracy" );
self.bufferedStats[ "misses" ] = self getPlayerData( "misses" );
self.bufferedStats[ "hits" ] = self getPlayerData( "hits" );
self.bufferedStats[ "timePlayedAllies" ] = self getPlayerData( "timePlayedAllies" );
self.bufferedStats[ "timePlayedOpfor" ] = self getPlayerData( "timePlayedOpfor" );
self.bufferedStats[ "timePlayedOther" ] = self getPlayerData( "timePlayedOther" );
self.bufferedStats[ "timePlayedTotal" ] = self getPlayerData( "timePlayedTotal" );
self.bufferedChildStats = [];
self.bufferedChildStats[ "round" ] = [];
self.bufferedChildStats[ "round" ][ "timePlayed" ] = self getPlayerData( "round", "timePlayed" );
@ -60,10 +60,13 @@ Sets the value of the named stat
statSet( dataName, value )
{
assert( !isDefined( self.bufferedStats[ dataName ] ) ); // should use statGetBuffered consistently with statSetBuffered
if ( !self rankingEnabled() )
return;
if (getDvarInt("developer_script"))
return;
self SetPlayerData( dataName, value );
}
@ -75,12 +78,15 @@ Adds the passed value to the value of the named stat
=============
*/
statAdd( dataName, value )
{
{
assert( !isDefined( self.bufferedStats[ dataName ] ) ); // should use statGetBuffered consistently with statSetBuffered
if ( !self rankingEnabled() )
return;
if (getDvarInt("developer_script"))
return;
curValue = self GetPlayerData( dataName );
self SetPlayerData( dataName, value + curValue );
}
@ -96,7 +102,10 @@ statSetChild( parent, child, value )
{
if ( !self rankingEnabled() )
return;
if (getDvarInt("developer_script"))
return;
self SetPlayerData( parent, child, value );
}
@ -107,7 +116,10 @@ statAddChild( parent, child, value )
if ( !self rankingEnabled() )
return;
if (getDvarInt("developer_script"))
return;
curValue = self GetPlayerData( parent, child );
self SetPlayerData( parent, child, curValue + value );
}
@ -116,7 +128,7 @@ statAddChild( parent, child, value )
statGetChildBuffered( parent, child )
{
assert( isDefined( self.bufferedChildStats[ parent ][ child ] ) );
return self.bufferedChildStats[ parent ][ child ];
}
@ -124,7 +136,7 @@ statGetChildBuffered( parent, child )
statSetChildBuffered( parent, child, value )
{
assert( isDefined( self.bufferedChildStats[ parent ][ child ] ) );
if ( !self rankingEnabled() )
return;
@ -138,7 +150,7 @@ statAddChildBuffered( parent, child, value )
if ( !self rankingEnabled() )
return;
curValue = statGetChildBuffered( parent, child );
statSetChildBuffered( parent, child, curValue + value );
}
@ -154,7 +166,7 @@ Returns the value of the named stat
statGetBuffered( dataName )
{
assert( isDefined( self.bufferedStats[ dataName ] ) );
return self.bufferedStats[ dataName ];
}
@ -171,7 +183,7 @@ statSetBuffered( dataName, value )
if ( !self rankingEnabled() )
return;
self.bufferedStats[ dataName ] = value;
}
@ -183,12 +195,12 @@ Adds the passed value to the value of the named stat
=============
*/
statAddBuffered( dataName, value )
{
{
assert( isDefined( self.bufferedStats[ dataName ] ) );
if ( !self rankingEnabled() )
return;
curValue = statGetBuffered( dataName );
statSetBuffered( dataName, curValue + value );
}
@ -198,7 +210,7 @@ updateBufferedStats()
{
// give the first player time to connect
wait ( 0.15 );
nextToUpdate = 0;
while ( !level.gameEnded )
{
@ -211,9 +223,9 @@ updateBufferedStats()
wait ( 2.0 );
}
foreach ( player in level.players )
player writeBufferedStats();
player writeBufferedStats();
}
@ -221,7 +233,7 @@ writeBufferedStats()
{
if (getDvarInt("developer_script"))
return;
foreach ( statName, statVal in self.bufferedStats )
{
self setPlayerData( statName, statVal );

View File

@ -609,6 +609,8 @@ getSpawnpoint_NearTeam( spawnpoints, favoredspawnpoints )
obj = spawnstruct();
alliedDistanceWeight = 2;
if ( getDVar( "scr_alliedDistanceWeight" ) != "" )
alliedDistanceWeight = getDVarFloat( "scr_alliedDistanceWeight" );
//prof_begin(" spawn_basicsumdists");
myTeam = self.team;

View File

@ -1572,13 +1572,16 @@ setClaymoreTeamHeadIcon( team )
{
self endon( "death" );
if ( self.weaponname == "claymore_mp" && !level.allowExtendedClaymoreTrace )
if ( isDefined( self.weaponname ) && self.weaponname == "claymore_mp" && !level.allowExtendedClaymoreTrace )
{
self waittill( "missile_stuck" );
self waittill( "claymore_trace_fixed" );
}
else
wait 0.05;
if ( !isDefined( self ) )
return;
if ( isDefined( self.entityHeadIcon ) )
{
@ -2689,6 +2692,42 @@ detach_hip_weapon()
}
FixHideTagList( hideTagList, stowWeapon )
{
answer = [];
for ( i = 0; i < hideTagList.size; i++ )
{
tag = hideTagList[ i ];
if ( stowWeapon == "weapon_ak74u" )
{
if ( tag == "tag_reflex_sight" || tag == "tag_acog" || tag == "tag_ak47_mount" )
continue;
}
else if ( stowWeapon == "weapon_ak47_classic" )
{
if ( tag == "tag_reflex_sight" || tag == "tag_acog" || tag == "tag_ak47_mount" )
continue;
}
else if ( stowWeapon == "worldmodel_bo2_peacekeeper" )
{
if ( tag == "tag_holo" || tag == "tag_reflex" || tag == "tag_silencer" )
continue;
}
else if ( stowWeapon == "weapon_beretta" )
{
if ( tag == "tag_knife" )
continue;
}
answer[ answer.size ] = tag;
}
return answer;
}
stow_on_back()
{
prof_begin( "stow_on_back" );
@ -2778,6 +2817,8 @@ stow_on_back()
prof_end( "stow_on_back" );
return;
}
hideTagList = FixHideTagList( hideTagList, self.tag_stowed_back );
for ( i = 0; i < hideTagList.size; i++ )
self HidePart( hideTagList[ i ], self.tag_stowed_back );
@ -2815,6 +2856,8 @@ stow_on_hip()
if ( !isDefined( hideTagList ) )
return;
hideTagList = FixHideTagList( hideTagList, self.tag_stowed_hip );
for ( i = 0; i < hideTagList.size; i++ )
self HidePart( hideTagList[ i ], self.tag_stowed_hip );

View File

@ -0,0 +1,454 @@
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
/*
VIP
Objective: Escort the VIP to safety, or eliminate the VIP beofore he reaches extraction
Map ends: When one team eliminates the enemy team, or the flag is reached
Respawning: Beginning of next round
Level requirementss
------------------
Spawnpoints:
classname mp_tdm_spawn
Spectator Spawnpoints:
classname mp_global_intermission
*/
main()
{
if(getdvar("mapname") == "mp_background")
return;
maps\mp\gametypes\_globallogic::init();
maps\mp\gametypes\_callbacksetup::SetupCallbacks();
maps\mp\gametypes\_globallogic::SetupCallbacks();
registerRoundSwitchDvar( level.gameType, 0, 0, 9 );
registerTimeLimitDvar( level.gameType, 10, 0, 1440 );
registerScoreLimitDvar( level.gameType, 500, 0, 5000 );
registerRoundLimitDvar( level.gameType, 1, 0, 10 );
registerWinLimitDvar( level.gameType, 1, 0, 10 );
registerRoundSwitchDvar( level.gameType, 3, 0, 30 );
registerNumLivesDvar( level.gameType, 1, 0, 10 );
registerWatchDvarInt( "halftime", 0 );
level.teamBased = true;
level.objectiveBased = true;
level.onPrecacheGameType = ::onPrecacheGameType;
level.onStartGameType = ::onStartGameType;
level.getSpawnPoint = ::getSpawnPoint;
level.onSpawnPlayer = ::onSpawnPlayer;
level.onNormalDeath = ::onNormalDeath;
level.onPlayerKilled = ::onPlayerKilled;
level.onDeadEvent = ::onDeadEvent;
game["dialog"]["gametype"] = "VIP";
}
onPrecacheGameType()
{
precacheShader( "compass_waypoint_captureneutral" );
precacheShader( "compass_waypoint_capture" );
precacheShader( "compass_waypoint_defend" );
precacheShader( "waypoint_captureneutral" );
precacheShader( "waypoint_capture" );
precacheShader( "waypoint_defend" );
precacheString( &"MP_ELIMINATED_VIP" );
precacheString( &"MP_DEFENDED_VIP" );
precacheString( &"SPLASHES_VIP" );
game["flagmodels"] = [];
game["flagmodels"]["neutral"] = "prop_flag_neutral";
game["flagmodels"]["allies"] = maps\mp\gametypes\_teams::getTeamFlagModel( "allies" );
game["flagmodels"]["axis"] = maps\mp\gametypes\_teams::getTeamFlagModel( "axis" );
precacheModel( game["flagmodels"]["neutral"] );
precacheModel( game["flagmodels"]["allies"] );
precacheModel( game["flagmodels"]["axis"] );
}
onStartGameType()
{
setClientNameMode("auto_change");
if ( !isdefined( game["switchedsides"] ) )
game["switchedsides"] = false;
if ( game["switchedsides"] )
{
oldAttackers = game["attackers"];
oldDefenders = game["defenders"];
game["attackers"] = oldDefenders;
game["defenders"] = oldAttackers;
}
setObjectiveText( "allies", &"OBJECTIVES_VIP" );
setObjectiveText( "axis", &"OBJECTIVES_VIP" );
if ( level.splitscreen )
{
setObjectiveScoreText( "allies", &"OBJECTIVES_VIP" );
setObjectiveScoreText( "axis", &"OBJECTIVES_VIP" );
}
else
{
setObjectiveScoreText( "allies", &"OBJECTIVES_VIP_SCORE" );
setObjectiveScoreText( "axis", &"OBJECTIVES_VIP_SCORE" );
}
setObjectiveHintText( "allies", &"OBJECTIVES_VIP_HINT" );
setObjectiveHintText( "axis", &"OBJECTIVES_VIP_HINT" );
level.spawnMins = ( 0, 0, 0 );
level.spawnMaxs = ( 0, 0, 0 );
maps\mp\gametypes\_spawnlogic::placeSpawnPoints( "mp_tdm_spawn_allies_start" );
maps\mp\gametypes\_spawnlogic::placeSpawnPoints( "mp_tdm_spawn_axis_start" );
maps\mp\gametypes\_spawnlogic::addSpawnPoints( "allies", "mp_tdm_spawn" );
maps\mp\gametypes\_spawnlogic::addSpawnPoints( "axis", "mp_tdm_spawn" );
level.mapCenter = maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs );
setMapCenter( level.mapCenter );
allowed[0] = "vip";
allowed[1] = "sd";
allowed[2] = "airdrop_pallet";
allowed[3] = "gtnw";
allowed[4] = "gtnw_zone";
//maps\mp\gametypes\_rank::registerScoreInfo( "capture", 200 );
maps\mp\gametypes\_gameobjects::main(allowed);
self thread waitToProcess();
}
waitToProcess()
{
level endon( "game_end" );
level endon( "waitSkipped" );
self thread extractionZone();
self thread skipWait();
gameFlagWait( "prematch_done" );
gameFlagWait( "graceperiod_done" );
self notify( "graceComplete" );
self thread vipSelection();
}
skipWait()
{
self endon( "graceComplete" );
for(;;)
{
if( level.players.size > 2 )
break;
wait( .5 );
}
self notify( "waitSkipped" );
self thread vipSelection();
}
getSpawnPoint()
{
spawnteam = self.pers["team"];
if ( game["switchedsides"] )
spawnteam = getOtherTeam( spawnteam );
if ( level.inGracePeriod )
{
spawnPoints = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_tdm_spawn_" + spawnteam + "_start" );
spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random( spawnPoints );
}
else
{
spawnPoints = maps\mp\gametypes\_spawnlogic::getTeamSpawnPoints( spawnteam );
spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_NearTeam( spawnPoints );
}
return spawnPoint;
}
onSpawnPlayer()
{
self.isVip = false;
self.usingObj = undefined;
level notify ( "spawned_player" );
}
onNormalDeath( victim, attacker, lifeId )
{
score = maps\mp\gametypes\_rank::getScoreInfoValue( "kill" );
assert( isDefined( score ) );
attacker maps\mp\gametypes\_gamescore::giveTeamScoreForObjective( attacker.pers["team"], score );
team = victim.team;
if ( isDefined( victim.isVip ) && victim.isVip )
{
level thread vip_endGame( game["attackers"], &"MP_ELIMINATED_VIP" );
attacker.finalKill = true;
}
}
onPlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration, killId)
{
thread checkAllowSpectating();
}
onTimeLimit()
{
if ( game["status"] == "overtime" )
{
winner = "forfeit";
}
else if ( game["teamScores"]["allies"] == game["teamScores"]["axis"] )
{
winner = "overtime";
}
else if ( game["teamScores"]["axis"] > game["teamScores"]["allies"] )
{
winner = "axis";
}
else
{
winner = "allies";
}
thread maps\mp\gametypes\_gamelogic::endGame( winner, game["strings"]["time_limit_reached"] );
}
checkAllowSpectating()
{
wait ( 0.05 );
update = false;
if ( !level.aliveCount[ game["attackers"] ] )
{
level.spectateOverride[game["attackers"]].allowEnemySpectate = 1;
update = true;
}
if ( !level.aliveCount[ game["defenders"] ] )
{
level.spectateOverride[game["defenders"]].allowEnemySpectate = 1;
update = true;
}
if ( update )
maps\mp\gametypes\_spectating::updateSpectateSettings();
}
onDeadEvent( team )
{
if ( team == game["attackers"] )
{
level thread vip_endGame( game["defenders"], game["strings"][game["attackers"]+"_eliminated"] );
}
else if ( team == game["defenders"] )
{
level thread vip_endGame( game["attackers"], game["strings"][game["defenders"]+"_eliminated"] );
}
}
vip_endGame( winningTeam, endReasonText )
{
thread maps\mp\gametypes\_gamelogic::endGame( winningTeam, endReasonText );
}
vipSelection()
{
println( "SELECTION" );
potentialVIPs = [];
abortTime = 0;
for( ;; )
{
if ( level.players.size >= 2 )
break;
if ( abortTime >= 100 )
{
iPrintlnBold( "Game mode only playable with 2 or more players" );
wait( 2 );
maps\mp\gametypes\_callbacksetup::AbortLevel();
}
abortTime++;
wait( .1 );
}
foreach ( player in level.players )
{
if ( player.team == game["defenders"] )
potentialVIPs[ potentialVIPs.size ] = player;
}
selectedVIPNum = RandomIntRange( 0, potentialVIPs.size );
selectedPlayer = potentialVIPs[ selectedVIPNum ];
if ( !isAlive(selectedPlayer ) && !isSubStr( selectedPlayer.guid, "bot" ) )
selectedPlayer forceVIPSpawn();
setupVip( selectedPlayer );
}
setupVip ( vipPlayer )
{
vipPlayer TakeAllWeapons();
vipPlayer _clearPerks();
vipPlayer.isVip = true;
vipPlayer giveWeapon( "deserteagle_fmj_mp" );
vipPlayer giveStartAmmo( "deserteagle_fmj_mp" );
vipPlayer giveWeapon( "riotshield_mp" );
vipPlayer switchToWeapon( "riotshield_mp" );
vipPlayer _setPerk( "specialty_armorvest" );
vipPlayer _setPerk( "specialty_finalstand" );
vipPlayer iPrintlnBold( "You Are the VIP" );
//TO DO: add defend icon on the VIP
}
extractionZone()
{
extractionZones = getEntArray("extraction_vip", "targetname");
// check to see if zone is available.
if ( !extractionZones.size )
{
println("WARNING: no extraction zone specified" );
printLn( "^1Not enough extraction zones found in level!" );
extractionZones = getEntArray( "gtnw_zone", "targetname" );
if (!extractionZones.size)
{
maps\mp\gametypes\_callbacksetup::AbortLevel();
return;
}
}
trigger = extractionZones[0];
if ( isDefined( trigger.target ) )
{
visuals[0] = getEnt( trigger.target, "targetname" );
}
else
{
visuals[0] = spawn( "script_model", trigger.origin );
visuals[0].angles = trigger.angles;
}
extractionZone = maps\mp\gametypes\_gameobjects::createUseObject( game["defenders"], trigger, visuals, (0,0,100) );
extractionZone maps\mp\gametypes\_gameobjects::allowUse( "friendly" );
extractionZone maps\mp\gametypes\_gameobjects::setVisibleTeam( "none" );
extractionZone maps\mp\gametypes\_gameobjects::setUseText( &"MP_CALLING_EXTRACTION" );
extractionZone maps\mp\gametypes\_gameobjects::setUseTime( 0 );
extractionZone.onUse = ::onUse;
extractionZone.onCantUse = ::onCantUse;
traceStart = trigger.origin + (0,0,32);
traceEnd = trigger.origin + (0,0,-32);
trace = bulletTrace( traceStart, traceEnd, false, undefined );
fx = maps\mp\gametypes\_teams::getTeamFlagFX( game["defenders"] );
fxid = loadfx( fx );
upangles = vectorToAngles( trace["normal"] );
forward = anglesToForward( upangles );
right = anglesToRight( upangles );
thread spawnFxDelay( fxid, trace["position"], forward, right, 0.5 );
extractionZone maps\mp\gametypes\_gameobjects::set2DIcon( "friendly", "compass_waypoint_defend");
extractionZone maps\mp\gametypes\_gameobjects::set3DIcon( "friendly", "waypoint_defend");
extractionZone maps\mp\gametypes\_gameobjects::setVisibleTeam( "friendly" );
level.extractionZone = extractionZone;
}
setVIPUse()
{
foreach (player in level.players)
{
if ( ! player.isVip )
self.trigger disablePlayerUse(player);
}
}
onUse( player )
{
if ( !isDefined( player.isVip ) || ! player.isVip )
{
return;
}
iPrintlnBold( "Extraction on its way" );
self handleTimer( player );
}
handleTimer( player )
{
player endon( "death" );
level endon( "game_end" );
level.extractionTime = 45;
maps\mp\gametypes\_gamelogic::pauseTimer();
level.timeLimitOverride = true;
setGameEndTime( int( getTime() + (level.extractionTime * 1000) ) );
wait level.extractionTime;
//call the sentry airdrops
level thread vip_endGame( game["defenders"], &"MP_DEFENDED_VIP" );
}
onEndUse( team, player, success )
{
println( "End Use" );
}
onCantUse( player )
{
// player iPrintLnBold( &"MP_CANT_PLANT_WITHOUT_BOMB" );
}
spawnFxDelay( fxid, pos, forward, right, delay )
{
wait delay;
effect = spawnFx( fxid, pos, forward, right );
triggerFx( effect );
}
forceVIPSpawn()
{
self endon ( "death" );
self endon ( "disconnect" );
self endon ( "spawned" );
if ( self.hasSpawned )
return;
if ( !isValidClass( self.pers["class"] ) )
{
self.pers["class"] = "CLASS_CUSTOM1";
self.class = self.pers["class"];
}
self closeMenus();
self thread maps\mp\gametypes\_playerlogic::spawnClient();
}

View File

@ -231,8 +231,10 @@ waitForChangeTeam()
for ( ;; )
{
self waittill ( "joined_team" );
clearKillstreaks();
self clearUsingRemote();
self clearKillstreaks();
if ( self isUsingRemote() )
self clearUsingRemote();
}
}
@ -702,8 +704,11 @@ giveKillstreakWeapon( weapon )
self takeWeapon( item );
}
self _giveWeapon( weapon, 0 );
self _setActionSlot( 4, "weapon", weapon );
if ( isDefined( weapon ) && weapon != "" )
{
self _giveWeapon( weapon, 0 );
self _setActionSlot( 4, "weapon", weapon );
}
}
@ -858,7 +863,9 @@ clearRideIntro( delay )
destroyOnEvents(elem)
{
self waittill_either("disconnect", "start_killstreak_hud");
elem destroy();
if ( isDefined( elem ) )
elem destroy();
}
initKillstreakHud(inity)

View File

@ -629,8 +629,12 @@ selectOneManArmyClass()
level endon ( "game_ended" );
self _disableWeaponSwitch();
self _disableOffhandWeapons();
self _disableUsability();
if (level.fix_onemanarmyFlareBug)
{
self _disableOffhandWeapons();
self _disableUsability();
}
self openPopupMenu( game["menu_onemanarmy"] );
@ -639,22 +643,34 @@ selectOneManArmyClass()
self waittill ( "menuresponse", menu, className );
self _enableWeaponSwitch();
self _enableOffhandWeapons();
self _enableUsability();
if (level.fix_onemanarmyFlareBug)
{
self _enableOffhandWeapons();
self _enableUsability();
}
if ( className == "back" || !isOneManArmyMenu( menu ) || self isUsingRemote() )
{
if ( self getCurrentWeapon() == "onemanarmy_mp" )
{
self _disableWeaponSwitch();
self _disableOffhandWeapons();
self _disableUsability();
if (level.fix_onemanarmyFlareBug)
{
self _disableOffhandWeapons();
self _disableUsability();
}
self switchToWeapon( self getLastWeapon() );
self waittill ( "weapon_change" );
self _enableWeaponSwitch();
self _enableOffhandWeapons();
self _enableUsability();
if (level.fix_onemanarmyFlareBug)
{
self _enableOffhandWeapons();
self _enableUsability();
}
}
return;
}

View File

@ -12,6 +12,9 @@
- onemanarmyRefillsTubes <bool>
false - (default) One Man Army does not refill the gl attachment
true - it does
- fix_onemanarmyFlareBug <bool>
true - (default) fixes it
*/
#include common_scripts\utility;
@ -200,6 +203,9 @@ init()
setDvarIfUninitialized( "onemanarmyRefillsTubes", false );
level.onemanarmyRefillsTubes = getDvarInt( "onemanarmyRefillsTubes" );
setDvarIfUninitialized( "fix_onemanarmyFlareBug", true );
level.fix_onemanarmyFlareBug = getDvarInt( "fix_onemanarmyFlareBug" );
initPerkDvars();
level thread onPlayerConnect();

View File

@ -0,0 +1,4 @@
init()
{
level thread maps\mp\bots\_bot_chat::init();
}

View File

@ -24,64 +24,69 @@ init()
watchSniper()
{
if (getDvar("bot_sniperCheck") == "")
if ( getDvar( "bot_sniperCheck" ) == "" )
return;
for (;;)
for ( ;; )
{
wait 15;
logPrint("keepalive\n");
numPlayers = 0;
numSnipers = 0;
for(i = 0; i < level.players.size; i++)
for ( i = 0; i < level.players.size; i++ )
{
player = level.players[i];
if (player is_bot())
if ( player is_bot() )
continue;
if (!isDefined(player.team))
if ( !isDefined( player.team ) )
continue;
numPlayers++;
if (isDefined(player.isSniper) && player.isSniper)
if ( isDefined( player.isSniper ) && player.isSniper )
numSnipers++;
}
if (numPlayers > 0)
if ( numPlayers > 0 )
{
if (numSnipers / numPlayers >= 0.5)
setDvar("bots_sniperLoadout", 1);
if ( numSnipers / numPlayers >= 0.5 )
setDvar( "bots_sniperLoadout", 1 );
else
setDvar("bots_sniperLoadout", 0);
setDvar( "bots_sniperLoadout", 0 );
}
}
}
watchNuke()
{
setDvar("scr_spawnpointfavorweight", "");
level waittill( "nuke_death" );
setDvar("scr_spawnpointfavorweight", "499999");
setDvar( "scr_spawnpointfavorweight", "" );
for ( i = 0; i < 3; i++ )
level waittill( "nuke_death" );
setDvar( "scr_spawnpointfavorweight", "499999" );
}
watchBoxmap()
{
if (getDvar("mapname") == "iw4_credits")
setDvar("scr_spawnsimple", 1);
if ( getDvar( "mapname" ) == "iw4_credits" )
setDvar( "scr_spawnsimple", 1 );
else
setDvar("scr_spawnsimple", 0);
setDvar( "scr_spawnsimple", 0 );
}
watchBotCrackedClass()
{
if(getDvar("bot_pvb_helper_customBotClassTeam") == "")
setDvar("bot_pvb_helper_customBotClassTeam", "");
if ( getDvar( "bot_pvb_helper_customBotClassTeam" ) == "" )
setDvar( "bot_pvb_helper_customBotClassTeam", "" );
for (;;)
for ( ;; )
{
level waittill("bot_connected", bot);
level waittill( "bot_connected", bot );
bot thread watchBotLoadout();
}
@ -89,20 +94,20 @@ watchBotCrackedClass()
watchBotLoadout()
{
self endon("disconnect");
self endon( "disconnect" );
random = randomInt(2);
random = randomInt( 2 );
for (;;)
for ( ;; )
{
self waittill("bot_giveLoadout");
self waittill( "bot_giveLoadout" );
team = getDvar("bot_pvb_helper_customBotClassTeam");
team = getDvar( "bot_pvb_helper_customBotClassTeam" );
if (team == "")
if ( team == "" )
continue;
if (self.team != team)
if ( self.team != team )
continue;
// clear perks and weapons
@ -121,7 +126,8 @@ watchBotLoadout()
self maps\mp\perks\_perks::givePerk( "semtex_mp" );
twoStreak = "helicopter_minigun";
if (random)
if ( random )
twoStreak = "ac130";
self maps\mp\gametypes\_class::setKillstreaks( "harrier_airstrike", twoStreak, "nuke" );
@ -137,27 +143,29 @@ watchBotLoadout()
watchTeams()
{
if(getDvar("bot_pvb_helper_noPlayersOnTeam") == "")
setDvar("bot_pvb_helper_noPlayersOnTeam", "");
if ( getDvar( "bot_pvb_helper_noPlayersOnTeam" ) == "" )
setDvar( "bot_pvb_helper_noPlayersOnTeam", "" );
for (;;)
for ( ;; )
{
wait 1;
if (getDvar("bot_pvb_helper_noPlayersOnTeam") == "")
if ( getDvar( "bot_pvb_helper_noPlayersOnTeam" ) == "" )
continue;
team = getDvar("bot_pvb_helper_noPlayersOnTeam");
for(i = 0; i < level.players.size; i++)
team = getDvar( "bot_pvb_helper_noPlayersOnTeam" );
for ( i = 0; i < level.players.size; i++ )
{
player = level.players[i];
if (player is_bot())
if ( player is_bot() )
continue;
if (player.team != team)
if ( player.team != team )
continue;
if (team == "axis")
if ( team == "axis" )
player [[level.allies]]();
else
player [[level.axis]]();
@ -167,40 +175,42 @@ watchTeams()
onBotSayVar()
{
SetDvar("bot_say", "");
for (;;)
SetDvar( "bot_say", "" );
for ( ;; )
{
wait 0.05;
toSay = GetDvar("bot_say");
if (toSay == "")
toSay = GetDvar( "bot_say" );
if ( toSay == "" )
continue;
bot = random(getBotArray());
bot = random( getBotArray() );
if (!isDefined(bot))
if ( !isDefined( bot ) )
continue;
SetDvar("bot_say", "");
bot sayall(toSay);
SetDvar( "bot_say", "" );
bot sayall( toSay );
}
}
onSomeoneSaid()
{
for (;;)
for ( ;; )
{
level waittill("say", string, player);
level waittill( "say", string, player );
PrintConsole(player.name + ": ^7" + string + "\n");
PrintConsole( player.name + ": ^7" + string + "\n" );
}
}
onBotConnected()
{
for (;;)
for ( ;; )
{
level waittill("bot_connected", bot);
level waittill( "bot_connected", bot );
bot thread setBotPing();
}
@ -208,12 +218,12 @@ onBotConnected()
setBotPing()
{
self endon("disconnect");
self endon( "disconnect" );
for (;;)
for ( ;; )
{
wait 0.05;
self SetPing(randomIntRange(40, 60));
self SetPing( randomIntRange( 40, 60 ) );
}
}

View File

@ -6,15 +6,18 @@
init()
{
setDvarIfUninitialized( "bots_sniperLoadout", false );
setDvarIfUninitialized( "bots_oneHardIsSniper", false );
level thread onBotConnected();
level thread watchOneHardIsSniper();
}
onBotConnected()
{
for (;;)
for ( ;; )
{
level waittill("bot_connected", bot);
level waittill( "bot_connected", bot );
bot thread onBotGivenLoadout();
}
@ -22,43 +25,72 @@ onBotConnected()
onBotGivenLoadout()
{
self endon("disconnect");
self endon( "disconnect" );
for (;;)
for ( ;; )
{
self waittill( "bot_giveLoadout", allowCopycat );
if (!getDvarInt("bots_sniperLoadout"))
if ( !getDvarInt( "bots_sniperLoadout" ) )
continue;
self.pers["bots"]["behavior"]["quickscope"] = true;
// clear perks and weapons
self takeAllWeapons();
self.specialty = [];
self _clearPerks();
self maps\mp\gametypes\_class::_detachAll();
// give perks
self maps\mp\perks\_perks::givePerk( "specialty_fastreload" );
self maps\mp\perks\_perks::givePerk( "specialty_quickdraw" );
self maps\mp\perks\_perks::givePerk( "specialty_bulletdamage" );
self maps\mp\perks\_perks::givePerk( "specialty_armorpiercing" );
self maps\mp\perks\_perks::givePerk( "specialty_bulletaccuracy" );
self maps\mp\perks\_perks::givePerk( "specialty_holdbreath" );
// give weapons
self _giveWeapon( "usp_mp", 0 );
self SetWeaponAmmoClip( "usp_mp", 0 );
self SetWeaponAmmoStock( "usp_mp", 0 );
self _giveWeapon( "cheytac_mp", 0 );
self setSpawnWeapon( "cheytac_mp" );
// make into sniper model
if ( level.environment != "" )
self [[game[self.team+"_model"]["GHILLIE"]]]();
else
self [[game[self.team+"_model"]["SNIPER"]]]();
self give_sniper_loadout();
}
}
watchOneHardIsSniper()
{
for(;;)
{
wait 1;
if ( !getDvarInt( "bots_oneHardIsSniper" ) )
continue;
foreach (bot in level.bots)
{
if (bot.pers["bots"]["skill"]["base"] >= 7)
{
if (isAlive(bot) && !bot.isSniper)
bot give_sniper_loadout();
break;
}
}
}
}
give_sniper_loadout()
{
self.pers["bots"]["behavior"]["quickscope"] = true;
// clear perks and weapons
self takeAllWeapons();
self.specialty = [];
self _clearPerks();
self maps\mp\gametypes\_class::_detachAll();
// give perks
self maps\mp\perks\_perks::givePerk( "specialty_fastreload" );
self maps\mp\perks\_perks::givePerk( "specialty_quickdraw" );
self maps\mp\perks\_perks::givePerk( "specialty_bulletdamage" );
self maps\mp\perks\_perks::givePerk( "specialty_armorpiercing" );
self maps\mp\perks\_perks::givePerk( "specialty_bulletaccuracy" );
self maps\mp\perks\_perks::givePerk( "specialty_holdbreath" );
// give weapons
self _giveWeapon( "usp_mp", 0 );
self SetWeaponAmmoClip( "usp_mp", 0 );
self SetWeaponAmmoStock( "usp_mp", 0 );
self _giveWeapon( "cheytac_mp", 0 );
self setSpawnWeapon( "cheytac_mp" );
// make into sniper model
if ( level.environment != "" )
self [[game[self.team + "_model"]["GHILLIE"]]]();
else
self [[game[self.team + "_model"]["SNIPER"]]]();
self.isSniper = true;
}

View File

@ -5,42 +5,52 @@
init()
{
setDvarIfUninitialized( "scr_showHP", false );
level.showHP = getDvarInt("scr_showHP");
level.showHP = getDvarInt( "scr_showHP" );
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;;)
for ( ;; )
{
level waittill( "connected", player);
level waittill( "connected", player );
player thread onPlayerSpawned();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self endon( "disconnect" );
if(level.showHP)
self thread drawHP();
}
for ( ;; )
{
self waittill( "spawned_player" );
if ( level.showHP )
self thread drawHP();
}
}
destoryHPdraw()
{
self waittill_either("disconnect", "death");
self.drawHP destroy();
self endon( "disconnect" );
self waittill( "death" );
if ( isDefined( self.drawHP ) )
self.drawHP destroy();
if ( isDefined( self.drawSpeed ) )
self.drawSpeed destroy();
}
initHPdraw()
{
self.drawHP = self createFontString("default", 1.2);
self.drawHP setPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -150, -20);
self.drawHP = self createFontString( "default", 1.2 );
self.drawHP setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -150, -20 );
self.drawSpeed = self createFontString( "default", 1.2 );
self.drawSpeed setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -150, -10 );
self thread destoryHPdraw();
}
@ -49,10 +59,14 @@ drawHP()
self endon( "disconnect" );
self endon( "death" );
self initHPdraw();
for(;;)
for ( ;; )
{
//self.drawHP setText("HP: "+self.health+" KS: "+self.pers["cur_kill_streak"]);
self.drawHP setText(self.health);
self.drawHP setValue( self.health );
vel = self getVelocity();
self.drawSpeed setValue( int( length( ( vel[0], vel[1], 0 ) ) ) );
wait 0.05;
}
}
}

View File

@ -0,0 +1,71 @@
init()
{
if ( getDvarInt( "spawnpoints_test" ) )
level thread doSpawnPointTest();
}
drawNoSight(sp)
{
newdeathicon = newHudElem();
newdeathicon.x = sp.origin[0];
newdeathicon.y = sp.origin[1];
newdeathicon.z = sp.origin[2] + 32;
newdeathicon.alpha = .61;
newdeathicon.archived = true;
newdeathicon setShader( "headicon_dead", 5, 5 );
newdeathicon setwaypoint( true, false );
if (isDefined(sp.wp))
sp.wp destroy();
sp.wp = newdeathicon;
}
drawSight(sp)
{
newdeathicon = newHudElem();
newdeathicon.x = sp.origin[0];
newdeathicon.y = sp.origin[1];
newdeathicon.z = sp.origin[2] + 32;
newdeathicon.alpha = .61;
newdeathicon.archived = true;
newdeathicon setShader( "rank_prestige1", 5, 5 );
newdeathicon setwaypoint( true, false );
if (isDefined(sp.wp))
sp.wp destroy();
sp.wp = newdeathicon;
}
doSpawnPointTest()
{
for ( ;; )
{
wait 0.05;
if ( !isdefined( level.spawnpoints ) )
return;
for (i = 0; i < level.spawnpoints.size; i++)
{
spawnpoint = level.spawnpoints[i];
sight = false;
if (level.teamBased)
{
sight = (spawnpoint.sights["axis"] > 0);
if (!sight)
sight = (spawnpoint.sights["allies"] > 0);
}
else
sight = (spawnpoint.sights > 0);
if (!sight)
drawNoSight(spawnpoint);
else
drawSight(spawnpoint);
}
}
}

View File

@ -0,0 +1,70 @@
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
init()
{
setDvarIfUninitialized( "dom_lastFlagUseTimeMulti", 1.0 );
thread watchFlags();
}
watchFlags()
{
if ( getDvar( "g_gametype" ) != "dom" )
return;
while ( !isDefined( level.domFlags ) )
wait 0.05;
for ( ;; )
{
wait 1;
for ( i = 0; i < level.domFlags.size; i++ )
{
flag = level.domFlags[i];
if ( isDefined( flag.originalUseTime ) )
{
flag.useTime = flag.originalUseTime;
flag.originalUseTime = undefined;
}
}
team = "none";
axisFlags = maps\mp\gametypes\dom::getTeamFlagCount( "axis" );
alliesFlags = maps\mp\gametypes\dom::getTeamFlagCount( "allies" );
if ( alliesFlags == 2 || axisFlags == 2 )
{
if ( alliesFlags == 2 )
team = "allies";
else
team = "axis";
}
if ( game["teamScores"]["axis"] < game["teamScores"]["allies"] && team == "axis" )
continue;
if ( game["teamScores"]["allies"] < game["teamScores"]["axis"] && team == "allies" )
continue;
if ( team != "none" )
{
for ( i = 0; i < level.domFlags.size; i++ )
{
flag = level.domFlags[i];
flagTeam = flag maps\mp\gametypes\_gameobjects::getOwnerTeam();
if ( flagTeam != team && ( flagTeam == "axis" || flagTeam == "allies" ) )
{
flag.originalUseTime = flag.useTime;
flag.useTime *= getDvarFloat( "dom_lastFlagUseTimeMulti" );
}
}
}
}
}

View File

@ -1 +0,0 @@
start "" "%~dp0iw4x.exe" -nosteam -scriptablehttp -console +set r_fullscreen "0" +set sv_lanonly "1" +set r_mode "1024x768" +set drawlagometer "1" +set cg_drawfps "4" +set fs_game "" +set bots_manage_fill "4" +set cg_drawsnapshot "1" +set ui_mapname "mp_rust" +set scr_game_spectatetype "2" +set scr_war_scorelimit "0" +set thereisacow "1" +set sv_cheats "1" +devmap mp_rust

View File

@ -1 +0,0 @@
start "" "%~dp0iw4x.exe" -nosteam -scriptablehttp +set r_fullscreen "1" +set sv_lanonly "1" +set r_monitor "0" +set drawlagometer "0" +set cg_drawfps "0" +set cg_drawsnapshot "0" +set r_mode "1920x1080"

1
z_deploy.bat Normal file
View File

@ -0,0 +1 @@
start "" "node" deploy.js

View File

@ -1 +0,0 @@
start "" "%~dp0iw4x.exe" -nosteam -dump -console -scriptablehttp +set sv_lanonly "1" +set r_fullscreen "0" +set fs_game "mods/dev" +set developer "1" +set developer_script "1" +set cg_drawfps "4" +set cg_drawsnapshot "1" +set thereisacow "1" +set sv_cheats "1" +set bots_manage_add "0" +set drawlagometer "1" +set scr_game_spectatetype "2" +set r_mode "1024x768" +devmap mp_rust

View File

@ -1 +0,0 @@
start "" "%~dp0iw4x.exe" -nosteam -console -dump -scriptablehttp +set sv_lanonly "1" +set r_fullscreen "0" +set fs_game "mods/dev" +set developer "1" +set developer_script "1" +set cg_drawfps "4" +set cg_drawsnapshot "1" +set thereisacow "1" +set sv_cheats "1" +set drawlagometer "1" +set r_mode "1024x768" +connect 127.0.0.1

View File

@ -1 +1,26 @@
start "" "%~dp0iw4x.exe" -dedicated +set sv_lanonly "0" +set net_port "28960" +set fs_game "" +exec server.cfg +map_rotate
@echo off
::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=IW4x Bot Warfare Server
::Port used by the server (default: 28960)
set port=28960
::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%
title IW4x 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%" "%~dp0iw4x.exe" -dedicated +set sv_lanonly "0" +set net_ip "%ip%" +set net_port "%port%" +set rcon_password "%rcon_password%" +set fs_game "%mod%" +exec "%cfg%" +map_rotate
echo (%date%) - (%time%) WARNING: %name% server closed or dropped... server restarts.
goto Server

View File

@ -1 +1,26 @@
start "" "%~dp0iw4x.exe" -dedicated +set sv_lanonly "0" +set net_port "28960" +set fs_game "" +exec pvbrust.cfg +map_rotate
@echo off
::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=pvbrust.cfg
::Name of the server shown in the title of the cmd window. This will NOT bet shown ingame.
set name=IW4x Bot Warfare PvB Rust
::Port used by the server (default: 28960)
set port=28965
::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%
title IW4x 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%" "%~dp0iw4x.exe" -dedicated +set sv_lanonly "0" +set net_ip "%ip%" +set net_port "%port%" +set rcon_password "%rcon_password%" +set fs_game "%mod%" +exec "%cfg%" +map_rotate
echo (%date%) - (%time%) WARNING: %name% server closed or dropped... server restarts.
goto Server

View File

@ -0,0 +1,40 @@
@echo off
::Name
set name=IW4x Bot Warfare PvB Rust
::Exe of the server
set server_exe=iw4x.exe
::The regex search for the window name of the server
set server_title_regex=Bot Warfare Players vs bots 24/7 Rust 10x
::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%
::Rate to check if server is hung
set check_rate=300
::Server log location
set log_path=%gamepath%\userraw\logs\pvbrust
set log_file=games_mp.log
title IW4x MP - %name% - Server watchdog
echo Visit plutonium.pw / Join the Discord (a6JM2Tv) for NEWS and Updates!
echo (%date%) - (%time%) %name% server watchdog start.
::https://superuser.com/questions/699769/batch-file-last-modification-time-with-seconds
dir "%log_path%"\"%log_file%" > nul
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
:Server
set modif_time=%modif_time_temp%
timeout /t %check_rate% /nobreak > nul
dir "%log_path%"\"%log_file%" > nul
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
if "%modif_time_temp%" == "%modif_time%" (
echo "(%date%) - (%time%) WARNING: %name% server hung, killing server..."
::https://stackoverflow.com/questions/26552368/windows-batch-file-taskkill-if-window-title-contains-text
for /f "tokens=2 delims=," %%a in ('
tasklist /fi "imagename eq %server_exe%" /v /fo:csv /nh
^| findstr /r /c:"%server_title_regex%"
') do taskkill /pid %%a /f
)
goto Server

View File

@ -1 +1,26 @@
start "" "%~dp0iw4x.exe" -dedicated +set sv_lanonly "0" +set net_port "28960" +set fs_game "mods/pvb" +exec pvbvote.cfg +map_rotate
@echo off
::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=pvbvote.cfg
::Name of the server shown in the title of the cmd window. This will NOT bet shown ingame.
set name=IW4x Bot Warfare PvB Vote
::Port used by the server (default: 28960)
set port=28966
::What ip to bind too
set ip=0.0.0.0
::Mod name (default "")
set mod=mods/pvb
::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%
title IW4x 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%" "%~dp0iw4x.exe" -dedicated +set sv_lanonly "0" +set net_ip "%ip%" +set net_port "%port%" +set rcon_password "%rcon_password%" +set fs_game "%mod%" +exec "%cfg%" +map_rotate
echo (%date%) - (%time%) WARNING: %name% server closed or dropped... server restarts.
goto Server

View File

@ -0,0 +1,40 @@
@echo off
::Name
set name=IW4x Bot Warfare PvB Vote
::Exe of the server
set server_exe=iw4x.exe
::The regex search for the window name of the server
set server_title_regex=Bot Warfare Players vs bots Mapvote 10x
::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%
::Rate to check if server is hung
set check_rate=300
::Server log location
set log_path=%gamepath%\mods\pvb\logs\pvbvote
set log_file=games_mp.log
title IW4x MP - %name% - Server watchdog
echo Visit plutonium.pw / Join the Discord (a6JM2Tv) for NEWS and Updates!
echo (%date%) - (%time%) %name% server watchdog start.
::https://superuser.com/questions/699769/batch-file-last-modification-time-with-seconds
dir "%log_path%"\"%log_file%" > nul
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
:Server
set modif_time=%modif_time_temp%
timeout /t %check_rate% /nobreak > nul
dir "%log_path%"\"%log_file%" > nul
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
if "%modif_time_temp%" == "%modif_time%" (
echo "(%date%) - (%time%) WARNING: %name% server hung, killing server..."
::https://stackoverflow.com/questions/26552368/windows-batch-file-taskkill-if-window-title-contains-text
for /f "tokens=2 delims=," %%a in ('
tasklist /fi "imagename eq %server_exe%" /v /fo:csv /nh
^| findstr /r /c:"%server_title_regex%"
') do taskkill /pid %%a /f
)
goto Server

40
z_server_watchdog.bat Normal file
View File

@ -0,0 +1,40 @@
@echo off
::Name
set name=IW4x Bot Warfare Server
::Exe of the server
set server_exe=iw4x.exe
::The regex search for the window name of the server
set server_title_regex=Bot Warfare 24/7 Rust 10x
::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%
::Rate to check if server is hung
set check_rate=300
::Server log location
set log_path=%gamepath%\userraw\logs\server
set log_file=games_mp.log
title IW4x MP - %name% - Server watchdog
echo Visit plutonium.pw / Join the Discord (a6JM2Tv) for NEWS and Updates!
echo (%date%) - (%time%) %name% server watchdog start.
::https://superuser.com/questions/699769/batch-file-last-modification-time-with-seconds
dir "%log_path%"\"%log_file%" > nul
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
:Server
set modif_time=%modif_time_temp%
timeout /t %check_rate% /nobreak > nul
dir "%log_path%"\"%log_file%" > nul
for /f "delims=" %%i in ('"forfiles /p "%log_path%" /m "%log_file%" /c "cmd /c echo @ftime" "') do set modif_time_temp=%%i
if "%modif_time_temp%" == "%modif_time%" (
echo "(%date%) - (%time%) WARNING: %name% server hung, killing server..."
::https://stackoverflow.com/questions/26552368/windows-batch-file-taskkill-if-window-title-contains-text
for /f "tokens=2 delims=," %%a in ('
tasklist /fi "imagename eq %server_exe%" /v /fo:csv /nh
^| findstr /r /c:"%server_title_regex%"
') do taskkill /pid %%a /f
)
goto Server

View File

@ -1 +0,0 @@
start "" "%~dp0iw4x.exe" -dedicated -console -dump +set sv_lanonly "1" +set fs_game "mods/dev" +set net_port "28960" +set developer "1" +set developer_script "1" +set scr_game_spectatetype "2" scr_war_scorelimit "0" +set thereisacow "1" +set sv_cheats "1" +set logfile "2" +set bots_manage_add "8" +set bots_main_firstIsHost "1" +devmap mp_rust