From 182661dd82335137e1e6f7a4295ef2fd460f1aca Mon Sep 17 00:00:00 2001 From: Ragora Date: Sun, 17 Mar 2013 23:06:38 -0400 Subject: [PATCH] Lots of changes --- ChangeLog.txt | 11 + Scripts/CTFGame.cs | 2055 ------------ Scripts/LobbyGui.cs | 616 ---- Scripts/ModScripts/AI/SentinelAI.cs | 71 - Scripts/ModScripts/AI/SentinelData.cs | 654 ---- Scripts/OptionsDlg.cs | 2772 ----------------- Scripts/TR2medium_male.cs | 43 - Scripts/arenaAI.cs | 75 - Scripts/chatMenuHud.cs | 236 -- Scripts/client.cs | 2439 --------------- Scripts/controlDefaults.cs | 1740 ----------- Scripts/creditsGui.cs | 144 - Scripts/editor.cs | 113 - Scripts/gameBase.cs | 147 - Scripts/serverCommanderMap.cs | 373 --- Scripts/serverDefaults.cs | 178 -- {Scripts => scripts}/CombatConGame.cs | 0 {Scripts => scripts}/ConstructionGame.cs | 0 {Scripts => scripts}/InfectionGame.cs | 0 {Scripts => scripts}/JTLmeteorStorm.cs | 0 {Scripts => scripts}/TR2Game.cs | 0 {Scripts => scripts}/admin.cs | 0 {Scripts => scripts}/ai.cs | 0 {Scripts => scripts}/aiDefaultTasks.cs | 0 {Scripts => scripts}/aiInventory.cs | 0 {Scripts => scripts}/chatCommands.cs | 0 {Scripts => scripts}/creditsText.cs | 0 {Scripts => scripts}/dEffects.cs | 0 {Scripts => scripts}/damageTypes.cs | 0 .../data/messagedata.cs | 0 .../PulseData.cs => scripts/data/pulsedata.cs | 0 .../data/variabledefaults.cs | 0 {Scripts => scripts}/deathMessages.cs | 0 {Scripts => scripts}/defaultGame.cs | 0 {Scripts => scripts}/deployables.cs | 0 .../do_not_delete/Dfunctions.cs.dso | Bin .../do_not_delete/MergeToolSupport.cs.dso | Bin .../do_not_delete/loadscreen.cs.dso | Bin {Scripts => scripts}/expertLibraries.cs | 0 {Scripts => scripts}/forceField.cs | 0 {Scripts => scripts}/functions.cs | 0 {Scripts => scripts}/hazard.cs | 0 {Scripts => scripts}/hfunctions.cs | 0 {Scripts => scripts}/hud.cs | 0 {Scripts => scripts}/inventory.cs | 0 {Scripts => scripts}/inventoryHud.cs | 0 {Scripts => scripts}/ion.cs | 0 {Scripts => scripts}/item.cs | 0 {Scripts => scripts}/libraries.cs | 0 {Scripts => scripts}/loadMenu.cs | 0 {Scripts => scripts}/mapGame.cs | 0 {Scripts => scripts}/message.cs | 0 .../modscripts/ai/drone.cs | 0 .../S11AI.cs => scripts/modscripts/ai/s11.cs | 0 .../S17AI.cs => scripts/modscripts/ai/s17.cs | 0 .../modscripts/chatcommands/admin.cs | 0 .../modscripts/chatcommands/ai.cs | 0 .../modscripts/chatcommands/help.cs | 0 .../modscripts/chatcommands/sa.cs | 0 .../modscripts/chatcommands/zombie.cs | 0 .../modscripts/modfunctions.cs | 0 scripts/modscripts/player.cs | 58 + .../modscripts/ranking.cs | 0 .../modscripts/specops.cs | 0 {Scripts => scripts}/pack.cs | 0 .../packs}/ArtilleryLoadoutPack.cs | 0 .../packs}/CommandSatelite.cs | 0 .../packs}/DeployableWaypoint.cs | 0 .../Packs => scripts/packs}/Effectpacks.cs | 0 .../Packs => scripts/packs}/FlamerAmmopack.cs | 0 .../Packs => scripts/packs}/JetBooster.cs | 0 {Scripts/Packs => scripts/packs}/Medpack.cs | 0 .../Packs => scripts/packs}/PurgeGenerator.cs | 0 .../Packs => scripts/packs}/SentinelPack.cs | 0 .../Packs => scripts/packs}/ZSpawnpack.cs | 0 {Scripts/Packs => scripts/packs}/ammopack.cs | 0 .../packs}/artillerybarrelPack.cs | 0 .../Packs => scripts/packs}/blastfloor.cs | 0 {Scripts/Packs => scripts/packs}/blastwall.cs | 0 .../Packs => scripts/packs}/blastwwall.cs | 0 {Scripts/Packs => scripts/packs}/cratepack.cs | 0 .../Packs => scripts/packs}/deconExamples.cs | 0 .../Packs => scripts/packs}/decorationpack.cs | 0 {Scripts/Packs => scripts/packs}/door.cs | 0 .../Packs => scripts/packs}/forcefieldpack.cs | 0 {Scripts/Packs => scripts/packs}/generator.cs | 0 .../packs}/gravityfieldpack.cs | 0 {Scripts/Packs => scripts/packs}/jumpad.cs | 0 .../Packs => scripts/packs}/largeInventory.cs | 0 .../Packs => scripts/packs}/largeSensor.cs | 0 .../Packs => scripts/packs}/laserturret.cs | 0 {Scripts/Packs => scripts/packs}/lightpack.cs | 0 .../packs}/logoprojectorpack.cs | 0 .../Packs => scripts/packs}/mediumSensor.cs | 0 {Scripts/Packs => scripts/packs}/mspine.cs | 0 .../Packs => scripts/packs}/parachutepack.cs | 0 .../Packs => scripts/packs}/repairpack.cs | 0 .../Packs => scripts/packs}/satchelCharge.cs | 0 .../packs}/sentryturretpack.cs | 0 .../Packs => scripts/packs}/solarpanel.cs | 0 .../Packs => scripts/packs}/spawnpointpack.cs | 0 {Scripts/Packs => scripts/packs}/spine.cs | 0 {Scripts/Packs => scripts/packs}/switch.cs | 0 .../Packs => scripts/packs}/telepadpack.cs | 0 {Scripts/Packs => scripts/packs}/treepack.cs | 0 {Scripts/Packs => scripts/packs}/tripwire.cs | 0 .../Packs => scripts/packs}/turretpack.cs | 0 .../Packs => scripts/packs}/vehiclepad.cs | 0 .../packs}/vehiclerepairpad.cs | 0 {Scripts => scripts}/player.cs | 0 {Scripts => scripts}/power.cs | 0 {Scripts => scripts}/prison.cs | 0 {Scripts => scripts}/projectiles.cs | 0 {Scripts => scripts}/saveBuilding.cs | 0 {Scripts => scripts}/server.cs | 0 {Scripts => scripts}/skywrite.cs | 0 {Scripts => scripts}/solitudeBlock.cs | 0 {Scripts => scripts}/staticShape.cs | 0 {Scripts => scripts}/station.cs | 0 {Scripts => scripts}/terSupport.cs | 0 {Scripts => scripts}/truPhysics.cs | 0 {Scripts => scripts}/turret.cs | 0 .../turrets}/Artillerybarrellarge.cs | 0 .../turrets}/ELFBarrelLarge.cs | 0 .../turrets}/aabarrellarge.cs | 0 .../turrets}/indoordeployablebarrel.cs | 0 .../turrets}/missileBarrelLarge.cs | 0 .../turrets}/mortarBarrelLarge.cs | 0 .../turrets}/outdoorDeployableBarrel.cs | 0 .../turrets}/plasmaBarrelLarge.cs | 0 .../vehicles}/Vehicle_strikefighter.cs | 0 .../vehicles}/serverVehicleHud.cs | 0 .../Vehicles => scripts/vehicles}/vehicle.cs | 0 .../vehicles}/vehicle_AWACS.cs | 0 .../vehicles}/vehicle_Artillery.cs | 0 .../vehicles}/vehicle_CGM.cs | 0 .../vehicles}/vehicle_CGTank.cs | 0 .../vehicles}/vehicle_DropPod.cs | 0 .../vehicles}/vehicle_HeavyHelicopter.cs | 0 .../vehicles}/vehicle_HeavyTank.cs | 0 .../vehicles}/vehicle_Helicopter.cs | 0 .../vehicles}/vehicle_S17.cs | 0 .../vehicles}/vehicle_SuperiorityFighter.cs | 0 .../vehicles}/vehicle_boat.cs | 0 .../vehicles}/vehicle_bomber.cs | 0 .../vehicles}/vehicle_effects.cs | 0 .../vehicles}/vehicle_gunship.cs | 0 .../vehicles}/vehicle_havoc.cs | 0 .../vehicles}/vehicle_hawk.cs | 0 .../vehicles}/vehicle_mpb.cs | 0 .../vehicles}/vehicle_s11.cs | 0 .../vehicles}/vehicle_shrike.cs | 0 .../vehicles}/vehicle_spec_fx.cs | 0 .../vehicles}/vehicle_sub.cs | 0 .../vehicles}/vehicle_superHavoc.cs | 0 .../vehicles}/vehicle_superWildcat.cs | 0 .../vehicles}/vehicle_tank.cs | 0 .../vehicles}/vehicle_transboat.cs | 0 .../vehicles}/vehicle_wildcat.cs | 0 {Scripts => scripts}/weapTurretCode.cs | 0 {Scripts => scripts}/weapons.cs | 0 .../Weapons => scripts/weapons}/DZShot.cs | 0 .../weapons}/EditingTool.cs | 0 .../weapons}/FlameMortar.cs | 0 {Scripts/Weapons => scripts/weapons}/Krieg.cs | 0 .../weapons}/LightMachineGun.cs | 0 .../weapons}/M4GrenadeLauncher.cs | 0 {Scripts/Weapons => scripts/weapons}/MG42.cs | 0 .../Weapons => scripts/weapons}/MergeTool.cs | 0 {Scripts/Weapons => scripts/weapons}/PBC.cs | 0 .../Weapons => scripts/weapons}/PulseLaser.cs | 0 .../Weapons => scripts/weapons}/RPchaingun.cs | 0 .../Weapons => scripts/weapons}/RailGun.cs | 0 .../weapons}/RocketLauncher.cs | 0 .../Weapons => scripts/weapons}/Shotgun.cs | 0 .../weapons}/SmokeGrenade.cs | 0 .../weapons}/TextureTool.cs | 0 .../weapons}/ZLordPoison.cs | 0 .../Weapons => scripts/weapons}/allweapons.cs | 0 .../Weapons => scripts/weapons}/bazooka.cs | 0 .../weapons}/constructionTool.cs | 0 .../weapons}/flamethrower.cs | 0 .../weapons}/flareGrenade.cs | 0 .../weapons}/flashGrenade.cs | 0 .../Weapons => scripts/weapons}/grenade.cs | 0 {Scripts/Weapons => scripts/weapons}/mine.cs | 0 .../weapons}/missileLauncher.cs | 0 .../Weapons => scripts/weapons}/pistol.cs | 0 .../Weapons => scripts/weapons}/snipergun.cs | 0 .../weapons}/superChaingun.cs | 0 .../weapons}/targetingLaser.cs | 0 191 files changed, 69 insertions(+), 11656 deletions(-) delete mode 100644 Scripts/CTFGame.cs delete mode 100644 Scripts/LobbyGui.cs delete mode 100644 Scripts/ModScripts/AI/SentinelAI.cs delete mode 100644 Scripts/ModScripts/AI/SentinelData.cs delete mode 100644 Scripts/OptionsDlg.cs delete mode 100644 Scripts/TR2medium_male.cs delete mode 100644 Scripts/arenaAI.cs delete mode 100644 Scripts/chatMenuHud.cs delete mode 100644 Scripts/client.cs delete mode 100644 Scripts/controlDefaults.cs delete mode 100644 Scripts/creditsGui.cs delete mode 100644 Scripts/editor.cs delete mode 100644 Scripts/gameBase.cs delete mode 100644 Scripts/serverCommanderMap.cs delete mode 100644 Scripts/serverDefaults.cs rename {Scripts => scripts}/CombatConGame.cs (100%) rename {Scripts => scripts}/ConstructionGame.cs (100%) rename {Scripts => scripts}/InfectionGame.cs (100%) rename {Scripts => scripts}/JTLmeteorStorm.cs (100%) rename {Scripts => scripts}/TR2Game.cs (100%) rename {Scripts => scripts}/admin.cs (100%) rename {Scripts => scripts}/ai.cs (100%) rename {Scripts => scripts}/aiDefaultTasks.cs (100%) rename {Scripts => scripts}/aiInventory.cs (100%) rename {Scripts => scripts}/chatCommands.cs (100%) rename {Scripts => scripts}/creditsText.cs (100%) rename {Scripts => scripts}/dEffects.cs (100%) rename {Scripts => scripts}/damageTypes.cs (100%) rename Scripts/Data/MessageData.cs => scripts/data/messagedata.cs (100%) rename Scripts/Data/PulseData.cs => scripts/data/pulsedata.cs (100%) rename Scripts/Data/VariableDefaults.cs => scripts/data/variabledefaults.cs (100%) rename {Scripts => scripts}/deathMessages.cs (100%) rename {Scripts => scripts}/defaultGame.cs (100%) rename {Scripts => scripts}/deployables.cs (100%) rename {Scripts => scripts}/do_not_delete/Dfunctions.cs.dso (100%) rename {Scripts => scripts}/do_not_delete/MergeToolSupport.cs.dso (100%) rename {Scripts => scripts}/do_not_delete/loadscreen.cs.dso (100%) rename {Scripts => scripts}/expertLibraries.cs (100%) rename {Scripts => scripts}/forceField.cs (100%) rename {Scripts => scripts}/functions.cs (100%) rename {Scripts => scripts}/hazard.cs (100%) rename {Scripts => scripts}/hfunctions.cs (100%) rename {Scripts => scripts}/hud.cs (100%) rename {Scripts => scripts}/inventory.cs (100%) rename {Scripts => scripts}/inventoryHud.cs (100%) rename {Scripts => scripts}/ion.cs (100%) rename {Scripts => scripts}/item.cs (100%) rename {Scripts => scripts}/libraries.cs (100%) rename {Scripts => scripts}/loadMenu.cs (100%) rename {Scripts => scripts}/mapGame.cs (100%) rename {Scripts => scripts}/message.cs (100%) rename Scripts/ModScripts/AI/DroneAI.cs => scripts/modscripts/ai/drone.cs (100%) rename Scripts/ModScripts/AI/S11AI.cs => scripts/modscripts/ai/s11.cs (100%) rename Scripts/ModScripts/AI/S17AI.cs => scripts/modscripts/ai/s17.cs (100%) rename Scripts/ModScripts/ChatCommands/AdminCommands.cs => scripts/modscripts/chatcommands/admin.cs (100%) rename Scripts/ModScripts/ChatCommands/AICommands.cs => scripts/modscripts/chatcommands/ai.cs (100%) rename Scripts/ModScripts/ChatCommands/HelpCommand.cs => scripts/modscripts/chatcommands/help.cs (100%) rename Scripts/ModScripts/ChatCommands/SACommands.cs => scripts/modscripts/chatcommands/sa.cs (100%) rename Scripts/ModScripts/ChatCommands/ZombieCommands.cs => scripts/modscripts/chatcommands/zombie.cs (100%) rename Scripts/ModScripts/ModFunctions.cs => scripts/modscripts/modfunctions.cs (100%) create mode 100644 scripts/modscripts/player.cs rename Scripts/RankStuff.cs => scripts/modscripts/ranking.cs (100%) rename Scripts/SpecOpsFeatures.cs => scripts/modscripts/specops.cs (100%) rename {Scripts => scripts}/pack.cs (100%) rename {Scripts/Packs => scripts/packs}/ArtilleryLoadoutPack.cs (100%) rename {Scripts/Packs => scripts/packs}/CommandSatelite.cs (100%) rename {Scripts/Packs => scripts/packs}/DeployableWaypoint.cs (100%) rename {Scripts/Packs => scripts/packs}/Effectpacks.cs (100%) rename {Scripts/Packs => scripts/packs}/FlamerAmmopack.cs (100%) rename {Scripts/Packs => scripts/packs}/JetBooster.cs (100%) rename {Scripts/Packs => scripts/packs}/Medpack.cs (100%) rename {Scripts/Packs => scripts/packs}/PurgeGenerator.cs (100%) rename {Scripts/Packs => scripts/packs}/SentinelPack.cs (100%) rename {Scripts/Packs => scripts/packs}/ZSpawnpack.cs (100%) rename {Scripts/Packs => scripts/packs}/ammopack.cs (100%) rename {Scripts/Packs => scripts/packs}/artillerybarrelPack.cs (100%) rename {Scripts/Packs => scripts/packs}/blastfloor.cs (100%) rename {Scripts/Packs => scripts/packs}/blastwall.cs (100%) rename {Scripts/Packs => scripts/packs}/blastwwall.cs (100%) rename {Scripts/Packs => scripts/packs}/cratepack.cs (100%) rename {Scripts/Packs => scripts/packs}/deconExamples.cs (100%) rename {Scripts/Packs => scripts/packs}/decorationpack.cs (100%) rename {Scripts/Packs => scripts/packs}/door.cs (100%) rename {Scripts/Packs => scripts/packs}/forcefieldpack.cs (100%) rename {Scripts/Packs => scripts/packs}/generator.cs (100%) rename {Scripts/Packs => scripts/packs}/gravityfieldpack.cs (100%) rename {Scripts/Packs => scripts/packs}/jumpad.cs (100%) rename {Scripts/Packs => scripts/packs}/largeInventory.cs (100%) rename {Scripts/Packs => scripts/packs}/largeSensor.cs (100%) rename {Scripts/Packs => scripts/packs}/laserturret.cs (100%) rename {Scripts/Packs => scripts/packs}/lightpack.cs (100%) rename {Scripts/Packs => scripts/packs}/logoprojectorpack.cs (100%) rename {Scripts/Packs => scripts/packs}/mediumSensor.cs (100%) rename {Scripts/Packs => scripts/packs}/mspine.cs (100%) rename {Scripts/Packs => scripts/packs}/parachutepack.cs (100%) rename {Scripts/Packs => scripts/packs}/repairpack.cs (100%) rename {Scripts/Packs => scripts/packs}/satchelCharge.cs (100%) rename {Scripts/Packs => scripts/packs}/sentryturretpack.cs (100%) rename {Scripts/Packs => scripts/packs}/solarpanel.cs (100%) rename {Scripts/Packs => scripts/packs}/spawnpointpack.cs (100%) rename {Scripts/Packs => scripts/packs}/spine.cs (100%) rename {Scripts/Packs => scripts/packs}/switch.cs (100%) rename {Scripts/Packs => scripts/packs}/telepadpack.cs (100%) rename {Scripts/Packs => scripts/packs}/treepack.cs (100%) rename {Scripts/Packs => scripts/packs}/tripwire.cs (100%) rename {Scripts/Packs => scripts/packs}/turretpack.cs (100%) rename {Scripts/Packs => scripts/packs}/vehiclepad.cs (100%) rename {Scripts/Packs => scripts/packs}/vehiclerepairpad.cs (100%) rename {Scripts => scripts}/player.cs (100%) rename {Scripts => scripts}/power.cs (100%) rename {Scripts => scripts}/prison.cs (100%) rename {Scripts => scripts}/projectiles.cs (100%) rename {Scripts => scripts}/saveBuilding.cs (100%) rename {Scripts => scripts}/server.cs (100%) rename {Scripts => scripts}/skywrite.cs (100%) rename {Scripts => scripts}/solitudeBlock.cs (100%) rename {Scripts => scripts}/staticShape.cs (100%) rename {Scripts => scripts}/station.cs (100%) rename {Scripts => scripts}/terSupport.cs (100%) rename {Scripts => scripts}/truPhysics.cs (100%) rename {Scripts => scripts}/turret.cs (100%) rename {Scripts/Turrets => scripts/turrets}/Artillerybarrellarge.cs (100%) rename {Scripts/Turrets => scripts/turrets}/ELFBarrelLarge.cs (100%) rename {Scripts/Turrets => scripts/turrets}/aabarrellarge.cs (100%) rename {Scripts/Turrets => scripts/turrets}/indoordeployablebarrel.cs (100%) rename {Scripts/Turrets => scripts/turrets}/missileBarrelLarge.cs (100%) rename {Scripts/Turrets => scripts/turrets}/mortarBarrelLarge.cs (100%) rename {Scripts/Turrets => scripts/turrets}/outdoorDeployableBarrel.cs (100%) rename {Scripts/Turrets => scripts/turrets}/plasmaBarrelLarge.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/Vehicle_strikefighter.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/serverVehicleHud.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_AWACS.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_Artillery.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_CGM.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_CGTank.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_DropPod.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_HeavyHelicopter.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_HeavyTank.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_Helicopter.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_S17.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_SuperiorityFighter.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_boat.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_bomber.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_effects.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_gunship.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_havoc.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_hawk.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_mpb.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_s11.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_shrike.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_spec_fx.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_sub.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_superHavoc.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_superWildcat.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_tank.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_transboat.cs (100%) rename {Scripts/Vehicles => scripts/vehicles}/vehicle_wildcat.cs (100%) rename {Scripts => scripts}/weapTurretCode.cs (100%) rename {Scripts => scripts}/weapons.cs (100%) rename {Scripts/Weapons => scripts/weapons}/DZShot.cs (100%) rename {Scripts/Weapons => scripts/weapons}/EditingTool.cs (100%) rename {Scripts/Weapons => scripts/weapons}/FlameMortar.cs (100%) rename {Scripts/Weapons => scripts/weapons}/Krieg.cs (100%) rename {Scripts/Weapons => scripts/weapons}/LightMachineGun.cs (100%) rename {Scripts/Weapons => scripts/weapons}/M4GrenadeLauncher.cs (100%) rename {Scripts/Weapons => scripts/weapons}/MG42.cs (100%) rename {Scripts/Weapons => scripts/weapons}/MergeTool.cs (100%) rename {Scripts/Weapons => scripts/weapons}/PBC.cs (100%) rename {Scripts/Weapons => scripts/weapons}/PulseLaser.cs (100%) rename {Scripts/Weapons => scripts/weapons}/RPchaingun.cs (100%) rename {Scripts/Weapons => scripts/weapons}/RailGun.cs (100%) rename {Scripts/Weapons => scripts/weapons}/RocketLauncher.cs (100%) rename {Scripts/Weapons => scripts/weapons}/Shotgun.cs (100%) rename {Scripts/Weapons => scripts/weapons}/SmokeGrenade.cs (100%) rename {Scripts/Weapons => scripts/weapons}/TextureTool.cs (100%) rename {Scripts/Weapons => scripts/weapons}/ZLordPoison.cs (100%) rename {Scripts/Weapons => scripts/weapons}/allweapons.cs (100%) rename {Scripts/Weapons => scripts/weapons}/bazooka.cs (100%) rename {Scripts/Weapons => scripts/weapons}/constructionTool.cs (100%) rename {Scripts/Weapons => scripts/weapons}/flamethrower.cs (100%) rename {Scripts/Weapons => scripts/weapons}/flareGrenade.cs (100%) rename {Scripts/Weapons => scripts/weapons}/flashGrenade.cs (100%) rename {Scripts/Weapons => scripts/weapons}/grenade.cs (100%) rename {Scripts/Weapons => scripts/weapons}/mine.cs (100%) rename {Scripts/Weapons => scripts/weapons}/missileLauncher.cs (100%) rename {Scripts/Weapons => scripts/weapons}/pistol.cs (100%) rename {Scripts/Weapons => scripts/weapons}/snipergun.cs (100%) rename {Scripts/Weapons => scripts/weapons}/superChaingun.cs (100%) rename {Scripts/Weapons => scripts/weapons}/targetingLaser.cs (100%) diff --git a/ChangeLog.txt b/ChangeLog.txt index 256be74..26beb1e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,14 @@ +ACCM 1.5.0 -------------------------------------------------- +* DarkDragonDX takes up development. +* Fixed saving of objects with names set via /name (generators, solar panels, etc are excluded as they are supposed to display frequency #) +* Removed a bunch of Sentinel Stuff (by Blnukem) -- their AI was never actually finished it seemed. +* Chat command '/killzombies' used to only half the zombie population. Now it kills them all. +* Several occurances of console spam were fixed. +* Removed unused files, reorganized files slightly. +* Added Linux shell script for deleting .dso files if you're weird like me and run on some Linux operating system via WINE. +* Team 6 is now the 'offical zombie team'. This just means zombie teams are set to this by default. +* Added player.setSkin() and player.setName() -- they need tested + ACCM 1.4.0 [For Deflun :] ------------------------------ * The turret override (disable / enable turrets) now works outside of purebuild. * Emplacements can no longer be controlled via the command circuit. diff --git a/Scripts/CTFGame.cs b/Scripts/CTFGame.cs deleted file mode 100644 index a91301c..0000000 --- a/Scripts/CTFGame.cs +++ /dev/null @@ -1,2055 +0,0 @@ -// DisplayName = Capture the Flag - -//--- GAME RULES BEGIN --- -//Prevent enemy from capturing your flag -//Score one point for grabbing the enemy's flag -//To capture, your flag must be at its stand -//Score 100 points each time enemy flag is captured -//--- GAME RULES END --- - -//exec the AI scripts -exec("scripts/aiCTF.cs"); - -//-- tracking --- -function CTFGame::initGameVars(%game) -{ - - if(isDemo()) - { - %game.SCORE_PER_SUICIDE = -1; - %game.SCORE_PER_TEAMKILL = -1; - %game.SCORE_PER_DEATH = -1; - - %game.SCORE_PER_KILL = 1; - %game.SCORE_PER_PLYR_FLAG_CAP = 3; - %game.SCORE_PER_TEAM_FLAG_CAP = 100; - %game.SCORE_PER_TEAM_FLAG_TOUCH = 1; - %game.SCORE_PER_GEN_DESTROY = 2; - %game.SCORE_PER_ESCORT_ASSIST = 1; - - %game.SCORE_PER_TURRET_KILL = 1; - %game.SCORE_PER_FLAG_DEFEND = 1; - %game.SCORE_PER_CARRIER_KILL = 1; - %game.SCORE_PER_FLAG_RETURN = 1; - %game.SCORE_PER_GEN_DEFEND = 1; - %game.SCORE_PER_GEN_REPAIR = 1; - - %game.FLAG_RETURN_DELAY = 45 * 1000; //45 seconds - - %game.TIME_CONSIDERED_FLAGCARRIER_THREAT = 3 * 1000; //after damaging enemy flag carrier - %game.RADIUS_GEN_DEFENSE = 20; //meters - %game.RADIUS_FLAG_DEFENSE = 20; //meters - - %game.TOUCH_DELAY_MS = 20000; //20 secs - - %game.fadeTimeMS = 2000; - - %game.notifyMineDist = 7.5; - - - %game.stalemate = false; - %game.stalemateObjsVisible = false; - %game.stalemateTimeMS = 60000; - %game.stalemateFreqMS = 15000; - %game.stalemateDurationMS = 6000; - } - if( !isDemo() ) - { - %game.SCORE_PER_SUICIDE = -10; - %game.SCORE_PER_TEAMKILL = -10; - %game.SCORE_PER_DEATH = 0; - - %game.SCORE_PER_KILL = 10; - %game.SCORE_PER_PLYR_FLAG_CAP = 30; - %game.SCORE_PER_PLYR_FLAG_TOUCH = 20; - %game.SCORE_PER_TEAM_FLAG_CAP = 100; - %game.SCORE_PER_TEAM_FLAG_TOUCH = 1; - %game.SCORE_PER_ESCORT_ASSIST = 5; - %game.SCORE_PER_HEADSHOT = 1; - - %game.SCORE_PER_TURRET_KILL = 10; // controlled - %game.SCORE_PER_TURRET_KILL_AUTO = 3; // uncontrolled - %game.SCORE_PER_FLAG_DEFEND = 5; - %game.SCORE_PER_CARRIER_KILL = 5; - %game.SCORE_PER_FLAG_RETURN = 10; - %game.SCORE_PER_STALEMATE_RETURN = 15; - %game.SCORE_PER_GEN_DEFEND = 5; - - %game.SCORE_PER_DESTROY_GEN = 10; - %game.SCORE_PER_DESTROY_SENSOR = 4; - %game.SCORE_PER_DESTROY_TURRET = 5; - %game.SCORE_PER_DESTROY_ISTATION = 2; - %game.SCORE_PER_DESTROY_VSTATION = 5; - %game.SCORE_PER_DESTROY_SOLAR = 5; - %game.SCORE_PER_DESTROY_SENTRY = 4; - %game.SCORE_PER_DESTROY_DEP_SENSOR = 1; - %game.SCORE_PER_DESTROY_DEP_INV = 2; - %game.SCORE_PER_DESTROY_DEP_TUR = 3; - - %game.SCORE_PER_DESTROY_SHRIKE = 7; - %game.SCORE_PER_DESTROY_STRIKEFIGHTER = 8; - %game.SCORE_PER_DESTROY_HELICOPTER = 10; - %game.SCORE_PER_DESTROY_AWACS = 5; - %game.SCORE_PER_DESTROY_BOMBER = 12; - %game.SCORE_PER_DESTROY_GUNSHIP = 15; - %game.SCORE_PER_DESTROY_HEAVYHELICOPTER = 8; - %game.SCORE_PER_DESTROY_TRANSPORT = 5; - %game.SCORE_PER_DESTROY_WILDCAT = 3; - %game.SCORE_PER_DESTROY_TANK = 5; - %game.SCORE_PER_DESTROY_HEAVYTANK = 6; - %game.SCORE_PER_DESTROY_CGTANK = 5; - %game.SCORE_PER_DESTROY_FFTRANSPORT = 5; - %game.SCORE_PER_DESTROY_ARTILLERY = 8; - %game.SCORE_PER_DESTROY_MPB = 8; - %game.SCORE_PER_DESTROY_TRANSBOAT = 4; - %game.SCORE_PER_DESTROY_SUB = 10; - %game.SCORE_PER_DESTROY_BOAT = 15; - %game.SCORE_PER_PASSENGER = 3; - - %game.SCORE_PER_REPAIR_GEN = 8; - %game.SCORE_PER_REPAIR_SENSOR = 1; - %game.SCORE_PER_REPAIR_TURRET = 4; - %game.SCORE_PER_REPAIR_ISTATION = 2; - %game.SCORE_PER_REPAIR_VSTATION = 4; - %game.SCORE_PER_REPAIR_SOLAR = 4; - %game.SCORE_PER_REPAIR_SENTRY = 2; - %game.SCORE_PER_REPAIR_DEP_TUR = 3; - %game.SCORE_PER_REPAIR_DEP_INV = 2; - - %game.FLAG_RETURN_DELAY = 45 * 1000; //45 seconds - - %game.TIME_CONSIDERED_FLAGCARRIER_THREAT = 3 * 1000; //after damaging enemy flag carrier - %game.RADIUS_GEN_DEFENSE = 20; //meters - %game.RADIUS_FLAG_DEFENSE = 20; //meters - - %game.TOUCH_DELAY_MS = 20000; //20 secs - - %game.fadeTimeMS = 2000; - - %game.notifyMineDist = 7.5; - - - %game.stalemate = false; - %game.stalemateObjsVisible = false; - %game.stalemateTimeMS = 60000; - %game.stalemateFreqMS = 15000; - %game.stalemateDurationMS = 6000; - } - -} - -package CTFGame { - -function ShapeBaseData::onDestroyed(%data, %obj) -{ - %scorer = %obj.lastDamagedBy; - if(!isObject(%scorer)) - return; - - if( (%scorer.getType() & $TypeMasks::GameBaseObjectType) && - %scorer.getDataBlock().catagory $= "Vehicles" ) - { - // --------------------------------------------- - // z0dd - ZOD, 6/18/02. %name was never defined. - %name = %scorer.getDatablock().getName(); - if(%name $= "BomberFlyer" || %name $= "AssaultVehicle") - %gunnerNode = 1; - else - %gunnerNode = 0; - - if(%scorer.getMountNodeObject(%gunnerNode)) - { - %destroyer = %scorer.getMountNodeObject(%gunnerNode).client; - %scorer = %destroyer; - %damagingTeam = %scorer.team; - } - } - else if(%scorer.getClassName() $= "Turret") - { - if(%scorer.getControllingClient()) - { - //manned turret - %destroyer = %scorer.getControllingClient(); - %scorer = %destroyer; - %damagingTeam = %scorer.team; - } - else return; //unmanned turret - } - - if(!%damagingTeam) - %damagingTeam = %scorer.team; - - if(%damagingTeam == %obj.team) - { - //error("team objects dont score"); - return; - } - - if(%obj.soiledByEnemyRepair) - { - //error(%obj SPC "was once repiared by an enemy. No destruction points."); - return; - } - - %objType = %obj.getDataBlock().getName(); - if(%objType $= "GeneratorLarge") - { - %score = game.awardScoreGenDestroy(%scorer); - game.shareScore(%scorer, %score); - } - else if(%objType $= "SensorLargePulse" || %objType $= "SensorMediumPulse") - { - %score = game.awardScoreSensorDestroy(%scorer); - game.shareScore(%scorer, %score); - } - else if(%objType $= "TurretBaseLarge") - { - %score = game.awardScoreTurretDestroy(%scorer); - game.shareScore(%scorer, %score); - } - else if(%objType $= "StationInventory") - { - %score = game.awardScoreInvDestroy(%scorer); - game.shareScore(%scorer, %score); - } - else if(%objType $= "StationVehicle") - { - %score = game.awardScoreVehicleStationDestroy(%scorer); - game.shareScore(%scorer, %score); - } - else if(%objType $= "SolarPanel") - { - %score = game.awardScoreSolarDestroy(%scorer); - game.shareScore(%score, %score); - } - else if(%objType $= "SentryTurret") - { - %score = game.awardScoreSentryDestroy(%scorer); - game.shareScore(%scorer, %score); - } - else if(%objType $= "DeployedMotionSensor" || %objType $= "DeployedPulseSensor") - { - %score = game.awardScoreDepSensorDestroy(%scorer); - game.shareScore(%scorer, %score); - } - else if(%objType $= "TurretDeployedWallIndoor" || %objType $= "TurretDeployedFloorIndoor" || - %objType $= "TurretDeployedCeilingIndoor" || %objType $= "TurretDeployedOutdoor") - { - %score = game.awardScoreDepTurretDestroy(%scorer); - game.shareScore(%scorer, %score); - } - else if(%objType $= "DeployedStationInventory") - { - %score = game.awardScoreDepStationDestroy(%scorer); - game.shareScore(%scorer, %score); - } - -} - -function ShapeBaseData::onDisabled(%data, %obj) -{ - %obj.wasDisabled = true; - Parent::onDisabled(%data, %obj); -} - -function RepairGunImage::onRepair(%this, %obj, %slot) -{ - Parent::onRepair(%this, %obj, %slot); - %target = %obj.repairing; - if(%target && %target.team != %obj.team) - { - //error("Enemy stuff("@%obj@") is being repaired (by "@%target@")"); - %target.soiledByEnemyRepair = true; - } -} - - -function Flag::objectiveInit(%data, %flag) -{ - if (!%flag.isTeamSkinned) - { - %pos = %flag.getTransform(); - %group = %flag.getGroup(); - } - %flag.originalPosition = %flag.getTransform(); - $flagPos[%flag.team] = %flag.originalPosition; - %flag.isHome = true; - %flag.carrier = ""; - %flag.grabber = ""; - setTargetSkin(%flag.getTarget(), CTFGame::getTeamSkin(CTFGame, %flag.team)); - setTargetSensorGroup(%flag.getTarget(), %flag.team); - setTargetAlwaysVisMask(%flag.getTarget(), 0x7); - setTargetRenderMask(%flag.getTarget(), getTargetRenderMask(%flag.getTarget()) | 0x2); - %flag.scopeWhenSensorVisible(true); - $flagStatus[%flag.team] = ""; - - //Point the flag and stand at each other - %group = %flag.getGroup(); - %count = %group.getCount(); - %flag.stand = ""; - for(%i = 0; %i < %count; %i++) - { - %this = %group.getObject(%i); - - //--------------------------------------------------------------------------------------------------------------------------- - // z0dd - ZOD, 3/16/02. Added TSStatic class, to fix console spam. - //if((%this.getClassName() !$= "InteriorInstance") && (%this.getClassName() !$= "SimGroup")) - if(%this.getClassName() !$= "InteriorInstance" && %this.getClassName() !$= "SimGroup" && %this.getClassName() !$= "TSStatic") - { - if(%this.getDataBlock().getName() $= "ExteriorFlagStand") - { - %flag.stand = %this; - %this.flag = %flag; - } - } - } - - // set the nametag on the target - setTargetName(%flag.getTarget(), CTFGame::getTeamName(CTFGame, %flag.team)); - - // create a marker on this guy - %flag.waypoint = new MissionMarker() { - position = %flag.getTransform(); - dataBlock = "FlagMarker"; - }; - MissionCleanup.add(%flag.waypoint); - - // create a target for this (there is no MissionMarker::onAdd script call) - %target = createTarget(%flag.waypoint, CTFGame::getTeamName( CTFGame, %flag.team), "", "", 'Base', %flag.team, 0); - setTargetAlwaysVisMask(%target, 0xffffffff); - - //store the flag in an array - $TeamFlag[%flag.team] = %flag; - - // ------------------------------------------ - // z0dd - ZOD, 5/27/02. Fixes flags hovering - // over friendly player when collision occurs - %flag.static = true; -} - -function Flag::onEnterLiquid(%data, %obj, %coverage, %type) -{ - if(%type > 3) // 1-3 are water, 4+ is lava and quicksand(?) - { - //error("flag("@%obj@") is in liquid type" SPC %type); - game.schedule(3000, flagReturn, %obj); - } -} - -}; - -//-------------------------------------------------------------------------- -// need to have this for the corporate maps which could not be fixed -function SimObject::clearFlagWaypoints(%this) -{ -} - -function WayPoint::clearFlagWaypoints(%this) -{ - logEcho("Removing flag waypoint: " @ %this); - if(%this.nameTag $= "Flag") - %this.delete(); -} - -function SimGroup::clearFlagWaypoints(%this) -{ - for(%i = %this.getCount() - 1; %i >= 0; %i--) - %this.getObject(%i).clearFlagWaypoints(); -} - -function CTFGame::getTeamSkin(%game, %team) -{ - - if(isDemo() || $host::tournamentMode) - { - return $teamSkin[%team]; - } - - else - { - //error("CTFGame::getTeamSkin"); - if(!$host::useCustomSkins) - { - %terrain = MissionGroup.musicTrack; - //error("Terrain type is: " SPC %terrain); - switch$(%terrain) - { - case "lush": - if(%team == 1) - %skin = 'beagle'; - else if(%team == 2) - %skin = 'dsword'; - else %skin = 'base'; - - case "badlands": - if(%team == 1) - %skin = 'swolf'; - else if(%team == 2) - %skin = 'dsword'; - else %skin = 'base'; - - case "ice": - if(%team == 1) - %skin = 'swolf'; - else if(%team == 2) - %skin = 'beagle'; - else %skin = 'base'; - - case "desert": - if(%team == 1) - %skin = 'cotp'; - else if(%team == 2) - %skin = 'beagle'; - else %skin = 'base'; - - case "Volcanic": - if(%team == 1) - %skin = 'dsword'; - else if(%team == 2) - %skin = 'cotp'; - else %skin = 'base'; - - default: - if(%team == 2) - %skin = 'baseb'; - else %skin = 'base'; - } - } - else %skin = $teamSkin[%team]; - - //error("%skin = " SPC getTaggedString(%skin)); - return %skin; -} -} - -function CTFGame::getTeamName(%game, %team) -{ - if ( isDemo() || $host::tournamentMode) - return $TeamName[%team]; - - //error("CTFGame::getTeamName"); - if(!$host::useCustomSkins) - { - %terrain = MissionGroup.musicTrack; - //error("Terrain type is: " SPC %terrain); - switch$(%terrain) - { - case "lush": - if(%team == 1) - %name = 'Blood Eagle'; - else if(%team == 2) - %name = 'Diamond Sword'; - - case "badlands": - if(%team == 1) - %name = 'Starwolf'; - else if(%team == 2) - %name = 'Diamond Sword'; - - case "ice": - if(%team == 1) - %name = 'Starwolf'; - else if(%team == 2) - %name = 'Blood Eagle'; - - case "desert": - if(%team == 1) - %name = 'Phoenix'; - else if(%team == 2) - %name = 'Blood Eagle'; - - case "Volcanic": - if(%team == 1) - %name = 'Diamond Sword'; - else if(%team == 2) - %name = 'Phoenix'; - - default: - if(%team == 2) - %name = 'Inferno'; - else - %name = 'Storm'; - } - - if(%name $= "") - { - //error("No team Name ============================="); - %name = $teamName[%team]; - } - } - else - %name = $TeamName[%team]; - - //error("%name = " SPC getTaggedString(%name)); - return %name; -} - -//-------------------------------------------------------------------------- -function CTFGame::missionLoadDone(%game) -{ - //default version sets up teams - must be called first... - DefaultGame::missionLoadDone(%game); - - for(%i = 1; %i < (%game.numTeams + 1); %i++) - $teamScore[%i] = 0; - - // remove - MissionGroup.clearFlagWaypoints(); - - //reset some globals, just in case... - $dontScoreTimer[1] = false; - $dontScoreTimer[2] = false; - - echo( "starting camp thread..." ); - %game.campThread_1 = schedule( 1000, 0, "checkVehicleCamping", 1 ); - %game.campThread_2 = schedule( 1000, 0, "checkVehicleCamping", 2 ); -} - -function CTFGame::playerTouchFlag(%game, %player, %flag) -{ - %client = %player.client; - - if ((%flag.carrier $= "") && (%player.getState() !$= "Dead")) - { - //flag isn't held and has been touched by a live player - if (%client.team == %flag.team) - %game.playerTouchOwnFlag(%player, %flag); - else - %game.playerTouchEnemyFlag(%player, %flag); - } - - // toggle visibility of the flag - setTargetRenderMask(%flag.waypoint.getTarget(), %flag.isHome ? 0 : 1); - -} - -function CTFGame::playerTouchOwnFlag(%game, %player, %flag) -{ - if(%flag.isHome) - { - if (%player.holdingFlag !$= "") - %game.flagCap(%player); - } - else - %game.flagReturn(%flag, %player); - - //call the AI function - %game.AIplayerTouchOwnFlag(%player, %flag); -} - -function CTFGame::playerTouchEnemyFlag(%game, %player, %flag) -{ - %client = %player.client; - %player.holdingFlag = %flag; //%player has this flag - %flag.carrier = %player; //this %flag is carried by %player - - %player.mountImage(FlagImage, $FlagSlot, true, %game.getTeamSkin(%flag.team)); - - %game.playerGotFlagTarget(%player); - //only cancel the return timer if the player is in bounds... - if (!%client.outOfBounds) - { - cancel($FlagReturnTimer[%flag]); - $FlagReturnTimer[%flag] = ""; - } - - //if this flag was "at home", see if both flags have now been taken - if (%flag.isHome) - { - // tiebreaker score - game.awardScoreFlagTouch( %client, %flag ); - - %startStalemate = false; - if ($TeamFlag[1] == %flag) - %startStalemate = !$TeamFlag[2].isHome; - else - %startStalemate = !$TeamFlag[1].isHome; - - if (%startStalemate) - %game.stalemateSchedule = %game.schedule(%game.stalemateTimeMS, beginStalemate); - - } - - %flag.hide(true); - %flag.startFade(0, 0, false); - %flag.isHome = false; - if(%flag.stand) - %flag.stand.getDataBlock().onFlagTaken(%flag.stand);//animate, if exterior stand - - $flagStatus[%flag.team] = %client.nameBase; - %teamName = %game.getTeamName(%flag.team); - messageTeamExcept(%client, 'MsgCTFFlagTaken', '\c2Teammate %1 took the %2 flag.~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase); - messageTeam(%flag.team, 'MsgCTFFlagTaken', '\c2Your flag has been taken by %1!~wfx/misc/flag_taken.wav',%client.name, 0, %flag.team, %client.nameBase); - messageTeam(0, 'MsgCTFFlagTaken', '\c2%1 took the %2 flag.~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase); - messageClient(%client, 'MsgCTFFlagTaken', '\c2You took the %2 flag.~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase); - logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") took team "@%flag.team@" flag"); - - //call the AI function - %game.AIplayerTouchEnemyFlag(%player, %flag); - - //if the player is out of bounds, then in 3 seconds, it should be thrown back towards the in bounds area... - if (%client.outOfBounds) - %game.schedule(3000, "boundaryLoseFlag", %player); -} - -function CTFGame::playerGotFlagTarget(%game, %player) -{ - %player.scopeWhenSensorVisible(true); - %target = %player.getTarget(); - setTargetRenderMask(%target, getTargetRenderMask(%target) | 0x2); - if(%game.stalemateObjsVisible) - setTargetAlwaysVisMask(%target, 0x7); -} - -function CTFGame::playerLostFlagTarget(%game, %player) -{ - %player.scopeWhenSensorVisible(false); - %target = %player.getTarget(); - setTargetRenderMask(%target, getTargetRenderMask(%target) & ~0x2); - // clear his always vis target mask - setTargetAlwaysVisMask(%target, (1 << getTargetSensorGroup(%target))); -} - -function CTFGame::playerDroppedFlag(%game, %player) -{ - %client = %player.client; - %flag = %player.holdingFlag; - - %game.playerLostFlagTarget(%player); - - %player.holdingFlag = ""; //player isn't holding a flag anymore - %flag.carrier = ""; //flag isn't held anymore - $flagStatus[%flag.team] = ""; - - %player.unMountImage($FlagSlot); - %flag.hide(false); //Does the throwItem function handle this? - - %teamName = %game.getTeamName(%flag.team); - messageTeamExcept(%client, 'MsgCTFFlagDropped', '\c2Teammate %1 dropped the %2 flag.~wfx/misc/flag_drop.wav', %client.name, %teamName, %flag.team); - messageTeam(%flag.team, 'MsgCTFFlagDropped', '\c2Your flag has been dropped by %1!~wfx/misc/flag_drop.wav', %client.name, 0, %flag.team); - messageTeam(0, 'MsgCTFFlagDropped', '\c2%1 dropped the %2 flag.~wfx/misc/flag_drop.wav', %client.name, %teamName, %flag.team); - if(!%player.client.outOfBounds) - messageClient(%client, 'MsgCTFFlagDropped', '\c2You dropped the %2 flag.~wfx/misc/flag_drop.wav', 0, %teamName, %flag.team); - logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") dropped team "@%flag.team@" flag"); - - //don't duplicate the schedule if there's already one in progress... - if ($FlagReturnTimer[%flag] <= 0) - $FlagReturnTimer[%flag] = %game.schedule(%game.FLAG_RETURN_DELAY - %game.fadeTimeMS, "flagReturnFade", %flag); - - //call the AI function - %game.AIplayerDroppedFlag(%player, %flag); -} - -function CTFGame::flagCap(%game, %player) -{ - %client = %player.client; - %flag = %player.holdingFlag; - %flag.carrier = ""; - - %game.playerLostFlagTarget(%player); - //award points to player and team - %teamName = %game.getTeamName(%flag.team); - messageTeamExcept(%client, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag!~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team); - messageTeam(%flag.team, 'MsgCTFFlagCapped', '\c2Your flag was captured by %1.~wfx/misc/flag_lost.wav', %client.name, 0, %flag.team, %client.team); - messageTeam(0, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag!~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team); - messageClient(%client, 'MsgCTFFlagCapped', '\c2You captured the %2 flag!~wfx/misc/flag_capture.wav', 0, %teamName, %flag.team, %client.team); - - logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") capped team "@%client.team@" flag"); - %player.holdingFlag = ""; //no longer holding it. - %player.unMountImage($FlagSlot); - %game.awardScoreFlagCap(%client, %flag); - %game.flagReset(%flag); - - //call the AI function - %game.AIflagCap(%player, %flag); - - //if this cap didn't end the game, play the announcer... - if ($missionRunning) - { - if (%game.getTeamName(%client.team) $= 'Inferno') - messageAll("", '~wvoice/announcer/ann.infscores.wav'); - else if (%game.getTeamName(%client.team) $= 'Storm') - messageAll("", '~wvoice/announcer/ann.stoscores.wav'); - else if (%game.getTeamName(%client.team) $= 'Phoenix') - messageAll("", '~wvoice/announcer/ann.pxscore.wav'); - else if (%game.getTeamName(%client.team) $= 'Blood Eagle') - messageAll("", '~wvoice/announcer/ann.bescore.wav'); - else if (%game.getTeamName(%client.team) $= 'Diamond Sword') - messageAll("", '~wvoice/announcer/ann.dsscore.wav'); - else if (%game.getTeamName(%client.team) $= 'Starwolf') - messageAll("", '~wvoice/announcer/ann.swscore.wav'); - } -} - -function CTFGame::flagReturnFade(%game, %flag) -{ - $FlagReturnTimer[%flag] = %game.schedule(%game.fadeTimeMS, "flagReturn", %flag); - %flag.startFade(%game.fadeTimeMS, 0, true); -} - -function CTFGame::flagReturn(%game, %flag, %player) -{ - cancel($FlagReturnTimer[%flag]); - $FlagReturnTimer[%flag] = ""; - - if(%flag.team == 1) - %otherTeam = 2; - else - %otherTeam = 1; - %teamName = %game.getTeamName(%flag.team); - if (%player !$= "") - { - //a player returned it - %client = %player.client; - messageTeamExcept(%client, 'MsgCTFFlagReturned', '\c2Teammate %1 returned your flag to base.~wfx/misc/flag_return.wav', %client.name, 0, %flag.team); - messageTeam(%otherTeam, 'MsgCTFFlagReturned', '\c2Enemy %1 returned the %2 flag.~wfx/misc/flag_return.wav', %client.name, %teamName, %flag.team); - messageTeam(0, 'MsgCTFFlagReturned', '\c2%1 returned the %2 flag.~wfx/misc/flag_return.wav', %client.name, %teamName, %flag.team); - messageClient(%client, 'MsgCTFFlagReturned', '\c2You returned your flag.~wfx/misc/flag_return.wav', 0, %teamName, %flag.team); - logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") returned team "@%flag.team@" flag"); - - // find out what type of return it is - // stalemate return? - if(!isDemo()) - { - if(%game.stalemate) - { - //error("Stalemate return!!!"); - %game.awardScoreStalemateReturn(%player.client); - } - // regular return - else - { - %enemyFlagDist = vectorDist($flagPos[%flag.team], $flagPos[%otherTeam]); - %dist = vectorDist(%flag.position, %flag.originalPosition); - - %rawRatio = %dist/%enemyFlagDist; - %ratio = %rawRatio < 1 ? %rawRatio : 1; - %percentage = mFloor( (%ratio) * 10 ) * 10; - %game.awardScoreFlagReturn(%player.client, %percentage); - } - } - else %game.awardScoreFlagReturn(%player.client); - } - else - { - //returned due to timer - messageTeam(%otherTeam, 'MsgCTFFlagReturned', '\c2The %2 flag was returned to base.~wfx/misc/flag_return.wav', 0, %teamName, %flag.team); //because it was dropped for too long - messageTeam(%flag.team, 'MsgCTFFlagReturned', '\c2Your flag was returned.~wfx/misc/flag_return.wav', 0, 0, %flag.team); - messageTeam(0, 'MsgCTFFlagReturned', '\c2The %2 flag was returned to base.~wfx/misc/flag_return.wav', 0, %teamName, %flag.team); - logEcho("team "@%flag.team@" flag returned (timeout)"); - } - - %game.flagReset(%flag); -} - -function CTFGame::showStalemateTargets(%game) -{ - cancel(%game.stalemateSchedule); - - //show the targets - for (%i = 1; %i <= 2; %i++) - { - %flag = $TeamFlag[%i]; - - //find the object to scope/waypoint.... - //render the target hud icon for slot 1 (a centermass flag) - //if we just set him as always sensor vis, it'll work fine. - if (isObject(%flag.carrier)) - setTargetAlwaysVisMask(%flag.carrier.getTarget(), 0x7); - } - - //schedule the targets to hide - %game.stalemateObjsVisible = true; - %game.stalemateSchedule = %game.schedule(%game.stalemateDurationMS, hideStalemateTargets); -} - -function CTFGame::hideStalemateTargets(%game) -{ - cancel(%game.stalemateSchedule); - - //hide the targets - for (%i = 1; %i <= 2; %i++) - { - %flag = $TeamFlag[%i]; - if (isObject(%flag.carrier)) - { - %target = %flag.carrier.getTarget(); - setTargetAlwaysVisMask(%target, (1 << getTargetSensorGroup(%target))); - } - } - - //schedule the targets to show again - %game.stalemateObjsVisible = false; - %game.stalemateSchedule = %game.schedule(%game.stalemateFreqMS, showStalemateTargets); -} - -function CTFGame::beginStalemate(%game) -{ - %game.stalemate = true; - %game.showStalemateTargets(); -} - -function CTFGame::endStalemate(%game) -{ - %game.stalemate = false; - %game.hideStalemateTargets(); - cancel(%game.stalemateSchedule); -} - -function CTFGame::flagReset(%game, %flag) -{ - //any time a flag is reset, kill the stalemate schedule - %game.endStalemate(); - - //make sure if there's a player carrying it (probably one out of bounds...), it is stripped first - if (isObject(%flag.carrier)) - { - //hide the target hud icon for slot 2 (a centermass flag - visible only as part of a teams sensor network) - %game.playerLostFlagTarget(%flag.carrier); - %flag.carrier.holdingFlag = ""; //no longer holding it. - %flag.carrier.unMountImage($FlagSlot); - } - - //fades, restore default position, home, velocity, general status, etc. - %flag.setVelocity("0 0 0"); - %flag.setTransform(%flag.originalPosition); - %flag.isHome = true; - %flag.carrier = ""; - %flag.grabber = ""; - $flagStatus[%flag.team] = ""; - %flag.hide(false); - if(%flag.stand) - %flag.stand.getDataBlock().onFlagReturn(%flag.stand);//animate, if exterior stand - - //fade the flag in... - %flag.startFade(%game.fadeTimeMS, 0, false); - - // dont render base target - setTargetRenderMask(%flag.waypoint.getTarget(), 0); - - //call the AI function - %game.AIflagReset(%flag); - - // ------------------------------------------ - // z0dd - ZOD, 5/27/02. Fixes flags hovering - // over friendly player when collision occurs - %flag.static = true; -} - -function CTFGame::timeLimitReached(%game) -{ - logEcho("game over (timelimit)"); - %game.gameOver(); - cycleMissions(); -} - -function CTFGame::scoreLimitReached(%game) -{ - logEcho("game over (scorelimit)"); - %game.gameOver(); - cycleMissions(); -} - -function CTFGame::notifyMineDeployed(%game, %mine) -{ - //see if the mine is within 5 meters of the flag stand... - %mineTeam = %mine.sourceObject.team; - %homeFlag = $TeamFlag[%mineTeam]; - if (isObject(%homeFlag)) - { - %dist = VectorDist(%homeFlag.originalPosition, %mine.position); - if (%dist <= %game.notifyMineDist) - { - messageTeam(%mineTeam, 'MsgCTFFlagMined', "The flag has been mined.~wvoice/announcer/flag_minedFem.wav" ); - } - } -} - -function CTFGame::gameOver(%game) -{ - //call the default - DefaultGame::gameOver(%game); - - //send the winner message - %winner = ""; - if ($teamScore[1] > $teamScore[2]) - %winner = %game.getTeamName(1); - else if ($teamScore[2] > $teamScore[1]) - %winner = %game.getTeamName(2); - - if (%winner $= 'Storm') - messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.stowins.wav" ); - else if (%winner $= 'Inferno') - messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.infwins.wav" ); - else if (%winner $= 'Starwolf') - messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.swwin.wav" ); - else if (%winner $= 'Blood Eagle') - messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.bewin.wav" ); - else if (%winner $= 'Diamond Sword') - messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.dswin.wav" ); - else if (%winner $= 'Phoenix') - messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.pxwin.wav" ); - else - messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); - - messageAll('MsgClearObjHud', ""); - for(%i = 0; %i < ClientGroup.getCount(); %i ++) - { - %client = ClientGroup.getObject(%i); - %game.resetScore(%client); - } - for(%j = 1; %j <= %game.numTeams; %j++) - $TeamScore[%j] = 0; -} - -function CTFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc) -{ - if(%clVictim.headshot && %damageType == $DamageType::Laser && %clVictim.team != %clAttacker.team) - { - %clAttacker.scoreHeadshot++; - if (%game.SCORE_PER_HEADSHOT != 0) - { - messageClient(%clAttacker, 'msgHeadshot', '\c0You received a %1 point bonus for a successful headshot.', %game.SCORE_PER_HEADSHOT); - } - %game.recalcScore(%clAttacker); - } - - //the DefaultGame will set some vars - DefaultGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc); - - - //if victim is carrying a flag and is not on the attackers team, mark the attacker as a threat for x seconds(for scoring purposes) - if ((%clVictim.holdingFlag !$= "") && (%clVictim.team != %clAttacker.team)) - { - %clAttacker.dmgdFlagCarrier = true; - cancel(%clAttacker.threatTimer); //restart timer - %clAttacker.threatTimer = schedule(%game.TIME_CONSIDERED_FLAGCARRIER_THREAT, %clAttacker.dmgdFlagCarrier = false); - } - - -} - -//////////////////////////////////////////////////////////////////////////////////////// -function CTFGame::clientMissionDropReady(%game, %client) -{ - messageClient(%client, 'MsgClientReady',"", %game.class); - %game.resetScore(%client); - for(%i = 1; %i <= %game.numTeams; %i++) - { - $Teams[%i].score = 0; - messageClient(%client, 'MsgCTFAddTeam', "", %i, %game.getTeamName(%i), $flagStatus[%i], $TeamScore[%i]); - } - //%game.populateTeamRankArray(%client); - - //messageClient(%client, 'MsgYourRankIs', "", -1); - - messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); - - DefaultGame::clientMissionDropReady(%game, %client); -} - -function CTFGame::assignClientTeam(%game, %client, %respawn) -{ - DefaultGame::assignClientTeam(%game, %client, %respawn); - // if player's team is not on top of objective hud, switch lines - messageClient(%client, 'MsgCheckTeamLines', "", %client.team); -} - -function CTFGame::recalcScore(%game, %cl) -{ - %killValue = %cl.kills * %game.SCORE_PER_KILL; - %deathValue = %cl.deaths * %game.SCORE_PER_DEATH; - - if (%killValue - %deathValue == 0) - %killPoints = 0; - else - %killPoints = (%killValue * %killValue) / (%killValue - %deathValue); - - if(!isDemo()) - { - %cl.offenseScore = %killPoints + - %cl.suicides * %game.SCORE_PER_SUICIDE + - %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + - %cl.teamKills * %game.SCORE_PER_TEAMKILL + - %cl.scoreHeadshot * %game.SCORE_PER_HEADSHOT + - %cl.flagCaps * %game.SCORE_PER_PLYR_FLAG_CAP + - %cl.flagGrabs * %game.SCORE_PER_PLYR_FLAG_TOUCH + - %cl.genDestroys * %game.SCORE_PER_DESTROY_GEN + - %cl.sensorDestroys * %game.SCORE_PER_DESTROY_SENSOR + - %cl.turretDestroys * %game.SCORE_PER_DESTROY_TURRET + - %cl.iStationDestroys * %game.SCORE_PER_DESTROY_ISTATION + - %cl.vstationDestroys * %game.SCORE_PER_DESTROY_VSTATION + - %cl.solarDestroys * %game.SCORE_PER_DESTROY_SOLAR + - %cl.sentryDestroys * %game.SCORE_PER_DESTROY_SENTRY + - %cl.depSensorDestroys * %game.SCORE_PER_DESTROY_DEP_SENSOR + - %cl.depTurretDestroys * %game.SCORE_PER_DESTROY_DEP_TUR + - %cl.depStationDestroys * %game.SCORE_PER_DESTROY_DEP_INV + - %cl.vehicleScore + %cl.vehicleBonus; - - %cl.defenseScore = %cl.genDefends * %game.SCORE_PER_GEN_DEFEND + - %cl.flagDefends * %game.SCORE_PER_FLAG_DEFEND + - %cl.carrierKills * %game.SCORE_PER_CARRIER_KILL + - %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + - %cl.turretKills * %game.SCORE_PER_TURRET_KILL_AUTO + - %cl.mannedturretKills * %game.SCORE_PER_TURRET_KILL + - %cl.genRepairs * %game.SCORE_PER_REPAIR_GEN + - %cl.SensorRepairs * %game.SCORE_PER_REPAIR_SENSOR + - %cl.TurretRepairs * %game.SCORE_PER_REPAIR_TURRET + - %cl.StationRepairs * %game.SCORE_PER_REPAIR_ISTATION + - %cl.VStationRepairs * %game.SCORE_PER_REPAIR_VSTATION + - %cl.solarRepairs * %game.SCORE_PER_REPAIR_SOLAR + - %cl.sentryRepairs * %game.SCORE_PER_REPAIR_SENTRY + - %cl.depInvRepairs * %game.SCORE_PER_REPAIR_DEP_INV + - %cl.depTurretRepairs * %game.SCORE_PER_REPAIR_DEP_TUR + - %cl.returnPts; - } - - if( isDemo() ) - { - %cl.offenseScore = %killPoints + - %cl.flagDefends * %game.SCORE_PER_FLAG_DEFEND + - %cl.suicides * %game.SCORE_PER_SUICIDE + //-1 - %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + // 1 - %cl.teamKills * %game.SCORE_PER_TEAMKILL + // -1 - %cl.flagCaps * %game.SCORE_PER_PLYR_FLAG_CAP + // 3 - %cl.genDestroys * %game.SCORE_PER_GEN_DESTROY; // 2 - - %cl.defenseScore = %cl.genDefends * %game.SCORE_PER_GEN_DEFEND + // 1 - %cl.carrierKills * %game.SCORE_PER_CARRIER_KILL + // 1 - %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + // 1 - %cl.turretKills * %game.SCORE_PER_TURRET_KILL + // 1 - %cl.flagReturns * %game.SCORE_PER_FLAG_RETURN + // 1 - %cl.genRepairs * %game.SCORE_PER_GEN_REPAIR; // 1 - } - - %cl.score = mFloor(%cl.offenseScore + %cl.defenseScore + (%cl.zkills * $zombie::killpoints)); - - %game.recalcTeamRanks(%cl); -} - -function CTFGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) -{ -// is this a vehicle kill rather than a player kill - - // console error message suppression - if( isObject( %implement ) ) - { - if( %implement.getDataBlock().getName() $= "AssaultPlasmaTurret" || %implement.getDataBlock().getName() $= "BomberTurret" ) // gunner - %clKiller = %implement.vehicleMounted.getMountNodeObject(1).client; - else if(%implement.getDataBlock().catagory $= "Vehicles") // pilot - %clKiller = %implement.getMountNodeObject(0).client; - } - - if(%game.testTurretKill(%implement)) //check for turretkill before awarded a non client points for a kill - %game.awardScoreTurretKill(%clVictim, %implement); - else if (%game.testKill(%clVictim, %clKiller)) //verify victim was an enemy - { - %value = %game.awardScoreKill(%clKiller); - %game.shareScore(%clKiller, %value); - %game.awardScoreDeath(%clVictim); - - if (%game.testGenDefend(%clVictim, %clKiller)) - %game.awardScoreGenDefend(%clKiller); - - if(%game.testCarrierKill(%clVictim, %clKiller)) - %game.awardScoreCarrierKill(%clKiller); - else - { - if (%game.testFlagDefend(%clVictim, %clKiller)) - %game.awardScoreFlagDefend(%clKiller); - } - if (%game.testEscortAssist(%clVictim, %clKiller)) - %game.awardScoreEscortAssist(%clKiller); - } - else - { - if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide - { - %game.awardScoreSuicide(%clVictim); - } - else - { - if (%game.testTeamKill(%clVictim, %clKiller)) //otherwise test for a teamkill - %game.awardScoreTeamKill(%clVictim, %clKiller); - } - } -} - -function CTFGame::testFlagDefend(%game, %victimID, %killerID) -{ - InitContainerRadiusSearch(%victimID.plyrPointOfDeath, %game.RADIUS_FLAG_DEFENSE, $TypeMasks::ItemObjectType); - %objID = containerSearchNext(); - while(%objID != 0) - { - %objType = %objID.getDataBlock().getName(); - if ((%objType $= "Flag") && (%objID.team == %killerID.team)) - return true; //found the(a) killer's flag near the victim's point of death - else - %objID = containerSearchNext(); - } - return false; //didn't find a qualifying flag within required radius of victims point of death -} - -function CTFGame::testGenDefend(%game, %victimID, %killerID) -{ - InitContainerRadiusSearch(%victimID.plyrPointOfDeath, %game.RADIUS_GEN_DEFENSE, $TypeMasks::StaticShapeObjectType); - %objID = containerSearchNext(); - while(%objID != 0) - { - %objType = %objID.getDataBlock().ClassName; - if ((%objType $= "generator") && (%objID.team == %killerID.team)) - return true; //found a killer's generator within required radius of victim's death - else - %objID = containerSearchNext(); - } - return false; //didn't find a qualifying gen within required radius of victim's point of death -} - -function CTFGame::testCarrierKill(%game, %victimID, %killerID) -{ - %flag = %victimID.plyrDiedHoldingFlag; - return ((%flag !$= "") && (%flag.team == %killerID.team)); -} - -function CTFGame::testEscortAssist(%game, %victimID, %killerID) -{ - return (%victimID.dmgdFlagCarrier); -} - -function CTFGame::testValidRepair(%game, %obj) -{ - if(!%obj.wasDisabled) - { - //error(%obj SPC "was never disabled"); - return false; - } - else if(%obj.lastDamagedByTeam == %obj.team) - { - //error(%obj SPC "was last damaged by a friendly"); - return false; - } - else if(%obj.team != %obj.repairedBy.team) - { - //error(%obj SPC "was repaired by an enemy"); - return false; - } - else - { - if(%obj.soiledByEnemyRepair) - %obj.soiledByEnemyRepair = false; - return true; - } -} - -function CTFGame::awardScoreFlagCap(%game, %cl, %flag) -{ - %cl.flagCaps++; - $TeamScore[%cl.team] += %game.SCORE_PER_TEAM_FLAG_CAP; - messageAll('MsgTeamScoreIs', "", %cl.team, $TeamScore[%cl.team]); - - %flag.grabber.flagGrabs++; - - if (%game.SCORE_PER_TEAM_FLAG_CAP > 0) - { - %plural = (%game.SCORE_PER_PLYR_FLAG_CAP != 1 ? 's' : ""); - %plural2 = (%game.SCORE_PER_PLYR_FLAG_TOUCH != 1 ? 's' : ""); - - if(isDemo()) - { - messageTeam(%flag.team, 'msgCTFEnemyCap', '\c0Enemy %1 received %2 point%3 for capturing your flag!', %cl.name, %game.SCORE_PER_PLYR_FLAG_CAP, %plural); - messageTeamExcept(%cl, 'msgCTFFriendCap', '\c0Teammate %1 receives %2 point%3 for capturing the enemy flag!', %cl.name, %game.SCORE_PER_PLYR_FLAG_CAP, %plural); - messageClient(%cl, 'msgCTFFriendCap', '\c0You receive %1 point%2 for stealing and capturing the enemy flag!', %game.SCORE_PER_PLYR_FLAG_CAP, %plural); - } - - if(!isDemo()) - { - if(%cl == %flag.grabber) - { - messageClient(%cl, 'msgCTFFriendCap', '\c0You receive %1 point%2 for stealing and capturing the enemy flag!', %game.SCORE_PER_PLYR_FLAG_CAP+%game.SCORE_PER_PLYR_FLAG_TOUCH, %plural); - messageTeam(%flag.team, 'msgCTFEnemyCap', '\c0Enemy %1 received %2 point%3 for capturing your flag!', %cl.name, %game.SCORE_PER_PLYR_FLAG_CAP+%game.SCORE_PER_PLYR_FLAG_TOUCH, %plural); - messageTeamExcept(%cl, 'msgCTFFriendCap', '\c0Teammate %1 receives %2 point%3 for capturing the enemy flag!', %cl.name, %game.SCORE_PER_PLYR_FLAG_CAP+%game.SCORE_PER_PLYR_FLAG_TOUCH, %plural); - } - else - { - if(isObject(%flag.grabber)) // is the grabber still here? - { - messageClient(%cl, 'msgCTFFriendCap', '\c0You receive %1 point%2 for capturing the enemy flag! %3 gets %4 point%5 for the steal assist.', %game.SCORE_PER_PLYR_FLAG_CAP, %plural, %flag.grabber.name, %game.SCORE_PER_PLYR_FLAG_TOUCH, %plural2); - messageClient(%flag.grabber, 'msgCTFFriendCap', '\c0You receive %1 point%2 for stealing a flag that was subsequently capped by %3.', %game.SCORE_PER_PLYR_FLAG_TOUCH, %plural2, %cl.name); - } - else - messageClient(%cl, 'msgCTFFriendCap', '\c0You receive %1 point%2 for capturing the enemy flag!', %game.SCORE_PER_PLYR_FLAG_CAP, %plural); - - messageTeamExcept(%cl, 'msgCTFFriendCap', '\c0Teammate %1 receives %2 point%3 for capturing the enemy flag!', %cl.name, %game.SCORE_PER_PLYR_FLAG_CAP, %plural); - messageTeam(%flag.team, 'msgCTFEnemyCap', '\c0Enemy %1 received %2 point%3 for capturing your flag!', %cl.name, %game.SCORE_PER_PLYR_FLAG_CAP, %plural); - } - } - } - - %game.recalcScore(%cl); - - if(isObject(%flag.grabber)) - %game.recalcScore(%flag.grabber); - - %game.checkScoreLimit(%cl.team); -} - - -function CTFGame::awardScoreFlagTouch(%game, %cl, %flag) -{ - - %flag.grabber = %cl; - %team = %cl.team; - if( $DontScoreTimer[%team] ) - return; - - $dontScoreTimer[%team] = true; - //tinman - needed to remove all game calls to "eval" for the PURE server... - %game.schedule(%game.TOUCH_DELAY_MS, resetDontScoreTimer, %team); - //schedule(%game.TOUCH_DELAY_MS, 0, eval, "$dontScoreTimer["@%team@"] = false;"); - schedule(%game.TOUCH_DELAY_MS, 0, eval, "$dontScoreTimer["@%team@"] = false;"); - $TeamScore[%team] += %game.SCORE_PER_TEAM_FLAG_TOUCH; - messageAll('MsgTeamScoreIs', "", %team, $TeamScore[%team]); - - if (%game.SCORE_PER_TEAM_FLAG_TOUCH > 0) - { - %plural = (%game.SCORE_PER_TEAM_FLAG_TOUCH != 1 ? 's' : ""); - messageTeam(%team, 'msgCTFFriendFlagTouch', '\c0Your team receives %1 point%2 for grabbing the enemy flag!', %game.SCORE_PER_TEAM_FLAG_TOUCH, %plural); - messageTeam(%flag.team, 'msgCTFEnemyFlagTouch', '\c0Enemy %1 receives %2 point%3 for grabbing your flag!', %cl.name, %game.SCORE_PER_TEAM_FLAG_TOUCH, %plural); - } - %game.recalcScore(%cl); - %game.checkScoreLimit(%team); -} - -function CTFGame::resetDontScoreTimer(%game, %team) -{ - $dontScoreTimer[%team] = false; -} - -function CTFGame::checkScoreLimit(%game, %team) -{ - %scoreLimit = MissionGroup.CTF_scoreLimit * %game.SCORE_PER_TEAM_FLAG_CAP; - // default of 5 if scoreLimit not defined - if(%scoreLimit $= "") - %scoreLimit = 5 * %game.SCORE_PER_TEAM_FLAG_CAP; - if($TeamScore[%team] >= %scoreLimit) - %game.scoreLimitReached(); -} - -function CTFGame::awardScoreFlagReturn(%game, %cl, %perc) -{ - if(isDemo()) - { - %cl.flagReturns++; - if (%game.SCORE_PER_FLAG_RETURN != 0) - { - messageClient(%cl, 'scoreFlaRetMsg', '\c0You received a %1 point bonus for returning your flag.', %game.SCORE_PER_FLAG_RETURN); - //messageTeamExcept(%cl, 'scoreFlaRetMsg', '\c0Teammate %1 received a %2 point bonus for returning your flag.', %cl.name, %game.SCORE_PER_FLAG_RETURN); - } - %game.recalcScore(%cl); - } - else - { - if (%game.SCORE_PER_FLAG_RETURN != 0) - { - %pts = mfloor( %game.SCORE_PER_FLAG_RETURN * (%perc/100) ); - if(%perc == 100) - messageClient(%cl, 'scoreFlaRetMsg', 'Flag return - exceeded capping distance - %1 point bonus.', %pts, %perc); - else if(%perc == 0) - messageClient(%cl, 'scoreFlaRetMsg', 'You gently place the flag back on the stand.', %pts, %perc); - else - messageClient(%cl, 'scoreFlaRetMsg', '\c0Flag return from %2%% of capping distance - %1 point bonus.', %pts, %perc); - %cl.returnPts += %pts; - } - %game.recalcScore(%cl); - return %game.SCORE_PER_FLAG_RETURN; - } -} - -function CTFGame::awardScoreStalemateReturn(%game, %cl) -{ - if (%game.SCORE_PER_STALEMATE_RETURN != 0) - { - messageClient(%cl, 'scoreStaleRetMsg', '\c0You received a %1 point bonus for a stalemate-breaking, flag return.', %game.SCORE_PER_STALEMATE_RETURN); - %cl.returnPts += %game.SCORE_PER_STALEMATE_RETURN; - } - %game.recalcScore(%cl); - return %game.SCORE_PER_STALEMATE_RETURN; -} - -// Asset Destruction scoring -function CTFGame::awardScoreGenDestroy(%game,%cl) -{ - %cl.genDestroys++; - if (%game.SCORE_PER_DESTROY_GEN != 0) - { - messageClient(%cl, 'msgGenDes', '\c0You received a %1 point bonus for destroying an enemy generator.', %game.SCORE_PER_DESTROY_GEN); - //messageTeamExcept(%cl, 'msgGenDes', '\c0Teammate %1 received a %2 point bonus for destroying an enemy generator.', %cl.name, %game.SCORE_PER_GEN_DESTROY); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_DESTROY_GEN; -} - -function CTFGame::awardScoreSensorDestroy(%game,%cl) -{ - %cl.sensorDestroys++; - if (%game.SCORE_PER_DESTROY_SENSOR != 0) - { - messageClient(%cl, 'msgSensorDes', '\c0You received a %1 point bonus for destroying an enemy sensor.', %game.SCORE_PER_DESTROY_SENSOR); - //messageTeamExcept(%cl, 'msgGenDes', '\c0Teammate %1 received a %2 point bonus for destroying an enemy generator.', %cl.name, %game.SCORE_PER_GEN_DESTROY); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_DESTROY_SENSOR; -} - -function CTFGame::awardScoreTurretDestroy(%game,%cl) -{ - %cl.turretDestroys++; - if (%game.SCORE_PER_DESTROY_TURRET != 0) - { - messageClient(%cl, 'msgTurretDes', '\c0You received a %1 point bonus for destroying an enemy turret.', %game.SCORE_PER_DESTROY_TURRET); - //messageTeamExcept(%cl, 'msgGenDes', '\c0Teammate %1 received a %2 point bonus for destroying an enemy generator.', %cl.name, %game.SCORE_PER_GEN_DESTROY); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_DESTROY_TURRET; -} - -function CTFGame::awardScoreInvDestroy(%game,%cl) -{ - %cl.IStationDestroys++; - if (%game.SCORE_PER_DESTROY_ISTATION != 0) - { - messageClient(%cl, 'msgInvDes', '\c0You received a %1 point bonus for destroying an enemy inventory station.', %game.SCORE_PER_DESTROY_ISTATION); - //messageTeamExcept(%cl, 'msgGenDes', '\c0Teammate %1 received a %2 point bonus for destroying an enemy generator.', %cl.name, %game.SCORE_PER_GEN_DESTROY); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_DESTROY_ISTATION; -} - -function CTFGame::awardScoreVehicleStationDestroy(%game,%cl) -{ - %cl.VStationDestroys++; - if (%game.SCORE_PER_DESTROY_VSTATION != 0) - { - messageClient(%cl, 'msgVSDes', '\c0You received a %1 point bonus for destroying an enemy vehicle station.', %game.SCORE_PER_DESTROY_VSTATION); - //messageTeamExcept(%cl, 'msgGenDes', '\c0Teammate %1 received a %2 point bonus for destroying an enemy generator.', %cl.name, %game.SCORE_PER_GEN_DESTROY); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_DESTROY_VSTATION; -} - -function CTFGame::awardScoreSolarDestroy(%game,%cl) -{ - %cl.SolarDestroys++; - if (%game.SCORE_PER_DESTROY_SOLAR != 0) - { - messageClient(%cl, 'msgSolarDes', '\c0You received a %1 point bonus for destroying an enemy solar panel.', %game.SCORE_PER_DESTROY_SOLAR); - //messageTeamExcept(%cl, 'msgGenDes', '\c0Teammate %1 received a %2 point bonus for destroying an enemy generator.', %cl.name, %game.SCORE_PER_GEN_DESTROY); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_DESTROY_SOLAR; -} - -function CTFGame::awardScoreSentryDestroy(%game,%cl) -{ - %cl.sentryDestroys++; - if (%game.SCORE_PER_DESTROY_SENTRY != 0) - { - messageClient(%cl, 'msgSentryDes', '\c0You received a %1 point bonus for destroying an enemy sentry turret.', %game.SCORE_PER_DESTROY_SENTRY); - //messageTeamExcept(%cl, 'msgGenDes', '\c0Teammate %1 received a %2 point bonus for destroying an enemy generator.', %cl.name, %game.SCORE_PER_GEN_DESTROY); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_DESTROY_SENTRY; -} - -function CTFGame::awardScoreDepSensorDestroy(%game,%cl) -{ - %cl.depSensorDestroys++; - if (%game.SCORE_PER_DESTROY_DEP_SENSOR != 0) - { - messageClient(%cl, 'msgDepSensorDes', '\c0You received a %1 point bonus for destroying an enemy deployable.', %game.SCORE_PER_DESTROY_DEP_SENSOR); - //messageTeamExcept(%cl, 'msgGenDes', '\c0Teammate %1 received a %2 point bonus for destroying an enemy generator.', %cl.name, %game.SCORE_PER_GEN_DESTROY); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_DESTROY_DEP_SENSOR; -} - -function CTFGame::awardScoreDepTurretDestroy(%game,%cl) -{ - %cl.depTurretDestroys++; - if (%game.SCORE_PER_DESTROY_DEP_TUR != 0) - { - messageClient(%cl, 'msgDepTurDes', '\c0You received a %1 point bonus for destroying an enemy deployed turret.', %game.SCORE_PER_DESTROY_DEP_TUR); - //messageTeamExcept(%cl, 'msgGenDes', '\c0Teammate %1 received a %2 point bonus for destroying an enemy generator.', %cl.name, %game.SCORE_PER_GEN_DESTROY); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_DESTROY_DEP_TUR; -} - -function CTFGame::awardScoreDepStationDestroy(%game,%cl) -{ - %cl.depStationDestroys++; - if (%game.SCORE_PER_DESTROY_DEP_INV != 0) - { - messageClient(%cl, 'msgDepInvDes', '\c0You received a %1 point bonus for destroying an enemy deployed station.', %game.SCORE_PER_DESTROY_DEP_INV); - //messageTeamExcept(%cl, 'msgGenDes', '\c0Teammate %1 received a %2 point bonus for destroying an enemy generator.', %cl.name, %game.SCORE_PER_GEN_DESTROY); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_DESTROY_DEP_INV; -} - -function CTFGame::awardScoreGenDefend(%game, %killerID) -{ - %killerID.genDefends++; - if (%game.SCORE_PER_GEN_DEFEND != 0) - { - messageClient(%killerID, 'msgGenDef', '\c0You received a %1 point bonus for defending a generator.', %game.SCORE_PER_GEN_DEFEND); - //messageTeamExcept(%killerID, 'msgGenDef', '\c0Teammate %1 received a %2 point bonus for defending a generator.', %killerID.name, %game.SCORE_PER_GEN_DEFEND); - } - %game.recalcScore(%cl); - return %game.SCORE_PER_GEN_DEFEND; -} - -function CTFGame::awardScoreCarrierKill(%game, %killerID) -{ - %killerID.carrierKills++; - if (%game.SCORE_PER_CARRIER_KILL != 0) - { - messageClient(%killerID, 'msgCarKill', '\c0You received a %1 point bonus for stopping the enemy flag carrier!', %game.SCORE_PER_CARRIER_KILL); - //messageTeamExcept(%killerID, 'msgCarKill', '\c0Teammate %1 received a %2 point bonus for stopping the enemy flag carrier!', %killerID.name, %game.SCORE_PER_CARRIER_KILL); - } - %game.recalcScore(%killerID); - return %game.SCORE_PER_CARRIER_KILL; -} - -function CTFGame::awardScoreFlagDefend(%game, %killerID) -{ - %killerID.flagDefends++; - if (%game.SCORE_PER_FLAG_DEFEND != 0) - { - messageClient(%killerID, 'msgFlagDef', '\c0You received a %1 point bonus for defending your flag!', %game.SCORE_PER_FLAG_DEFEND); - //messageTeamExcept(%killerID, 'msgFlagDef', '\c0Teammate %1 received a %2 point bonus for defending your flag!', %killerID.name, %game.SCORE_PER_FLAG_DEFEND); - } - %game.recalcScore(%killerID); - return %game.SCORE_PER_FLAG_DEFEND; -} - -function CTFGame::awardScoreEscortAssist(%game, %killerID) -{ - %killerID.escortAssists++; - if (%game.SCORE_PER_ESCORT_ASSIST != 0) - { - messageClient(%killerID, 'msgEscAsst', '\c0You received a %1 point bonus for protecting the flag carrier!', %game.SCORE_PER_ESCORT_ASSIST); - //messageTeamExcept(%killerID, 'msgEscAsst', '\c0Teammate %1 received a %2 point bonus for protecting the flag carrier!', %killerID.name, %game.SCORE_PER_ESCORT_ASSIST); - } - %game.recalcScore(%killerID); - return %game.SCORE_PER_ESCORT_ASSIST; -} - -function CTFGame::resetScore(%game, %client) -{ - %client.offenseScore = 0; - %client.kills = 0; - %client.deaths = 0; - %client.suicides = 0; - %client.escortAssists = 0; - %client.teamKills = 0; - %client.flagCaps = 0; - %client.flagGrabs = 0; - %client.genDestroys = 0; - %client.sensorDestroys = 0; - %client.turretDestroys = 0; - %client.iStationDestroys = 0; - %client.vstationDestroys = 0; - %client.solarDestroys = 0; - %client.sentryDestroys = 0; - %client.depSensorDestroys = 0; - %client.depTurretDestroys = 0; - %client.depStationDestroys = 0; - %client.vehicleScore = 0; - %client.vehicleBonus = 0; - - %client.flagDefends = 0; - %client.defenseScore = 0; - %client.genDefends = 0; - %client.carrierKills = 0; - %client.escortAssists = 0; - %client.turretKills = 0; - %client.mannedTurretKills = 0; - %client.flagReturns = 0; - %client.genRepairs = 0; - %client.SensorRepairs =0; - %client.TurretRepairs =0; - %client.StationRepairs =0; - %client.VStationRepairs =0; - %client.solarRepairs =0; - %client.sentryRepairs =0; - %client.depInvRepairs =0; - %client.depTurretRepairs=0; - %client.returnPts = 0; - %client.score = 0; -} - -function CTFGame::objectRepaired(%game, %obj, %objName) -{ - %item = %obj.getDataBlock().getName(); - switch$ (%item) - { - case generatorLarge : - %game.genOnRepaired(%obj, %objName); - case sensorMediumPulse : - %game.sensorOnRepaired(%obj, %objName); - case sensorLargePulse : - %game.sensorOnRepaired(%obj, %objName); - case stationInventory : - %game.stationOnRepaired(%obj, %objName); - case turretBaseLarge : - %game.turretOnRepaired(%obj, %objName); - case stationVehicle : - %game.vStationOnRepaired(%obj, %objName); - case solarPanel : - %game.solarPanelOnRepaired(%obj, %objName); - case sentryTurret : - %game.sentryTurretOnRepaired(%obj, %objName); - case TurretDeployedWallIndoor: - %game.depTurretOnRepaired(%obj, %objName); - case TurretDeployedFloorIndoor: - %game.depTurretOnRepaired(%obj, %objName); - case TurretDeployedCeilingIndoor: - %game.depTurretOnRepaired(%obj, %objName); - case TurretDeployedOutdoor: - %game.depTurretOnRepaired(%obj, %objName); - } - %obj.wasDisabled = false; -} - -function CTFGame::genOnRepaired(%game, %obj, %objName) -{ - - if (%game.testValidRepair(%obj)) - { - %repairman = %obj.repairedBy; - teamRepairMessage(%repairman, 'msgGenRepaired', '\c0%1 repaired the %2 Generator!', %repairman.name, %obj.nameTag); - %game.awardScoreGenRepair(%obj.repairedBy); - } -} - -function CTFGame::stationOnRepaired(%game, %obj, %objName) -{ - if (%game.testValidRepair(%obj)) - { - %repairman = %obj.repairedBy; - teamRepairMessage(%repairman, 'msgStationRepaired', '\c0%1 repaired the %2 Inventory Station!', %repairman.name, %obj.nameTag); - %game.awardScoreStationRepair(%obj.repairedBy); - } -} - -function CTFGame::sensorOnRepaired(%game, %obj, %objName) -{ - if (%game.testValidRepair(%obj)) - { - %repairman = %obj.repairedBy; - teamRepairMessage(%repairman, 'msgSensorRepaired', '\c0%1 repaired the %2 Pulse Sensor!', %repairman.name, %obj.nameTag); - %game.awardScoreSensorRepair(%obj.repairedBy); - } -} - -function CTFGame::turretOnRepaired(%game, %obj, %objName) -{ - if (%game.testValidRepair(%obj)) - { - %repairman = %obj.repairedBy; - teamRepairMessage(%repairman, 'msgTurretRepaired', '\c0%1 repaired the %2 Turret!', %repairman.name, %obj.nameTag); - %game.awardScoreTurretRepair(%obj.repairedBy); - } -} - -function CTFGame::vStationOnRepaired(%game, %obj, %objName) -{ - if (%game.testValidRepair(%obj)) - { - %repairman = %obj.repairedBy; - teamRepairMessage(%repairman, 'msgvstationRepaired', '\c0%1 repaired the Vehicle Station!', %repairman.name); - %game.awardScoreVStationRepair(%obj.repairedBy); - } -} - -function CTFGame::solarPanelOnRepaired(%game, %obj, %objName) -{ - if (%game.testValidRepair(%obj)) - { - %repairman = %obj.repairedBy; - teamRepairMessage(%repairman, 'msgsolarRepaired', '\c0%1 repaired the %2 Solar Panel!', %repairman.name, %obj.nameTag); - %game.awardScoreSolarRepair(%obj.repairedBy); - } -} - -function CTFGame::sentryTurretOnRepaired(%game, %obj, %objName) -{ - if (%game.testValidRepair(%obj)) - { - %repairman = %obj.repairedBy; - teamRepairMessage(%repairman, 'msgsentryTurretRepaired', '\c0%1 repaired the %2 Sentry Turret!', %repairman.name, %obj.nameTag); - %game.awardScoreSentryRepair(%obj.repairedBy); - } -} - -function CTFGame::depTurretOnRepaired(%game, %obj, %objName) -{ - if (%game.testValidRepair(%obj)) - { - %repairman = %obj.repairedBy; - %game.awardScoreDepTurretRepair(%obj.repairedBy); - } -} - -function CTFGame::depInvOnRepaired(%game, %obj, %objName) -{ - if (%game.testValidRepair(%obj)) - { - %repairman = %obj.repairedBy; - %game.awardScoreDepInvRepair(%obj.repairedBy); - } -} - -function CTFGame::awardScoreGenRepair(%game, %cl) -{ - %cl.genRepairs++; - if (%game.SCORE_PER_REPAIR_GEN != 0) - { - messageClient(%cl, 'msgGenRep', '\c0You received a %1 point bonus for repairing a generator.', %game.SCORE_PER_REPAIR_GEN); - } - %game.recalcScore(%cl); -} - -function CTFGame::awardScoreStationRepair(%game, %cl) -{ - %cl.stationRepairs++; - if (%game.SCORE_PER_REPAIR_ISTATION != 0) - { - messageClient(%cl, 'msgIStationRep', '\c0You received a %1 point bonus for repairing a inventory station.', %game.SCORE_PER_REPAIR_ISTATION); - } - %game.recalcScore(%cl); -} - -function CTFGame::awardScoreSensorRepair(%game, %cl) -{ - %cl.sensorRepairs++; - if (%game.SCORE_PER_REPAIR_SENSOR != 0) - { - messageClient(%cl, 'msgSensorRep', '\c0You received a %1 point bonus for repairing a sensor.', %game.SCORE_PER_REPAIR_SENSOR); - } - %game.recalcScore(%cl); -} - -function CTFGame::awardScoreTurretRepair(%game, %cl) -{ - %cl.TurretRepairs++; - if (%game.SCORE_PER_REPAIR_TURRET != 0) - { - messageClient(%cl, 'msgTurretRep', '\c0You received a %1 point bonus for repairing a base turret.', %game.SCORE_PER_REPAIR_TURRET); - } - %game.recalcScore(%cl); -} - -function CTFGame::awardScoreVStationRepair(%game, %cl) -{ - %cl.VStationRepairs++; - if (%game.SCORE_PER_REPAIR_VSTATION != 0) - { - messageClient(%cl, 'msgVStationRep', '\c0You received a %1 point bonus for repairing a vehicle station.', %game.SCORE_PER_REPAIR_VSTATION); - } - %game.recalcScore(%cl); -} - -function CTFGame::awardScoreSolarRepair(%game, %cl) -{ - %cl.solarRepairs++; - if (%game.SCORE_PER_REPAIR_SOLAR != 0) - { - messageClient(%cl, 'msgsolarRep', '\c0You received a %1 point bonus for repairing a solar panel.', %game.SCORE_PER_REPAIR_SOLAR); - } - %game.recalcScore(%cl); -} - -function CTFGame::awardScoreSentryRepair(%game, %cl) -{ - %cl.sentryRepairs++; - if (%game.SCORE_PER_REPAIR_SENTRY != 0) - { - messageClient(%cl, 'msgSentryRep', '\c0You received a %1 point bonus for repairing a sentry turret.', %game.SCORE_PER_REPAIR_SENTRY); - } - %game.recalcScore(%cl); -} - -function CTFGame::awardScoreDepTurretRepair(%game, %cl) -{ - %cl.depTurretRepairs++; - if (%game.SCORE_PER_REPAIR_DEP_TUR != 0) - { - messageClient(%cl, 'msgDepTurretRep', '\c0You received a %1 point bonus for repairing a deployed turret.', %game.SCORE_PER_REPAIR_DEP_TUR); - } - %game.recalcScore(%cl); -} - -function CTFGame::awardScoreDepInvRepair(%game, %cl) -{ - %cl.depInvRepairs++; - if (%game.SCORE_PER_REPAIR_DEP_INV != 0) - { - messageClient(%cl, 'msgDepInvRep', '\c0You received a %1 point bonus for repairing a deployed station.', %game.SCORE_PER_REPAIR_DEP_INV); - } - %game.recalcScore(%cl); -} - -function CTFGame::enterMissionArea(%game, %playerData, %player) -{ - if(%player.getState() $= "Dead") - return; - %player.client.outOfBounds = false; - messageClient(%player.client, 'EnterMissionArea', '\c1You are back in the mission area.'); - logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") entered mission area"); - - //the instant a player leaves the mission boundary, the flag is dropped, and the return is scheduled... - if (%player.holdingFlag > 0) - { - cancel($FlagReturnTimer[%player.holdingFlag]); - $FlagReturnTimer[%player.holdingFlag] = ""; - } -} - -function CTFGame::leaveMissionArea(%game, %playerData, %player) -{ - if(%player.getState() $= "Dead") - return; - // maybe we'll do this just in case - %player.client.outOfBounds = true; - // if the player is holding a flag, strip it and throw it back into the mission area - // otherwise, just print a message - if(%player.holdingFlag > 0) - %game.boundaryLoseFlag(%player); - else - messageClient(%player.client, 'MsgLeaveMissionArea', '\c1You have left the mission area.~wfx/misc/warning_beep.wav'); - logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") left mission area"); -} - -function CTFGame::boundaryLoseFlag(%game, %player) -{ - // this is called when a player goes out of the mission area while holding - // the enemy flag. - make sure the player is still out of bounds - if (!%player.client.outOfBounds || !isObject(%player.holdingFlag)) - return; - - %client = %player.client; - %flag = %player.holdingFlag; - %flag.setVelocity("0 0 0"); - %flag.setTransform(%player.getWorldBoxCenter()); - %flag.setCollisionTimeout(%player); - - %game.playerDroppedFlag(%player); - - // now for the tricky part -- throwing the flag back into the mission area - // let's try throwing it back towards its "home" - %home = %flag.originalPosition; - %vecx = firstWord(%home) - firstWord(%player.getWorldBoxCenter()); - %vecy = getWord(%home, 1) - getWord(%player.getWorldBoxCenter(), 1); - %vecz = getWord(%home, 2) - getWord(%player.getWorldBoxCenter(), 2); - %vec = %vecx SPC %vecy SPC %vecz; - - // normalize the vector, scale it, and add an extra "upwards" component - %vecNorm = VectorNormalize(%vec); - %vec = VectorScale(%vecNorm, 1500); - %vec = vectorAdd(%vec, "0 0 500"); - - // --------------------------------------------------------------------- - // z0dd - ZOD, 6/09/02. Remove anti-hover so flag can be thrown properly - %flag.static = false; - - // apply the impulse to the flag object - %flag.applyImpulse(%player.getWorldBoxCenter(), %vec); - - //don't forget to send the message - // ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - // z0dd - ZOD 3/30/02. Message was sending the wrong varible to objective hud thus not updating hud correctly. - //messageClient(%player.client, 'MsgCTFFlagDropped', '\c1You have left the mission area and lost the flag.~wfx/misc/flag_drop.wav', 0, 0, %player.holdingFlag.team); - messageClient(%player.client, 'MsgCTFFlagDropped', '\c1You have left the mission area and lost the flag.~wfx/misc/flag_drop.wav', 0, 0, %flag.team); - - logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") lost flag (out of bounds)"); -} - -function CTFGame::dropFlag(%game, %player) -{ - if(%player.holdingFlag > 0) - { - if (!%player.client.outOfBounds) - %player.throwObject(%player.holdingFlag); - else - %game.boundaryLoseFlag(%player); - } -} - -function CTFGame::applyConcussion(%game, %player) -{ - %game.dropFlag( %player ); -} - -function CTFGame::vehicleDestroyed(%game, %vehicle, %destroyer){ - %data = %vehicle.getDataBlock(); - %vehicleType = getTaggedString(%data.targetTypeTag); - if(%vehicleType !$= "MPB") - %vehicleType = strlwr(%vehicleType); - - %enemyTeam = ( %destroyer.team == 1 ) ? 2 : 1; - - %scorer = 0; - %multiplier = 3; - %shouldshare = 0; - - %passengers = 0; - for(%i = 0; %i < %data.numMountPoints; %i++) - if(%vehicle.getMountNodeObject(%i)) - %passengers++; - - if(%destroyer.client){ - %destroyer = %destroyer.client; - %scorer = %destroyer; - - if(%vehicle.lastDamageType == $DamageType::Mine) - %multiplier = 1; - } - else if(%destroyer.getClassName() $= "Turret"){ - if(%destroyer.getControllingClient()){ - %destroyer = %destroyer.getControllingClient(); - %scorer = %destroyer; - if(%destroyer.vehicleMounted){ - if(%destroyer.vehicleMounted.getMountNodeObject(0)){ - %driver = %destroyer.vehicleMounted.getMountNodeObject(0); - %sharer = %driver.client; - %shouldshare = 1; - } - %multiplier = 2; - } - } - else{ - %destroyerName = "A turret"; - %multiplier = 0; - } - } - else if(%destroyer.getDataBlock().catagory $= "Vehicles"){ - if(%destroyer.getMountNodeObject(0)){ - %destroyer = %destroyer.getMountNodeObject(0).client; - %scorer = %destroyer; - } - %multiplier = 2; - } - else - return; - - - if(%destroyerName $= "") - %destroyerName = %destroyer.name; - - if(%vehicle.team == %destroyer.team){ - %pref = (%vehicleType $= "Assault Tank") ? "an" : "a"; - messageAll( 'msgVehicleTeamDestroy', '\c0%1 TEAMKILLED %3 %2!', %destroyerName, %vehicleType, %pref); - } - else{ - messageTeamExcept(%destroyer, 'msgVehicleDestroy', '\c0%1 destroyed an enemy %2.', %destroyerName, %vehicleType); - messageTeam(%enemyTeam, 'msgVehicleDestroy', '\c0%1 destroyed your team\'s %2.', %destroyerName, %vehicleType); - - if(%scorer){ - %value = %game.awardScoreVehicleDestroyed(%scorer, %vehicleType, %multiplier, %passengers); - if(%shouldshare == 1) - %game.awardScoreVehicleDestroyed(%sharer, %vehicleType, (%multiplier / 2), %passengers); - %game.shareScore(%value); - } - } -} - -function CTFGame::awardScoreVehicleDestroyed(%game, %client, %vehicleType, %mult, %passengers) -{ - if(isDemo()) - return 0; - - if(%vehicleType $= "Interceptor") - %base = %game.SCORE_PER_DESTROY_SHRIKE; - - else if(%vehicleType $= "Fighter") - %base = %game.SCORE_PER_DESTROY_STRIKEFIGHTER; - - else if(%vehicleType $= "Assault Chopper") - %base = %game.SCORE_PER_DESTROY_HELICOPTER; - - else if(%vehicleType $= "AWACS") - %base = %game.SCORE_PER_DESTROY_AWACS; - - else if(%vehicleType $= "Bomber") - %base = %game.SCORE_PER_DESTROY_BOMBER; - - else if(%vehicleType $= "Gunship") - %base = %game.SCORE_PER_DESTROY_GUNSHIP; - - else if(%vehicleType $= "Transport Chopper") - %base = %game.SCORE_PER_DESTROY_HEAVYHELICOPTER; - - else if(%vehicleType $= "Heavy Transport") - %base = %game.SCORE_PER_DESTROY_TRANSPORT; - - else if(%vehicleType $= "Grav Cycle") - %base = %game.SCORE_PER_DESTROY_WILDCAT; - - else if(%vehicleType $= "Light Tank") - %base = %game.SCORE_PER_DESTROY_TANK; - - else if(%vehicleType $= "Assault Tank") - %base = %game.SCORE_PER_DESTROY_HEAVYTANK; - - else if(%vehicleType $= "chaingun tank") - %base = %game.SCORE_PER_DESTROY_CGTANK; - - else if(%vehicleType $= "APC") - %base = %game.SCORE_PER_DESTROY_FFTRANSPORT; - - else if(%vehicleType $= "Heavy Artillery") - %base = %game.SCORE_PER_DESTROY_ARTILLERY; - - else if(%vehicleType $= "MPB") - %base = %game.SCORE_PER_DESTROY_MPB; - - else if(%vehicleType $= "Boat") - %base = %game.SCORE_PER_DESTROY_TRANSBOAT; - - else if(%vehicleType $= "Submarine") - %base = %game.SCORE_PER_DESTROY_SUB; - - else if(%vehicleType $= "GunBoat") - %base = %game.SCORE_PER_DESTROY_BOAT; - - - %total = ( %base * %mult ) + ( %passengers * %game.SCORE_PER_PASSENGER ); - - %client.vehicleScore += %total; - - messageClient(%client, 'msgVehicleScore', '\c0You received a %1 point bonus for destroying an enemy %2.', %total, %vehicleType); - %game.recalcScore(%client); - return %total; -} - -function CTFGame::shareScore(%game, %client, %amount) -{ - if(isDemo()) - return 0; - - //error("share score of"SPC %amount SPC "from client:" SPC %client); - // all of the player in the bomber and tank share the points - // gained from any of the others - %vehicle = %client.vehicleMounted; - if(!%vehicle) - return 0; - %vehicleType = getTaggedString(%vehicle.getDataBlock().targetTypeTag); - if(%vehicleType $= "Bomber" || %vehicleType $= "Assault Tank") - { - for(%i = 0; %i < %vehicle.getDataBlock().numMountPoints; %i++) - { - %occupant = %vehicle.getMountNodeObject(%i); - if(%occupant) - { - %occCl = %occupant.client; - if(%occCl != %client && %occCl.team == %client.team) - { - // the vehicle has a valid teammate at this node - // share the score with them - %occCl.vehicleBonus += %amount; - %game.recalcScore(%occCl); - } - } - } - - } -} - -function CTFGame::awardScoreTurretKill(%game, %victimID, %implement) -{ - if ((%killer = %implement.getControllingClient()) != 0) //award whoever might be controlling the turret - { - if (%killer == %victimID) - %game.awardScoreSuicide(%victimID); - else if (%killer.team == %victimID.team) //player controlling a turret killed a teammate - { - %killer.teamKills++; - %game.awardScoreTurretTeamKill(%victimID, %killer); - %game.awardScoreDeath(%victimID); - } - else - { - %killer.mannedturretKills++; - %game.recalcScore(%killer); - %game.awardScoreDeath(%victimID); - } - } - else if ((%killer = %implement.owner) != 0) //if it isn't controlled, award score to whoever deployed it - { - if (%killer.team == %victimID.team) - { - %game.awardScoreDeath(%victimID); - } - else - { - %killer.turretKills++; - %game.recalcScore(%killer); - %game.awardScoreDeath(%victimID); - } - } - //default is, no one was controlling it, no one owned it. No score given. -} - -function CTFGame::testKill(%game, %victimID, %killerID) -{ - return ((%killerID !=0) && (%victimID.team != %killerID.team)); -} - -function CTFGame::awardScoreKill(%game, %killerID) -{ - %killerID.kills++; - %game.recalcScore(%killerID); - return %game.SCORE_PER_KILL; -} - - -function checkVehicleCamping( %team ) -{ - %position = $flagPos[%team]; - %radius = 5; - InitContainerRadiusSearch(%position, %radius, $TypeMasks::VehicleObjectType ); - - while ((%vehicle = containerSearchNext()) != 0) - { - %dist = containerSearchCurrRadDamageDist(); - - if (%dist > %radius) - continue; - else - { - //if( %vehicle.team == %team ) - applyVehicleCampDamage( %vehicle ); - } - } - - if( %team == 1 ) - Game.campThread_1 = schedule( 1000, 0, "checkVehicleCamping", 1 ); - else - Game.campThread_2 = schedule( 1000, 0, "checkVehicleCamping", 2 ); -} - -function applyVehicleCampDamage( %vehicle ) -{ - if( !isObject( %vehicle ) ) - return; - - if( %vehicle.getDamageState() $= "Destroyed" ) - return; - - %client = %vehicle.getMountNodeObject(0).client; // grab the pilot - - messageClient( %client, 'serverMessage', "Can't park vehicles in flag zones!" ); - %vehicle.getDataBlock().damageObject( %vehicle, 0, "0 0 0", 0.5, 0); -} diff --git a/Scripts/LobbyGui.cs b/Scripts/LobbyGui.cs deleted file mode 100644 index 2f1e752..0000000 --- a/Scripts/LobbyGui.cs +++ /dev/null @@ -1,616 +0,0 @@ -//------------------------------------------------------------------------------ -// -// LobbyGui.cs -// -//------------------------------------------------------------------------------ - -$InLobby = false; - -//------------------------------------------------------------------------------ -function LobbyGui::onAdd( %this ) -{ - // Add the Player popup menu: - new GuiControl(LobbyPlayerActionDlg) { - profile = "GuiModelessDialogProfile"; - horizSizing = "width"; - vertSizing = "height"; - position = "0 0"; - extent = "640 480"; - minExtent = "8 8"; - visible = "1"; - setFirstResponder = "0"; - modal = "1"; - - new ShellPopupMenu( LobbyPlayerPopup ) { - profile = "ShellPopupProfile"; - position = "0 0"; - extent = "0 0"; - minExtent = "0 0"; - visible = "1"; - maxPopupHeight = "200"; - noButtonStyle = "1"; - }; - }; -} - -//------------------------------------------------------------------------------ -function LobbyGui::onWake( %this ) -{ - if ( !%this.initialized ) - { - LobbyPlayerList.setSortColumn( $pref::Lobby::SortColumnKey ); - LobbyPlayerList.setSortIncreasing( $pref::Lobby::SortInc ); - - %this.initialized = true; - } - - $InLobby = true; - - //pop any key maps - moveMap.pop(); - if ( isObject( passengerkeys ) ) - passengerKeys.pop(); - if ( isObject( observerBlockMap ) ) - observerBlockMap.pop(); - if ( isObject( observerMap ) ) - observerMap.pop(); - - $enableDirectInput = "0"; - deactivateDirectInput(); - - LobbyMessageVector.attach(HudMessageVector); - LobbyMessageScroll.scrollToBottom(); - updateLobbyPlayerList(); - - LobbyServerName.setText( $clServerName ); - - %headerStyle = ""; - %statusText = "" @ %headerStyle @ "MISSION TYPE:" SPC $clMissionType - NL "" @ %headerStyle @ "MISSION:" SPC $clMissionName - NL "" @ %headerStyle @ "OBJECTIVES:"; - - for ( %line = 0; %this.objLine[%line] !$= ""; %line++ ) - %statusText = %statusText NL "* " @ %this.objLine[%line]; - - LobbyStatusText.setText( %statusText ); - - fillLobbyVoteMenu(); -} - -//------------------------------------------------------------------------------ -function LobbyGui::onSleep( %this ) -{ - if ( %this.playerDialogOpen ) - LobbyPlayerPopup.forceClose(); - - LobbyVoteMenu.clear(); - LobbyVoteMenu.mode = ""; - LobbyCancelBtn.setVisible( false ); - LobbyStatusText.setText( "" ); - $InLobby = false; -} - -//------------------------------------------------------------------------------ -function lobbyDisconnect() -{ - MessageBoxYesNo( "CONFIRM", "Are you sure you want to leave this game?", "lobbyLeaveGame();", "" ); -} - -//------------------------------------------------------------------------------ -function lobbyLeaveGame() -{ - Canvas.popDialog( LobbyGui ); - Disconnect(); -} - -//------------------------------------------------------------------------------ -function lobbyReturnToGame() -{ - Canvas.setContent( PlayGui ); -} - -//------------------------------------------------------------------------------ -function LobbyChatEnter::onEscape( %this ) -{ - %this.setValue( "" ); -} - -//------------------------------------------------------------------------------ -function LobbyChatEnter::send( %this ) -{ - %text = %this.getValue(); - if ( %text $= "" ) - %text = " "; - commandToServer( 'MessageSent', %text ); - %this.setValue( "" ); -} - -//------------------------------------------------------------------------------ -function LobbyPlayerList::initColumns( %this ) -{ - %this.clear(); - %this.clearColumns(); - %this.addColumn( 0, " ", 24, 24, 24, "center" ); // Flag column - %this.addColumn( 6, "lobby_headset", 36, 36, 36, "headericon" ); // Voice Com column - %this.addColumn( 1, "Player", $pref::Lobby::Column1, 50, 200 ); - if ( $clTeamCount > 1 ) - %this.addColumn( 2, "Team", $pref::Lobby::Column2, 50, 200 ); - %this.addColumn( 3, "Score", $pref::Lobby::Column3, 25, 200, "numeric center" ); - %this.addColumn( 4, "Ping", $pref::Lobby::Column4, 25, 200, "numeric center" ); - %this.addColumn( 5, "PL", $pref::Lobby::Column5, 25, 200, "numeric center" ); - - commandToServer( 'getScores' ); -} - -//------------------------------------------------------------------------------ -function LobbyPlayerList::onColumnResize( %this, %col, %size ) -{ - $pref::Lobby::Column[%this.getColumnKey( %col )] = %size; -} - -//------------------------------------------------------------------------------ -function LobbyPlayerList::onSetSortKey( %this, %key, %increasing ) -{ - $pref::Lobby::SortColumnKey = %key; - $pref::Lobby::SortInc = %increasing; -} - -//------------------------------------------------------------------------------ -function updateLobbyPlayerList() -{ - if ( $InLobby ) - { - // Let the server know we want an update: - commandToServer( 'getScores' ); - schedule( 4000, 0, updateLobbyPlayerList ); - } -} - -//------------------------------------------------------------------------------ -function lobbyUpdatePlayer( %clientId ) -{ - %player = $PlayerList[%clientId]; - if ( !isObject( %player ) ) - { - warn( "lobbyUpdatePlayer( " @ %clientId @ " ) - there is no client object with that id!" ); - return; - } - - // Build the text: - if ( %player.isSuperAdmin ) - %tag = "SA"; - else if ( %player.isAdmin ) - %tag = "A"; - else if ( %player.isZombieKeeper ) - %tag = "ZK"; - else if ( %player.isBot ) - %tag = "B"; - else - %tag = " "; - - if ( %player.canListen ) - { - if ( %player.voiceEnabled ) - { - %voiceIcons = "lobby_icon_speak"; - if ( %player.isListening ) - %voiceIcons = %voiceIcons @ ":lobby_icon_listen"; - } - else - %voiceIcons = %player.isListening ? "lobby_icon_listen" : ""; - } - else - %voiceIcons = "shll_icon_timedout"; - - if ( $clTeamCount > 1 ) - { - if ( %player.teamId == 0 ) - %teamName = "Observer"; - else - %teamName = $clTeamScore[%player.teamId, 0] $= "" ? "-" : $clTeamScore[%player.teamId, 0]; - %text = %tag TAB %voiceIcons TAB %player.name TAB %teamName TAB %player.score TAB %player.ping TAB %player.packetLoss; - } - else - %text = %tag TAB %voiceIcons TAB %player.name TAB %player.score TAB %player.ping TAB %player.packetLoss; - - if ( LobbyPlayerList.getRowNumById( %clientId ) == -1 ) - LobbyPlayerList.addRow( %clientId, %text ); - else - LobbyPlayerList.setRowById( %clientId, %text ); - - if ( $InLobby ) - LobbyPlayerList.sort(); -} - -//------------------------------------------------------------------------------ -function lobbyRemovePlayer( %clientId ) -{ - LobbyPlayerList.removeRowById( %clientId ); -} - -//------------------------------------------------------------------------------ -function LobbyPlayerList::onRightMouseDown( %this, %column, %row, %mousePos ) -{ - // Open the action menu: - %clientId = %this.getRowId( %row ); - LobbyPlayerPopup.player = $PlayerList[%clientId]; - - if ( LobbyPlayerPopup.player !$= "" ) - { - LobbyPlayerPopup.position = %mousePos; - Canvas.pushDialog( LobbyPlayerActionDlg ); - LobbyPlayerPopup.forceOnAction(); - } -} - -//------------------------------------------------------------------------------ -function LobbyPlayerActionDlg::onWake( %this ) -{ - LobbyGui.playerDialogOpen = true; - fillPlayerPopupMenu(); -} - -//------------------------------------------------------------------------------ -function LobbyPlayerActionDlg::onSleep( %this ) -{ - LobbyGui.playerDialogOpen = false; -} - -//------------------------------------------------------------------------------ -function LobbyPlayerPopup::onSelect( %this, %id, %text ) -{ -//the id's for these are used in DefaultGame::sendGamePlayerPopupMenu()... -//mute: 1 -//admin: 2 -//kick: 3 -//ban: 4 -//force observer: 5 -//switch team: 6 - - switch( %id ) - { - case 1: // Mute/Unmute - togglePlayerMute(%this.player.clientId); - - case 2: // Admin - MessageBoxYesNo( "CONFIRM", "Are you sure you want to make " @ %this.player.name @ " an admin?", - "lobbyPlayerVote( VoteAdminPlayer, \"ADMIN player\", " @ %this.player.clientId @ " );" ); - - case 3: // Kick - MessageBoxYesNo( "CONFIRM", "Are you sure you want to kick " @ %this.player.name @ "?", - "lobbyPlayerVote( VoteKickPlayer, \"KICK player\", " @ %this.player.clientId @ " );" ); - - case 4: // Ban - MessageBoxYesNo( "CONFIRM", "Are you sure you want to ban " @ %this.player.name @ "?", - "lobbyPlayerVote( BanPlayer, \"BAN player\", " @ %this.player.clientId @ " );" ); - - case 5: // force observer - forceToObserver(%this.player.clientId); - - case 6: //change team 1 - changePlayersTeam(%this.player.clientId, 1); - - case 7: //change team 2 - changePlayersTeam(%this.player.clientId, 2); - - case 8: - adminAddPlayerToGame(%this.player.clientId); - - case 9: // enable/disable voice communication - togglePlayerVoiceCom( %this.player ); - - case 10: - confirmAdminListAdd( %this.player, false ); - - case 11: - confirmAdminListAdd( %this.player, true ); - - Canvas.popDialog( LobbyPlayerActionDlg ); - } -} - -function confirmAdminListAdd( %client, %super ) -{ - if( %super ) - MessageBoxYesNo( "CONFIRM", "Are you sure you want to add " @ %client.name @ " to the server super admin list?", "toSuperList( " @ %client.clientId @ " );" ); - - else - MessageBoxYesNo( "CONFIRM", "Are you sure you want to add " @ %client.name @ " to the server admin list?", "toAdminList( " @ %client.clientId @ " );" ); -} - -function toSuperList( %client ) -{ - commandToServer( 'AddToSuperAdminList', %client ); -} - -function toAdminList( %client ) -{ - commandToServer( 'AddToAdminList', %client ); -} - -//------------------------------------------------------------------------------ -function LobbyPlayerPopup::onCancel( %this ) -{ - Canvas.popDialog( LobbyPlayerActionDlg ); -} - -//------------------------------------------------------------------------------ -function togglePlayerMute(%client) -{ - commandToServer( 'togglePlayerMute', %client ); -} - -//------------------------------------------------------------------------------ -function togglePlayerVoiceCom( %playerRep ) -{ - commandToServer( 'ListenTo', %playerRep.clientId, !%playerRep.voiceEnabled, true ); -} - -//------------------------------------------------------------------------------ -function forceToObserver( %client ) -{ - commandToServer( 'forcePlayerToObserver', %client ); -} - -function AdminAddPlayerToGame(%client) -{ - CommandToServer( 'clientAddToGame', %client ); -} - -//------------------------------------------------------------------------------ -function changePlayersTeam(%client, %team) -{ - commandToServer( 'changePlayersTeam', %client, %team); -} -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -function fillLobbyVoteMenu() -{ - LobbyVoteMenu.key++; - LobbyVoteMenu.clear(); - LobbyVoteMenu.tourneyChoose = 0; - commandToServer( 'GetVoteMenu', LobbyVoteMenu.key ); -} - -//------------------------------------------------------------------------------ -function fillLobbyTeamMenu() -{ - LobbyVoteMenu.key++; - LobbyVoteMenu.clear(); - LobbyVoteMenu.mode = "team"; - commandToServer( 'GetTeamList', LobbyVoteMenu.key ); - LobbyCancelBtn.setVisible( true ); -} - -//------------------------------------------------------------------------------ -function fillPlayerPopupMenu() -{ - LobbyPlayerPopup.key++; - LobbyPlayerPopup.clear(); - - LobbyPlayerPopup.add(LobbyPlayerPopup.player.name, 0); - commandToServer( 'GetPlayerPopupMenu', LobbyPlayerPopup.player.clientId, LobbyPlayerPopup.key ); -} - -//------------------------------------------------------------------------------ -function fillLobbyMissionTypeMenu() -{ - LobbyVoteMenu.key++; - LobbyVoteMenu.clear(); - LobbyVoteMenu.mode = "type"; - commandToServer( 'GetMissionTypes', LobbyVoteMenu.key ); - LobbyCancelBtn.setVisible( true ); -} - -//------------------------------------------------------------------------------ -function fillLobbyMissionMenu( %type, %typeName ) -{ - LobbyVoteMenu.key++; - LobbyVoteMenu.clear(); - LobbyVoteMenu.mode = "mission"; - LobbyVoteMenu.missionType = %type; - LobbyVoteMenu.typeName = %typeName; - commandToServer( 'GetMissionList', LobbyVoteMenu.key, %type ); -} - -//------------------------------------------------------------------------------ -function fillLobbyTimeLimitMenu() -{ - LobbyVoteMenu.key++; - LobbyVoteMenu.clear(); - LobbyVoteMenu.mode = "timeLimit"; - commandToServer( 'GetTimeLimitList', LobbyVoteMenu.key ); - LobbyCancelBtn.setVisible( true ); -} -//------------------------------------------------------------------------------ -addMessageCallback( 'MsgVoteItem', handleVoteItemMessage ); -addMessageCallback( 'MsgPlayerPopupItem', handlePlayerPopupMessage ); -addMessageCallback( 'MsgVotePassed', handleVotePassedMessage ); -addMessageCallback( 'MsgVoteFailed', handleVoteFailedMessage ); -addMessageCallback( 'MsgAdminPlayer', handleAdminPlayerMessage ); -addMessageCallback( 'MsgAdminAdminPlayer', handleAdminAdminPlayerMessage ); -addMessageCallback( 'MsgSuperAdminPlayer', handleSuperAdminPlayerMessage ); -addMessageCallback( 'MsgAdminForce', handleAdminForceMessage ); - -//------------------------------------------------------------------------------ -function handleAdminForceMessage() -{ - alxPlay(AdminForceSound, 0, 0, 0); -} - -//------------------------------------------------------------------------------ -function handleAdminAdminPlayerMessage( %msgType, %msgString, %client ) -{ - %player = $PlayerList[%client]; - if(%player) - %player.isAdmin = true; - alxPlay(AdminForceSound, 0, 0, 0); -} - -//------------------------------------------------------------------------------ -function handleAdminPlayerMessage( %msgType, %msgString, %client ) -{ - %player = $PlayerList[%client]; - if(%player) - %player.isAdmin = true; - alxPlay(VotePassSound, 0, 0, 0); -} - -//------------------------------------------------------------------------------ -function handleSuperAdminPlayerMessage( %msgType, %msgString, %client ) -{ - %player = $PlayerList[%client]; - if(%player) - { - %player.isSuperAdmin = true; - %player.isAdmin = true; - } - alxPlay(AdminForceSound, 0, 0, 0); -} - -//------------------------------------------------------------------------------ -function handleVoteItemMessage( %msgType, %msgString, %key, %voteName, %voteActionMsg, %voteText, %sort ) -{ - if ( %key != LobbyVoteMenu.key ) - return; - - %index = LobbyVoteMenu.rowCount(); - LobbyVoteMenu.addRow( %index, detag( %voteText ) ); - if ( %sort ) - LobbyVoteMenu.sort( 0 ); - $clVoteCmd[%index] = detag( %voteName ); - $clVoteAction[%index] = detag( %voteActionMsg ); -} - -//------------------------------------------------------------------------------ -function handlePlayerPopupMessage( %msgType, %msgString, %key, %voteName, %voteActionMsg, %voteText, %popupEntryId ) -{ - if ( %key != LobbyPlayerPopup.key ) - return; - - LobbyPlayerPopup.add( " " @ detag( %voteText ), %popupEntryId ); -} - -//------------------------------------------------------------------------------ -function handleVotePassedMessage( %msgType, %msgString, %voteName, %voteText ) -{ - if ( $InLobby ) - fillLobbyVoteMenu(); - - alxPlay(VotePassSound, 0, 0, 0); -} - -//------------------------------------------------------------------------------ -function handleVoteFailedMessage( %msgType, %msgString, %voteName, %voteText ) -{ - if ( $InLobby ) - fillLobbyVoteMenu(); - - alxPlay(VoteNotPassSound, 0, 0, 0); -} - -//------------------------------------------------------------------------------ -function lobbyVote() -{ - %id = LobbyVoteMenu.getSelectedId(); - %text = LobbyVoteMenu.getRowTextById( %id ); - - switch$ ( LobbyVoteMenu.mode ) - { - case "": // Default case... - // Test for special cases: - switch$ ( $clVoteCmd[%id] ) - { - case "JoinGame": - CommandToServer( 'clientJoinGame' ); - schedule( 100, 0, lobbyReturnToGame ); - return; - - case "ChooseTeam": - commandToServer( 'ClientJoinTeam', -1, true ); - schedule( 100, 0, lobbyReturnToGame ); - return; - - case "VoteTournamentMode": - LobbyVoteMenu.tourneyChoose = 1; - fillLobbyMissionTypeMenu(); - return; - - case "VoteMatchStart": - startNewVote( "VoteMatchStart" ); - schedule( 100, 0, lobbyReturnToGame ); - return; - - case "MakeObserver": - commandToServer( 'ClientMakeObserver' ); - schedule( 100, 0, lobbyReturnToGame ); - return; - - case "VoteChangeMission": - fillLobbyMissionTypeMenu(); - return; - - case "VoteChangeTimeLimit": - fillLobbyTimeLimitMenu(); - return; - - case "Addbot": - commandToServer( 'addBot' ); - return; - } - - case "team": - commandToServer( 'ClientJoinTeam', %id++ ); - LobbyVoteMenu.reset(); - return; - - case "type": - fillLobbyMissionMenu( $clVoteCmd[%id], %text ); - return; - - case "mission": - if( !LobbyVoteMenu.tourneyChoose ) - { - startNewVote( "VoteChangeMission", - %text, // Mission display name - LobbyVoteMenu.typeName, // Mission type display name - $clVoteCmd[%id], // Mission id - LobbyVoteMenu.missionType ); // Mission type id - } - else - { - startNewVote( "VoteTournamentMode", - %text, // Mission display name - LobbyVoteMenu.typeName, // Mission type display name - $clVoteCmd[%id], // Mission id - LobbyVoteMenu.missionType ); // Mission type id - LobbyVoteMenu.tourneyChoose = 0; - } - LobbyVoteMenu.reset(); - return; - - case "timeLimit": - startNewVote( "VoteChangeTimeLimit", $clVoteCmd[%id] ); - LobbyVoteMenu.reset(); - return; - } - - startNewVote( $clVoteCmd[%id], $clVoteAction[%id] ); - fillLobbyVoteMenu(); -} - -//------------------------------------------------------------------------------ -function LobbyVoteMenu::reset( %this ) -{ - %this.mode = ""; - %this.tourneyChoose = 0; - LobbyCancelBtn.setVisible( false ); - fillLobbyVoteMenu(); -} - -//------------------------------------------------------------------------------ -function lobbyPlayerVote(%voteType, %actionMsg, %playerId) -{ - startNewVote(%voteType, %playerId, 0, 0, 0, true); - fillLobbyVoteMenu(); -} diff --git a/Scripts/ModScripts/AI/SentinelAI.cs b/Scripts/ModScripts/AI/SentinelAI.cs deleted file mode 100644 index 371c115..0000000 --- a/Scripts/ModScripts/AI/SentinelAI.cs +++ /dev/null @@ -1,71 +0,0 @@ -$sent::patrolwaittime = 10; // 10 secs -$sent::patrolsaturation = 2; // 2 sentinel patrolling one point at a time - -// 1 = Normal Sentinel -// 2 = Sentinel Monitor - -//============================================================================== -// CreateSentinel -//------------------------------------------------------------------------------ -// %pos = position -// %team = team -// %quantity = how many sentinels to spawn -// %type = the type of sentinel to spawn [regular/monitor] -//------------------------------------------------------------------------------ -// It creates a sentinel. -//============================================================================== -function CreateSentinel(%pos, %quantity, %type) -{ - if(%quantity < 1) - return; - - while(%quantity) - { - %data = (%type == 2 ? "SentinelMonitor" : "SentinelVehicle"); - %sent = new FlyingVehicle() { - datablock = %data; - }; - - %sent.setTransform(%pos SPC "0 0 1 0"); - %sent.team = 1; - - MissionCleanup.add(%sent); - - setTargetSensorGroup(%sent.getTarget(), 1); - - $ignoreNextBotConnection = true; - %ai = aiConnect("_AISent"); - ChangeName(%ai, "Sentinel"@%ai); - - %ai.isSentinel = true; - %ai.sentVehicle = %sent; - %ai.sentinelType = %type; - - %ai.setControlObject(%sent); - -// SentinelAI_PatrolArea(%ai); - warn("Sentinel created: "@%ai@", VEHID"@%sent); - %quantity--; - } -} - -function DropSentinel(%id) -{ - if(!isObject(%id) || %id.isSentinel != true) - return; - - if(isObject(%id.sentVehicle) && %id.sentVehicle.getDamageState() !$= "Destroyed") - %id.sentVehicle.setDamageState(Destroyed); - - %id.drop(); -} - -function AIConnection::Sentinel_MoveTo(%client, %coords) -{ - %client.clearStep(); - - %client.setPilotAim(%coords); - %client.setPilotDestination(%coords); -} - -function AIConnection::Sentinel_Damaged \ No newline at end of file diff --git a/Scripts/ModScripts/AI/SentinelData.cs b/Scripts/ModScripts/AI/SentinelData.cs deleted file mode 100644 index 88a305c..0000000 --- a/Scripts/ModScripts/AI/SentinelData.cs +++ /dev/null @@ -1,654 +0,0 @@ -//============================================================================== -// Sentinel Data - Made by Blnukem -//============================================================================== -// Sentinel Sounds -//------------------------------------------------------------------------------ - -datablock EffectProfile(SentinelTurretSwitchEffect) -{ - effectname = "powered/turret_light_activate"; - minDistance = 2.5; - maxDistance = 5.0; -}; - -datablock EffectProfile(SentinelTurretFireEffect) -{ - filename = "fx/vehicles/tank_chaingun.wav"; - minDistance = 2.5; - maxDistance = 8.0; -}; - -datablock EffectProfile(SentinelDeactivateEffect) -{ - effectname = "powered/turret_heavy_reload"; - minDistance = 2.5; - maxDistance = 5.0; -}; - -datablock EffectProfile(SentinelActivateEffect) -{ - effectname = "powered/turret_light_reload"; - minDistance = 2.5; - maxDistance = 5.0; -}; - -datablock EffectProfile(SentinelIdleEffect) -{ - effectname = "powered/turret_light_idle"; - minDistance = 1; - maxDistance = 2; -}; - -datablock AudioProfile(SentinelTurretSwitchSound) -{ - filename = "fx/powered/turret_light_activate.wav"; - description = AudioClose3d; - preload = true; - effect = SentinelTurretSwitchEffect; -}; - -datablock AudioProfile(SentinelTurretFireSound) -{ - filename = "fx/vehicles/tank_chaingun.wav"; - description = AudioDefaultLooping3d; - preload = true; - effect = SentinelTurretFireEffect; -}; - -datablock AudioProfile(SentinelIdleSound) -{ - filename = "fx/powered/turret_light_idle.wav"; - description = AudioDefaultLooping3d; - preload = true; - effect = SentinelIdleEffect; -}; - -datablock AudioProfile(SentinelActivateSound) -{ - filename = "fx/powered/turret_light_reload.wav"; - description = AudioClose3d; - preload = true; - effect = SentinelActivateEffect; -}; - -datablock AudioProfile(SentinelDeactivateSound) -{ - filename = "fx/powered/turret_heavy_reload.wav"; - description = AudioClose3d; - preload = true; - effect = SentinelDeactivateEffect; -}; - -//============================================================================== -// Vehicle Data -//============================================================================== -// Standard Sentinel -//------------------------------------------------------------------------------ - -datablock FlyingVehicleData(SentinelVehicle) : SentinelDamageProfile -{ - spawnOffset = "0.0 0.0 0.1"; - - catagory = "Sentinels"; - shapeFile = "stackable2s.dts"; - multipassenger = false; - computeCRC = true; - - debrisShapeName = "debris_generic.dts"; - debris = TurretDebris; - renderWhenDestroyed = false; - - drag = 0.15; - density = 1.0; - - numMountPoints = 0; - - cameraMaxDist = 15; - cameraOffset = 2.5; - cameraLag = 0.9; - explosion = TurretExplosion; - explosionDamage = 0.5; - explosionRadius = 5.0; - - maxDamage = 0.5; - destroyedLevel = 0.5; - - isShielded = true; - energyPerDamagePoint = 160; - maxEnergy = 280; - rechargeRate = 0.8; - - minDrag = 30; - rotationalDrag = 2000; - - maxAutoSpeed = 15; - autoAngularForce = 400; - autoLinearForce = 300; - autoInputDamping = 0.95; - - maxSteeringAngle = 5; - horizontalSurfaceForce = 6; - verticalSurfaceForce = 4; - maneuveringForce = 5000; - steeringForce = 3000; - steeringRollForce = 0; - rollForce = 10; - hoverHeight = 10; - createHoverHeight = 2; - maxForwardSpeed = 15; - - jetForce = 4500; - minJetEnergy = 0; - jetEnergyDrain = 0; // Auto stabilize speed - vertThrustMultiple = 0; - - mass = 100; - bodyFriction = 0; - bodyRestitution = 0.5; - minRollSpeed = 0; - softImpactSpeed = 14; - hardImpactSpeed = 25; - - minImpactSpeed = 10; - speedDamageScale = 0.06; - - collDamageThresholdVel = 23.0; - collDamageMultiplier = 0.02; - - jetSound = ""; - engineSound = SentinelIdleSound; - softImpactSound = SoftImpactSound; - hardImpactSound = HardImpactSound; - - softSplashSoundVelocity = 10.0; - mediumSplashSoundVelocity = 15.0; - hardSplashSoundVelocity = 20.0; - exitSplashSoundVelocity = 10.0; - - exitingWater = VehicleExitWaterMediumSound; - impactWaterEasy = VehicleImpactWaterSoftSound; - impactWaterMedium = VehicleImpactWaterMediumSound; - impactWaterHard = VehicleImpactWaterMediumSound; - waterWakeSound = VehicleWakeMediumSplashSound; - - dustEmitter = LiftoffDustEmitter; - triggerDustHeight = 1.0; - dustHeight = 0.1; - canControl = false; - - minMountDist = 4; - - splashEmitter[0] = VehicleFoamDropletsEmitter; - splashEmitter[1] = VehicleFoamEmitter; - - shieldImpact = VehicleShieldImpact; - - cmdCategory = "Tactical"; - cmdIcon = CMDFlyingScoutIcon; - cmdMiniIconName = "commander/MiniIcons/com_scout_grey"; - targetNameTag = 'Standard'; - targetTypeTag = 'Sentinel'; - sensorData = combatSensor; - sensorRadius = combatSensor.detectRadius; - sensorColor = "9 9 255"; - - checkRadius = 5.5; - observeParameters = "1 5 5"; - canObserve = true; - - runningLight[0] = ShrikeLight1; - - shieldEffectScale = "2.0 2.0 2.0"; - -}; - -//============================================================================== -// Sentinel Monitor Vehicle Data -//============================================================================== - -datablock FlyingVehicleData(SentinelMonitor) : SentinelDamageProfile -{ - spawnOffset = "0.0 0.0 0.0"; - - catagory = "Sentinels"; - shapeFile = "beacon.dts"; - multipassenger = false; - computeCRC = true; - - debrisShapeName = "debris_generic.dts"; - debris = TurretDebris; - renderWhenDestroyed = false; - - drag = 4.15; - density = 1.0; - - numMountPoints = 0; - - cameraMaxDist = 15; - cameraOffset = 2.5; - cameraLag = 0.9; - explosion = TurretExplosion; - explosionDamage = 0.5; - explosionRadius = 5.0; - - maxDamage = 50.00; - destroyedLevel = 50.00; - - isShielded = true; - rechargeRate = 2.5; - energyPerDamagePoint = 1; - maxEnergy = 500; - rechargeRate = 50.0; - - minDrag = 30; - rotationalDrag = 2000; - - maxAutoSpeed = 15; - autoAngularForce = 400; - autoLinearForce = 300; - autoInputDamping = 0.95; - - maxSteeringAngle = 5; - horizontalSurfaceForce = 6; - verticalSurfaceForce = 4; - maneuveringForce = 5000; - steeringForce = 1000; - steeringRollForce = 0; - rollForce = 100; - hoverHeight = 15; - createHoverHeight = 2; - maxForwardSpeed = 15; - - jetForce = 1500; - minJetEnergy = 0; - jetEnergyDrain = 0; // Auto stabilize speed - vertThrustMultiple = 0; - - mass = 100; - bodyFriction = 0; - bodyRestitution = 0.5; - minRollSpeed = 0; - softImpactSpeed = 14; - hardImpactSpeed = 25; - - minImpactSpeed = 25; - speedDamageScale = 0.06; - - collDamageThresholdVel = 23.0; - collDamageMultiplier = 0.02; - - minTrailSpeed = 0.1; - trailEmitter = ContrailEmitter; - - jetSound = ""; - engineSound = SentinelIdleSound; - softImpactSound = SoftImpactSound; - hardImpactSound = HardImpactSound; - - softSplashSoundVelocity = 10.0; - mediumSplashSoundVelocity = 15.0; - hardSplashSoundVelocity = 20.0; - exitSplashSoundVelocity = 10.0; - - exitingWater = VehicleExitWaterMediumSound; - impactWaterEasy = VehicleImpactWaterSoftSound; - impactWaterMedium = VehicleImpactWaterMediumSound; - impactWaterHard = VehicleImpactWaterMediumSound; - waterWakeSound = VehicleWakeMediumSplashSound; - - dustEmitter = LiftoffDustEmitter; - triggerDustHeight = 2.0; - dustHeight = 0.0; - canControl = false; - - damageEmitter[0] = LightDamageSmoke; - damageEmitter[1] = LightDamageSmoke; - damageEmitter[2] = DamageBubbles; - damageEmitterOffset[0] = "0.0 0.0 0.0 "; - damageLevelTolerance[0] = 0.3; - damageLevelTolerance[1] = 0.7; - numDmgEmitterAreas = 1; - - minMountDist = 4; - - splashEmitter[0] = VehicleFoamDropletsEmitter; - splashEmitter[1] = VehicleFoamEmitter; - - shieldImpact = VehicleShieldImpact; - - cmdCategory = "Tactical"; - cmdIcon = CMDCameraIcon; - cmdMiniIconName = "commander/MiniIcons/com_camera_grey"; - targetNameTag = ''; - targetTypeTag = 'Monitor'; - sensorData = combatSensor; - sensorRadius = combatSensor.detectRadius; - sensorColor = "9 9 255"; - - checkRadius = 10.5; - observeParameters = "1 5 5"; - canObserve = true; - - runningLight[0] = ShrikeLight1; - - shieldEffectScale = "2.0 2.0 2.0"; - -}; - -//============================================================================== -// Image Data -//============================================================================== -// Standard Sentinel Image Data: -//------------------------------------------------------------------------------ - -datablock ShapeBaseImageData(BodyImage) : SentinelVehicle -{ - offset = "0.0 -0.2 0.3"; - rotation = "0 0 1 0"; - shapeFile = "turret_mortar_large.dts"; -}; - -datablock ShapeBaseImageData(RightWing) : SentinelVehicle -{ - offset = "0.2 0.0 0.4"; - rotation = "0 0 -1 90"; - shapeFile = "pack_deploy_sensor_pulse.dts"; -}; - -datablock ShapeBaseImageData(LeftWing) : SentinelVehicle -{ - offset = "-0.2 0.0 0.4"; - rotation = "0 0 1 90"; - shapeFile = "pack_deploy_sensor_pulse.dts"; -}; - -datablock ShapeBaseImageData(Eye) : SentinelVehicle -{ - offset = "0.0 1.1 0.22"; - rotation = "1 0 0 90"; - shapeFile = "beacon.dts"; -}; - -//============================================================================== -// Sentinel Monitor Image Data: -//============================================================================== - -datablock ShapeBaseImageData(Front) : SentinelMonitor -{ - offset = "0.0 -0.02 0.0"; - rotation = "1.0 0.0 0.0 90.0"; - shapeFile = "camera.dts"; -}; - -datablock ShapeBaseImageData(Rear) : SentinelMonitor -{ - offset = "0.0 0.02 0.0"; - rotation = "-1.0 0.0 0.0 90.0"; - shapeFile = "camera.dts"; -}; - -//============================================================================== -// Decals and Projectiles -//============================================================================== -// Default Sentinel bullet Decal image: -//------------------------------------------------------------------------------ - -datablock DecalData(SentinelDecal1) -{ - sizeX = 0.15; - sizeY = 0.15; - textureName = "special/bullethole3"; -}; - -//============================================================================== -// Standard Sentinel Bullet: -//============================================================================== - -datablock TracerProjectileData(SentinelBullet) -{ - doDynamicClientHits = true; - - directDamage = 0.15; - directDamageType = $DamageType::Sentinel; - explosion = "ChaingunExplosion"; - splash = ChaingunSplash; - HeadMultiplier = 1.5; - LegsMultiplier = 0.5; - - kickBackStrength = 50.0; - sound = ChaingunProjectile; - - dryVelocity = 800.0; - wetVelocity = 100.0; - velInheritFactor = 1.0; - fizzleTimeMS = 3000; - lifetimeMS = 3000; - explodeOnDeath = false; - reflectOnWaterImpactAngle = 0.0; - explodeOnWaterImpact = false; - deflectionOnWaterImpact = 0.0; - fizzleUnderwaterMS = 3000; - - tracerLength = 10.0; - tracerAlpha = false; - tracerMinPixels = 6; - tracerColor = 10.0/255.0 @ " " @ 30.0/255.0 @ " " @ 240.0/255.0 @ " 0.75"; - tracerTex[0] = "special/tracer00"; - tracerTex[1] = "special/tracercross"; - tracerWidth = 0.15; - crossSize = 0.20; - crossViewAng = 0.990; - renderCross = true; - - decalData[0] = SentinelDecal1; - - hasLight = true; - lightRadius = 8.0; - lightColor = "0.5 0.5 0.175"; - -}; - -//============================================================================== -// Turret Data -//============================================================================== -// Standard Sentinel Turret: -//------------------------------------------------------------------------------ - -datablock TurretData(SentinelTurret) : TurretDamageProfile -{ - className = VehicleTurret; - catagory = "Turrets"; - shapeFile = "turret_belly_base.dts"; - preload = true; - - mass = 1.0; - maxDamage = 1.0; - destroyedLevel = 1.0; - repairRate = 0; - maxDamage = SentinelVehicle.maxDamage; - destroyedLevel = SentinelVehicle.destroyedLevel; - rechargeRate = 0.15; - - thetaMin = 90; - thetaMax = 180; - thetaNull = 90; - - rechargeRate = 0.15; - - isShielded = false; - energyPerDamagePoint = 110; - maxEnergy = 60; - renderWhenDestroyed = true; - barrel = SentinelTurretBarrel; - heatSignature = 0; - - canControl = false; - cmdCategory = "DTactical"; - cmdIcon = CMDTurretIcon; - cmdMiniIconName = "commander/MiniIcons/com_turret_grey"; - targetNameTag = 'Sentinel'; - targetTypeTag = 'Turret'; - - firstPersonOnly = true; - - debrisShapeName = "debris_generic_small.dts"; - debris = TurretDebrisSmall; -}; - -datablock TurretImageData(SentinelTurretBarrel) -{ - shapeFile = "turret_muzzlepoint.dts"; - mountPoint = 0; - - projectile = SentinelBullet; - projectileType = TracerProjectile; - - usesEnergy = true; - fireEnergy = 0.0; - minEnergy = 10.0; - emap = true; - - activationMS = 700; - deactivateDelayMS = 1500; - thinkTimeMS = 120; - degPerSecTheta = 2000; - degPerSecPhi = 2000; - attackRadius = 100; - - casing = ShellDebris; - shellExitDir = "0.0 -0.5 -0.5"; - shellExitOffset = "0.0 0.0 0.0"; - shellExitVariance = 20.0; - shellVelocity = 5.0; - - projectileSpread = 2.0 / 1000.0; - - stateName[0] = "Activate"; - stateTransitionOnNotLoaded[0] = "Dead"; - stateTransitionOnLoaded[0] = "ActivateReady"; - - stateName[1] = "ActivateReady"; - stateSequence[1] = "Activate"; - stateSound[1] = SentinelActivateSound; - stateTimeoutValue[1] = 1; - stateTransitionOnTimeout[1] = "Ready"; - stateTransitionOnNotLoaded[1] = "Deactivate"; - stateTransitionOnNoAmmo[1] = "NoAmmo"; - - stateName[2] = "Ready"; - stateTransitionOnNotLoaded[2] = "Deactivate"; - stateTransitionOnTriggerDown[2] = "Fire"; - stateTransitionOnNoAmmo[2] = "NoAmmo"; - - stateName[3] = "Fire"; - stateSequence[3] = "Fire"; - stateSequenceRandomFlash[3] = true; - stateSound[3] = ChaingunFireSound; - stateAllowImageChange[3] = false; - stateEmitter[3] = "GunFireEffectEmitter"; - stateEmitterNode[3] = "muzzlepoint1"; - stateEmitterTime[3] = 0.1; - stateScript[3] = "onFire"; - stateFire[3] = true; - stateEjectShell[3] = true; - stateTimeoutValue[3] = 0.1; - stateTransitionOnTimeout[3] = "Fire"; - stateTransitionOnTriggerUp[3] = "Reload"; - stateTransitionOnNoAmmo[3] = "noAmmo"; - - stateName[4] = "Reload"; - stateTimeoutValue[4] = 0.01; - stateAllowImageChange[4] = false; - stateWaitForTimeout[4] = true; - stateSequence[4] = "Reload"; - stateTransitionOnTimeout[4] = "Ready"; - stateTransitionOnNotLoaded[4] = "Deactivate"; - stateTransitionOnNoAmmo[4] = "NoAmmo"; - - stateName[5] = "Deactivate"; - stateSequence[5] = "Activate"; - stateSound[5] = SentinelDeactivateSound; - stateEmitter[5] = "GunFireEffectEmitter"; - stateEmitterNode[5] = "muzzlepoint1"; - stateEmitterTime[5] = 0.2; - stateDirection[5] = false; - stateTimeoutValue[5] = 1; - stateTransitionOnLoaded[5] = "ActivateReady"; - stateTransitionOnTimeout[5] = "Dead"; - - stateName[6] = "Dead"; - stateTransitionOnLoaded[6] = "ActivateReady"; - - stateName[7] = "NoAmmo"; - stateTransitionOnAmmo[7] = "Reload"; - stateSequence[7] = "NoAmmo"; -}; - -//============================================================================== -// Vehicle Functions -//============================================================================== -// Sentinel Functions: -//------------------------------------------------------------------------------ - -function SentinelVehicle::deleteAllMounted(%data, %obj) { - $HostGamePlayerCount = ClientGroup.GetCount(); - %turret = %obj.getMountNodeObject(10); - if (!%turret) - return; - - %turret.altTrigger = 0; - %turret.fireTrigger = 0; - - if (%client = %turret.getControllingClient()) { - %client.player.setControlObject(%client.player); - %client.player.mountImage(%client.player.lastWeapon, $WeaponSlot); - %client.player.mountVehicle = false; - - %client.player.bomber = false; - %client.player.isBomber = false; - } - %turret.schedule(0, delete); -} - -function SentinelVehicle::onAdd(%this, %obj) -{ - Parent::onAdd(%this, %obj); - if (%obj.clientControl) - serverCmdResetControlObject(%obj.clientControl); - - %obj.mountImage(BodyImage, 1); - %obj.mountImage(RightWing, 2); - %obj.mountImage(LeftWing, 3); - %obj.mountImage(Eye, 4); - - %turret = TurretData::create(SentinelTurret); - %turret.scale = "0.45 0.45 0.45"; - MissionCleanup.add(%turret); - %turret.team = 1; - %turret.selectedWeapon = 1; - %turret.setSelfPowered(); - %obj.mountObject(%turret, 10); - %turret.mountImage(SentinelTurretBarrel, 0); - %obj.turretObject = %turret; - %turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate ); - %turret.vehicleMounted = %obj; - %turret.setAutoFire(true); - %turret.mountImage(AIAimingTurretBarrel, 1); - - setTargetSensorGroup(%turret.getTarget(), %turret.team); - setTargetNeverVisMask(%turret.getTarget(), 0xffffffff); -} - -//============================================================================== -// Monitor Functions: -//============================================================================== - -function SentinelMonitor::onAdd(%this, %obj) -{ - Parent::onAdd(%this, %obj); - if (%obj.clientControl) - serverCmdResetControlObject(%obj.clientControl); - - %obj.mountImage(Front, 1); - %obj.mountImage(Rear, 2); -} diff --git a/Scripts/OptionsDlg.cs b/Scripts/OptionsDlg.cs deleted file mode 100644 index 9516871..0000000 --- a/Scripts/OptionsDlg.cs +++ /dev/null @@ -1,2772 +0,0 @@ -//------------------------------------------------------------------------------ -// -// OptionsDlg.cs -// -//------------------------------------------------------------------------------ -$max_screenerror = 25; -$min_TSScreenError = 2; -$max_TSScreenError = 20; -$min_TSDetailAdjust = 0.6; -$max_TSDetailAdjust = 1.0; -//------------------------------------------------------------------------------ -function OptionsDlg::onWake( %this ) -{ - OP_VideoPane.setVisible( false ); - OP_GraphicsPane.setVisible( false ); - OP_TexturesPane.setVisible( false ); - OP_SoundPane.setVisible( false ); - OP_VoicePane.setVisible( false ); - OP_ControlsPane.setVisible( false ); - OP_NetworkPane.setVisible( false ); - OP_GamePane.setVisible( false ); - - OP_VideoTab.setValue( false ); - OP_GraphicsTab.setValue( false ); - OP_TexturesTab.setValue( false ); - OP_SoundTab.setValue( false ); - OP_VoiceTab.setValue( false ); - OP_ControlsTab.setValue( false ); - OP_NetworkTab.setValue( false ); - OP_GameTab.setValue( false ); - - // Initialize the Video Pane controls: - // First the Video Driver menu: - %buffer = getDisplayDeviceList(); - %count = getFieldCount( %buffer ); - for ( %i = 0; %i < %count; %i++ ) - OP_VideoDriverMenu.add( getField( %buffer, %i ), %i ); - - // Select the current device: - OP_FullScreenTgl.setValue( $pref::Video::fullScreen ); - - %selId = OP_VideoDriverMenu.findText( $pref::Video::displayDevice ); - if ( %selId == -1 ) - %selId = 0; // How did THAT happen? - OP_VideoDriverMenu.setSelected( %selId ); - OP_VideoDriverMenu.onSelect( %selId, "" ); - OP_FullScreenTgl.onAction(); - - OP_ApplyBtn.setActive( false ); - - // Initialize the Graphics Options controls: - OptionsDlg::deviceDependent( %this ); - - // Radeon cards don't switch color depth good until they release their beta drivers which fix this problem. - if( $RadeonRenderer == true ) - OP_BPPMenu.setActive( false ); - - OP_GammaSlider.setValue( $pref::OpenGL::gammaCorrection ); - OP_GammaSlider.setActive( $Video::setGammaCorrectionSupported ); - - OP_TerrainSlider.setValue( $max_screenerror - $pref::Terrain::screenError ); - OP_ShapeSlider.setValue( ( $max_TSScreenError - $pref::TS::screenError ) / ( $max_TSScreenError - $min_TSScreenError ) ); - OP_ShadowSlider.setValue( $pref::Shadows ); - OP_InteriorDetailSlider.setValue( $pref::Interior::detailAdjust ); - OP_VisibleDistanceSlider.setValue( $pref::VisibleDistanceMod ); - OP_ParticleDensitySlider.setValue( 4.0 - $pref::ParticleDensity ); - OP_DynamicLightSlider.setValue( 100 - $pref::Interior::DynamicLightsClipPix ); - updateDynamicLightSliderState(); - OP_SkyDetailMenu.init(); - if ( !$pref::SkyOn ) - %selId = 5; - else if ( $pref::numCloudLayers >= 0 && $pref::numCloudLayers < 4 ) - %selId = 4 - $pref::numCloudLayers; - else - %selId = 1; - OP_SkyDetailMenu.setSelected( %selId ); - OP_SkyDetailMenu.setText( OP_SkyDetailMenu.getTextById( %selId ) ); - OP_PlayerRenderMenu.init(); - %selId = $pref::Player::renderMyPlayer | ( $pref::Player::renderMyItems << 1 ); - OP_PlayerRenderMenu.setSelected( %selId ); - OP_VertexLightTgl.setValue( $pref::Interior::VertexLighting ); - - // Initialize the Textures Options controls: - OP_TerrainTexSlider.setValue( 6 - $pref::Terrain::texDetail ); - - // We're using the noDrawArraysAlpha variable here because we've already - // gone gold (hard to add a new profiling variable). But the Voodoo2/3/3500 - // cards that have the 256x256 texture limitation (in OpenGL) also have the - // noDrawArraysAlpha hack on...so that works out nice - %mipRange = $pref::OpenGL::noDrawArraysAlpha ? 4.0 : 5.0; - OP_ShapeTexSlider.setValue( (5 - $pref::OpenGL::mipReduction) / %mipRange ); - OP_BuildingTexSlider.setValue( (5 - $pref::OpenGL::interiorMipReduction) / %mipRange ); - OP_SkyTexSlider.setValue( (5 - $pref::OpenGL::skyMipReduction) / %mipRange ); - if ( !isDemo() ) - OP_HiResSkinTgl.setValue( $pref::use512PlayerSkins ); - - // Initialize the Sound Options controls: - // provider menu - %count = alxGetContexti(ALC_PROVIDER_COUNT); - for(%i = 0; %i < %count; %i++) - OP_AudioProviderMenu.add(alxGetContextstr(ALC_PROVIDER_NAME, %i), %i); - %selId = alxGetContexti(ALC_PROVIDER); - OP_AudioProviderMenu.setSelected(%selId); - OP_AudioResetProvider.setActive(false); - - // environment provider: disable and uncheck if not an environment provider - %envProvider = audioIsEnvironmentProvider(alxGetContextstr(ALC_PROVIDER_NAME, %selId)); - - if(!%envProvider) - OP_AudioEnvironmentTgl.setValue(false); - OP_AudioEnvironmentTgl.setActive(%envProvider); - - // speaker menu - %count = alxGetContexti(ALC_SPEAKER_COUNT); - for(%i = 0; %i < %count; %i++) - OP_AudioSpeakerMenu.add(alxGetContextstr(ALC_SPEAKER_NAME, %i), %i); - %selId = alxGetContexti(ALC_SPEAKER); - OP_AudioSpeakerMenu.setSelected(%selId); - OP_AudioSpeakerMenu.onSelect(%selId, ""); - - OP_AudioFrequencyMenu.init(); - OP_AudioBitRateMenu.init(); - OP_AudioChannelsMenu.init(); - - // don't allow changing of of mixer settings while in a game... - %active = !isObject(ServerConnection); - OP_AudioFrequencyMenu.setActive(%active); - // Changing these audio settings doesn't help Linux performance - if ( $platform $= "linux" ) - { - OP_AudioBitRateMenu.setActive(false); - OP_AudioChannelsMenu.setActive(false); - } - else - { - OP_AudioBitRateMenu.setActive(%active); - OP_AudioChannelsMenu.setActive(%active); - } - - // only allow for disable - if(!%active) - OP_AudioEnvironmentTgl.setActive(%active); - - OP_AudioProviderMenu.setActive(%active); - OP_AudioSpeakerMenu.setActive(%active); - - OP_MasterVolumeSlider.setValue( $pref::Audio::masterVolume ); - OP_EffectsVolumeSlider.setValue( $pref::Audio::effectsVolume ); - OP_VoiceBindVolumeSlider.setValue( $pref::Audio::radioVolume ); - OP_GuiVolumeSlider.setValue( $pref::Audio::guiVolume ); - OP_MusicTgl.onAction(); - OP_MusicVolumeSlider.setValue( $pref::Audio::musicVolume ); - - // Initialize the Voice Settings controls: - OP_MicrophoneEnabledTgl.onAction(); - OP_MicrophoneVolumeSlider.setValue( $pref::Audio::voiceVolume ); - OP_InputBoostSlider.setValue( $pref::Audio::captureGainScale ); - OP_VoiceListenMenu.init(); - OP_VoiceSendMenu.init(); - OP_VoiceCodecInfo.init(); - updateInputBoost(); - - // Initialize the Control Options controls: - OP_ControlGroupMenu.init(); - - if ( isJoystickDetected() ) - { - OP_JoystickTgl.setValue( $pref::Input::JoystickEnabled ); - OP_JoystickTgl.setActive( true ); - OP_ConfigureJoystickBtn.setActive( $pref::Input::JoystickEnabled ); - } - else - { - OP_JoystickTgl.setValue( false ); - OP_JoystickTgl.setActive( false ); - $pref::Input::JoystickEnabled = false; - OP_ConfigureJoystickBtn.setActive( false ); - } - - // Initialize the Network Options controls: - OP_NetworkDisplayHud.init(); - if( !OP_NetworkPresetsMenu.size() ) - OP_NetworkPresetsMenu.init(); - OP_PacketRateSlider.setValue( $pref::Net::PacketRateToClient ); - OP_PacketSizeSlider.setValue( $pref::Net::PacketSize ); - OP_UpdateRateSlider.setValue( $pref::Net::PacketRateToServer ); - if ( !OP_MasterServerMenu.size() ) - OP_MasterServerMenu.init(); - %selId = OP_MasterServerMenu.findText( $pref::Net::DisplayOnMaster ); - if ( %selId == -1 ) - %selId = 1; - OP_MasterServerMenu.setSelected( %selId ); - if ( !OP_RegionMenu.size() ) - OP_RegionMenu.init(); - OP_RegionMenu.setSelected( $pref::Net::RegionMask ); - - // Initialize the Game Options controls: - OP_ZoomSpeedSlider.setValue( 500 - $pref::Player::zoomSpeed ); - OP_LaunchScreenMenu.init(); - - %selId = OP_LaunchScreenMenu.findText( $pref::Shell::LaunchGui ); - if ( %selId == -1 ) - %selId = 1; - OP_LaunchScreenMenu.setText( OP_LaunchScreenMenu.getTextById( %selId ) ); - OP_LaunchScreenMenu.setSelected( %selId ); - - // Hide controls that are not relevant to the demo: - if ( isDemo() ) - { - OP_MasterServerTxt.setVisible( false ); - OP_MasterServerMenu.setVisible( false ); - OP_CheckEmailTgl.setVisible( false ); - OP_ChatDisconnectTgl.setVisible( false ); - OP_EditChatMenuBtn.setVisible( false ); - OP_LaunchScreenTxt.setVisible( false ); - OP_LaunchScreenMenu.setVisible( false ); - } - - %this.setPane( %this.pane ); -} - -//------------------------------------------------------------------------------ -function OptionsDlg::deviceDependent( %this ) -{ - if ( $SwapIntervalSupported ) - { - OP_VSyncTgl.setValue( $pref::Video::disableVerticalSync ); - OP_VSyncTgl.setActive( true ); - } - else - { - OP_VSyncTgl.setValue( false ); - OP_VSyncTgl.setActive( false ); - } - - if ( isDemo() ) - { - OP_TexQualityMenu.setText( "Palletized" ); - OP_TexQualityMenu.setActive( false ); - } - else - { - OP_TexQualityMenu.init(); - if ( $pref::OpenGL::forcePalettedTexture ) - { - $pref::OpenGL::force16bittexture = false; - %selId = 1; - } - else if ( $pref::OpenGL::force16bittexture ) - %selId = 2; - else - %selId = 3; - OP_TexQualityMenu.setSelected( %selId ); - } - - OP_CompressMenu.init(); - if ( $TextureCompressionSupported && !$pref::OpenGL::disableARBTextureCompression ) - { - OP_CompressLabel.setVisible( true ); - OP_CompressLabel_Disabled.setVisible( false ); - OP_CompressMenu.setActive( true ); - if ( !$pref::OpenGL::allowCompression ) - OP_CompressMenu.setSelected( 1 ); - else if ( $pref::OpenGL::compressionHint $= "GL_NICEST" ) - OP_CompressMenu.setSelected( 3 ); - else - OP_CompressMenu.setSelected( 2 ); - } - else - { - OP_CompressLabel_Disabled.setVisible( true ); - OP_CompressLabel.setVisible( false ); - OP_CompressMenu.setActive( false ); - OP_CompressMenu.setText( "None" ); - } - - if ( $FogCoordSupported ) - { - OP_IntTexturedFogTgl.setValue( $pref::Interior::TexturedFog ); - OP_IntTexturedFogTgl.setActive( true ); - } - else - { - OP_IntTexturedFogTgl.setValue( true ); - OP_IntTexturedFogTgl.setActive( false ); - } - - OP_AnisotropySlider.setValue( $pref::OpenGL::anisotropy ); - OP_AnisotropySlider.setActive( $AnisotropySupported ); - if ( $AnisotropySupported ) - { - OP_AnisotropyLabel.setVisible( true ); - OP_AnisotropyLabel_Disabled.setVisible( false ); - } - else - { - OP_AnisotropyLabel_Disabled.setVisible( true ); - OP_AnisotropyLabel.setVisible( false ); - } - - OP_EnvMapTgl.setValue($pref::environmentMaps); - OP_EnvMapTgl.setActive($pref::OpenGL::allowTexGen); -} - -//------------------------------------------------------------------------------ -function OptionsDlg::onSleep( %this ) -{ - OP_VideoDriverMenu.clear(); - OP_ResMenu.clear(); - OP_BPPMenu.clear(); - OP_AudioProviderMenu.clear(); - OP_AudioSpeakerMenu.clear(); - OP_NetworkDisplayHud.uninit(); - - if ( %this.resetAudio ) - { - echo( "Resetting the audio driver..." ); - audioSetDriver( "none" ); - audioSetDriver( $pref::Audio::activeDriver ); - %this.resetAudio = ""; - - // Play the shell hum: (all sources are gone) - if($HudHandle[shellScreen] $= "") - alxStop($HudHandle[shellScreen]); - - $HudHandle[shellScreen] = alxPlay(ShellScreenHumSound, 0, 0, 0); - } - - if ( isObject( ServerConnection ) && isTextureFlushRequired() ) - MessageBoxYesNo( "WARNING", "You have made changes that require Tribes 2 to flush the texture cache. " - @ "Doing this while the game is running can take a long time. " - @ "Do you wish to continue?", - "OptionsDlg.saveSettings();", "returnFromSettings();" ); - else - %this.saveSettings(); -} - -//------------------------------------------------------------------------------ -function isTextureFlushRequired() -{ - if ( $pref::Interior::VertexLighting != OP_VertexLightTgl.getValue() ) - return( true ); - - // We're using the noDrawArraysAlpha variable here because we've already - // gone gold (hard to add a new profiling variable). But the Voodoo2/3/3500 - // cards that have the 256x256 texture limitation (in OpenGL) also have the - // noDrawArraysAlpha hack on...so that works out nice - %mipRange = $pref::OpenGL::noDrawArraysAlpha ? 4 : 5; - if ( $pref::OpenGL::mipReduction != 5 - mFloor( OP_ShapeTexSlider.getValue() * %mipRange ) ) - return( true ); - - if ( $pref::OpenGL::interiorMipReduction != 5 - mFloor( OP_BuildingTexSlider.getValue() * %mipRange ) ) - return( true ); - - if ( $pref::OpenGL::skyMipReduction != 5 - mFloor( OP_SkyTexSlider.getValue() * %mipRange ) ) - return( true ); - - if ( $AnisotropySupported && $pref::OpenGL::anisotropy != OP_AnisotropySlider.getValue() ) - return( true ); - - if ( !isDemo() ) - { - %id = OP_TexQualityMenu.getSelected(); - if ( $pref::OpenGL::forcePalettedTexture ) - { - if ( %id != 1 ) - return( true ); - } - else if ( $pref::OpenGL::force16bittexture ) - { - if ( %id != 2 ) - return( true ); - } - else if ( %id != 3 ) - return( true ); - } - - if ( $TextureCompressionSupported && !$pref::OpenGL::disableARBTextureCompression ) - { - %id = OP_CompressMenu.getSelected(); - if ( $pref::OpenGL::allowCompression ) - { - if ( $pref::OpenGL::compressionHint $= "GL_FASTEST" ) - { - if ( %id != 2 ) - return( true ); - } - else if ( $pref::OpenGL::compressionHint $= "GL_NICEST" ) - { - if ( %id != 3 ) - return( true ); - } - else if ( %id == 1 ) - return( true ); - } - else if ( %id > 1 ) - return( true ); - } - - return( false ); -} - -//------------------------------------------------------------------------------ -function returnFromSettings() -{ - // to unpause singlePlayerGame when returning from options - if ( isObject( Game ) ) - Game.OptionsDlgSleep(); -} - -//------------------------------------------------------------------------------ -function OptionsDlg::saveSettings( %this ) -{ - // Save off any prefs that don't auto-update: - %flushTextures = false; - - if ( $SwapIntervalSupported && OP_VSyncTgl.getValue() != $pref::Video::disableVerticalSync ) - { - $pref::Video::disableVerticalSync = OP_VSyncTgl.getValue(); - setVerticalSync( !$pref::Video::disableVerticalSync ); - } - - %temp = OP_SkyDetailMenu.getSelected(); - if ( %temp == 5 ) - $pref::SkyOn = false; - else - { - $pref::SkyOn = true; - $pref::numCloudLayers = ( 4 - %temp ); - } - - if ( $FogCoordSupported ) - $pref::Interior::TexturedFog = OP_IntTexturedFogTgl.getValue(); - - if ( $pref::Interior::VertexLighting != OP_VertexLightTgl.getValue() ) - { - $pref::Interior::VertexLighting = OP_VertexLightTgl.getValue(); - %flushTextures = true; - } - - %temp = OP_PlayerRenderMenu.getSelected(); - $pref::Player::renderMyPlayer = %temp & 1; - $pref::Player::renderMyItems = %temp & 2; - - if ( !isDemo() ) - { - switch ( OP_TexQualityMenu.getSelected() ) - { - case 1: // 8-bit - if ( !$pref::OpenGL::forcePalettedTexture || $pref::OpenGL::force16bittexture ) - { - $pref::OpenGL::forcePalettedTexture = true; - $pref::OpenGL::force16bittexture = false; - %flushTextures = true; - } - case 2: // 16-bit - if ( $pref::OpenGL::forcePalettedTexture || !$pref::OpenGL::force16bittexture ) - { - $pref::OpenGL::forcePalettedTexture = false; - $pref::OpenGL::force16bittexture = true; - %flushTextures = true; - } - case 3: // 32-bit - if ( $pref::OpenGL::forcePalettedTexture || $pref::OpenGL::force16bittexture ) - { - $pref::OpenGL::forcePalettedTexture = false; - $pref::OpenGL::force16bittexture = false; - %flushTextures = true; - } - } - OP_TexQualityMenu.clear(); - } - - $pref::Terrain::texDetail = 6 - mFloor( OP_TerrainTexSlider.getValue() ); - - // We're using the noDrawArraysAlpha variable here because we've already - // gone gold (hard to add a new profiling variable). But the Voodoo2/3/3500 - // cards that have the 256x256 texture limitation (in OpenGL) also have the - // noDrawArraysAlpha hack on...so that works out nice - %mipRange = $pref::OpenGL::noDrawArraysAlpha ? 4 : 5; - - %temp = 5 - mFloor( OP_ShapeTexSlider.getValue() * %mipRange ); - if ( $pref::OpenGL::mipReduction != %temp ) - { - $pref::OpenGL::mipReduction = %temp; - setOpenGLMipReduction( $pref::OpenGL::mipReduction ); - %flushTextures = true; - } - - %temp = 5 - mFloor( OP_BuildingTexSlider.getValue() * %mipRange ); - if ( $pref::OpenGL::interiorMipReduction != %temp ) - { - $pref::OpenGL::interiorMipReduction = %temp; - setOpenGLInteriorMipReduction( $pref::OpenGL::interiorMipReduction ); - %flushTextures = true; - } - - %temp = 5 - mFloor( OP_SkyTexSlider.getValue() * %mipRange ); - if ( $pref::OpenGL::skyMipReduction != %temp ) - { - $pref::OpenGL::skyMipReduction = %temp; - setOpenGLSkyMipReduction( $pref::OpenGL::skyMipReduction ); - %flushTextures = true; - } - - if ( $TextureCompressionSupported && !$pref::OpenGL::disableARBTextureCompression ) - { - %temp = OP_CompressMenu.getSelected(); - if ( $pref::OpenGL::allowCompression ) - { - switch ( %temp ) - { - case 2: - if ( $pref::OpenGL::compressionHint !$= "GL_FASTEST" ) - { - $pref::OpenGL::compressionHint = "GL_FASTEST"; - setOpenGLTextureCompressionHint( $pref::OpenGL::compressionHint ); - %flushTextures = true; - } - - case 3: - if ( $pref::OpenGL::compressionHint !$= "GL_NICEST" ) - { - $pref::OpenGL::compressionHint = "GL_NICEST"; - setOpenGLTextureCompressionHint( $pref::OpenGL::compressionHint ); - %flushTextures = true; - } - - default: // None - $pref::OpenGL::allowCompression = false; - %flushTextures = true; - } - } - else if ( %temp > 1 ) - { - $pref::OpenGL::allowCompression = true; - if ( %temp == 3 ) - $pref::OpenGL::compressionHint = "GL_NICEST"; - else - $pref::OpenGL::compressionHint = "GL_FASTEST"; - setOpenGLTextureCompressionHint( $pref::OpenGL::compressionHint ); - %flushTextures = true; - } - } - OP_CompressMenu.clear(); - - if ( $AnisotropySupported ) - { - %temp = OP_AnisotropySlider.getValue(); - if ( $pref::OpenGL::anisotropy != %temp ) - { - $pref::OpenGL::anisotropy = %temp; - setOpenGLAnisotropy( $pref::OpenGL::anisotropy ); - %flushTextures = true; - } - } - - if ( !isDemo() ) - { - if ( OP_HiResSkinTgl.getValue() != $pref::use512PlayerSkins ) - { - $pref::use512PlayerSkins = OP_HiResSkinTgl.getValue(); - if ( Canvas.getContent() == GameGui.getId() && GM_WarriorPane.isVisible() ) - GMW_PlayerModel.update(); - } - } - - $pref::Terrain::screenError = $max_screenerror - mFloor( OP_TerrainSlider.getValue() ); - $pref::TS::screenError = $max_TSScreenError - mFloor( OP_ShapeSlider.getValue() * ( $max_TSScreenError - $min_TSScreenError ) ); - $pref::TS::detailAdjust = $min_TSDetailAdjust + OP_ShapeSlider.getValue() * ( $max_TSDetailAdjust - $min_TSDetailAdjust ); - $pref::Shadows = OP_ShadowSlider.getValue(); - $pref::ParticleDensity = 4.0 - OP_ParticleDensitySlider.getValue(); - %val = 100 - OP_DynamicLightSlider.getValue(); - $pref::Interior::DynamicLightsClipPix = $pref::Terrain::DynamicLightsClipPix = %val; - $pref::Interior::DynamicLightsFadePix = $pref::Terrain::DynamicLightsFadePix = 2 * %val; - setShadowDetailLevel( $pref::Shadows ); - $pref::Interior::detailAdjust = OP_InteriorDetailSlider.getValue(); - $pref::VisibleDistanceMod = OP_VisibleDistanceSlider.getValue(); - - $pref::Audio::musicVolume = OP_MusicVolumeSlider.getValue(); - $pref::Audio::masterVolume = OP_MasterVolumeSlider.getValue(); - $pref::Audio::effectsVolume = OP_EffectsVolumeSlider.getValue(); - alxSetChannelVolume( $EffectAudioType, $pref::Audio::effectsVolume ); - $pref::Audio::voiceVolume = OP_MicrophoneVolumeSlider.getValue(); - alxSetChannelVolume( $VoiceAudioType, $pref::Audio::voiceVolume ); - $pref::Audio::radioVolume = OP_VoiceBindVolumeSlider.getValue(); - alxSetChannelVolume( $ChatAudioType, $pref::Audio::radioVolume ); - $pref::Audio::guiVolume = OP_GuiVolumeSlider.getValue(); - alxSetChannelVolume( $GuiAudioType, $pref::Audio::guiVolume); - $pref::Audio::captureGainScale = OP_InputBoostSlider.getValue(); - if ( !$missionRunning ) - MusicPlayer.stop(); - - if ( $pref::Audio::enableVoiceCapture ) - { - %reinit = false; - %selId = OP_VoiceListenMenu.getSelected(); - if ( $pref::Audio::decodingMask != %selId ) - { - $pref::Audio::decodingMask = %selId; - %reinit = true; - } - - %selId = OP_VoiceSendMenu.getSelected(); - if ( $pref::Audio::encodingLevel != %selId ) - { - $pref::Audio::encodingLevel = %selId; - %reinit = true; - } - - if ( %reinit ) - { - alxCaptureDestroy(); - alxCaptureInit(); - - // If in a game, let the server know about the altered settings: - if ( isObject( ServerConnection ) ) - commandToServer( 'SetVoiceInfo', $pref::Audio::voiceChannels, $pref::Audio::decodingMask, $pref::Audio::encodingLevel ); - } - } - - updateNetworkSettings(); - - $pref::Player::zoomSpeed = 500 - mFloor( OP_ZoomSpeedSlider.getValue() ); - setZoomSpeed( $pref::Player::zoomSpeed ); - - $pref::Shell::LaunchGui = OP_LaunchScreenMenu.getText(); - - export( "$pref::*", "prefs/ClientPrefs.cs", false ); - saveActiveMapFile(); - - if ( %flushTextures ) - { - // Give the Options Dialog a chance to go away: - OptionsDlg.schedule( 0, doTextureFlush ); - } - - returnFromSettings(); -} - -//------------------------------------------------------------------------------ -function OptionsDlg::doTextureFlush( %this ) -{ - MessagePopup( "PLEASE WAIT", "Flushing texture cache...\nThis may take a while" ); - Canvas.repaint(); - flushTextureCache(); - CloseMessagePopup(); -} - -//------------------------------------------------------------------------------ -function OptionsDlg::setPane( %this, %pane ) -{ - if((%this.pane $= "Sound") && !$missionRunning) - MusicPlayer.stop(); - - if ( %this.pane !$= "None" ) - { - %paneCtrl = "OP_" @ %this.pane @ "Pane"; - %paneCtrl.setVisible( false ); - - %tabCtrl = "OP_" @ %this.pane @ "Tab"; - %tabCtrl.setValue( false ); - } - - %paneCtrl = "OP_" @ %pane @ "Pane"; - %paneCtrl.setVisible( true ); - - %tabCtrl = "OP_" @ %pane @ "Tab"; - %tabCtrl.setValue( true ); - - %this.pane = %pane; -} - -//------------------------------------------------------------------------------ -function OptionsDlg::applyGraphicChanges( %this ) -{ - %newDriver = OP_VideoDriverMenu.getText(); - %newRes = OP_ResMenu.getText(); - %newBpp = OP_BPPMenu.getText(); - %newFullScreen = OP_FullScreenTgl.getValue(); - - if ( %newDriver !$= $pref::Video::displayDevice ) - { - setDisplayDevice( %newDriver, firstWord( %newRes ), getWord( %newRes, 1 ), %newBpp, %newFullScreen ); - OptionsDlg::deviceDependent( %this ); - } - else - setScreenMode( firstWord( %newRes ), getWord( %newRes, 1 ), %newBpp, %newFullScreen ); - - OP_ApplyBtn.updateState(); -} - - -//------------------------------------------------------------------------------ -function OP_VideoDriverMenu::onSelect( %this, %id, %text ) -{ - // Attempt to keep the same res and bpp settings: - if ( OP_ResMenu.size() > 0 ) - %prevRes = OP_ResMenu.getText(); - else - %prevRes = getWords( $pref::Video::resolution, 0, 1 ); - - // Check if this device is full-screen only: - if ( isDeviceFullScreenOnly( %this.getText() ) ) - { - OP_FullScreenTgl.setValue( true ); - OP_FullScreenTgl.setActive( false ); - OP_FullScreenTgl.onAction(); - } - else - OP_FullScreenTgl.setActive( true ); - - if ( OP_FullScreenTgl.getValue() ) - { - if ( OP_BPPMenu.size() > 0 ) - %prevBPP = OP_BPPMenu.getText(); - else - %prevBPP = getWord( $pref::Video::resolution, 2 ); - } - - // Fill the resolution and bit depth lists: - OP_ResMenu.init( %this.getText(), OP_FullScreenTgl.getValue() ); - OP_BPPMenu.init( %this.getText() ); - - // Try to select the previous settings: - %selId = OP_ResMenu.findText( %prevRes ); - if ( %selId == -1 ) - %selId = 0; - OP_ResMenu.setSelected( %selId ); - - if ( OP_FullScreenTgl.getValue() ) - { - %selId = OP_BPPMenu.findText( %prevBPP ); - if ( %selId == -1 ) - %selId = 0; - OP_BPPMenu.setSelected( %selId ); - OP_BPPMenu.setText( OP_BPPMenu.getTextById( %selId ) ); - } - else - OP_BPPMenu.setText( "Default" ); - - OP_ApplyBtn.updateState(); -} - -//------------------------------------------------------------------------------ -function OP_ResMenu::init( %this, %device, %fullScreen ) -{ - %this.clear(); - %resList = getResolutionList( %device ); - %resCount = getFieldCount( %resList ); - %deskRes = getDesktopResolution(); - %count = 0; - for ( %i = 0; %i < %resCount; %i++ ) - { - %res = getWords( getField( %resList, %i ), 0, 1 ); - - if ( !%fullScreen ) - { - if ( firstWord( %res ) >= firstWord( %deskRes ) ) - continue; - if ( getWord( %res, 1 ) >= getWord( %deskRes, 1 ) ) - continue; - } - - // Only add to list if it isn't there already: - if ( %this.findText( %res ) == -1 ) - { - %this.add( %res, %count ); - %count++; - } - } -} - -//------------------------------------------------------------------------------ -function OP_ResMenu::onSelect( %this, %id, %text ) -{ - OP_ApplyBtn.updateState(); -} - -//------------------------------------------------------------------------------ -function OP_BPPMenu::init( %this, %device ) -{ - %this.clear(); - - if ( %device $= "Voodoo2" ) - %this.add( "16", 0 ); - else - { - %resList = getResolutionList( %device ); - %resCount = getFieldCount( %resList ); - %count = 0; - for ( %i = 0; %i < %resCount; %i++ ) - { - %bpp = getWord( getField( %resList, %i ), 2 ); - - // Only add to list if it isn't there already: - if ( %this.findText( %bpp ) == -1 ) - { - %this.add( %bpp, %count ); - %count++; - } - } - } -} - -//------------------------------------------------------------------------------ -function OP_BPPMenu::onSelect( %this, %id, %text ) -{ - OP_ApplyBtn.updateState(); -} - -//------------------------------------------------------------------------------ -function OP_FullScreenTgl::onAction( %this ) -{ - // Attempt to maintain current settings: - %selId = OP_ResMenu.getSelected(); - if ( %selId == -1 ) - %selId = 0; - %prevRes = OP_ResMenu.getTextById( %selId ); - - OP_ResMenu.init( OP_VideoDriverMenu.getText(), %this.getValue() ); - - %selId = OP_ResMenu.findText( %prevRes ); - if ( %selId == -1 ) - %selId = 0; - OP_ResMenu.setSelected( %selId ); - - if ( %this.getValue() ) - { - %selId = OP_BPPMenu.findText( getWord( $pref::Video::resolution, 2 ) ); - if ( %selId == - 1 ) - %selId = 0; - OP_BPPMenu.setSelected( %selId ); - OP_BPPMenu.setText( OP_BPPMenu.getTextById( %selId ) ); - OP_BPPMenu.setActive( true ); - } - else - { - OP_BPPMenu.setText( "Default" ); - OP_BPPMenu.setActive( false ); - } - - OP_ApplyBtn.updateState(); -} - -//------------------------------------------------------------------------------ -function OP_ApplyBtn::updateState( %this ) -{ - %active = false; - - if ( OP_VideoDriverMenu.getText() !$= $pref::Video::displayDevice ) - %active = true; - else if ( OP_ResMenu.getText() !$= getWords( $pref::Video::resolution, 0, 1 ) ) - %active = true; - else if ( OP_FullScreenTgl.getValue() != $pref::Video::fullScreen ) - %active = true; - else if ( OP_FullScreenTgl.getValue() ) - { - if ( OP_BPPMenu.getText() !$= getWord( $pref::Video::resolution, 2 ) ) - %active = true; - } - - %this.setActive( %active ); -} - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -// Graphics Settings: -// -function updateGammaCorrection() -{ - $pref::OpenGL::gammaCorrection = OP_GammaSlider.getValue(); - videoSetGammaCorrection( $pref::OpenGL::gammaCorrection ); -} - -//------------------------------------------------------------------------------ -function updateTerrainDetail() -{ - $pref::Terrain::screenError = $max_screenerror - mFloor( OP_TerrainSlider.getValue()); - if ( OP_TerrainSlider.getValue() != $max_screenerror - $pref::Terrain::screenError ) - OP_TerrainSlider.setValue( $max_screenerror - $pref::Terrain::screenError ); -} - -//------------------------------------------------------------------------------ -function updateDynamicLightSliderState() -{ - %on = $pref::Interior::DynamicLights || $pref::Terrain::dynamicLights; - OP_DynamicLightText.setVisible( %on ); - OP_DynamicLightText_Disabled.setVisible( !%on ); - OP_DynamicLightSlider.setActive( %on ); -} - -//------------------------------------------------------------------------------ -function OP_SkyDetailMenu::init( %this ) -{ - %this.clear(); - %this.add( "Full Sky", 1 ); - %this.add( "Two Cloud Layers", 2 ); - %this.add( "One Cloud Layer", 3 ); - %this.add( "Sky Box Only", 4 ); - %this.add( "No Sky", 5 ); -} - -//------------------------------------------------------------------------------ -function OP_PlayerRenderMenu::init( %this ) -{ - %this.clear(); - %this.add( "Player and Items", 3 ); - %this.add( "Player only", 1 ); - %this.add( "Items only", 2 ); - %this.add( "Neither Player nor Items", 0 ); -} - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -// Texture Settings: -// -function OP_CompressMenu::init( %this ) -{ - %this.clear(); - %this.add( "None", 1 ); - %this.add( "Fastest", 2 ); - %this.add( "Nicest", 3 ); -} - -//------------------------------------------------------------------------------ -function OP_TexQualityMenu::init( %this ) -{ - %this.clear(); - if ( $PalettedTextureSupported ) - %this.add( "Palletized", 1 ); - %this.add( "16 bit", 2 ); - %this.add( "32 bit", 3 ); -} - -//------------------------------------------------------------------------------ -function OP_TexQualityMenu::onSelect( %this, %id, %text ) -{ - if ( %id == 1 ) - { - // Disable these with palletized textures by default: - OP_EnvMapTgl.setValue( false ); - //OP_EnvMapTgl.setActive( false ); - OP_IntEnvMapTgl.setValue( false ); - //OP_IntEnvMapTgl.setActive( false ); - } -// else -// { -// OP_EnvMapTgl.setActive( true ); -// OP_IntEnvMapTgl.setActive( true ); -// } -} - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -// Audio Settings: -// -function setAudioProvider(%idx) -{ - alxContexti(ALC_PROVIDER, %idx); - $pref::Audio::provider = alxGetContextstr(ALC_PROVIDER_NAME, %idx); - - %active = audioIsEnvironmentProvider($pref::Audio::provider); - - // unset tgl if cannot be environment provider - if(!%active) - OP_AudioEnvironmentTgl.setValue(false); - OP_AudioEnvironmentTgl.setActive(%active); - - audioUpdateProvider($pref::Audio::provider); - OP_AudioProviderMenu.setSelected(%idx); -} - -//------------------------------------------------------------------------------ -function OP_AudioEnvironmentTgl::onAction(%this) -{ - alxEnableEnvironmental(%this.getValue()); -} - -//------------------------------------------------------------------------------ -function OP_AudioProviderMenu::onSelect(%this, %id, %text) -{ - if(%id != $Audio::originalProvider) - { - if(!%this.seenWarning) - { - MessageBoxOK("Warning", "Changing sound drivers may result in incompatibilities and game oddities. If you experience such oddities, hit \"Reset\" to restore defaults.", ""); - %this.seenWarning = true; - } - OP_AudioResetProvider.setActive(true); - } - setAudioProvider(%id); -} - -//------------------------------------------------------------------------------ -function OP_AudioResetProvider::onAction(%this) -{ - setAudioProvider($Audio::originalProvider); - %this.setActive(false); -} -//------------------------------------------------------------------------------ -function OP_AudioSpeakerMenu::onSelect(%this, %id, %text) -{ - alxContexti(ALC_SPEAKER, %id); - $pref::Audio::speakerType = alxGetContextstr(ALC_SPEAKER_NAME, %id); -} - -//------------------------------------------------------------------------------ -function OP_AudioFrequencyMenu::init( %this ) -{ - %this.clear(); - %this.add( "11 KHz", 0 ); - %this.add( "22 KHz", 1 ); - %this.add( "44 KHz", 2 ); - - switch ( $pref::Audio::frequency ) - { - case 11025: %this.setSelected( 0 ); - case 22050: %this.setSelected( 1 ); - default: %this.setSelected( 2 ); - } -} - -//------------------------------------------------------------------------------ -function OP_AudioFrequencyMenu::onSelect( %this, %id, %text ) -{ - switch ( %id ) - { - case 0: %newVal = 11025; - case 1: %newVal = 22050; - default: %newVal = 44100; - } - - if ( $pref::Audio::frequency != %newVal ) - { - $pref::Audio::frequency = %newVal; - OptionsDlg.resetAudio = true; - } -} - -//------------------------------------------------------------------------------ -function OP_AudioBitRateMenu::init( %this ) -{ - %this.clear(); - %this.add( "8 bit", 0 ); - %this.add( "16 bit", 1 ); - - if ( $pref::Audio::sampleBits == 8 ) - %this.setSelected( 0 ); - else - %this.setSelected( 1 ); -} - -//------------------------------------------------------------------------------ -function OP_AudioBitRateMenu::onSelect( %this, %id, %text ) -{ - %newVal = %id == 0 ? 8 : 16; - if ( $pref::Audio::sampleBits != %newVal ) - { - $pref::Audio::sampleBits = %newVal; - OptionsDlg.resetAudio = true; - } -} - -//------------------------------------------------------------------------------ -function OP_AudioChannelsMenu::init( %this ) -{ - %this.clear(); - %this.add( "One", 0 ); - %this.add( "Two", 1 ); - - if ( $pref::Audio::channels == 1 ) - %this.setSelected( 0 ); - else - %this.setSelected( 1 ); -} - -//------------------------------------------------------------------------------ -function OP_AudioChannelsMenu::onSelect( %this, %id, %text ) -{ - %newVal = %id == 0 ? 1 : 2; - if ( $pref::Audio::channels != %newVal ) - { - $pref::Audio::channels = %newVal; - OptionsDlg.resetAudio = true; - } -} - -//------------------------------------------------------------------------------ -function OP_MusicTgl::onAction( %this ) -{ - %on = %this.getValue(); - OP_MusicVolumeLabel.setVisible( %on ); - OP_MusicVolumeLabel_Disabled.setVisible( !%on ); - OP_MusicVolumeSlider.setActive( %on ); - $pref::Audio::musicEnabled = %on; - - if ( %on ) - MusicPlayer.play(); - else - MusicPlayer.stop(); -} - -//------------------------------------------------------------------------------ -function updateMusicVolume() -{ - %volume = OP_MusicVolumeSlider.getValue(); - alxSetChannelVolume( $MusicAudioType, %volume ); -} - -//------------------------------------------------------------------------------ -function updateGuiVolume() -{ - %volume = OP_GuiVolumeSlider.getValue(); - alxSetChannelVolume( $GuiAudioType, %volume ); -} - -//------------------------------------------------------------------------------ -function updateMasterVolume() -{ - %volume = OP_MasterVolumeSlider.getValue(); - alxListenerf( AL_GAIN_LINEAR, %volume ); -} - - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -// Voice Settings: -// -function OP_MicrophoneEnabledTgl::onAction( %this ) -{ - %on = %this.getValue(); - OP_RecordTestBtn.setActive( %on ); - OP_MicVolumeLabel.setVisible( %on ); - OP_MicVolumeLabel_Disabled.setVisible( !%on ); - OP_MicrophoneVolumeSlider.setActive( %on ); - OP_InputBoostLabel.setVisible( %on ); - OP_InputBoostLabel_Disabled.setVisible( !%on ); - OP_InputBoostSlider.setActive( %on ); - OP_InputBoostPercentTxt.setVisible( %on ); - OP_VoiceListenLabel.setVisible( %on ); - OP_VoiceListenLabel_Disabled.setVisible( !%on ); - OP_VoiceListenMenu.setActive( %on ); - OP_VoiceSendLabel.setVisible( %on ); - OP_VoiceSendLabel_Disabled.setVisible( !%on ); - OP_VoiceSendMenu.setActive( %on ); - - if(%on != alxIsEnabled("capture")) - { - if(%on) - alxCaptureInit(); - else - alxCaptureDestroy(); - } -} - -//------------------------------------------------------------------------------ -function updateInputBoost() -{ - %val = OP_InputBoostSlider.getValue(); - alxSetCaptureGainScale( %val ); - %val = mFloor(%val * 100); - OP_InputBoostPercentTxt.setValue(%val @ "%"); -} - -//------------------------------------------------------------------------------ -function OP_RecordTestBtn::onAction( %this ) -{ - alxCaptureStart(true); -} - -//------------------------------------------------------------------------------ -function localCaptureStart( %method ) -{ - if(%method $= "record") - { - OP_RecordTestBtn.setActive(false); - OP_RecordTestBtn.setValue(">> Recording <<"); - } - else - { - OP_RecordTestBtn.setActive(false); - OP_RecordTestBtn.setValue(">> Playing <<"); - } -} - -//------------------------------------------------------------------------------ -function localCaptureStop( %method ) -{ - if(%method $= "play") - { - OP_RecordTestBtn.setActive(true); - OP_RecordTestBtn.setValue("Test Record"); - } -} - -//------------------------------------------------------------------------------ -function OP_VoiceListenMenu::init( %this ) -{ - %this.clear(); - %this.add( "", 0 ); - if ( $platform !$= "linux" ) { - %this.add( ".v12", 1 ); - %this.add( ".v12 - .v24", 3 ); - %this.add( ".v12 - .v29", 7 ); - } - if ( $platform $= "linux" ) { - %this.add( "GSM" , 8 ); - } - - switch ( $pref::Audio::decodingMask ) - { - case 0 or 3 or 7 or 8: - %this.setSelected( $pref::Audio::decodingMask ); - default: - %this.setSelected( 1 ); - } -} - -//------------------------------------------------------------------------------ -function OP_VoiceSendMenu::init( %this ) -{ - %this.clear(); - if ( $platform !$= "linux" ) { - %this.add( ".v12", 0 ); - %this.add( ".v24", 1 ); - %this.add( ".v29", 2 ); - } - if ( $platform $= "linux" ) { - %this.add( "GSM", 3 ); - } - - %this.setSelected($pref::Audio::encodingLevel); -} - -function OP_VoiceCodecInfo::init( %this ) -{ - %headerStyle = ""; - if ( $platform $= "linux" ) { - %displayText = "" @ %headerStyle @ "Voice Codec Information:" NL - "\n" @ - " GSM: fixed bitrate codec (6.6 kbits/sec linux only)" NL - "\n" @ - "" @ - "Setting your codec levels too high can have adverse" @ - " affects on network performance." @ - ""; - } else { - %displayText = "" @ %headerStyle @ "Voice Codec Information:" NL - "\n" @ - " .v12: variable bitrate codec (~1.2 kbits/sec win only)" NL - " .v24: fixed bitrate codec (2.4 kbits/sec win only)" NL - " .v29: fixed bitrate codec (2.9 kbits/sec win only)" NL - "\n" @ - "" @ - "Setting your codec levels too high can have adverse" @ - " affects on network performance." @ - ""; - } - - %this.setText(%displayText); - %this.setActive(false); -} - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -// Driver Info dialog: -// -function DriverInfoDlg::onWake( %this ) -{ - %headerStyle = ""; - %infoString = getVideoDriverInfo(); - %displayText = "" @ %headerStyle @ "VENDOR:" NL - " " @ getField( %infoString, 0 ) NL - "" @ %headerStyle @ "RENDERER:" NL - " " @ getField( %infoString, 1 ) NL - "" @ %headerStyle @ "VERSION " @ getField( %infoString, 2 ) NL - "\n" @ - "" @ %headerStyle @ "SUPPORTED OPENGL EXTENSIONS:" NL - getField( %infoString, 3 ); - - DriverInfoText.setText( %displayText ); -} - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -// Control remapper section: -// -$RemapCount = 0; -$RemapName[$RemapCount] = "Forward"; -$RemapCmd[$RemapCount] = "moveforward"; -$RemapCount++; -$RemapName[$RemapCount] = "Backward"; -$RemapCmd[$RemapCount] = "movebackward"; -$RemapCount++; -$RemapName[$RemapCount] = "Strafe Left"; -$RemapCmd[$RemapCount] = "moveleft"; -$RemapCount++; -$RemapName[$RemapCount] = "Strafe Right"; -$RemapCmd[$RemapCount] = "moveright"; -$RemapCount++; -$RemapName[$RemapCount] = "Turn Left"; -$RemapCmd[$RemapCount] = "turnLeft"; -$RemapCount++; -$RemapName[$RemapCount] = "Turn Right"; -$RemapCmd[$RemapCount] = "turnRight"; -$RemapCount++; -$RemapName[$RemapCount] = "Look Up"; -$RemapCmd[$RemapCount] = "panUp"; -$RemapCount++; -$RemapName[$RemapCount] = "Look Down"; -$RemapCmd[$RemapCount] = "panDown"; -$RemapCount++; -$RemapName[$RemapCount] = "Jump"; -$RemapCmd[$RemapCount] = "jump"; -$RemapCount++; -$RemapName[$RemapCount] = "Jet Pack"; -$RemapCmd[$RemapCount] = "mouseJet"; -$RemapCount++; -$RemapName[$RemapCount] = "Fire Weapon"; -$RemapCmd[$RemapCount] = "mouseFire"; -$RemapCount++; -$RemapName[$RemapCount] = "Zoom"; -$RemapCmd[$RemapCount] = "toggleZoom"; -$RemapCount++; -$RemapName[$RemapCount] = "Cycle Zoom Level"; -$RemapCmd[$RemapCount] = "setZoomFOV"; -$RemapCount++; -$RemapName[$RemapCount] = "Weapon Slot One"; -$RemapCmd[$RemapCount] = "useFirstWeaponSlot"; -$RemapCount++; -$RemapName[$RemapCount] = "Weapon Slot Two"; -$RemapCmd[$RemapCount] = "useSecondWeaponSlot"; -$RemapCount++; -$RemapName[$RemapCount] = "Weapon Slot Three"; -$RemapCmd[$RemapCount] = "useThirdWeaponSlot"; -$RemapCount++; -$RemapName[$RemapCount] = "Weapon Slot Four"; -$RemapCmd[$RemapCount] = "useFourthWeaponSlot"; -$RemapCount++; -$RemapName[$RemapCount] = "Weapon Slot Five"; -$RemapCmd[$RemapCount] = "useFifthWeaponSlot"; -$RemapCount++; -$RemapName[$RemapCount] = "Weapon Slot Six"; -$RemapCmd[$RemapCount] = "useSixthWeaponSlot"; -$RemapCount++; -$RemapName[$RemapCount] = "Blaster"; -$RemapCmd[$RemapCount] = "useBlaster"; -$RemapCount++; -$RemapName[$RemapCount] = "Plasma Rifle"; -$RemapCmd[$RemapCount] = "usePlasma"; -$RemapCount++; -$RemapName[$RemapCount] = "Chaingun"; -$RemapCmd[$RemapCount] = "useChaingun"; -$RemapCount++; -$RemapName[$RemapCount] = "Spinfusor"; -$RemapCmd[$RemapCount] = "useDisc"; -$RemapCount++; -$RemapName[$RemapCount] = "Grenade Launcher"; -$RemapCmd[$RemapCount] = "useGrenadeLauncher"; -$RemapCount++; -$RemapName[$RemapCount] = "Laser Rifle"; -$RemapCmd[$RemapCount] = "useSniperRifle"; -$RemapCount++; -$RemapName[$RemapCount] = "ELF Projector"; -$RemapCmd[$RemapCount] = "useELFGun"; -$RemapCount++; -$RemapName[$RemapCount] = "Fusion Mortar"; -$RemapCmd[$RemapCount] = "useMortar"; -$RemapCount++; -$RemapName[$RemapCount] = "Missile Launcher"; -$RemapCmd[$RemapCount] = "useMissileLauncher"; -$RemapCount++; -$RemapName[$RemapCount] = "Shocklance"; -$RemapCmd[$RemapCount] = "useShockLance"; -$RemapCount++; -$RemapName[$RemapCount] = "Targeting Laser"; -$RemapCmd[$RemapCount] = "useTargetingLaser"; -$RemapCount++; -$RemapName[$RemapCount] = "Previous Weapon"; -$RemapCmd[$RemapCount] = "prevWeapon"; -$RemapCount++; -$RemapName[$RemapCount] = "Next Weapon"; -$RemapCmd[$RemapCount] = "nextWeapon"; -$RemapCount++; -$RemapName[$RemapCount] = "Throw Grenade"; -$RemapCmd[$RemapCount] = "throwGrenade"; -$RemapCount++; -$RemapName[$RemapCount] = "Place Mine"; -$RemapCmd[$RemapCount] = "placeMine"; -$RemapCount++; -$RemapName[$RemapCount] = "Use Pack"; -$RemapCmd[$RemapCount] = "useBackpack"; -$RemapCount++; -$RemapName[$RemapCount] = "Use Health Kit"; -$RemapCmd[$RemapCount] = "useRepairKit"; -$RemapCount++; -$RemapName[$RemapCount] = "Deploy Beacon"; -$RemapCmd[$RemapCount] = "placeBeacon"; -$RemapCount++; -$RemapName[$RemapCount] = "Inventory"; -$RemapCmd[$RemapCount] = "toggleInventoryHud"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 1"; -$RemapCmd[$RemapCount] = "selectFavorite1"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 2"; -$RemapCmd[$RemapCount] = "selectFavorite2"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 3"; -$RemapCmd[$RemapCount] = "selectFavorite3"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 4"; -$RemapCmd[$RemapCount] = "selectFavorite4"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 5"; -$RemapCmd[$RemapCount] = "selectFavorite5"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 6"; -$RemapCmd[$RemapCount] = "selectFavorite6"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 7"; -$RemapCmd[$RemapCount] = "selectFavorite7"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 8"; -$RemapCmd[$RemapCount] = "selectFavorite8"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 9"; -$RemapCmd[$RemapCount] = "selectFavorite9"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 10"; -$RemapCmd[$RemapCount] = "selectFavorite10"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 11"; -$RemapCmd[$RemapCount] = "selectFavorite11"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 12"; -$RemapCmd[$RemapCount] = "selectFavorite12"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 13"; -$RemapCmd[$RemapCount] = "selectFavorite13"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 14"; -$RemapCmd[$RemapCount] = "selectFavorite14"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 15"; -$RemapCmd[$RemapCount] = "selectFavorite15"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 16"; -$RemapCmd[$RemapCount] = "selectFavorite16"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 17"; -$RemapCmd[$RemapCount] = "selectFavorite17"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 18"; -$RemapCmd[$RemapCount] = "selectFavorite18"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 19"; -$RemapCmd[$RemapCount] = "selectFavorite19"; -$RemapCount++; -$RemapName[$RemapCount] = "Favorite 20"; -$RemapCmd[$RemapCount] = "selectFavorite20"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Energy Pack"; -$RemapCmd[$RemapCount] = "quickPackEnergyPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Repair Pack"; -$RemapCmd[$RemapCount] = "quickPackRepairPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Shield Pack"; -$RemapCmd[$RemapCount] = "quickPackShieldPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Cloaking Pack"; -$RemapCmd[$RemapCount] = "quickPackCloakPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Sensor Jammer"; -$RemapCmd[$RemapCount] = "quickPackJammerPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Ammo Pack"; -$RemapCmd[$RemapCount] = "quickPackAmmoPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Satchel Charge"; -$RemapCmd[$RemapCount] = "quickPackSatchelCharge"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Inv Station"; -$RemapCmd[$RemapCount] = "quickPackDeployableStation"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Spider Turret"; -$RemapCmd[$RemapCount] = "quickPackIndoorTurret"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Landspike Turret"; -$RemapCmd[$RemapCount] = "quickPackOutdoorTurret"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Motion Sensor"; -$RemapCmd[$RemapCount] = "quickPackMotionSensor"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Deploy Pulse"; -$RemapCmd[$RemapCount] = "quickPackPulse"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Plasma Barrel"; -$RemapCmd[$RemapCount] = "quickPackPlasmaBarrel"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Missile Barrel"; -$RemapCmd[$RemapCount] = "quickPackMissileBarrel"; -$RemapCount++; -$RemapName[$RemapCount] = "Select AA Barrel"; -$RemapCmd[$RemapCount] = "quickPackAABarrel"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Mortar Barrel"; -$RemapCmd[$RemapCount] = "quickPackMortarBarrel"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Elf Barrel"; -$RemapCmd[$RemapCount] = "quickPackElfBarrel"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Grenade"; -$RemapCmd[$RemapCount] = "quickPackGrenade"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Flash Grenade"; -$RemapCmd[$RemapCount] = "quickPackFlashGrenade"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Concussion"; -$RemapCmd[$RemapCount] = "quickPackConcussionGrenade"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Camera"; -$RemapCmd[$RemapCount] = "quickPackCameraGrenade"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Flare Grenade"; -$RemapCmd[$RemapCount] = "quickPackFlareGrenade"; -$RemapCount++; -$RemapName[$RemapCount] = "Command Circuit"; -$RemapCmd[$RemapCount] = "toggleCommanderMap"; -$RemapCount++; -$RemapName[$RemapCount] = "Toggle Task List"; -$RemapCmd[$RemapCount] = "toggleTaskListDlg"; -$RemapCount++; -$RemapName[$RemapCount] = "Accept Task"; -$RemapCmd[$RemapCount] = "fnAcceptTask"; -$RemapCount++; -$RemapName[$RemapCount] = "Decline Task"; -$RemapCmd[$RemapCount] = "fnDeclineTask"; -$RemapCount++; -$RemapName[$RemapCount] = "Task Completed"; -$RemapCmd[$RemapCount] = "fnTaskCompleted"; -$RemapCount++; -$RemapName[$RemapCount] = "Reset Task List"; -$RemapCmd[$RemapCount] = "fnResetTaskList"; -$RemapCount++; -$RemapName[$RemapCount] = "Vote Yes"; -$RemapCmd[$RemapCount] = "voteYes"; -$RemapCount++; -$RemapName[$RemapCount] = "Vote No"; -$RemapCmd[$RemapCount] = "voteNo"; -$RemapCount++; -$RemapName[$RemapCount] = "Voice Chat Menu"; -$RemapCmd[$RemapCount] = "activateChatMenuHud"; -$RemapCount++; -$RemapName[$RemapCount] = "Global Chat"; -$RemapCmd[$RemapCount] = "ToggleMessageHud"; -$RemapCount++; -$RemapName[$RemapCount] = "Team Chat"; -$RemapCmd[$RemapCount] = "TeamMessageHud"; -$RemapCount++; -$RemapName[$RemapCount] = "Resize Chat Hud"; -$RemapCmd[$RemapCount] = "resizeChatHud"; -$RemapCount++; -$RemapName[$RemapCount] = "Toggle Microphone"; -$RemapCmd[$RemapCount] = "voiceCapture"; -$RemapCount++; -$RemapName[$RemapCount] = "Toggle Help Text"; -$RemapCmd[$RemapCount] = "toggleHelpGui"; -$RemapCount++; -$RemapName[$RemapCount] = "Score Screen"; -$RemapCmd[$RemapCount] = "toggleScoreScreen"; -$RemapCount++; -$RemapName[$RemapCount] = "Free Look"; -$RemapCmd[$RemapCount] = "toggleFreeLook"; -$RemapCount++; -$RemapName[$RemapCount] = "Exterior View"; -$RemapCmd[$RemapCount] = "toggleFirstPerson"; -$RemapCount++; -$RemapName[$RemapCount] = "Drop Weapon"; -$RemapCmd[$RemapCount] = "throwWeapon"; -$RemapCount++; -$RemapName[$RemapCount] = "Drop Pack"; -$RemapCmd[$RemapCount] = "throwPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Drop Flag"; -$RemapCmd[$RemapCount] = "throwFlag"; -$RemapCount++; -$RemapName[$RemapCount] = "Suicide"; -$RemapCmd[$RemapCount] = "suicide"; -$RemapCount++; -$RemapName[$RemapCount] = "Toggle Personal Wypts"; -$RemapCmd[$RemapCount] = "toggleHudWaypoints"; -$RemapCount++; -$RemapName[$RemapCount] = "Toggle Mission Wypts"; -$RemapCmd[$RemapCount] = "toggleHudMarkers"; -$RemapCount++; -$RemapName[$RemapCount] = "Toggle Beacons"; -$RemapCmd[$RemapCount] = "toggleHudTargets"; -$RemapCount++; -$RemapName[$RemapCount] = "Toggle Commands"; -$RemapCmd[$RemapCount] = "toggleHudCommands"; -$RemapCount++; -$RemapName[$RemapCount] = "Construction Tool"; -$RemapCmd[$RemapCount] = "useConstructionTool"; -$RemapCount++; - -// Construction -$RemapName[$RemapCount] = "Select Light Support Beam"; -$RemapCmd[$RemapCount] = "quickPackLightSupportBeam"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Light Walkway"; -$RemapCmd[$RemapCount] = "quickPackLightWalkway"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Light Blast Wall"; -$RemapCmd[$RemapCount] = "quickPackLightBlastWall"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Medium Support Beam"; -$RemapCmd[$RemapCount] = "quickPackMediumSupportBeam"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Medium Floor"; -$RemapCmd[$RemapCount] = "quickPackMediumFloor"; -$RemapCount++; -//$RemapName[$RemapCount] = "Select Disc Turret"; -//$RemapCmd[$RemapCount] = "quickPackDiscTurret"; -//$RemapCount++; -$RemapName[$RemapCount] = "Select Large Inventory Station"; -$RemapCmd[$RemapCount] = "quickPackLargeInventoryStation"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Generator Pack"; -$RemapCmd[$RemapCount] = "quickPackGeneratorPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Solar Panel Pack"; -$RemapCmd[$RemapCount] = "quickPackSolarPanelPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Switch Pack"; -$RemapCmd[$RemapCount] = "quickPackSwitchPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Medium Sensor Pack"; -$RemapCmd[$RemapCount] = "quickPackMediumSensorPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Large Sensor Pack"; -$RemapCmd[$RemapCount] = "quickPackLargeSensorPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Teleport Pad"; -$RemapCmd[$RemapCount] = "quickPackTeleportPad"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Deployable Turret Base"; -$RemapCmd[$RemapCount] = "quickPackDeployableTurretBase"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Energizer"; -$RemapCmd[$RemapCount] = "quickPackEnergizer"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Tree Pack"; -$RemapCmd[$RemapCount] = "quickPackTreePack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Crate Pack"; -$RemapCmd[$RemapCount] = "quickPackCratePack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Decoration Pack"; -$RemapCmd[$RemapCount] = "quickPackDecorationPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Light Pack"; -$RemapCmd[$RemapCount] = "quickPackLightPack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Tripwire Pack"; -$RemapCmd[$RemapCount] = "quickPackTripwirePack"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Logo Projector Pack"; -$RemapCmd[$RemapCount] = "quickPackLogoProjectorPack"; -$RemapCount++; -//$RemapName[$RemapCount] = "Select Laser Turret"; -//$RemapCmd[$RemapCount] = "quickPackLaserTurret"; -//$RemapCount++; -$RemapName[$RemapCount] = "Select Missile Rack Turret"; -$RemapCmd[$RemapCount] = "quickPackMissileRackTurret"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Force Field"; -$RemapCmd[$RemapCount] = "quickPackForceField"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Gravity Field"; -$RemapCmd[$RemapCount] = "quickPackGravityField"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Jump Pad"; -$RemapCmd[$RemapCount] = "quickPackJumpPad"; -$RemapCount++; -$RemapName[$RemapCount] = "Select Escape Pod"; -$RemapCmd[$RemapCount] = "quickPackEscapePod"; -$RemapCount++; -$RemapName[$RemapCount] = "Pack Setting: Fwd"; -$RemapCmd[$RemapCount] = "cyclePackFwd"; -$RemapCount++; -$RemapName[$RemapCount] = "Pack Setting: Back"; -$RemapCmd[$RemapCount] = "cyclePackBack"; -$RemapCount++; -$RemapName[$RemapCount] = "Pack Setting: FFwd"; -$RemapCmd[$RemapCount] = "cyclePackFFwd"; -$RemapCount++; -$RemapName[$RemapCount] = "Pack Setting: FBack"; -$RemapCmd[$RemapCount] = "cyclePackFBack"; -$RemapCount++; -$RemapName[$RemapCount] = "Emote: Sit Down"; -$RemapCmd[$RemapCount] = "emoteSitDown"; -$RemapCount++; -$RemapName[$RemapCount] = "Emote: Squat"; -$RemapCmd[$RemapCount] = "emoteSquat"; -$RemapCount++; -$RemapName[$RemapCount] = "Emote: Jig"; -$RemapCmd[$RemapCount] = "emoteJig"; -$RemapCount++; -$RemapName[$RemapCount] = "Emote: Lie Down"; -$RemapCmd[$RemapCount] = "emoteLieDown"; -$RemapCount++; -$RemapName[$RemapCount] = "Emote: Heart Attack"; -$RemapCmd[$RemapCount] = "emoteHeartAttack"; -$RemapCount++; -$RemapName[$RemapCount] = "Emote: Sucker Punched"; -$RemapCmd[$RemapCount] = "emoteSuckerPunched"; -$RemapCount++; -$RemapName[$RemapCount] = "Toggle Flash Light"; -$RemapCmd[$RemapCount] = "toggleNightVision"; -$RemapCount++; -$RemapName[$RemapCount] = "Slow Motion"; -$RemapCmd[$RemapCount] = "SlowMotion"; -$RemapCount++; -$RemapName[$RemapCount] = "Restrain target"; -$RemapCmd[$RemapCount] = "doGrab"; -$RemapCount++; -$quickPackExtrasBind = true; -// End Construction - -if ( !isDemo() ) -{ - $RemapName[$RemapCount] = "Start Demo Record"; - $RemapCmd[$RemapCount] = "startRecordingDemo"; - $RemapCount++; - $RemapName[$RemapCount] = "Stop Demo Record"; - $RemapCmd[$RemapCount] = "stopRecordingDemo"; - $RemapCount++; -} -$RemapName[$RemapCount] = "Chat Page Up"; -$RemapCmd[$RemapCount] = "pageMessageHudUp"; -$RemapCount++; -$RemapName[$RemapCount] = "Chat Page Down"; -$RemapCmd[$RemapCount] = "pageMessageHudDown"; -$RemapCount++; -$RemapName[$RemapCount] = "Toggle Net Meter"; -$RemapCmd[$RemapCount] = "toggleNetDisplayHud"; -$RemapCount++; - -$ObsRemapCount = 0; -$ObsRemapName[$ObsRemapCount] = "Move Up"; -$ObsRemapCmd[$ObsRemapCount] = "moveup"; -$ObsRemapCount++; -$ObsRemapName[$ObsRemapCount] = "Move Down"; -$ObsRemapCmd[$ObsRemapCount] = "movedown"; -$ObsRemapCount++; -$ObsRemapName[$ObsRemapCount] = "Toggle Observer Mode"; -$ObsRemapCmd[$ObsRemapCount] = "jump"; -$ObsRemapCount++; -$ObsRemapName[$ObsRemapCount] = "Spawn/Previous"; -$ObsRemapCmd[$ObsRemapCount] = "mouseFire"; -$ObsRemapCount++; -$ObsRemapName[$ObsRemapCount] = "Cycle Camera/Next"; -$ObsRemapCmd[$ObsRemapCount] = "mouseJet"; -$ObsRemapCount++; - -//------------------------------------------------------------------------------ -function restoreDefaultMappings() -{ - moveMap.delete(); - exec( "scripts/controlDefaults.cs" ); - $pref::Input::ActiveConfig = "MyConfig"; - OP_RemapList.fillList(); -} - -//------------------------------------------------------------------------------ -function isMapFile( %file ) -{ - %fObject = new FileObject(); - if ( !%fObject.openForRead( %file ) ) - return( false ); - - while ( !%fObject.isEOF() ) - { - %line = %fObject.readLine(); - if ( %line $= "// Tribes 2 Input Map File" ) - { - %fObject.close(); - return( true ); - } - } - - %fObject.close(); - return( false ); -} - -//------------------------------------------------------------------------------ -function isValidMapFileSaveName( %file ) -{ - if (isDemo()) - %basePath = "demo_base/"; - else - %basePath = "base/"; - if ( !isWriteableFileName( %basePath @ %file ) ) - return( false ); - - if ( isFile( %file ) ) - return( isMapFile( %file ) ); - - return( true ); -} - -//------------------------------------------------------------------------------ -function loadMapFile( %filename ) -{ - exec( "prefs/" @ %filename @ ".cs" ); - $pref::Input::ActiveConfig = %filename; - OP_RemapList.fillList(); -} - -//------------------------------------------------------------------------------ -function saveActiveMapFile() -{ - if ( isValidMapFileSaveName( "prefs/" @ $pref::Input::ActiveConfig @ ".cs" ) ) - saveMapFile( $pref::Input::ActiveConfig ); - else - ShellGetSaveFilename( "SAVE CONTROL CONFIG", "prefs/*.cs", "isMapFile", "saveMapFile", "" ); -} - -//------------------------------------------------------------------------------ -function saveMapFile( %filename ) -{ - if ( strcspn( %filename, "\\/?*\"\'<>|" ) < strlen( %filename ) ) - { - MessageBoxOK( "SAVE FAILED", "Filenames may not contain any of the following characters:" NL "\\ / ? * < > \" \' |", - "ShellGetSaveFilename( \"SAVE CONTROL CONFIG\", \"prefs/*.cs\", \"isMapFile\", \"saveMapFile\", $pref::Input::ActiveConfig );" ); - return; - } - - if (isDemo()) - %basePath = "demo_base/"; - else - %basePath = "base/"; - %mapFile = "prefs/" @ %filename @ ".cs"; - if ( !isWriteableFileName( %basePath @ %mapFile ) ) - { - MessageBoxOK( "SAVE FAILED", "That is not a writeable file name. Please choose another file name.", - "ShellGetSaveFilename( \"SAVE CONTROL CONFIG\", \"prefs/*.cs\", \"isMapFile\", \"saveMapFile\", $pref::Input::ActiveConfig );" ); - return; - } - - if ( isFile( %mapFile ) && !isMapFile( %mapFile ) ) - { - MessageBoxOK( "SAVE FAILED", "A file of that name already exists and is not an input configuration file. Please choose another file name.", - "ShellGetSaveFilename( \"SAVE CONTROL CONFIG\", \"prefs/*.cs\", \"isMapFile\", \"saveMapFile\", $pref::Input::ActiveConfig );" ); - return; - } - - moveMap.save( %mapFile ); - // Append the observer action map: - observerMap.save( %mapFile, true ); - - // Write out the console toggle key: - %fObject = new FileObject(); - if ( %fObject.openForAppend( %mapFile ) ) - { - %bind = GlobalActionMap.getBinding( "toggleConsole" ); - if ( %bind !$= "" ) - { - %fObject.writeLine( "GlobalActionMap.bind(keyboard, \"" @ getField( %bind, 1 ) @ "\", toggleConsole);" ); - %fObject.close(); - } - } - %fObject.delete(); - - $pref::Input::ActiveConfig = %filename; -} - -//------------------------------------------------------------------------------ -function getMapDisplayName( %device, %action ) -{ - if ( %device $= "keyboard" ) - return( %action ); - else if ( strstr( %device, "mouse" ) != -1 ) - { - // Substitute "mouse" for "button" in the action string: - %pos = strstr( %action, "button" ); - if ( %pos != -1 ) - { - %mods = getSubStr( %action, 0, %pos ); - %object = getSubStr( %action, %pos, 1000 ); - %instance = getSubStr( %object, strlen( "button" ), 1000 ); - return( %mods @ "mouse" @ ( %instance + 1 ) ); - } - else - error( "Mouse input object other than button passed to getDisplayMapName!" ); - } - else if ( strstr( %device, "joystick" ) != -1 ) - { - // Substitute "joystick" for "button" in the action string: - %pos = strstr( %action, "button" ); - if ( %pos != -1 ) - { - %mods = getSubStr( %action, 0, %pos ); - %object = getSubStr( %action, %pos, 1000 ); - %instance = getSubStr( %object, strlen( "button" ), 1000 ); - return( %mods @ "joystick" @ ( %instance + 1 ) ); - } - else - { - %pos = strstr( %action, "pov" ); - if ( %pos != -1 ) - { - %wordCount = getWordCount( %action ); - %mods = %wordCount > 1 ? getWords( %action, 0, %wordCount - 2 ) @ " " : ""; - %object = getWord( %action, %wordCount - 1 ); - switch$ ( %object ) - { - case "upov": %object = "POV1 up"; - case "dpov": %object = "POV1 down"; - case "lpov": %object = "POV1 left"; - case "rpov": %object = "POV1 right"; - case "upov2": %object = "POV2 up"; - case "dpov2": %object = "POV2 down"; - case "lpov2": %object = "POV2 left"; - case "rpov2": %object = "POV2 right"; - default: %object = "??"; - } - return( %mods @ %object ); - } - else - error( "Unsupported Joystick input object passed to getDisplayMapName!" ); - } - } - - return( "??" ); -} - -//------------------------------------------------------------------------------ -function buildFullMapString( %index ) -{ - switch$ ( OP_ControlsPane.group ) - { - case "Observer": - %actionMap = observerMap; - %name = $ObsRemapName[%index]; - %cmd = $ObsRemapCmd[%index]; - - default: - %actionMap = moveMap; - %name = $RemapName[%index]; - %cmd = $RemapCmd[%index]; - } - - %temp = %actionMap.getBinding( %cmd ); - %device = getField( %temp, 0 ); - %object = getField( %temp, 1 ); - if ( %device !$= "" && %object !$= "" ) - %mapString = getMapDisplayName( %device, %object ); - else - %mapString = ""; - - return( %name TAB %mapString ); -} - -//------------------------------------------------------------------------------ -function OP_ControlGroupMenu::init( %this ) -{ - %selId = %this.getSelected(); - %this.clear(); - %this.add( "Main", 0 ); - %this.add( "Observer", 1 ); - %this.setSelected( %selId ); - %this.onSelect( %selId, %this.getTextById( %selId ) ); -} - -//------------------------------------------------------------------------------ -function OP_ControlGroupMenu::onSelect( %this, %id, %text ) -{ - OP_ControlsPane.group = %text; - OP_RemapList.fillList(); -} - -//------------------------------------------------------------------------------ -function OP_RemapList::fillList( %this ) -{ - switch$ ( OP_ControlsPane.group ) - { - case "Observer": %count = $ObsRemapCount; - default: %count = $RemapCount; - } - - %this.clear(); - for ( %i = 0; %i < %count; %i++ ) - %this.addRow( %i, buildFullMapString( %i ) ); - - // Set the console key: - %bind = GlobalActionMap.getBinding( "toggleConsole" ); - OP_ConsoleKeyBtn.setValue( getField( %bind, 1 ) ); -} - -//------------------------------------------------------------------------------ -function OP_RemapList::onDeleteKey( %this, %rowId ) -{ - switch$ ( OP_ControlsPane.group ) - { - case "Observer": - %actionMap = observerMap; - %cmd = $ObsRemapCmd[%rowId]; - default: - %actionMap = moveMap; - %cmd = $RemapCmd[%rowId]; - } - clearMapping( %actionMap, %cmd ); - %this.setRowById( %rowId, buildFullMapString( %rowId ) ); -} - -//------------------------------------------------------------------------------ -function OP_RemapList::doRemap( %this ) -{ - %selId = %this.getSelectedId(); - switch$ ( OP_ControlsPane.group ) - { - case "Observer": %name = $ObsRemapName[%selId]; - default: %name = $RemapName[%selId]; - } - - RemapFrame.setTitle( "REMAP \"" @ %name @ "\"" ); - RemapInputCtrl.mode = "move"; - RemapInputCtrl.index = %selId; - Canvas.pushDialog( RemapDlg ); -} - -//------------------------------------------------------------------------------ -function OP_ConsoleKeyBtn::doRemap( %this ) -{ - RemapFrame.setTitle( "REMAP \"Toggle Console\"" ); - RemapInputCtrl.mode = "consoleKey"; - RemapInputCtrl.index = 0; - Canvas.pushDialog( RemapDlg ); -} - -//------------------------------------------------------------------------------ -function RemapDlg::onWake( %this ) -{ - $enableDirectInput = "1"; - activateDirectInput(); - - if ( RemapInputCtrl.mode $= "consoleKey" ) - RemapText.setText( "Press a key to assign it to this action" NL "or Esc to cancel..." ); - else - RemapText.setText( "Press a key or button to assign it to this action" NL "or Esc to cancel..." ); -} - -//------------------------------------------------------------------------------ -function RemapDlg::onSleep( %this ) -{ - $enableDirectInput = "1"; - deactivateDirectInput(); -} - -//------------------------------------------------------------------------------ -function findRemapCmdIndex( %command ) -{ - switch$ ( OP_ControlsPane.group ) - { - case "Observer": - for ( %i = 0; %i < $ObsRemapCount; %i++ ) - { - if ( %command $= $ObsRemapCmd[%i] ) - return( %i ); - } - default: - for ( %i = 0; %i < $RemapCount; %i++ ) - { - if ( %command $= $RemapCmd[%i] ) - return( %i ); - } - } - - return( -1 ); -} - -//------------------------------------------------------------------------------ -function clearMapping( %actionMap, %cmd ) -{ - %fullMapString = %actionMap.getBinding( %cmd ); - %mapCount = getRecordCount( %fullMapString ); - for ( %i = 0; %i < %mapCount; %i++ ) - { - %temp = getRecord( %fullMapString, %i ); - %actionMap.unbind( getField( %temp, 0 ), getField( %temp, 1 ) ); - } -} - -//------------------------------------------------------------------------------ -function redoMapping( %actionMap, %device, %action, %cmd, %oldIndex, %newIndex ) -{ - //%actionMap.bind( %device, %action, $RemapCmd[%newIndex] ); - %actionMap.bind( %device, %action, %cmd ); - OP_RemapList.setRowById( %oldIndex, buildFullMapString( %oldIndex ) ); - OP_RemapList.setRowById( %newIndex, buildFullMapString( %newIndex ) ); -} - -//------------------------------------------------------------------------------ -function redoConsoleMapping( %action, %oldIndex ) -{ - moveMap.unbind( "keyboard", %action ); - GlobalActionMap.bind( "keyboard", %action, "toggleConsole" ); - OP_ConsoleKeyBtn.setValue( %action ); - OP_RemapList.setRowById( %oldIndex, buildFullMapString( %oldIndex ) ); -} - -//------------------------------------------------------------------------------ -function RemapInputCtrl::onInputEvent( %this, %device, %action ) -{ - //error( "** onInputEvent called - device = " @ %device @ ", action = " @ %action @ " **" ); - Canvas.popDialog( RemapDlg ); - - // Test for the reserved keystrokes: - if ( %device $= "keyboard" ) - { - // Cancel... - if ( %action $= "escape" ) - { - // Do nothing... - return; - } - } - - if ( %this.mode $= "consoleKey" ) - { - if ( %device !$= "keyboard" ) - { - MessageBoxOK( "REMAP FAILED", "This command can only be bound to keys on the keyboard!" ); - return; - } - - %prevMap = GlobalActionMap.getCommand( %device, %action ); - if ( %prevMap !$= "" ) - { - MessageBoxOK( "REMAP FAILED", "\"" @ getMapDisplayName( %device, %action ) @ "\" is already bound to a non-remappable command!" ); - return; - } - - %mvMap = moveMap.getCommand( %device, %action ); - if ( %mvMap $= "" ) - { - GlobalActionMap.bind( %device, %action, "toggleConsole" ); - OP_ConsoleKeyBtn.setValue( %action ); - } - else - { - %mapName = getMapDisplayName( %device, %action ); - %mvMapIndex = findRemapCmdIndex( %mvMap ); - if ( %mvMapIndex == -1 ) - MessageBoxOK( "REMAP FAILED", "\"" @ %mapName @ "\" is already bound to a non-remappable command!" ); - else - MessageBoxYesNo( "WARNING", "\"" @ %mapName @ "\" is already bound to \"" - @ $RemapName[%mvMapIndex] @ "\"!" - NL "Do you want to undo this mapping?", - "redoConsoleMapping(\"" @ %action @ "\", " @ %mvMapIndex @ ");", "" ); - return; - } - } - else - { - switch$ ( OP_ControlsPane.group ) - { - case "Observer": - %actionMap = observerMap; - %cmd = $ObsRemapCmd[%this.index]; - %name = $ObsRemapName[%this.index]; - - default: - %actionMap = moveMap; - %cmd = $RemapCmd[%this.index]; - %name = $RemapName[%this.index]; - } - - // First check to see if the given action is already mapped: - %prevMap = %actionMap.getCommand( %device, %action ); - if ( %prevMap !$= %cmd ) - { - if ( %prevMap $= "" ) - { - %actionMap.bind( %device, %action, %cmd ); - OP_RemapList.setRowById( %this.index, buildFullMapString( %this.index ) ); - } - else - { - %mapName = getMapDisplayName( %device, %action ); - %prevMapIndex = findRemapCmdIndex( %prevMap ); - if ( %prevMapIndex == -1 ) - MessageBoxOK( "REMAP FAILED", "\"" @ %mapName @ "\" is already bound to a non-remappable command!" ); - else - { - switch$ ( OP_ControlsPane.group ) - { - case "Observer": - %prevCmdName = $ObsRemapName[%prevMapIndex]; - default: - %prevCmdName = $RemapName[%prevMapIndex]; - } - - MessageBoxYesNo( "WARNING", - "\"" @ %mapName @ "\" is already bound to \"" - @ %prevCmdName @ "\"!\nDo you want to undo this mapping?", - "redoMapping(" @ %actionMap @ ", " @ %device @ ", \"" @ %action @ "\", \"" @ %cmd @ "\", " @ %prevMapIndex @ ", " @ %this.index @ ");", "" ); - } - return; - } - } - } -} - -//------------------------------------------------------------------------------ -function OP_JoystickTgl::onAction( %this ) -{ - %on = %this.getValue(); - if ( %on ) - enableJoystick(); - else - disableJoystick(); - - OP_ConfigureJoystickBtn.setActive( %on ); -} - -//------------------------------------------------------------------------------ -function MouseConfigDlg::onWake( %this ) -{ - MouseXSlider.setValue( moveMap.getScale( mouse, xaxis ) / 2 ); - MouseYSlider.setValue( moveMap.getScale( mouse, yaxis ) / 2 ); - InvertMouseTgl.setValue( moveMap.isInverted( mouse, yaxis ) ); - - MouseZActionMenu.clear(); - MouseZActionMenu.add( "Nothing", 1 ); - MouseZActionMenu.add( "Cycle Weapon", 2 ); - MouseZActionMenu.add( "Next Weapon Only", 3 ); -// MouseZActionMenu.add( "Cycle Zoom Level", 4 ); - - %bind = moveMap.getCommand( "mouse", "zaxis" ); - %selId = 1; - switch$ ( %bind ) - { - case "cycleWeaponAxis": - %selId = 2; - case "cycleNextWeaponOnly": - %selId = 3; - } - MouseZActionMenu.setSelected( %selId ); -} - -//------------------------------------------------------------------------------ -function MouseConfigDlg::onOK( %this ) -{ - %xSens = MouseXSlider.getValue() * 2; - %ySens = MouseYSlider.getValue() * 2; - moveMap.bind( mouse, xaxis, "S", %xSens, "yaw" ); - %yFlags = InvertMouseTgl.getValue() ? "SI" : "S"; - moveMap.bind( mouse, yaxis, %yFlags, %ySens, "pitch" ); - - switch ( MouseZActionMenu.getSelected() ) - { - case 2: - moveMap.bind( mouse, zaxis, cycleWeaponAxis ); - case 3: - moveMap.bind( mouse, zaxis, cycleNextWeaponOnly ); - default: - moveMap.unbind( mouse, zaxis ); - } - - Canvas.popDialog( MouseConfigDlg ); -} - -//------------------------------------------------------------------------------ -function MouseXSlider::sync( %this ) -{ - %thisValue = %this.getValue(); - MouseXText.setValue( "(" @ getSubStr( %thisValue, 0, 4 ) @ ")" ); - if ( $pref::Input::LinkMouseSensitivity ) - { - if ( MouseYSlider.getValue() != %thisValue ) - MouseYSlider.setValue( %thisValue ); - } -} - -//------------------------------------------------------------------------------ -function MouseYSlider::sync( %this ) -{ - %thisValue = %this.getValue(); - MouseYText.setValue( "(" @ getSubStr( %thisValue, 0, 4 ) @ ")" ); - if ( $pref::Input::LinkMouseSensitivity ) - { - if ( MouseXSlider.getValue() != %thisValue ) - MouseXSlider.setValue( %thisValue ); - } -} - -//------------------------------------------------------------------------------ -// Joystick Config dialog: -//------------------------------------------------------------------------------ -$JoyRemapCount = 0; -$JoyRemapName[$JoyRemapCount] = "Look Up/Down"; -$JoyRemapCmd[$JoyRemapCount] = "joyPitch"; -$JoyRemapCount++; -$JoyRemapName[$JoyRemapCount] = "Turn Left/Right"; -$JoyRemapCmd[$JoyRemapCount] = "joyYaw"; -$JoyRemapCount++; -$JoyRemapName[$JoyRemapCount] = "Move Forward/Backward"; -$JoyRemapCmd[$JoyRemapCount] = "joystickMoveY"; -$JoyRemapCount++; -$JoyRemapName[$JoyRemapCount] = "Strafe Left/Right"; -$JoyRemapCmd[$JoyRemapCount] = "joystickMoveX"; -$JoyRemapCount++; -$JoyRemapName[$JoyRemapCount] = "Cycle Weapon"; -$JoyRemapCmd[$JoyRemapCount] = "cycleWeaponAxis"; -$JoyRemapCount++; - -//------------------------------------------------------------------------------ -function JoystickConfigDlg::onWake( %this ) -{ - // Add all of the axis tabs: - %temp = getJoystickAxes( 0 ); - %tryCount = getField( %temp, 0 ); - $JoyAxisCount = 0; - - for ( %i = 0; %i < %tryCount; %i++ ) - { - %type = getField( %temp, %i + 1 ); - switch$ ( %type ) - { - case "X": %tabName = "X Axis"; %tabType = "xaxis"; - case "Y": %tabName = "Y Axis"; %tabType = "yaxis"; - case "Z": %tabName = "Z Axis"; %tabType = "zaxis"; - case "R": %tabName = "R Axis"; %tabType = "rxaxis"; - case "U": %tabName = "U Axis"; %tabType = "ryaxis"; - case "V": %tabName = "V Axis"; %tabType = "rzaxis"; - case "S": %tabName = "Slider"; %tabType = "slider"; - case "L": %tabName = "Slider 2"; %tabType = "slider2"; - default: %tabName = ""; - } - - if ( %tabName !$= "" ) - { - $JoyAxisTab[$JoyAxisCount] = new ShellTabButton() { - profile = "ShellTabProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "29" SPC ( 52 + ( %i * 30 ) ); - extent = "100 38"; - minExtent = "48 38"; - visible = "1"; - command = "JoystickConfigDlg.setPane(" @ %i @ ");"; - helpTag = "0"; - text = %tabName; - type = %tabType; - }; - - $JoyAxisCount++; - JoystickConfigFrame.add( $JoyAxisTab[%i] ); - } - } - - // Fill the action menu: - JoyAxisActionMenu.clear(); - for ( %i = 0; %i < $JoyRemapCount; %i++ ) - JoyAxisActionMenu.add( $JoyRemapName[%i], %i ); - JoyAxisActionMenu.add( "Nothing", 255 ); - - // Select the first axis: - %this.setPane( %this.pane ); -} - -//------------------------------------------------------------------------------ -function JoystickConfigDlg::onSleep( %this ) -{ - // Save the current pane's settings: - bindJoystickAxis( %this.pane, JoyAxisActionMenu.getSelected() ); - for ( %i = 0; %i < $JoyAxisCount; %i++ ) - { - JoystickConfigFrame.remove( $JoyAxisTab[%i] ); - $JoyAxisTab[%i].delete(); - } -} - -//------------------------------------------------------------------------------ -function JoystickConfigDlg::setPane( %this, %pane ) -{ - if ( %this.pane != %pane ) - { - // Save the previous axes' settings: - bindJoystickAxis( %this.pane, JoyAxisActionMenu.getSelected() ); - %this.pane = %pane; - } - - for ( %i = 0; %i < $joyAxisCount; %i++ ) - $JoyAxisTab[%i].setValue( %i == %pane ); - - // Update the config controls: - %axisType = $JoyAxisTab[%pane].type; - %bind = moveMap.getCommand( "joystick", %axisType ); - if ( %bind !$= "" ) - { - for ( %i = 0; %i < $JoyRemapCount; %i++ ) - { - if ( $JoyRemapCmd[%i] $= %bind ) - { - JoyAxisActionMenu.setSelected( %i ); - JoyAxisActionMenu.setText( $JoyRemapName[%i] ); - JoyAxisActionMenu.onSelect( %i, "" ); - break; - } - } - - if ( %i == $JoyRemapCount ) - { - JoyAxisActionMenu.setSelected( 255 ); // 255 is the code for "Nothing" - JoyAxisActionMenu.onSelect( 255, "" ); - } - - %scale = moveMap.getScale( "joystick", %axisType ); - JoyAxisSlider.setValue( %scale / 100 ); - %deadZone = moveMap.getDeadZone( "joystick", %axisType ); - if ( %deadZone $= "0 0" ) - DeadZoneSlider.setValue( 0.0 ); - else - DeadZoneSlider.setValue( abs( firstWord( %deadZone ) ) / %scale ); - InvertJoyAxisTgl.setValue( moveMap.isInverted( "joystick", %axisType ) ); - //JoyAxisRelativeTgl.setValue( moveMap.isRelativeAxis( "joystick", %axisType ) ); - } - else - { - JoyAxisActionMenu.setSelected( 255 ); // 255 is the code for "Nothing" - JoyAxisActionMenu.onSelect( 255, "" ); - JoyAxisSlider.setValue( 0.5 ); - DeadZoneSlider.setValue( 0.0 ); - InvertJoyAxisTgl.setValue( false ); - //JoyAxisRelativeTgl.setValue( %axisType $= "slider" ); - } -} - -//------------------------------------------------------------------------------ -function JoyAxisActionMenu::onSelect( %this, %id, %text ) -{ - %on = ( %id < $JoyRemapCount ); - JoyAxisSlider.setActive( %on ); - JoySensText.setVisible( %on ); - DeadZoneSlider.setActive( %on ); - DeadZoneText.setVisible( %on ); - InvertJoyAxisTgl.setActive( %on ); - //JoyAxisRelativeTgl.setActive( %on ); -} - -//------------------------------------------------------------------------------ -function JoySensText::update( %this ) -{ - %this.setValue( "(" @ getSubStr( JoyAxisSlider.getValue(), 0, 4 ) @ ")" ); -} - -//------------------------------------------------------------------------------ -function DeadZoneText::update( %this ) -{ - %val = DeadZoneSlider.getValue(); - %percent = %val * 100; - %temp = strstr( %percent, "." ); - if ( %temp != -1 ) - %percent = getSubStr( %percent, 0, %temp ); - - %this.setValue( "(" @ %percent @ "%)" ); -} - -//------------------------------------------------------------------------------ -function bindJoystickAxis( %axisIndex, %cmdIndex ) -{ - %cmd = $JoyRemapCmd[%cmdIndex]; - %axis = $JoyAxisTab[%axisIndex].type; - if ( %cmdIndex > $JoyRemapCount ) - { - // Make sure the axis is unbound: - moveMap.unbind( "joystick", %axis ); - return; - } - - %sens = JoyAxisSlider.getValue() * 100; - %delta = DeadZoneSlider.getValue() * %sens; - %flags = "S"; - if ( InvertJoyAxisTgl.getValue() ) - %flags = %flags @ "I"; -// if ( JoyAxisRelativeTgl.getValue() ) -// %flags = %flags @ "L"; - if ( %delta > 0 ) - { - %deadZone = "-" @ %delta SPC %delta; - moveMap.bind( "joystick", %axis, %flags @ "D", %deadZone, %sens, %cmd ); - } - else - moveMap.bind( "joystick", %axis, %flags, %sens, %cmd ); -} - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -// Network Settings: -// - -function updateNetworkSettings() -{ - $pref::Net::PacketRateToClient = mFloor( OP_PacketRateSlider.getValue() ); - $pref::Net::PacketSize = mFloor( OP_PacketSizeSlider.getValue() ); - $pref::Net::PacketRateToServer = mFloor( OP_UpdateRateSlider.getValue() ); - - // check the max rate: - if ( isObject( ServerConnection ) ) - ServerConnection.checkMaxRate(); - if ( isObject( ClientGroup ) ) - { - %count = ClientGroup.getCount(); - for ( %i = 0; %i < %count; %i++ ) - { - %cl = ClientGroup.getObject( %i ); - %cl.checkMaxRate(); - } - } -} - -function OP_NetworkDisplayHud::init(%this) -{ - %this.getPrefs(); - - %this.textHeight = 14; - %this.textOffset = 2; - - if(!%this.infoCallback) - { - %this.textProfile = 0; - return; - } - - // profile for the text fields - %this.textProfile = new GuiControlProfile() - { - fontType = $ShellButtonFont; - fontSize = $ShellButtonFontSize; - autoSizeWidth = true; - autoSizeHeight = true; - fontColors[6] = "128 128 128"; - }; - - %yOffset = %this.textOffset; - - for(%i = 0; %i < 6; %i++) - { - // set the text color - %this.textProfile.fontColors[%i] = %this.fieldColors[%i]; - - // create the text field - %this.textField[%i] = new GuiTextCtrl() - { - profile = %this.textProfile; - horizSizing = "right"; - vertSizing = "bottom"; - position = "20 " @ %yOffset; - extent = "190 " @ %this.textHeight; - visible = "1"; - }; - - // create the toggle field - %this.toggleField[%i] = new GuiTextCtrl() - { - profile = ShellActiveTextProfile; - horizSizing = "right"; - vertSizing = "bottom"; - position = "5 " @ %yOffset; - extent = "15 " @ %this.textHeight; - visible = "1"; - }; - - // create a mouse object - %this.mouseField[%i] = new GuiMouseEventCtrl(NetworkDisplayMouseCtrl) - { - profile = GuiDefaultProfile; - horizSizing = "right"; - vertSizing = "bottom"; - position = "10 " @ %yOffset; - extent = "200 " @ %this.textHeight; - visible = "1"; - fieldIndex = %i; - }; - - OP_NetworkDisplayTextFrame.add(%this.textField[%i]); - OP_NetworkDisplayTextFrame.add(%this.toggleField[%i]); - OP_NetworkDisplayTextFrame.add(%this.mouseField[%i]); - - %yOffset += (%this.textHeight + %this.textOffset); - } - %this.infoUpdate(0, 0, 0, 0, 0, 0); -} - -function NetworkDisplayMouseCtrl::onMouseDown(%this) -{ - %b = OP_NetworkDisplayHud.renderField[%this.fieldIndex]; - OP_NetworkDisplayHud.renderField[%this.fieldIndex] = !%b; - OP_NetworkDisplayHud.updateToggles(); -} - -function OP_NetworkDisplayHud::uninit(%this) -{ - if(!%this.infoCallback) - return; - - if(isObject(%this.textProfile)) - %this.textProfile.delete(); - - for(%i = 0; %i < 6; %i++) - { - if(isObject(%this.textField[%i])) - %this.textField[%i].delete(); - - if(isObject(%this.toggleField[%i])) - %this.toggleField[%i].delete(); - - if(isObject(%this.mouseField[%i])) - %this.mouseField[%i].delete(); - } -} - -function OP_NetworkDisplayHud::updateToggles(%this) -{ - // update the toggles - $pref::Net::graphFields = 0; - - for(%i = 0; %i < 6; %i++) - { - $pref::Net::graphFields |= %this.renderField[%i] << %i; - %this.toggleField[%i].setText(%this.renderField[%i] ? "+" : "-"); - } -} - -function OP_NetworkDisplayHud::infoUpdate(%this, %ping, %packetLoss, %sendPackets, %sendBytes, %receivePackets, %receiveBytes) -{ - %this.updateToggles(); - - // set the text - %this.textField[0].setText("\c0Ping: " @ mFormatFloat(%ping, "%4.0f") @ "ms"); - %this.textField[1].setText("\c1Packet Loss: " @ mFormatFloat(%packetLoss, "%3.0f") @ "%"); - %this.textField[2].setText("\c2Send Packets: " @ mFormatFloat(%sendPackets, "%2.1f") @ "pps"); - %this.textField[3].setText("\c3Send Bytes: " @ mFormatFloat(%sendBytes, "%5.0f") @ "bps"); - %this.textField[4].setText("\c4Receive Packets: " @ mFormatFloat(%receivePackets, "%2.1f") @ "pps"); - %this.textField[5].setText("\c5Receive Bytes: " @ mFormatFloat(%receiveBytes, "%5.0f") @ "bps"); -} - -// "" -// [1,32] [8,32] [100,450] -$NetworkPresetCount = 0; -$NetworkPreset[$NetworkPresetCount] = "28.8 Modem\t12\t16\t200"; $NetworkPresetCount++; -$NetworkPreset[$NetworkPresetCount] = "56K Modem\t16\t20\t240"; $NetworkPresetCount++; -$NetworkPreset[$NetworkPresetCount] = "DSL\t20\t24\t350"; $NetworkPresetCount++; -$NetworkPreset[$NetworkPresetCount] = "Cable\t24\t24\t400"; $NetworkPresetCount++; -$NetworkPreset[$NetworkPresetCount] = "T1/LAN\t32\t32\t450"; $NetworkPresetCount++; - -function OP_NetworkPresetsMenu::init( %this ) -{ - %this.clear(); - for(%i = 0; %i < $NetworkPresetCount; %i++) - %this.add( getField($NetworkPreset[%i], 0), %i); - - // don't update settings on init (only update when values change) - %this.updateSettings = false; - %this.setSelected($pref::Net::Preset); - %this.updateSettings = true; -} - -function OP_NetworkPresetsMenu::onSelect( %this, %id, %text ) -{ - OP_PacketRateSlider.setValue( getField($NetworkPreset[%id], 1) ); - OP_UpdateRateSlider.setValue( getField($NetworkPreset[%id], 2) ); - OP_PacketSizeSlider.setValue( getField($NetworkPreset[%id], 3) ); - - if(%this.updateSettings) - updateNetworkSettings(); - $pref::Net::Preset = %id; -} - -//------------------------------------------------------------------------------ -function OP_MasterServerMenu::init( %this ) -{ - %this.clear(); - // You can change these strings, but NOT THE IDS! - %this.add( "Always", 1 ); - %this.add( "When Not Full", 2 ); - %this.add( "Never", 3 ); -} - -//------------------------------------------------------------------------------ -function OP_MasterServerMenu::onSelect( %this, %id, %text ) -{ - switch( %id ) - { - case 2: - $pref::Net::DisplayOnMaster = "NotFull"; - case 3: - $pref::Net::DisplayOnMaster = "Never"; - default: - $pref::Net::DisplayOnMaster = "Always"; - } -} - -//------------------------------------------------------------------------------ -function OP_RegionMenu::init( %this ) -{ - %this.clear(); - %this.add( "North America East", 1 ); - %this.add( "North America West", 2 ); - %this.add( "South America", 4 ); - %this.add( "Australia", 8 ); - %this.add( "Asia", 16 ); - %this.add( "Europe", 32 ); -} - -//------------------------------------------------------------------------------ -function OP_RegionMenu::onSelect( %this, %id, %text ) -{ - $pref::Net::RegionMask = %id; -} - -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -// Game Settings: -// -function OP_LaunchScreenMenu::init( %this ) -{ - %this.clear(); - %this.add( "Game", 1 ); - %this.add( "Email", 4 ); - %this.add( "Chat", 5 ); - %this.add( "Browser", 6 ); -} - -//------------------------------------------------------------------------------ -function toggleInvertYAxis() -{ - // Catch the case where this is toggled in-game while in a vehicle: - if ( isObject( passengerKeys ) ) - { - %bind = passengerKeys.getBinding( pitch ); - if ( %bind !$= "" ) - { - %device = getField( %bind, 0 ); - %action = getField( %bind, 1 ); - %flags = $pref::Vehicle::InvertYAxis ? "SDI" : "SD"; - %deadZone = passengerKeys.getDeadZone( %device, %action ); - %scale = passengerKeys.getScale( %device, %action ); - passengerKeys.bind( %device, %action, %flags, %deadZone, %scale, pitch ); - } - } -} - -//------------------------------------------------------------------------------ -function toggleImmersion() -{ - MessageBoxOK( "Force Feedback", "This will take effect the next time you start Tribes 2." ); -} - -//------------------------------------------------------------------------------ -function toggleVehicleTeleportPref() -{ - // If we are in a game, let the server know we've changed; - if ( isObject( ServerConnection ) ) - commandToServer( 'EnableVehicleTeleport', $pref::Vehicle::pilotTeleport ); -} diff --git a/Scripts/TR2medium_male.cs b/Scripts/TR2medium_male.cs deleted file mode 100644 index 7b18da4..0000000 --- a/Scripts/TR2medium_male.cs +++ /dev/null @@ -1,43 +0,0 @@ - -datablock TSShapeConstructor(TR2MediumMaleDts) -{ - baseShape = "TR2medium_male.dts"; - sequence0 = "TR2medium_male_root.dsq root"; - sequence1 = "TR2medium_male_forward.dsq run"; - sequence2 = "TR2medium_male_back.dsq back"; - sequence3 = "TR2medium_male_side.dsq side"; - sequence4 = "medium_male_lookde.dsq look"; - sequence5 = "medium_male_head.dsq head"; - sequence6 = "TR2medium_male_fall.dsq fall"; - sequence7 = "TR2medium_male_jet.dsq jet"; - sequence8 = "TR2medium_male_land.dsq land"; - sequence9 = "TR2medium_male_jump.dsq jump"; - sequence10 = "medium_male_recoilde.dsq light_recoil"; - sequence11 = "medium_male_headside.dsq headside"; - sequence12 = "medium_male_looksn.dsq looksn"; - sequence13 = "medium_male_lookms.dsq lookms"; - sequence14 = "TR2medium_male_sitting.dsq sitting"; - sequence15 = "TR2medium_male_diehead.dsq death1"; - sequence16 = "TR2medium_male_diechest.dsq death2"; - sequence17 = "TR2medium_male_dieback.dsq death3"; - sequence18 = "TR2medium_male_diesidelf.dsq death4"; - sequence19 = "TR2medium_male_diesidert.dsq death5"; - sequence20 = "TR2medium_male_dieleglf.dsq death6"; - sequence21 = "TR2medium_male_diechest.dsq death7"; // medium_male_dielegrt - sequence22 = "TR2medium_male_dieback.dsq death8"; - sequence23 = "TR2medium_male_dieknees.dsq death9"; - sequence24 = "TR2medium_male_dieforward.dsq death10"; - sequence25 = "TR2medium_male_diespin.dsq death11"; - sequence26 = "medium_male_idlepda.dsq pda"; - sequence27 = "TR2medium_male_celsalute.dsq cel1"; - sequence28 = "TR2medium_male_celwave.dsq cel2"; - sequence29 = "TR2medium_male_tauntbest.dsq cel3"; - sequence30 = "TR2medium_male_tauntimp.dsq cel4"; - sequence31 = "TR2medium_male_celdance.dsq cel5"; - sequence32 = "TR2medium_male_celflex.dsq cel6"; - sequence33 = "TR2medium_male_celtaunt.dsq cel7"; - sequence34 = "TR2medium_male_celrocky.dsq cel8"; - sequence35 = "TR2medium_male_ski.dsq ski"; - sequence36 = "TR2medium_male_standjump.dsq standjump"; - sequence37 = "medium_male_looknw.dsq looknw"; -}; diff --git a/Scripts/arenaAI.cs b/Scripts/arenaAI.cs deleted file mode 100644 index 526f9cc..0000000 --- a/Scripts/arenaAI.cs +++ /dev/null @@ -1,75 +0,0 @@ - -// Tribes 2 Arena [Rev2] 1.0 Final -// Written By Teribaen (teribaen@planettribes.com) -// http://www.planettribes.com/t2arena/ - -$Arena::AI::Version = 1.0; - - -// ========================================================================== // -// | | // -// | AI TASKS | // -// | | // -// ========================================================================== // - -// ------------------------------------------------------------------ // -// ArenaGame::onAIRespawn() -// Gives the bots their objectives - -function ArenaGame::onAIRespawn( %game, %client ) -{ - // Setup AI tasks - if ( !%client.defaultTasksAdded ) - { - %client.defaultTasksAdded = true; - %client.addTask(AIEngageTask); - %client.addTask(AIPickupItemTask); -// %client.addTask(AITauntCorpseTask); // Heh, this makes the bots sitting ducks while they taunt - %client.addTask(AIUseInventoryTask); -// %client.addtask(AIEngageTurretTask); - %client.addtask(AIDetectMineTask); - %client.addTask(AIPatrolTask); - } - - // Use an inv whenever we spawn? - %client.spawnUseInv = true; - - // Mark the bot as alive (they just spawned) - arenaSetClientAlive( %client ); -} - - -// ========================================================================== // -// | | // -// | AI CALLBACK HANDLERS | // -// | | // -// ========================================================================== // - -function ArenaGame::AIInit( %game ) -{ - // Call the default AIInit() function - AIInit(); -} - -function ArenaGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType, %implement ) -{ - if ( %clAttacker && %clAttacker != %clVictim && %clAttacker.team == %clVictim.team ) - { - // Clear the "lastDamageClient" tag so we don't turn on teammates - %clVictim.lastDamageClient = -1; - } -} - -function ArenaGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement) -{ - if ( %clVictim.team != %clAttacker.team ) - DefaultGame::onAIKilledClient( %game, %clVictim, %clAttacker, %damageType, %implement ); -} - -function ArenaGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement) -{ -// if ( %clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim ) -// AIMessageThread("ChatSorry", %clAttacker, %clVictim); -} - - diff --git a/Scripts/chatMenuHud.cs b/Scripts/chatMenuHud.cs deleted file mode 100644 index fe78140..0000000 --- a/Scripts/chatMenuHud.cs +++ /dev/null @@ -1,236 +0,0 @@ -//------------------------------------------------------------------------------ -// -// chatMenuHud.cs -// -//------------------------------------------------------------------------------ - -if ( isFile( "prefs/customVoiceBinds.cs" ) ) - $defaultVoiceBinds = false; -else - $defaultVoiceBinds = true; - -// Load in all of the installed chat items: -exec( "scripts/cannedChatItems.cs" ); - - -//------------------------------------------------------------------------------ -// Chat menu loading function: -new SimSet( ChatMenuList ); // Store all of the chat menu maps here so that we can delete them later: -function activateChatMenu( %filename ) -{ - if ( isFile( %filename ) || isFile( %filename @ ".dso" ) ) - { - // Clear the old chat menu: - ChatMenuList.clear(); - - // Create the root of the new menu: - $RootChatMenu = new ActionMap(); - ChatMenuList.add( $RootChatMenu ); - $CurrentChatMenu = $RootChatMenu; - $CurrentChatMenu.optionCount = 0; - $CurrentChatMenu.bindCmd(keyboard, escape, "cancelChatMenu();", ""); - - // Build the new chat menu: - exec( %filename ); - } - else - error( "Chat menu file \"" @ %filename @ "\" not found!" ); -} - -//------------------------------------------------------------------------------ -// Chat menu building functions: -function startChatMenu(%heading) -{ - %key = firstWord(%heading); - %text = restWords(%heading); - %menu = new ActionMap(); - ChatMenuList.add( %menu ); - %cm = $CurrentChatMenu; - %cm.bindCmd(keyboard, %key, "setChatMenu(\"" @ %text @ "\", " @ %menu @ ");", ""); - %cm.option[%cm.optionCount] = %key @ ": " @ %text; - %cm.command[%cm.optionCount] = %menu; // Save this off here for later... - %cm.isMenu[%cm.optionCount] = 1; - %cm.optionCount++; - %menu.parent = %cm; - %menu.bindCmd(keyboard, escape, "cancelChatMenu();", ""); - %menu.optionCount = 0; - $CurrentChatMenu = %menu; -} - -function endChatMenu() -{ - $CurrentChatMenu = $CurrentChatMenu.parent; -} - -function addChat(%keyDesc, %command) -{ - %key = firstWord(%keyDesc); - %text = restWords(%keyDesc); - %cm = $CurrentChatMenu; - %cm.bindCmd(keyboard, %key, "issueChatCmd(" @ %cm @ "," @ %cm.optionCount @ ");", ""); - %cm.option[%cm.optionCount] = %key @ ": " @ %text; - %cm.command[%cm.optionCount] = %command; - %cm.isMenu[%cm.optionCount] = 0; - %cm.optionCount++; -} - - -//------------------------------------------------------------------------------ -// Chat menu hud functions: -$ChatMenuHudLineCount = 0; -function activateChatMenuHud( %make ) -{ - if(%make && !TaskHudDlg.isVisible()) - showChatMenuHud(); -} - -function showChatMenuHud() -{ - Canvas.pushDialog(ChatMenuHudDlg); - ChatMenuHudDlg.setVisible(true); - setChatMenu(Root, $RootChatMenu); -} - -function cancelChatMenu() -{ - $CurrentChatMenu.pop(); - $CurrentChatMenu = $RootChatMenu; - Canvas.popDialog(ChatMenuHudDlg); - ChatMenuHudDlg.setVisible(false); -} - -function setChatMenu( %name, %menu ) -{ - for ( %i = 0; %i < $ChatMenuHudLineCount; %i++ ) - chatMenuHud.remove( $ChatMenuHudText[%i] ); - - $ChatMenuHudLineCount = %menu.optionCount + 1; - chatMenuHud.extent = "170" SPC ( $ChatMenuHudLineCount * 15 ) + 8; - - // First add the menu title line: - $ChatMenuHudText[0] = new GuiTextCtrl() - { - profile = "GuiHudVoiceMenuProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "5 3"; - extent = "165 20"; - minExtent = "8 8"; - visible = "1"; - setFirstResponder = "0"; - modal = "1"; - helpTag = "0"; - text = "\c2" @ %name @ " Menu:"; - }; - chatMenuHud.add( $ChatMenuHudText[0] ); - - // Now add all of the menu options: - for ( %option = 0; %option < %menu.optionCount; %option++ ) - { - %yOffset = ( %option * 15 ) + 18; - - if ( %menu.isMenu[%option] == 1 ) - { - $ChatMenuHudText[%option + 1] = new GuiTextCtrl() - { - profile = "GuiHudVoiceMenuProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "5 " @ %yOffset; - extent = "165 20"; - minExtent = "8 8"; - visible = "1"; - setFirstResponder = "0"; - modal = "1"; - helpTag = "0"; - text = " " @ %menu.option[%option]; - }; - } - else - { - $ChatMenuHudText[%option + 1] = new GuiTextCtrl() - { - profile = "GuiHudVoiceCommandProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "5 " @ %yOffset; - extent = "165 20"; - minExtent = "8 8"; - visible = "1"; - setFirstResponder = "0"; - modal = "1"; - helpTag = "0"; - text = " " @ %menu.option[%option]; - }; - } - - chatMenuHud.add( $ChatMenuHudText[%option + 1] ); - } - - //bind "anykey" to closing the chat menu, so if you press an invalid entry, you don't accidently - //open the commander map or something... - %menu.bindCmd(keyboard, "anykey", "cancelChatMenu();", ""); - - // Pop the old menu map and push the new menu's map: - $CurrentChatMenu.pop(); - $CurrentChatMenu = %menu; - %menu.push(); -} - -function issueChatCmd( %menu, %index ) -{ - processChatItemCallbacks( %menu.command[%index] ); - commandToServer( 'CannedChat', %menu.command[%index], false ); - cancelChatMenu(); -} - - -//------------------------------------------------------------------------------ -// Canned chat handler: -function serverCmdCannedChat( %client, %command, %fromAI ) -{ - if(%client.isSilenced) - return; - - %cmdCode = getWord( %command, 0 ); - %cmdId = getSubStr( %cmdCode, 1, strlen( %command ) - 1 ); - %cmdString = getWord( %command, 1 ); - if ( %cmdString $= "" ) - %cmdString = getTaggedString( %cmdCode ); - - if ( !isObject( $ChatTable[%cmdId] ) ) - { - error( %cmdString @ " is not a recognized canned chat command." ); - return; - } - - %chatItem = $ChatTable[%cmdId]; - - //if there is text - if (%chatItem.text !$= "" || !%chatItem.play3D) - { - %message = %chatItem.text @ "~w" @ %chatItem.audioFile; - - if ( %chatItem.teamOnly ) - cannedChatMessageTeam( %client, %client.team, '\c3%1: %2', %client.name, %message, %chatItem.defaultKeys ); - else - cannedChatMessageAll( %client, '\c4%1: %2', %client.name, %message, %chatItem.defaultKeys ); - } - - //if no text, see if the audio is to be played in 3D... - else if ( %chatItem.play3D && %client.player ) - playTargetAudio(%client.target, addTaggedString(%chatItem.audioFile), AudioClosest3d, true); - - if ( %chatItem.animation !$= "" ) - serverCmdPlayAnim(%client, %chatItem.animation); - - // Let the AI respond to the canned chat messages (from humans only) - if (!%fromAI) - CreateVoiceServerTask(%client, %cmdCode); -} - -if ( $defaultVoiceBinds ) - activateChatMenu( "scripts/voiceBinds.cs" ); -else - activateChatMenu( "prefs/customVoiceBinds.cs" ); - diff --git a/Scripts/client.cs b/Scripts/client.cs deleted file mode 100644 index 88cf74d..0000000 --- a/Scripts/client.cs +++ /dev/null @@ -1,2439 +0,0 @@ -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- - -function SAD(%password) -{ - if(%password !$= "") - commandToServer('SAD', %password); -} - -function SADSetPassword(%password) -{ - commandToServer('SADSetPassword', %password); -} - -function use(%data) -{ - // %data is currently the datablock name of the item - commandToServer('use',%data); -} - -function throw(%data) -{ - // %data is currently the datablock name of the item - commandToServer('throw',%data); -} - -function giveAll() -{ - commandToServer('giveAll'); -} - -function clientCmdSetPlayContent() -{ - if ( $LaunchMode $= "InteriorView" ) - Canvas.setContent( interiorPreviewGui ); - else if ( $LaunchMode $= "TSShow" ) - Canvas.setContent( TSShowGui ); - else - Canvas.setContent( Playgui ); -} - -function clientCmdPickTeamMenu( %teamA, %teamB ) -{ - ClientCmdSetHudMode("PickTeam"); - PickTeamAButton.text = getTaggedString( %teamA ); - PickTeamBButton.text = getTaggedString( %teamB ); - PickTeamFrame.setTitle( "Pick Team" ); - - Canvas.pushDialog( PickTeamDlg ); -} - -function clientCmdProcessPickTeam( %option ) -{ - if( %option !$= "" && %option <= 4 ) - CommandToServer( 'clientPickedTeam', %option ); - else if( %option !$= "" && %option == 5 ) - disconnect(); - - Canvas.popDialog( PickTeamDlg ); -} - -new MessageVector(HudMessageVector); - -$LastHudTarget = 0; - -function addMessageHudLine(%text) -{ - %adjustPos = false; - if( chatPageDown.isVisible() ) - { - %adjustPos = true; - %origPosition = chatHud.position; - } - - //add the message... - while( !chatPageDown.isVisible() && HudMessageVector.getNumLines() && (HudMessageVector.getNumLines() >= $pref::HudMessageLogSize)) - { - %tag = HudMessageVector.getLineTag(0); - if(%tag != 0) - %tag.delete(); - HudMessageVector.popFrontLine(); - } - HudMessageVector.pushBackLine(%text, $LastHudTarget); - $LastHudTarget = 0; - - //now that we've added the message, see if we need to reset the position - if ( %adjustPos ) - { - chatPageDown.setVisible(true); - ChatPageDown.position = ( firstWord( outerChatHud.extent ) - 20 ) @ " " @ ( $chatScrollLenY[$Pref::chatHudLength] - 6 ); - chatHud.position = %origPosition; - } - else - chatPageDown.setVisible(false); - -} - -function pageUpMessageHud() -{ - //find out the text line height - %textHeight = chatHud.profile.fontSize; - if (%textHeight <= 0) - %textHeight = 12; - - //find out how many lines per page are visible - %chatScrollHeight = getWord(chatHud.getGroup().getGroup().extent, 1); - if (%chatScrollHeight <= 0) - return; - - %pageLines = mFloor(%chatScrollHeight / %textHeight) - 1; - if (%pageLines <= 0) - %pageLines = 1; - - //see how many lines we actually can scroll up: - %chatPosition = -1 * getWord(chatHud.position, 1); - %linesToScroll = mFloor((%chatPosition / %textHeight) + 0.5); - if (%linesToScroll <= 0) - return; - - if (%linesToScroll > %pageLines) - %scrollLines = %pageLines; - else - %scrollLines = %linesToScroll; - - //now set the position - chatHud.position = firstWord(chatHud.position) SPC (getWord(chatHud.position, 1) + (%scrollLines * %textHeight)); - - //display the pageup icon - ChatPageDown.position = ( firstWord( outerChatHud.extent ) - 20 ) @ " " @ ( $chatScrollLenY[$pref::chatHudLength] - 6 ); - chatPageDown.setVisible(true); -} - -function pageDownMessageHud() -{ - //find out the text line height - %textHeight = chatHud.profile.fontSize; - if (%textHeight <= 0) - %textHeight = 12; - - //find out how many lines per page are visible - %chatScrollHeight = getWord(chatHud.getGroup().getGroup().extent, 1); - if (%chatScrollHeight <= 0) - return; - - %pageLines = mFloor(%chatScrollHeight / %textHeight) - 1; - if (%pageLines <= 0) - %pageLines = 1; - - //see how many lines we actually can scroll down: - %chatPosition = getWord(chatHud.extent, 1) - %chatScrollHeight + getWord(chatHud.position, 1); - %linesToScroll = mFloor((%chatPosition / %textHeight) + 0.5); - if (%linesToScroll <= 0) - return; - - if (%linesToScroll > %pageLines) - %scrollLines = %pageLines; - else - %scrollLines = %linesToScroll; - - //now set the position - chatHud.position = firstWord(chatHud.position) SPC (getWord(chatHud.position, 1) - (%scrollLines * %textHeight)); - - //see if we have should (still) display the pagedown icon - if (%scrollLines < %linesToScroll) - { - chatPageDown.setVisible(true); - ChatPageDown.position = ( firstWord( outerChatHud.extent ) - 20 ) @ " " @ ( $chatScrollLenY[$Pref::chatHudLength] - 6 ); - } - else - chatPageDown.setVisible(false); -} - -$cursorControlled = true; - -function CursorOff() -{ - if ( $cursorControlled ) - lockMouse(true); - Canvas.cursorOff(); -} - -function CursorOn() -{ - if ( $cursorControlled ) - lockMouse(false); - Canvas.cursorOn(); - Canvas.setCursor(DefaultCursor); -} - -function toggleCursorControl() -{ - // If the user manually toggles the mouse control, lock or unlock for them - if ( $cursorControlled ) - $cursorControlled = false; - else - $cursorControlled = true; - lockMouse($cursorControlled); -} - -if ( $platform $= "linux" ) - GlobalActionMap.bindCmd(keyboard, "ctrl g", "", "toggleCursorControl();"); - -function toggleNetDisplayHud(%val) -{ - if(%val) - { - if(NetGraphHudFrame.isVisible()) - { - NetGraphHudFrame.setVisible(false); - NetBarHudFrame.setVisible(true); - } - else if(NetBarHudFrame.isVisible()) - { - NetBarHudFrame.setVisible(false); - } - else - NetGraphHudFrame.setVisible(true); - } -} - -function PlayGui::onWake(%this) -{ - // Make sure the shell hum is off: - if ( $HudHandle[shellScreen] !$= "" ) - { - alxStop( $HudHandle[shellScreen] ); - $HudHandle[shellScreen] = ""; - } - - $enableDirectInput = "1"; - activateDirectInput(); - - // chat hud dialog - Canvas.pushDialog( MainChatHud ); - chatHud.attach(HudMessageVector); - - // just update the action map here, the huds should be properly setup - updateActionMaps(); - - // hack city - these controls are floating around and need to be clamped - schedule(0, 0, "refreshCenterTextCtrl"); - schedule(0, 0, "refreshBottomTextCtrl"); - - // update the network graph prefs - NetGraphHud.getPrefs(); -} - -function refreshBottomTextCtrl() -{ - BottomPrintText.position = "0 0"; -} - -function refreshCenterTextCtrl() -{ - CenterPrintText.position = "0 0"; -} - -function PlayGui::onSleep(%this) -{ - Canvas.popDialog( MainChatHud ); - - //pop all possible keymaps - moveMap.pop(); - if ( isObject( passengerKeys ) ) - passengerKeys.pop(); - if ( isObject( observerBlockMap ) ) - observerBlockMap.pop(); - if ( isObject( observerMap ) ) - observerMap.pop(); - //flyingCameraMove.pop(); -} - -function onConnectRequestRejected( %msg ) -{ - switch$(%msg) - { - case "CR_INVALID_CONNECT_PACKET": - %error = "Network error - badly formed network packet - this should not happen!"; - case "CR_AUTHENTICATION_FAILED": - %error = "Failed to authenticate with server. Please restart TRIBES 2 and try again."; - case "CR_YOUAREBANNED": - %error = "You are not allowed to play on this server."; - case "CR_SERVERFULL": - %error = "This server is full."; - default: - %error = "Connection error. Please try another server. Error code: (" @ %msg @ ")"; - } - DisconnectedCleanup(); - MessageBoxOK( "REJECTED", %error); -} - -function onChallengeRequestRejected( %msg ) -{ - CloseMessagePopup(); - DisconnectedCleanup(); - switch$(%msg) - { - case "PASSWORD": - if ( $JoinGamePassword $= "" ) - Canvas.pushDialog( PasswordDlg ); - else - { - $JoinGamePassword = ""; - MessageBoxOK( "REJECTED", "That password is incorrect."); - } - return; - case "CHR_PROTOCOL_SERVER": - %error = "Incompatible protocol version: The server is running an older, incompatible version of Tribes 2."; - case "CHR_PROTOCOL": - %error = "Incompatible protocol version: You must upgrade your game version to play on this server."; - case "CHR_NOT_AUTHENTICATED": - %error = "This is an online server - you must be logged in to play on it."; - case "CHR_INVALID_SERVER_PACKET": - %error = "Invalid server response packet. This should not happen."; - case "WS_PeerAuthServer_ExpiredClientCertificate": - %error = "Authentication error - please restart TRIBES 2 and try again."; - default: - %error = "Connection challenge error. Please try another server. Error code: (" @ %msg @ ")"; - } - MessageBoxOK( "REJECTED", %error ); -} - -function onConnectRequestTimedOut() -{ - DisconnectedCleanup(); - MessageBoxOK( "TIMED OUT", "Your connection to the server timed out." ); -} - -function onConnectionToServerTimedOut() -{ - DisconnectedCleanup(); - MessageBoxOK( "TIMED OUT", "Your connection to the server timed out."); -} - -function onConnectionToServerLost( %msg ) -{ - DisconnectedCleanup(); - if ( %msg $= "" ) - %msg = "Your connection to the server was lost."; - MessageBoxOK( "DISCONNECTED", %msg ); -} - -// Client voting functions: -function startNewVote(%name, %arg1, %arg2, %arg3, %arg4, %playerVote) -{ - if ( %arg1 $= "" ) - %arg1 = 0; - if ( %arg2 $= "" ) - %arg2 = 0; - if ( %arg3 $= "" ) - %arg3 = 0; - if ( %arg4 $= "" ) - %arg4 = 0; - if ( %playerVote $= "" ) - %playerVote = 0; - - commandToServer('startNewVote', %name, %arg1, %arg2, %arg3, %arg4, %playerVote); -} - -function setPlayerVote(%vote) -{ - commandToServer('setPlayerVote', %vote); -} - -function ClientCmdVoteSubmitted(%type) -{ - clientCmdClearBottomPrint(); - - if(%type) - alxPlay(VoteAgainstSound, 0, 0, 0); - else - alxPlay(VoteForSound, 0, 0, 0); -} -// End client voting functions. - -//-------------------------------------------------------------------------- -// Player pref functions: -function getPlayerPrefs( %player ) -{ - %voiceMuted = false; - if ( $PlayingOnline ) - { - if ( !%player.isSmurf ) - { - %record = queryPlayerDatabase( %player.guid ); - if ( %record !$= "" ) - { - if ( firstWord( %record ) == 1 ) - { - %player.chatMuted = true; - commandToServer( 'TogglePlayerMute', %player.clientId ); - } - - %voiceMuted = getWord( %record, 1 ) == 1; - } - } - else - %voiceMuted = true; // For now, automatically mute smurfs - } - - commandToServer( 'ListenTo', %player.clientId, !%voiceMuted, false ); -} - -//-------------------------------------------------------------------------- -function handlePlayerMuted( %msgType, %msgString, %name, %client, %mute ) -{ - if ( isObject( $PlayerList[%client] ) ) - { - $PlayerList[%client].chatMuted = %mute; - if ( $PlayingOnline && !$PlayerList[%client].isSmurf && $PlayerList[%client].guid > 0 ) - setPlayerTextMuted( $PlayerList[%client].guid, %mute ); - } -} - -//-------------------------------------------------------------------------- -function clientCmdEndBomberSight() -{ - PlayGui.remove($bombSightHud); -} - -function clientCmdRemoveReticle() -{ - reticleHud.setBitmap(""); - reticleFrameHud.setVisible(false); -} - -function clientCmdSetBeaconNames(%target, %marker, %vehicle) -{ - setBeaconNames(%target, %marker, %vehicle); -} - -function clientCmdStartBomberSight() -{ - $bombSightHud = new HudBombSight(bombSightName) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "286 206"; - extent = "67 67"; - minExtent = "8 8"; - visible = "1"; - setFirstResponder = "0"; - modal = "1"; - helpTag = "0"; - minDisplayHeight = "20"; - }; - PlayGui.add($bombSightHud); -} - -function tempShowSpeed(%client) -{ - if(!$tmpSpeedShow) - $tmpSpeedShow = true; - else - $tmpSpeedShow = false; - commandToClient(%client, 'toggleSpeed', %client, $tmpSpeedShow); -} - -function clientCmdToggleSpeed(%client, %toggle) -{ - if(%toggle) { - %tempSpeedHud = new GuiTextCtrl(tmpSpeed) { - profile = "GuiTempSpeedProfile"; - horizSizing = "center"; - vertSizing = "top"; - position = "175 200"; - extent = "120 50"; - minExtent = "8 8"; - visible = "1"; - setFirstResponder = "0"; - modal = "1"; - }; - PlayGui.add(%tempSpeedHud); - %client.updateTempSpeed(%client); - } - else { - cancel(%client.tmpSpeedCheck); - tmpSpeed.delete(); - } -} - -function GameConnection::updateTempSpeed(%client) -{ - commandToClient(%client, 'getTempSpeed'); - %client.tmpSpeedCheck = %client.schedule(100, "updateTempSpeed", %client); -} - -function clientCmdGetTempSpeed() -{ - %vel = getControlObjectSpeed(); - tmpSpeed.setValue(%vel); -} - -function clientCmdInitLoadClientFavorites() -{ - loadFavorite($pref::FavCurrentSelect); -} - -function clientCmdToggleDashHud(%val) -{ - if(!%val) { - if(isObject(vDiagramHud)) - { - vDiagramHud.delete(); - cancel(dashboardHud.speedCheck); - vSpeedBox.delete(); - } - if(isObject(vOverheadHud)) - vOverheadHud.delete(); - if(isObject(vEnergyFrame)) - vEnergyFrame.delete(); - if(isObject(vDamageFrame)) - vDamageFrame.delete(); - if(isObject(vAltitudeBox)) - { - cancel(dashboardHud.altitudeCheck); - vAltitudeBox.delete(); - } - if(isObject(vWeaponOne)) - vWeaponOne.delete(); - if(isObject(vWeaponTwo)) - vWeaponTwo.delete(); - if(isObject(vWeaponThree)) - vWeaponThree.delete(); - if(isObject(vWeapHiliteOne)) - vWeapHiliteOne.delete(); - if(isObject(vWeapHiliteTwo)) - vWeapHiliteTwo.delete(); - if(isObject(vWeapHiliteThree)) - vWeapHiliteThree.delete(); - if(isObject(vPassengerHud)) - vPassengerHud.delete(); - if(isObject(bombardierHud)) - bombardierHud.delete(); - if(isObject(turreteerHud)) - turreteerHud.delete(); - // reset in case of vehicle-specific reticle - //reticleHud.setBitmap(""); - //reticleFrameHud.setVisible(false); - } - dashboardHud.setVisible(%val); -} - -function addEnergyGauge( %vehType ) -{ - switch$ (%vehType) - { - case "Assault" or "Bomber": - dashboardHud.nrgBar = new HudBitmapCtrl(vEnergyFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "160 80"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_dashpiece_5"; - opacity = "0.8"; - - new HudEnergy(vEnergyBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.353000 0.373000 0.933000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 1.000000"; - autoCenter = "0"; - autoResize = "0"; - displayMounted = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - verticalFill = false; - subRegion = "4 5 98 5"; - pulseRate = "500"; - pulseThreshold = "0.3"; - //modColor = "1.000000 0.500000 0.000000 1.000000"; - }; - - new HudCapacitor(vCapBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 8"; - extent = "118 8"; - minExtent = "8 8"; - visible = "1"; - fillColor = "1.000 0.729 0.301 0.800000"; - frameColor = "0.000000 1.000000 0.000000 1.000000"; - autoCenter = "0"; - autoResize = "0"; - displayMounted = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - verticalFill = false; - subRegion = "4 5 98 5"; - pulseRate = "500"; - pulseThreshold = "0.3"; - //modColor = "1.000000 0.500000 0.000000 1.000000"; - }; - }; - dashboardHud.add(dashboardHud.nrgBar); - - default: - dashboardHud.nrgBar = new HudBitmapCtrl(vEnergyFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "160 80"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_dashpiece_5"; - opacity = "0.8"; - - new HudEnergy(vEnergyBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.353000 0.373000 0.933000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 1.000000"; - autoCenter = "0"; - autoResize = "0"; - displayMounted = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - verticalFill = false; - subRegion = "4 5 98 10"; - pulseRate = "500"; - pulseThreshold = "0.3"; - //modColor = "1.000000 0.500000 0.000000 1.000000"; - }; - }; - dashboardHud.add(dashboardHud.nrgBar); - } -} - -function clientCmdShowVehicleGauges(%vehType, %node) -{ - //if(!((%vehType $= "Bomber" || %vehType $= "Assault") && %node > 0)) - if(%node == 0) - { - // common elements that show up on all vehicle pilot HUDs - dashboardHud.diagram = new HudBitmapCtrl(vDiagramHud) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "200 10"; - extent = "176 108"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_dash"; - opacity = "0.8"; - }; - dashboardHud.add(dashboardHud.diagram); - - dashboardHud.vehDiagram = new HudBitmapCtrl(vOverheadHud) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "256 0"; - extent = "128 128"; - minExtent = "8 8"; - visible = "1"; - bitmap = ""; - opacity = "1.0"; - }; - dashboardHud.add(dashboardHud.vehDiagram); - - addEnergyGauge( %vehType ); - - dashboardHud.dmgBar = new HudBitmapCtrl(vDamageFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "361 80"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_dashpiece_4"; - opacity = "0.8"; - - new HudDamage(vDamageBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.000000 1.0000 0.000000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 0.000000"; - bitmap = "gui/hud_veh_new_dashpiece_4"; - verticalFill = false; - displayMounted = true; - opacity = "0.8"; - subRegion = "18 5 97 10"; - pulseRate = "500"; - pulseThreshold = "0.3"; - //modColor = "1.000000 0.500000 0.000000 1.000000"; - }; - }; - dashboardHud.add(dashboardHud.dmgBar); - - dashboardHud.speedBox = new GuiControl(vSpeedBox) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "210 47"; - extent = "40 40"; - minExtent = "8 8"; - visible = "1"; - - new GuiTextCtrl(vSpeedText) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "3 15"; - extent = "18 15"; - minExtent = "8 8"; - visible = "1"; - text = "test"; - }; - new GuiTextCtrl(vSpeedTxtLbl) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "18 15"; - extent = "27 15"; - minExtent = "8 8"; - visible = "1"; - text = "KPH"; - }; - }; - dashboardHud.add(dashboardHud.speedBox); - - dashboardHud.updateSpeed(); - } - - switch$ (%vehType) { - case "Shrike" : - vOverheadHud.setBitmap("gui/hud_veh_icon_shrike"); - // add altitude box for flying vehicles - dashboardHud.altBox = new HudBitmapCtrl(vAltitudeBox) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "371 56"; - extent = "68 22"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_1"; - visible = "1"; - opacity = "0.8"; - - new GuiTextCtrl(vAltitudeText) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "19 5"; - extent = "18 15"; - minExtent = "8 8"; - visible = "1"; - text = "test"; - }; - new GuiTextCtrl(vAltitudeTxtLbl) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "40 5"; - extent = "12 15"; - minExtent = "8 8"; - visible = "1"; - text = "M"; - }; - }; - dashboardHud.add(dashboardHud.altBox); - dashboardHud.updateAltitude(); - // add right-hand weapons box and highlight - dashboardHud.weapon = new GuiControl(vWeapHiliteOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "358 22"; - extent = "80 33"; - minExtent = "8 8"; - visible = "1"; - - new HudBitmapCtrl(vWeapBkgdOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_2"; - visible = "1"; - opacity = "0.8"; - - new HudBitmapCtrl(vWeapIconOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "28 6"; - extent = "25 25"; - minExtent = "8 8"; - bitmap = "gui/hud_blaster"; - visible = "1"; - opacity = "0.8"; - }; - }; - }; - dashboardHud.add(dashboardHud.weapon); - // change to shrike reticle - reticleHud.setBitmap("gui/hud_ret_shrike"); - reticleFrameHud.setVisible(false); - - case "shrike2" : - vOverheadHud.setBitmap("gui/hud_veh_icon_shrike"); - // add altitude box for flying vehicles - dashboardHud.altBox = new HudBitmapCtrl(vAltitudeBox) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "371 56"; - extent = "68 22"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_1"; - visible = "1"; - opacity = "0.8"; - - new GuiTextCtrl(vAltitudeText) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "19 5"; - extent = "18 15"; - minExtent = "8 8"; - visible = "1"; - text = "test"; - }; - new GuiTextCtrl(vAltitudeTxtLbl) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "40 5"; - extent = "12 15"; - minExtent = "8 8"; - visible = "1"; - text = "M"; - }; - }; - dashboardHud.add(dashboardHud.altBox); - dashboardHud.updateAltitude(); - // add right-hand weapons box and highlight - dashboardHud.weapon = new GuiControl(vWeapHiliteOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "358 22"; - extent = "80 33"; - minExtent = "8 8"; - visible = "1"; - - new HudBitmapCtrl(vWeapBkgdOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_2"; - visible = "1"; - opacity = "0.8"; - - new HudBitmapCtrl(vWeapIconOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "28 6"; - extent = "25 25"; - minExtent = "8 8"; - bitmap = "gui/hud_blaster"; - visible = "1"; - opacity = "0.8"; - }; - }; - new HudBitmapCtrl(vWeap1Hilite) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_hilite_right"; - visible = "0"; - opacity = "0.8"; - }; - }; - dashboardHud.add(dashboardHud.weapon); - dashboardHud.weaponTwo = new GuiControl(vWeapHiliteTwo) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "202 22"; - extent = "80 33"; - minExtent = "8 8"; - visible = "1"; - - new HudBitmapCtrl(vWeapBkgdTwo) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_3"; - visible = "1"; - opacity = "0.8"; - - new HudBitmapCtrl(vWeapIconTwo) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "28 6"; - extent = "25 25"; - minExtent = "8 8"; - bitmap = "gui/hud_missiles"; - visible = "1"; - opacity = "0.8"; - }; - }; - new HudBitmapCtrl(vWeap2Hilite) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_hilite_left"; - visible = "0"; - opacity = "0.8"; - }; - }; - dashboardHud.add(dashboardHud.weaponTwo); - dashboardHud.weaponThree = new GuiControl(vWeapHiliteThree) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "202 22"; - extent = "80 33"; - minExtent = "8 8"; - visible = "0"; - - new HudBitmapCtrl(vWeapBkgdThree) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_3"; - visible = "0"; - opacity = "0.8"; - - new HudBitmapCtrl(vWeapIconThree) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "28 6"; - extent = "25 25"; - minExtent = "8 8"; - bitmap = "gui/hud_missiles"; - visible = "0"; - opacity = "0.8"; - }; - }; - new HudBitmapCtrl(vWeap3Hilite) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_hilite_left"; - visible = "0"; - opacity = "0.8"; - }; - }; - dashboardHud.add(dashboardHud.weaponThree); - $numVWeapons = 3; - reticleHud.setBitmap("gui/ret_chaingun"); - reticleFrameHud.setVisible(false); - - case "apache" : - vOverheadHud.setBitmap("gui/hud_veh_icon_bomber"); - dashboardHud.altBox = new HudBitmapCtrl(vAltitudeBox) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "371 56"; - extent = "68 22"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_1"; - visible = "1"; - opacity = "0.8"; - - new GuiTextCtrl(vAltitudeText) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "19 5"; - extent = "18 15"; - minExtent = "8 8"; - visible = "1"; - text = "test"; - }; - new GuiTextCtrl(vAltitudeTxtLbl) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "40 5"; - extent = "12 15"; - minExtent = "8 8"; - visible = "1"; - text = "M"; - }; - }; - dashboardHud.add(dashboardHud.altBox); - dashboardHud.updateAltitude(); - dashboardHud.weapon = new GuiControl(vWeapHiliteOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "358 22"; - extent = "80 33"; - minExtent = "8 8"; - visible = "1"; - - new HudBitmapCtrl(vWeapBkgdOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_2"; - visible = "1"; - opacity = "0.8"; - - new HudBitmapCtrl(vWeapIconOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "28 6"; - extent = "25 25"; - minExtent = "8 8"; - bitmap = "gui/hud_blaster"; - visible = "1"; - opacity = "0.8"; - }; - }; - new HudBitmapCtrl(vWeap1Hilite) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_hilite_right"; - visible = "0"; - opacity = "0.8"; - }; - }; - dashboardHud.add(dashboardHud.weapon); - dashboardHud.weaponTwo = new GuiControl(vWeapHiliteTwo) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "202 22"; - extent = "80 33"; - minExtent = "8 8"; - visible = "1"; - - new HudBitmapCtrl(vWeapBkgdTwo) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_3"; - visible = "1"; - opacity = "0.8"; - - new HudBitmapCtrl(vWeapIconTwo) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "28 6"; - extent = "25 25"; - minExtent = "8 8"; - bitmap = "gui/hud_missiles"; - visible = "1"; - opacity = "0.8"; - }; - }; - new HudBitmapCtrl(vWeap2Hilite) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "82 40"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_hilite_left"; - visible = "0"; - opacity = "0.8"; - }; - }; - dashboardHud.add(dashboardHud.weaponTwo); - $numVWeapons = 2; - reticleHud.setBitmap("gui/ret_chaingun"); - reticleFrameHud.setVisible(false); - - case "Bomber" : - if(%node == 1) - { - // bombardier hud - dashboardHud.bHud = new GuiControl(bombardierHud) { - profile = "GuiDefaultProfile"; - horizSizing = "center"; - vertSizing = "top"; - position = "200 75"; - extent = "240 50"; - minExtent = "8 8"; - visible = "1"; - - new HudBitmapCtrl(vWeap1Hilite) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "18 9"; - extent = "80 44"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_hilite_left"; - opacity = "0.3"; - }; - new HudBitmapCtrl(vWeap2Hilite) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "141 9"; - extent = "80 44"; - minExtent = "8 8"; - visible = "0"; - bitmap = "gui/hud_veh_new_hilite_right"; - opacity = "0.3"; - }; - new HudBitmapCtrl(vWeap3Hilite) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "99 9"; - extent = "40 44"; - minExtent = "8 8"; - visible = "0"; - bitmap = "gui/hud_veh_new_hilite_middle"; - opacity = "0.3"; - }; - - new HudBitmapCtrl(bombardierFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "center"; - vertSizing = "bottom"; - position = "20 8"; - extent = "200 40"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_bombardier_dash"; - opacity = "1.0"; - - new HudBitmapCtrl(vWeaponOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "28 5"; - extent = "25 25"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_blaster"; - }; - - new HudBitmapCtrl(vWeaponTwo) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "87 6"; - extent = "25 25"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_targetlaser"; - }; - - new HudBitmapCtrl(vWeaponThree) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "147 6"; - extent = "25 25"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_bomb"; - }; - }; - }; - dashboardHud.add(dashboardHud.bHud); - - dashboardHud.nrgBar = new HudBitmapCtrl(vEnergyFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "110 95"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - flipVertical = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - opacity = "0.8"; - - new HudEnergy(vEnergyBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.353000 0.373000 0.933000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 1.000000"; - autoCenter = "0"; - autoResize = "0"; - displayMounted = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - verticalFill = false; - subRegion = "4 5 98 5"; - pulseRate = "500"; - pulseThreshold = "0.3"; - //modColor = "1.000000 0.500000 0.000000 1.000000"; - }; - new HudCapacitor(vCapBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 8"; - extent = "118 8"; - minExtent = "8 8"; - visible = "1"; - fillColor = "1.000 0.729 0.301 0.800000"; - frameColor = "0.000000 1.000000 0.000000 1.000000"; - autoCenter = "0"; - autoResize = "0"; - displayMounted = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - verticalFill = false; - subRegion = "4 5 98 5"; - pulseRate = "500"; - pulseThreshold = "0.3"; - //modColor = "1.000000 0.500000 0.000000 1.000000"; - }; - }; - dashboardHud.add(dashboardHud.nrgBar); - - dashboardHud.dmgBar = new HudBitmapCtrl(vDamageFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "410 95"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - flipVertical = true; - bitmap = "gui/hud_veh_new_dashpiece_4"; - opacity = "0.8"; - - new HudDamage(vDamageBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.000000 1.0000 0.000000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 0.000000"; - bitmap = "gui/hud_veh_new_dashpiece_4"; - verticalFill = false; - displayMounted = true; - opacity = "0.8"; - subRegion = "18 5 97 10"; - pulseRate = "500"; - pulseThreshold = "0.3"; - //modColor = "1.000000 0.500000 0.000000 1.000000"; - }; - }; - dashboardHud.add(dashboardHud.dmgBar); - $numVWeapons = 3; - reticleHud.setBitmap("gui/hud_ret_shrike"); - reticleFrameHud.setVisible(false); - } - else if(%node == 0) - { - // pilot dashboard hud - vOverheadHud.setBitmap("gui/hud_veh_icon_bomber"); - // add altitude box for flying vehicles - dashboardHud.altBox = new HudBitmapCtrl(vAltitudeBox) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "371 56"; - extent = "68 22"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_1"; - visible = "1"; - opacity = "0.8"; - - new GuiTextCtrl(vAltitudeText) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "19 5"; - extent = "18 15"; - minExtent = "8 8"; - visible = "1"; - text = "test"; - }; - new GuiTextCtrl(vAltitudeTxtLbl) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "40 5"; - extent = "12 15"; - minExtent = "8 8"; - visible = "1"; - text = "M"; - }; - }; - dashboardHud.add(dashboardHud.altBox); - dashboardHud.updateAltitude(); - } - else - { - // tailgunner hud - dashboardHud.vehDiagram = new HudBitmapCtrl(vOverheadHud) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "256 0"; - extent = "128 128"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_icon_bomber"; - opacity = "1.0"; - }; - dashboardHud.add(dashboardHud.vehDiagram); - - dashboardHud.nrgBar = new HudBitmapCtrl(vEnergyFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "177 50"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_dashpiece_5"; - flipVertical = true; - opacity = "0.8"; - - new HudEnergy(vEnergyBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.353000 0.373000 0.933000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 1.000000"; - autoCenter = "0"; - autoResize = "0"; - displayMounted = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - verticalFill = false; - subRegion = "4 5 98 10"; - pulseRate = "500"; - pulseThreshold = "0.3"; - }; - }; - dashboardHud.add(dashboardHud.nrgBar); - - dashboardHud.dmgBar = new HudBitmapCtrl(vDamageFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "345 50"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_dashpiece_4"; - flipVertical = true; - opacity = "0.8"; - - new HudDamage(vDamageBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.000000 1.0000 0.000000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 0.000000"; - bitmap = "gui/hud_veh_new_dashpiece_4"; - verticalFill = false; - displayMounted = true; - opacity = "0.8"; - subRegion = "18 5 97 10"; - pulseRate = "500"; - pulseThreshold = "0.3"; - }; - }; - dashboardHud.add(dashboardHud.dmgBar); - } - if(%node != 1) - { - // passenger slot "dots" - vOverheadHud.passengerHud = new GuiControl(vPassengerHud) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "101 101"; - minExtent = "8 8"; - visible = "1"; - - new GuiBitmapCtrl(vPassenger0Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "59 24"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - bitmap = "gui/hud_veh_seatdot"; - }; - new GuiBitmapCtrl(vPassenger1Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "59 39"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - bitmap = "gui/hud_veh_seatdot"; - }; - new GuiBitmapCtrl(vPassenger2Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "59 84"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - bitmap = "gui/hud_veh_seatdot"; - }; - }; - vOverheadHud.add(vOverheadHud.passengerHud); - } - case "HAPC" : - if(%node == 0) - { - vOverheadHud.setBitmap("gui/hud_veh_icon_hapc"); - // add altitude box for flying vehicles - dashboardHud.altBox = new HudBitmapCtrl(vAltitudeBox) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "371 56"; - extent = "68 22"; - minExtent = "8 8"; - bitmap = "gui/hud_veh_new_dashpiece_1"; - visible = "1"; - opacity = "0.8"; - - new GuiTextCtrl(vAltitudeText) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "19 5"; - extent = "18 15"; - minExtent = "8 8"; - visible = "1"; - text = "test"; - }; - new GuiTextCtrl(vAltitudeTxtLbl) { - profile = "GuiDashTextProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "40 5"; - extent = "12 15"; - minExtent = "8 8"; - visible = "1"; - text = "M"; - }; - }; - dashboardHud.add(dashboardHud.altBox); - updateVehicleAltitude(); - dashboardHud.updateAltitude(); - - } - else - { - // passenger hud - dashboardHud.vehDiagram = new HudBitmapCtrl(vOverheadHud) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "256 0"; - extent = "128 128"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_icon_hapc"; - opacity = "1.0"; - }; - dashboardHud.add(dashboardHud.vehDiagram); - - dashboardHud.nrgBar = new HudBitmapCtrl(vEnergyFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "180 30"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_dashpiece_5"; - flipVertical = true; - opacity = "0.8"; - - new HudEnergy(vEnergyBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.353000 0.373000 0.933000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 1.000000"; - autoCenter = "0"; - autoResize = "0"; - displayMounted = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - verticalFill = false; - subRegion = "4 5 98 10"; - pulseRate = "500"; - pulseThreshold = "0.3"; - }; - }; - dashboardHud.add(dashboardHud.nrgBar); - - dashboardHud.dmgBar = new HudBitmapCtrl(vDamageFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "342 30"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_dashpiece_4"; - flipVertical = true; - opacity = "0.8"; - - new HudDamage(vDamageBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.000000 1.0000 0.000000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 0.000000"; - bitmap = "gui/hud_veh_new_dashpiece_4"; - verticalFill = false; - displayMounted = true; - opacity = "0.8"; - subRegion = "18 5 97 10"; - pulseRate = "500"; - pulseThreshold = "0.3"; - }; - }; - dashboardHud.add(dashboardHud.dmgBar); - } - // passenger slot "dots" - vOverheadHud.passengerHud = new GuiControl(vPassengerHud) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "101 101"; - minExtent = "8 8"; - visible = "1"; - setFirstResponder = "0"; - modal = "1"; - helpTag = "0"; - - new GuiBitmapCtrl(vPassenger0Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "59 65"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - setFirstResponder = "0"; - modal = "1"; - bitmap = "gui/hud_veh_seatdot"; - wrap = "0"; - }; - new GuiBitmapCtrl(vPassenger1Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "59 84"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - setFirstResponder = "0"; - modal = "1"; - bitmap = "gui/hud_veh_seatdot"; - wrap = "0"; - }; - new GuiBitmapCtrl(vPassenger2Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "38 29"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - setFirstResponder = "0"; - modal = "1"; - bitmap = "gui/hud_veh_seatdot"; - wrap = "0"; - }; - new GuiBitmapCtrl(vPassenger3Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "38 50"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - setFirstResponder = "0"; - modal = "1"; - bitmap = "gui/hud_veh_seatdot"; - wrap = "0"; - }; - new GuiBitmapCtrl(vPassenger4Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "80 50"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - setFirstResponder = "0"; - modal = "1"; - bitmap = "gui/hud_veh_seatdot"; - wrap = "0"; - }; - new GuiBitmapCtrl(vPassenger5Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "80 29"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - setFirstResponder = "0"; - modal = "1"; - bitmap = "gui/hud_veh_seatdot"; - wrap = "0"; - }; - }; - vOverheadHud.add(vOverheadHud.passengerHud); - - case "Assault" : - if(%node == 1) - { - // turreteer hud - dashboardHud.tHud = new GuiControl(turreteerHud) { - profile = "GuiDefaultProfile"; - horizSizing = "center"; - vertSizing = "top"; - position = "225 70"; - extent = "240 50"; - minExtent = "8 8"; - visible = "1"; - - new HudBitmapCtrl(vWeap1Hilite) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "40 11"; - extent = "80 44"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_hilite_left"; - opacity = "0.4"; - }; - new HudBitmapCtrl(vWeap2Hilite) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "118 11"; - extent = "80 44"; - minExtent = "8 8"; - visible = "0"; - bitmap = "gui/hud_veh_new_hilite_right"; - opacity = "0.4"; - }; - - new HudBitmapCtrl(turreteerFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "center"; - vertSizing = "bottom"; - position = "20 8"; - extent = "152 36"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_veh_new_tankgunner_dash"; - opacity = "0.8"; - - new HudBitmapCtrl(vWeaponOne) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "25 8"; - extent = "25 25"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_chaingun"; - }; - - new HudBitmapCtrl(vWeaponTwo) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "bottom"; - position = "99 8"; - extent = "25 25"; - minExtent = "8 8"; - visible = "1"; - bitmap = "gui/hud_mortor"; - }; - }; - }; - dashboardHud.add(dashboardHud.tHud); - - dashboardHud.nrgBar = new HudBitmapCtrl(vEnergyFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "134 95"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - flipVertical = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - opacity = "0.8"; - - new HudEnergy(vEnergyBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.353000 0.373000 0.933000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 1.000000"; - autoCenter = "0"; - autoResize = "0"; - displayMounted = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - verticalFill = false; - subRegion = "4 5 98 5"; - pulseRate = "500"; - pulseThreshold = "0.3"; - //modColor = "1.000000 0.500000 0.000000 1.000000"; - }; - new HudCapacitor(vCapBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 8"; - extent = "118 8"; - minExtent = "8 8"; - visible = "1"; - fillColor = "1.000 0.729 0.301 0.800000"; - frameColor = "0.000000 1.000000 0.000000 1.000000"; - autoCenter = "0"; - autoResize = "0"; - displayMounted = true; - bitmap = "gui/hud_veh_new_dashpiece_5"; - verticalFill = false; - subRegion = "4 5 98 5"; - pulseRate = "500"; - pulseThreshold = "0.3"; - //modColor = "1.000000 0.500000 0.000000 1.000000"; - }; - }; - dashboardHud.add(dashboardHud.nrgBar); - - dashboardHud.dmgBar = new HudBitmapCtrl(vDamageFrame) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "390 95"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - flipVertical = true; - bitmap = "gui/hud_veh_new_dashpiece_4"; - opacity = "0.8"; - - new HudDamage(vDamageBar) { - profile = "GuiDefaultProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "118 19"; - minExtent = "8 8"; - visible = "1"; - fillColor = "0.000000 1.0000 0.000000 0.800000"; - frameColor = "0.000000 1.000000 0.000000 0.000000"; - bitmap = "gui/hud_veh_new_dashpiece_4"; - verticalFill = false; - displayMounted = true; - opacity = "0.8"; - subRegion = "18 5 97 10"; - pulseRate = "500"; - pulseThreshold = "0.3"; - //modColor = "1.000000 0.500000 0.000000 1.000000"; - }; - }; - dashboardHud.add(dashboardHud.dmgBar); - - $numVWeapons = 2; - // add tank chaingun reticle - reticleHud.setBitmap("gui/hud_ret_tankchaingun"); - reticleFrameHud.setVisible(false); - } - else - { - // node 0 == driver - vOverheadHud.setBitmap("gui/hud_veh_icon_assault"); - // passenger slot "dots" - vOverheadHud.passengerHud = new GuiControl(vPassengerHud) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "101 101"; - minExtent = "8 8"; - visible = "1"; - - new GuiBitmapCtrl(vPassenger0Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "64 30"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - bitmap = "gui/hud_veh_seatdot"; - }; - new GuiBitmapCtrl(vPassenger1Slot) { - profile = "GuiDashBoxProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "53 53"; - extent = "10 10"; - minExtent = "3 3"; - visible = "0"; - bitmap = "gui/hud_veh_seatdot"; - }; - }; - vOverheadHud.add(vOverheadHud.passengerHud); - } - - case "Hoverbike" : - vOverheadHud.setBitmap("gui/hud_veh_icon_hoverbike"); - - case "MPB" : - vOverheadHud.setBitmap("gui/hud_veh_icon_mpb"); - - } - if(%node == 0) - vDiagramHud.setVisible(true); - else - if(isObject(vDiagramHud)) - vDiagramHud.setVisible(false); -} - -function GuiControl::updateAltitude(%this) -{ - %alt = getControlObjectAltitude(); - vAltitudeText.setValue(%alt); - %this.altitudeCheck = %this.schedule(500, "updateAltitude"); -} - -function GuiControl::updateSpeed(%this) -{ - %vel = getControlObjectSpeed(); - // convert from m/s to km/h - %cVel = mFloor(%vel * 3.6); // m/s * (3600/1000) = km/h - vSpeedText.setValue(%cVel); - %this.speedCheck = %this.schedule(500, "updateSpeed"); -} - -//function clientCmdShowVehicleWeapons(%vehicleType) -//{ - // all vehicle weapons are energy based; a -1 displays an infinity symbol - // for that weapon's ammo amount - //switch$ (%vehicleType) - //{ - // case "ScoutFlyer": - // // blaster - // vWeaponsBox.addWeapon(0, -1); - // case "BomberFlyer": - // // plasma, bomb and targeting laser - // vWeaponsBox.addWeapon(1, -1); - // vWeaponsBox.addWeapon(3, -1); - // vWeaponsBox.addWeapon(4, -1); - // case "AssaultVehicle": - // vWeaponsBox.addWeapon(1, -1); - // vWeaponsBox.addWeapon(3, -1); - //} - //vWeaponsBox.setVisible(true); -//} - -// if set, then static shapes with data member 'noIndividualDamage' set will -// not display their damage bars -function clientCmdProtectingStaticObjects(%val) -{ - NavHud.protectedStatics = %val; -} - -function clientCmdCheckPassengers(%pString) -{ - // since each slot is represented by a "1" or a "0" followed by a space, the length - // of the string divided by 2 is equal to the number of slots in the vehicle - %numSlots = strlen(%pString) / 2; - for(%i = 0; %i < %numSlots; %i++) - { - %pass = "vPassenger" @ %i @ "Slot"; - if(isObject(%pass)) - if(getWord(%pString, %i) $= "1") - %pass.setVisible(true); - else - %pass.setVisible(false); - } -} - -function clientCmdShowPassenger(%slot, %full) -{ - %dotNum = "vPassenger" @ %slot @ "Slot"; - if(isObject(%dotNum)) - %dotNum.setVisible(%full); -} - -function clientCmdClearPassengers() -{ - for(%i = 1; %i < 6; %i++) - { - %pass = "vPassenger" @ %i @ "Slot"; - %pass.setVisible(false); - } -} - -addMessageCallback( 'MsgMissionDropInfo', handleDropInfoMessage ); -addMessageCallback( 'MsgTeamList', handleTeamListMessage ); -addMessageCallback( 'LeaveMissionArea', HandleLeaveMissionAreaAlarmMessage ); -addMessageCallback( 'EnterMissionArea', HandleEnterMissionAreaAlarmMessage ); -addMessageCallback( 'msgBountyStreakBonus', HandleBountyStreakMessage ); -addMessageCallback( 'onClientKicked', handleIveBeenKicked ); -addMessageCallback( 'onClientBanned', handleIveBeenBanned ); -addMessageCallback( 'msgDeploySensorRed', clientDeploySensorRed ); -addMessageCallback( 'msgDeploySensorGrn', clientDeploySensorGrn ); -addMessageCallback( 'msgDeploySensorOff', clientDeploySensorOff ); -addMessageCallback( 'msgPackIconOff', clientPackIconOff ); -addMessageCallback( 'MsgForceObserver', HandleForceObserver ); -addMessageCallback( 'MsgPlayerMuted', handlePlayerMuted ); - -//------------------------------------------------------------------------------ -// Siege-specific callbacks: -addMessageCallback( 'MsgSiegeHalftime', handleSiegeHalftimeMessage ); -addMessageCallback( 'MsgSiegeResult', handleSiegeResultMessage ); -addMessageCallback( 'MsgSiegeAddLine', handleSiegeLineMessage ); -//------------------------------------------------------------------------------ - -function HandleForceObserver( %msgType, %msgString ) -{ - -} - -function handleIveBeenBanned(%msgType, %msgString) -{ - DisconnectedCleanup(); -} - -function handleIveBeenKicked(%msgType, %msgString) -{ - DisconnectedCleanup(); -} - -function clientDeploySensorRed() -{ - deploySensor.color = "255 0 0"; - deploySensor.setVisible(true); -} - -function clientDeploySensorGrn() -{ - deploySensor.color = "0 255 0"; - deploySensor.setVisible(true); -} - -function clientDeploySensorOff() -{ - deploySensor.setVisible(false); -} - -function clientPackIconOff() -{ - backpackIcon.setBitmap(""); - backpackFrame.setVisible(false); - backpackText.setValue(""); - backpackText.setVisible(false); - backpackFrame.pack = false; -} - -function HandleBountyStreakMessage(%msgType, %msgString, %client, %streak, %award) -{ - %delay = alxGetWaveLen("fx/misc/bounty_bonus.wav"); - %overlap = 0.50; - - alxPlay(BountyBellSound, 0, 0, 0); //first bell - for (%loop = 1; %loop < %award; %loop++) //any repetitions, overlapped. - schedule((%delay * %loop) * %overlap, 0, "alxPlay", BountyBellSound, 0, 0, 0); -} - -function HandleLeaveMissionAreaAlarmMessage(%msgType, %msgString) -{ - //Tinman - sounds are now sent by the individual game script - //if(ServerConnection.OutOfBoundsHandle $= "") - // ServerConnection.OutOfBoundsHandle = alxPlay(OutOfBoundsSound, 0, 0, 0); -} - -function HandleEnterMissionAreaAlarmMessage(%msgType, %msgString) -{ - //Tinman - sounds are now sent by the individual game script - //if(ServerConnection.OutOfBoundsHandle !$= "") - // alxStop(ServerConnection.OutOfBoundsHandle); - // - //ServerConnection.OutOfBoundsHandle = ""; -} - -function handleDropInfoMessage( %msgType, %msgString, %map, %gameType, %serverName ) -{ - $clServerName = %serverName; - $clMissionName = %map; - $clMissionType = %gameType; -} - -function handleTeamListMessage( %msgType, %msgString, %teamCount, %teamList ) -{ - // Save off the team names: - $clTeamCount = %teamCount; - for ( %i = 0; %i < %teamCount; %i++ ) - $clTeamScore[%i + 1, 0] = getRecord( %teamList, %i ); - - // Initialize the lobby: - LobbyPlayerList.initColumns(); -} - -//---------------------------------------------------------------------------- - -function clientCmdStartEffect( %effect ) -{ - // Put in iterations - StartEffect( %effect ); -} - -function clientCmdStopEffect( %effect ) -{ - StopEffect( %effect ); -} - -function clientCmdPickTeam() -{ - -} - -function clientCmdMissionStartPhase1(%seq, %missionName, %musicTrack) -{ - echo( "got client StartPhase1..." ); - - // Reset the loading progress controls: - LoadingProgress.setValue( 0 ); - DB_LoadingProgress.setValue( 0 ); - LoadingProgressTxt.setValue( "LOADING MISSION" ); - DB_LoadingProgressTxt.setValue( "LOADING MISSION" ); - - clientCmdPlayMusic(%musicTrack); - commandToServer('MissionStartPhase1Done', %seq); - clientCmdResetCommandMap(); -} - -function clientCmdMissionStartPhase2(%seq) { - $ConstructionServerPretext = ""; - $ConstructionServerVersion = ""; - $ConstructionServerCredits = ""; - $ConstructionServerQVer = ""; - $ConstructionServerString = ""; - commandToServer('ConstructionQueryServer'); - commandToServer('ConstructionRegisterClient',"2"); - // clean some stuff up. - MessageHud.close(); - purgeResources(); - if (!$pref::NoClearConsole) - cls(); - commandToServer('MissionStartPhase2Done', %seq); -} - -function clientCmdQueryServerReply(%pretext,%version,%credits,%qVer) { - $ConstructionServerPretext = %pretext; - $ConstructionServerVersion = %version; - $ConstructionServerCredits = %credits; - $ConstructionServerQVer = %qVer; - $ConstructionServerString = %pretext SPC %version @ " - " @ %credits; - echo($ConstructionServerString @ " - (" @ %qVer @ ")"); -} - -function clientCmdMissionStartPhase3(%seq, %missionName) -{ - $MSeq = %seq; - - //Reset Inventory Hud... - if($Hud['inventoryScreen'] !$= "") - { - %favList = $Hud['inventoryScreen'].data[0, 1].type TAB $Hud['inventoryScreen'].data[0, 1].getValue(); - for ( %i = 1; %i < $Hud['inventoryScreen'].count; %i++ ) - if($Hud['inventoryScreen'].data[%i, 1].getValue() $= invalid) - %favList = %favList TAB $Hud['inventoryScreen'].data[%i, 1].type TAB "EMPTY"; - else - %favList = %favList TAB $Hud['inventoryScreen'].data[%i, 1].type TAB $Hud['inventoryScreen'].data[%i, 1].getValue(); - commandToServer( 'setClientFav', %favList ); - } - else - commandToServer( 'setClientFav', $pref::Favorite[$pref::FavCurrentSelect]); - - // needed? - $MissionName = %missionName; - //commandToServer( 'getScores' ); - - // only show dialog if actually lights - if(lightScene("sceneLightingComplete", $LaunchMode $= "SceneLight" ? "forceWritable" : "")) - { - error("beginning SceneLighting...."); - schedule(1, 0, "updateLightingProgress"); - $lightingMission = true; - LoadingProgress.setValue( 0 ); - DB_LoadingProgress.setValue( 0 ); - LoadingProgressTxt.setValue( "LIGHTING MISSION" ); - DB_LoadingProgressTxt.setValue( "LIGHTING MISSION" ); - $missionLightStarted = true; - Canvas.repaint(); - } -} - -function clientCmdMissionEnd(%seq) -{ - alxStopAll(); - // disable mission lighting if it's going (since the interiors will be gone in a sec) - $lightingMission = false; - $sceneLighting::terminateLighting = true; -} - -function clientCmdSetPowerAudioProfiles(%up, %down) -{ - setPowerAudioProfiles(%up, %down); -} - -function ghostAlwaysStarted(%ghostCount) -{ - echo( "starting to ghost " @ %ghostCount @ " server objects...."); - - LoadingProgress.setValue( 0 ); - DB_LoadingProgress.setValue( 0 ); - LoadingProgressTxt.setValue( "LOADING OBJECTS" ); - DB_LoadingProgressTxt.setValue( "LOADING OBJECTS" ); - Canvas.repaint(); - $ghostCount = %ghostCount; - $ghostsRecvd = 0; -} - -function ghostAlwaysObjectReceived() -{ - $ghostsRecvd++; - %pct = $ghostsRecvd / $ghostCount; - LoadingProgress.setValue( %pct ); - DB_LoadingProgress.setValue( %pct ); - Canvas.repaint(); -} - -function updateLightingProgress() -{ - if( $SceneLighting::lightingProgress == 0) - { - if($sceneLightStarted) - { - $sceneLightStarted = false; - } - else - $SceneLighting::lightingProgress = 1; - } - - LoadingProgress.setValue( $SceneLighting::lightingProgress ); - DB_LoadingProgress.setValue( $SceneLighting::lightingProgress ); - if($lightingMission) - $lightingProgressThread = schedule(1, 0, "updateLightingProgress"); -} - -function sceneLightingComplete() -{ - LoadingProgress.setValue( 1 ); - DB_LoadingProgress.setValue( 1 ); - - echo("Scenelighting done..."); - $lightingMission = false; - - cleanUpHuds(); - - if($LaunchMode $= "SceneLight") - { - quit(); - return; - } - - clientCmdResetHud(); - commandToServer('SetVoiceInfo', $pref::Audio::voiceChannels, $pref::Audio::decodingMask, $pref::Audio::encodingLevel); - commandToServer('EnableVehicleTeleport', $pref::Vehicle::pilotTeleport ); - commandToServer('MissionStartPhase3Done', $MSeq); -} - -function clientCmdSetVoiceInfo(%channels, %decodingMask, %encodingLevel) -{ - $Audio::serverChannels = %channels; - $Audio::serverDecodingMask = %decodingMask; - $Audio::serverEncodingLevel = %encodingLevel; -} - -function ClientReceivedDataBlock(%index, %total) -{ - %pct = %index / %total; - LoadingProgress.setValue( %pct ); - LoadingProgress.setValue( %pct ); - Canvas.repaint(); -} - -function GameConnection::onTargetLocked( %con, %state ) -{ - if( %state $= "true" ) - { - if( !%con.targetTone ) - %con.targetTone = alxPlay( "sLockedTone", 0, 0, 0 ); - } - else - { - if( %con.targetTone $= "" ) - return; - - if( %con.targetTone ) - alxStop( %con.targetTone ); - - %con.targetTone = ""; - } -} - -function GameConnection::onTrackingTarget( %con, %state ) -{ - if( %state $= "true" ) - { - if( !%con.trackingTargetTone ) - %con.trackingTargetTone = alxPlay( "sSearchingTone", 0, 0, 0 ); - } - else - { - if( %con.trackingTargetTone $= "" ) - return; - - if( %con.trackingTargetTone ) - alxStop( %con.trackingTargetTone ); - - %con.TrackingTargetTone = ""; - } -} - -function GameConnection::onLockWarning( %con, %state ) -{ - if( %state $= "true" ) - { - if( !%con.lockWarningTone ) - %con.lockWarningTone = alxPlay( "sMissileLockWarningTone", 0, 0, 0 ); - - } - else - { - if( %con.lockWarningTone $= "" ) - return; - - if( %con.lockWarningTone ) - alxStop( %con.lockWarningTone ); - - %con.lockWarningTone = ""; - } -} - -function GameConnection::onHomeWarning( %con, %state ) -{ - if( %state $= "true" ) - { - if( !%con.homeWarningTone ) - %con.homeWarningTone = alxPlay( "sMissileHomingWarningTone", 0, 0, 0 ); - } - else - { - if( %con.homeWarningTone $= "" ) - return; - - if( %con.homeWarningTone ) - alxStop( %con.homeWarningTone ); - - %con.homeWarningTone = ""; - } -} - -function GameConnection::initialControlSet(%this) -{ - if ( $LaunchMode $= "InteriorView" ) - { - Canvas.setContent( InteriorPreviewGui ); - return; - } - - if( $LaunchMode $= "TSShow" ) - { - Canvas.setContent( TSShowGui ); - return; - } - - if( Canvas.getContent() != PlayGui.getId() ) - { - Canvas.setContent( PlayGui ); - Canvas.pushDialog( MainChatHud ); - CommandToServer('PlayContentSet'); - } -} - -//------------------------------------------------------------------------------ -// Siege-specific client functions: -//------------------------------------------------------------------------------ -function handleSiegeHalftimeMessage( %msgType, %msgString ) -{ - alxPlay( SiegeSwitchSides, 0, 0, 0 ); - showTaskHudDlg( false ); - SiegeHalftimeText.setText( "" ); -} - -//------------------------------------------------------------------------------ -function handleSiegeResultMessage( %msgType, %msgString, %result ) -{ - SiegeHalftimeHeaderText.setText( "" @ detag( %result ) ); -} - -//------------------------------------------------------------------------------ -function handleSiegeLineMessage( %msgType, %msgString, %line ) -{ - %text = SiegeHalftimeText.getText(); - if ( %text $= "" ) - %newText = detag( %line ); - else - %newText = %text NL detag( %line ); - SiegeHalftimeText.setText( %newText ); -} - -//------------------------------------------------------------------------------ -function clientCmdSetHalftimeClock( %time ) -{ - SiegeHalftimeClock.setTime( %time ); -} - -//------------------------------------------------------------------------------ -function SiegeHalftimeHeaderText::onResize( %this, %width, %height ) -{ - %w = firstWord( SiegeHalftimeHeader.getExtent() ); - SiegeHalftimeHeader.setExtent( %w, %height + 6 ); - %paneHeight = getWord( siegeHalftimeHud.getExtent(), 1 ); - %x = firstWord( SiegeHalftimeScroll.getPosition() ); - %y = %height + 40; - %w = firstWord( SiegeHalftimeScroll.getExtent() ); - %h = %paneHeight - %height - 59; - SiegeHalftimeScroll.resize( %x, %y, %w, %h ); -} - -function reLightMission() { - if ($SceneLighting::lightingProgress == 0 || $SceneLighting::lightingProgress == 1) - lightScene("",forceAlways); -} - -function clientCmdReLightMission() { - if (!$pref::disallowRelight) - reLightMission(); -} diff --git a/Scripts/controlDefaults.cs b/Scripts/controlDefaults.cs deleted file mode 100644 index 06c3f60..0000000 --- a/Scripts/controlDefaults.cs +++ /dev/null @@ -1,1740 +0,0 @@ -if ( isObject( moveMap ) ) - moveMap.delete(); -new ActionMap(moveMap); - -$vehicletiltrate = 25; - -//------------------------------------------------------------------------------ -// Utility remap functions: -//------------------------------------------------------------------------------ -function ActionMap::copyBind( %this, %otherMap, %command ) -{ - if ( !isObject( %otherMap ) ) - { - error( "ActionMap::copyBind - \"" @ %otherMap @ "\" is not an object!" ); - return; - } - - %bind = %otherMap.getBinding( %command ); - if ( %bind !$= "" ) - { - %device = getField( %bind, 0 ); - %action = getField( %bind, 1 ); - %flags = %otherMap.isInverted( %device, %action ) ? "SDI" : "SD"; - %deadZone = %otherMap.getDeadZone( %device, %action ); - %scale = %otherMap.getScale( %device, %action ); - %this.bind( %device, %action, %flags, %deadZone, %scale, %command ); - } -} - -//------------------------------------------------------------------------------ -function ActionMap::blockBind( %this, %otherMap, %command ) -{ - if ( !isObject( %otherMap ) ) - { - error( "ActionMap::copyBind - \"" @ %otherMap @ "\" is not an object!" ); - return; - } - - %bind = %otherMap.getBinding( %command ); - if ( %bind !$= "" ) - %this.bind( getField( %bind, 0 ), getField( %bind, 1 ), "" ); -} - -//------------------------------------------------------------------------------ -// NON-REMAPPABLE BINDS: -function escapeFromGame() -{ - if(TaskHudDlg.isVisible()) - showTaskHudDlg(false); - - if ( $currentMissionType $= "SinglePlayer" ) - Canvas.pushDialog( SinglePlayerEscapeDlg ); - else - Canvas.setContent( LobbyGui ); -} - -function toggleEditor(%make) -{ - //editor should not be available in the demo version - if (isDemo()) - return; - - if(%make) - { - if(Canvas.getContent() == Editor.getId()) - Editor.close(); - else - Editor.open(); - } -} - -moveMap.bindCmd( keyboard, "escape", "", "escapeFromGame();" ); -moveMap.bind( keyboard, "alt e", toggleEditor ); - -//------------------------------------------------------------------------------ -$movementSpeed = 1; -function setSpeed(%speed) -{ - if(%speed) - $movementSpeed = %speed; -} - -function moveleft(%val) -{ - $mvLeftAction = %val; - if(%val) - commandToServer('checkHtilt',"left"); - else - commandToServer('checkendtilt'); -} - -function moveright(%val) -{ - $mvRightAction = %val; - if(%val) - commandToServer('checkHtilt',"right"); - else - commandToServer('checkendtilt'); -} - -function moveforward(%val) -{ - $mvForwardAction = %val; -} - -function movebackward(%val) -{ - $mvBackwardAction = %val; -} - -function moveup(%val) -{ - $mvUpAction = %val; -} - -function movedown(%val) -{ - $mvDownAction = %val; -} - -function turnLeft( %val ) -{ - $mvYawRightSpeed = %val ? $pref::Input::KeyboardTurnSpeed : 0; -} - -function turnRight( %val ) -{ - $mvYawLeftSpeed = %val ? $pref::Input::KeyboardTurnSpeed : 0; -} - -function panUp( %val ) -{ - $mvPitchDownSpeed = %val ? $pref::Input::KeyboardTurnSpeed : 0; -} - -function panDown( %val ) -{ - $mvPitchUpSpeed = %val ? $pref::Input::KeyboardTurnSpeed : 0; -} - -// based on a default camera fov of 90' -function getMouseAdjustAmount(%val) -{ - return(%val * ($cameraFov / 90) * 0.01); -} - -function yaw(%val) -{ - $mvYaw += getMouseAdjustAmount(%val); -} - -function pitch(%val) -{ - $mvPitch += getMouseAdjustAmount(%val); -} - -moveMap.bind( keyboard, s, moveleft ); -moveMap.bind( keyboard, f, moveright ); -moveMap.bind( keyboard, e, moveforward ); -moveMap.bind( keyboard, d, movebackward ); - -function toggleDepth(%val) -{ - if (%val) { - $testDepth = !$testDepth; - } -} - -function snLine(%val) { if(%val) snapLine(); } -function snToggle(%val) { if(%val) snapToggle(); } - -moveMap.bind( mouse, xaxis, yaw ); -moveMap.bind( mouse, yaxis, pitch ); -moveMap.bind( keyboard, space, jump ); -moveMap.bind( mouse, button0, mouseFire ); -moveMap.bind( mouse, button1, mouseJet ); -//moveMap.bind( keyboard, "shift a", altTrigger ); - -//------------------------------------------------------------------------------ -// MESSAGE HUD FUNCTIONS: -function pageMessageHudUp( %val ) -{ - if ( %val ) - pageUpMessageHud(); -} - -function pageMessageHudDown( %val ) -{ - if ( %val ) - pageDownMessageHud(); -} - -moveMap.bind( keyboard, "pageUp", pageMessageHudUp ); -moveMap.bind( keyboard, "pageDown", pageMessageHudDown ); - -//------------------------------------------------------------------------------ -function voiceCapture( %val ) -{ - if ( %val ) - voiceCapStart(); - else - voiceCapStop(); -} - -moveMap.bind(keyboard, x, voiceCapture); - -//------------------------------------------------------------------------------ -// WEAPON CYCLING FUNCTIONS: -function prevWeapon( %val ) -{ - if ( %val ) - commandToServer( 'cycleWeapon', "prev" ); -} - -function nextWeapon( %val ) -{ - if ( %val ) - commandToServer( 'cycleWeapon', "next" ); -} - -function cycleWeaponAxis( %val ) -{ - if ( %val < 0 ) - commandToServer( 'cycleWeapon', "next" ); - else - commandToServer( 'cycleWeapon', "prev" ); -} - -function cycleNextWeaponOnly( %val ) -{ - if ( %val < 0 ) - commandToServer( 'cycleWeapon', "next" ); -} - -moveMap.bind( keyboard, "shift w", prevWeapon ); -moveMap.bind( keyboard, w, nextWeapon ); -moveMap.bind( mouse, zaxis, cycleWeaponAxis ); - -function toggleFreeLook( %val ) -{ - if ( %val ) - $mvFreeLook = true; - else - $mvFreeLook = false; -} - -function useRepairKit( %val ) -{ - if ( %val ) - use( RepairKit ); -} - -function useBackPack( %val ) -{ - if ( %val ) - commandToServer( 'startUseBackpack', BackPack ); - else - commandToServer( 'endUseBackpack', BackPack ); -} - -function ServerCmdStartUseBackpack( %client, %data ) -{ - %client.deployPack = false; - %client.getControlObject().use( %data ); -} - -function ServerCmdEndUseBackpack( %client ) -{ - %client.deployPack = true; -} - -moveMap.bind( keyboard, z, toggleFreeLook ); -moveMap.bind( keyboard, q, useRepairKit ); -moveMap.bind( keyboard, r, useBackpack ); - -//------------------------------------------------------------------------------ -// WEAPON SLOT SELECTION FUNCTIONS: -function useFirstWeaponSlot( %val ) -{ - if ( %val ) - commandToServer( 'selectWeaponSlot', 0 ); -} - -function useSecondWeaponSlot( %val ) -{ - if ( %val ) - commandToServer( 'selectWeaponSlot', 1 ); -} - -function useThirdWeaponSlot( %val ) -{ - if ( %val ) - commandToServer( 'selectWeaponSlot', 2 ); -} - -function useFourthWeaponSlot( %val ) -{ - if ( %val ) - commandToServer( 'selectWeaponSlot', 3 ); -} - -function useFifthWeaponSlot( %val ) -{ - if ( %val ) - commandToServer( 'selectWeaponSlot', 4 ); -} - -function useSixthWeaponSlot( %val ) -{ - if ( %val ) - commandToServer( 'selectWeaponSlot', 5 ); -} - -moveMap.bind( keyboard, "1", useFirstWeaponSlot ); -moveMap.bind( keyboard, "2", useSecondWeaponSlot ); -moveMap.bind( keyboard, "3", useThirdWeaponSlot ); -moveMap.bind( keyboard, "4", useFourthWeaponSlot ); -moveMap.bind( keyboard, "5", useFifthWeaponSlot ); -moveMap.bind( keyboard, "6", useSixthWeaponSlot ); - -//------------------------------------------------------------------------------ -// DIRECT WEAPON SELECTION FUNCTIONS: -function useBlaster( %val ) -{ - if ( %val ) - use( Blaster ); -} - -function usePlasma( %val ) -{ - if ( %val ) - use( Plasma ); -} - -function useChaingun( %val ) -{ - if ( %val ) - use( Chaingun ); -} - -function useDisc( %val ) -{ - if ( %val ) - use( Disc ); -} - -function useGrenadeLauncher( %val ) -{ - if ( %val ) - use( GrenadeLauncher ); -} - -function useSniperRifle( %val ) -{ - if ( %val ) - use( SniperRifle ); -} - -function useELFGun( %val ) -{ - if ( %val ) - use( ELFGun ); -} - -function useMortar( %val ) -{ - if ( %val ) - use( Mortar ); -} - -function useMissileLauncher( %val ) -{ - if ( %val ) - use( MissileLauncher ); -} - -function useTargetingLaser( %val ) -{ - if ( %val ) - use( TargetingLaser ); -} - -function useShockLance( %val ) -{ - if ( %val ) - use( ShockLance ); -} - -function useConstructionTool(%val) -{ -if (%val) - use ( ConstructionTool ); -} - -function throwGrenade( %val ) -{ - if ( %val ) - commandToServer( 'startThrowCount' ); - else - commandToServer( 'endThrowCount' ); - $mvTriggerCount4 += $mvTriggerCount4 & 1 == %val ? 2 : 1; -} - -function placeMine( %val ) -{ - if ( %val ) - commandToServer( 'startThrowCount' ); - else - commandToServer( 'endThrowCount' ); - $mvTriggerCount5 += $mvTriggerCount5 & 1 == %val ? 2 : 1; -} - -function placeBeacon( %val ) -{ - if ( %val ) - use( Beacon); -} - -moveMap.bind( keyboard, g, throwGrenade ); -moveMap.bind( keyboard, b, placeMine ); -moveMap.bind( keyboard, h, placeBeacon ); -moveMap.bind( keyboard, l, useTargetingLaser ); - -function throwWeapon( %val ) -{ - if ( %val ) - commandToServer( 'throwWeapon' ); -} - -function throwPack( %val ) -{ - if ( %val ) - commandToServer('throwPack'); -} - -function throwFlag( %val ) -{ - // TR2: Allow variable strength passes - if (objectiveHud.gameType $= "TR2Game") - { - if ( %val ) - { - doFlagGauge(%val); - commandToServer( 'startFlagThrowCount' ); - - // Schedule to remove the HUD in 3 seconds. - $TR2HideGaugeThread = schedule(2500, 0, "hideFlagGauge"); - } - else - { - cancel($TR2HideGaugeThread); - commandToServer( 'endFlagThrowCount' ); - - // If we're still trying to throw it, throw it. Don't bother trying - // to remove this to get max toss flag throws...it doesn't work. - if ($TR2FGaugeThread > 0) - commandToServer('throwFlag'); - doFlagGauge(%val); - } - - // What's this global for? - //$mvTriggerCount6 += $mvTriggerCount6 & 1 == %val ? 2 : 1; - } - else if ( %val ) - commandToServer('throwFlag'); -} - -moveMap.bind( keyboard, "ctrl w", throwWeapon ); -moveMap.bind( keyboard, "ctrl r", throwPack ); -moveMap.bind( keyboard, "ctrl f", throwFlag ); - -function resizeChatHud( %val ) -{ - if ( %val ) - MainChatHud.nextChatHudLen(); -} - -moveMap.bind( keyboard, "p", resizeChatHud ); - -//------------------------------------------------------------------------------ -// ZOOM FUNCTIONS: -if($pref::player::currentFOV $= "") - $pref::player::currentFOV = 45; - -function setZoomFOV(%val) -{ - if(%val) - calcZoomFOV(); -} - -function toggleZoom( %val ) -{ - if ( %val ) - { - if(ZoomHud.isVisible()) - { - cancel(ZoomHud.hideThread); - hideZoomHud(); - } - $ZoomOn = true; - setFov( $pref::player::currentFOV ); - } - else - { - $ZoomOn = false; - setFov( $pref::player::defaultFov ); - } -} - -moveMap.bind(keyboard, t, setZoomFOV); -moveMap.bind(keyboard, a, toggleZoom); - -//------------------------------------------------------------------------------ -// INVENTORY FAVORITE FUNCTIONS: -function toggleInventoryHud( %val ) -{ - if ( %val ) - toggleCursorHuds('inventoryScreen'); -} - -function selectFavorite1( %val ) -{ - if ( %val ) - loadFavorite( 0, 1 ); -} - -function selectFavorite2( %val ) -{ - if ( %val ) - loadFavorite( 1, 1 ); -} - -function selectFavorite3( %val ) -{ - if ( %val ) - loadFavorite( 2, 1 ); -} - -function selectFavorite4( %val ) -{ - if ( %val ) - loadFavorite( 3, 1 ); -} - -function selectFavorite5( %val ) -{ - if ( %val ) - loadFavorite( 4, 1 ); -} - -function selectFavorite6( %val ) -{ - if ( %val ) - loadFavorite( 5, 1 ); -} - -function selectFavorite7( %val ) -{ - if ( %val ) - loadFavorite( 6, 1 ); -} - -function selectFavorite8( %val ) -{ - if ( %val ) - loadFavorite( 7, 1 ); -} - -function selectFavorite9( %val ) -{ - if ( %val ) - loadFavorite( 8, 1 ); -} - -function selectFavorite10( %val ) -{ - if ( %val ) - loadFavorite( 9, 1 ); -} - -function selectFavorite11( %val ) -{ - if ( %val ) - loadFavorite( 10, 1 ); -} - -function selectFavorite12( %val ) -{ - if ( %val ) - loadFavorite( 11, 1 ); -} - -function selectFavorite13( %val ) -{ - if ( %val ) - loadFavorite( 12, 1 ); -} - -function selectFavorite14( %val ) -{ - if ( %val ) - loadFavorite( 13, 1 ); -} - -function selectFavorite15( %val ) -{ - if ( %val ) - loadFavorite( 14, 1 ); -} - -function selectFavorite16( %val ) -{ - if ( %val ) - loadFavorite( 15, 1 ); -} - -function selectFavorite17( %val ) -{ - if ( %val ) - loadFavorite( 16, 1 ); -} - -function selectFavorite18( %val ) -{ - if ( %val ) - loadFavorite( 17, 1 ); -} - -function selectFavorite19( %val ) -{ - if ( %val ) - loadFavorite( 18, 1 ); -} - -function selectFavorite20( %val ) -{ - if ( %val ) - loadFavorite( 19, 1 ); -} - -moveMap.bind( keyboard, numpadenter, toggleInventoryHud ); -moveMap.bind( keyboard, numpad1, selectFavorite1 ); -moveMap.bind( keyboard, numpad2, selectFavorite2 ); -moveMap.bind( keyboard, numpad3, selectFavorite3 ); -moveMap.bind( keyboard, numpad4, selectFavorite4 ); -moveMap.bind( keyboard, numpad5, selectFavorite5 ); -moveMap.bind( keyboard, numpad6, selectFavorite6 ); -moveMap.bind( keyboard, numpad7, selectFavorite7 ); -moveMap.bind( keyboard, numpad8, selectFavorite8 ); -moveMap.bind( keyboard, numpad9, selectFavorite9 ); -moveMap.bind( keyboard, numpad0, selectFavorite10 ); - -moveMap.bind( keyboard, "shift numpad1", selectFavorite11 ); -moveMap.bind( keyboard, "shift numpad2", selectFavorite12 ); -moveMap.bind( keyboard, "shift numpad3", selectFavorite13 ); -moveMap.bind( keyboard, "shift numpad4", selectFavorite14 ); -moveMap.bind( keyboard, "shift numpad5", selectFavorite15 ); -moveMap.bind( keyboard, "shift numpad6", selectFavorite16 ); -moveMap.bind( keyboard, "shift numpad7", selectFavorite17 ); -moveMap.bind( keyboard, "shift numpad8", selectFavorite18 ); -moveMap.bind( keyboard, "shift numpad9", selectFavorite19 ); -moveMap.bind( keyboard, "shift numpad0", selectFavorite20 ); - -moveMap.bind( keyboard, "ctrl numpad0", quickPackEnergyPack ); -moveMap.bind( keyboard, "ctrl numpad1", quickPackRepairPack ); -moveMap.bind( keyboard, "ctrl numpad2", quickPackShieldPack ); -moveMap.bind( keyboard, "ctrl numpad3", quickPackCloakPack ); -moveMap.bind( keyboard, "ctrl numpad4", quickPackJammerPack ); -moveMap.bind( keyboard, "ctrl numpad5", quickPackAmmoPack ); -moveMap.bind( keyboard, "ctrl numpad6", quickPackSatchelCharge ); -moveMap.bind( keyboard, "ctrl numpad7", quickPackDeployableStation ); -moveMap.bind( keyboard, "ctrl numpad8", quickPackIndoorTurret ); -moveMap.bind( keyboard, "ctrl numpad9", quickPackOutdoorTurret ); -moveMap.bind( keyboard, "ctrl numpaddivide", quickPackMotionSensor ); -moveMap.bind( keyboard, "ctrl numpadmult", quickPackPulse ); - -function quickPackRepairPack(%val) -{ - if(%val) - addQuickPackFavorite("Repair Pack"); -} - -function quickPackEnergyPack(%val) -{ - if(%val) - addQuickPackFavorite("Energy Pack"); -} - -function quickPackShieldPack(%val) -{ - if(%val) - addQuickPackFavorite("Shield Pack"); -} - -function quickPackCloakPack(%val) -{ - if(%val) - addQuickPackFavorite("Cloak Pack"); -} - -function quickPackJammerPack(%val) -{ - if(%val) - addQuickPackFavorite("Sensor Jammer Pack"); -} - -function quickPackAmmoPack(%val) -{ - if(%val) - addQuickPackFavorite("Ammunition Pack"); -} - -function quickPackSatchelCharge(%val) -{ - if(%val) - addQuickPackFavorite("Satchel Charge"); -} - -function quickPackDeployableStation(%val) -{ - if(%val) - addQuickPackFavorite("Inventory Station"); -} - -function quickPackIndoorTurret(%val) -{ - if(%val) - addQuickPackFavorite("Spider Clamp Turret"); -} - -function quickPackOutdoorTurret(%val) -{ - if(%val) - addQuickPackFavorite("Landspike Turret"); -} - -function quickPackMotionSensor(%val) -{ - if(%val) - addQuickPackFavorite("Motion Sensor Pack"); -} - -function quickPackPulse(%val) -{ - if(%val) - addQuickPackFavorite("Pulse Sensor Pack"); -} - -function quickPackMortarBarrel(%val) -{ - if(%val) - addQuickPackFavorite("Mortar Turret Barrel"); -} - -function quickPackElfBarrel(%val) -{ - if(%val) - addQuickPackFavorite("ELF Turret Barrel"); -} - -function quickPackAABarrel(%val) -{ - if(%val) - addQuickPackFavorite("AA Turret Barrel"); -} - -function quickPackPlasmaBarrel(%val) -{ - if(%val) - addQuickPackFavorite("Plasma Turret Barrel"); -} - -function quickPackMissileBarrel(%val) -{ - if(%val) - addQuickPackFavorite("Missile Turret Barrel"); -} - -function quickPackFlashGrenade(%val) -{ - if(%val) - addQuickPackFavorite("Whiteout Grenade", grenade); -} - -function quickPackConcussionGrenade(%val) -{ - if(%val) - addQuickPackFavorite("Concussion Grenade", grenade); -} - -function quickPackGrenade(%val) -{ - if(%val) - addQuickPackFavorite("Grenade", grenade); -} - -function quickPackFlareGrenade(%val) -{ - if(%val) - addQuickPackFavorite("Flare Grenade", grenade); -} - -function quickPackCameraGrenade(%val) -{ - if(%val) - addQuickPackFavorite("Deployable Camera", grenade); -} - -// Construction -function quickPackLightSupportBeam(%val) { - if (%val) - addQuickPackFavorite("Light Support Beam", dep); -} - -function quickPackLightWalkway(%val) { - if (%val) - addQuickPackFavorite("Light Walkway", dep); -} - -function quickPackLightBlastWall(%val) { - if (%val) - addQuickPackFavorite("Light Blast Wall", dep); -} - -function quickPackMediumSupportBeam(%val) { - if (%val) - addQuickPackFavorite("Medium Support Beam", dep); -} - -function quickPackMediumFloor(%val) { - if (%val) - addQuickPackFavorite("Medium Floor", dep); -} - -function quickPackInventoryStation(%val) { - if (%val) - addQuickPackFavorite("Inventory Station", dep); -} - -function quickPackLargeInventoryStation(%val) { - if (%val) - addQuickPackFavorite("Large Inventory station", dep); -} - -function quickPackGeneratorPack(%val) { - if (%val) - addQuickPackFavorite("Generator Pack", dep); -} - -function quickPackSolarPanelPack(%val) { - if (%val) - addQuickPackFavorite("Solar Panel Pack", dep); -} - -function quickPackSwitchPack(%val) { - if (%val) - addQuickPackFavorite("Switch Pack", dep); -} - -function quickPackMediumSensorPack(%val) { - if (%val) - addQuickPackFavorite("Medium Sensor Pack", dep); -} - -function quickPackLargeSensorPack(%val) { - if (%val) - addQuickPackFavorite("Large Sensor Pack", dep); -} - -function quickPackTeleportPad(%val) { - if (%val) - addQuickPackFavorite("Teleport Pad", dep); -} - -function quickPackDeployableTurretBase(%val) { - if (%val) - addQuickPackFavorite("Deployable Turret Base", dep); -} - -function quickPackEnergizer(%val) { - if (%val) - addQuickPackFavorite("Energizer", dep); -} - -function quickPackTreePack(%val) { - if (%val) - addQuickPackFavorite("Tree Pack", dep); -} - -function quickPackCratePack(%val) { - if (%val) - addQuickPackFavorite("Crate Pack", dep); -} - -function quickPackDecorationPack(%val) { - if (%val) - addQuickPackFavorite("Decoration Pack", dep); -} - -function quickPackLightPack(%val) { - if (%val) - addQuickPackFavorite("Light Pack", dep); -} - -function quickPackTripwirePack(%val) { - if (%val) - addQuickPackFavorite("Tripwire Pack", dep); -} - -function quickPackLogoProjectorPack(%val) { - if (%val) - addQuickPackFavorite("Logo Projector Pack", dep); -} - -function quickPackForceField(%val) { - if (%val) - addQuickPackFavorite("Force Field", dep); -} - -function quickPackGravityField(%val) { - if (%val) - addQuickPackFavorite("Gravity Field", dep); -} - -function quickPackJumpPad(%val) { - if (%val) - addQuickPackFavorite("Jump Pad", dep); -} - -function quickPackEscapePod(%val) { - if (%val) - addQuickPackFavorite("Escape Pod", dep); -} - -function quickPackDiscTurret(%val) { - if (%val) - addQuickPackFavorite("Disc Turret"); -} - -function quickPackLaserTurret(%val) { - if (%val) - addQuickPackFavorite("Laser Turret"); -} - -function quickPackMissileRackTurret(%val) { - if (%val) - addQuickPackFavorite("Missile Rack Turret"); -} - -function cyclePackFwd(%val) { - if (%val) - commandToServer('CyclePackSetting',1); -} - -function cyclePackBack(%val) { - if (%val) - commandToServer('CyclePackSetting',-1); -} - -function cyclePackFFwd(%val) { - if (%val) - commandToServer('CyclePackSetting',5); -} - -function cyclePackFBack(%val) { - if (%val) - commandToServer('CyclePackSetting',-5); -} - -function serverCmdCyclePackSetting(%client,%val) { - %plyr = %client.player; - if (isObject(%plyr)) - cyclePackSetting(%plyr,%val); -} - -// Emotes -function emoteSitDown(%val) { - if (%val) - commandToServer('Emote',"SitDown"); -} - -function emoteSquat(%val) { - if (%val) - commandToServer('Emote',"Squat"); -} - -function emoteJig(%val) { - if (%val) - commandToServer('Emote',"Jig"); -} - -function emoteLieDown(%val) { - if (%val) - commandToServer('Emote',"LieDown"); -} - -function emoteHeartAttack(%val) { - if (%val) - commandToServer('Emote',"HeartAttack"); -} - -function emoteSuckerPunched(%val) { - if (%val) - commandToServer('Emote',"SuckerPunched"); -} - -function serverCmdEmote(%client,%anim) { - %plyr = %client.player; - if (isObject(%plyr)) { - switch$ (%anim) { - case "SitDown": - %plyr.setActionThread("sitting",true); - case "Squat": - %plyr.setActionThread("scoutRoot",true); - case "Jig": - %plyr.setActionThread("ski",true); - case "LieDown": - %plyr.setActionThread("death9",true); - case "HeartAttack": - %plyr.setActionThread("death8",true); - case "SuckerPunched": - %plyr.setActionThread("death11",true); - } - } -} - -// START DONS -function serverCmdcheckHtilt(%client,%direction){ - if(isObject(%client.player)){ - if(%client.player.mountedtoV){ - if(%client.player.Vmountedto.getdatablock().getname() $= "helicopter"){ - %veh = %client.player.Vmountedto; - %impulse = $vehicletiltrate; - if(%direction $= "left") - %impulse = %impulse * -1; - %client.tilting = 1; - %veh.tilt = schedule(50, 0, "tiltveh", %veh, %impulse, %client); - } - } - } -} - -function serverCmdcheckendtilt(%client){ - if(isObject(%client.player)){ - if(%client.player.mountedtoV){ - if(%client.player.Vmountedto.getdatablock().getname() $= "helicopter"){ - %client.tilting = 0; - } - } - } -} - -function tiltveh(%veh, %impulse, %client){ - if(!isObject(%veh)) - return; - if(%client.tilting == 1){ - %vec = vectornormalize(vectorcross(%veh.getForwardvector(),%veh.getUpvector())); - %imppos = vectoradd(%veh.getPosition(),%vec); - %veh.applyImpulse(%impPos,vectorscale(vectorNormalize(%veh.getUpvector()),(%impulse * -1))); - %veh.tilt = schedule(25, 0, "tiltveh", %veh, %impulse, %client); - } -} - -// NightVision -function toggleNightVision(%val) { - if (%val) - commandToServer('NightVision'); -} - -function serverCmdNightVision(%client) { - %plyr = %client.player; - %ArmorType = %plyr.getDatablock().getname(); - if(%ArmorType $= "SpecOpsMaleHumanArmor" || %ArmorType $= "SpecOpsFemaleHumanArmor" || %ArmorType $= "SpecOpsMaleBiodermArmor"){ - if(%plyr.NVActivated == 1){ - Cancel(%plyr.nightvision); - messageClient(%client, 'MsgNVon', '\c2Night Vision Deactivated.'); - %plyr.NVActivated = 0; - } - else{ - NightVisionLoop(%client); - messageClient(%client, 'MsgNVoff', '\c2Night Vision Activated.'); - %plyr.NVActivated = 1; - } - return; - } - - if (isObject(%plyr)) { - if (!(%client.NVActivated == 1)) - { - %plyr.mountImage(FlashLightImage, 7); - messageClient(%client, 'MsgNVon', '\c2Grabbing Flash Light.'); - %client.NVActivated = 1; - } - else if (%client.NVActivated == 1) - { - %plyr.unmountImage(7); - messageClient(%client, 'MsgNVoff', '\c2Holistering Flash Light.'); - %client.NVActivated = 0; - } - } -} - -$host::slowmodist = 100; - -function SlowMotion(%val) { - if (%val) - commandToServer('StartSM'); -} - -function serverCmdStartSM(%client){ - if (!isobject(%client.player)) - return; - %orgscale = $timescale; - %newScale = (%orgscale / 4); - commandToClient(%client, 'SetTimescale', %newScale, %orgscale, %client); - %pos = %client.player.getposition(); - %count = ClientGroup.getCount(); - for(%i = 0; %i < %count; %i++) - { - %cl = ClientGroup.getObject(%i); - if(isObject(%cl.player)){ - %testPos = %cl.player.getWorldBoxCenter(); - %distance = vectorDist(%pos, %testPos); - if (%distance > 0 && %distance < $host::slowmodist) - { - commandToClient(%cl, 'SetTimescale', %newScale, %orgscale); - } - } - } -} - -function clientCmdSetTimescale(%newScale, %orgscale) { - if(%newScale > 0.09 && %newScale < 1.1){ - $timescale = %newScale; - schedule(8000, 0, "resetTimescale", %orgscale); - } -} - -function ResetTimescale(%orgscale){ - $timescale = %orgScale; -} - -function doGrab(%val){ - if(%val) - commandToServer('DoGrab'); -} -// End DONS, End Construction - - -moveMap.bind( keyboard, tab, toggleFirstPerson ); -moveMap.bind( keyboard, u, ToggleMessageHud ); -moveMap.bind( keyboard, y, TeamMessageHud ); -moveMap.bind( keyboard, v, activateChatMenuHud ); - -function toggleCommanderMap( %val ) -{ - if ( %val ) - { - showTaskHudDlg(false); - CommanderMapGui.toggle(); - } -} - -moveMap.bind( keyboard, c, toggleCommanderMap ); -moveMap.bind( keyboard, "ctrl k", suicide ); - -function report(%val) -{ - if(%val) - commandToServer('report'); -} - -function suicide(%val) -{ - if (%val) - commandToServer('suicide'); -} - -function toggleFirstPerson(%val) -{ - if (%val) - { - $firstPerson = !$firstPerson; - hudFirstPersonToggled(); - } -} - -function toggleCamera(%val) -{ - if (%val) - commandToServer('ToggleCamera'); -} - -function dropPlayerAtCamera(%val) -{ - if (%val) - commandToServer('DropPlayerAtCamera'); -} - -function dropCameraAtPlayer(%val) -{ - if (%val) - commandToServer('dropCameraAtPlayer'); -} - -function dropPlayerAtCamera(%val) -{ - if (%val) - commandToServer('DropPlayerAtCamera'); -} - -function togglePlayerRace(%val) -{ - if (%val) - commandToServer('ToggleRace'); -} - -function togglePlayerGender(%val) -{ - if (%val) - commandToServer('ToggleGender'); -} - -function togglePlayerArmor(%val) -{ - if (%val) - commandToServer('ToggleArmor'); -} - -function jump(%val) -{ - //$mvTriggerCount2++; - $mvTriggerCount2 += (($mvTriggerCount2 & 1) == %val) ? 2 : 1; -} - -// moveMap.bind(keyboard, "alt c", playCel); -// moveMap.bind(keyboard, "alt a", toggleArmor); -// moveMap.bind(keyboard, "alt d", playDeath); - -//function playCel(%val) -//{ -// if (%val) -// commandToServer('playCel',%anim); -//} - -//function playDeath(%val) -//{ -// if (%val) -// commandToServer('playDeath',%anim); -//} - -function mouseFire(%val) -{ - $mvTriggerCount0 += (($mvTriggerCount0 & 1) == %val) ? 2 : 1; -} - -function mouseJet(%val) -{ - $mvTriggerCount3 += (($mvTriggerCount3 & 1) == %val) ? 2 : 1; -} - -function altTrigger(%val) -{ - $mvTriggerCount1 += (($mvTriggerCount1 & 1) == %val) ? 2 : 1; -} - -function testLOSTarget() -{ - ServerConnection.sendLOSTarget(); - commandToServer('TestLOS'); -} - -function serverCmdTestLOS(%client) -{ - %client.sendTargetTo(%client); - %msg = 'This is a simple test.'; - messageClient(%client, 'TestMsg', %msg); -} - -//------------------------------------------------------------------------------ -function toggleHelpGui( %val ) -{ - if ( %val ) - toggleHelpText(); -} - -function toggleScoreScreen( %val ) -{ - if ( %val ) - toggleCursorHuds('scoreScreen'); -} - -moveMap.bind( keyboard, F1, toggleHelpGui ); -moveMap.bind( keyboard, F2, toggleScoreScreen ); - -//------------------------------------------------------------------------------ -// DEMO RECORD FUNCTIONS: -function startRecordingDemo( %val ) -{ - if ( %val ) - beginDemoRecord(); -} - -function stopRecordingDemo( %val ) -{ - if ( %val ) - stopDemoRecord(); -} - -if ( !isDemo() ) -{ - moveMap.bind( keyboard, F3, startRecordingDemo ); - moveMap.bind( keyboard, F4, stopRecordingDemo ); -} - -//------------------------------------------------------------------------------ -// NAV HUD DISPLAY FUNCTIONS: -function toggleHudWaypoints(%val) -{ - if(%val) - navHud.setMarkerTypeVisible(ClientWaypoint, !navHud.isMarkerTypeVisible(ClientWaypoint)); -} - -function toggleHudMarkers(%val) -{ - if(%val) - navHud.setMarkerTypeVisible(MissionWaypoint, !navHud.isMarkerTypeVisible(MissionWaypoint)); -} - -function toggleHudTargets(%val) -{ - if(%val) - { - %visible = navHud.isMarkerTypeVisible(Target); - PlayGui.beaconsVisible = !%visible; - navHud.setMarkerTypeVisible(Target, !%visible); - } -} - -function toggleHudCommands(%val) -{ - if(%val) - { - %visible = navHud.isMarkerTypeVisible(PotentialTask); - navHud.setMarkerTypeVisible(PotentialTask, !%visible); - navHud.setMarkerTypeVisible(AssignedTask, !%visible); - } -} - -moveMap.bind( keyboard, F6, toggleHudWaypoints ); -moveMap.bind( keyboard, F7, toggleHudMarkers ); -moveMap.bind( keyboard, F8, toggleHudCommands ); -moveMap.bind( keyboard, F9, toggleHudTargets ); - -//------------------------------------------------------------------------------ -// TASK FUNCTIONS: -function fnAcceptTask( %val ) -{ - if ( %val ) - clientAcceptCurrentTask(); -} - -function fnDeclineTask( %val ) -{ - if ( %val ) - clientDeclineCurrentTask(); -} - -function fnTaskCompleted( %val ) -{ - if ( %val ) - clientTaskCompleted(); -} - -function fnResetTaskList( %val ) -{ - if ( %val ) - TaskList.reset(); -} - -// tasks -moveMap.bind( keyboard, n, toggleTaskListDlg ); -moveMap.bind( keyboard, "enter", fnAcceptTask ); -moveMap.bind( keyboard, "backspace", fnDeclineTask ); -moveMap.bind( keyboard, "shift c", fnTaskCompleted ); -moveMap.bind( keyboard, "shift x", fnResetTaskList ); - -// misc: -moveMap.bind( keyboard, "ctrl n", toggleNetDisplayHud ); - -//------------------------------------------------------------------------------ -// VOTING FUNCTIONS: -function voteYes( %val ) -{ - if ( %val ) - setPlayerVote( true ); -} - -function voteNo( %val ) -{ - if ( %val ) - setPlayerVote( false ); -} - -moveMap.bind( keyboard, insert, voteYes ); -moveMap.bind( keyboard, delete, voteNo ); - -/////////////////////// -// Observer Keys -/////////////////////// -if ( isObject( observerMap ) ) - observerMap.delete(); -new ActionMap( observerMap ); -observerMap.bind( keyboard, t, moveup ); -observerMap.bind( keyboard, b, movedown ); -observerMap.bind( keyboard, space, jump ); -observerMap.bind( mouse, button0, mouseFire ); -observerMap.bind( mouse, button1, mouseJet ); - -if(!isDemo()) -{ - observerMap.copyBind(moveMap, startRecordingDemo); - observerMap.copyBind(moveMap, stopRecordingDemo); -} - -/////////////////////// -// Vehicle Keys -/////////////////////// -function clientCmdSetWeaponryVehicleKeys() -{ - %bind = moveMap.getBinding( nextWeapon ); - passengerKeys.bind( getField( %bind, 0 ), getField( %bind, 1 ), nextVehicleWeapon ); - - %bind = moveMap.getBinding( prevWeapon ); - passengerKeys.bind( getField( %bind, 0 ), getField( %bind, 1 ), prevVehicleWeapon ); - - %bind = moveMap.getBinding( cycleWeaponAxis ); - passengerKeys.bind( getField( %bind, 0 ), getField( %bind, 1 ), cycleVehicleWeapon ); - - %bind = moveMap.getBinding( cycleNextWeaponOnly ); - passengerKeys.bind( getField( %bind, 0 ), getField( %bind, 1 ), cycleNextVehicleWeaponOnly ); - - passengerKeys.bind( keyboard, 1, useWeaponOne ); - passengerKeys.bind( keyboard, 2, useWeaponTwo ); - passengerKeys.bind( keyboard, 3, useWeaponThree ); -} - -function clientCmdSetPilotVehicleKeys() -{ - passengerKeys.copyBind( moveMap, toggleFirstPerson ); - passengerKeys.copyBind( moveMap, toggleFreeLook ); - passengerKeys.copyBind( moveMap, mouseJet ); - - // Use the InvertVehicleYAxis pref: - if ( $pref::Vehicle::InvertYAxis ) - { - %bind = moveMap.getBinding( pitch ); - %device = getField( %bind, 0 ); - %action = getField( %bind, 1 ); - %flags = moveMap.isInverted( %device, %action ) ? "SD" : "SDI"; - %deadZone = moveMap.getDeadZone( %device, %action ); - %scale = moveMap.getScale( %device, %action ); - passengerKeys.bind( %device, %action, %flags, %deadZone, %scale, pitch ); - } -} - -function clientCmdSetPassengerVehicleKeys() -{ - passengerKeys.copyBind( moveMap, toggleZoom ); - passengerKeys.copyBind( moveMap, setZoomFOV ); - passengerKeys.copyBind( moveMap, toggleScoreScreen ); -} - -function clientCmdSetDefaultVehicleKeys(%inVehicle) -{ - if ( %inVehicle ) - { - if ( isObject( passengerKeys ) ) - { - passengerKeys.pop(); - passengerKeys.delete(); - } - new ActionMap( passengerKeys ); - - // Bind all of the movement keys: - passengerKeys.copyBind( moveMap, moveleft ); - passengerKeys.copyBind( moveMap, moveright ); - passengerKeys.copyBind( moveMap, moveforward ); - passengerKeys.copyBind( moveMap, movebackward ); - passengerKeys.copyBind( moveMap, mouseFire ); - passengerKeys.copyBind( moveMap, yaw ); - passengerKeys.copyBind( moveMap, pitch ); - passengerKeys.copyBind( moveMap, turnLeft ); - passengerKeys.copyBind( moveMap, turnRight ); - passengerKeys.copyBind( moveMap, panUp ); - passengerKeys.copyBind( moveMap, panDown ); - passengerKeys.copyBind( moveMap, jump ); - passengerKeys.copyBind( moveMap, setZoomFOV ); - passengerKeys.copyBind( moveMap, toggleZoom ); - - // Copy the joystick binds as well: - passengerKeys.copyBind( moveMap, joyPitch ); - passengerKeys.copyBind( moveMap, joyYaw ); - passengerKeys.copyBind( moveMap, joystickMoveX ); - passengerKeys.copyBind( moveMap, joystickMoveY ); - - // Bind the chat keys as well: - passengerKeys.copyBind( moveMap, ToggleMessageHud ); - passengerKeys.copyBind( moveMap, TeamMessageHud ); - passengerKeys.copyBind( moveMap, resizeChatHud ); - passengerKeys.copyBind( moveMap, pageMessageHudUp ); - passengerKeys.copyBind( moveMap, pageMessageHudDown ); - passengerKeys.copyBind( moveMap, activateChatMenuHud ); - passengerKeys.copyBind( moveMap, voiceCapture ); - - // Miscellaneous other binds: - passengerKeys.copyBind( moveMap, useBackpack ); - passengerKeys.copyBind( moveMap, useRepairKit ); - passengerKeys.copyBind( moveMap, suicide ); - passengerKeys.copyBind( moveMap, voteYes ); - passengerKeys.copyBind( moveMap, voteNo ); - passengerKeys.copyBind( moveMap, toggleCommanderMap ); - passengerKeys.bindCmd( keyboard, escape, "", "escapeFromGame();" ); - passengerKeys.copyBind( moveMap, toggleHelpGui ); - passengerKeys.copyBind( moveMap, toggleScoreScreen ); - passengerKeys.copyBind( moveMap, toggleNetDisplayHud ); - - // Bind the weapon keys as well: - passengerKeys.copyBind( moveMap, nextWeapon ); - passengerKeys.copyBind( moveMap, prevWeapon ); - passengerKeys.copyBind( moveMap, cycleWeaponAxis ); - passengerKeys.copyBind( moveMap, cycleNextWeaponOnly ); - - passengerKeys.copyBind( moveMap, useFirstWeaponSlot ); - passengerKeys.copyBind( moveMap, useSecondWeaponSlot ); - passengerKeys.copyBind( moveMap, useThirdWeaponSlot ); - passengerKeys.copyBind( moveMap, useFourthWeaponSlot ); - passengerKeys.copyBind( moveMap, useFifthWeaponSlot ); - passengerKeys.copyBind( moveMap, useSixthWeaponSlot ); - - // Bind individual weapons as well: - passengerKeys.copyBind( moveMap, useBlaster ); - passengerKeys.copyBind( moveMap, usePlasma ); - passengerKeys.copyBind( moveMap, useChaingun ); - passengerKeys.copyBind( moveMap, useDisc ); - passengerKeys.copyBind( moveMap, useGrenadeLauncher ); - passengerKeys.copyBind( moveMap, useSniperRifle ); - passengerKeys.copyBind( moveMap, useELFGun ); - passengerKeys.copyBind( moveMap, useMortar ); - passengerKeys.copyBind( moveMap, useMissileLauncher ); - passengerKeys.copyBind( moveMap, useTargetingLaser ); - passengerKeys.copyBind( moveMap, useShockLance ); - passengerKeys.copyBind( moveMap, throwGrenade ); - passengerKeys.copyBind( moveMap, placeMine ); - - // Bind the command assignment/response keys as well: - passengerKeys.copyBind( moveMap, toggleTaskListDlg ); - passengerKeys.copyBind( moveMap, fnAcceptTask ); - passengerKeys.copyBind( moveMap, fnDeclineTask ); - passengerKeys.copyBind( moveMap, fnTaskCompleted ); - passengerKeys.copyBind( moveMap, fnResetTaskList ); - - // grab the demo recorder binds - passengerKeys.copyBind( moveMap, startRecordingDemo ); - passengerKeys.copyBind( moveMap, stopRecordingDemo ); - } - else if ( isObject( passengerKeys ) ) - { - passengerKeys.pop(); - passengerKeys.delete(); - } -} - -function useWeaponOne(%val) -{ - if(%val) - commandToServer('setVehicleWeapon', 1); -} - -function useWeaponTwo(%val) -{ - if(%val) - commandToServer('setVehicleWeapon', 2); -} - -function useWeaponThree(%val) -{ - if(%val) - commandToServer('setVehicleWeapon', 3); -} - -function serverCmdSetVehicleWeapon(%client, %num) -{ - %turret = %client.player.getControlObject(); - if(%turret.getDataBlock().numWeapons < %num) - return; - %turret.selectedWeapon = %num; - - //%hudNum = %turret.getDataBlock().getHudNum(%num); - //%client.setVWeaponsHudActive(%hudNum); - %client.setVWeaponsHudActive(%num); - - // set the active image on the client's obj - if(%num == 1) - %client.setObjectActiveImage(%turret, 2); - else if(%num == 2) - %client.setObjectActiveImage(%turret, 4); - else - %client.setObjectActiveImage(%turret, 6); - - // if firing then set the proper image trigger - if(%turret.fireTrigger) - { - if(%num == 1) - { - %turret.setImageTrigger(4, false); - if(%turret.getImageTrigger(6)) - { - %turret.setImageTrigger(6, false); - ShapeBaseImageData::deconstruct(%turret.getMountedImage(6), %turret); - } - %turret.setImageTrigger(2, true); - } - else if( %num == 2) - { - %turret.setImageTrigger(2, false); - if(%turret.getImageTrigger(6)) - { - %turret.setImageTrigger(6, false); - ShapeBaseImageData::deconstruct(%turret.getMountedImage(6), %turret); - } - %turret.setImageTrigger(4, true); - } - else - { - %turret.setImageTrigger(2, false); - %turret.setImageTrigger(4, false); - } - } -} - -function nextVehicleWeapon(%val) -{ - if ( %val ) - commandToServer('switchVehicleWeapon', "next"); -} - -function prevVehicleWeapon(%val) -{ - if ( %val ) - commandToServer('switchVehicleWeapon', "prev"); -} - -function cycleVehicleWeapon( %val ) -{ - if ( %val < 0 ) - commandToServer( 'switchVehicleWeapon', "next" ); - else - commandToServer( 'switchVehicleWeapon', "prev" ); -} - -function cycleNextVehicleWeaponOnly( %val ) -{ - if ( %val < 0 ) - commandToServer( 'switchVehicleWeapon', "next" ); -} - -function serverCmdSwitchVehicleWeapon(%client, %dir) -{ - %turret = %client.player.getControlObject(); - %weaponNum = %turret.selectedWeapon; - if(%dir $= "next") - { - if(%weaponNum++ > %turret.getDataBlock().numWeapons) - %weaponNum = 1; - } - else - { - if(%weaponNum-- < 1) - %weaponNum = %turret.getDataBlock().numWeapons; - } - serverCmdSetVehicleWeapon(%client, %weaponNum); -} - - -/////////////////////// -//Station -/////////////////////// -function clientCmdSetStationKeys(%inStation) -{ - if ( %inStation ) - { - if ( isObject( stationMap ) ) - { - stationMap.pop(); - stationMap.delete(); - } - new ActionMap( stationMap ); - stationMap.blockBind( moveMap, toggleInventoryHud ); - stationMap.bind( keyboard, escape, "" ); - stationMap.push(); - } - else if ( isObject( stationMap ) ) - { - stationMap.pop(); - stationMap.delete(); - } -} - -function shutServerDown(){ - commandToServer('noobserverSD'); -} - -$MFDebugRenderMode = 0; -function cycleDebugRenderMode() -{ - if($MFDebugRenderMode == 0) - { - show(); - GLEnableOutline(true); - $MFDebugRenderMode = 1; - } - else if ($MFDebugRenderMode == 1) - { - GLEnableOutline(false); - setInteriorRenderMode(7); - $MFDebugRenderMode = 2; - } - else if ($MFDebugRenderMode == 2) - { - setInteriorRenderMode(0); - GLEnableOutline(false); - showTri(); - $MFDebugRenderMode = 0; - } -} - -// Since the toggle console key is remappable, put it here: -if (!isDemo()) - GlobalActionMap.bind(keyboard, "grave", toggleConsole); diff --git a/Scripts/creditsGui.cs b/Scripts/creditsGui.cs deleted file mode 100644 index e3dda2e..0000000 --- a/Scripts/creditsGui.cs +++ /dev/null @@ -1,144 +0,0 @@ -function LaunchCredits() -{ - Canvas.setContent(CreditsGui); -} - -function cancelCredits() -{ - //delete the action map - CreditsActionMap.pop(); - - //kill the schedules - cancel($CreditsScrollSchedule); - cancel($CreditsSlideShow); - - //kill the music - MusicPlayer.stop(); - - //load the launch gui back... - Canvas.setContent(LaunchGui); - - //delete the contents of the ML ctrl so as to free up memory... - Credits_Text.setText(""); -} - -function CreditsGui::onWake(%this) -{ - //create an action map to use "esc" to exit the credits screen... - if (!isObject(CreditsActionMap)) - { - new ActionMap(CreditsActionMap); - CreditsActionMap.bindCmd(keyboard, anykey, "cancelCredits();", ""); - CreditsActionMap.bindCmd(keyboard, space, "cancelCredits();", ""); - CreditsActionMap.bindCmd(keyboard, escape, "cancelCredits();", ""); - CreditsActionMap.bindCmd(mouse, button0, "$CreditsPaused = true;", "$CreditsPaused = false;"); - CreditsActionMap.bindCmd(mouse, button1, "$CreditsSpeedUp = true;", "$CreditsSpeedUp = false;"); - if (!isDemo()) - CreditsActionMap.bindCmd(mouse, button2, "creditsNextPic();", ""); - } - CreditsActionMap.push(); - - //build the ML text ctrl... - exec("scripts/creditsText.cs"); - if (!isDemo()) - { - $CreditsPicIndex = 1; - CREDITS_Pic.setBitmap("gui/ACCM_" @ $CreditsPicIndex @ ".png"); - } - else - CREDITS_Pic.setBitmap("gui/ACCM_1.png"); - - //music array - if (!isDemo()) - { - $CreditsMusic[0] = "ACCM_Warrior"; - $CreditsMusic[1] = "ACCM_Warrior"; - $CreditsMusic[2] = "ACCM_Warrior"; - $CreditsMusic[3] = "ACCM_Warrior"; - $CreditsMusic[4] = "ACCM_Warrior"; - } - else - { - $CreditsMusic[0] = "lush"; - $CreditsMusic[1] = "desert"; - $CreditsMusic[2] = "desert"; - $CreditsMusic[3] = "lush"; - $CreditsMusic[4] = "desert"; - } - - //start the credits from the beginning - $CreditsOffset = 0.0; - %screenHeight = getWord(getResolution(), 1); - Credits_Text.resize(getWord(Credits_Text.position, 0), - mFloor(%screenHeight / 2) - 125, - getWord(Credits_Text.extent, 0), - getWord(Credits_Text.extent, 1)); - - //start the scrolling - $CreditsPaused = false; - $CreditsSpeedUp = false; - $CreditsScrollSchedule = schedule(3000, 0, scrollTheCredits); - - //start cycling the bitmaps - if (!isDemo()) - $CreditsSlideShow = schedule(5000, 0, creditsNextPic); - - //start some music - %chooseTrack = mFloor(getRandom() * 4.99); - MusicPlayer.playTrack($CreditsMusic[%chooseTrack]); -} - -function addCreditsLine(%text, %lastLine) -{ - CREDITS_Text.addText(%text @ "\n", %lastline); -} - -function scrollTheCredits() -{ - //make sure we're not paused - if (!$CreditsPaused) - { - //if we've scrolled off the top, set the position back down to the bottom - %parentCtrl = CREDITS_Text.getGroup(); - if (getWord(Credits_Text.position, 1) + getWord(Credits_Text.extent, 1) < 0) - { - Credits_Text.position = getWord(Credits_Text.position, 0) SPC getWord(%parentCtrl.extent, 1); - $CreditsOffset = getWord(Credits_Text.position, 1); - } - - if ($CreditsSpeedUp) - %valueToScroll = 10; - else - %valueToScroll = 1; - - //scroll the control up a bit - Credits_Text.resize(getWord(Credits_Text.position, 0), - getWord(Credits_Text.position, 1) - %valueToScroll, - getWord(Credits_Text.extent, 0), - getWord(Credits_Text.extent, 1)); - } - - //schedule the next scroll... - $CreditsScrollSchedule = schedule(30, 0, scrollTheCredits); -} - -function creditsNextPic() -{ - //no slide show in the demo... - if (isDemo()) - return; - - cancel($CreditsSlideShow); - if (!$CreditsPaused) - { - $CreditsPicIndex += 1; - if ($CreditsPicIndex > 10) - $CreditsPicindex = 1; - - //set the bitmap - CREDITS_Pic.setBitmap("gui/ACCM_" @ $CreditsPicIndex @ ".png"); - } - - //schedule the next bitmap - $CreditsSlideShow = schedule(5000, 0, creditsNextPic); -} diff --git a/Scripts/editor.cs b/Scripts/editor.cs deleted file mode 100644 index b12737c..0000000 --- a/Scripts/editor.cs +++ /dev/null @@ -1,113 +0,0 @@ -//----------------------------------------------------------------------------- -// Torque Game Engine -// -// Copyright (c) 2001 GarageGames.Com -// Portions Copyright (c) 2001 by Sierra Online, Inc. -//----------------------------------------------------------------------------- - - -//------------------------------------------------------------------------------ -// Hard coded images referenced from C++ code -//------------------------------------------------------------------------------ - -// editor/SelectHandle.png -// editor/DefaultHandle.png -// editor/LockedHandle.png - - -//------------------------------------------------------------------------------ -// Functions -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ -// Mission Editor -//------------------------------------------------------------------------------ - -function Editor::create() -{ - // Not much to do here, build it and they will come... - // Only one thing... the editor is a gui control which - // expect the Canvas to exist, so it must be constructed - // before the editor. - new EditManager(Editor) - { - profile = "GuiContentProfile"; - horizSizing = "right"; - vertSizing = "top"; - position = "0 0"; - extent = "640 480"; - minExtent = "8 8"; - visible = "1"; - setFirstResponder = "0"; - modal = "1"; - helpTag = "0"; - open = false; - }; -} - - -function Editor::onAdd(%this) -{ - // Basic stuff - exec("scripts/cursors.cs"); - exec("scripts/EditorProfiles.cs"); - - // Tools - exec("scripts/editor.bind.cs"); - exec("gui/ObjectBuilderGui.gui"); - - // New World Editor - exec("gui/EditorGui.gui"); - exec("scripts/EditorGui.cs"); - exec("gui/AIEWorkingDlg.gui"); - - // World Editor - exec("gui/WorldEditorSettingsDlg.gui"); - - // Terrain Editor - exec("gui/TerrainEditorVSettingsGui.gui"); - exec("gui/HelpDlg.gui"); - exec("scripts/help.cs"); - - // do gui initialization... - EditorGui.init(); - - // - exec("scripts/editorRender.cs"); -} - -function Editor::checkActiveLoadDone() -{ - if(isObject(EditorGui) && EditorGui.loadingMission) - { - Canvas.setContent(EditorGui); - EditorGui.loadingMission = false; - return true; - } - return false; -} - -//------------------------------------------------------------------------------ -function toggleEditor(%make) -{ - if (%make) - { - if (!$missionRunning) - { - MessageBoxOK("Mission Required", "You must load a mission before starting the Mission Editor.", ""); - return; - } - -// $testcheats = 1; - if (!isObject(Editor)) - { - Editor::create(); - MissionCleanup.add(Editor); - } - if (Canvas.getContent() == EditorGui.getId()) - Editor.close(); - else - Editor.open(); - } -} - diff --git a/Scripts/gameBase.cs b/Scripts/gameBase.cs deleted file mode 100644 index ddee682..0000000 --- a/Scripts/gameBase.cs +++ /dev/null @@ -1,147 +0,0 @@ - -function GameBaseData::onAdd(%data, %obj) -{ - if(%data.targetTypeTag !$= "") - { - // use the name given to the object in the mission file - if(%obj.nameTag !$= "") - { - %obj.nameTag = addTaggedString(%obj.nameTag); - %nameTag = %obj.nameTag; - } - else - %nameTag = %data.targetNameTag; - - %obj.target = createTarget(%obj, %nameTag, "", "", %data.targetTypeTag, 0, 0); - } - else - %obj.target = -1; -} - -function GameBaseData::onRemove(%data, %obj) -{ - %target = %obj.getTarget(); - - // first 32 targets are team targets - if(%target >= 32) - { - if(%obj.nameTag !$= "") - removeTaggedString(%obj.nameTag); - freeTarget(%target); - } -} - -function InteriorInstance::damage() -{ -} - -function TerrainBlock::damage() -{ -} - -function WaterBlock::damage() { -} - -function ForceFieldBare::damage(%this, %sourceObject, %position, %amount, %damageType) { - %this.getDataBlock().damageObject(%this, %sourceObject, %position, %amount, %damageType); -} - -function ForceFieldBareData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) { - StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType); -} - -function ForceFieldBare::applyDamage(%obj,%amount,%sourceObject,%position,%damageType) { - %dataBlockName = %obj.getDataBlock().getName(); - if (getSubStr(%dataBlockName,0,18) $= "DeployedForceField" || getSubStr(%dataBlockName,0,20) $= "DeployedGravityField") { - %count = getWordCount($PowerList); - for(%i=0;%i<%count;%i++) { - %powerObj = getWord($PowerList,%i); - if (genPoweringObj(%powerObj,%obj)) - %powerList = %powerList SPC %powerObj; - } - %powerList = trim(%powerList); - %genDamage = (%amount * 1) / getWordCount(%powerList); - %count = getWordCount(%powerList); - for(%i=0;%i<%count;%i++) { - %powerObj = getWord(%powerList,%i); - %mult = (1 - 0.05) + (getRandom() * 0.10); - %powerObj.damage(%sourceObject,%position,%genDamage * %mult,%damageType); - } - } -} - -function ForceFieldBare::isEnabled() { - // created to prevent console errors -} - -function GameBaseData::shouldApplyImpulse(%data, %obj) -{ - return %data.shouldApplyImpulse; -} - - -function ShapeBaseData::onAdd(%data, %obj) -{ - Parent::onAdd(%data, %obj); - // if it's a deployed object, schedule the ambient thread to play in a little while - if(%data.deployAmbientThread) - %obj.schedule(750, "playThread", $AmbientThread, "ambient"); - // check for ambient animation that should always be played - if(%data.alwaysAmbient) - %obj.playThread($AmbientThread, "ambient"); -} - -function SimObject::setOwnerClient(%obj, %cl) -{ - %obj.client = %cl; -} - -function SimObject::getOwnerClient(%obj) -{ - if(isObject(%obj)) - return %obj.client; - return 0; -} - // recursive objective init functions for mission group - -function SimGroup::objectiveInit(%this) -{ - for (%i = 0; %i < %this.getCount(); %i++) - %this.getObject(%i).objectiveInit(); -} - -function SimObject::objectiveInit(%this) -{ -} - -function GameBase::objectiveInit(%this) -{ - //error("Initializing object " @ %this @ ", " @ %this.getDataBlock().getName()); - %this.getDataBlock().objectiveInit(%this); -} - -// tag strings are ignored if they start with an underscore -function GameBase::getGameName(%this) -{ - %name = ""; - - if(%this.nameTag !$= "") - %name = %this.nameTag; - else - { - %name = getTaggedString(%this.getDataBlock().targetNameTag); - if((%name !$= "") && (getSubStr(%name, 0, 1) $= "_")) - %name = ""; - } - - %type = getTaggedString(%this.getDataBlock().targetTypeTag); - if((%type !$= "") && (getSubStr(%type, 0, 1) !$= "_")) - { - if(%name !$= "") - return(%name @ " " @ %type); - else - return(%type); - } - - return(%name); -} diff --git a/Scripts/serverCommanderMap.cs b/Scripts/serverCommanderMap.cs deleted file mode 100644 index 62e17e6..0000000 --- a/Scripts/serverCommanderMap.cs +++ /dev/null @@ -1,373 +0,0 @@ -//------------------------------------------------------------------------------ -// Object control -//------------------------------------------------------------------------------ -function getControlObjectType(%obj,%user) -{ - // turrets (camera is a turret) - if (%obj.getType() & $TypeMasks::TurretObjectType) - { - %barrel = %obj.getMountedImage(0); - if (isObject(%barrel)) - return(addTaggedString(%barrel.getName())); - } - - // unknown - return('Unknown'); -} - -function serverCmdControlObject(%client, %targetId) -{ - // match started: - if (!$MatchStarted) - { - commandToClient(%client, 'ControlObjectResponse', false, "mission has not started."); - return; - } - - // object: - %obj = getTargetObject(%targetId); - if (%obj == -1) - { - commandToClient(%client, 'ControlObjectResponse', false, "failed to find target object."); - return; - } - - // shapebase: - if (!(%obj.getType() & $TypeMasks::ShapeBaseObjectType)) - { - commandToClient(%client, 'ControlObjectResponse', false, "object cannot be controlled."); - return; - } - - // can control: - if (!%obj.getDataBlock().canControl) - { - commandToClient(%client, 'ControlObjectResponse', false, "object cannot be controlled."); - return; - } - - // check damage: - if (%obj.getDamageState() !$= "Enabled") - { - commandToClient(%client, 'ControlObjectResponse', false, "object is " @ %obj.getDamageState()); - return; - } - - // powered: - if (!%obj.isPowered()) - { - commandToClient(%client, 'ControlObjectResponse', false, "object is not powered."); - return; - } - - // controlled already: - %control = %obj.getControllingClient(); - if (%control) - { - if (%control == %client) - commandToClient(%client, 'ControlObjectResponse', false, "you are already controlling that object."); - else - commandToClient(%client, 'ControlObjectResponse', false, "someone is already controlling that object."); - return; - } - - // same team? - if (getTargetSensorGroup(%targetId) != %client.getSensorGroup()) - { - commandToClient(%client, 'ControlObjectResonse', false, "cannot control enemy objects."); - return; - } - - // dead? - if (%client.player == 0 && getTargetDataBlock(%targetId).getName() !$= "TurretPrisonCamera") { - commandToClient(%client, 'ControlObjectResponse', false, "dead people cannot control objects."); - return; - } - - if (%client.isJailed) { - return; - } - - // turret in purebuild mode? - if ((%obj.getType() & $TypeMasks::TurretObjectType) - && $Host::Purebuild == 1 - && !(%client.isAdmin || %client.isSuperAdmin) - && %obj.getDataBlock().getName() !$= "TurretDeployedCamera" - && %obj.getDataBlock().getName() !$= "TurretPrisonCamera") { - commandToClient(%client, 'ControlObjectResponse', false, "cannot control turrets in purebuild mode."); - return; - } - -//[[CHANGE]]Make sure you can command a bomber... and ride it the same time ;) - - //mounted in a vehicle? - //if (%client.player.isMounted()) - //{ - // commandToClient(%client, 'ControlObjectResponse', false, "can't control objects while mounted in a vehicle."); - // return; - //} - - %client.setControlObject(%obj); - commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%obj,%client.player)); - %objName = getTaggedString(getTargetName(%obj.target)) SPC getTaggedString(getTargetType(%obj.target)); - if (%obj $= "") - %objName = %obj.getDataBlock().getName(); - if ($Host::Purebuild == 1) - messageAll('msgClient','\c2%1 is now controlling %2.',%client.name,%objName); - else - messageTeam(%client.team,'msgClient','\c2%1 is now controlling %2.',%client.name,%objName); - -//[[CHANGE]] Make sure the controlled object knows how is controlling it. - %obj.clientControl = %client; - -///[[CHANGE]] Includes the remote station functionality. - - if (%obj.getType() & $TypeMasks::StationObjectType) - { -//Lost of commented stuff... should not be nessesary. - %colObj = %client.player; - //%colObj.inStation = true; - - //commandToClient(%colObj.client,'setStationKeys', true); - messageClient(%colObj.client, 'CloseHud', "", 'inventoryScreen'); - //commandToClient(%colObj.client, 'TogglePlayHuds', true); - %obj.triggeredBy = %colObj; - //%obj.getDataBlock().stationTriggered(%obj, 1); - %colObj.station = %obj; - //%colObj.lastWeapon = ( %colObj.getMountedImage($WeaponSlot) == 0 ) ? "" : %colObj.getMountedImage($WeaponSlot).getName().item; - //%colObj.unmountImage($WeaponSlot); - // Make sure none of the other popup huds are active: - //messageClient( %obj.triggeredBy.client, 'CloseHud', "", 'scoreScreen' ); - //messageClient( %obj.triggeredBy.client, 'CloseHud', "", 'inventoryScreen' ); - //Make sure the client doesn't transport.. but does get command. - %client.telebuy = 1; - - - //Stuff from observing - %data = %obj.getDataBlock(); - - %obsData = %data.observeParameters; - %obsX = firstWord(%obsData); - %obsY = getWord(%obsData, 1); - %obsZ = getWord(%obsData, 2); - - // don't set the camera mode so that it does not interfere with spawning - %transform = %obj.getTransform(); - - // create a fresh camera to observe through... (could add to a list on - // the observed camera to be removed when that object dies/...) - - if ( !isObject( %client.comCam ) ) - { - %client.comCam = new Camera() - { - dataBlock = CommanderCamera; - }; - MissionCleanup.add(%client.comCam); - } - - %client.comCam.setTransform(%transform); - %client.comCam.setOrbitMode(%obj, %transform, %obsX, %obsY, %obsZ); - - %client.setControlObject(%client.comCam); - commandToClient(%client, 'CameraAttachResponse', true); - - //Display the Vehicle Station GUI - //%client.player.AttachBeacon(); - //%client.player.schedule(20000,"RemoveBeacon"); - //%client.player.scheduel(1000,RemoveBeacon()); - - commandToClient(%obj.triggeredBy.client, 'StationVehicleShowHud'); - } - if (isObject(%client.player)) { - %client.player.RemoveBeacon(); - %client.player.AttachBeacon(); - } -//[[End CHANGE]] -} - -//[[CHANGE]] Pretty straigh forward functions. -function Player::AttachBeacon(%obj) -{ - %beacon = new BeaconObject(){ - datablock = BomberBeacon; - }; - if (%obj.team == 1) - %team = 2; - else - %team = 1; - %beacon.team = %team; - %beacon.owner = %obj; - %beacon.setTarget(%team); - %obj.mountObject(%beacon, 4); - %obj.enemyBeacon = %beacon; - MissionCleanup.add(%beacon); - %beacon.setBeaconType(enemy); -} -function Player::RemoveBeacon(%obj) -{ -if (%obj.enemybeacon) - %obj.enemyBeacon.delete(); - %obj.enemyBeacon = ""; -} -//[[End CHANGE]] -//------------------------------------------------------------------------------ -// TV Functions -//------------------------------------------------------------------------------ -function resetControlObject(%client) { - if ( isObject( %client.comCam ) ) - %client.comCam.delete(); - if (isObject(%client.player) && !%client.player.isDestroyed() && $MatchStarted) - %client.setControlObject(%client.player); - else - %client.setControlObject(%client.camera); - - // [[CHANGE]] make sure all is reset. - if (isObject(%client.player)) { - %client.player.station.triggeredBy = ""; - %client.player.station = ""; - %client.player.RemoveBeacon(); - } -} - -function serverCmdResetControlObject(%client) { - resetControlObject(%client); - commandToClient(%client, 'ControlObjectReset'); - // -------------------------------------------------------- - // z0dd - ZOD 4/18/02. Vehicle reticle disappearance fix. - // commandToClient(%client, 'RemoveReticle'); - //if(isObject(%client.player)) - //{ - // %weapon = %client.player.getMountedImage($WeaponSlot); - // %client.setWeaponsHudActive(%weapon.item); - //} - if(isObject(%client.player)) - { - if(%client.player.isPilot() || %client.player.isWeaponOperator()) - { - return; - } - else - { - commandToClient(%client, 'RemoveReticle'); - %weapon = %client.player.getMountedImage($WeaponSlot); - %client.setWeaponsHudActive(%weapon.item); - } - } - // End z0dd - ZOD - // -------------------------------------------------------- - - // [[CHANGE]] make sure all is reset. - if (isObject(%client.player)) { - %client.player.station.triggeredBy = ""; - %client.player.station = ""; - %client.player.RemoveBeacon(); - } -} - -function serverCmdAttachCommanderCamera(%client, %target) -{ - // dont allow observing until match has started - if (!$MatchStarted) - { - commandToClient(%client, 'CameraAttachResponse', false); - return; - } - - %obj = getTargetObject(%target); - if ((%obj == -1) || (%target == -1)) - { - commandToClient(%client, 'CameraAttachResponse', false); - return; - } - - // shape base object? - if (!(%obj.getType() & $TypeMasks::ShapeBaseObjectType)) - { - commandToClient(%client, 'CameraAttachResponse', false); - return; - } - - // can be observed? - if (!%obj.getDataBlock() || !%obj.getDataBlock().canObserve) - { - commandToClient(%client, 'CameraAttachResponse', false); - return; - } - - // same team? - if (getTargetSensorGroup(%target) != %client.getSensorGroup()) - { - commandToClient(%client, 'CameraAttachResponse', false); - return; - } - - // powered? - if (!%obj.isPowered()) - { - commandToClient(%client, 'CameraAttachResponse', false); - return; - } - - // client connection? - if (%obj.getClassName() $= "GameConnection") - { - %player = %obj.player; - if (%obj == %client) - { - if (isObject(%player) && !%player.isDestroyed()) - { - - %client.setControlObject(%player); - commandToClient(%client, 'CameraAttachResponse', true); - return; - } - } - - %obj = %player; - } - - if (!isObject(%obj) || %obj.isDestroyed()) - { - commandToClient(%client, 'CameraAttachResponse', false); - return; - } - - %data = %obj.getDataBlock(); - - %obsData = %data.observeParameters; - %obsX = firstWord(%obsData); - %obsY = getWord(%obsData, 1); - %obsZ = getWord(%obsData, 2); - - // don't set the camera mode so that it does not interfere with spawning - %transform = %obj.getTransform(); - - // create a fresh camera to observe through... (could add to a list on - // the observed camera to be removed when that object dies/...) - if ( !isObject( %client.comCam ) ) - { - %client.comCam = new Camera() - { - dataBlock = CommanderCamera; - }; - MissionCleanup.add(%client.comCam); - } - - %client.comCam.setTransform(%transform); - %client.comCam.setOrbitMode(%obj, %transform, %obsX, %obsY, %obsZ); - - %client.setControlObject(%client.comCam); - commandToClient(%client, 'CameraAttachResponse', true); -} - -//------------------------------------------------------------------------------ -// Scoping -function serverCmdScopeCommanderMap(%client, %scope) -{ - if (%scope) - resetControlObject(%client); - %client.scopeCommanderMap(%scope); - - commandToClient(%client, 'ScopeCommanderMap', %scope); -} \ No newline at end of file diff --git a/Scripts/serverDefaults.cs b/Scripts/serverDefaults.cs deleted file mode 100644 index eefa511..0000000 --- a/Scripts/serverDefaults.cs +++ /dev/null @@ -1,178 +0,0 @@ -$Host::teamskin[0] = "base"; -$Host::teamskin[1] = "basebbot"; -$Host::teamskin[2] = "basebot"; -$Host::teamskin[3] = "beagle"; -$Host::teamskin[4] = "dsword"; -$Host::teamskin[5] = "cotp"; -$Host::teamskin[6] = "swolf"; - -$Host::teamname[0] = "Outcasts"; -$Host::teamname[1] = "Constructors"; -$Host::teamname[2] = "Builders"; -$Host::teamname[3] = "Admins"; -$Host::teamname[4] = "Rebels"; -$Host::teamname[5] = "Rouges"; -$Host::teamname[6] = "Zombies"; - -$Host::holoName[0] = ""; -$Host::holoName[1] = "Storm"; -$Host::holoName[2] = "Inferno"; -$Host::holoName[3] = "Starwolf"; -$Host::holoName[4] = "DSword"; -$Host::holoName[5] = "BloodEagle"; -$Host::holoName[6] = "Harbinger"; - -// Demo-specific preferences: -if ( isDemo() ) -{ - $Host::GameName = "Tribes 2 Demo Server"; - $Host::Info = "This is a Tribes 2 Demo Server."; - $Host::Map = "SlapDash"; - $Host::MaxPlayers = 32; -} -else -{ - $Host::GameName = "ACCM Server"; - $Host::Info = "This is an ACCM server."; - $Host::Map = "Lost World"; - $Host::MaxPlayers = 20; -} - -$Host::AdminList = ""; -$Host::SuperAdminList = ""; -$Host::BindAddress = ""; -$Host::Port = 28000; -$Host::Password = ""; -$Host::AdminPassword = ""; -$Host::PureServer = 1; -$Host::Dedicated = 0; -$Host::MissionType = "Infection"; -$Host::TimeLimit = 30; -$Host::BotCount = 2; -$Host::BotsEnabled = 0; -$Host::MinBotDifficulty = 0.5; -$Host::MaxBotDifficulty = 0.75; -$Host::NoSmurfs = 0; -$Host::VoteTime = 30; // amount of time before votes are calculated -$Host::VotePassPercent = 60; // percent needed to pass a vote -$Host::KickBanTime = 60; // specified in seconds -$Host::BanTime = 1800; // specified in seconds -$Host::PlayerRespawnTimeout = 60; // time before a dead player is forced into observer mode -$Host::warmupTime = 20; -$Host::TournamentMode = 0; -$Host::allowAdminPlayerVotes = 0; -$Host::FloodProtectionEnabled = 0; -$Host::MaxMessageLen = 120; -$Host::VoteSpread = 20; -$Host::TeamDamageOn = 0; -$Host::Siege::Halftime = 20000; -$Host::CRCTextures = 0; - -// Construction-specific defaults. -$Host::ACCMChatLogging = 1; -$Host::ACCMEchoChat = 1; -$Host::AdminOnlyFadeObject = 0; -$Host::AllowKeeperPlayerVotes = 1; -$Host::AntidoteStationMaxAntidotes = 20; -$Host::Cascade = 0; -$Host::ExpertMode = 1; -$Host::Hazard::Enabled = 0; -$Host::InvincibleArmors = 0; -$Host::InvincibleDeployables = 1; -$Host::KeepersGetMakerAbility = 1; -$Host::LockedTeams = "0"; -$Host::NoAnnoyingVoiceChatSpam = 0; -$Host::NoInfection = 0; -$Host::NoPulseSCG = 0; -$Host::ObserversCannotChat = 1; -$Host::OnlyOwnerCascade = 1; -$Host::OnlyOwnerCubicReplace = 1; -$Host::OnlyOwnerDeconstruct = 1; -$Host::OnlyOwnerRotate = 1; -$Host::Prison::DeploySpam = 0; -$Host::Prison::DeploySpamCheckTimeMS = 1000; -$Host::Prison::DeploySpamMaxTime = 300; -$Host::Prison::DeploySpamMultiply = 1; -$Host::Prison::DeploySpamRemoveRecentMS = 15000; -$Host::Prison::DeploySpamResetWarnCountTime = 30; -$Host::Prison::DeploySpamTime = 60; -$Host::Prison::DeploySpamWarnings = 10; -$Host::Prison::Enabled = 0; -$Host::Prison::JailMode = 0; -$Host::Prison::Kill = 0; -$Host::Prison::KillTime = 120; -$Host::Prison::ReleaseMode = 1; -$Host::Prison::TeamKill = 0; -$Host::Purebuild = 0; -$Host::SADProtection = 1; -$Host::StationHoldTime = 1600; // Specified in seconds. -$Host::SuperAdminPassword = ""; -$Host::Vehicles = 1; - -// 0: .v12 (1.2 kbits/sec), 1: .v24 (2.4 kbits/sec), 2: .v29 (2.9kbits/sec) -// 3: GSM (6.6 kbits/sec) -$Audio::maxEncodingLevel = 3; -$Audio::maxVoiceChannels = 2; - -$Host::MapPlayerLimits["Abominable", "CnH"] = "-1 -1"; -$Host::MapPlayerLimits["AgentsOfFortune", "TeamHunters"] = "-1 32"; -$Host::MapPlayerLimits["Alcatraz", "Siege"] = "-1 48"; -$Host::MapPlayerLimits["Archipelago", "CTF"] = "16 -1"; -$Host::MapPlayerLimits["AshesToAshes", "CnH"] = "16 -1"; -$Host::MapPlayerLimits["BeggarsRun", "CTF"] = "-1 32"; -$Host::MapPlayerLimits["Caldera", "Siege"] = "-1 48"; -$Host::MapPlayerLimits["CasernCavite", "Hunters"] = "-1 32"; -$Host::MapPlayerLimits["CasernCavite", "DM"] = "-1 32"; -$Host::MapPlayerLimits["CasernCavite", "Bounty"] = "-1 32"; -$Host::MapPlayerLimits["Damnation", "CTF"] = "-1 32"; -$Host::MapPlayerLimits["DeathBirdsFly", "CTF"] = "8 -1"; -$Host::MapPlayerLimits["Desiccator", "CTF"] = "-1 -1"; -$Host::MapPlayerLimits["DustToDust", "CTF"] = "-1 32"; -$Host::MapPlayerLimits["DustToDust", "Hunters"] = "-1 32"; -$Host::MapPlayerLimits["DustToDust", "TeamHunters"] = "-1 32"; -$Host::MapPlayerLimits["Equinox", "CnH"] = "-1 -1"; -$Host::MapPlayerLimits["Equinox", "DM"] = "-1 32"; -$Host::MapPlayerLimits["Escalade", "Hunters"] = "8 -1"; -$Host::MapPlayerLimits["Escalade", "TeamHunters"] = "8 -1"; -$Host::MapPlayerLimits["Escalade", "DM"] = "16 -1"; -$Host::MapPlayerLimits["Escalade", "Bounty"] = "16 32"; -$Host::MapPlayerLimits["Escalade", "Rabbit"] = "16 -1"; -$Host::MapPlayerLimits["Firestorm", "CTF"] = "-1 24"; -$Host::MapPlayerLimits["Firestorm", "CnH"] = "-1 24"; -$Host::MapPlayerLimits["Flashpoint", "CnH"] = "-1 -1"; -$Host::MapPlayerLimits["Gauntlet", "Siege"] = "-1 32"; -$Host::MapPlayerLimits["Gehenna", "Hunters"] = "-1 -1"; -$Host::MapPlayerLimits["Gehenna", "TeamHunters"] = "-1 -1"; -$Host::MapPlayerLimits["Icebound", "Siege"] = "-1 -1"; -$Host::MapPlayerLimits["Insalubria", "CnH"] = "-1 32"; -$Host::MapPlayerLimits["JacobsLadder", "CnH"] = "-1 -1"; -$Host::MapPlayerLimits["Katabatic", "CTF"] = "-1 48"; -$Host::MapPlayerLimits["Masada", "Siege"] = "-1 32"; -$Host::MapPlayerLimits["Minotaur", "CTF"] = "-1 32"; -$Host::MapPlayerLimits["Myrkwood", "Hunters"] = "-1 32"; -$Host::MapPlayerLimits["Myrkwood", "DM"] = "-1 32"; -$Host::MapPlayerLimits["Myrkwood", "Rabbit"] = "-1 32"; -$Host::MapPlayerLimits["Oasis", "DM"] = "-1 32"; -$Host::MapPlayerLimits["Overreach", "CnH"] = "8 -1"; -$Host::MapPlayerLimits["Quagmire", "CTF"] = "-1 -1"; -$Host::MapPlayerLimits["Rasp", "TeamHunters"] = "-1 32"; -$Host::MapPlayerLimits["Rasp", "Bounty"] = "-1 32"; -$Host::MapPlayerLimits["Recalescence", "CTF"] = "16 -1"; -$Host::MapPlayerLimits["Respite", "Siege"] = "-1 32"; -$Host::MapPlayerLimits["Reversion", "CTF"] = "-1 -1"; -$Host::MapPlayerLimits["Rimehold", "Hunters"] = "8 -1"; -$Host::MapPlayerLimits["Rimehold", "Hunters"] = "8 -1"; -$Host::MapPlayerLimits["Riverdance", "CTF"] = "-1 -1"; -$Host::MapPlayerLimits["Sanctuary", "CTF"] = "-1 -1"; -$Host::MapPlayerLimits["Sirocco", "CnH"] = "8 -1"; -$Host::MapPlayerLimits["Slapdash", "CTF"] = "-1 -1"; -$Host::MapPlayerLimits["SunDried", "DM"] = "8 -1"; -$Host::MapPlayerLimits["SunDried", "Bounty"] = "8 -1"; -$Host::MapPlayerLimits["Talus", "Bounty"] = "-1 32"; -$Host::MapPlayerLimits["ThinIce", "CTF"] = "-1 -1"; -$Host::MapPlayerLimits["Tombstone", "CTF"] = "-1 -1"; -$Host::MapPlayerLimits["UltimaThule", "Siege"] = "8 -1"; -$Host::MapPlayerLimits["Underhill", "DM"] = "-1 -1"; -$Host::MapPlayerLimits["Underhill", "Bounty"] = "-1 32"; -$Host::MapPlayerLimits["Whiteout", "DM"] = "8 -1"; -$Host::MapPlayerLimits["Whiteout", "Bounty"] = "8 -1"; diff --git a/Scripts/CombatConGame.cs b/scripts/CombatConGame.cs similarity index 100% rename from Scripts/CombatConGame.cs rename to scripts/CombatConGame.cs diff --git a/Scripts/ConstructionGame.cs b/scripts/ConstructionGame.cs similarity index 100% rename from Scripts/ConstructionGame.cs rename to scripts/ConstructionGame.cs diff --git a/Scripts/InfectionGame.cs b/scripts/InfectionGame.cs similarity index 100% rename from Scripts/InfectionGame.cs rename to scripts/InfectionGame.cs diff --git a/Scripts/JTLmeteorStorm.cs b/scripts/JTLmeteorStorm.cs similarity index 100% rename from Scripts/JTLmeteorStorm.cs rename to scripts/JTLmeteorStorm.cs diff --git a/Scripts/TR2Game.cs b/scripts/TR2Game.cs similarity index 100% rename from Scripts/TR2Game.cs rename to scripts/TR2Game.cs diff --git a/Scripts/admin.cs b/scripts/admin.cs similarity index 100% rename from Scripts/admin.cs rename to scripts/admin.cs diff --git a/Scripts/ai.cs b/scripts/ai.cs similarity index 100% rename from Scripts/ai.cs rename to scripts/ai.cs diff --git a/Scripts/aiDefaultTasks.cs b/scripts/aiDefaultTasks.cs similarity index 100% rename from Scripts/aiDefaultTasks.cs rename to scripts/aiDefaultTasks.cs diff --git a/Scripts/aiInventory.cs b/scripts/aiInventory.cs similarity index 100% rename from Scripts/aiInventory.cs rename to scripts/aiInventory.cs diff --git a/Scripts/chatCommands.cs b/scripts/chatCommands.cs similarity index 100% rename from Scripts/chatCommands.cs rename to scripts/chatCommands.cs diff --git a/Scripts/creditsText.cs b/scripts/creditsText.cs similarity index 100% rename from Scripts/creditsText.cs rename to scripts/creditsText.cs diff --git a/Scripts/dEffects.cs b/scripts/dEffects.cs similarity index 100% rename from Scripts/dEffects.cs rename to scripts/dEffects.cs diff --git a/Scripts/damageTypes.cs b/scripts/damageTypes.cs similarity index 100% rename from Scripts/damageTypes.cs rename to scripts/damageTypes.cs diff --git a/Scripts/Data/MessageData.cs b/scripts/data/messagedata.cs similarity index 100% rename from Scripts/Data/MessageData.cs rename to scripts/data/messagedata.cs diff --git a/Scripts/Data/PulseData.cs b/scripts/data/pulsedata.cs similarity index 100% rename from Scripts/Data/PulseData.cs rename to scripts/data/pulsedata.cs diff --git a/Scripts/Data/VariableDefaults.cs b/scripts/data/variabledefaults.cs similarity index 100% rename from Scripts/Data/VariableDefaults.cs rename to scripts/data/variabledefaults.cs diff --git a/Scripts/deathMessages.cs b/scripts/deathMessages.cs similarity index 100% rename from Scripts/deathMessages.cs rename to scripts/deathMessages.cs diff --git a/Scripts/defaultGame.cs b/scripts/defaultGame.cs similarity index 100% rename from Scripts/defaultGame.cs rename to scripts/defaultGame.cs diff --git a/Scripts/deployables.cs b/scripts/deployables.cs similarity index 100% rename from Scripts/deployables.cs rename to scripts/deployables.cs diff --git a/Scripts/do_not_delete/Dfunctions.cs.dso b/scripts/do_not_delete/Dfunctions.cs.dso similarity index 100% rename from Scripts/do_not_delete/Dfunctions.cs.dso rename to scripts/do_not_delete/Dfunctions.cs.dso diff --git a/Scripts/do_not_delete/MergeToolSupport.cs.dso b/scripts/do_not_delete/MergeToolSupport.cs.dso similarity index 100% rename from Scripts/do_not_delete/MergeToolSupport.cs.dso rename to scripts/do_not_delete/MergeToolSupport.cs.dso diff --git a/Scripts/do_not_delete/loadscreen.cs.dso b/scripts/do_not_delete/loadscreen.cs.dso similarity index 100% rename from Scripts/do_not_delete/loadscreen.cs.dso rename to scripts/do_not_delete/loadscreen.cs.dso diff --git a/Scripts/expertLibraries.cs b/scripts/expertLibraries.cs similarity index 100% rename from Scripts/expertLibraries.cs rename to scripts/expertLibraries.cs diff --git a/Scripts/forceField.cs b/scripts/forceField.cs similarity index 100% rename from Scripts/forceField.cs rename to scripts/forceField.cs diff --git a/Scripts/functions.cs b/scripts/functions.cs similarity index 100% rename from Scripts/functions.cs rename to scripts/functions.cs diff --git a/Scripts/hazard.cs b/scripts/hazard.cs similarity index 100% rename from Scripts/hazard.cs rename to scripts/hazard.cs diff --git a/Scripts/hfunctions.cs b/scripts/hfunctions.cs similarity index 100% rename from Scripts/hfunctions.cs rename to scripts/hfunctions.cs diff --git a/Scripts/hud.cs b/scripts/hud.cs similarity index 100% rename from Scripts/hud.cs rename to scripts/hud.cs diff --git a/Scripts/inventory.cs b/scripts/inventory.cs similarity index 100% rename from Scripts/inventory.cs rename to scripts/inventory.cs diff --git a/Scripts/inventoryHud.cs b/scripts/inventoryHud.cs similarity index 100% rename from Scripts/inventoryHud.cs rename to scripts/inventoryHud.cs diff --git a/Scripts/ion.cs b/scripts/ion.cs similarity index 100% rename from Scripts/ion.cs rename to scripts/ion.cs diff --git a/Scripts/item.cs b/scripts/item.cs similarity index 100% rename from Scripts/item.cs rename to scripts/item.cs diff --git a/Scripts/libraries.cs b/scripts/libraries.cs similarity index 100% rename from Scripts/libraries.cs rename to scripts/libraries.cs diff --git a/Scripts/loadMenu.cs b/scripts/loadMenu.cs similarity index 100% rename from Scripts/loadMenu.cs rename to scripts/loadMenu.cs diff --git a/Scripts/mapGame.cs b/scripts/mapGame.cs similarity index 100% rename from Scripts/mapGame.cs rename to scripts/mapGame.cs diff --git a/Scripts/message.cs b/scripts/message.cs similarity index 100% rename from Scripts/message.cs rename to scripts/message.cs diff --git a/Scripts/ModScripts/AI/DroneAI.cs b/scripts/modscripts/ai/drone.cs similarity index 100% rename from Scripts/ModScripts/AI/DroneAI.cs rename to scripts/modscripts/ai/drone.cs diff --git a/Scripts/ModScripts/AI/S11AI.cs b/scripts/modscripts/ai/s11.cs similarity index 100% rename from Scripts/ModScripts/AI/S11AI.cs rename to scripts/modscripts/ai/s11.cs diff --git a/Scripts/ModScripts/AI/S17AI.cs b/scripts/modscripts/ai/s17.cs similarity index 100% rename from Scripts/ModScripts/AI/S17AI.cs rename to scripts/modscripts/ai/s17.cs diff --git a/Scripts/ModScripts/ChatCommands/AdminCommands.cs b/scripts/modscripts/chatcommands/admin.cs similarity index 100% rename from Scripts/ModScripts/ChatCommands/AdminCommands.cs rename to scripts/modscripts/chatcommands/admin.cs diff --git a/Scripts/ModScripts/ChatCommands/AICommands.cs b/scripts/modscripts/chatcommands/ai.cs similarity index 100% rename from Scripts/ModScripts/ChatCommands/AICommands.cs rename to scripts/modscripts/chatcommands/ai.cs diff --git a/Scripts/ModScripts/ChatCommands/HelpCommand.cs b/scripts/modscripts/chatcommands/help.cs similarity index 100% rename from Scripts/ModScripts/ChatCommands/HelpCommand.cs rename to scripts/modscripts/chatcommands/help.cs diff --git a/Scripts/ModScripts/ChatCommands/SACommands.cs b/scripts/modscripts/chatcommands/sa.cs similarity index 100% rename from Scripts/ModScripts/ChatCommands/SACommands.cs rename to scripts/modscripts/chatcommands/sa.cs diff --git a/Scripts/ModScripts/ChatCommands/ZombieCommands.cs b/scripts/modscripts/chatcommands/zombie.cs similarity index 100% rename from Scripts/ModScripts/ChatCommands/ZombieCommands.cs rename to scripts/modscripts/chatcommands/zombie.cs diff --git a/Scripts/ModScripts/ModFunctions.cs b/scripts/modscripts/modfunctions.cs similarity index 100% rename from Scripts/ModScripts/ModFunctions.cs rename to scripts/modscripts/modfunctions.cs diff --git a/scripts/modscripts/player.cs b/scripts/modscripts/player.cs new file mode 100644 index 0000000..ec45c6a --- /dev/null +++ b/scripts/modscripts/player.cs @@ -0,0 +1,58 @@ +// ------------------------------------------- +// player.cs +// ACCM Player-bound commands +// =========================================== + +function Player::setSkin(%self, %skin) +{ + freeTarget(%self.getTarget()); + + %self.skin = %skin; + // Zombitch + if (!isObject(%self.client)) + { + %self.target = createTarget(%self, %self.name, %skin, "Derm3", '', 6, PlayerSensor); + setTargetSensorGroup(%self.target, 6); + } + else + { + %self.target = createTarget(%self, %self.client.name, %skin, %self.client.voice, '', 0, PlayerSensor); + setTargetSensorGroup(%self.target, %self.client.team); + setTargetName(%obj.target, %self.client.name); + %self.client.skin = addTaggedString(%skin); + %self.client.target = %self.target; + } + setTargetSkin(%self.target, addTaggedString(%skin)); + setTargetDataBlock(%self.target, %self.getDatablock()); + setTargetSensorData(%self.target, PlayerSensor); + %self.setTarget(%self.target); + return true; +} + +function Player::setName(%self, %name) +{ + + %self.name = %name; + if (!isObject(%self.client)) + { + freeTarget(%self.getTarget()); + %self.target = createTarget(%self, %self.name, %skin, "Derm3", '', 6, PlayerSensor); + setTargetSensorGroup(%self.target, 6); + } + else + { + %ptarget = %self.target; + %skin = getTaggedString(getTargetSkin(%self.getTarget())); + %self.target = createTarget(%self, %name, %skin, %self.client.voice, '', 0, PlayerSensor); + freeTarget(%ptarget); + setTargetSensorGroup(%self.target, %self.client.team); + setTargetName(%self.target, %name); + %self.client.target = %self.target; + } + setTargetSkin(%self.target, addTaggedString(%self.skin)); + setTargetDataBlock(%self.target, %self.getDatablock()); + setTargetSensorData(%self.target, PlayerSensor); + %self.setTarget(%self.target); + return true; +} + diff --git a/Scripts/RankStuff.cs b/scripts/modscripts/ranking.cs similarity index 100% rename from Scripts/RankStuff.cs rename to scripts/modscripts/ranking.cs diff --git a/Scripts/SpecOpsFeatures.cs b/scripts/modscripts/specops.cs similarity index 100% rename from Scripts/SpecOpsFeatures.cs rename to scripts/modscripts/specops.cs diff --git a/Scripts/pack.cs b/scripts/pack.cs similarity index 100% rename from Scripts/pack.cs rename to scripts/pack.cs diff --git a/Scripts/Packs/ArtilleryLoadoutPack.cs b/scripts/packs/ArtilleryLoadoutPack.cs similarity index 100% rename from Scripts/Packs/ArtilleryLoadoutPack.cs rename to scripts/packs/ArtilleryLoadoutPack.cs diff --git a/Scripts/Packs/CommandSatelite.cs b/scripts/packs/CommandSatelite.cs similarity index 100% rename from Scripts/Packs/CommandSatelite.cs rename to scripts/packs/CommandSatelite.cs diff --git a/Scripts/Packs/DeployableWaypoint.cs b/scripts/packs/DeployableWaypoint.cs similarity index 100% rename from Scripts/Packs/DeployableWaypoint.cs rename to scripts/packs/DeployableWaypoint.cs diff --git a/Scripts/Packs/Effectpacks.cs b/scripts/packs/Effectpacks.cs similarity index 100% rename from Scripts/Packs/Effectpacks.cs rename to scripts/packs/Effectpacks.cs diff --git a/Scripts/Packs/FlamerAmmopack.cs b/scripts/packs/FlamerAmmopack.cs similarity index 100% rename from Scripts/Packs/FlamerAmmopack.cs rename to scripts/packs/FlamerAmmopack.cs diff --git a/Scripts/Packs/JetBooster.cs b/scripts/packs/JetBooster.cs similarity index 100% rename from Scripts/Packs/JetBooster.cs rename to scripts/packs/JetBooster.cs diff --git a/Scripts/Packs/Medpack.cs b/scripts/packs/Medpack.cs similarity index 100% rename from Scripts/Packs/Medpack.cs rename to scripts/packs/Medpack.cs diff --git a/Scripts/Packs/PurgeGenerator.cs b/scripts/packs/PurgeGenerator.cs similarity index 100% rename from Scripts/Packs/PurgeGenerator.cs rename to scripts/packs/PurgeGenerator.cs diff --git a/Scripts/Packs/SentinelPack.cs b/scripts/packs/SentinelPack.cs similarity index 100% rename from Scripts/Packs/SentinelPack.cs rename to scripts/packs/SentinelPack.cs diff --git a/Scripts/Packs/ZSpawnpack.cs b/scripts/packs/ZSpawnpack.cs similarity index 100% rename from Scripts/Packs/ZSpawnpack.cs rename to scripts/packs/ZSpawnpack.cs diff --git a/Scripts/Packs/ammopack.cs b/scripts/packs/ammopack.cs similarity index 100% rename from Scripts/Packs/ammopack.cs rename to scripts/packs/ammopack.cs diff --git a/Scripts/Packs/artillerybarrelPack.cs b/scripts/packs/artillerybarrelPack.cs similarity index 100% rename from Scripts/Packs/artillerybarrelPack.cs rename to scripts/packs/artillerybarrelPack.cs diff --git a/Scripts/Packs/blastfloor.cs b/scripts/packs/blastfloor.cs similarity index 100% rename from Scripts/Packs/blastfloor.cs rename to scripts/packs/blastfloor.cs diff --git a/Scripts/Packs/blastwall.cs b/scripts/packs/blastwall.cs similarity index 100% rename from Scripts/Packs/blastwall.cs rename to scripts/packs/blastwall.cs diff --git a/Scripts/Packs/blastwwall.cs b/scripts/packs/blastwwall.cs similarity index 100% rename from Scripts/Packs/blastwwall.cs rename to scripts/packs/blastwwall.cs diff --git a/Scripts/Packs/cratepack.cs b/scripts/packs/cratepack.cs similarity index 100% rename from Scripts/Packs/cratepack.cs rename to scripts/packs/cratepack.cs diff --git a/Scripts/Packs/deconExamples.cs b/scripts/packs/deconExamples.cs similarity index 100% rename from Scripts/Packs/deconExamples.cs rename to scripts/packs/deconExamples.cs diff --git a/Scripts/Packs/decorationpack.cs b/scripts/packs/decorationpack.cs similarity index 100% rename from Scripts/Packs/decorationpack.cs rename to scripts/packs/decorationpack.cs diff --git a/Scripts/Packs/door.cs b/scripts/packs/door.cs similarity index 100% rename from Scripts/Packs/door.cs rename to scripts/packs/door.cs diff --git a/Scripts/Packs/forcefieldpack.cs b/scripts/packs/forcefieldpack.cs similarity index 100% rename from Scripts/Packs/forcefieldpack.cs rename to scripts/packs/forcefieldpack.cs diff --git a/Scripts/Packs/generator.cs b/scripts/packs/generator.cs similarity index 100% rename from Scripts/Packs/generator.cs rename to scripts/packs/generator.cs diff --git a/Scripts/Packs/gravityfieldpack.cs b/scripts/packs/gravityfieldpack.cs similarity index 100% rename from Scripts/Packs/gravityfieldpack.cs rename to scripts/packs/gravityfieldpack.cs diff --git a/Scripts/Packs/jumpad.cs b/scripts/packs/jumpad.cs similarity index 100% rename from Scripts/Packs/jumpad.cs rename to scripts/packs/jumpad.cs diff --git a/Scripts/Packs/largeInventory.cs b/scripts/packs/largeInventory.cs similarity index 100% rename from Scripts/Packs/largeInventory.cs rename to scripts/packs/largeInventory.cs diff --git a/Scripts/Packs/largeSensor.cs b/scripts/packs/largeSensor.cs similarity index 100% rename from Scripts/Packs/largeSensor.cs rename to scripts/packs/largeSensor.cs diff --git a/Scripts/Packs/laserturret.cs b/scripts/packs/laserturret.cs similarity index 100% rename from Scripts/Packs/laserturret.cs rename to scripts/packs/laserturret.cs diff --git a/Scripts/Packs/lightpack.cs b/scripts/packs/lightpack.cs similarity index 100% rename from Scripts/Packs/lightpack.cs rename to scripts/packs/lightpack.cs diff --git a/Scripts/Packs/logoprojectorpack.cs b/scripts/packs/logoprojectorpack.cs similarity index 100% rename from Scripts/Packs/logoprojectorpack.cs rename to scripts/packs/logoprojectorpack.cs diff --git a/Scripts/Packs/mediumSensor.cs b/scripts/packs/mediumSensor.cs similarity index 100% rename from Scripts/Packs/mediumSensor.cs rename to scripts/packs/mediumSensor.cs diff --git a/Scripts/Packs/mspine.cs b/scripts/packs/mspine.cs similarity index 100% rename from Scripts/Packs/mspine.cs rename to scripts/packs/mspine.cs diff --git a/Scripts/Packs/parachutepack.cs b/scripts/packs/parachutepack.cs similarity index 100% rename from Scripts/Packs/parachutepack.cs rename to scripts/packs/parachutepack.cs diff --git a/Scripts/Packs/repairpack.cs b/scripts/packs/repairpack.cs similarity index 100% rename from Scripts/Packs/repairpack.cs rename to scripts/packs/repairpack.cs diff --git a/Scripts/Packs/satchelCharge.cs b/scripts/packs/satchelCharge.cs similarity index 100% rename from Scripts/Packs/satchelCharge.cs rename to scripts/packs/satchelCharge.cs diff --git a/Scripts/Packs/sentryturretpack.cs b/scripts/packs/sentryturretpack.cs similarity index 100% rename from Scripts/Packs/sentryturretpack.cs rename to scripts/packs/sentryturretpack.cs diff --git a/Scripts/Packs/solarpanel.cs b/scripts/packs/solarpanel.cs similarity index 100% rename from Scripts/Packs/solarpanel.cs rename to scripts/packs/solarpanel.cs diff --git a/Scripts/Packs/spawnpointpack.cs b/scripts/packs/spawnpointpack.cs similarity index 100% rename from Scripts/Packs/spawnpointpack.cs rename to scripts/packs/spawnpointpack.cs diff --git a/Scripts/Packs/spine.cs b/scripts/packs/spine.cs similarity index 100% rename from Scripts/Packs/spine.cs rename to scripts/packs/spine.cs diff --git a/Scripts/Packs/switch.cs b/scripts/packs/switch.cs similarity index 100% rename from Scripts/Packs/switch.cs rename to scripts/packs/switch.cs diff --git a/Scripts/Packs/telepadpack.cs b/scripts/packs/telepadpack.cs similarity index 100% rename from Scripts/Packs/telepadpack.cs rename to scripts/packs/telepadpack.cs diff --git a/Scripts/Packs/treepack.cs b/scripts/packs/treepack.cs similarity index 100% rename from Scripts/Packs/treepack.cs rename to scripts/packs/treepack.cs diff --git a/Scripts/Packs/tripwire.cs b/scripts/packs/tripwire.cs similarity index 100% rename from Scripts/Packs/tripwire.cs rename to scripts/packs/tripwire.cs diff --git a/Scripts/Packs/turretpack.cs b/scripts/packs/turretpack.cs similarity index 100% rename from Scripts/Packs/turretpack.cs rename to scripts/packs/turretpack.cs diff --git a/Scripts/Packs/vehiclepad.cs b/scripts/packs/vehiclepad.cs similarity index 100% rename from Scripts/Packs/vehiclepad.cs rename to scripts/packs/vehiclepad.cs diff --git a/Scripts/Packs/vehiclerepairpad.cs b/scripts/packs/vehiclerepairpad.cs similarity index 100% rename from Scripts/Packs/vehiclerepairpad.cs rename to scripts/packs/vehiclerepairpad.cs diff --git a/Scripts/player.cs b/scripts/player.cs similarity index 100% rename from Scripts/player.cs rename to scripts/player.cs diff --git a/Scripts/power.cs b/scripts/power.cs similarity index 100% rename from Scripts/power.cs rename to scripts/power.cs diff --git a/Scripts/prison.cs b/scripts/prison.cs similarity index 100% rename from Scripts/prison.cs rename to scripts/prison.cs diff --git a/Scripts/projectiles.cs b/scripts/projectiles.cs similarity index 100% rename from Scripts/projectiles.cs rename to scripts/projectiles.cs diff --git a/Scripts/saveBuilding.cs b/scripts/saveBuilding.cs similarity index 100% rename from Scripts/saveBuilding.cs rename to scripts/saveBuilding.cs diff --git a/Scripts/server.cs b/scripts/server.cs similarity index 100% rename from Scripts/server.cs rename to scripts/server.cs diff --git a/Scripts/skywrite.cs b/scripts/skywrite.cs similarity index 100% rename from Scripts/skywrite.cs rename to scripts/skywrite.cs diff --git a/Scripts/solitudeBlock.cs b/scripts/solitudeBlock.cs similarity index 100% rename from Scripts/solitudeBlock.cs rename to scripts/solitudeBlock.cs diff --git a/Scripts/staticShape.cs b/scripts/staticShape.cs similarity index 100% rename from Scripts/staticShape.cs rename to scripts/staticShape.cs diff --git a/Scripts/station.cs b/scripts/station.cs similarity index 100% rename from Scripts/station.cs rename to scripts/station.cs diff --git a/Scripts/terSupport.cs b/scripts/terSupport.cs similarity index 100% rename from Scripts/terSupport.cs rename to scripts/terSupport.cs diff --git a/Scripts/truPhysics.cs b/scripts/truPhysics.cs similarity index 100% rename from Scripts/truPhysics.cs rename to scripts/truPhysics.cs diff --git a/Scripts/turret.cs b/scripts/turret.cs similarity index 100% rename from Scripts/turret.cs rename to scripts/turret.cs diff --git a/Scripts/Turrets/Artillerybarrellarge.cs b/scripts/turrets/Artillerybarrellarge.cs similarity index 100% rename from Scripts/Turrets/Artillerybarrellarge.cs rename to scripts/turrets/Artillerybarrellarge.cs diff --git a/Scripts/Turrets/ELFBarrelLarge.cs b/scripts/turrets/ELFBarrelLarge.cs similarity index 100% rename from Scripts/Turrets/ELFBarrelLarge.cs rename to scripts/turrets/ELFBarrelLarge.cs diff --git a/Scripts/Turrets/aabarrellarge.cs b/scripts/turrets/aabarrellarge.cs similarity index 100% rename from Scripts/Turrets/aabarrellarge.cs rename to scripts/turrets/aabarrellarge.cs diff --git a/Scripts/Turrets/indoordeployablebarrel.cs b/scripts/turrets/indoordeployablebarrel.cs similarity index 100% rename from Scripts/Turrets/indoordeployablebarrel.cs rename to scripts/turrets/indoordeployablebarrel.cs diff --git a/Scripts/Turrets/missileBarrelLarge.cs b/scripts/turrets/missileBarrelLarge.cs similarity index 100% rename from Scripts/Turrets/missileBarrelLarge.cs rename to scripts/turrets/missileBarrelLarge.cs diff --git a/Scripts/Turrets/mortarBarrelLarge.cs b/scripts/turrets/mortarBarrelLarge.cs similarity index 100% rename from Scripts/Turrets/mortarBarrelLarge.cs rename to scripts/turrets/mortarBarrelLarge.cs diff --git a/Scripts/Turrets/outdoorDeployableBarrel.cs b/scripts/turrets/outdoorDeployableBarrel.cs similarity index 100% rename from Scripts/Turrets/outdoorDeployableBarrel.cs rename to scripts/turrets/outdoorDeployableBarrel.cs diff --git a/Scripts/Turrets/plasmaBarrelLarge.cs b/scripts/turrets/plasmaBarrelLarge.cs similarity index 100% rename from Scripts/Turrets/plasmaBarrelLarge.cs rename to scripts/turrets/plasmaBarrelLarge.cs diff --git a/Scripts/Vehicles/Vehicle_strikefighter.cs b/scripts/vehicles/Vehicle_strikefighter.cs similarity index 100% rename from Scripts/Vehicles/Vehicle_strikefighter.cs rename to scripts/vehicles/Vehicle_strikefighter.cs diff --git a/Scripts/Vehicles/serverVehicleHud.cs b/scripts/vehicles/serverVehicleHud.cs similarity index 100% rename from Scripts/Vehicles/serverVehicleHud.cs rename to scripts/vehicles/serverVehicleHud.cs diff --git a/Scripts/Vehicles/vehicle.cs b/scripts/vehicles/vehicle.cs similarity index 100% rename from Scripts/Vehicles/vehicle.cs rename to scripts/vehicles/vehicle.cs diff --git a/Scripts/Vehicles/vehicle_AWACS.cs b/scripts/vehicles/vehicle_AWACS.cs similarity index 100% rename from Scripts/Vehicles/vehicle_AWACS.cs rename to scripts/vehicles/vehicle_AWACS.cs diff --git a/Scripts/Vehicles/vehicle_Artillery.cs b/scripts/vehicles/vehicle_Artillery.cs similarity index 100% rename from Scripts/Vehicles/vehicle_Artillery.cs rename to scripts/vehicles/vehicle_Artillery.cs diff --git a/Scripts/Vehicles/vehicle_CGM.cs b/scripts/vehicles/vehicle_CGM.cs similarity index 100% rename from Scripts/Vehicles/vehicle_CGM.cs rename to scripts/vehicles/vehicle_CGM.cs diff --git a/Scripts/Vehicles/vehicle_CGTank.cs b/scripts/vehicles/vehicle_CGTank.cs similarity index 100% rename from Scripts/Vehicles/vehicle_CGTank.cs rename to scripts/vehicles/vehicle_CGTank.cs diff --git a/Scripts/Vehicles/vehicle_DropPod.cs b/scripts/vehicles/vehicle_DropPod.cs similarity index 100% rename from Scripts/Vehicles/vehicle_DropPod.cs rename to scripts/vehicles/vehicle_DropPod.cs diff --git a/Scripts/Vehicles/vehicle_HeavyHelicopter.cs b/scripts/vehicles/vehicle_HeavyHelicopter.cs similarity index 100% rename from Scripts/Vehicles/vehicle_HeavyHelicopter.cs rename to scripts/vehicles/vehicle_HeavyHelicopter.cs diff --git a/Scripts/Vehicles/vehicle_HeavyTank.cs b/scripts/vehicles/vehicle_HeavyTank.cs similarity index 100% rename from Scripts/Vehicles/vehicle_HeavyTank.cs rename to scripts/vehicles/vehicle_HeavyTank.cs diff --git a/Scripts/Vehicles/vehicle_Helicopter.cs b/scripts/vehicles/vehicle_Helicopter.cs similarity index 100% rename from Scripts/Vehicles/vehicle_Helicopter.cs rename to scripts/vehicles/vehicle_Helicopter.cs diff --git a/Scripts/Vehicles/vehicle_S17.cs b/scripts/vehicles/vehicle_S17.cs similarity index 100% rename from Scripts/Vehicles/vehicle_S17.cs rename to scripts/vehicles/vehicle_S17.cs diff --git a/Scripts/Vehicles/vehicle_SuperiorityFighter.cs b/scripts/vehicles/vehicle_SuperiorityFighter.cs similarity index 100% rename from Scripts/Vehicles/vehicle_SuperiorityFighter.cs rename to scripts/vehicles/vehicle_SuperiorityFighter.cs diff --git a/Scripts/Vehicles/vehicle_boat.cs b/scripts/vehicles/vehicle_boat.cs similarity index 100% rename from Scripts/Vehicles/vehicle_boat.cs rename to scripts/vehicles/vehicle_boat.cs diff --git a/Scripts/Vehicles/vehicle_bomber.cs b/scripts/vehicles/vehicle_bomber.cs similarity index 100% rename from Scripts/Vehicles/vehicle_bomber.cs rename to scripts/vehicles/vehicle_bomber.cs diff --git a/Scripts/Vehicles/vehicle_effects.cs b/scripts/vehicles/vehicle_effects.cs similarity index 100% rename from Scripts/Vehicles/vehicle_effects.cs rename to scripts/vehicles/vehicle_effects.cs diff --git a/Scripts/Vehicles/vehicle_gunship.cs b/scripts/vehicles/vehicle_gunship.cs similarity index 100% rename from Scripts/Vehicles/vehicle_gunship.cs rename to scripts/vehicles/vehicle_gunship.cs diff --git a/Scripts/Vehicles/vehicle_havoc.cs b/scripts/vehicles/vehicle_havoc.cs similarity index 100% rename from Scripts/Vehicles/vehicle_havoc.cs rename to scripts/vehicles/vehicle_havoc.cs diff --git a/Scripts/Vehicles/vehicle_hawk.cs b/scripts/vehicles/vehicle_hawk.cs similarity index 100% rename from Scripts/Vehicles/vehicle_hawk.cs rename to scripts/vehicles/vehicle_hawk.cs diff --git a/Scripts/Vehicles/vehicle_mpb.cs b/scripts/vehicles/vehicle_mpb.cs similarity index 100% rename from Scripts/Vehicles/vehicle_mpb.cs rename to scripts/vehicles/vehicle_mpb.cs diff --git a/Scripts/Vehicles/vehicle_s11.cs b/scripts/vehicles/vehicle_s11.cs similarity index 100% rename from Scripts/Vehicles/vehicle_s11.cs rename to scripts/vehicles/vehicle_s11.cs diff --git a/Scripts/Vehicles/vehicle_shrike.cs b/scripts/vehicles/vehicle_shrike.cs similarity index 100% rename from Scripts/Vehicles/vehicle_shrike.cs rename to scripts/vehicles/vehicle_shrike.cs diff --git a/Scripts/Vehicles/vehicle_spec_fx.cs b/scripts/vehicles/vehicle_spec_fx.cs similarity index 100% rename from Scripts/Vehicles/vehicle_spec_fx.cs rename to scripts/vehicles/vehicle_spec_fx.cs diff --git a/Scripts/Vehicles/vehicle_sub.cs b/scripts/vehicles/vehicle_sub.cs similarity index 100% rename from Scripts/Vehicles/vehicle_sub.cs rename to scripts/vehicles/vehicle_sub.cs diff --git a/Scripts/Vehicles/vehicle_superHavoc.cs b/scripts/vehicles/vehicle_superHavoc.cs similarity index 100% rename from Scripts/Vehicles/vehicle_superHavoc.cs rename to scripts/vehicles/vehicle_superHavoc.cs diff --git a/Scripts/Vehicles/vehicle_superWildcat.cs b/scripts/vehicles/vehicle_superWildcat.cs similarity index 100% rename from Scripts/Vehicles/vehicle_superWildcat.cs rename to scripts/vehicles/vehicle_superWildcat.cs diff --git a/Scripts/Vehicles/vehicle_tank.cs b/scripts/vehicles/vehicle_tank.cs similarity index 100% rename from Scripts/Vehicles/vehicle_tank.cs rename to scripts/vehicles/vehicle_tank.cs diff --git a/Scripts/Vehicles/vehicle_transboat.cs b/scripts/vehicles/vehicle_transboat.cs similarity index 100% rename from Scripts/Vehicles/vehicle_transboat.cs rename to scripts/vehicles/vehicle_transboat.cs diff --git a/Scripts/Vehicles/vehicle_wildcat.cs b/scripts/vehicles/vehicle_wildcat.cs similarity index 100% rename from Scripts/Vehicles/vehicle_wildcat.cs rename to scripts/vehicles/vehicle_wildcat.cs diff --git a/Scripts/weapTurretCode.cs b/scripts/weapTurretCode.cs similarity index 100% rename from Scripts/weapTurretCode.cs rename to scripts/weapTurretCode.cs diff --git a/Scripts/weapons.cs b/scripts/weapons.cs similarity index 100% rename from Scripts/weapons.cs rename to scripts/weapons.cs diff --git a/Scripts/Weapons/DZShot.cs b/scripts/weapons/DZShot.cs similarity index 100% rename from Scripts/Weapons/DZShot.cs rename to scripts/weapons/DZShot.cs diff --git a/Scripts/Weapons/EditingTool.cs b/scripts/weapons/EditingTool.cs similarity index 100% rename from Scripts/Weapons/EditingTool.cs rename to scripts/weapons/EditingTool.cs diff --git a/Scripts/Weapons/FlameMortar.cs b/scripts/weapons/FlameMortar.cs similarity index 100% rename from Scripts/Weapons/FlameMortar.cs rename to scripts/weapons/FlameMortar.cs diff --git a/Scripts/Weapons/Krieg.cs b/scripts/weapons/Krieg.cs similarity index 100% rename from Scripts/Weapons/Krieg.cs rename to scripts/weapons/Krieg.cs diff --git a/Scripts/Weapons/LightMachineGun.cs b/scripts/weapons/LightMachineGun.cs similarity index 100% rename from Scripts/Weapons/LightMachineGun.cs rename to scripts/weapons/LightMachineGun.cs diff --git a/Scripts/Weapons/M4GrenadeLauncher.cs b/scripts/weapons/M4GrenadeLauncher.cs similarity index 100% rename from Scripts/Weapons/M4GrenadeLauncher.cs rename to scripts/weapons/M4GrenadeLauncher.cs diff --git a/Scripts/Weapons/MG42.cs b/scripts/weapons/MG42.cs similarity index 100% rename from Scripts/Weapons/MG42.cs rename to scripts/weapons/MG42.cs diff --git a/Scripts/Weapons/MergeTool.cs b/scripts/weapons/MergeTool.cs similarity index 100% rename from Scripts/Weapons/MergeTool.cs rename to scripts/weapons/MergeTool.cs diff --git a/Scripts/Weapons/PBC.cs b/scripts/weapons/PBC.cs similarity index 100% rename from Scripts/Weapons/PBC.cs rename to scripts/weapons/PBC.cs diff --git a/Scripts/Weapons/PulseLaser.cs b/scripts/weapons/PulseLaser.cs similarity index 100% rename from Scripts/Weapons/PulseLaser.cs rename to scripts/weapons/PulseLaser.cs diff --git a/Scripts/Weapons/RPchaingun.cs b/scripts/weapons/RPchaingun.cs similarity index 100% rename from Scripts/Weapons/RPchaingun.cs rename to scripts/weapons/RPchaingun.cs diff --git a/Scripts/Weapons/RailGun.cs b/scripts/weapons/RailGun.cs similarity index 100% rename from Scripts/Weapons/RailGun.cs rename to scripts/weapons/RailGun.cs diff --git a/Scripts/Weapons/RocketLauncher.cs b/scripts/weapons/RocketLauncher.cs similarity index 100% rename from Scripts/Weapons/RocketLauncher.cs rename to scripts/weapons/RocketLauncher.cs diff --git a/Scripts/Weapons/Shotgun.cs b/scripts/weapons/Shotgun.cs similarity index 100% rename from Scripts/Weapons/Shotgun.cs rename to scripts/weapons/Shotgun.cs diff --git a/Scripts/Weapons/SmokeGrenade.cs b/scripts/weapons/SmokeGrenade.cs similarity index 100% rename from Scripts/Weapons/SmokeGrenade.cs rename to scripts/weapons/SmokeGrenade.cs diff --git a/Scripts/Weapons/TextureTool.cs b/scripts/weapons/TextureTool.cs similarity index 100% rename from Scripts/Weapons/TextureTool.cs rename to scripts/weapons/TextureTool.cs diff --git a/Scripts/Weapons/ZLordPoison.cs b/scripts/weapons/ZLordPoison.cs similarity index 100% rename from Scripts/Weapons/ZLordPoison.cs rename to scripts/weapons/ZLordPoison.cs diff --git a/Scripts/Weapons/allweapons.cs b/scripts/weapons/allweapons.cs similarity index 100% rename from Scripts/Weapons/allweapons.cs rename to scripts/weapons/allweapons.cs diff --git a/Scripts/Weapons/bazooka.cs b/scripts/weapons/bazooka.cs similarity index 100% rename from Scripts/Weapons/bazooka.cs rename to scripts/weapons/bazooka.cs diff --git a/Scripts/Weapons/constructionTool.cs b/scripts/weapons/constructionTool.cs similarity index 100% rename from Scripts/Weapons/constructionTool.cs rename to scripts/weapons/constructionTool.cs diff --git a/Scripts/Weapons/flamethrower.cs b/scripts/weapons/flamethrower.cs similarity index 100% rename from Scripts/Weapons/flamethrower.cs rename to scripts/weapons/flamethrower.cs diff --git a/Scripts/Weapons/flareGrenade.cs b/scripts/weapons/flareGrenade.cs similarity index 100% rename from Scripts/Weapons/flareGrenade.cs rename to scripts/weapons/flareGrenade.cs diff --git a/Scripts/Weapons/flashGrenade.cs b/scripts/weapons/flashGrenade.cs similarity index 100% rename from Scripts/Weapons/flashGrenade.cs rename to scripts/weapons/flashGrenade.cs diff --git a/Scripts/Weapons/grenade.cs b/scripts/weapons/grenade.cs similarity index 100% rename from Scripts/Weapons/grenade.cs rename to scripts/weapons/grenade.cs diff --git a/Scripts/Weapons/mine.cs b/scripts/weapons/mine.cs similarity index 100% rename from Scripts/Weapons/mine.cs rename to scripts/weapons/mine.cs diff --git a/Scripts/Weapons/missileLauncher.cs b/scripts/weapons/missileLauncher.cs similarity index 100% rename from Scripts/Weapons/missileLauncher.cs rename to scripts/weapons/missileLauncher.cs diff --git a/Scripts/Weapons/pistol.cs b/scripts/weapons/pistol.cs similarity index 100% rename from Scripts/Weapons/pistol.cs rename to scripts/weapons/pistol.cs diff --git a/Scripts/Weapons/snipergun.cs b/scripts/weapons/snipergun.cs similarity index 100% rename from Scripts/Weapons/snipergun.cs rename to scripts/weapons/snipergun.cs diff --git a/Scripts/Weapons/superChaingun.cs b/scripts/weapons/superChaingun.cs similarity index 100% rename from Scripts/Weapons/superChaingun.cs rename to scripts/weapons/superChaingun.cs diff --git a/Scripts/Weapons/targetingLaser.cs b/scripts/weapons/targetingLaser.cs similarity index 100% rename from Scripts/Weapons/targetingLaser.cs rename to scripts/weapons/targetingLaser.cs