PDA

View Full Version : air and heli settings


wraithwingus
05-21-2008, 12:29 AM
I am looking to change how many kills it takes to get air and heli. Anyone know what the setting is for that?

DNX-Bertus
05-21-2008, 04:10 AM
As far as I know, unfortunately it's not possible.

JudgeMental
05-21-2008, 05:31 AM
Au contraire Bertus, it is perfectly possible, the only complication is that you need to make your server a 'custom'server in order to do so. Simplest way is to download a mod like ACE 1.8 or similar. There are a good few out there. They include mutiple config options which enable you to change pretty much anything.
You will need to set your server up using the fs_mod folder but its all described both here and elsewhere. Only drawback with a custom server is that it is correspondingly less 'visible' to n00bs who can't be arsed to alter their filters. You could of course go the whole hog with your custom server and use custom maps and off site download too, but thats more work.
Just to reiterate:
Alter things like helicopter entitlement etc and alter classes? ONLY WITH A CUSTOM SERVER
Can't be done (at least not yet) with COD4 straight out of the box.

DNX-Bertus
05-21-2008, 06:30 AM
I didn't know ACE had this feature. I'm going to check it out, cos my server at the moment runs modwarfare.

wraithwingus
05-21-2008, 08:16 AM
I wont be using a 3rd party mod. My reason behind can be pointed out with the k3 mod. I realize that not everyone does that but my point is unless i write it or see the code i wont use it.

That said. I plan on using the mod warefare that came with the game. I am hoping that there is a setting with in that i can use.

Number7
05-21-2008, 09:21 AM
I wont be using a 3rd party mod. My reason behind can be pointed out with the k3 mod. I realize that not everyone does that but my point is unless i write it or see the code i wont use it.

That said. I plan on using the mod warefare that came with the game. I am hoping that there is a setting with in that i can use.

In modwarfare, open the maps\mp\gametypes\_hardpoints.gsc file, change this section of the init() function:


if ( maps\mp\gametypes\_tweakables::getTweakableValue( "hardpoint", "allowuav" ) )
{
level.hardpointItems["radar_mp"] = priority;
priority++;
}

if ( maps\mp\gametypes\_tweakables::getTweakableValue( "hardpoint", "allowartillery" ) )
{
level.hardpointItems["airstrike_mp"] = priority;
priority++;
}

if ( maps\mp\gametypes\_tweakables::getTweakableValue( "hardpoint", "allowhelicopter" ) )
{
level.hardpointItems["helicopter_mp"] = priority;
priority++;
}


To this:


// Number7
level.svrHardpoints = dvardef("svr_hardpoints", 1, 0, 1, "int");
level.svrAllowUavRadar = dvardef("svr_allowuavradar", 1, 0, 1, "int");
level.svrAllowAirstrike = dvardef("svr_allowairstrike", 1, 0, 1, "int");
level.svrAllowHelicopter = dvardef("svr_allowhelicopter", 1, 0, 1, "int");
level.svrUavRadarStreak = dvardef("svr_uavradarstreak", 3, 1, 99, "int");
level.svrAirstrikeStreak = dvardef("svr_airstrikestreak", 5, 1, 99, "int");
level.svrHelicopterStreak = dvardef("svr_helicopterstreak", 7, 1, 99, "int");
level.radarViewTime = dvardef("svr_radartime", 30, 1, 60, "int");
if (level.svrAllowUavRadar)
{
level.hardpointItems["radar_mp"] = priority;
priority++;
}
if (level.svrAllowAirstrike)
{
level.hardpointItems["airstrike_mp"] = priority;
priority++;
}
if (level.svrAllowHelicopter)
{
level.hardpointItems["helicopter_mp"] = priority;
priority++;
}
//


Then scroll down to the giveHardpointItemForStreak() function and change it from this:


giveHardpointItemForStreak()
{
streak = self.cur_kill_streak;

if ( streak < 3 )
return;

if ( !getDvarInt( "scr_game_forceuav" ) )
{
if ( streak == 3 )
self giveHardpoint( "radar_mp", streak );
else if ( streak == 5 )
self giveHardpoint( "airstrike_mp", streak );
else if ( streak == 7 )
self giveHardpoint( "helicopter_mp", streak );
else if ( streak >= 10 )
{
if ( (streak % 5) == 0 )
self streakNotify( streak );
}
}
else
{
if ( streak == 3 )
{
self giveHardpoint( "airstrike_mp", streak );
}
else if ( streak == 5 )
{
self giveHardpoint( "helicopter_mp", streak );
}
else if ( streak >= 10 )
{
if ( (streak % 5) == 0 )
self streakNotify( streak );
}
}
}


