diff --git a/CTFGame.cs b/CTFGame.cs index 86f5fcd..629cbbc 100644 --- a/CTFGame.cs +++ b/CTFGame.cs @@ -28,6 +28,7 @@ function CTFGame::initGameVars(%game) %game.SCORE_PER_ESCORT_ASSIST = 5; %game.SCORE_PER_HEADSHOT = 1; %game.SCORE_PER_REARSHOT = 1; // z0dd - ZOD, 8/25/02. Added Lance rear shot messages + %game.SCORE_PER_MIDAIR = 1; // Added Chocotaco. From sctf %game.SCORE_PER_TURRET_KILL = 10; // controlled %game.SCORE_PER_TURRET_KILL_AUTO = 5; // uncontrolled, z0dd - ZOD, 5/27/03. More points, was 3 @@ -254,6 +255,36 @@ function Flag::onLeaveLiquid(%data, %obj, %type) if(isEventPending(%obj.lavaEnterThread)) cancel(%obj.lavaEnterThread); } + +function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal) +{ + if(!isObject(%targetObject) && !isObject(%projectile.sourceObject)) + return; + if(!(%targetObject.getType() & ($TypeMasks::StaticTSObjectType | $TypeMasks::InteriorObjectType | + $TypeMasks::TerrainObjectType | $TypeMasks::WaterObjectType))) + { + if(%projectile.sourceObject.team !$= %targetObject.team) + { + if(%targetObject.getDataBlock().getClassName() $= "PlayerData" && %data.getName() $= "DiscProjectile") + { + %mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType; + %start = %targetObject.getWorldBoxCenter(); + %distance = mFloor(VectorDist(%start, %projectile.initialPosition)); + %end = getWord(%start, 0) SPC getWord(%start, 1) SPC getWord(%start, 2) - 15; + %grounded = ContainerRayCast(%start, %end, %mask, 0); + if(!%grounded) + { + %projectile.sourceObject.client.scoreMidAir++; + messageClient(%projectile.sourceObject.client, 'MsgMidAir', '\c0You received a %1 point bonus for a successful mid air shot.~wfx/misc/bounty_bonus.wav', Game.SCORE_PER_MIDAIR, %data.radiusDamageType, %distance); + messageTeamExcept(%projectile.sourceObject.client, 'MsgMidAir', '\c5%1 hit a mid air shot.', %projectile.sourceObject.client.name, %data.radiusDamageType, %distance); + Game.recalcScore(%projectile.sourceObject.client); + } + } + } + Parent::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal); + } +} + }; //-------------------------------------------------------------------------- @@ -931,6 +962,7 @@ function CTFGame::recalcScore(%game, %cl) %cl.tkDestroys * %game.SCORE_PER_TK_DESTROY + // z0dd - ZOD, 10/03/02. Penalty for tking equiptment. %cl.scoreHeadshot * %game.SCORE_PER_HEADSHOT + %cl.scoreRearshot * %game.SCORE_PER_REARSHOT + // z0dd - ZOD, 8/25/02. Added Lance rear shot messages + %cl.scoreMidAir * %game.SCORE_PER_MIDAIR + %cl.flagCaps * %game.SCORE_PER_PLYR_FLAG_CAP + %cl.flagGrabs * %game.SCORE_PER_PLYR_FLAG_TOUCH + %cl.genDestroys * %game.SCORE_PER_DESTROY_GEN + @@ -1497,6 +1529,7 @@ function CTFGame::resetScore(%game, %client) { %client.offenseScore = 0; %client.kills = 0; + %client.scoreMidAir = 0; %client.deaths = 0; %client.suicides = 0; %client.escortAssists = 0; diff --git a/SCtF/DeleteObjects.cs b/SCtF/DeleteObjects.cs deleted file mode 100644 index f6f7a8e..0000000 --- a/SCtF/DeleteObjects.cs +++ /dev/null @@ -1,90 +0,0 @@ -function getGroupObjectByName(%group, %name) -{ - %numObjects = %group.getCount(); - - for(%i = 0; %i < %numObjects; %i++) - { - if (%group.getObject(%i).getName() $= %name) - return %group.getObject(%i); - } -} - -function deleteObjectsFromMapByType(%type) -{ - %teamsGroup = getGroupObjectByName(MissionGroup, "Teams"); - if (!isObject(%teamsGroup)) - { - return; - } - - %team1Group = getGroupObjectByName(%teamsGroup, "Team1"); - if (!isObject(%team1Group)) - { - return; - } - - %team2Group = getGroupObjectByName(%teamsGroup, "Team2"); - if (!isObject(%team2Group)) - { - return; - } - - %team1Base0Group = getGroupObjectByName(%team1Group, "Base0"); - if (!isObject(%team1Base0Group)) - { - return; - } - - %team2Base0Group = getGroupObjectByName(%team2Group, "Base1"); - if (!isObject(%team2Base0Group)) - { - return; - } - - - deleteObjectsFromGroupByType(%team1Base0Group, %type); - deleteObjectsFromGroupByType(%team2Base0Group, %type); -} - -function deleteObjectsFromGroupByType(%group, %type) -{ - %noObjectsLeft = 0; - - while (%noObjectsLeft == 0) - { - %i = 0; - %noObjectsLeft = 1; - %loop = 1; - %numObjects = %group.getCount(); - - while ((%loop == 1) && (%i < %numObjects)) - { - %obj = %group.getObject(%i); - - if (%obj.getClassName() $= "SimGroup") - deleteObjectsFromGroupByType(%obj, %type); - - if (%obj.getClassName() $= %type) - { - %obj.delete(); - %loop = 0; - %noObjectsLeft = 0; - } - else - %i++; - } - } -} - -function deleteNonSCtFObjectsFromMap() -{ - //deleteObjectsFromGroupByType(MissionGroup, "PhysicalZone"); - deleteObjectsFromGroupByType(MissionGroup, "Turret"); - deleteObjectsFromGroupByType(MissionGroup, "StaticShape"); - //deleteObjectsFromGroupByType(MissionGroup, "ForceFieldBare"); - deleteObjectsFromGroupByType(MissionGroup, "FlyingVehicle"); - deleteObjectsFromGroupByType(MissionGroup, "WheeledVehicle"); - deleteObjectsFromGroupByType(MissionGroup, "HoverVehicle"); - deleteObjectsFromGroupByType(MissionGroup, "Waypoint"); - //deleteObjectsFromGroupByType(MissionGroup, "Item"); -} diff --git a/SCtFGame.cs b/SCtFGame.cs index 4ad432c..1831d34 100644 --- a/SCtFGame.cs +++ b/SCtFGame.cs @@ -22,8 +22,6 @@ exec("scripts/aiSCtF.cs"); //exec the prefs exec("prefs/SctfPrefs.cs"); -//exec the DeleteObjects -exec("scripts/SCtF/DeleteObjects.cs"); // Setup the default bans setArmorDefaults("Light"); @@ -284,7 +282,7 @@ package SCtFGame if(!%grounded) { %projectile.sourceObject.client.scoreMidAir++; - messageClient(%projectile.sourceObject.client, 'MsgMidAir', '\c0You received a %1 point bonus for a successful mid air shot.', Game.SCORE_PER_MIDAIR, %data.radiusDamageType, %distance); + messageClient(%projectile.sourceObject.client, 'MsgMidAir', '\c0You received a %1 point bonus for a successful mid air shot.~wfx/misc/bounty_bonus.wav', Game.SCORE_PER_MIDAIR, %data.radiusDamageType, %distance); messageTeamExcept(%projectile.sourceObject.client, 'MsgMidAir', '\c5%1 hit a mid air shot.', %projectile.sourceObject.client.name, %data.radiusDamageType, %distance); Game.recalcScore(%projectile.sourceObject.client); } @@ -2041,4 +2039,93 @@ function SCtFGame::startFlagCollisionSearch(%game, %flag) // } //} +//DeleteObjects Code +function getGroupObjectByName(%group, %name) +{ + %numObjects = %group.getCount(); + for(%i = 0; %i < %numObjects; %i++) + { + if (%group.getObject(%i).getClassName() $= %name) + return %group.getObject(%i); + } +} + +function deleteObjectsFromMapByType(%type) +{ + %teamsGroup = getGroupObjectByName(MissionGroup, "Teams"); + if (!isObject(%teamsGroup)) + { + return; + } + + %team1Group = getGroupObjectByName(%teamsGroup, "Team1"); + if (!isObject(%team1Group)) + { + return; + } + + %team2Group = getGroupObjectByName(%teamsGroup, "Team2"); + if (!isObject(%team2Group)) + { + return; + } + + %team1Base0Group = getGroupObjectByName(%team1Group, "Base0"); + if (!isObject(%team1Base0Group)) + { + return; + } + + %team2Base0Group = getGroupObjectByName(%team2Group, "Base1"); + if (!isObject(%team2Base0Group)) + { + return; + } + + + deleteObjectsFromGroupByType(%team1Base0Group, %type); + deleteObjectsFromGroupByType(%team2Base0Group, %type); +} + +function deleteObjectsFromGroupByType(%group, %type) +{ + %noObjectsLeft = 0; + + while (%noObjectsLeft == 0) + { + %i = 0; + %noObjectsLeft = 1; + %loop = 1; + %numObjects = %group.getCount(); + + while ((%loop == 1) && (%i < %numObjects)) + { + %obj = %group.getObject(%i); + + if (%obj.getClassName() $= "SimGroup") + deleteObjectsFromGroupByType(%obj, %type); + + if (%obj.getClassName() $= %type) + { + %obj.delete(); + %loop = 0; + %noObjectsLeft = 0; + } + else + %i++; + } + } +} + +function deleteNonSCtFObjectsFromMap() +{ + deleteObjectsFromGroupByType(MissionGroup, "Turret"); + deleteObjectsFromGroupByType(MissionGroup, "StaticShape"); + deleteObjectsFromGroupByType(MissionGroup, "FlyingVehicle"); + deleteObjectsFromGroupByType(MissionGroup, "WheeledVehicle"); + deleteObjectsFromGroupByType(MissionGroup, "HoverVehicle"); + deleteObjectsFromGroupByType(MissionGroup, "Waypoint"); + //deleteObjectsFromGroupByType(MissionGroup, "ForceFieldBare"); + //deleteObjectsFromGroupByType(MissionGroup, "Item"); +} diff --git a/autoexec/packetsettings.cs b/autoexec/packetsettings.cs new file mode 100644 index 0000000..2ff19af --- /dev/null +++ b/autoexec/packetsettings.cs @@ -0,0 +1,13 @@ +$pref::Net::PacketRateToClient = "32"; //determines how many packets per second sent to each client +$pref::Net::PacketRateToServer = "32"; //may determine how many packets are allowed from each client +$pref::Net::PacketSize = "350"; //size of each packet sent to each client, maximum.has no effect on size of packets client send to the server + + +setlogmode(0); +// leave this set to zero unless you are coding and need a log it will make a huge file...!!! + +$logechoenabled=0; +//set to 1 you can now see game details in console. Thanks to tubaguy. + +SetPerfCounterEnable(0); +//server stutter fix \ No newline at end of file diff --git a/prefs/evo_mapRotation.cs b/prefs/evo_mapRotation.cs index 021fe07..4737d6b 100644 --- a/prefs/evo_mapRotation.cs +++ b/prefs/evo_mapRotation.cs @@ -63,7 +63,7 @@ addRotationMap("S8_Cardiac", CTF, 1, 1); addRotationMap("CirclesEdge", CTF, 1, 1); addRotationMap("S5_Icedance", CTF, 1, 1); addRotationMap("Bulwark", CTF, 1, 1); -addRotationMap("TWL_WoodyMyrk", CTF, 1, 1); +addRotationMap("S5_Woodymyrk", CTF, 1, 1); addRotationMap("Discord", CTF, 1, 1); addRotationMap("NatureMagic", CTF, 1, 1); addRotationMap("TenebrousCTF", CTF, 1, 1); @@ -125,19 +125,18 @@ addRotationMap("S5_Misadventure", CTF, 1, 0); addRotationMap("S5_Reynard", CTF, 1, 0); addRotationMap("S5_Sherman", CTF, 1, 0); addRotationMap("S5_Silenus", CTF, 1, 0); -addRotationMap("S5_Woodymyrk", CTF, 1, 0); addRotationMap("S8_CentralDogma", CTF, 0, 0); addRotationMap("S8_Mountking", CTF, 0, 0); addRotationMap("S8_Zilch", CTF, 0, 0); addRotationMap("TWL2_CloakOfNight", CTF, 1, 0); -addRotationMap("TWL2_Crevice", CTF, 0, 0); +addRotationMap("TWL2_Crevice", CTF, 1, 0); addRotationMap("TWL2_Dissention", CTF, 0, 0); addRotationMap("TWL2_Drifts", CTF, 1, 0); addRotationMap("TWL2_Drorck", CTF, 0, 0); addRotationMap("TWL2_FrozenHope", CTF, 1, 0); -addRotationMap("TWL2_IceDagger", CTF, 0, 0); +addRotationMap("TWL2_IceDagger", CTF, 1, 0); addRotationMap("TWL2_MuddySwamp", CTF, 1, 0); -addRotationMap("TWL2_Norty", CTF, 0, 0); +addRotationMap("TWL2_Norty", CTF, 1, 0); addRotationMap("TWL2_Ruined", CTF, 1, 0); addRotationMap("TWL_Abaddon", CTF, 0, 0); addRotationMap("TWL_BaNsHee", CTF, 0, 0); @@ -154,7 +153,7 @@ addRotationMap("TWL_DangerousCrossing", CTF, 1, 0); addRotationMap("TWL_DeadlyBirdsSong", CTF, 1, 0); addRotationMap("TWL_Deserted", CTF, 1, 0); addRotationMap("TWL_Frostclaw", CTF, 1, 0); -addRotationMap("TWL_Frozen", CTF, 0, 0); +addRotationMap("TWL_Frozen", CTF, 1, 0); addRotationMap("TWL_Harvester", CTF, 0, 0); addRotationMap("TWL_Horde", CTF, 0, 0); addRotationMap("TWL_Katabatic", CTF, 1, 0); @@ -165,6 +164,7 @@ addRotationMap("TWL_Sandstorm", CTF, 0, 0); addRotationMap("TWL_Starfallen", CTF, 1, 0); addRotationMap("TWL_SubZero", CTF, 1, 0); addRotationMap("TWL_Titan", CTF, 1, 0); +addRotationMap("TWL_WoodyMyrk", CTF, 1, 0); addRotationMap("Vauban", CTF, 1, 0); addRotationMap("Glade", CTF, 1, 0); addRotationMap("WindyGap", CTF, 1, 0); diff --git a/prefs/serverPrefs.cs b/prefs/serverPrefs.cs index 4db2aaa..d6b6e3b 100644 --- a/prefs/serverPrefs.cs +++ b/prefs/serverPrefs.cs @@ -35,7 +35,7 @@ $Host::ClassicLogEchoEnabled = 0; $Host::ClassicMaxTelepads = 3; $Host::ClassicNoNullVoiceSpam = 0; $Host::ClassicPacketRateToClient = 32; -$Host::ClassicPacketSize = 450; +$Host::ClassicPacketSize = 350; $Host::ClassicRandomizeTeams = 1; $Host::ClassicRandomMissions = 1; $Host::ClassicRandomMisTypes = 0; @@ -1102,7 +1102,7 @@ $Host::MapPlayerLimitsSandOcean_CTF = "8 32"; $Host::MapPlayerLimitsSandstorm_CTF = "10 32"; $Host::MapPlayerLimitsSandStormLak_LakRabbit = "-1 32"; $Host::MapPlayerLimitsScarabrae_nef_CTF = "12 32"; -$Host::MapPlayerLimitsShockRidge_CTF = "8 32"; +$Host::MapPlayerLimitsShockRidge_CTF = "10 32"; $Host::MapPlayerLimitsShortFall_CTF = "8 32"; $Host::MapPlayerLimitsShortFall_sctf = "8 32"; $Host::MapPlayerLimitsSignal_CTF = "6 32"; @@ -1258,7 +1258,7 @@ $Host::MapPlayerLimitsWhiteout_Duel = "-1 32"; $Host::MarkDnDObjectives = 1; $Host::MaxBotDifficulty = "0.75"; $Host::MaxMessageLen = 120; -$Host::MaxPlayers = "16"; +$Host::MaxPlayers = "18"; $Host::MinBotDifficulty = "0.5"; $Host::MissionType = "LakRabbit"; $Host::NoSmurfs = 1;