Giter VIP home page Giter VIP logo

Comments (1)

HarleySalas avatar HarleySalas commented on July 28, 2024

If you go to your mods/bots folder and open the z_svr_bots.iwd with winrar/7-zip and then proceed to navigate to maps/mp/bots/ and open _bot_script.gsc with a text editor (code editor like vscode preferred), you can change a couple of lines to get rid of them.

ctrl+f/find the following function: chooseRandomPrimary()

You'll see the following code within it:
`
if (!allowOp)
{
if (primary == "riotshield")
continue;
}

	if (reasonable)
	{
		if (primary == "riotshield")
			continue;
		if (primary == "wa2000")
			continue;
		if (primary == "uzi")
			continue;
		if (primary == "sa80")
			continue;
		if (primary == "fn2000")
			continue;
		if (primary == "m240")
			continue;
		if (primary == "mg4")
			continue;
	}

	if (!self isItemUnlocked(primary))
		continue;

	return primary;

`

the if (!allowOp) and if (reasonable) lines determine that those guns will not be allowed to be added to the pool of guns that will randomly be chosen by a bot, in any instance that you've decided to either disable op weapons, or only allow reasonable weapons. I chose to add the code disabling guns in to the reasonable option, so that any time I only allow reasonable guns to be used, the cod4 guns will be removed. You could also place the code outside of the if statements to disable them entirely. you can replace the original function with the following to copy the same behavior as I've chosen:

`
chooseRandomPrimary()
{
primaries = getPrimaries();
allowOp = (getDvarInt("bots_loadout_allow_op") >= 1);
reasonable = getDvarInt("bots_loadout_reasonable");

while (true)
{
	primary = random(primaries);
	
	if (!allowOp)
	{
		if (primary == "riotshield")
			continue;	
	}

	if (reasonable)
	{
		if (primary == "riotshield")
			continue;
		if (primary == "wa2000")
			continue;
		if (primary == "uzi")
			continue;
		if (primary == "sa80")
			continue;
		if (primary == "fn2000")
			continue;
		if (primary == "m240")
			continue;
		if (primary == "mg4")
			continue;
		if (primary == "ak74u")
			continue;
		if (primary == "peacekeeper")
			continue;
		if (primary == "m40a3")
			continue;
		if (primary == "ak47classic")
			continue;
		if (primary == "dragunov")
			continue;
	}

	if (!self isItemUnlocked(primary))
		continue;

	return primary;
}

}
`

from iw4_bot_warfare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.