To this:


giveHardpointItemForStreak() // Number7
{
streak = self.cur_kill_streak;

if ( !level.svrHardpoints || streak < 3 )
return;

if ( !getDvarInt( "scr_game_forceuav" ) )
{
if ( streak == level.svrUavRadarStreak && level.svrAllowUavRadar) self giveHardpoint( "radar_mp", streak );
else if ( streak == level.svrAirstrikeStreak && level.svrAllowAirstrike) self giveHardpoint( "airstrike_mp", streak );
else if ( streak == level.svrHelicopterStreak && level.svrAllowHelicopter ) self giveHardpoint( "helicopter_mp", streak );
else if ( streak >= 10 )
{
if ( (streak % 5) == 0 )
self streakNotify( streak );
}
}
else
{
if ( streak == level.svrAirstrikeStreak && level.svrAllowAirstrike ) self giveHardpoint( "airstrike_mp", streak );
else if ( streak == level.svrHelicopterStreak && level.svrAllowHelicopter ) self giveHardpoint( "helicopter_mp", streak );
else if ( streak >= 10 )
{
if ( (streak % 5) == 0 )
self streakNotify( streak );
}
}
}


You'll also need the dvardef function.. Add this to the bottom of the script:


// From Ravir (slightly modified by Number7)
dvardef(vN, vD, min, max, type)
{
mapname = getDvar("mapname"); // "mp_dawnville", "mp_rocket", etc.
gametype = getDvar("g_gametype"); // "tdm", "bel", etc.
gtmap = gametype + "_" + mapname; // "tdm_mp_dawnville"

tV = vN + "_" + gametype; // i.e., scr_teambalance becomes scr_teambalance_tdm
if(getDvar(tV) != "") // if the gametype override is being used
vN = tV; // use the gametype override instead of the standard variable

tV = vN + "_" + mapname; // i.e., scr_teambalance becomes scr_teambalance_mp_dawnville
if(getDvar(tV) != "") // if the map override is being used
vN = tV; // use the map override instead of the standard variable

tV = vN + "_" + gtmap; // i.e., scr_teambalance becomes scr_teambalance_tdm_mp_dawnville
if(getDvar(tV) != "") //
vN = tV; //

// get the variable's definition
switch(type)
{
case "int":
if(getDvar(vN) == "") // if the dvar is blank
def = vD; // set the default
else
def = getDvarInt(vN);
break;
case "float":
if(getDvar(vN) == "") // if the dvar is blank
def = vD; // set the default
else
def = getDvarFloat(vN);
break;
case "string":
default:
if(getDvar(vN) == "") // if the dvar is blank
def = vD; // set the default
else
def = getDvar(vN);
break;
}

// if it's a number, with a minimum, that violates the parameter
if((type == "int" || type == "float") && min != 0 && def < min)
def = min;

// if it's a number, with a maximum, that violates the parameter
if((type == "int" || type == "float") && max != 0 && def > max)
def = max;

return def;
}


Here are the dvars for the config:


////////////////////////////////////////////////////////////////////////////////////
// Hardpoints/Kill Streaks ///////////////////////////////////////////////////////

// Allow hardpoints? If no, all of the dvars in this section are bypassed.
set svr_hardpoints 1 // 0 = No, 1 = Yes (default = 1)

// Allow UAV Radar?
set svr_allowuavradar 1 // 0 = No, 1 = Yes (default = 1)

// Allow Airstrikes?
set svr_allowairstrike 1 // 0 = No, 1 = Yes (default = 1)

// Allow Helicopter?
set svr_allowhelicopter 1 // 0 = No, 1 = Yes (default = 1)

// Killstreak values:
set svr_uavradarstreak 3 // 1 = Min, 99 = Max (default = 3)
set svr_airstrikestreak 5 // 1 = Min, 99 = Max (default = 5)
set svr_helicopterstreak 7 // 1 = Min, 99 = Max (default = 7)

// Time (in seconds) that the uavradar will remain active
set svr_radartime 30 // 1 = Min, 60 = Max (default = 30)



If you want to see the code working, my mod is available on filefront & here (www.aigaming.net)
BTW - Marc (creator of ACE mod) is stand-up guy. There should be no trust issues there.

wraithwingus
05-21-2008, 09:52 AM
Thanks for the code.

I am sure marc is a good guy and is clean. And what I said was not meant to bash anyone or to be disrespectful. I am the one who has issues :D