PK !(b<scripts/weblinks.csfunction weblinksmenu::defaultList(%this) { addWebLink( "Tribes 2 Home Page", "www.tribes2.com" ); addWebLink( "T2 Technical Information", "sierrastudios.com/games/tribes2/support" ); addWebLink( "5 Assed Monkey", "www.5assedmonkey.com" ); addWebLink( "Arc 2055", "www.arc2055.com" ); addWebLink( "Atari Secret Society", "www.atarisecretsociety.org" ); addWebLink( "BarrysWorld", "www.barrysworld.com" ); addWebLink( "Bomb", "www.bomb.net" ); addWebLink( "Clan Happytyme", "www.happytyme.com" ); addWebLink( "ClanBase", "www.clanbase.com" ); addWebLink( "ClanServ", "www.clanserv.com" ); addWebLink( "Dopplegangers", "www.dopplegangers.com" ); addWebLink( "Dutchbat Homeworld", "www.dutchbat-homeworld.com" ); addWebLink( "eDome Tribes 2", "http://games.edome.net/tribes2/" ); addWebLink( "Euro Tribesplayers", "www.euro-tribesplayers.com" ); addWebLink( "eXtreme-Players", "www.eXtreme-players.de" ); addWebLink( "Game Forces", "www.gforces.net" ); addWebLink( "Game Planet", "www.gameplanet.co.nz" ); addWebLink( "Game Surf", "www.gamesurf.de" ); addWebLink( "Grave Diggers Union", "www.gravediggersunion.com" ); addWebLink( "HomeLan", "www.homelan.com" ); addWebLink( "IanStorm", "www.ianstorm.com" ); addWebLink( "IMGaming", "www.imgaming.com" ); addWebLink( "LAN Place", "www.lanplace.co.nz" ); addWebLink( "Long Dongles", "www.longdongles.com" ); addWebLink( "MaxBaud.Net", "www.maxbaud.net" ); addWebLink( "MoreGaming", "www.moregaming.com" ); addWebLink( "NetGames UK", "www.nguk.net" ); addWebLink( "NGI", "www.ngi.it" ); addWebLink( "PlanetTribes", "www.planettribes.com" ); addWebLink( "Raging Angels", "www.ragingangels.org" ); addWebLink( "Rogue Disciples", "www.roguedisciples.com" ); addWebLink( "StrikeForce", "www.strikeforcecenter.com" ); addWebLink( "Sydney Gamers League", "www.sgl.org.au" ); addWebLink( "System Recall", "www.systemrecall.com" ); addWebLink( "TeamSound", "www.teamsound.com" ); addWebLink( "Telenordia", "www.telenordia.se" ); addWebLink( "Telepresence Heavy Assault Team", "www.that.co.nz" ); addWebLink( "Temple of Blood", "www.templeofblood.com" ); addWebLink( "The Ghostbear Tribe", "www.ghostbear.net" ); addWebLink( "ToKrZ", "www.tokrz.com" ); addWebLink( "Tribes Attack", "www.tribesattack.com" ); addWebLink( "Tribes Center", "www.tribescenter.com" ); addWebLink( "Tribes 2 Database", "www.tribes2database.com" ); addWebLink( "Tribes Gamers", "www.tribesgamers.com" ); addWebLink( "TribesMaps", "www.tribesmaps.com" ); addWebLink( "TribalWar", "www.tribalwar.com" ); addWebLink( "Tribes Worlds", "www.tribesworlds.com" ); addWebLink( "Tribes-Universe", "www.tribes-universe.com" ); addWebLink( "WirePlay", "www.wireplay.com.au" ); //addWebLink( "Z Free", "games13.clear.net.nz" ); //addWebLink( "Box Factory Games", "http://www.bfgames1.com" ); //addWebLink( "Box Factory Games", "http://www.bfgn.hobbiton.org" ); for ( %i = 0; %i < $WebLinkCount; %i++ ) %this.add( $WebLink[%i, name], %i ); weblinksmenu.setSelected(0); } function weblinksmenu::onDatabaseQueryResult(%this,%status,%resultstring,%key) { if(%key != %this.key) return; echo("RECV:" @ %status); switch$(%this.state) { case "fetchWeblink": if(getField(%status,0) == 0) { %this.isloaded = true; %this.state = "getLinks"; $WebLink = ""; %this.clear(); %this.rownum = 0; } else { %this.state = "error"; $WebLink = ""; %this.clear(); %this.defaultList(); } } } function weblinksmenu::onDatabaseRow(%this,%row,%isLastRow,%key) { if(%key != %this.key) return; echo("RECV:" @ %row); switch$(%this.state) { case "getLinks": if(getField(%row,0) $= "0") { addWebLink(getField(%row,1),getField(%row,2)); %this.add( getField(%row,1), %this.rownum ); %this.rownum++; } if(%isLastRow) weblinksmenu.setSelected(0); } } PK !(}scripts/defaultGame.cs//$MissionName is the file name of the mission //$MapName is the displayed name(no underscore,spaces) //$GameType (CTF,Hunters) function DefaultGame::activatePackages(%game) { // activate the default package for the game type activatePackage(DefaultGame); if(isPackage(%game.class) && %game.class !$= DefaultGame) activatePackage(%game.class); } function DefaultGame::deactivatePackages(%game) { deactivatePackage(DefaultGame); if(isPackage(%game.class) && %game.class !$= DefaultGame) deactivatePackage(%game.class); } package DefaultGame { function FlipFlop::objectiveInit(%data, %flipflop) { // add this flipflop to missioncleanup %flipflopSet = nameToID("MissionCleanup/FlipFlops"); if(%flipflopSet <= 0) { %flipflopSet = new SimSet("FlipFlops"); MissionCleanup.add(%flipflopSet); } %flipflopSet.add(%flipflop); // see if there's a holo projector associated with this flipflop // search the flipflop's folder for a holo projector // if one exists, associate it with the flipflop %flipflop.projector = 0; %folder = %flipflop.getGroup(); for(%i = 0; %i < %folder.getCount(); %i++) { %proj = %folder.getObject(%i); // weird, but line below prevents console error if(%proj.getClassName() !$= "SimGroup" && %proj.getClassName() !$= "InteriorInstance") if(%proj.getDatablock().getName() $= "LogoProjector") { %flipflop.projector = %proj; %flipflop.projector.holo = 0; break; } } // may have been hidden %target = %flipFlop.getTarget(); if(%target != -1) { // set flipflop to base skin setTargetSkin(%target, $teamSkin[0]); // make this always visible in the commander map setTargetAlwaysVisMask(%target, 0xffffffff); // make this always visible in the commander list setTargetRenderMask(%target, getTargetRenderMask(%target) | $TargetInfo::CommanderListRender); } } function FlipFlop::playerTouch(%data, %flipflop, %player) { %client = %player.client; %flipTeam = %flipflop.team; if(%flipTeam == %client.team) return false; %teamName = game.getTeamName(%client.team); // Let the observers know: messageTeam( 0, 'MsgClaimFlipFlop', '\c2%1 claimed %2 for %3.~wfx/misc/flipflop_taken.wav', %client.name, Game.cleanWord( %flipflop.name ), %teamName ); // Let the teammates know: messageTeam( %client.team, 'MsgClaimFlipFlop', '\c2%1 claimed %2 for %3.~wfx/misc/flipflop_taken.wav', %client.name, Game.cleanWord( %flipflop.name ), %teamName ); // Let the other team know: %losers = %client.team == 1 ? 2 : 1; messageTeam( %losers, 'MsgClaimFlipFlop', '\c2%1 claimed %2 for %3.~wfx/misc/flipflop_lost.wav', %client.name, Game.cleanWord( %flipflop.name ), %teamName ); logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") claimed flipflop "@%flipflop@" for team "@%client.team); //change the skin on the switch to claiming team's logo setTargetSkin(%flipflop.getTarget(), game.getTeamSkin(%player.team)); setTargetSensorGroup(%flipflop.getTarget(), %player.team); // if there is a "projector" associated with this flipflop, put the claiming team's logo there if(%flipflop.projector > 0) { %projector = %flipflop.projector; // axe the old projected holo, if one exists if(%projector.holo > 0) %projector.holo.delete(); %newHolo = getTaggedString(game.getTeamSkin(%client.team)) @ "Logo"; %projTransform = %projector.getTransform(); // below two functions are from deployables.cs %projRot = rotFromTransform(%projTransform); %projPos = posFromTransform(%projTransform); // place the holo above the projector (default 10 meters) %hHeight = %projector.holoHeight; if(%hHeight $= "") %hHeight = 10; %holoZ = getWord(%projPos, 2) + %hHeight; %holoPos = firstWord(%projPos) SPC getWord(%projPos,1) SPC %holoZ; %holo = new StaticShape() { rotation = %projRot; position = %holoPos; dataBlock = %newHolo; }; // dump the hologram into MissionCleanup MissionCleanup.add(%holo); // associate the holo with the projector %projector.holo = %holo; } // convert the resources associated with the flipflop Game.claimFlipflopResources(%flipflop, %client.team); if(Game.countFlips()) for(%i = 1; %i <= Game.numTeams; %i++) { %teamHeld = Game.countFlipsHeld(%i); messageAll('MsgFlipFlopsHeld', "", %i, %teamHeld); } //call the ai function Game.AIplayerCaptureFlipFlop(%player, %flipflop); return true; } }; //--------- DEFAULT SCORING, SUPERCEDE IN GAMETYPE FILE ------------------ function DefaultGame::initGameVars(%game) { %game.SCORE_PER_SUICIDE = 0; %game.SCORE_PER_TEAMKILL = 0; %game.SCORE_PER_DEATH = 0; %game.SCORE_PER_KILL = 0; %game.SCORE_PER_TURRET_KILL = 0; } //-- tracking --- // .deaths .kills .suicides .teamKills .turretKills function DefaultGame::claimFlipflopResources(%game, %flipflop, %team) { %group = %flipflop.getGroup(); %group.setTeam(%team); // make this always visible in the commander map (gets reset when sensor group gets changed) setTargetAlwaysVisMask(%flipflop.getTarget(), 0xffffffff); } //------------------------------------------------------------------------------ function DefaultGame::selectSpawnSphere(%game, %team) { // - walks the objects in the 'teamdrops' group for this team // - find a random spawn point which has a running sum less more than // 0->total sphere weight %teamDropsGroup = "MissionCleanup/TeamDrops" @ %team; %group = nameToID(%teamDropsGroup); if (%group != -1) { %count = %group.getCount(); if (%count != 0) { // Get total weight of those spheres not filtered by mission types list- %overallWeight = 0; for (%i = 0; %i < %count; %i++) { %sphereObj = %group.getObject(%i); if ( ! %sphereObj.isHidden() ) %overallWeight += %sphereObj.sphereWeight; } if (%overallWeight > 0) { // Subtract a little from this as hedge against any rounding offness- %randSum = getRandom(%overallWeight) - 0.05; // echo("randSum = " @ %randSum); for (%i = 0; %i < %count; %i++) { %sphereObj = %group.getObject(%i); if (! %sphereObj.isHidden()) { %randSum -= %sphereObj.sphereWeight; if (%randSum <= 0) { // echo("Chose sphere " @ %i); return %group.getObject(%i); // Found our sphere } } } error("Random spawn sphere selection didn't work"); } else error("No non-hidden spawnspheres were found in " @ %teamDropsGroup); } else error("No spawnspheres found in " @ %teamDropsGroup); } else error(%teamDropsGroup @ " not found in selectSpawnSphere()."); return -1; } function DefaultGame::selectSpawnZone(%game, %sphere) { // determines if this should spawn inside or outside %overallWeight = %sphere.indoorWeight + %sphere.outdoorWeight; %index = mFloor(getRandom() * (%overallWeight - 0.1)) + 1; if ((%index - %sphere.indoorWeight) > 0) return false; //do not pick an indoor spawn else return true; //pick an indoor spawn } function DefaultGame::selectSpawnFacing(%game, %src, %target, %zone) { //this used only when spawn loc is not on an interior. This points spawning player to the ctr of spawnshpere %target = setWord(%target, 2, 0); %src = setWord(%src, 2, 0); if(VectorDist(%target, %src) == 0) return " 0 0 1 0 "; %vec = VectorNormalize(VectorSub(%target, %src)); %angle = mAcos(getWord(%vec, 1)); if(%src < %target) return(" 0 0 1 " @ %angle); else return(" 0 0 1 " @ -%angle); } function DefaultGame::pickTeamSpawn(%game, %team) { // early exit if no nav graph if (!navGraphExists()) { echo("No navigation graph is present. Build one."); return -1; } for (%attempt = 0; %attempt < 20; %attempt++) { // finds a random spawn sphere // selects inside/outside on this random sphere // if the navgraph exists, then uses it to grab a random node as spawn // location/rotation %sphere = %game.selectSpawnSphere(%team); if (%sphere == -1) { echo("No spawn spheres found for team " @ %team); return -1; } %zone = %game.selectSpawnZone(%sphere); %useIndoor = %zone; %useOutdoor = !%zone; if (%zone) %area = "indoor"; else %area = "outdoor"; %radius = %sphere.radius; %sphereTrans = %sphere.getTransform(); %sphereCtr = getWord(%sphereTrans, 0) @ " " @ getWord(%sphereTrans, 1) @ " " @ getWord(%sphereTrans, 2); //don't need full transform here, just x, y, z //echo("Selected Sphere is " @ %sphereCtr @ " with a radius of " @ %radius @ " meters. Selecting from " @ %area @ " zone."); %avoidThese = $TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::TurretObjectType; for (%tries = 0; %tries < 10; %tries++) { %nodeIndex = navGraph.randNode(%sphereCtr, %radius, %useIndoor, %useOutdoor); if (%nodeIndex >= 0) { %loc = navGraph.randNodeLoc(%nodeIndex); %adjUp = VectorAdd(%loc, "0 0 1.0"); // don't go much below if (ContainerBoxEmpty( %avoidThese, %adjUp, 2.0)) break; } } if (%nodeIndex >= 0) { %loc = navGraph.randNodeLoc(%nodeIndex); if (%zone) { %trns = %loc @ " 0 0 1 0"; %spawnLoc = whereToLook(%trns); } else { %rot = %game.selectSpawnFacing(%loc, %sphereCtr, %zone); %spawnLoc = %loc @ %rot; } return %spawnLoc; } } } //------------------------------------------------------------ function DefaultGame::pickObserverSpawn(%game, %client, %next) { %group = nameToID("MissionGroup/ObserverDropPoints"); %count = %group.getCount(); if(!%count || %group == -1) { echo("no observer spawn points found"); return -1; } if(%client.lastObserverSpawn == -1) { %client.lastObserverSpawn = 0; return(%group.getObject(%client.lastObserverSpawn)); } if(%next == true) %spawnIdx = %client.lastObserverSpawn + 1; else %spawnIdx = %client.lastObserverSpawn - 1; if(%spawnIdx < 0) %spawnIdx = %count - 1; else if(%spawnIdx >= %count) %spawnIdx = 0; %client.lastObserverSpawn = %spawnIdx; //echo("Observer spawn point found"); return %group.getObject(%spawnIdx); } //------------------------------------------------------------ function DefaultGame::spawnPlayer( %game, %client, %respawn ) { %client.lastSpawnPoint = %game.pickPlayerSpawn( %client, false ); %client.suicidePickRespawnTime = getSimTime() + 20000; %game.createPlayer( %client, %client.lastSpawnPoint, %respawn ); } //------------------------------------------------------------ function DefaultGame::playerSpawned(%game, %player) { if( %player.client.respawnTimer ) cancel(%player.client.respawnTimer); %player.client.observerStartTime = ""; %game.equip(%player); //set the spawn time (for use by the AI system) %player.client.spawnTime = getSimTime(); // jff: this should probably be checking the team of the client //update anyone observing this client %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.camera.mode $= "observerFollow" && %cl.observeClient == %player.client) { %transform = %player.getTransform(); %cl.camera.setOrbitMode(%player, %transform, 0.5, 4.5, 4.5); %cl.camera.targetObj = %player; } } } function DefaultGame::equip(%game, %player) { for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); //%player.setArmor("Light"); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.setInventory(Beacon, 3); %player.setInventory(TargetingLaser, 1); %player.weaponCount = 3; %player.use("Blaster"); } //------------------------------------------------------------ function DefaultGame::pickPlayerSpawn(%game, %client, %respawn) { // place this client on his own team, '%respawn' does not ever seem to be used //we no longer care whether it is a respawn since all spawns use same points. return %game.pickTeamSpawn(%client.team); } //------------------------------------------------------------ function DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn) { // do not allow a new player if there is one (not destroyed) on this client if(isObject(%client.player) && (%client.player.getState() !$= "Dead")) return; // clients and cameras can exist in team 0, but players should not if(%client.team == 0) error("Players should not be added to team0!"); // defaultplayerarmor is in 'players.cs' if(%spawnLoc == -1) %spawnLoc = "0 0 300 1 0 0 0"; //else // echo("Spawning player at " @ %spawnLoc); // copied from player.cs if (%client.race $= "Bioderm") // Only have male bioderms. %armor = $DefaultPlayerArmor @ "Male" @ %client.race @ Armor; else %armor = $DefaultPlayerArmor @ %client.sex @ %client.race @ Armor; %client.armor = $DefaultPlayerArmor; %player = new Player() { //dataBlock = $DefaultPlayerArmor; dataBlock = %armor; }; if(%respawn) { %player.setInvincible(true); %player.setCloaked(true); %player.setInvincibleMode($InvincibleTime,0.02); %player.respawnCloakThread = %player.schedule($InvincibleTime * 1000, "setRespawnCloakOff"); %player.schedule($InvincibleTime * 1000, "setInvincible", false); } %player.setTransform( %spawnLoc ); MissionCleanup.add(%player); // setup some info %player.setOwnerClient(%client); %player.team = %client.team; %client.outOfBounds = false; %player.setEnergyLevel(60); %client.player = %player; // updates client's target info for this player %player.setTarget(%client.target); setTargetDataBlock(%client.target, %player.getDatablock()); setTargetSensorData(%client.target, PlayerSensor); setTargetSensorGroup(%client.target, %client.team); %client.setSensorGroup(%client.team); //make sure the player has been added to the team rank array... %game.populateTeamRankArray(%client); %game.playerSpawned(%client.player); } function Player::setRespawnCloakOff(%player) { %player.setCloaked(false); %player.respawnCloakThread = ""; } //------------------------------------------------------------ function DefaultGame::startMatch(%game) { echo("START MATCH"); MessageAll('MsgMissionStart', "\c2Match started!"); //the match has been started, clear the team rank array, and repopulate it... for (%i = 0; %i < 32; %i++) %game.clearTeamRankArray(%i); //used in BountyGame, prolly in a few others as well... $matchStarted = true; %game.clearDeployableMaxes(); $missionStartTime = getSimTime(); %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000); // schedule first timeLimit check for 20 seconds if(%game.class !$= "SiegeGame") { %game.timeCheck = %game.schedule(20000, "checkTimeLimit"); } //schedule the end of match countdown EndCountdown($Host::TimeLimit * 60 * 1000); //reset everyone's score and add them to the team rank array for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); %game.resetScore(%cl); %game.populateTeamRankArray(%cl); } // set all clients control to their player %count = ClientGroup.getCount(); for( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject(%i); // Siege game will set the clock differently if(%game.class !$= "SiegeGame") messageClient(%cl, 'MsgSystemClock', "", $Host::TimeLimit, %curTimeLeftMS); if( !$Host::TournamentMode && %cl.matchStartReady && %cl.camera.mode $= "pre-game") { commandToClient(%cl, 'setHudMode', 'Standard'); %cl.setControlObject( %cl.player ); } else { if( %cl.matchStartReady ) { if(%cl.camera.mode $= "pre-game") { %cl.observerMode = ""; commandToClient(%cl, 'setHudMode', 'Standard'); if(isObject(%cl.player)) %cl.setControlObject( %cl.player ); else echo("can't set control for client: " @ %cl @ ", no player object found!"); } else %cl.observerMode = "observerFly"; } } } // on with the show this is it! AISystemEnabled( true ); } function DefaultGame::gameOver( %game ) { //set the bool $missionRunning = false; CancelCountdown(); CancelEndCountdown(); //loop through all the clients, and do any cleanup... %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %client = ClientGroup.getObject(%i); %player = %client.player; %client.lastTeam = %client.team; if ( !%client.isAiControlled() ) { %client.endMission(); messageClient( %client, 'MsgClearDebrief', "" ); %game.sendDebriefing( %client ); if(%client.player.isBomber) commandToClient(%client, 'endBomberSight'); //clear the score hud... messageClient( %client, 'SetScoreHudHeader', "", "" ); messageClient( %client, 'SetScoreHudSubheader', "", ""); messageClient( %client, 'ClearHud', "", 'scoreScreen', 0 ); // clean up the players' HUDs: %client.setWeaponsHudClearAll(); %client.setInventoryHudClearAll(); } } // Default game does nothing... except lets the AI know the mission is over AIMissionEnd(); } //------------------------------------------------------------------------------ function DefaultGame::sendDebriefing( %game, %client ) { if ( %game.numTeams == 1 ) { // Mission result: %winner = $TeamRank[0, 0]; if ( %winner.score > 0 ) messageClient( %client, 'MsgDebriefResult', "", '%1 wins!', $TeamRank[0, 0].name ); else messageClient( %client, 'MsgDebriefResult', "", 'Nobody wins.' ); // Player scores: %count = $TeamRank[0, count]; messageClient( %client, 'MsgDebriefAddLine', "", 'PLAYERSCOREKILLS' ); for ( %i = 0; %i < %count; %i++ ) { %cl = $TeamRank[0, %i]; if ( %cl.score $= "" ) %score = 0; else %score = %cl.score; if ( %cl.kills $= "" ) %kills = 0; else %kills = %cl.kills; messageClient( %client, 'MsgDebriefAddLine', "", ' %1 %2 %3', %cl.name, %score, %kills ); } } else { %topScore = ""; %topCount = 0; for ( %team = 1; %team <= %game.numTeams; %team++ ) { if ( %topScore $= "" || $TeamScore[%team] > %topScore ) { %topScore = $TeamScore[%team]; %firstTeam = %team; %topCount = 1; } else if ( $TeamScore[%team] == %topScore ) { %secondTeam = %team; %topCount++; } } // Mission result: if ( %topCount == 1 ) messageClient( %client, 'MsgDebriefResult', "", 'Team %1 wins!', %game.getTeamName(%firstTeam) ); else if ( %topCount == 2 ) messageClient( %client, 'MsgDebriefResult', "", 'Team %1 and Team %2 tie!', %game.getTeamName(%firstTeam), %game.getTeamName(%secondTeam) ); else messageClient( %client, 'MsgDebriefResult', "", 'The mission ended in a tie.' ); // Team scores: messageClient( %client, 'MsgDebriefAddLine', "", 'TEAMSCORE' ); for ( %team = 1; %team - 1 < %game.numTeams; %team++ ) { if ( $TeamScore[%team] $= "" ) %score = 0; else %score = $TeamScore[%team]; messageClient( %client, 'MsgDebriefAddLine', "", ' %1 %2', %game.getTeamName(%team), %score ); } // Player scores: messageClient( %client, 'MsgDebriefAddLine', "", '\nPLAYERTEAMSCOREKILLS' ); for ( %team = 1; %team - 1 < %game.numTeams; %team++ ) %count[%team] = 0; %notDone = true; while ( %notDone ) { // Get the highest remaining score: %highScore = ""; for ( %team = 1; %team <= %game.numTeams; %team++ ) { if ( %count[%team] < $TeamRank[%team, count] && ( %highScore $= "" || $TeamRank[%team, %count[%team]].score > %highScore ) ) { %highScore = $TeamRank[%team, %count[%team]].score; %highTeam = %team; } } // Send the debrief line: %cl = $TeamRank[%highTeam, %count[%highTeam]]; %score = %cl.score $= "" ? 0 : %cl.score; %kills = %cl.kills $= "" ? 0 : %cl.kills; messageClient( %client, 'MsgDebriefAddLine', "", ' %1 %2 %3 %4', %cl.name, %game.getTeamName(%cl.team), %score, %kills ); %count[%highTeam]++; %notDone = false; for ( %team = 1; %team - 1 < %game.numTeams; %team++ ) { if ( %count[%team] < $TeamRank[%team, count] ) { %notDone = true; break; } } } } //now go through an list all the observers: %count = ClientGroup.getCount(); %printedHeader = false; for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team <= 0) { //print the header only if we actually find an observer if (!%printedHeader) { %printedHeader = true; messageClient(%client, 'MsgDebriefAddLine', "", '\nOBSERVERSSCORE'); } //print out the client %score = %cl.score $= "" ? 0 : %cl.score; messageClient( %client, 'MsgDebriefAddLine', "", ' %1 %2', %cl.name, %score); } } } //------------------------------------------------------------ function DefaultGame::clearDeployableMaxes(%game) { for(%i = 0; %i <= %game.numTeams; %i++) { $TeamDeployedCount[%i, TurretIndoorDeployable] = 0; $TeamDeployedCount[%i, TurretOutdoorDeployable] = 0; $TeamDeployedCount[%i, PulseSensorDeployable] = 0; $TeamDeployedCount[%i, MotionSensorDeployable] = 0; $TeamDeployedCount[%i, InventoryDeployable] = 0; $TeamDeployedCount[%i, DeployedCamera] = 0; $TeamDeployedCount[%i, MineDeployed] = 0; $TeamDeployedCount[%i, TargetBeacon] = 0; $TeamDeployedCount[%i, MarkerBeacon] = 0; } } // called from player scripts function DefaultGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %sourceObject) { //set the vars if it was a turret if (isObject(%sourceObject)) { %sourceClassType = %sourceObject.getDataBlock().getClassName(); %sourceType = %sourceObject.getDataBlock().getName(); } if (%sourceClassType $= "TurretData") { // jff: are there special turret types which makes this needed? // tinman: yes, we don't want bots stopping to fire on the big outdoor turrets, which they // will just get mowed down. deployables only. if (%sourceType $= "TurretDeployedFloorIndoor" || %sourceType $= "TurretDeployedWallIndoor" || %sourceType $= "TurretDeployedCeilingIndoor" || %sourceType $= "TurretDeployedOutdoor") { %clVictim.lastDamageTurretTime = getSimTime(); %clVictim.lastDamageTurret = %sourceObject; } %turretAttacker = %sourceObject.getControllingClient(); // should get a damagae message from friendly fire turrets also if(%turretAttacker && %turretAttacker != %clVictim && %turretAttacker.team == %clVictim.team) { if (%game.numTeams > 1 && %turretAttacker.player.causedRecentDamage != %clVictim.player) //is a teamgame & player just damaged a teammate { %turretAttacker.player.causedRecentDamage = %clVictim.player; %turretAttacker.player.schedule(1000, "causedRecentDamage", ""); //allow friendly fire message every x ms %game.friendlyFireMessage(%clVictim, %turretAttacker); } } } else if (%sourceClassType $= "PlayerData") { //now see if both were on the same team if(%clAttacker && %clAttacker != %clVictim && %clVictim.team == %clAttacker.team) { if (%game.numTeams > 1 && %clAttacker.player.causedRecentDamage != %clVictim.player) //is a teamgame & player just damaged a teammate { %clAttacker.player.causedRecentDamage = %clVictim.player; %clAttacker.player.schedule(1000, "causedRecentDamage", ""); //allow friendly fire message every x ms %game.friendlyFireMessage(%clVictim, %clAttacker); } } if (%clAttacker && %clAttacker != %clVictim) { %clVictim.lastDamageTime = getSimTime(); %clVictim.lastDamageClient = %clAttacker; if (%clVictim.isAIControlled()) %clVictim.clientDetected(%clAttacker); } } //call the game specific AI routines... if (isObject(%clVictim) && %clVictim.isAIControlled()) %game.onAIDamaged(%clVictim, %clAttacker, %damageType, %sourceObject); if (isObject(%clAttacker) && %clAttacker.isAIControlled()) %game.onAIFriendlyFire(%clVictim, %clAttacker, %damageType, %sourceObject); } function DefaultGame::friendlyFireMessage(%game, %damaged, %damager) { messageClient(%damaged, 'MsgDamagedByTeam', '\c1You were harmed by teammate %1', %damager.name); messageClient(%damager, 'MsgDamagedTeam', '\c1You just harmed teammate %1.', %damaged.name); } function DefaultGame::clearWaitRespawn(%game, %client) { %client.waitRespawn = 0; } // called from player scripts function DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation) { %plVictim = %clVictim.player; %plKiller = %clKiller.player; %clVictim.plyrPointOfDeath = %plVictim.position; %clVictim.plyrDiedHoldingFlag = %plVictim.holdingFlag; %clVictim.waitRespawn = 1; cancel( %plVictim.reCloak ); cancel(%clVictim.respawnTimer); %clVictim.respawnTimer = %game.schedule(($Host::PlayerRespawnTimeout * 1000), "forceObserver", %clVictim, "spawnTimeout" ); // reset the alarm for out of bounds if(%clVictim.outOfBounds) messageClient(%clVictim, 'EnterMissionArea', ""); if (%damageType == $DamageType::suicide) %respawnDelay = 10; else %respawnDelay = 2; %game.schedule(%respawnDelay*1000, "clearWaitRespawn", %clVictim); // if victim had an undetonated satchel charge pack, get rid of it if(%plVictim.thrownChargeId != 0) if(!%plVictim.thrownChargeId.kaboom) %plVictim.thrownChargeId.delete(); if(%plVictim.lastVehicle !$= "") { schedule(15000, %plVictim.lastVehicle,"vehicleAbandonTimeOut", %plVictim.lastVehicle); %plVictim.lastVehicle.lastPilot = ""; } // unmount pilot or remove sight from bomber if(%plVictim.isMounted()) { if(%plVictim.vehicleTurret) %plVictim.vehicleTurret.getDataBlock().playerDismount(%plVictim.vehicleTurret); else { %plVictim.getDataBlock().doDismount(%plVictim, true); %plVictim.mountVehicle = false; } } if(%plVictim.inStation) commandToClient(%plVictim.client,'setStationKeys', false); %clVictim.camera.mode = "playerDeath"; // reset who triggered this station and cancel outstanding armor switch thread if(%plVictim.station) { %plVictim.station.triggeredBy = ""; %plVictim.station.getDataBlock().stationTriggered(%plVictim.station,0); if(%plVictim.armorSwitchSchedule) cancel(%plVictim.armorSwitchSchedule); } //Close huds if player dies... messageClient(%clVictim, 'CloseHud', "", 'inventoryScreen'); messageClient(%clVictim, 'CloseHud', "", 'vehicleHud'); commandToClient(%clVictim, 'setHudMode', 'Standard', "", 0); // $weaponslot from item.cs %plVictim.setRepairRate(0); %plVictim.setImageTrigger($WeaponSlot, false); playDeathAnimation(%plVictim, %damageLocation, %damageType); playDeathCry(%plVictim); %victimName = %clVictim.name; %game.displayDeathMessages(%clVictim, %clKiller, %damageType, %implement); %game.updateKillScores(%clVictim, %clKiller, %damageType, %implement); // toss whatever is being carried, '$flagslot' from item.cs // MES - had to move this to after death message display because of Rabbit game type for(%index = 0 ; %index < 8; %index++) { %image = %plVictim.getMountedImage(%index); if(%image) { if(%index == $FlagSlot) %plVictim.throwObject(%plVictim.holdingFlag); else %plVictim.throw(%image.item); } } // target manager update setTargetDataBlock(%clVictim.target, 0); setTargetSensorData(%clVictim.target, 0); // clear the hud %clVictim.SetWeaponsHudClearAll(); %clVictim.SetInventoryHudClearAll(); %clVictim.setAmmoHudCount(-1); // clear out weapons, inventory and pack huds messageClient(%clVictim, 'msgDeploySensorOff', ""); //make sure the deploy hud gets shut off messageClient(%clVictim, 'msgPackIconOff', ""); // clear the pack icon //clear the deployable HUD %plVictim.client.deployPack = false; cancel(%plVictim.deployCheckThread); deactivateDeploySensor(%plVictim); //if the killer was an AI... if (isObject(%clKiller) && %clKiller.isAIControlled()) %game.onAIKilledClient(%clVictim, %clKiller, %damageType, %implement); // reset control object on this player: also sets 'playgui' as content serverCmdResetControlObject(%clVictim); // set control object to the camera %clVictim.player = 0; %transform = %plVictim.getTransform(); //note, AI's don't have a camera... if (isObject(%clVictim.camera)) { %clVictim.camera.setTransform(%transform); %clVictim.camera.setOrbitMode(%plVictim, %plVictim.getTransform(), 0.5, 4.5, 4.5); %clVictim.setControlObject(%clVictim.camera); } //hook in the AI specific code for when a client dies if (%clVictim.isAIControlled()) { aiReleaseHumanControl(%clVictim.controlByHuman, %clVictim); %game.onAIKilled(%clVictim, %clKiller, %damageType, %implement); } else aiReleaseHumanControl(%clVictim, %clVictim.controlAI); //used to track corpses so the AI can get ammo, etc... AICorpseAdded(%plVictim); //if the death was a suicide, prevent respawning for 5 seconds... %clVictim.lastDeathSuicide = false; if (%damageType == $DamageType::Suicide) { %clVictim.lastDeathSuicide = true; %clVictim.suicideRespawnTime = getSimTime() + 5000; } } function DefaultGame::forceObserver( %game, %client, %reason ) { //make sure we have a valid client... if (%client <= 0) return; // first kill this player if(%client.player) %client.player.scriptKill(0); if( %client.respawnTimer ) cancel(%client.respawnTimer); %client.respawnTimer = ""; // remove them from the team rank array %game.removeFromTeamRankArray(%client); // place them in observer mode %client.lastObserverSpawn = -1; %client.observerStartTime = getSimTime(); %adminForce = 0; switch$ ( %reason ) { case "playerChoose": %client.camera.getDataBlock().setMode( %client.camera, "observerFly" ); messageClient(%client, 'MsgClientJoinTeam', '\c2You have become an observer.', %client.name, %game.getTeamName(0), %client, 0 ); logEcho(%client.nameBase@" (cl "@%client@") entered observer mode"); %client.lastTeam = %client.team; case "AdminForce": %client.camera.getDataBlock().setMode( %client.camera, "observerFly" ); messageClient(%client, 'MsgClientJoinTeam', '\c2You have been forced into observer mode by the admin.', %client.name, %game.getTeamName(0), %client, 0 ); logEcho(%client.nameBase@" (cl "@%client@") was forced into observer mode by admin"); %client.lastTeam = %client.team; %adminForce = 1; if($Host::TournamentMode) { if(!$matchStarted) { if(%client.camera.Mode $= "pickingTeam") { commandToClient( %client, 'processPickTeam'); clearBottomPrint( %client ); } else { clearCenterPrint(%client); %client.notReady = true; } } } case "spawnTimeout": %client.camera.getDataBlock().setMode( %client.camera, "observerTimeout" ); messageClient(%client, 'MsgClientJoinTeam', '\c2You have been placed in observer mode due to delay in respawning.', %client.name, %game.getTeamName(0), %client, 0 ); logEcho(%client.nameBase@" (cl "@%client@") was placed in observer mode due to spawn delay"); // save the team the player was on - only if this was a delay in respawning %client.lastTeam = %client.team; } // switch client to team 0 (observer) %client.team = 0; %client.player.team = 0; setTargetSensorGroup( %client.target, %client.team ); %client.setSensorGroup( %client.team ); // set their control to the obs. cam %client.setControlObject( %client.camera ); commandToClient(%client, 'setHudMode', 'Observer'); // display the hud //displayObserverHud(%client, 0); updateObserverFlyHud(%client); // message everyone about this event if( !%adminForce ) messageAllExcept(%client, -1, 'MsgClientJoinTeam', '\c2%1 has become an observer.', %client.name, %game.getTeamName(0), %client, 0 ); else messageAllExcept(%client, -1, 'MsgClientJoinTeam', '\c2The admin has forced %1 to become an observer.', %client.name, %game.getTeamName(0), %client, 0 ); updateCanListenState( %client ); // call the onEvent for this game type %game.onClientEnterObserverMode(%client); //Bounty uses this to remove this client from others' hit lists } function DefaultGame::displayDeathMessages(%game, %clVictim, %clKiller, %damageType, %implement) { // ---------------------------------------------------------------------------------- // z0dd - ZOD, 6/18/02. From Panama Jack, send the damageTypeText as the last varible // in each death message so client knows what weapon it was that killed them. %victimGender = (%clVictim.sex $= "Male" ? 'him' : 'her'); %victimPoss = (%clVictim.sex $= "Male" ? 'his' : 'her'); %killerGender = (%clKiller.sex $= "Male" ? 'him' : 'her'); %killerPoss = (%clKiller.sex $= "Male" ? 'his' : 'her'); %victimName = %clVictim.name; %killerName = %clKiller.name; //error("DamageType = " @ %damageType @ ", implement = " @ %implement @ ", implement class = " @ %implement.getClassName() @ ", is controlled = " @ %implement.getControllingClient()); if(%damageType == $DamageType::Explosion) { messageAll('msgExplosionKill', $DeathMessageExplosion[mFloor(getRandom() * $DeathMessageExplosionCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by a nearby explosion."); } else if(%damageType == $DamageType::Suicide) //player presses cntrl-k { messageAll('msgSuicide', $DeathMessageSuicide[mFloor(getRandom() * $DeathMessageSuicideCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") committed suicide (CTRL-K)"); } else if(%damageType == $DamageType::VehicleSpawn) { messageAll('msgVehicleSpawnKill', $DeathMessageVehPad[mFloor(getRandom() * $DeathMessageVehPadCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by vehicle spawn"); } else if(%damageType == $DamageType::ForceFieldPowerup) { messageAll('msgVehicleSpawnKill', $DeathMessageFFPowerup[mFloor(getRandom() * $DeathMessageFFPowerupCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by Force Field Powerup"); } else if(%damageType == $DamageType::Crash) { messageAll('msgVehicleCrash', $DeathMessageVehicleCrash[%damageType, mFloor(getRandom() * $DeathMessageVehicleCrashCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") crashes a vehicle."); } else if(%damageType == $DamageType::Impact) // run down by vehicle { if( ( %controller = %implement.getControllingClient() ) > 0) { %killerGender = (%controller.sex $= "Male" ? 'him' : 'her'); %killerPoss = (%controller.sex $= "Male" ? 'his' : 'her'); %killerName = %controller.name; messageAll('msgVehicleKill', $DeathMessageVehicle[mFloor(getRandom() * $DeathMessageVehicleCount)], %victimName, %victimGender, %victimPoss, %killerName ,%killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by a vehicle controlled by "@%controller); } else { messageAll('msgVehicleKill', $DeathMessageVehicleUnmanned[mFloor(getRandom() * $DeathMessageVehicleUnmannedCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by a vehicle (unmanned)"); } } else if (isObject(%implement) && (%implement.getClassName() $= "Turret" || %implement.getClassName() $= "VehicleTurret" || %implement.getClassName() $= "FlyingVehicle" )) //player killed by a turret { if (%implement.getControllingClient() != 0) //is turret being controlled? { %controller = %implement.getControllingClient(); %killerGender = (%controller.sex $= "Male" ? 'him' : 'her'); %killerPoss = (%controller.sex $= "Male" ? 'his' : 'her'); %killerName = %controller.name; if (%controller == %clVictim) messageAll('msgTurretSelfKill', $DeathMessageTurretSelfKill[mFloor(getRandom() * $DeathMessageTurretSelfKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); else if (%controller.team == %clVictim.team) //controller TK'd a friendly messageAll('msgCTurretKill', $DeathMessageCTurretTeamKill[%damageType, mFloor(getRandom() * $DeathMessageCTurretTeamKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); else //controller killed an enemy messageAll('msgCTurretKill', $DeathMessageCTurretKill[%damageType, mFloor(getRandom() * $DeathMessageCTurretKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by a turret controlled by "@%controller); } // use the handle associated with the deployed object to verify valid owner else if (isObject(%implement.owner)) { %owner = %implement.owner; //error("Owner is " @ %owner @ " Handle is " @ %implement.ownerHandle); //error("Turret is still owned"); //turret is uncontrolled, but is owned - treat the same as controlled. %killerGender = (%owner.sex $= "Male" ? 'him' : 'her'); %killerPoss = (%owner.sex $= "Male" ? 'his' : 'her'); %killerName = %owner.name; if (%owner.team == %clVictim.team) //player got in the way of a teammates deployed but uncontrolled turret. messageAll('msgCTurretKill', $DeathMessageCTurretAccdtlKill[%damageType,mFloor(getRandom() * $DeathMessageCTurretAccdtlKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); else //deployed, uncontrolled turret killed an enemy messageAll('msgCTurretKill', $DeathMessageCTurretKill[%damageType,mFloor(getRandom() * $DeathMessageCTurretKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") was killed by turret (automated)"); } else //turret is not a placed (owned) turret (or owner is no longer on it's team), and is not being controlled { messageAll('msgTurretKill', $DeathMessageTurretKill[%damageType,mFloor(getRandom() * $DeathMessageTurretKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by turret"); } } else if((%clKiller == %clVictim) || (%damageType == $DamageType::Ground)) //player killed himself or fell to death { messageAll('msgSelfKill', $DeathMessageSelfKill[%damageType,mFloor(getRandom() * $DeathMessageSelfKillCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed self ("@getTaggedString($DamageTypeText[%damageType])@")"); } else if (%damageType == $DamageType::OutOfBounds) //killer died due to Out-of-Bounds damage { messageAll('msgOOBKill', $DeathMessageOOB[mFloor(getRandom() * $DeathMessageOOBCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by out-of-bounds damage"); } else if (%damageType == $DamageType::NexusCamping) //Victim died from camping near the nexus... { messageAll('msgCampKill', $DeathMessageCamping[mFloor(getRandom() * $DeathMessageCampingCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed for nexus camping"); } else if(%clKiller.team == %clVictim.team) //was a TK { messageAll('msgTeamKill', $DeathMessageTeamKill[%damageType, mFloor(getRandom() * $DeathMessageTeamKillCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") teamkilled by "@%clKiller.nameBase@" (pl "@%clKiller.player@"/cl "@%clKiller@")"); } else if (%damageType == $DamageType::Lava) //player died by falling in lava { messageAll('msgLavaKill', $DeathMessageLava[mFloor(getRandom() * $DeathMessageLavaCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by lava"); } else if ( %damageType == $DamageType::Lightning ) // player was struck by lightning { messageAll('msgLightningKill', $DeathMessageLightning[mFloor(getRandom() * $DeathMessageLightningCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by lightning"); } else if ( %damageType == $DamageType::Mine && !isObject(%clKiller) ) { error("Mine kill w/o source"); messageAll('MsgRogueMineKill', $DeathMessageRogueMine[%damageType, mFloor(getRandom() * $DeathMessageRogueMineCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); } else //was a legitimate enemy kill { if(%damageType == 6 && (%clVictim.headShot)) { // laser headshot just occurred messageAll('MsgHeadshotKill', $DeathMessageHeadshot[%damageType, mFloor(getRandom() * $DeathMessageHeadshotCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); } else messageAll('MsgLegitKill', $DeathMessage[%damageType, mFloor(getRandom() * $DeathMessageCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]); logEcho(%clVictim.nameBase@" (pl "@%clVictim.player@"/cl "@%clVictim@") killed by "@%clKiller.nameBase@" (pl "@%clKiller.player@"/cl "@%clKiller@") using "@getTaggedString($DamageTypeText[%damageType])); } } function DefaultGame::assignClientTeam(%game, %client, %respawn ) { //error("DefaultGame::assignClientTeam"); // this function is overwritten in non-team mission types (e.g. DM) // so these lines won't do anything //if(!%game.numTeams) //{ // setTargetSkin(%client.target, %client.skin); // return; //} // camera is responsible for creating a player // - counts the number of players per team // - puts this player on the least player count team // - sets the client's skin to the servers default %numPlayers = ClientGroup.getCount(); for(%i = 0; %i <= %game.numTeams; %i++) %numTeamPlayers[%i] = 0; for(%i = 0; %i < %numPlayers; %i = %i + 1) { %cl = ClientGroup.getObject(%i); if(%cl != %client) %numTeamPlayers[%cl.team]++; } %leastPlayers = %numTeamPlayers[1]; %leastTeam = 1; for(%i = 2; %i <= %game.numTeams; %i++) { if( (%numTeamPlayers[%i] < %leastPlayers) || ( (%numTeamPlayers[%i] == %leastPlayers) && ($teamScore[%i] < $teamScore[%leastTeam] ) )) { %leastTeam = %i; %leastPlayers = %numTeamPlayers[%i]; } } %client.team = %leastTeam; %client.lastTeam = %team; // Assign the team skin: if ( %client.isAIControlled() ) { if ( %leastTeam & 1 ) { %client.skin = addTaggedString( "basebot" ); setTargetSkin( %client.target, 'basebot' ); } else { %client.skin = addTaggedString( "basebbot" ); setTargetSkin( %client.target, 'basebbot' ); } } else setTargetSkin( %client.target, %game.getTeamSkin(%client.team) ); //setTargetSkin( %client.target, %client.skin ); // might as well standardize the messages //messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, $teamName[%leastTeam], %client, %leastTeam ); //messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', $client.name, $teamName[%client.team], %client, %client.team ); messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, %game.getTeamName(%client.team), %client, %client.team ); messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', %client.name, %game.getTeamName(%client.team), %client, %client.team ); updateCanListenState( %client ); logEcho(%client.nameBase@" (cl "@%client@") joined team "@%client.team); } function DefaultGame::getTeamSkin(%game, %team) { //error("DefaultGame::getTeamSkin"); %skin = $teamSkin[%team]; //error("%skin = " SPC getTaggedString(%skin)); return %skin; } function DefaultGame::getTeamName(%game, %team) { //error("DefaultGame::getTeamName"); %name = $teamName[%team]; //error("name = " SPC getTaggedString(%name)); return %name; } function DefaultGame::clientJoinTeam( %game, %client, %team, %respawn ) { //error("DefaultGame::clientJoinTeam"); if ( %team < 1 || %team > %game.numTeams ) return; if( %respawn $= "" ) %respawn = 1; %client.team = %team; %client.lastTeam = %team; setTargetSkin( %client.target, %game.getTeamSkin(%team) ); setTargetSensorGroup( %client.target, %team ); %client.setSensorGroup( %team ); // Spawn the player: %game.spawnPlayer( %client, %respawn ); messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, %game.getTeamName(%team), %client, %team ); messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', $client.name, %game.getTeamName(%client.team), %client, %client.team ); updateCanListenState( %client ); logEcho(%client.nameBase@" (cl "@%client@") joined team "@%client.team); } function DefaultGame::AIHasJoined(%game, %client) { //defined to prevent console spam } function DefaultGame::AIChangeTeam(%game, %client, %newTeam) { //make sure we're trying to drop an AI if (!isObject(%client) || !%client.isAIControlled()) return; //clear the ai from any objectives, etc... AIUnassignClient(%client); %client.stop(); %client.clearTasks(); %client.clearStep(); %client.lastDamageClient = -1; %client.lastDamageTurret = -1; %client.shouldEngage = -1; %client.setEngageTarget(-1); %client.setTargetObject(-1); %client.pilotVehicle = false; %client.defaultTasksAdded = false; //kill the player, which should cause the Game object to perform whatever cleanup is required. if (isObject(%client.player)) %client.player.scriptKill(0); //clean up the team rank array %game.removeFromTeamRankArray(%client); //assign the new team %client.team = %newTeam; if (%newTeam < 0) Game.assignClientTeam(%client); else { if ( %client.team & 1 ) { %client.skin = addTaggedString( "basebot" ); setTargetSkin( %client.target, 'basebot' ); } else { %client.skin = addTaggedString( "basebbot" ); setTargetSkin( %client.target, 'basebbot' ); } } messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1bot %1 has switched to team %2.', %client.name, %game.getTeamName(%client.team), %client, %client.team ); } function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs) { //error("DefaultGame::clientChangeTeam"); //first, remove the client from the team rank array //the player will be added to the new team array as soon as he respawns... %game.removeFromTeamRankArray(%client); %pl = %client.player; if(isObject(%pl)) { if(%pl.isMounted()) %pl.getDataBlock().doDismount(%pl); %pl.scriptKill(0); } // reset the client's targets and tasks only clientResetTargets(%client, true); // give this client a new handle to disassociate ownership of deployed objects if( %team $= "" && (%team > 0 && %team <= %game.numTeams)) { if( %client.team == 1 ) %client.team = 2; else %client.team = 1; } else %client.team = %team; // Set the client's skin: if (!%client.isAIControlled()) setTargetSkin( %client.target, %game.getTeamSkin(%client.team) ); setTargetSensorGroup( %client.target, %client.team ); %client.setSensorGroup( %client.team ); // Spawn the player: %client.lastSpawnPoint = %game.pickPlayerSpawn( %client ); %game.createPlayer( %client, %client.lastSpawnPoint, $MatchStarted ); if($MatchStarted) %client.setControlObject(%client.player); else { %client.camera.getDataBlock().setMode(%client.camera, "pre-game", %client.player); %client.setControlObject(%client.camera); } // call the onEvent for this game type %game.onClientEnterObserverMode(%client); //Bounty uses this to remove this client from others' hit lists if(%fromObs $= "" || !%fromObs) { messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 switched to team %2.', %client.name, %game.getTeamName(%client.team), %client, %client.team ); messageClient( %client, 'MsgClientJoinTeam', '\c1You switched to team %2.', $client.name, %game.getTeamName(%client.team), %client, %client.team ); } else { messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined team %2.', %client.name, %game.getTeamName(%client.team), %client, %team ); messageClient( %client, 'MsgClientJoinTeam', '\c1You joined team %2.', $client.name, %game.getTeamName(%client.team), %client, %client.team ); } updateCanListenState( %client ); // MES - switch objective hud lines when client switches teams messageClient(%client, 'MsgCheckTeamLines', "", %client.team); logEcho(%client.nameBase@" (cl "@%client@") switched to team "@%client.team); } // missioncleanup and missiongroup are checked prior to entering game code function DefaultGame::missionLoadDone(%game) { // walks through the mission group and sets the power stuff up // - groups get initialized with power count 0 then iterated to // increment powercount if an object within is powered // - powers objects up/down //MissionGroup.objectiveInit(); MissionGroup.clearPower(); MissionGroup.powerInit(0); %game.initGameVars(); //set up scoring variables and other game specific globals // make team0 visible/friendly to all setSensorGroupAlwaysVisMask(0, 0xffffffff); setSensorGroupFriendlyMask(0, 0xffffffff); // update colors: // - enemy teams are red // - same team is green // - team 0 is white for(%i = 0; %i < 32; %i++) { %team = (1 << %i); setSensorGroupColor(%i, %team, "0 255 0 255"); setSensorGroupColor(%i, ~%team, "255 0 0 255"); setSensorGroupColor(%i, 1, "255 255 255 255"); // setup the team targets (alwyas friendly and visible to same team) setTargetAlwaysVisMask(%i, %team); setTargetFriendlyMask(%i, %team); } //set up the teams %game.setUpTeams(); //clear out the team rank array... for (%i = 0; %i < 32; %i++) $TeamRank[%i, count] = ""; // objectiveInit has to take place after setupTeams -- objective HUD relies on flags // having their team set MissionGroup.objectiveInit(); //initialize the AI system %game.aiInit(); //need to reset the teams if we switch from say, CTF to Bounty... // assign the bots team if ($currentMissionType !$= $previousMissionType) { $previousMissionType = $currentMissionType; for(%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.isAIControlled()) %game.assignClientTeam(%cl); } } //Save off respawn or Siege Team switch information... if(%game.class !$= "SiegeGame") MissionGroup.setupPositionMarkers(true); echo("Default game mission load done."); } function DefaultGame::onClientLeaveGame(%game, %client) { // if there is a player attached to this client, kill it if( isObject(%client.player)) %client.player.scriptKill(0); //cancel a scheduled call... cancel(%client.respawnTimer); %client.respawnTimer = ""; //remove them from the team rank arrays %game.removeFromTeamRankArray(%client); logEcho(%client.nameBase@" (cl "@%client@") dropped"); } function DefaultGame::clientMissionDropReady(%game, %client) { //synchronize the clock HUD messageClient(%client, 'MsgSystemClock', "", 0, 0); %game.sendClientTeamList( %client ); %game.setupClientHuds( %client ); if($CurrentMissionType $= "SinglePlayer") { //CommandToClient( %client, 'setPlayContent'); return; } %observer = false; if( !$Host::TournamentMode ) { if( %client.camera.mode $= "observerFly" || %client.camera.mode $= "justJoined") { %observer = true; %client.observerStartTime = getSimTime(); commandToClient(%client, 'setHudMode', 'Observer'); %client.setControlObject( %client.camera ); //displayObserverHud( %client, 0 ); updateObserverFlyHud(%client); } if( !%observer ) { if(!$MatchStarted && !$CountdownStarted) // server has not started anything yet { %client.setControlObject( %client.camera ); commandToClient(%client, 'setHudMode', 'Observer'); } else if(!$MatchStarted && $CountdownStarted) // server has started the countdown { commandToClient(%client, 'setHudMode', 'Observer'); %client.setControlObject( %client.camera ); } else { commandToClient(%client, 'setHudMode', 'Standard'); // the game has already started %client.setControlObject( %client.player ); } } } else { // set all players into obs mode. setting the control object will handle further procedures... %client.camera.getDataBlock().setMode( %client.camera, "ObserverFly" ); commandToClient(%client, 'setHudMode', 'Observer'); %client.setControlObject( %client.camera ); messageAll( 'MsgClientJoinTeam', "",%client.name, $teamName[0], %client, 0 ); %client.team = 0; if( !$MatchStarted && !$CountdownStarted) { if($TeamDamage) %damMess = "ENABLED"; else %damMess = "DISABLED"; if(%game.numTeams > 1) BottomPrint(%client, "Server is Running in Tournament Mode.\nPick a Team\nTeam Damage is " @ %damMess, 0, 3 ); } else { BottomPrint( %client, "\nServer is Running in Tournament Mode", 0, 3 ); } } //make sure the objective HUD indicates your team on top and in green... if (%client.team > 0) messageClient(%client, 'MsgCheckTeamLines', "", %client.team); // were ready to go. %client.matchStartReady = true; echo("Client" SPC %client SPC "is ready."); if ( isDemo() ) { if ( %client.demoJustJoined ) { %client.demoJustJoined = false; centerPrint( %client, "Welcome to the Tribes 2 Demo." NL "You have been assigned the name \"" @ %client.nameBase @ "\"." NL "Press FIRE to join the game.", 0, 3 ); } } } function DefaultGame::sendClientTeamList(%game, %client) { // Send the client the current team list: %teamCount = %game.numTeams; for ( %i = 0; %i < %teamCount; %i++ ) { if ( %i > 0 ) %teamList = %teamList @ "\n"; %teamList = %teamList @ detag( getTaggedString( %game.getTeamName(%i + 1) ) ); } messageClient( %client, 'MsgTeamList', "", %teamCount, %teamList ); } function DefaultGame::setupClientHuds(%game, %client) { // tell the client to setup the huds... for(%i =0; %i<$WeaponsHudCount; %i++) %client.setWeaponsHudBitmap(%i, $WeaponsHudData[%i, itemDataName], $WeaponsHudData[%i, bitmapName]); for(%i =0; %i<$InventoryHudCount; %i++) { if ( $InventoryHudData[%i, slot] != 0 ) %client.setInventoryHudBitmap($InventoryHudData[%i, slot], $InventoryHudData[%i, itemDataName], $InventoryHudData[%i, bitmapName]); } %client.setInventoryHudBitmap( 0, "", "gui/hud_handgren" ); %client.setWeaponsHudBackGroundBmp("gui/hud_new_panel"); %client.setWeaponsHudHighLightBmp("gui/hud_new_weaponselect"); %client.setWeaponsHudInfiniteAmmoBmp("gui/hud_infinity"); %client.setInventoryHudBackGroundBmp("gui/hud_new_panel"); // tell the client if we are protecting statics (so no health bar will be displayed) commandToClient(%client, 'protectingStaticObjects', %game.allowsProtectedStatics()); commandToClient(%client, 'setPowerAudioProfiles', sPowerUp.getId(), sPowerDown.getId()); } function DefaultGame::testDrop( %game, %client ) { %game.clientJoinTeam( %client, 1, false ); %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); %client.setControlObject( %client.camera ); CommandToClient( %client, 'setPlayContent' ); } function DefaultGame::onClientEnterObserverMode( %game, %client ) { // Default game doesn't care... } // from 'item.cs' function DefaultGame::playerTouchFlag(%game, %player, %flag) { messageAll('MsgPlayerTouchFlag', 'Player %1 touched flag %2', %player, %flag); } // from 'item.cs' function DefaultGame::playerDroppedFlag(%game, %player, %flag) { messageAll('MsgPlayerDroppedFlag', 'Player %1 dropped flag %2', %player, %flag); } // from 'staticShape.cs' function DefaultGame::flagStandCollision(%game, %dataBlock, %obj, %colObj) { // for retreiveGame } function DefaultGame::notifyMineDeployed(%game, %mine) { //do nothign in the default game... } // from 'staticshape.cs' function DefaultGame::findProjector(%game, %flipflop) { // search the flipflop's folder for a holo projector // if one exists, associate it with the flipflop %flipflop.projector = 0; %folder = %flipflop.getGroup(); for(%i = 0; %i < %folder.getCount(); %i++) { %proj = %folder.getObject(%i); if(%proj.getDatablock().getName() $= "LogoProjector") { %flipflop.projector = %proj; %flipflop.projector.holo = 0; break; } } } //****************************************************************************** //* DefaultGame Trigger - Functions * //****************************************************************************** /// -Trigger- ////////////////////////////////////////////////////////////////// //Function -- onEnterTrigger (%game, %name, %data, %obj, %colObj) // %game = Current game type object // %name = Trigger name - defined when trigger is created // %data = Trigger Data Block // %obj = Trigger Object // %colObj = Object that collided with the trigger //Decription -- Called when trigger has been triggered //////////////////////////////////////////////////////////////////////////////// // from 'trigger.cs' function DefaultGame::onEnterTrigger(%game, %triggerName, %data, %obj, %colobj) { //Do Nothing } /// -Trigger- ////////////////////////////////////////////////////////////////// //Function -- onLeaveTrigger (%game, %name, %data, %obj, %colObj) // %game = Current game type object // %name = Trigger name - defined when trigger is created // %data = Trigger Data Block // %obj = Trigger Object // %colObj = Object that collided with the trigger //Decription -- Called when trigger has been untriggered //////////////////////////////////////////////////////////////////////////////// // from 'trigger.cs' function DefaultGame::onLeaveTrigger(%game, %triggerName, %data, %obj, %colobj) { //Do Nothing } /// -Trigger- ////////////////////////////////////////////////////////////////// //Function -- onTickTrigger(%game, %name, %data, %obj) // %game = Current game type object // %name = Trigger name - defined when trigger is created // %data = Trigger Data Block // %obj = Trigger Object //Decription -- Called every tick if triggered //////////////////////////////////////////////////////////////////////////////// // from 'trigger.cs' function DefaultGame::onTickTrigger(%game, %triggerName, %data, %obj) { //Do Nothing } function DefaultGame::setUpTeams(%game) { %group = nameToID("MissionGroup/Teams"); if(%group == -1) return; // create a team0 if it does not exist %team = nameToID("MissionGroup/Teams/team0"); if(%team == -1) { %team = new SimGroup("team0"); %group.add(%team); } // 'team0' is not counted as a team here %game.numTeams = 0; while(%team != -1) { // create drop set and add all spawnsphere objects into it %dropSet = new SimSet("TeamDrops" @ %game.numTeams); MissionCleanup.add(%dropSet); %spawns = nameToID("MissionGroup/Teams/team" @ %game.numTeams @ "/SpawnSpheres"); if(%spawns != -1) { %count = %spawns.getCount(); for(%i = 0; %i < %count; %i++) %dropSet.add(%spawns.getObject(%i)); } // set the 'team' field for all the objects in this team %team.setTeam(%game.numTeams); clearVehicleCount(%team+1); // get next group %team = nameToID("MissionGroup/Teams/team" @ %game.numTeams + 1); if (%team != -1) %game.numTeams++; } // set the number of sensor groups (including team0) that are processed setSensorGroupCount(%game.numTeams + 1); } function SimGroup::setTeam(%this, %team) { for (%i = 0; %i < %this.getCount(); %i++) { %obj = %this.getObject(%i); switch$ (%obj.getClassName()) { case SpawnSphere : if($MatchStarted) { // find out what team the spawnsphere used to belong to %found = false; for(%l = 1; %l <= Game.numTeams; %l++) { %drops = nameToId("MissionCleanup/TeamDrops" @ %l); for(%j = 0; %j < %drops.getCount(); %j++) { %current = %drops.getObject(%j); if(%current == %obj) %found = %l; } } if(%team != %found) Game.claimSpawn(%obj, %team, %found); else error("spawn "@%obj@" is already on team "@%team@"!"); } else Game.claimSpawn(%obj, %team, ""); case SimGroup : %obj.setTeam(%team); default : %obj.team = %team; } if(%obj.getType() & $TypeMasks::GameBaseObjectType) { // eeck.. please go away when scripts get cleaned... // ----------------------------------------------------------------------------- // z0dd - ZOD, 5/8/02. Part of re-write of Vehicle // station creation. Do not need this code anymore. //if(%obj.getDataBlock().getName() $= "StationVehiclePad") //{ // %team = %obj.team; // %obj = %obj.station; // %obj.team = %team; //%obj.teleporter.team = %team; //} %target = %obj.getTarget(); if(%target != -1) setTargetSensorGroup(%target, %team); } } } function DefaultGame::claimSpawn(%game, %obj, %newTeam, %oldTeam) { if(%newTeam == %oldTeam) return; %newSpawnGroup = nameToId("MissionCleanup/TeamDrops" @ %newTeam); if(%oldTeam !$= "") { %oldSpawnGroup = nameToId("MissionCleanup/TeamDrops" @ %oldTeam); %oldSpawnGroup.remove(%obj); } %newSpawnGroup.add(%obj); } // recursive function to assign teams to all mission objects function SimGroup::swapTeams(%this) { // used in Siege only Game.groupSwapTeams(%this); } function ShapeBase::swapTeams(%this) { // used in Siege only Game.objectSwapTeams(%this); } function GameBase::swapTeams(%this) { // used in Siege only Game.objectSwapTeams(%this); } function TSStatic::swapTeams(%this) { // used in Siege only // do nothing } function InteriorInstance::swapTeams(%this) { // used in Siege only // do nothing -- interiors don't switch teams } function SimGroup::swapVehiclePads(%this) { // used in Siege only Game.groupSwapVehiclePads(%this); } function ShapeBase::swapVehiclePads(%this) { // used in Siege only Game.objectSwapVehiclePads(%this); } function GameBase::swapVehiclePads(%this) { // used in Siege only // do nothing -- only searching for vehicle pads } function InteriorInstance::swapVehiclePads(%this) { // used in Siege only // do nothing -- only searching for vehicle pads } function SimSet::swapVehiclePads(%this) { // used in Siege only // do nothing -- only searching for vehicle pads } function PhysicalZone::swapVehiclePads(%this) { // used in Siege only // do nothing -- only searching for vehicle pads } function SimGroup::objectRestore(%this) { // used in Siege only Game.groupObjectRestore(%this); } function ShapeBase::objectRestore(%object) { // only used for Siege Game.shapeObjectRestore(%object); } function Turret::objectRestore(%object) { // only used for Siege Game.shapeObjectRestore(%object); } function AIObjective::objectRestore(%object) { // only used for Siege // don't do anything for AI Objectives } function DefaultGame::checkObjectives(%game) { //any special objectives that can be met by gametype //none for default game } //--------------------------------------------------- function DefaultGame::checkTimeLimit(%game, %forced) { // Don't add extra checks: if ( %forced ) cancel( %game.timeCheck ); // if there is no time limit, check back in a minute to see if it's been set if(($Host::TimeLimit $= "") || $Host::TimeLimit == 0) { %game.timeCheck = %game.schedule(20000, "checkTimeLimit"); return; } %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); if (%curTimeLeftMS <= 0) { // time's up, put down your pencils %game.timeLimitReached(); } else { if(%curTimeLeftMS >= 20000) %game.timeCheck = %game.schedule(20000, "checkTimeLimit"); else %game.timeCheck = %game.schedule(%curTimeLeftMS + 1, "checkTimeLimit"); //now synchronize everyone's clock messageAll('MsgSystemClock', "", $Host::TimeLimit, %curTimeLeftMS); } } function listplayers() { for(%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); %status = ""; if(%cl.isAiControlled()) %status = "Bot "; if(%cl.isSmurf) %status = "Alias "; if(%cl.isAdmin) %status = %status @ "Admin "; if(%cl.isSuperAdmin) %status = %status @ "SuperAdmin "; if(%status $= "") %status = ""; echo("client: " @ %cl @ " player: " @ %cl.player @ " name: " @ %cl.nameBase @ " team: " @ %cl.team @ " status: " @ %status); } } function DefaultGame::clearTeamRankArray(%game, %team) { %count = $TeamRank[%team, count]; for (%i = 0; %i < %count; %i++) $TeamRank[%team, %i] = ""; $TeamRank[%team, count] = 0; } function DefaultGame::populateTeamRankArray(%game, %client) { //this function should be called *after* the client has been added to a team... if (%client <= 0 || %client.team <= 0) return; //find the team if (%game.numTeams == 1) %team = 0; else %team = %client.team; //find the number of teammates already ranked... %count = $TeamRank[%team, count]; if (%count $= "") { $TeamRank[%team, count] = 0; %count = 0; } //make sure we're not already in the array for (%i = 0; %i < %count; %i++) { if ($TeamRank[%team, %i] == %client) return; } //add the client in at the bottom of the list, and increment the count $TeamRank[%team, %count] = %client; $TeamRank[%team, count] = $TeamRank[%team, count] + 1; //now recalculate the team rank for this player %game.recalcTeamRanks(%client); } function DefaultGame::removeFromTeamRankArray(%game, %client) { //note, this should be called *before* the client actually switches teams or drops... if (%client <= 0 || %client.team <= 0) return; //find the correct team if (%game.numTeams == 1) %team = 0; else %team = %client.team; //now search throught the team rank array, looking for this client %count = $TeamRank[%team, count]; for (%i = 0; %i < %count; %i++) { if ($TeamRank[%team, %i] == %client) { //we've found the client in the array, now loop through, and move everyone else up a rank for (%j = %i + 1; %j < %count; %j++) { %cl = $TeamRank[%team, %j]; $TeamRank[%team, %j - 1] = %cl; messageClient(%cl, 'MsgYourRankIs', "", %j); } $TeamRank[%team, %count - 1] = ""; //now decrement the team rank array count, and break $TeamRank[%team, count] = $TeamRank[%team, count] - 1; break; } } } function DefaultGame::recalcTeamRanks(%game, %client) { if (%client <= 0 || %client.team <= 0) return; // this is a little confusing -- someone's actual numerical rank is always // one number higher than his index in the $TeamRank array // (e.g. person ranked 1st has index of 0) // TINMAN: I'm going to remove the %client.teamRank field - the index in the // $TeamRank array already contains their rank - safer to search the array than // to maintiain the information in a separate variable... //find the team, the client in the team array if (%game.numTeams == 1) %team = 0; else %team = %client.team; %count = $TeamRank[%team, count]; %index = -1; for (%i = 0; %i < %count; %i++) { if ($TeamRank[%team, %i] == %client) { %index = %i; break; } } //if they weren't found in the array, return if (%index < 0) return; //make sure far down the array as they should be... %tempIndex = %index; %swapped = false; while (true) { if (%tempIndex <= 0) break; %tempIndex--; %tempClient = $TeamRank[%team, %tempIndex]; //see if we should swap the two if (%client.score > %tempClient.score) { %swapped = true; %index = %tempIndex; $TeamRank[%team, %tempIndex] = %client; $TeamRank[%team, %tempIndex + 1] = %tempClient; messageClient(%tempClient, 'MsgYourRankIs', "", %tempIndex + 2); } } //if we've swapped up at least once, we obviously won't need to swap down as well... if (%swapped) { messageClient(%client, 'MsgYourRankIs', "", %index + 1); return; } //since we didnt' swap up, see if we need to swap down... %tempIndex = %index; %swapped = false; while (true) { if (%tempIndex >= %count - 1) break; %tempIndex++; %tempClient = $TeamRank[%team, %tempIndex]; //see if we should swap the two if (%client.score < %tempClient.score) { %swapped = true; %index = %tempIndex; $TeamRank[%team, %tempIndex] = %client; $TeamRank[%team, %tempIndex - 1] = %tempClient; messageClient(%tempClient, 'MsgYourRankIs', "", %tempIndex); } } //send the message (regardless of whether a swap happened or not) messageClient(%client, 'MsgYourRankIs', "", %index + 1); } function DefaultGame::recalcScore(%game, %cl) { %game.recalcTeamRanks(%cl); } function DefaultGame::testKill(%game, %victimID, %killerID) { return ((%killerID !=0) && (%victimID.team != %killerID.team)); } function DefaultGame::testSuicide(%game, %victimID, %killerID, %damageType) { return ((%victimID == %killerID) || (%damageType == $DamageType::Ground) || (%damageType == $DamageType::Suicide)); } function DefaultGame::testTeamKill(%game, %victimID, %killerID) { return (%killerID.team == %victimID.team); } function DefaultGame::testTurretKill(%game, %implement) { if(%implement == 0) return false; else return (%implement.getClassName() $= "Turret"); } // function DefaultGame::awardScoreFlagCap(%game, %cl) // { // %cl.flagCaps++; // $TeamScore[%cl.team] += %game.SCORE_PER_TEAM_FLAG_CAP; // messageAll('MsgCTFTeamScore', "", %cl.team, $TeamScore[%cl.team]); // // if (%game.SCORE_PER_PLYR_FLAG_CAP > 1) // %plural = "s"; // else // %plural = ""; // // if (%game.SCORE_PER_PLYR_FLAG_CAP != 0) // messageClient(%cl, 'scoreFlaCapMsg', 'You received %1 point%2 for capturing the flag.', %game.SCORE_PER_PLYR_FLAG_CAP, %plural); // %game.recalcScore(%cl); // } function DefaultGame::testOOBDeath(%game, %damageType) { return (%damageType == $DamageType::OutOfBounds); } function DefaultGame::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.turretKills++; %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 DefaultGame::awardScoreDeath(%game, %victimID) { %victimID.deaths++; if ( %game.SCORE_PER_DEATH != 0 ) { // %plural = (abs(%game.SCORE_PER_DEATH) != 1 ? "s" : ""); // messageClient(%victimID, 'MsgScoreDeath', '\c0You have been penalized %1 point%2 for dying.', abs(%game.SCORE_PER_DEATH), %plural); %game.recalcScore(%victimID); } } function DefaultGame::awardScoreKill(%game, %killerID) { %killerID.kills++; %game.recalcScore(%killerID); } function DefaultGame::awardScoreSuicide(%game, %victimID) { %victimID.suicides++; // if (%game.SCORE_PER_SUICIDE != 0) // messageClient(%victimID, 'MsgScoreSuicide', '\c0You have been penalized for killing yourself.'); %game.recalcScore(%victimID); } function DefaultGame::awardScoreTeamkill(%game, %victimID, %killerID) { %killerID.teamKills++; if (%game.SCORE_PER_TEAMKILL != 0) messageClient(%killerID, 'MsgScoreTeamkill', '\c0You have been penalized for killing teammate %1.', %victimID.name); %game.recalcScore(%killerID); } function DefaultGame::awardScoreTurretTeamKill(%game, %victimID, %killerID) { %killerID.teamKills++; if (%game.SCORE_PER_TEAMKILL != 0) messageClient(%killerID, 'MsgScoreTeamkill', '\c0You have been penalized for killing your teammate %1, with a turret.', %victimID.name); %game.recalcScore(%killerID); } function DefaultGame::objectRepaired(%game, %obj, %objName) { %item = %obj.getDataBlock().getName(); //echo("Item repaired is a " @ %item); switch$ (%item) { case generatorLarge : %game.genOnRepaired(%obj, %objName); case stationInventory : %game.stationOnRepaired(%obj, %objName); case sensorMediumPulse : %game.sensorOnRepaired(%obj, %objName); case sensorLargePulse : %game.sensorOnRepaired(%obj, %objName); case turretBaseLarge : %game.turretOnRepaired(%obj, %objName); case stationVehicle : %game.vStationOnRepaired(%obj, %objName); default: //unused by current gametypes. Add more checks here if desired } } function DefaultGame::allowsProtectedStatics(%game) { return false; } // jff: why is game object doing this? //Return a simple string with no extras function DefaultGame::cleanWord(%game, %this) { %length = strlen(%this); for(%i = 0; %i < %length; %i++) { %char = getSubStr(%this, %i, 1); if(%char $= "_") { %next = getSubStr(%this, (%i+1), 1); if(%next $= "_") { %char = "'"; //apostrophe (2 chars) %i++; } else %char = " "; //space } %clean = (%clean @ %char); } } function DefaultGame::stationOnEnterTrigger(%game, %data, %obj, %colObj) { return true; } function DefaultGame::WeaponOnUse(%game, %data, %obj) { return true; } function DefaultGame::HandInvOnUse(%game, %data, %obj) { return true; } function DefaultGame::WeaponOnInventory(%game, %this, %obj, %amount) { return true; } function DefaultGame::ObserverOnTrigger(%game, %data, %obj, %trigger, %state) { return true; } // jff: why is the game being notified that a weapon is being thrown? hot potato gametype? function DefaultGame::ShapeThrowWeapon(%game, %this) { return true; } function DefaultGame::leaveMissionArea(%game, %playerData, %player) { if(%player.getState() $= "Dead") return; %player.client.outOfBounds = true; messageClient(%player.client, 'LeaveMissionArea', '\c1You left the mission area.~wfx/misc/warning_beep.wav'); } function DefaultGame::enterMissionArea(%game, %playerData, %player) { if(%player.getState() $= "Dead") return; %player.client.outOfBounds = false; messageClient(%player.client, 'EnterMissionArea', '\c1You are back in the mission area.'); } //------------------------------------------------------------------------------ // AI stubs: //------------------------------------------------------------------------------ function DefaultGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType, %sourceObject) { } function DefaultGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %sourceObject) { } function DefaultGame::onAIKilled(%game, %clVictim, %clKiller, %damageType, %implement) { //unassign the client from any objectives AIUnassignClient(%clVictim); //break the link, if this ai is controlled aiReleaseHumanControl(%clVictim.controlByHuman, %clVictim); //and schedule the respawn %clVictim.respawnThread = schedule(5000, %clVictim, "onAIRespawn", %clVictim); } function DefaultGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement) { %clAttacker.setVictim(%clVictim, %clVictim.player); } //------------------------------------------------------------------------------ // Voting stuff: //------------------------------------------------------------------------------ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %key ) { if( !%targetClient.matchStartReady ) return; %isAdmin = ( %client.isAdmin || %client.isSuperAdmin ); %isTargetSelf = ( %client == %targetClient ); %isTargetAdmin = ( %targetClient.isAdmin || %targetClient.isSuperAdmin ); %isTargetBot = %targetClient.isAIControlled(); %isTargetObserver = ( %targetClient.team == 0 ); %outrankTarget = false; if ( %client.isSuperAdmin ) %outrankTarget = !%targetClient.isSuperAdmin; else if ( %client.isAdmin ) %outrankTarget = !%targetClient.isAdmin; if( %client.isSuperAdmin && %targetClient.guid != 0 && !isDemo() ) { messageClient( %client, 'MsgPlayerPopupItem', "", %key, "addAdmin", "", 'Add to Server Admin List', 10); messageClient( %client, 'MsgPlayerPopupItem', "", %key, "addSuperAdmin", "", 'Add to Server SuperAdmin List', 11); } //mute options if ( !%isTargetSelf ) { if ( %client.muted[%targetClient] ) messageClient( %client, 'MsgPlayerPopupItem', "", %key, "MutePlayer", "", 'Unmute Text Chat', 1); else messageClient( %client, 'MsgPlayerPopupItem', "", %key, "MutePlayer", "", 'Mute Text Chat', 1); if ( !%isTargetBot && %client.canListenTo( %targetClient ) ) { if ( %client.getListenState( %targetClient ) ) messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ListenPlayer", "", 'Disable Voice Com', 9 ); else messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ListenPlayer", "", 'Enable Voice Com', 9 ); } } if( !%client.canVote && !%isAdmin ) return; // regular vote options on players if ( %game.scheduleVote $= "" && !%isAdmin && !%isTargetAdmin ) { if ( $Host::allowAdminPlayerVotes && !%isTargetBot && !isDemo() ) messageClient( %client, 'MsgPlayerPopupItem', "", %key, "AdminPlayer", "", 'Vote to Make Admin', 2 ); if ( !%isTargetSelf ) { messageClient( %client, 'MsgPlayerPopupItem', "", %key, "KickPlayer", "", 'Vote to Kick', 3 ); } } // Admin only options on players: else if ( %isAdmin && !isDemo() ) { if ( !%isTargetBot && !%isTargetAdmin ) messageClient( %client, 'MsgPlayerPopupItem', "", %key, "AdminPlayer", "", 'Make Admin', 2 ); if ( !%isTargetSelf && %outrankTarget ) { messageClient( %client, 'MsgPlayerPopupItem', "", %key, "KickPlayer", "", 'Kick', 3 ); if ( !%isTargetBot ) { if( %client.isSuperAdmin ) messageClient( %client, 'MsgPlayerPopupItem', "", %key, "BanPlayer", "", 'Ban', 4 ); if ( !%isTargetObserver ) messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ToObserver", "", 'Force observer', 5 ); } } if ( %isTargetSelf || %outrankTarget ) { if ( %game.numTeams > 1 ) { if ( %isTargetObserver ) { %action = %isTargetSelf ? "Join " : "Change to "; %str1 = %action @ getTaggedString( %game.getTeamName(1) ); %str2 = %action @ getTaggedString( %game.getTeamName(2) ); messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ChangeTeam", "", %str1, 6 ); messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ChangeTeam", "", %str2, 7 ); } else { %changeTo = %targetClient.team == 1 ? 2 : 1; %str = "Switch to " @ getTaggedString( %game.getTeamName(%changeTo) ); %caseId = 5 + %changeTo; messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ChangeTeam", "", %str, %caseId ); } } else if ( %isTargetObserver ) { %str = %isTargetSelf ? 'Join the Game' : 'Add to Game'; messageClient( %client, 'MsgPlayerPopupItem', "", %key, "JoinGame", "", %str, 8 ); } } } } //------------------------------------------------------------------------------ function DefaultGame::sendGameVoteMenu( %game, %client, %key ) { %isAdmin = ( %client.isAdmin || %client.isSuperAdmin ); %multipleTeams = %game.numTeams > 1; // no one is going anywhere until this thing starts if($MatchStarted) { // Client options: if ( %client.team != 0 ) { if ( %multipleTeams ) if( !$Host::TournamentMode ) messageClient( %client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team' ); messageClient( %client, 'MsgVoteItem', "", %key, 'MakeObserver', "", 'Become an Observer' ); } else { if(!%multipleTeams && !$Host::TournamentMode) messageClient( %client, 'MsgVoteItem', "", %key, 'JoinGame', "", 'Join the Game' ); } //%totalSlots = $Host::maxPlayers - ($HostGamePlayerCount + $HostGameBotCount); // if( $HostGameBotCount > 0 && %totalSlots > 0 && %client.isAdmin) //messageClient( %client, 'MsgVoteItem', "", %key, 'Addbot', "", 'Add a Bot' ); } if( !%client.canVote && !%isAdmin ) return; if (isDemo()) return; if ( %game.scheduleVote $= "" ) { if(!%client.isAdmin) { // Actual vote options: messageClient( %client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission' ); if( $Host::TournamentMode ) { messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Vote Free For All Mode' ); if(!$MatchStarted && !$CountdownStarted) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match' ); } else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Vote Tournament Mode' ); if ( %multipleTeams ) { if(!$MatchStarted && !$Host::TournamentMode) messageClient( %client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team' ); if ( $teamDamage ) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage' ); } } else { // Actual vote options: messageClient( %client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Change the Mission' ); if( $Host::TournamentMode ) { messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Free For All Mode' ); if(!$MatchStarted && !$CountdownStarted) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Start Match' ); } else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Tournament Mode' ); if ( %multipleTeams ) { if(!$MatchStarted) messageClient( %client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Choose Team' ); if ( $teamDamage ) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Disable Team Damage' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage' ); } } } // Admin only options: if ( %client.isAdmin ) { messageClient( %client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Change the Time Limit' ); messageClient( %client, 'MsgVoteItem', "", %key, 'VoteResetServer', 'reset server defaults', 'Reset the Server' ); } } //------------------------------------------------------------------------------ function DefaultGame::sendGameTeamList( %game, %client, %key ) { %teamCount = %game.numTeams; if ( %teamCount < 2 ) { warn( "Team menu requested for one-team game!" ); return; } for ( %team = 1; %team - 1 < %teamCount; %team++ ) messageClient( %client, 'MsgVoteItem', "", %key, %team, "", detag( getTaggedString( %game.getTeamName(%team) ) ) ); } //------------------------------------------------------------------------------ function DefaultGame::sendTimeLimitList( %game, %client, %key ) { messageClient( %client, 'MsgVoteItem', "", %key, 10, "", '10 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 15, "", '15 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 20, "", '20 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 25, "", '25 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 30, "", '30 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 45, "", '45 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 60, "", '60 minutes' ); messageClient( %client, 'MsgVoteItem', "", %key, 200, "", 'No time limit' ); } //------------------------------------------------------------------------------ // all global votes here // this function was created to remove the call to "eval", which is non-functional in PURE servers... function DefaultGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4) { switch$ (%typeName) { case "voteChangeMission": %game.voteChangeMission(%admin, %arg1, %arg2, %arg3, %arg4); case "voteTeamDamage": %game.voteTeamDamage(%admin, %arg1, %arg2, %arg3, %arg4); case "voteTournamentMode": %game.voteTournamentMode(%admin, %arg1, %arg2, %arg3, %arg4); case "voteMatchStart": %game.voteMatchStart(%admin, %arg1, %arg2, %arg3, %arg4); case "voteFFAMode": %game.voteFFAMode(%admin, %arg1, %arg2, %arg3, %arg4); case "voteChangeTimeLimit": %game.voteChangeTimeLimit(%admin, %arg1, %arg2, %arg3, %arg4); case "voteResetServer": %game.voteResetServer(%admin, %arg1, %arg2, %arg3, %arg4); case "voteKickPlayer": %game.voteKickPlayer(%admin, %arg1, %arg2, %arg3, %arg4); case "voteAdminPlayer": %game.voteAdminPlayer(%admin, %arg1, %arg2, %arg3, %arg4); case "voteGreedMode": %game.voteGreedMode(%admin, %arg1, %arg2, %arg3, %arg4); case "voteHoardMode": %game.voteHoardMode(%admin, %arg1, %arg2, %arg3, %arg4); } } function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typeDisplayName, %missionId, %missionTypeId) { %mission = $HostMissionFile[%missionId]; if ( %mission $= "" ) { error( "Invalid mission index passed to DefaultGame::voteChangeMission!" ); return; } %missionType = $HostTypeName[%missionTypeId]; if ( %missionType $= "" ) { error( "Invalid mission type id passed to DefaultGame::voteChangeMission!" ); return; } if(%admin) { messageAll('MsgAdminChangeMission', '\c2The Admin has changed the mission to %1 (%2).', %missionDisplayName, %typeDisplayName ); logEcho("mission changed to "@%missionDisplayName@"/"@%typeDisplayName@" (admin)"); %game.gameOver(); loadMission( %mission, %missionType, false ); } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { messageAll('MsgVotePassed', '\c2The mission was changed to %1 (%2) by vote.', %missionDisplayName, %typeDisplayName ); logEcho("mission changed to "@%missionDisplayName@"/"@%typeDisplayName@" (vote)"); %game.gameOver(); loadMission( %mission, %missionType, false ); } else messageAll('MsgVoteFailed', '\c2Change mission vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); } } //------------------------------------------------------------------------------ function DefaultGame::voteTeamDamage(%game, %admin) { %setto = ""; %cause = ""; if(%admin) { if($teamDamage) { messageAll('MsgAdminForce', '\c2The Admin has disabled team damage.'); $Host::TeamDamageOn = $TeamDamage = 0; %setto = "disabled"; } else { messageAll('MsgAdminForce', '\c2The Admin has enabled team damage.'); $Host::TeamDamageOn = $TeamDamage = 1; %setto = "enabled"; } %cause = "(admin)"; } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { if($teamDamage) { messageAll('MsgVotePassed', '\c2Team damage was disabled by vote.'); $Host::TeamDamageOn = $TeamDamage = 0; %setto = "disabled"; } else { messageAll('MsgVotePassed', '\c2Team damage was enabled by vote.'); $Host::TeamDamageOn = $TeamDamage = 1; %setto = "enabled"; } %cause = "(vote)"; } else { if($teamDamage) messageAll('MsgVoteFailed', '\c2Disable team damage vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); else messageAll('MsgVoteFailed', '\c2Enable team damage vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); } } if(%setto !$= "") logEcho("team damage "@%setto SPC %cause); } //------------------------------------------------------------------------------ function DefaultGame::voteTournamentMode( %game, %admin, %missionDisplayName, %typeDisplayName, %missionId, %missionTypeId ) { %mission = $HostMissionFile[%missionId]; if ( %mission $= "" ) { error( "Invalid mission index passed to DefaultGame::voteTournamentMode!" ); return; } %missionType = $HostTypeName[%missionTypeId]; if ( %missionType $= "" ) { error( "Invalid mission type id passed to DefaultGame::voteTournamentMode!" ); return; } %cause = ""; if (%admin) { messageAll( 'MsgAdminForce', '\c2The Admin has switched the server to Tournament mode (%1).', %missionDisplayName ); setModeTournament( %mission, %missionType ); %cause = "(admin)"; } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { messageAll('MsgVotePassed', '\c2Server switched to Tournament mode by vote (%1): %2 percent.', %missionDisplayName, mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); setModeTournament( %mission, %missionType ); %cause = "(vote)"; } else messageAll('MsgVoteFailed', '\c2Tournament mode vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); } if(%cause !$= "") logEcho("tournament mode set "@%cause); } //------------------------------------------------------------------------------ function DefaultGame::voteMatchStart( %game, %admin) { %cause = ""; %ready = forceTourneyMatchStart(); if(%admin) { if(!%ready) { messageClient( %client, 'msgClient', '\c2No players are ready yet.'); return; } else { messageAll('msgMissionStart', '\c2The admin has forced the match to start.'); %cause = "(admin)"; startTourneyCountdown(); } } else { if(!%ready) { messageAll( 'msgClient', '\c2Vote passed to start match, but no players are ready yet.'); return; } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { messageAll('MsgVotePassed', '\c2The match has been started by vote: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); startTourneyCountdown(); } else messageAll('MsgVoteFailed', '\c2Start Match vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); } } if(%cause !$= "") logEcho("start match "@%cause); } //------------------------------------------------------------------------------ function DefaultGame::voteFFAMode( %game, %admin, %client ) { %cause = ""; %name = getTaggedString(%client.name); if (%admin) { messageAll('MsgAdminForce', '\c2The Admin has switched the server to Free For All mode.', %client); setModeFFA($CurrentMission, $CurrentMissionType); %cause = "(admin)"; } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { messageAll('MsgVotePassed', '\c2Server switched to Free For All mode by vote.', %client); setModeFFA($CurrentMission, $CurrentMissionType); %cause = "(vote)"; } else messageAll('MsgVoteFailed', '\c2Free For All mode vote did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); } if(%cause !$= "") logEcho("free for all set "@%cause); } //------------------------------------------------------------------------------ function DefaultGame::voteChangeTimeLimit( %game, %admin, %newLimit ) { if( %newLimit == 999 ) %display = "unlimited"; else %display = %newLimit; %cause = ""; if ( %admin ) { messageAll( 'MsgAdminForce', '\c2The Admin changed the mission time limit to %1 minutes.', %display ); $Host::TimeLimit = %newLimit; %cause = "(admin)"; } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { messageAll('MsgVotePassed', '\c2The mission time limit was set to %1 minutes by vote.', %display); $Host::TimeLimit = %newLimit; %cause = "(vote)"; } else messageAll('MsgVoteFailed', '\c2The vote to change the mission time limit did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); } //if the time limit was actually changed... if(%cause !$= "") { logEcho("time limit set to "@%display SPC %cause); //if the match has been started, reset the end of match countdown if ($matchStarted) { //schedule the end of match countdown %elapsedTimeMS = getSimTime() - $missionStartTime; %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) - %elapsedTimeMS; error("time limit="@$Host::TimeLimit@", elapsed="@(%elapsedTimeMS / 60000)@", curtimeleftms="@%curTimeLeftMS); CancelEndCountdown(); EndCountdown(%curTimeLeftMS); cancel(%game.timeSync); %game.checkTimeLimit(true); } } } //------------------------------------------------------------------------------ function DefaultGame::voteResetServer( %game, %admin, %client ) { %cause = ""; if ( %admin ) { messageAll( 'AdminResetServer', '\c2The Admin has reset the server.' ); resetServerDefaults(); %cause = "(admin)"; } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { messageAll('MsgVotePassed', '\c2The Server has been reset by vote.' ); resetServerDefaults(); %cause = "(vote)"; } else messageAll('MsgVoteFailed', '\c2The vote to reset Server to defaults did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); } if(%cause !$= "") logEcho("server reset "@%cause); } //------------------------------------------------------------------------------ // all team based votes here function DefaultGame::voteKickPlayer(%game, %admin, %client) { %cause = ""; if(%admin) { kick(%client, %admin, %client.guid ); %cause = "(admin)"; } else { %team = %client.team; %totalVotes = %game.votesFor[%game.kickTeam] + %game.votesAgainst[%game.kickTeam]; if(%totalVotes > 0 && (%game.votesFor[%game.kickTeam] / %totalVotes) > ($Host::VotePasspercent / 100)) { kick(%client, %admin, %game.kickGuid); %cause = "(vote)"; } else { for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { %cl = ClientGroup.getObject( %idx ); if (%cl.team == %game.kickTeam && !%cl.isAIControlled()) messageClient( %cl, 'MsgVoteFailed', '\c2Kick player vote did not pass' ); } } } %game.kickTeam = ""; %game.kickGuid = ""; %game.kickClientName = ""; if(%cause !$= "") logEcho(%name@" (cl " @ %game.kickClient @ ") kicked " @ %cause); } //------------------------------------------------------------------------------ function DefaultGame::banPlayer(%game, %admin, %client) { %cause = ""; %name = %client.nameBase; if( %admin ) { ban( %client, %admin ); %cause = "(admin)"; } if(%cause !$= "") logEcho(%name@" (cl "@%client@") banned "@%cause); } //------------------------------------------------------------------------------ function DefaultGame::voteAdminPlayer(%game, %admin, %client) { %cause = ""; if (%admin) { messageAll('MsgAdminAdminPlayer', '\c2The Admin made %2 an admin.', %client, %client.name); %client.isAdmin = 1; %cause = "(admin)"; } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { messageAll('MsgAdminPlayer', '\c2%2 was made an admin by vote.', %client, %client.name); %client.isAdmin = 1; %cause = "(vote)"; } else messageAll('MsgVoteFailed', '\c2Vote to make %1 an admin did not pass.', %client.name); } if(%cause !$= "") logEcho(%client.nameBase@" (cl "@%client@") made admin "@%cause); } //------------------------------------------------------------------------------ function DefaultGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5) { //the default behavior when clicking on a game link is to start observing that client %targetClient = %arg1; if ((%client.team == 0) && isObject(%targetClient) && (%targetClient.team != 0)) { %prevObsClient = %client.observeClient; // update the observer list for this client observerFollowUpdate( %client, %targetClient, %prevObsClient !$= "" ); serverCmdObserveClient(%client, %targetClient); displayObserverHud(%client, %targetClient); if (%targetClient != %prevObsClient) { messageClient(%targetClient, 'Observer', '\c1%1 is now observing you.', %client.name); messageClient(%prevObsClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); } } } //------------------------------------------------------------------------------ $ScoreHudMaxVisible = 19; function DefaultGame::updateScoreHud(%game, %client, %tag) { if (Game.numTeams > 1) { // Send header: messageClient( %client, 'SetScoreHudHeader', "", '\t%1%2\t%3%4', %game.getTeamName(1), $TeamScore[1], %game.getTeamName(2), $TeamScore[2] ); // Send subheader: messageClient( %client, 'SetScoreHudSubheader', "", '\tPLAYERS (%1)SCORE\tPLAYERS (%2)SCORE', $TeamRank[1, count], $TeamRank[2, count] ); %index = 0; while ( true ) { if ( %index >= $TeamRank[1, count]+2 && %index >= $TeamRank[2, count]+2 ) break; //get the team1 client info %team1Client = ""; %team1ClientScore = ""; %col1Style = ""; if ( %index < $TeamRank[1, count] ) { %team1Client = $TeamRank[1, %index]; %team1ClientScore = %team1Client.score $= "" ? 0 : %team1Client.score; %col1Style = %team1Client == %client ? "" : ""; %team1playersTotalScore += %team1Client.score; } else if( %index == $teamRank[1, count] && $teamRank[1, count] != 0 && !isDemo() && %game.class $= "CTFGame") { %team1ClientScore = "--------------"; } else if( %index == $teamRank[1, count]+1 && $teamRank[1, count] != 0 && !isDemo() && %game.class $= "CTFGame") { %team1ClientScore = %team1playersTotalScore != 0 ? %team1playersTotalScore : 0; } //get the team2 client info %team2Client = ""; %team2ClientScore = ""; %col2Style = ""; if ( %index < $TeamRank[2, count] ) { %team2Client = $TeamRank[2, %index]; %team2ClientScore = %team2Client.score $= "" ? 0 : %team2Client.score; %col2Style = %team2Client == %client ? "" : ""; %team2playersTotalScore += %team2Client.score; } else if( %index == $teamRank[2, count] && $teamRank[2, count] != 0 && !isDemo() && %game.class $= "CTFGame") { %team2ClientScore = "--------------"; } else if( %index == $teamRank[2, count]+1 && $teamRank[2, count] != 0 && !isDemo() && %game.class $= "CTFGame") { %team2ClientScore = %team2playersTotalScore != 0 ? %team2playersTotalScore : 0; } //if the client is not an observer, send the message if (%client.team != 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%5%1%2\t%6%3%4', %team1Client.name, %team1ClientScore, %team2Client.name, %team2ClientScore, %col1Style, %col2Style ); } //else for observers, create an anchor around the player name so they can be observed else { messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%5%1%2\t%6%3%4', %team1Client.name, %team1ClientScore, %team2Client.name, %team2ClientScore, %col1Style, %col2Style, %team1Client, %team2Client ); } %index++; } } else { //tricky stuff here... use two columns if we have more than 15 clients... %numClients = $TeamRank[0, count]; if ( %numClients > $ScoreHudMaxVisible ) %numColumns = 2; // Clear header: messageClient( %client, 'SetScoreHudHeader', "", "" ); // Send header: if (%numColumns == 2) messageClient(%client, 'SetScoreHudSubheader', "", '\tPLAYERSCORE\tPLAYERSCORE'); else messageClient(%client, 'SetScoreHudSubheader', "", '\tPLAYERSCORE'); %countMax = %numClients; if ( %countMax > ( 2 * $ScoreHudMaxVisible ) ) { if ( %countMax & 1 ) %countMax++; %countMax = %countMax / 2; } else if ( %countMax > $ScoreHudMaxVisible ) %countMax = $ScoreHudMaxVisible; for ( %index = 0; %index < %countMax; %index++ ) { //get the client info %col1Client = $TeamRank[0, %index]; %col1ClientScore = %col1Client.score $= "" ? 0 : %col1Client.score; %col1Style = %col1Client == %client ? "" : ""; //see if we have two columns if ( %numColumns == 2 ) { %col2Client = ""; %col2ClientScore = ""; %col2Style = ""; //get the column 2 client info %col2Index = %index + %countMax; if ( %col2Index < %numClients ) { %col2Client = $TeamRank[0, %col2Index]; %col2ClientScore = %col2Client.score $= "" ? 0 : %col2Client.score; %col2Style = %col2Client == %client ? "" : ""; } } //if the client is not an observer, send the message if (%client.team != 0) { if ( %numColumns == 2 ) messageClient(%client, 'SetLineHud', "", %tag, %index, '\t%5%1%2\t%6%3%4', %col1Client.name, %col1ClientScore, %col2Client.name, %col2ClientScore, %col1Style, %col2Style ); else messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%3%1%2', %col1Client.name, %col1ClientScore, %col1Style ); } //else for observers, create an anchor around the player name so they can be observed else { if ( %numColumns == 2 ) messageClient(%client, 'SetLineHud', "", %tag, %index, '\t%5%1%2\t%6%3%4', %col1Client.name, %col1ClientScore, %col2Client.name, %col2ClientScore, %col1Style, %col2Style, %col1Client, %col2Client ); else messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%3%1%2', %col1Client.name, %col1ClientScore, %col1Style, %col1Client ); } } } // Tack on the list of observers: %observerCount = 0; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team == 0) %observerCount++; } if (%observerCount > 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, ""); %index++; messageClient(%client, 'SetLineHud', "", %tag, %index, '\tOBSERVERS (%1)TIME', %observerCount); %index++; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); //if this is an observer if (%cl.team == 0) { %obsTime = getSimTime() - %cl.observerStartTime; %obsTimeStr = %game.formatTime(%obsTime, false); messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%1%2', %cl.name, %obsTimeStr ); %index++; } } } //clear the rest of Hud so we don't get old lines hanging around... messageClient( %client, 'ClearHud', "", %tag, %index ); } //------------------------------------------------------------------------------ function UpdateClientTimes(%time) { %secondsLeft = %time / 1000; messageAll('MsgSystemClock', "", (%secondsLeft / 60), %time); } //------------------------------------------------------------------------------ function notifyMatchStart(%time) { %seconds = mFloor(%time / 1000); if (%seconds > 2) MessageAll('MsgMissionStart', '\c2Match starts in %1 seconds.~wfx/misc/hunters_%1.wav', %seconds); else if (%seconds == 2) MessageAll('MsgMissionStart', '\c2Match starts in 2 seconds.~wvoice/announcer/ann.match_begins.wav'); else if (%seconds == 1) MessageAll('MsgMissionStart', '\c2Match starts in 1 second.'); UpdateClientTimes(%time); } //------------------------------------------------------------------------------ function notifyMatchEnd(%time) { %seconds = mFloor(%time / 1000); if (%seconds > 1) MessageAll('MsgMissionEnd', '\c2Match ends in %1 seconds.~wfx/misc/hunters_%1.wav', %seconds); else if (%seconds == 1) MessageAll('MsgMissionEnd', '\c2Match ends in 1 second.~wfx/misc/hunters_1.wav'); UpdateClientTimes(%time); } function DefaultGame::formatTime(%game, %tStr, %includeHundredths) { %timeInSeconds = %tStr / 1000; %mins = mFloor(%timeInSeconds / 60); if(%mins < 1) %timeString = "00:"; else if(%mins < 10) %timeString = "0" @ %mins @ ":"; else %timeString = %mins @ ":"; %timeInSeconds -= (%mins * 60); %secs = mFloor(%timeInSeconds); if(%secs < 1) %timeString = %timeString @ "00"; else if(%secs < 10) %timeString = %timeString @ "0" @ %secs; else %timeString = %timeString @ %secs; if (%includeHundredths) { %timeString = %timeString @ "."; %timeInSeconds -= %secs; %hSecs = mFloor(%timeInSeconds * 100); // will be between 0 and 999 if(%hSecs < 1) %timeString = %timeString @ "00"; else if(%hSecs < 10) %timeString = %timeString @ "0" @ %hSecs; else %timeString = %timeString @ %hSecs; } return %timeString; } //------------------------------------------------------------------------------ //AI FUNCTIONS function DefaultGame::AIChooseGameObjective(%game, %client) { AIChooseObjective(%client); } //------------------------------------------------------------------------------ function DefaultGame::getServerStatusString(%game) { %status = %game.numTeams; for ( %team = 1; %team - 1 < %game.numTeams; %team++ ) { %score = isObject( $teamScore[%team] ) ? $teamScore[%team] : 0; %teamStr = getTaggedString( %game.getTeamName(%team) ) TAB %score; %status = %status NL %teamStr; } %status = %status NL ClientGroup.getCount(); for ( %i = 0; %i < ClientGroup.getCount(); %i++ ) { %cl = ClientGroup.getObject( %i ); %score = %cl.score $= "" ? 0 : %cl.score; %playerStr = getTaggedString( %cl.name ) TAB getTaggedString( %game.getTeamName(%cl.team) ) TAB %score; %status = %status NL %playerStr; } return( %status ); } //------------------------------------------------------------------------------ function DefaultGame::OptionsDlgSleep( %game ) { // ignore in the default game... } //------------------------------------------------------------------------------ function DefaultGame::endMission( %game ) { } PK !(x44gui/AIEButtonBarDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(AIEButtonBarDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiChunkedBitmapCtrl() { profile = "EditorContentProfile"; horizSizing = "right"; vertSizing = "height"; position = "0 30"; extent = "120 420"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiCheckBoxCtrl(ExteriorCheckBox) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 23"; extent = "100 22"; minExtent = "8 8"; visible = "1"; command = "ExteriorCheckBox.updateCheckBox();"; helpTag = "0"; text = "Draw Ext"; }; new GuiCheckBoxCtrl(InteriorCheckBox) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 47"; extent = "100 22"; minExtent = "8 8"; visible = "1"; command = "InteriorCheckBox.updateCheckBox();"; helpTag = "0"; text = "Draw Int"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 6"; extent = "73 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Visual Options:"; }; new GuiCheckBoxCtrl(JetConnectionsCheckBox) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 73"; extent = "100 22"; minExtent = "8 8"; visible = "1"; command = "JetConnectionsCheckBox.updateCheckBox();"; helpTag = "0"; text = "Draw Jet"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 201"; extent = "100 29"; minExtent = "8 8"; visible = "1"; command = "makeJettableGraph(Nav);"; helpTag = "0"; text = "Bot Graph"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 169"; extent = "100 29"; minExtent = "8 8"; visible = "1"; command = "makeJettableGraph(Spawn);"; helpTag = "0"; text = "Spawn Graph"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 233"; extent = "100 29"; minExtent = "8 8"; visible = "1"; command = "AIEButtonBarDlg.createLOSXref();"; helpTag = "0"; text = "Build LOS"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 265"; extent = "100 29"; minExtent = "8 8"; visible = "1"; command = "navGraph.saveGraph();"; helpTag = "0"; text = "Save"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 151"; extent = "56 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Graph Build"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 315"; extent = "64 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "AI Objectives"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 331"; extent = "100 29"; minExtent = "8 8"; visible = "1"; command = "AICreateObjectives();"; helpTag = "0"; text = "Build Objectives"; }; new GuiPopUpMenuCtrl(ObjectiveList) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 368"; extent = "101 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "New Objective"; maxPopupHeight = "200"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 395"; extent = "100 29"; minExtent = "8 8"; visible = "1"; command = "AISaveMissionObjectives();"; helpTag = "0"; text = "Save"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 102"; extent = "73 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Camera speed:"; }; new GuiSliderCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 121"; extent = "80 20"; minExtent = "80 20"; visible = "1"; variable = "value"; command = "$Camera::movementSpeed = $ThisControl.getValue();"; helpTag = "0"; range = "0.000000 200.000000"; ticks = "10"; value = "20"; }; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function makeUnbridgedGraph() { GraphCurrentOperation.setValue("Generating interior nodes..."); Canvas.repaint(); navGraph::generateInterior(); dataProgress(); GraphCurrentOperation.setValue("Remaking graph..."); Canvas.repaint(); remakeTheGraph(); dataProgress(); } function makeJettableGraph(%NAVorSPAWN) { AIworking(true); $NavGraph::operations = 7; $NavGraph::operationsDone = 0; navGraph.setGenMode(%NAVorSPAWN); navGraph::exteriorInspect(); dataProgress(); makeUnbridgedGraph(); GraphCurrentOperation.setValue("Beginning slow bridge finding pass"); Canvas.repaint(); navGraph.assemble(); navGraph.cullIslands(); remakeTheGraph(); navGraph.pushBridges(); navGraph.makeTables(); dataProgress(); AIworking(false); } //------------------------------------------------------------------------------ function AIEButtonBarDlg::getPrefs(%this) { } //------------------------------------------------------------------------------ function AIEbuttonBarDlg::setPrefs(%this) { } //------------------------------------------------------------------------------ function AIEButtonBarDlg::init(%this) { InteriorCheckBox.setValue($pref::NavGraph::drawIndoor); ExteriorCheckBox.setValue($pref::NavGraph::drawOutdoor); if(!$pref::NavGraph::drawIndoor) JetConnectionsCheckBox.visible = false; JetConnectionsCheckBox.setValue($pref::NavGraph::drawJetEdges); ObjectiveList.clear(); ObjectiveList.setText("New Objective"); ObjectiveList.add("Deploy Outdoor Turret", 1); ObjectiveList.add("Deploy Indoor Turret", 2); ObjectiveList.add("Deploy Inventory", 3); ObjectiveList.add("Touch FlipFlop", 4); ObjectiveList.add("Mortar Target", 5); ObjectiveList.add("Repair Equipment", 6); ObjectiveList.add("Attack Target", 7); ObjectiveList.add("Defend Location", 8); objectiveList.add("New Group", 9); //ObjectivesList.sort(); } //------------------------------------------------------------------------------ function AIEButtonBarDlg::onSleep(%this) { } //------------------------------------------------------------------------------ function AIEButtonBarDlg::onWake(%this) { } //------------------------------------------------------------------------------ function dataProgress() { $NavGraph::operationsDone++; %percent = $NavGraph::operationsDone / $NavGraph::operations; GraphBuildProgress.setValue(%percent); Canvas.repaint(); } //------------------------------------------------------------------------------ function remakeTheGraph() { GraphCurrentOperation.setValue("making graph..."); Canvas.repaint(); navGraph.makeGraph(); dataProgress(); } //------------------------------------------------------------------------------ function AIEButtonBarDlg::createLOSXref() { AIworking(true); GraphCurrentOperation.setValue("Making LOS CrossRef Table..."); GraphBuildProgress.setValue(0); if(2.player) navGraph.prepLOS(2.player.getTransform()); else navGraph.prepLOS("0 0 0"); while(navGraph.makeLOS()) { GraphBuildProgress.setValue($graphProcessPercent); Canvas.repaint(); } GraphBuildProgress.setValue(100); Canvas.repaint(); AIworking(false); } function ExteriorCheckBox::updateCheckBox() { $pref::NavGraph::drawOutdoor = !$pref::NavGraph::drawOutdoor; } function InteriorCheckBox::updateCheckBox() { $pref::NavGraph::drawIndoor = !$pref::NavGraph::drawIndoor; if(!$pref::NavGraph::drawIndoor) JetConnectionsCheckBox.visible = false; else jetConnectionsCheckBox.visible = true; } function JetConnectionsCheckBox::updateCheckBox() { $pref::NavGraph::drawJetEdges = !$pref::NavGraph::drawJetEdges; } function AISaveMissionObjectives() { // once we have created all objecitves, save out the mis file if(!isObject(MissionGroup)) { error("No mission exists!"); return; } // check for read-only %file = "base/missions/" @ $MissionName; if(!isWriteableFileName(%file)) { error("Mission file '" @ %file @ "' is not writeable."); return; } // ok, were good to save. missionGroup.save("missions/" @ $MissionName); } function AIObjectivesLock(%lock) { %numTeams = nameToId("MissionGroup/Teams").getCount(); for(%j = 0; %j < %numTeams; %j++) { %objGroup = nameToId("MissionGroup/Teams/team" @ %j @ "/AIObjectives"); if(%objGroup == -1) continue; %objCount = %objGroup.getCount(); for(%i = 0; %i < %objCount; %i++) { %obj = %objGroup.getObject(%i); %obj.locked = %lock; } } // save AISaveMissionObjectives(); } function addNewObjective(%type) { if($AIEditor::inspectTeam == 1) %team = 1; else if($AIEditor::inspectTeam == 2) %team = 2; else %team = 1; %tGroup = nameToId("MissionGroup/Teams/team" @ %team @ "/AIObjectives"); if(%tGroup < 1) return; if($InstantGroup $= "MissionGroup") $InstantGroup = %tGroup; switch$(%type) { case "Defend Location": %objective = new AIObjective(AIODefendLocation) { dataBlock = "AIObjectiveMarker"; }; case "Repair Equipment": %objective = new AIObjective(AIORepairObject) { dataBlock = "AIObjectiveMarker"; }; case "Deploy Outdoor Turret": %Objective = new AIObjective(AIODeployEquipment) { dataBlock = "AIObjectiveMarker"; weightLevel1 = 4100; weightLevel2 = 0; description = "Deploy outdoor Turret"; offense = false; defense = true; targetObjectId = -1; targetObject = -1; targetClientId = -1; equipment = "TurretOutdoorDeployable"; buyEquipmentSet = "MediumOutdoorTurretSet"; }; case "Deploy Indoor Turret": %Objective = new AIObjective(AIODeployEquipment) { dataBlock = "AIObjectiveMarker"; weightLevel1 = 4100; weightLevel2 = 0; description = "Deploy indoor Turret"; offense = false; defense = true; targetObjectId = -1; targetObject = -1; targetClientId = -1; equipment = "TurretIndoorDeployable"; buyEquipmentSet = "MediumIndoorTurretSet"; }; case "Attack Target": %objective = new AIObjective(AIOAttackObject) { dataBlock = "AIObjectiveMarker"; }; case "Touch FlipFlop": %objective = new AIObjective(AIOTouchObject) { dataBlock = "AIObjectiveMarker"; }; case "Mortar Target": %objective = new AIObjective(AIOMortarObject) { dataBlock = "AIObjectiveMarker"; }; case "Deploy Inventory": %Objective = new AIObjective(AIODeployEquipment) { dataBlock = "AIObjectiveMarker"; weightLevel1 = 4100; weightLevel2 = 0; description = "Deploy Inventory Station"; offense = false; defense = true; targetObjectId = -1; targetObject = -1; targetClientId = -1; equipment = "InventoryDeployable"; buyEquipmentSet = "MediumInventorySet"; }; case "New Group": %set = new SimGroup("ObjectiveSet"); %tGroup.add(%set); return; default: error("no defined type."); return; } $InstantGroup.add(%objective); aiEdit.clearSelection(); aiEdit.selectObject(%objective); aiEdit.dropSelection(); %objective.location = %objective.getWorldBoxCenter(); Inspector.inspect(%objective); InspectorNameEdit.setValue(%objective.getName()); } function ObjectiveList::onSelect(%this, %id, %text) { addNewObjective(%text); ObjectiveList.setText("New Objective"); } PK !( %width - editor.minToolFrameWidth) AIEFrameSet.setColumnOffset(1, %width - editor.minToolFrameWidth); } } function AIEFrameSetDlg::resetFrames(%this) { %tools = AIEToolFrameSet; while(%tools.getRowCount() > %tools.getCount()) %tools.removeRow(); while(%tools.getRowCount() < %tools.getCount()) %tools.addRow(); %offset = 400; // update the frame view %frameSet = AIEFrameSet; if(!%tools.getCount() && (%frameSet.getColumnCount() > 1)) { %Offset = %frameSet.getColumnOffset(1); %frameSet.removeColumn(); } if(%tools.getCount() && (%frameSet.getColumnCount() == 1)) { %frameSet.addColumn(); %frameSet.setColumnOffset(1, %offset); } //if(%tools.getCount()) //%this.toolPaneOffset = AIEFrameSet.getColumnOffset(1); %this.activeToolCount = %tools.getCount(); } function AIEFrameSetDlg::addTool(%this, %tool) { %group = nameToId("MissionGroup/Teams/team" @ $AIEditor::inspectTeam @ "/AIObjectives"); if(%group == -1) return false; if($AIEditor::inspectTeam == 1) EditorTree.open("MissionGroup/Teams/team1/AIObjectives"); else EditorTree.open("MissionGroup/Teams/team2/AIObjectives"); AIEToolFrameSet.add(%tool); %this.resetFrames(); return true; } function AIEFrameSetDlg::removeTool(%this, %tool) { AIEToolFrameSet.remove(%tool); %this.resetFrames(); } PK !(7iigui/AIEStatusbarDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(AIEStatusBarDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "top"; position = "0 450"; extent = "640 30"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 8"; extent = "39 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Mission:"; }; new GuiControl() { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "49 6"; extent = "188 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextCtrl(AIEMissionNameText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 2"; extent = "8 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; }; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function AIEStatusBarDlg::init(%this) { %this.update(); } function AIEStatusBarDlg::update(%this) { if($MissionName $= "") AIEMissionNameText.setValue(""); else AIEMissionNameText.setValue($MissionName); } PK !(Ogui/AIEWorkingDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(AIEWorkingDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiChunkedBitmapCtrl() { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "top"; position = "234 5"; extent = "400 130"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellLargeLabelProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 10"; extent = "378 40"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Building Graph ..."; }; new GuiProgressCtrl(GraphBuildProgress) { profile = "ShellProgressBarProfile"; horizSizing = "center"; vertSizing = "top"; position = "29 50"; extent = "342 31"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; setValue = "0"; }; new GuiTextCtrl(GraphCurrentOperation) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "35 96"; extent = "8 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(_@<<gui/AIEditorGui.gui new WorldEditor(aiEdit) { profile = ""; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "520 420"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; }; //------------------------------------------------------------------------------ function AIworking(%working) { if(%working) { Canvas.pushDialog(AIEWorkingDlg); GraphBuildProgress.setValue(0.0); } else Canvas.popDialog(AIEWorkingDlg); Canvas.repaint(); } new ActionMap(AIEditorMap); //AIEditorMap.bindCmd(keyboard, "space", "aiEdit.nextMode();", ""); AIEditorMap.bindCmd(keyboard, "ctrl c", "aiEdit.copySelection();", ""); AIEditorMap.bindCmd(keyboard, "ctrl x", "aiEdit.copySelection();aiEdit.deleteSelection();", ""); AIEditorMap.bindCmd(keyboard, "delete", "aiEdit.copySelection();aiEdit.deleteSelection();", ""); AIEditorMap.bindCmd(keyboard, "ctrl v", "aiEdit.pasteSelection();", ""); AIEditorMap.bindCmd(keyboard, "ctrl h", "aiEdit.hideSelection(true);", ""); AIEditorMap.bindCmd(keyboard, "alt h", "aiEdit.hideSelection(false);", ""); AIEditorMap.bindCmd(keyboard, "i", "Canvas.pushDialog(interiorDebugDialog);", ""); AIEditorMap.bindCmd(keyboard, "ctrl d", "aiEdit.dropSelection();", ""); AIEditorMap.bindCmd(keyboard, "ctrl q", "aiEdit.dropCameraToSelection();", ""); AIEditorMap.bindCmd(keyboard, "ctrl m", "aiEdit.moveSelectionInPlace();", ""); AIEditorMap.bindCmd(keyboard, "ctrl r", "aiEdit.resetTransforms();", ""); AIEditorMap.bindCmd(keyboard, "space", "aiEdit.nextMode();", ""); PK !(F gui/AIEditorToolBar.gui//--- OBJECT WRITE BEGIN --- new GuiControl(AIEditorToolBar) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "640 30"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiCheckBoxCtrl(AIEditorObjectivesTree1CheckBox) { profile = "GuiRadioProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "290 5"; extent = "114 20"; minExtent = "8 8"; visible = "1"; command = "AIEditorObjectivesTree1CheckBox.setTreeGui(1);"; helpTag = "0"; text = "Objectives Team 1"; }; new GuiCheckBoxCtrl(AIEditorObjectivesTree2CheckBox) { profile = "GuiRadioProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "405 5"; extent = "114 20"; minExtent = "8 8"; visible = "1"; command = "AIEditorObjectivesTree2CheckBox.setTreeGui(2);"; helpTag = "0"; text = "Objectives Team 2"; }; new GuiCheckBoxCtrl(AIEditorObjectivesInspectorCheckBox) { profile = "GuiRadioProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "520 5"; extent = "114 20"; minExtent = "8 8"; visible = "1"; command = "if($ThisControl.getValue()) AIEFrameSetDlg.addTool(EditorToolInspectorGui); else AIEFrameSetDlg.removeTool(EditorToolInspectorGui);"; helpTag = "0"; text = "Objectives Inspector"; }; }; }; //--- OBJECT WRITE END --- function AIEditorToolBar::init(%this) { } function AIEditorObjectivesTree1CheckBox::setTreeGui(%this, %team) { $AIEditor::inspectTeam = %team; AIEditorObjectivesTree2CheckBox.setValue(false); if($ThisControl.getValue()) %isSet = AIEFrameSetDlg.addTool(EditorToolTreeViewGui); else %isSet = AIEFrameSetDlg.removeTool(EditorToolTreeViewGui); $ThisControl.setValue(%isSet); } function AIEditorObjectivesTree2CheckBox::setTreeGui(%this, %team) { $AIEditor::inspectTeam = %team; AIEditorObjectivesTree1CheckBox.setValue(false); if($ThisControl.getValue()) %isSet = AIEFrameSetDlg.addTool(EditorToolTreeViewGui); else %isSet = AIEFrameSetDlg.removeTool(EditorToolTreeViewGui); $ThisControl.setValue(%isSet); } PK !(w gui/AddressDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(AddressDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lbstate = "buddylist"; msg = "Request Processed"; lbline = "6"; DestList = "1"; key = "28"; state = "noprocess"; lbcount = "6"; blstate = "DONE"; useVariable = "0"; doRefresh = "1"; SrcList = "2"; err = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "79 68"; extent = "481 344"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "LIST CONTROL"; noTitleBar = "0"; new ShellBitmapButton(LC_CCListBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "219 178"; extent = "75 38"; minExtent = "32 38"; visible = "1"; command = "AddressDlg.AddCC();"; helpTag = "0"; text = "DEL"; simpleStyle = "0"; direction = "1"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "30 115"; extent = "183 178"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 7"; extent = "159 164"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellTextList(LC_BigList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "159 8"; minExtent = "8 8"; visible = "1"; variable = "$LCBigList"; command = "AddressDlg.onClick(\"BIGLIST\");"; altCommand = "AddressDlg.onDblClick(0);"; helpTag = "0"; enumerate = "1"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new ShellBitmapButton(LC_ToListBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "219 38"; extent = "75 38"; minExtent = "32 38"; visible = "1"; command = "AddressDlg.AddTo();"; helpTag = "0"; text = "DEL"; simpleStyle = "0"; direction = "1"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "284 40"; extent = "168 119"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 7"; extent = "144 105"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellTextList(LC_ToList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "144 8"; minExtent = "8 8"; visible = "1"; variable = "$LCToList"; command = "AddressDlg.onClick(\"TOLIST\");"; altCommand = "AddressDlg.onDblClick(1);"; helpTag = "0"; enumerate = "1"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColumnText = "0"; direction = "1"; }; }; }; new ShellBitmapButton(LC_BuddyListBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 288"; extent = "194 38"; minExtent = "32 38"; visible = "1"; command = "AddressDlg.AddBuddyList();"; helpTag = "0"; text = "ADD TO BUDDYLIST"; simpleStyle = "0"; direction = "0"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "284 175"; extent = "168 118"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 7"; extent = "144 104"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellTextList(LC_CCList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "144 8"; minExtent = "8 8"; visible = "1"; variable = "$LCCCList"; command = "AddressDlg.OnClick(\"CCLIST\");"; altCommand = "AddressDlg.onDblClick(2);"; helpTag = "0"; enumerate = "1"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new ShellBitmapButton(LC_OKBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "368 288"; extent = "89 38"; minExtent = "32 38"; visible = "1"; command = "AddressDlg.OK();"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "288 29"; extent = "40 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "TO List:"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "288 163"; extent = "41 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "CC List:"; }; new ShellBitmapButton(LC_CancelBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "278 288"; extent = "89 38"; minExtent = "32 38"; visible = "1"; command = "AddressDlg.Cancel();"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellPopupMenu(LC_ListBox) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "27 76"; extent = "193 36"; minExtent = "49 36"; visible = "1"; command = "AddressDlg.onClick(\"LISTBOX\");"; helpTag = "0"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new ShellTextEditCtrl(LC_Search) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "25 38"; extent = "158 38"; minExtent = "32 38"; visible = "1"; variable = "$LCSearch"; command = "AddressDlg.onClick(\"SEARCHBOX\");"; helpTag = "0"; historySize = "0"; maxLength = "255"; password = "0"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "37 29"; extent = "38 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Search:"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "37 68"; extent = "22 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "List:"; }; new ShellBitmapButton(LC_GoSearchBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "167 38"; extent = "53 38"; minExtent = "32 38"; visible = "1"; command = "AddressDlg.GoSearch();"; helpTag = "0"; text = "GO"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(55gui/AdvancedHostDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(AdvancedHostDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "50 30"; extent = "540 420"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ADVANCED HOST OPTIONS"; longTextBuffer = "0"; maxLength = "255"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 40"; extent = "40 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Port:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellTextEditCtrl(AH_HostPort) { profile = "NewTextEditNumericProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "67 32"; extent = "98 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "8"; historySize = "0"; password = "0"; IRCName = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 40"; extent = "64 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Time Limit:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellTextEditCtrl(AH_TimeLimit) { profile = "NewTextEditNumericProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "226 32"; extent = "68 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "3"; historySize = "0"; password = "0"; IRCName = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "292 40"; extent = "41 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Minutes"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "40 70"; extent = "110 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Admin Password:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellTextEditCtrl(AH_AdminPassword) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "146 62"; extent = "180 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "16"; historySize = "0"; password = "0"; IRCName = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellRadioButton(AH_HiFPSRdo) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "358 37"; extent = "150 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "HIGH FRAME RATE"; longTextBuffer = "0"; maxLength = "255"; groupNum = "0"; }; new ShellRadioButton(AH_HiVisibilityRdo) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "358 67"; extent = "150 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "HIGH VISIBILITY"; longTextBuffer = "0"; maxLength = "255"; groupNum = "0"; }; new ShellToggleButton(AH_DedicatedTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "32 106"; extent = "150 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DEDICATED"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(AH_PureServerTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "195 106"; extent = "150 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "PURE SERVER"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(AH_TeamDamageTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "358 106"; extent = "150 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "TEAM DAMAGE ON"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(AH_TournamentTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "32 136"; extent = "150 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "TOURNAMENT MODE"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(AH_AdminVoteTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "195 136"; extent = "150 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ALLOW ADMIN VOTES"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(AH_AllowSmurfTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "358 136"; extent = "150 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ALLOW ALIASES"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 174"; extent = "114 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Vote Pass Percentage:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(AH_VotePassText) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "198 175"; extent = "29 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "60%"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(AH_VotePassSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "89 189"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "AH_VotePassText.update();"; helpTag = "0"; range = "50.000000 100.000000"; ticks = "51"; value = "70"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 214"; extent = "54 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Vote Time:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(AH_VoteTimeText) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 215"; extent = "69 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "20 seconds"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(AH_VoteTimeSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "89 229"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "AH_VoteTimeText.update();"; helpTag = "0"; range = "10.000000 60.000000"; ticks = "51"; value = "20"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "277 175"; extent = "93 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Observer Timeout:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(AH_RespawnText) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "375 176"; extent = "69 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "30 seconds"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(AH_RespawnSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "287 190"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "AH_RespawnText.update();"; helpTag = "0"; range = "10.000000 60.000000"; ticks = "51"; value = "45"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "277 215"; extent = "72 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Warmup Time:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(AH_WarmupText) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "354 216"; extent = "69 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "30 seconds"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(AH_WarmupSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "287 230"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "AH_WarmupText.update();"; helpTag = "0"; range = "0.000000 30.000000"; ticks = "31"; value = "20"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "top"; position = "143 262"; extent = "58 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Server Info:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "center"; vertSizing = "top"; position = "140 275"; extent = "260 85"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "7 7"; extent = "230 71"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextEditCtrl(AH_ServerInfo) { profile = "ShellMessageTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "230 71"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "95 365"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.popDialog( AdvancedHostDlg );"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "317 365"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "AdvancedHostDlg.Accept();"; helpTag = "0"; text = "SAVE"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(DX X gui/BrowserEditInfoDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(BrowserEditInfoDlg) { profile = "DlgBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "70 80"; extent = "500 320"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "EDIT DESCRIPTION"; maxLength = "255"; noTitleBar = "0"; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "81 265"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "TribePropertiesDlg.pendingChanges = \"\";WarriorPropertiesDlg.pendingChanges = \"\";Canvas.popDialog(BrowserEditInfoDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "height"; position = "25 34"; extent = "449 233"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 7"; extent = "419 219"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMLTextEditCtrl(EditDescriptionText) { profile = "ShellMessageTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "419 219"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "1"; maxChars = "3600"; }; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "291 265"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "EditDescriptionApply();"; helpTag = "0"; text = "APPLY"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(y gui/BrowserSearchDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(BrowserSearchDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl(BrowserSearchPane) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 61"; extent = "399 358"; minExtent = "48 92"; visible = "1"; helpTag = "0"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "97 46"; extent = "44 16"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Search:"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 93"; extent = "226 187"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 7"; extent = "202 173"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellTextList(BrowserSearchMatchList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "202 8"; minExtent = "8 8"; visible = "1"; altCommand = "BrowserSearchDone();"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; }; }; }; new ShellBitmapButton(BSearchOKBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "201 288"; extent = "115 38"; minExtent = "32 38"; visible = "1"; command = "BrowserSearchDone();"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "172 80"; extent = "47 16"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Matches:"; }; new ShellTextEditCtrl(Search_EditField) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "139 33"; extent = "133 38"; minExtent = "32 38"; visible = "1"; variable = "$BrowserSearchField"; altCommand = "BrowserStartSearch();"; helpTag = "0"; historySize = "0"; maxLength = "255"; password = "0"; glowOffset = "9 9"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "80 288"; extent = "116 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(BrowserSearchDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "262 33"; extent = "51 38"; minExtent = "32 38"; visible = "1"; command = "BrowserStartSearch();"; helpTag = "0"; text = "GO"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(|..gui/CenterPrint.gui//--- OBJECT WRITE BEGIN --- new GuiControl(CenterPrintDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "638 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(CenterPrintText) { profile = "ShellProgressBarTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "300 240"; extent = "640 128"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "6"; }; }; //--- OBJECT WRITE END --- PK !(8] gui/ChannelBanDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(ChannelBanDlg) { profile = "DlgBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl(ChannelBanPane) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "154 65"; extent = "332 346"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "EDIT BAN LIST"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "27 28"; extent = "72 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Warrior Name:"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "height"; position = "22 42"; extent = "287 248"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 7"; extent = "279 234"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellChatMemberList(ChannelBanList) { profile = "ShellChatMemberListProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "263 8"; minExtent = "8 8"; visible = "1"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0 169"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new ShellBitmapButton(ChannelBanRemoveBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "32 291"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "ChannelRemoveBan();"; helpTag = "0"; text = "REMOVE BAN"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "169 291"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(ChannelBanDlg);"; helpTag = "0"; text = "DONE"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(J)  gui/ChannelKeyDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(ChannelKeyDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 160"; extent = "400 159"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "CHANNEL PASSWORD"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "34 40"; extent = "80 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Channel:"; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "119 38"; extent = "221 24"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiTextCtrl(KeyChannelName) { profile = "ShellStaticTextProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "8 3"; extent = "205 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "34 70"; extent = "80 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Password:"; }; new ShellTextEditCtrl(EditChannelKey) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "110 62"; extent = "238 38"; minExtent = "32 38"; visible = "1"; helpTag = "0"; historySize = "0"; maxLength = "255"; password = "1"; glowOffset = "9 9"; altCommand = "keyChannelJoin();"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "48 104"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(ChannelKeyDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "224 104"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "KeyChannelJoin();"; helpTag = "0"; text = "JOIN"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(T-ppgui/ChannelOptionsDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(ChannelOptionsDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "75 102"; extent = "490 276"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "CHANNEL OPTIONS"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "25 38"; extent = "60 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Channel:"; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "91 36"; extent = "218 24"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiTextCtrl(EditChannelName) { profile = "ShellStaticTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "8 3"; extent = "202 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "25 68"; extent = "60 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Topic:"; }; new ShellTextEditCtrl(EditChannelTopic) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "81 60"; extent = "362 38"; minExtent = "32 38"; visible = "1"; helpTag = "0"; historySize = "0"; maxLength = "64"; password = "0"; glowOffset = "9 9"; }; new ShellToggleButton(ButtonChannelInvite) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "63 106"; extent = "150 30"; minExtent = "26 27"; visible = "1"; variable = "$EditChannelInvite"; command = "ToggleChannelInvite();"; helpTag = "0"; text = "INVITE ONLY"; }; new ShellToggleButton(ButtonChannelModerate) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "277 106"; extent = "150 30"; minExtent = "26 27"; visible = "1"; variable = "$EditChannelModerate"; helpTag = "0"; text = "MODERATE"; }; new ShellToggleButton(ButtonChannelLimit) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "45 148"; extent = "150 30"; minExtent = "26 27"; visible = "1"; variable = "$EditChannelLimit"; command = "ToggleChannelLimit();"; helpTag = "0"; text = "LIMIT MEMBERS"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "201 151"; extent = "60 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Max:"; }; new ShellTextEditCtrl(EditChannelMaxMembers) { profile = "NewTextEditNumericProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "256 143"; extent = "99 38"; minExtent = "32 38"; visible = "1"; helpTag = "0"; historySize = "0"; maxLength = "5"; password = "0"; glowOffset = "9 9"; }; new ShellToggleButton(ButtonChannelKey) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "45 178"; extent = "150 30"; minExtent = "26 27"; visible = "1"; variable = "$EditChannelKey"; command = "ToggleChannelKey();"; helpTag = "0"; text = "REQUIRE PASSWORD"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "201 181"; extent = "60 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Password:"; }; new ShellTextEditCtrl(EditChannelPassword) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "256 173"; extent = "198 38"; minExtent = "32 38"; visible = "1"; helpTag = "0"; historySize = "0"; maxLength = "16"; password = "1"; glowOffset = "9 9"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "315 30"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.pushDialog(ChannelBanDlg);"; helpTag = "0"; text = "BAN LIST"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "78 221"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "CancelChannelOptions();"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton(ButtonChannelAccept) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "284 221"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "AcceptChannelOptions();"; helpTag = "0"; text = "ACCEPT"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(ɭ55gui/ChatDlg.guinew GuiControl(MainChatHud) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; modal = "1"; bypassHideCursor = "1"; setFirstResponder = "0"; new GuiNoMouseCtrl() { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "bottom"; position = "0 0"; extent = "300 300"; minExtent = "8 8"; visible = "1"; new HudHorzCtrl(mainVoteHud) { profile = "HudVoteBackProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "8 75"; extent = "256 5"; minExtent = "2 2"; visible = "0"; new GuiVoteCtrl(voteHud) { profile = "ShellProgressBarProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "6 2"; extent = "244 3"; minExtent = "2 2"; visible = "1"; }; new GuiBitmapCtrl(passHash) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "151 -1"; extent = "5 10"; minExtent = "1 1"; visible = "1"; bitmap = "gui/voteMeterPassBar"; }; }; new ShellFieldCtrl(OuterChatHud) { profile = "GuiChatBackProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "8 8"; extent = "256 72"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; new GuiBitmapCtrl(chatPageDown) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "250 50"; extent = "13 13"; minExtent = "8 8"; visible = "0"; bitmap = "gui/hud_chatPageDown"; }; new GuiScrollCtrl(ChatScrollHud) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "4 4"; extent = "252 64"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOff"; constantThumbHeight = "0"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "4 4"; extent = "252 64"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMessageVectorCtrl(ChatHud) { profile = "GuiChatHudProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 4"; extent = "252 64"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; lineSpacing = "0"; lineContinuedIndex = "10"; allowedMatches[0] = "http"; allowedMatches[1] = "t2server"; matchColors[0] = "0 0 255 255"; matchColors[1] = "255 0 0 255"; matchColors[2] = "0 0 255 255"; matchColors[3] = "0 0 255 255"; matchColors[4] = "0 0 255 255"; matchColors[5] = "0 0 255 255"; matchColors[6] = "0 0 255 255"; matchColors[7] = "0 0 255 255"; matchColors[8] = "0 0 255 255"; matchColors[9] = "0 0 255 255"; matchColors[10] = "0 0 255 255"; matchColors[11] = "0 0 255 255"; matchColors[12] = "0 0 255 255"; matchColors[13] = "0 0 255 255"; matchColors[14] = "0 0 255 255"; matchColors[15] = "0 0 255 255"; maxColorIndex = 5; }; }; }; }; }; }; PK !(묟))gui/ChatGui.gui//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(ChatGui) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$ShellBackground"; helpTag = "0"; useVariable = "1"; new ShellPaneCtrl(ChatChannelPane) { profile = "ShellPaneProfile"; horizSizing = "width"; vertSizing = "height"; position = "12 13"; extent = "620 423"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHAT"; longTextBuffer = "0"; maxLength = "255"; noTitleBar = "0"; new ShellTabFrame(ChatTabFrame) { profile = "ShellHorzTabFrameProfile"; horizSizing = "width"; vertSizing = "height"; position = "22 54"; extent = "576 351"; minExtent = "26 254"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; isVertical = "0"; useCloseButton = "0"; edgeInset = "0"; new GuiBubbleTextCtrl(ChatChannelTopic) { profile = "ShellTopicTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "59 14"; extent = "328 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "This is a sample chat topic"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "15 14"; extent = "38 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "TOPIC:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellBitmapButton(ChatOpenPaneBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "444 5"; extent = "100 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "ChatTabView.openNewPane();"; helpTag = "0"; text = "CHANNELS"; simpleStyle = "0"; }; new ShellBitmapButton(ChatClosePaneBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "529 5"; extent = "43 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "ChatTabView.closeCurrentPane();"; accelerator = "x"; helpTag = "0"; text = "X"; simpleStyle = "0"; }; }; new ShellFieldCtrl(WelcomePanel) { profile = "ShellFieldProfile"; horizSizing = "width"; vertSizing = "height"; position = "31 92"; extent = "559 315"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "195 5"; extent = "360 303"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 2"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 6"; extent = "336 291"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextCtrl(WelcomeText) { profile = "NewTextEditProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "362 2376"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "height"; position = "2 21"; extent = "195 287"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 7"; extent = "187 273"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellTextList(WelcomeHeadlines) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "187 180"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new GuiTextCtrl() { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 6"; extent = "72 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CONTENTS:"; longTextBuffer = "0"; maxLength = "255"; }; }; new ShellFieldCtrl(ChatPanel) { profile = "ShellFieldProfile"; horizSizing = "width"; vertSizing = "height"; position = "31 92"; extent = "559 315"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellTextEditCtrl(ChatMessageEntry) { profile = "NewTextEditProfile"; horizSizing = "width"; vertSizing = "top"; position = "-2 279"; extent = "392 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; altCommand = "ChatSendText();"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; historySize = "0"; password = "0"; IRCName = "0"; tabComplete = "1"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellScrollCtrl(MemberScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "left"; vertSizing = "height"; position = "383 1"; extent = "175 311"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 2"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 6"; extent = "151 299"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellChatMemberList(ChatRoomMemberList) { profile = "ShellChatMemberListProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "151 8"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; altCommand = "ChatPrivate();"; helpTag = "0"; enumerate = "1"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new ShellScrollCtrl(ChatGuiScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 2"; extent = "381 282"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "2 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "6 7"; extent = "353 268"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiChannelVectorCtrl(ChatGuiMessageVector) { profile = "GuiChannelVectorProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "357 8"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "0"; lineContinuedIndex = "5"; allowedMatches[0] = "http"; matchColor = "4 235 105 255"; maxColorIndex = "9"; }; }; }; }; new ShellTabGroupCtrl(ChatTabView) { profile = "TabGroupProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "30 25"; extent = "560 29"; minExtent = "38 29"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; glowOffset = "7"; tabSpacing = "2"; maxTabWidth = "150"; stretchToFit = "0"; }; new ShellBitmapButton(ChatEditChannelBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "15 -5"; extent = "128 38"; minExtent = "32 38"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; command = "EditChannelOptions();"; helpTag = "0"; text = "CHANNEL OPTIONS"; simpleStyle = "0"; }; new ShellBitmapButton(ChatEditOptionsBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "15 -5"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EditChatOptions();"; helpTag = "0"; text = "CHAT OPTIONS"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(a gui/ChatOptionsDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(ChatOptionsDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "75 102"; extent = "490 276"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "CHAT OPTIONS"; maxLength = "255"; noTitleBar = "0"; new ShellToggleButton(ButtonChatShowJoin) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "270 57"; extent = "177 30"; minExtent = "26 27"; visible = "1"; variable = ""; command = "ChatHideJoinMessage();"; helpTag = "0"; text = "Hide \"Join Server\" Messages"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 146"; extent = "88 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Away Message:"; maxLength = "255"; }; new ShellTextEditCtrl(EditChatAwayMessage) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 138"; extent = "366 38"; minExtent = "32 38"; visible = "1"; helpTag = "0"; maxLength = "64"; historySize = "0"; password = "0"; glowOffset = "9 9"; variable = "$tempAwayMsg"; }; new ShellToggleButton(ButtonChatHighlight) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 32"; extent = "150 30"; minExtent = "26 27"; visible = "1"; variable = ""; command = "ToggleChatHiglight();"; helpTag = "0"; text = "Highlight text with my nick"; maxLength = "255"; }; new ShellToggleButton(ButtonChatChannelHighlight) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 57"; extent = "150 30"; minExtent = "26 27"; visible = "1"; variable = ""; command = "ToggleChatHiglightChannel();"; helpTag = "0"; text = "Highlight Channel"; maxLength = "255"; }; new ShellToggleButton(ButtonChatNameLinkToggle) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "270 32"; extent = "176 30"; minExtent = "26 27"; visible = "1"; variable = ""; command = "ToggleChatLinkedNicks();"; helpTag = "0"; text = "Names are not links"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 174"; extent = "88 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Kick Message:"; maxLength = "255"; }; new ShellTextEditCtrl(EditChatKickMessage) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 166"; extent = "366 38"; minExtent = "32 38"; visible = "1"; helpTag = "0"; maxLength = "64"; historySize = "0"; password = "0"; glowOffset = "9 9"; variable = "$tempKickmsg"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 200"; extent = "88 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Ban Message:"; maxLength = "255"; }; new ShellTextEditCtrl(EditChatBanMessage) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 194"; extent = "366 38"; minExtent = "32 38"; visible = "1"; helpTag = "0"; maxLength = "64"; historySize = "0"; password = "0"; glowOffset = "9 9"; variable = "$tempBanmsg"; }; new ShellBitmapButton(ButtonChatOptionsAccept) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "284 221"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "AcceptChatOptions();"; helpTag = "0"; text = "ACCEPT"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "78 221"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "CancelChatOptions();"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(MMgui/ChooseFilterDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(ChooseFilterDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "95 78"; extent = "450 324"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "CHANGE FILTER"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "44 32"; extent = "98 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "CHOOSE A FILTER:"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "39 49"; extent = "218 220"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 7"; extent = "188 206"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellTextList(CF_FilterList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "188 8"; minExtent = "8 8"; visible = "1"; altCommand = "ChooseFilterDlg.editFilter();"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new ShellBitmapButton(CF_NewFilterBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "280 46"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "ChooseFilterDlg.newFilter();"; helpTag = "0"; text = "NEW FILTER"; simpleStyle = "0"; }; new ShellBitmapButton(CF_EditFilterBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "280 76"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "ChooseFilterDlg.editFilter();"; helpTag = "0"; text = "EDIT FILTER"; simpleStyle = "0"; }; new ShellBitmapButton(CF_DeleteFilterBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "280 106"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "ChooseFilterDlg.deleteFilter();"; helpTag = "0"; text = "DELETE FILTER"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "65 269"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(ChooseFilterDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton(CF_GoBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "257 269"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "ChooseFilterDlg.go();"; helpTag = "0"; text = "GO!"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(- gui/CommanderChatDlg.gui//--- OBJECT WRITE BEGIN --- new GuiCommanderNoFocusCtrl(CommanderChatDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new HudFancyCtrl() { profile = "GuiChatBackProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "60 0"; extent = "330 80"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiScrollCtrl() { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "7 4"; extent = "320 70"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOff"; constantThumbHeight = "0"; new GuiMessageVectorCtrl(CommanderChatHud) { profile = "GuiChatHudProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "7 4"; extent = "320 70"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; lineSpacing = "0"; lineContinuedIndex = "5"; allowedMatches[0] = "http"; allowedMatches[1] = "t2server"; matchColors[0] = "0 0 255 255"; matchColors[1] = "255 0 0 255"; matchColors[2] = "0 0 255 255"; matchColors[3] = "0 0 255 255"; matchColors[4] = "0 0 255 255"; matchColors[5] = "0 0 255 255"; matchColors[6] = "0 0 255 255"; matchColors[7] = "0 0 255 255"; matchColors[8] = "0 0 255 255"; matchColors[9] = "0 0 255 255"; matchColors[10] = "0 0 255 255"; matchColors[11] = "0 0 255 255"; matchColors[12] = "0 0 255 255"; matchColors[13] = "0 0 255 255"; matchColors[14] = "0 0 255 255"; matchColors[15] = "0 0 255 255"; }; }; }; }; //--- OBJECT WRITE END --- PK !(܃ۡ!!gui/CommanderMapGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(CommanderMapGui) { profile = "CommanderGuiProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; visible = "1"; new GuiCommanderMap(CommanderMap) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "475 480"; // field data defaultCursor = DefaultCursor; arrowCursor = CMDCursorArrow; handCursor = CMDCursorHandOpen; moveCursor = CMDCursorHandClosed; zoomCursor = CMDCursorZoom; addCursor = CMDCursorSelectAdd; removeCursor = CMDCursorSelectRemove; mouseSelectRectColor = "255 255 0 255"; cameraOffset = 10; cameraVelocity = 500; defaultIconName = CMDDefaultIcon; waypintIconName = CMDWaypointIcon; assignedTaskIconName = CMDAssignedTaskIcon; potentialTaskIconName = CMDPotentialTaskIcon; sensorSphereFrameAlpha = 75; sensorSphereFillAlpha = 30; renderMissionArea = true; missionAreaFillColor = "60 60 60 80"; missionAreaFrameColor = "128 0 0 255"; renderText = true; textOffset = 2; hilightedObjectColor = "234 154 4 200"; selectedObjectColor = "2 247 248 200"; playerMarkerAngle = 30; playerMarkerOffset = 8; playerMarkerLen = 8; playerMarkerColor = "0 255 0 200"; minIconSize = 20; maxIconSize = 64; iconProjLen = "20.0"; minDistanceScale = "0.02"; maxDistanceScale = "0.05"; enableEdgeMarkers = true; edgeMarkerSize = 32; renderSensors = false; }; new ShellScrollCtrl(CommanderTreeContainer) { profile = "NewScrollCtrlProfile"; horizSizing = "left"; vertSizing = "height"; vScrollBar = "alwaysOn"; hScrollBar = "alwaysOff"; position = "471 -4"; extent = "173 458"; new GuiScrollContentCtrl() { profile = "CommanderScrollContentProfile"; horizSizing = "left"; vertSizing = "height"; new GuiCommanderTree(CommanderTree) { profile = "CommanderTreeProfile"; position = "0 0"; extent = "150 459"; horizSizing = "left"; vertSizing = "height"; visible = "true"; // field data backdropBitmapName = "commander/gui/cmd_gradient"; headerFontType = "Arial Bold"; entryFontType = "Arial"; clientNoneFontType = "Arial"; headerFontSize = 14; entryFontSize = 13; clientNoneFontSize = 13; entryIconOffset = "2 1"; entryTextOffset = "20 3"; headerBitmapName = "commander/gui/cmd_columnheadbar"; headerTextOffset = "10 4"; clientNoneText = "None Selected"; headerHeight = 20; entryHeight = 20; entryHilightColor = "44 168 219 100"; entrySelectColor = "255 0 0 100"; categoryOpenTime = 250; damageColors = "0 255 0 20 255 255 0 70 255 0 0 100"; objectControlRect = "128 2 16 16"; objectControlBitmapName = "commander/gui/cmd_control_checkbox"; }; }; }; // boob-tube new GuiCommanderTV(CommanderTV) { profile = "CommanderButtonBackdropProfile"; position = "475 300"; extent = "165 150"; visible = "false"; vertSizing = "top"; horizSizing = "left"; frameBitmap = "commander/gui/cmd_tv_frame"; staticBitmap = "commander/gui/cmd_tv_static"; open = false; target = -1; new GuiMouseEventCtrl(CommanderTVScreen) { profile = "DefaultProfile"; position = "0 0"; extent = "165 150"; vertSizing = "top"; horizSizing = "left"; visible = "true"; }; }; // return to game new GuiControl() { profile = "CommanderButtonBackdropProfile"; position = "475 450"; extent = "165 31"; horizSizing = "left"; vertSizing = "top"; new ShellBitmapButton() { profile = "CommanderButtonProfile"; opaque = "true"; horizSizing = "left"; vertSizing = "top"; visible = "1"; position = "-6 -2"; extent = "177 31"; command = "CommanderMapGui.close();"; text = "RETURN TO GAME"; }; }; // top button bar new GuiControl() { profile = "DefaultProfile"; position = "437 -4"; extent = "44 228"; horizSizing = "left"; vertSizing = "bottom"; visible = "true"; new GuiCommanderMapCheckbox(CMDPlayersButton) { profile = "CommanderButtonProfile"; position = "0 0"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_players"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapCheckbox(CMDTacticalButton) { profile = "CommanderButtonProfile"; position = "0 31"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_tactical"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapCheckbox(CMDDeployedTacticalButton) { profile = "CommanderButtonProfile"; position = "0 62"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_tactical_D"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapCheckbox(CMDMiscButton) { profile = "CommanderButtonProfile"; position = "0 93"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_misc"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapCheckbox(CMDDeployedMiscButton) { profile = "CommanderButtonProfile"; position = "0 124"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_misc_D"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapCheckbox(CMDWaypointsButton) { profile = "CommanderButtonProfile"; position = "0 155"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_waypoints"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapCheckbox(CMDObjectivesButton) { profile = "CommanderButtonProfile"; position = "0 186"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_objectives"; mouseRegion = "7 7 31 31"; }; }; // bottom button bar new GuiControl() { profile = "DefaultProfile"; position = "437 286"; extent = "44 199"; horizSizing = "left"; vertSizing = "top"; visible = "true"; new GuiCommanderMapCheckbox(CMDShowSensorsButton) { profile = "CommanderButtonProfile"; position = "0 0"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_sensor"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapCheckbox(CMDMoveSelectButton) { profile = "CommanderButtonProfile"; position = "0 31"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_moveselect"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapCheckbox(CMDZoomButton) { profile = "CommanderButtonProfile"; position = "0 62"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_zoom"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapButton(CMDCenterButton) { profile = "CommanderButtonProfile"; position = "0 93"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_center"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapCheckbox(CMDTextButton) { profile = "CommanderButtonProfile"; position = "0 124"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_text"; mouseRegion = "7 7 31 31"; }; new GuiCommanderMapCheckbox(CMDCameraButton) { profile = "CommanderButtonProfile"; position = "0 155"; extent = "44 44"; bitmap = "commander/gui/cmd_icon_camera"; mouseRegion = "7 7 31 31"; }; }; }; //--- OBJECT WRITE END --- PK !(#" @ %text); eval(%text); ConsoleEntry.setValue(""); } function ToggleConsole(%make) { if (%make) { if ($ConsoleActive) { Canvas.popDialog(ConsoleDlg); $ConsoleActive = false; if ( $enableDirectInput ) activateKeyboard(); } else { Canvas.pushDialog(ConsoleDlg, 99); $ConsoleActive = true; deactivateKeyboard(); } } } PK !(;gui/CreateAccountDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(CreateAccountDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; open = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "70 36"; extent = "500 408"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "ACCOUNT INFORMATION"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "35 35"; extent = "100 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Login Name:"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "35 110"; extent = "100 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Password:"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "35 140"; extent = "100 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Confirm Password:"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "35 170"; extent = "100 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "CD Key:"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "35 218"; extent = "100 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Email:"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "174 289"; extent = "134 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "We are COPPA compliant."; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "73 305"; extent = "351 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "If you are under 13, you are not allowed to create a Tribes 2 account."; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "35 64"; extent = "100 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Warrior Name:"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "131 27"; extent = "180 38"; minExtent = "32 38"; visible = "1"; variable = "$CreateAccountLoginName"; helpTag = "0"; historySize = "0"; maxLength = "16"; password = "0"; glowOffset = "9 9"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "131 56"; extent = "180 38"; minExtent = "32 38"; visible = "1"; variable = "$CreateAccountWarriorName"; helpTag = "0"; historySize = "0"; maxLength = "16"; password = "0"; glowOffset = "9 9"; IRCName = true; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "131 102"; extent = "180 38"; minExtent = "32 38"; visible = "1"; variable = "$CreateAccountPassword"; helpTag = "0"; historySize = "0"; maxLength = "16"; password = "1"; glowOffset = "9 9"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "131 132"; extent = "180 38"; minExtent = "32 38"; visible = "1"; variable = "$CreateAccountConfirmPassword"; helpTag = "0"; historySize = "0"; maxLength = "16"; password = "1"; glowOffset = "9 9"; }; new ShellTextEditCtrl(CreateAccountCDKey1) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "131 162"; extent = "72 38"; minExtent = "32 38"; visible = "1"; command = "CreateAccountCDKey1.process();"; helpTag = "0"; historySize = "0"; maxLength = "4"; password = "0"; glowOffset = "9 9"; }; new ShellTextEditCtrl(CreateAccountCDKey2) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "191 162"; extent = "72 38"; minExtent = "32 38"; visible = "1"; command = "CreateAccountCDKey2.process();"; helpTag = "0"; historySize = "0"; maxLength = "4"; password = "0"; glowOffset = "9 9"; }; new ShellTextEditCtrl(CreateAccountCDKey3) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "251 162"; extent = "72 38"; minExtent = "32 38"; visible = "1"; command = "CreateAccountCDKey3.process();"; helpTag = "0"; historySize = "0"; maxLength = "4"; password = "0"; glowOffset = "9 9"; }; new ShellTextEditCtrl(CreateAccountCDKey4) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "311 162"; extent = "72 38"; minExtent = "32 38"; visible = "1"; command = "CreateAccountCDKey4.process();"; helpTag = "0"; historySize = "0"; maxLength = "4"; password = "0"; glowOffset = "9 9"; }; new ShellTextEditCtrl(CreateAccountCDKey5) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "371 162"; extent = "72 38"; minExtent = "32 38"; visible = "1"; command = "CreateAccountCDKey5.process();"; helpTag = "0"; historySize = "0"; maxLength = "4"; password = "0"; glowOffset = "9 9"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "131 209"; extent = "269 38"; minExtent = "32 38"; visible = "1"; variable = "$CreateAccountEmail"; helpTag = "0"; historySize = "0"; maxLength = "128"; password = "0"; glowOffset = "9 9"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "63 244"; extent = "366 30"; minExtent = "26 27"; visible = "1"; variable = "$CreateAccountSendInfo"; helpTag = "0"; text = "SEND ME INFORMATION ABOUT TRIBES 2 AND OTHER PRODUCTS"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "148 325"; extent = "201 30"; minExtent = "26 27"; visible = "1"; variable = "$CreateAccountAgeGood"; helpTag = "0"; text = "I AM AT LEAST 13 YEARS OF AGE"; }; new ShellBitmapButton(CreateAccountSubmitBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "282 351"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "CreateAccountDlg.onSubmit();"; helpTag = "0"; text = "SUBMIT"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "72 351"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "CreateAccountDlg.onCancel();"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(d^^gui/CreateTribeDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(CreateTribeDlg) { profile = "DlgBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "70 36"; extent = "500 408"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "CREATE TRIBE"; maxLength = "255"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "18 38"; extent = "70 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Tribe Name:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "18 68"; extent = "70 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Tribe Tag:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "18 128"; extent = "70 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Description:"; maxLength = "255"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 30"; extent = "260 38"; minExtent = "32 38"; visible = "1"; variable = "$CreateTribeName"; helpTag = "0"; maxLength = "24"; historySize = "0"; password = "0"; glowOffset = "9 9"; IRCName = true; }; new ShellTextEditCtrl(CT_TagText) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 60"; extent = "107 38"; minExtent = "32 38"; visible = "1"; variable = "$CreateTribeTag"; command = "updateTribeTagPreview();"; helpTag = "0"; maxLength = "8"; historySize = "0"; password = "0"; glowOffset = "9 9"; IRCName = true; }; new ShellToggleButton(rbAppendTag) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "189 64"; extent = "146 30"; minExtent = "26 27"; visible = "1"; variable = "$CreateTribeAppend"; command = "updateTribeTagPreview();"; helpTag = "0"; text = "APPEND TRIBE TAG"; maxLength = "255"; }; new ShellToggleButton(rbRecruiting) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "308 95"; extent = "162 30"; minExtent = "26 27"; visible = "1"; variable = "$CreateTribeRecruiting"; helpTag = "0"; text = "RECRUITING"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "18 98"; extent = "70 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Preview:"; maxLength = "255"; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "93 97"; extent = "192 22"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiTextCtrl(CT_PreviewText) { profile = "ShellAltTextCenterProfile"; horizSizing = "width"; vertSizing = "height"; position = "3 2"; extent = "186 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; }; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "height"; position = "26 143"; extent = "448 208"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 7"; extent = "418 194"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMLTextEditCtrl(CreateTribeDescription) { profile = "ShellMessageTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "418 194"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "3600"; }; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "81 354"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "CreateTribeDlg.Cancel();"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton(CreateTribeBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "291 354"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "CreateTribeDlg.CreateTribe();"; helpTag = "0"; text = "CREATE"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(0٥gui/CreditsGui.gui//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(CreditsGui) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; variable = "$ShellBackground"; helpTag = "0"; useVariable = "1"; hideCursor = "1"; qLineCount = "0"; new ShellPaneCtrl() { profile = "ShellPaneProfile"; horizSizing = "width"; vertSizing = "height"; position = "28 13"; extent = "584 459"; minExtent = "48 92"; visible = "1"; helpTag = "0"; noTitleBar = "1"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "height"; position = "26 34"; extent = "312 402"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(CREDITS_Text) { profile = "ShellLoadTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "312 1"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; }; }; new GuiControl() { profile = "ShellLoadFrameProfile"; horizSizing = "relative"; vertSizing = "relative"; position = "349 8"; extent = "212 428"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiChunkedBitmapCtrl(CREDITS_Pic) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "1 1"; extent = "210 426"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = "gui/loading"; useVariable = "0"; }; }; }; }; //--- OBJECT WRITE END --- PK !(Tgui/DebriefGui.gui//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(DebriefGui) { profile = "GuiContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; variable = "$ShellBackground"; helpTag = "0"; useVariable = "1"; new ShellPaneCtrl(DB_Pane) { profile = "ShellPaneProfile"; horizSizing = "width"; vertSizing = "height"; position = "28 13"; extent = "584 459"; minExtent = "48 92"; visible = "1"; helpTag = "0"; noTitleBar = "1"; }; new GuiProgressCtrl(DB_LoadingProgress) { profile = "ShellProgressBarProfile"; horizSizing = "right"; vertSizing = "top"; position = "67 423"; extent = "300 25"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiTextCtrl(DB_LoadingProgressTxt) { profile = "ShellProgressBarTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 3"; extent = "300 19"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "LOADING MISSION..."; }; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "relative"; position = "0 0"; extent = "300 236"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellScrollCtrl(DB_ChatScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "50 18"; extent = "251 184"; minExtent = "24 24"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "7 7"; extent = "221 170"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMessageVectorCtrl(DB_ChatVector) { profile = "GuiChatHudProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "221 170"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "0"; lineContinuedIndex = "10"; allowedMatches[0] = "http"; allowedMatches[1] = "t2server"; matchColor = "0 0 255 255"; maxColorIndex = "5"; matchColors1 = "255 0 0 255"; matchColors0 = "0 0 255 255"; }; }; }; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "height"; position = "300 15"; extent = "340 405"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellFieldCtrl(DB_ResultPane) { profile = "ShellFieldProfile"; horizSizing = "width"; vertSizing = "height"; position = "5 7"; extent = "280 392"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(DebriefResultText) { profile = "DebriefHeadlineTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "4 3"; extent = "272 28"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; }; new ShellScrollCtrl(DB_ResultScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "2 58"; extent = "276 332"; minExtent = "24 24"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "7 7"; extent = "262 318"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(DebriefText) { profile = "DebriefTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "262 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "1"; }; }; }; }; }; new ShellBitmapButton() { profile = "ShellButtonNoTabProfile"; horizSizing = "left"; vertSizing = "top"; position = "372 417"; extent = "115 38"; minExtent = "32 38"; visible = "1"; setFirstResponder = "0"; command = "debriefDisconnect();"; helpTag = "0"; text = "DISCONNECT"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonNoTabProfile"; horizSizing = "left"; vertSizing = "top"; position = "478 417"; extent = "115 38"; minExtent = "32 38"; visible = "1"; setFirstResponder = "0"; command = "debriefContinue();"; accelerator = "escape"; helpTag = "0"; text = "CONTINUE"; simpleStyle = "0"; }; }; //--- OBJECT WRITE END --- //--- OBJECT WRITE BEGIN --- new GuiControl(DB_ChatDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "relative"; position = "0 0"; extent = "300 236"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellTextEditCtrl(DB_ChatEntry) { profile = "NewTextEditProfile"; horizSizing = "width"; vertSizing = "top"; position = "45 197"; extent = "261 38"; minExtent = "32 38"; visible = "1"; setFirstResponder = "0"; altCommand = "DB_ChatEntry.sendChat();"; escapeCommand = "DB_ChatEntry.onEscape();"; helpTag = "0"; historySize = "0"; maxLength = "120"; password = "0"; glowOffset = "9 9"; }; }; }; //--- OBJECT WRITE END --- PK !(迕 !gui/DebuggerBreakConditionDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DebuggerBreakConditionDlg) { profile = "GuiDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "220 146"; extent = "200 188"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Set the break condition"; resizeWidth = "True"; resizeHeight = "True"; canMove = "False"; canClose = "False"; canMinimize = "False"; canMaximize = "False"; minSize = "50 50"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 28"; extent = "121 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Enter the break condition:"; }; new GuiTextEditCtrl(BreakCondition) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 44"; extent = "160 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; altCommand = "DbgBreakConditionSet();"; helpTag = "0"; historySize = "0"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 68"; extent = "57 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Pass Count:"; }; new GuiTextEditCtrl(BreakPassCount) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 84"; extent = "160 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; historySize = "0"; returnTab = "true"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 108"; extent = "27 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Clear:"; }; new GuiTextEditCtrl(BreakClear) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 124"; extent = "160 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; historySize = "0"; returnTab = "true"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "56 156"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DbgBreakConditionSet();"; helpTag = "0"; text = "Set"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 156"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.popDialog(DebuggerBreakConditionDlg);"; helpTag = "0"; text = "Cancel"; }; }; }; //--- OBJECT WRITE END --- PK !(n gui/DebuggerConnectDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DebuggerConnectDlg) { profile = "GuiDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "220 146"; extent = "200 188"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Connect to server:"; resizeWidth = "True"; resizeHeight = "True"; canMove = "False"; canClose = "False"; canMinimize = "False"; canMaximize = "False"; minSize = "50 50"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 28"; extent = "55 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "IP Address:"; }; new GuiTextEditCtrl(DebuggerConnectAddress) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 44"; extent = "160 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; variable = "$pref::DBGConnectAddress"; helpTag = "0"; historySize = "0"; returnTab = "true"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 68"; extent = "21 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Port:"; }; new GuiTextEditCtrl(DebuggerConnectPort) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 84"; extent = "160 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; variable = "$pref::DBGConnectPort"; helpTag = "0"; historySize = "0"; returnTab = "true"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 108"; extent = "52 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Password:"; }; new GuiTextEditCtrl(DebuggerConnectPassword) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 124"; extent = "160 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; variable = "$pref::DBGConnectPassword"; helpTag = "0"; historySize = "0"; returnTab = "true"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "56 156"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DbgConnect();"; helpTag = "0"; text = "Open"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 156"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.popDialog(DebuggerConnectDlg);"; helpTag = "0"; text = "Cancel"; }; }; }; //--- OBJECT WRITE END --- PK !(3"gui/DebuggerEditWatchDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DebuggerEditWatchDlg) { profile = "GuiDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "220 180"; extent = "200 108"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Edit a Variable"; resizeWidth = "True"; resizeHeight = "True"; canMove = "False"; canClose = "False"; canMinimize = "False"; canMaximize = "False"; minSize = "50 50"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 28"; extent = "99 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Enter the new value:"; }; new GuiTextEditCtrl(EditWatchDialogValue) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 44"; extent = "160 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; altCommand = "DbgWatchDialogEdit();"; helpTag = "0"; historySize = "0"; fontHL = "14 253 Arial"; font = "14 244 Arial"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "56 80"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DbgWatchDialogEdit();"; helpTag = "0"; text = "Edit"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 80"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.popDialog(DebuggerEditWatchDlg);"; helpTag = "0"; text = "Cancel"; }; }; }; //--- OBJECT WRITE END --- PK !(1ngui/DebuggerFindDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DebuggerFindDlg) { profile = "GuiDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "220 180"; extent = "200 108"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "File Search"; resizeWidth = "True"; resizeHeight = "True"; canMove = "False"; canClose = "False"; canMinimize = "False"; canMaximize = "False"; minSize = "50 50"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 28"; extent = "99 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Search for:"; }; new GuiTextEditCtrl(DebuggerFindStringText) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 44"; extent = "160 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; altCommand = "DbgFileViewFind();"; helpTag = "0"; historySize = "0"; fontHL = "14 253 Arial"; font = "14 244 Arial"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "56 80"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DbgFileViewFind();"; helpTag = "0"; text = "Find"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 80"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.popDialog(DebuggerFindDlg);"; helpTag = "0"; text = "Cancel"; }; }; }; //--- OBJECT WRITE END --- PK !(O@@gui/DebuggerGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DebuggerGui) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.pushDialog(DebuggerConnectDlg, 80);"; helpTag = "0"; text = "Connect"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "72 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.pushDialog(OpenFileDialog, 80);"; helpTag = "0"; text = "File"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "72 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "dbgStepIn();"; accelerator = "f7"; helpTag = "0"; text = "Step In"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "136 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "dbgStepOver();"; accelerator = "f8"; helpTag = "0"; text = "Step Over"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "200 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "dbgStepOut();"; accelerator = "f6"; helpTag = "0"; text = "Step Out"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "264 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "dbgContinue();"; accelerator = "f9"; helpTag = "0"; text = "Run"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "328 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.pushDialog(DebuggerFindDlg, 80);"; helpTag = "0"; text = "Find"; }; new GuiTextCtrl(DebuggerCursorWatch) { profile = "GuiTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "398 4"; extent = "126 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = ""; justify = "left"; }; new GuiTextCtrl(DebuggerStatus) { profile = "GuiTextProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "532 4"; extent = "60 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "NOT CONNECTED"; justify = "right"; }; new GuiFrameSetCtrl(DebuggerRootFrame) { profile = "GuiButtonProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 24"; extent = "640 456"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; columns = "0 486"; rows = "0"; borderWidth = "4"; borderColor = "0.000000, 0.000000, 0.000000, 0.000000"; borderEnable = "dynamic"; borderMovable = "dynamic"; new GuiFrameSetCtrl(DebuggerLeftFrame) { profile = "GuiButtonProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "482 456"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; columns = "0"; rows = "0 350"; borderWidth = "4"; borderColor = "0.000000, 0.000000, 0.000000, 0.000000"; borderEnable = "dynamic"; borderMovable = "dynamic"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "482 346"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 4"; extent = "47 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Open File:"; }; new GuiPopUpMenuCtrl(DebuggerFilePopup) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 4"; extent = "160 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; maxPopupHeight = "200"; }; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 24"; extent = "482 321"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "dynamic"; vScrollBar = "dynamic"; constantThumbHeight = "False"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "1 1"; extent = "462 301"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new DbgFileView(DebuggerFileView) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 -433"; extent = "509 3904"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; }; }; }; }; new GuiControl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 350"; extent = "482 106"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.pushDialog(DebuggerWatchDlg, 80);"; helpTag = "0"; text = "Add"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "72 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.pushDialog(DebuggerEditWatchDlg, 80);"; helpTag = "0"; text = "Edit"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "136 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DbgDeleteSelectedWatch();"; helpTag = "0"; text = "Delete"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "200 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DebuggerWatchView.clear();"; helpTag = "0"; text = "Clear"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "264 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DbgRefreshWatches();"; helpTag = "0"; text = "Refresh"; }; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 24"; extent = "481 80"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "dynamic"; vScrollBar = "dynamic"; constantThumbHeight = "False"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "1 1"; extent = "479 60"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextListCtrl(DebuggerWatchView) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 8"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; enumerate = "False"; resizeCell = "True"; columns = "0 200"; }; }; }; }; }; new GuiFrameSetCtrl(DebuggerRightFrame) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "486 0"; extent = "154 456"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; columns = "0"; rows = "0 150 350"; borderWidth = "4"; borderColor = "0.000000, 0.000000, 0.000000, 0.000000"; borderEnable = "dynamic"; borderMovable = "dynamic"; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "154 146"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "dynamic"; vScrollBar = "dynamic"; constantThumbHeight = "False"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "1 1"; extent = "152 126"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextListCtrl(DebuggerCallStack) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 8"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; enumerate = "False"; resizeCell = "True"; columns = "-1 -1 0"; }; }; }; new GuiControl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 150"; extent = "154 196"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.pushDialog(DebuggerBreakConditionDlg, 80);"; helpTag = "0"; text = "Condition"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "68 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DbgDeleteSelectedBreak();"; helpTag = "0"; text = "Delete"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "132 4"; extent = "56 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DebuggerBreakPoints.clearBreaks();"; helpTag = "0"; text = "Clear"; }; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 24"; extent = "153 171"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "dynamic"; vScrollBar = "dynamic"; constantThumbHeight = "False"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "1 1"; extent = "151 151"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextListCtrl(DebuggerBreakPoints) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "182 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; enumerate = "False"; resizeCell = "True"; columns = "16 56 156"; }; }; }; }; new GuiControl() { profile = "GuiWindowProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 350"; extent = "154 106"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "153 80"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "dynamic"; vScrollBar = "dynamic"; constantThumbHeight = "False"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "1 1"; extent = "151 78"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextListCtrl(DebuggerConsoleView) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "62 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; enumerate = "False"; resizeCell = "True"; columns = "0"; }; }; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "top"; position = "15 83"; extent = "9 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "%"; }; new GuiTextEditCtrl(DbgConsoleEntry) { profile = "GuiTextEditProfile"; horizSizing = "width"; vertSizing = "top"; position = "29 83"; extent = "120 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; altCommand = "DbgConsoleEntryReturn();"; helpTag = "0"; historySize = "32"; }; }; }; }; }; //--- OBJECT WRITE END --- PK !(3+:gui/DebuggerWatchDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DebuggerWatchDlg) { profile = "GuiDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "220 180"; extent = "200 108"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Add a Watch Expression:"; resizeWidth = "True"; resizeHeight = "True"; canMove = "False"; canClose = "False"; canMinimize = "False"; canMaximize = "False"; minSize = "50 50"; opaque = "true"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 28"; extent = "88 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Enter the Variable:"; }; new GuiTextEditCtrl(WatchDialogExpression) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 44"; extent = "160 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; altCommand = "DbgWatchDialogAdd();"; helpTag = "0"; historySize = "0"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "56 80"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DbgWatchDialogAdd();"; helpTag = "0"; text = "Add"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 80"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.popDialog(DebuggerWatchDlg);"; helpTag = "0"; text = "Cancel"; }; }; }; //--- OBJECT WRITE END --- PK !(pgui/DemoLoadProgressDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DemoLoadProgressDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "178 189"; extent = "300 107"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Loading..."; longTextBuffer = "0"; maxLength = "255"; noTitleBar = "0"; new GuiProgressCtrl(DemoLoadProgressCtrl) { profile = "ShellProgressBarProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 43"; extent = "209 30"; minExtent = "32 15"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; glowOffset = "9 9"; }; }; }; //--- OBJECT WRITE END --- PK !(0' ' gui/DemoPlaybackDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DemoPlaybackDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; hideCursor = "1"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl() { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "210 8"; extent = "217 82"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiProgressCtrl() { profile = "ShellProgressBarProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 34"; extent = "200 24"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$DemoPlaybackProgress"; helpTag = "0"; new GuiTextCtrl(DemoPlayback_CurTime) { profile = "ShellProgressBarTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 2"; extent = "200 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 59"; extent = "31 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "00:00"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(DemoPlayback_EndTime) { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "142 59"; extent = "64 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(DemoPlayback_StatusText) { profile = "ShellTextCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "77 10"; extent = "64 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; }; }; //--- OBJECT WRITE END --- PK !(mZ" " gui/DemoRenameFileDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DemoRenameFileDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "170 186"; extent = "300 146"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Rename File..."; longTextBuffer = "0"; maxLength = "255"; noTitleBar = "0"; new ShellTextEditCtrl(DemoRenameFile_Edit) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "71 39"; extent = "209 39"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; historySize = "0"; password = "0"; IRCName = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "28 47"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Filename:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "28 82"; extent = "124 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "OK"; simpleStyle = "0"; command = "Canvas.popDialog(DemoRenameFileDlg); doDemoFileRename();"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "154 82"; extent = "124 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; command = "Canvas.popDialog(DemoRenameFileDlg);"; }; }; }; //--- OBJECT WRITE END --- PK !(߱UVVgui/DetailSetDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DetailSetDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 -1"; extent = "129 281"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Detail Settings"; resizeWidth = "True"; resizeHeight = "True"; canMove = "True"; canClose = "True"; canMinimize = "True"; canMaximize = "True"; minSize = "50 50"; closeCommand = "DetailSetDgl::onCleanup(true);"; new GuiPopUpMenuCtrl(DetailMenu) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 21"; extent = "91 21"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Detail Options"; maxPopupHeight = "200"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 197"; extent = "32 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DetailAdjustTabs(Low);"; helpTag = "0"; text = "Low"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 197"; extent = "30 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DetailAdjustTabs(Medium);"; helpTag = "0"; text = "Med"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 198"; extent = "35 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DetailAdjustTabs(High);"; helpTag = "0"; text = "High"; }; new GuiScrollCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 43"; extent = "112 151"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOff"; constantThumbHeight = "True"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "110 149"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiControl(Sky_Tab) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "112 151"; minExtent = "8 8"; visible = "False"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 5"; extent = "84 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "Sky Settings:"; }; new GuiTextEditSliderCtrl(Sky_Slider) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 38"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; command = "Sky::DetailSliders(\"Sky_Slider\");"; helpTag = "0"; text = "1"; historySize = "0"; format = "%1.0f"; range = "1 99"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 23"; extent = "37 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Sphere:"; }; new GuiTextEditSliderCtrl(Cloud_Slider) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 75"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "3"; historySize = "0"; format = "%1.0f"; range = "0 3"; increment = "1"; command = "Sky::DetailSliders(\"Cloud_Slider\");"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 60"; extent = "29 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Cloud Layers:"; }; }; new GuiControl(Texture_Tab) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "112 151"; minExtent = "8 8"; visible = "False"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 5"; extent = "99 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "Texture Settings"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 23"; extent = "39 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Texture:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 38"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 60"; extent = "75 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Interior Texture:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 75"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; }; new GuiControl(Terrain_Tab) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "112 151"; minExtent = "8 8"; visible = "False"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 5"; extent = "97 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "Terrain Settings"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 23"; extent = "36 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Terrain:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 38"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 60"; extent = "64 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Screen Error:"; }; new GuiTextEditSliderCtrl(DetailScreenError) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 75"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; command = "$screenerror = DetailScreenError.getValue();"; helpTag = "0"; text = "3"; historySize = "0"; format = "%1.0f"; range = "0 10"; increment = "1"; }; }; new GuiControl(Shape_Tab) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "112 151"; minExtent = "8 8"; visible = "False"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 5"; extent = "89 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "Shape Settings"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 23"; extent = "63 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Static Shape:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 38"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 60"; extent = "66 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Player Shape:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 75"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; }; new GuiControl(Damage_Tab) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "-1 0"; extent = "112 151"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 7"; extent = "103 66"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "Damage Settings"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "23 26"; extent = "70 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Damage Detail:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 41"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "23 63"; extent = "64 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Damage Skin:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 78"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; }; new GuiControl(Decal_Tab) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "112 151"; minExtent = "8 8"; visible = "False"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 6"; extent = "84 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "Decal Settings"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 23"; extent = "29 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Decal:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 38"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 60"; extent = "57 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Smoke Trail:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 75"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; }; new GuiControl(Lighting_Tab) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "112 151"; minExtent = "8 8"; visible = "False"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 4"; extent = "101 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "Lighting Settings"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 23"; extent = "57 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Interior light:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 38"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 60"; extent = "69 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Dynamic Light:"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 75"; extent = "74 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "0"; historySize = "0"; format = "%1.0f"; range = "0 1"; increment = "1"; }; }; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 255"; extent = "63 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "DetailSetDgl::onCleanup(true);"; helpTag = "0"; text = "Close"; }; new GuiRadioCtrl(RadioOutline) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 217"; extent = "55 19"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "displayMode(True);"; helpTag = "0"; text = "OutLine"; groupNum = "1"; }; new GuiRadioCtrl(RadioTexture) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "66 216"; extent = "55 19"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "displayMode(False);"; helpTag = "0"; text = "Texture"; groupNum = "1"; }; }; }; //--- OBJECT WRITE END --- function DetailSetDialog() { showTabs(); $currentTab = ""; $currentSelected = ""; DetailMenu.clear(); DetailMenu.add("Sky",0); DetailMenu.add("Texture",1); DetailMenu.add("Terrain",2); DetailMenu.add("Lighting",3); DetailMenu.add("Decal",4); DetailMenu.add("Shape",5); DetailMenu.add("Damage",6); DetailMenu.setText("Detail Options"); RadioTexture.setValue(true); Canvas.pushDialog(DetailSetDlg,99); } function DetailMenu::onSelect(%this, %row) { %label = %this.getValue(); $currentTab = %label; %this.setText("Detail Options"); DetailSetDgl::onCleanup(); showTabs(%label); } function showTabs(%tab) { %tab = %tab @ "_Tab"; GameCtrl.setvisible(false); Sky_Tab.setvisible(false); Texture_Tab.setvisible(false); Terrain_Tab.setvisible(false); Shape_Tab.setvisible(false); Damage_Tab.setvisible(false); Decal_Tab.setvisible(false); Lighting_Tab.setvisible(false); %tab.setvisible(true); } function displayMode(%bool) { echo("CurrentTab: ",$currentTab); echo("CurrentSelected: ",$currentSelected); echo("BOOL: ",%bool); if($currentTab $= "Sky") { if($currentSelected $= "Sky") { echo("went in here: ",%bool); $pref::SkyOutline = %bool; } else { $pref::CloudOutline = %bool; } } else if ($currentTab $= "Terrain") DetailScreenError.setValue($screenerror); } function DetailSetDgl::onCleanup(%close) { $pref::SkyOutline = false; $pref::CloudOutline = false; $pref::CloudsOn = true; RadioTexture.setValue(true); if(%close == true) Canvas.popDialog(DetailSetDlg); } function Sky::detailSliders(%slider) { if(%slider $= "Sky_Slider") { $pref::sphereDetail = %slider.getValue(); $pref::CloudsOn = false; $currentSelected = "Sky"; if($pref::SkyOutline) RadioOutline.setValue(true); else RadioTexture.setValue(true); } else if(%slider $= "Cloud_Slider") { $pref::NumCloudLayers = %slider.getValue(); $pref::CloudsOn = true; $currentSelected = "Cloud"; if($pref::CloudOutline) RadioOutline.setValue(true); else RadioTexture.setValue(true); } }PK !(  gui/DriverInfoDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(DriverInfoDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "DRIVER INFO"; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "27 35"; extent = "346 209"; minExtent = "24 52"; childMargin = "4 2"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "322 201"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(DriverInfoText) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "313 420"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; }; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "136 245"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(DriverInfoDlg);"; accelerator = "space"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(n::gui/EULADlg.gui//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE END --- PK !(gui/EditChatCommandDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EditChatCommandDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "150 110"; extent = "340 260"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "EDIT ITEM"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "21 42"; extent = "80 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Key:"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "97 34"; extent = "49 38"; minExtent = "32 38"; visible = "1"; variable = "$ECI::key"; helpTag = "0"; historySize = "0"; maxLength = "1"; password = "0"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "21 80"; extent = "80 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Menu text:"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "97 72"; extent = "208 38"; minExtent = "32 38"; visible = "1"; variable = "$ECI::text"; helpTag = "0"; historySize = "0"; maxLength = "25"; password = "0"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "21 119"; extent = "80 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Command:"; }; new ShellPopupMenu(EditChatCommandList) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "97 110"; extent = "209 36"; minExtent = "49 36"; visible = "1"; helpTag = "0"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "21 158"; extent = "80 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Message:"; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "106 159"; extent = "191 36"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(EditChatCommandMessage) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 1"; extent = "187 16"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; }; }; new ShellBitmapButton(ChatCommandTestBtn) { profile = "SoundTestButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "80 175"; extent = "24 24"; minExtent = "24 24"; visible = "1"; command = "testChatCommand($ECI::command);"; helpTag = "0"; simpleStyle = "1"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "180 205"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "eval($ECI::OKCommand);"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "32 205"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog( EditChatCommandDlg );"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(. gui/EditChatMenuDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EditChatMenuDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "150 156"; extent = "340 167"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "EDIT MENU"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "21 42"; extent = "80 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Key:"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "97 34"; extent = "50 38"; minExtent = "32 38"; visible = "1"; variable = "$ECI::key"; helpTag = "0"; historySize = "0"; maxLength = "1"; password = "0"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "21 80"; extent = "80 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Menu text:"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "97 72"; extent = "208 38"; minExtent = "32 38"; visible = "1"; variable = "$ECI::text"; helpTag = "0"; historySize = "0"; maxLength = "25"; password = "0"; glowOffset = "9 9"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "180 112"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "eval($ECI::OKCommand);"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "32 112"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog( EditChatMenuDlg );"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(Cgui/EditChatMenuGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EditChatMenuGui) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "20 55"; extent = "600 370"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "EDIT CHAT MENU"; noTitleBar = "0"; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "25 32"; extent = "408 315"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 0"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "384 307"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiChatMenuTreeCtrl(chatMenuGuiTree) { profile = "ShellTreeViewProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "431 372"; minExtent = "8 8"; visible = "1"; altCommand = "editSelectedChatMenuItem();"; helpTag = "0"; tabSize = "16"; imagesBitmap = "gui/shll_treeView.png"; numImages = "13"; textOffset = "2"; fullRowSelect = "0"; itemHeight = "15"; altFontColor = "6 215 245 255"; altFontColorHL = "6 215 245 255"; altFontColorSE = "25 56 68 255"; dirty = "0"; }; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "445 29"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "newChatMenu();"; helpTag = "0"; text = "CLEAR"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "445 67"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "resetChatMenu();"; helpTag = "0"; text = "RESET"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "445 105"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "saveChatMenu();"; helpTag = "0"; text = "SAVE"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "445 315"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "leaveChatMenuEditor();"; helpTag = "0"; text = "DONE"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- //--- OBJECT WRITE BEGIN --- new GuiControl(ChatMenuItemActionDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new ShellPopupMenu(ChatMenuItemActionPopup) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "0 0"; minExtent = "0 0"; visible = "1"; command = "ChatMenuItemActionPopup.reset();"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; maxPopupHeight = "200"; noButtonStyle = "1"; }; }; //--- OBJECT WRITE END --- PK !(XXgui/EditorGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EditorGui) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; currentEditor = "World Editor Inspector"; saveAs = "0"; new EditManager() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "64 64"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; new WorldEditor(EWorldEditor) { profile = "MissionEditorProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 22"; extent = "640 458"; minExtent = "8 8"; visible = "0"; helpTag = "0"; renderMissionArea = "1"; missionAreaFillColor = "255 0 0 20"; missionAreaFrameColor = "255 0 0 128"; consoleFrameColor = "255 0 0 255"; consoleFillColor = "0 0 0 0"; consoleSphereLevel = "1"; consoleCircleSegments = "32"; consoleLineWidth = "1"; isDirty = "0"; planarMovement = "1"; undoLimit = "40"; dropType = "screenCenter"; projectDistance = "2000"; boundingBoxCollision = "1"; renderPlane = "1"; renderPlaneHashes = "1"; gridColor = "255 255 255 20"; planeDim = "500"; gridSize = "10 10 10"; renderPopupBackground = "1"; popupBackgroundColor = "100 100 100 255"; popupTextColor = "255 255 0 255"; objectTextColor = "255 255 255 255"; objectsUseBoxCenter = "1"; axisGizmoMaxScreenLen = "200"; axisGizmoActive = "1"; mouseMoveScale = "0.2"; mouseRotateScale = "0.01"; mouseScaleScale = "0.01"; minScaleFactor = "0.1"; maxScaleFactor = "4000"; objSelectColor = "255 0 0 255"; objMouseOverSelectColor = "0 0 255 255"; objMouseOverColor = "0 255 0 255"; showMousePopupInfo = "1"; dragRectColor = "255 255 0 255"; renderObjText = "1"; renderObjHandle = "1"; objTextFormat = "$id$: $name$"; faceSelectColor = "0 0 100 100"; renderSelectionBox = "1"; selectionBoxColor = "255 255 0 255"; selectionLocked = "0"; snapToGrid = "0"; snapRotations = "0"; rotationSnap = "15"; toggleIgnoreList = "0"; renderNav = "0"; selectHandle = "gui/Editor_SelectHandle.png"; defaultHandle = "gui/Editor_DefaultHandle.png"; lockedHandle = "gui/Editor_LockedHandle.png"; numEditModes = "3"; editMode2 = "scale"; editMode0 = "move"; editMode1 = "rotate"; new GuiControl(EWMissionArea) { profile = "EditorScrollProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "380 0"; extent = "260 280"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiControl(AE_MainBar) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "260 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "60 18"; minExtent = "8 8"; visible = "1"; command = "AreaEditor.enableEditing = $ThisControl.getValue();"; helpTag = "0"; text = "Edit Area"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "65 3"; extent = "60 18"; minExtent = "8 8"; visible = "1"; command = "AreaEditor.centerWorld();"; helpTag = "0"; text = "Center"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "126 3"; extent = "60 18"; minExtent = "8 8"; visible = "1"; command = "AreaEditor.enableMirroring = true;AE_MainBar.setVisible(0);AE_MirrorBar.setVisible(1);"; helpTag = "0"; text = "Mirror"; groupNum = "-1"; buttonType = "PushButton"; }; }; new GuiControl(AE_MirrorBar) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "260 22"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 3"; extent = "30 18"; minExtent = "8 8"; visible = "1"; command = "if(AreaEditor.mirrorIndex == 0) AreaEditor.mirrorIndex = 7; else AreaEditor.mirrorIndex--;"; helpTag = "0"; text = "<--"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "39 3"; extent = "30 18"; minExtent = "8 8"; visible = "1"; command = "if(AreaEditor.mirrorIndex == 7) AreaEditor.mirrorIndex = 0; else AreaEditor.mirrorIndex++;"; helpTag = "0"; text = "-->"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "80 3"; extent = "60 18"; minExtent = "8 8"; visible = "1"; command = "AreaEditor.enableMirroring = false;ETerrainEditor.mirrorTerrain(AreaEditor.mirrorIndex);AreaEditor.updateTerrain();AE_MirrorBar.setVisible(0);AE_MainBar.setVisible(1);"; helpTag = "0"; text = "Apply"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "143 3"; extent = "60 18"; minExtent = "8 8"; visible = "1"; command = "AreaEditor.enableMirroring = false;AE_MirrorBar.setVisible(0);AE_MainBar.setVisible(1);"; helpTag = "0"; text = "Cancel"; groupNum = "-1"; buttonType = "PushButton"; }; }; new MissionAreaEditor(AreaEditor) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 22"; extent = "256 256"; minExtent = "8 8"; visible = "1"; helpTag = "0"; wrap = "0"; squareBitmap = "1"; enableEditing = "0"; renderCamera = "1"; handleFrameColor = "255 255 255 255"; handleFillColor = "0 0 0 255"; defaultObjectColor = "0 255 0 100"; waterObjectColor = "0 0 255 100"; missionBoundsColor = "255 0 0 255"; cameraColor = "255 0 0 255"; enableMirroring = "0"; mirrorIndex = "0"; mirrorLineColor = "255 0 255 255"; mirrorArrowColor = "255 0 255 128"; }; new GuiTextCtrl(AreaEditingText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "top"; position = "7 258"; extent = "151 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; }; }; new GuiFrameSetCtrl(EWFrame) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "height"; position = "370 0"; extent = "270 458"; minExtent = "8 8"; visible = "0"; helpTag = "0"; columns = "0"; rows = "0 321"; borderWidth = "4"; borderColor = "206 206 206 206"; borderEnable = "dynamic"; borderMovable = "dynamic"; autoBalance = "0"; fudgeFactor = "0"; new GuiControl(EWTreePane) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "270 317"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiScrollCtrl() { profile = "EditorScrollProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "270 317"; minExtent = "8 8"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; childMargin = "0 0"; new GuiTreeView(EditorTree) { profile = "GuiTreeViewProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "2 2"; extent = "640 11"; minExtent = "8 8"; visible = "1"; helpTag = "0"; allowMultipleSelections = "1"; recurseSets = "1"; }; }; }; new GuiControl(EWCreatorInspectorPane) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 321"; extent = "270 137"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiScrollCtrl(EWCreatorPane) { profile = "EditorScrollProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "270 137"; minExtent = "8 8"; visible = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "dynamic"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; childMargin = "0 0"; new CreatorTree(Creator) { profile = "GuiTreeViewProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "93 44"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; }; new GuiControl(EWInspectorPane) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "270 137"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiControl() { profile = "EditorScrollProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "270 24"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "40 20"; minExtent = "8 8"; visible = "1"; command = "EWorldEditor.isDirty = true;inspector.apply(InspectorNameEdit.getValue());"; helpTag = "0"; text = "Apply"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiTextEditCtrl(InspectorNameEdit) { profile = "GuiTextEditProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "44 2"; extent = "160 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; }; new GuiScrollCtrl() { profile = "EditorScrollProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 24"; extent = "270 113"; minExtent = "8 8"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "dynamic"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; childMargin = "0 0"; new GuiInspector(Inspector) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "2 2"; extent = "248 74"; minExtent = "8 8"; visible = "1"; helpTag = "0"; editControlOffset = "5"; entryHeight = "16"; textExtent = "80"; entrySpacing = "2"; maxMenuExtent = "80"; }; }; }; }; }; }; new TerrainEditor(ETerrainEditor) { profile = "MissionEditorProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 22"; extent = "640 458"; minExtent = "8 8"; visible = "1"; helpTag = "0"; renderMissionArea = "1"; missionAreaFillColor = "255 0 0 20"; missionAreaFrameColor = "255 0 0 128"; consoleFrameColor = "255 0 0 255"; consoleFillColor = "0 0 0 0"; consoleSphereLevel = "1"; consoleCircleSegments = "32"; consoleLineWidth = "1"; isDirty = "1"; renderBorder = "1"; borderHeight = "10"; borderFillColor = "0 255 0 20"; borderFrameColor = "0 255 0 128"; borderLineMode = "0"; selectionHidden = "1"; enableSoftBrushes = "1"; renderVertexSelection = "1"; processUsesBrush = "0"; adjustHeightVal = "10"; setHeightVal = "100"; scaleVal = "1"; smoothFactor = "0.1"; materialGroup = "0"; softSelectRadius = "50"; softSelectFilter = "1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000"; softSelectDefaultFilter = "1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000"; adjustHeightMouseScale = "0.1"; currentMode = "paint"; softSelecting = "1"; brushSize = "9"; currentAction = "brushAdjustHeight"; new GuiControl(EHeightField) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 458"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiControl(HeightfieldTabParent) { profile = "EditorScrollProfile"; horizSizing = "left"; vertSizing = "height"; position = "370 0"; extent = "270 458"; minExtent = "8 8"; visible = "1"; helpTag = "0"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOff"; constantThumbHeight = "1"; willFirstRespond = "1"; new GuiControl(tab_fBm) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "100 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "fBm Fractal Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 35"; extent = "71 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Hill Frequency:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(fbm_interval) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "1 24"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "99 60"; extent = "58 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Roughness:"; maxLength = "255"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 136"; extent = "77 20"; minExtent = "8 8"; visible = "1"; command = "fBm_seed.setValue(terraFormer.generateSeed());Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; text = "New Seed"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "87 110"; extent = "70 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Random Seed:"; maxLength = "255"; }; new GuiTextEditCtrl(fBm_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 110"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "0"; maxLength = "255"; historySize = "5"; password = "0"; tabComplete = "0"; }; new GuiTextEditSliderCtrl(fbm_rough) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 60"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "128 85"; extent = "29 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Detail:"; maxLength = "255"; }; new GuiPopUpMenuCtrl(fbm_detail) { profile = "GuiPopUpMenuProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 85"; extent = "78 18"; minExtent = "8 8"; visible = "1"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; maxLength = "255"; maxPopupHeight = "200"; }; }; new GuiControl(tab_RMF) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "125 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Rigid MultiFractal Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "87 35"; extent = "71 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Hill Frequency:"; maxLength = "255"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 137"; extent = "73 20"; minExtent = "8 8"; visible = "1"; command = "rmf_seed.setValue(terraFormer.generateSeed());Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; text = "New Seed"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "101 60"; extent = "58 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Roughness:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(rmf_interval) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "1 16"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "90 111"; extent = "67 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Random Seed"; maxLength = "255"; }; new GuiTextEditCtrl(rmf_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 110"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "0"; maxLength = "255"; historySize = "5"; password = "0"; tabComplete = "0"; }; new GuiTextEditSliderCtrl(rmf_rough) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 60"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "128 85"; extent = "29 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Detail:"; maxLength = "255"; }; new GuiPopUpMenuCtrl(rmf_detail) { profile = "GuiPopUpMenuProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 85"; extent = "78 18"; minExtent = "8 8"; visible = "1"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; maxLength = "255"; maxPopupHeight = "200"; }; }; new GuiControl(tab_Canyon) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "118 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Canyon Fractal Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "124 61"; extent = "34 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Chaos:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(canyon_freq) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "4 10"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "63 35"; extent = "95 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Canyon Frequency:"; maxLength = "255"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 114"; extent = "73 20"; minExtent = "8 8"; visible = "1"; command = "canyon_seed.setValue(terraFormer.generateSeed());Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; text = "New Seed"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "88 89"; extent = "70 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Random Seed:"; maxLength = "255"; }; new GuiTextEditCtrl(canyon_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 89"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "0"; maxLength = "255"; historySize = "5"; password = "0"; tabComplete = "0"; }; new GuiTextEditSliderCtrl(canyon_factor) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 62"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; }; new GuiControl(tab_Smooth) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "95 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Smoothing Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 64"; extent = "77 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Agressiveness:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(smooth_iter) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; command = "Heightfield::saveTab($selectedOperation);Heightfield::preview($selectedOperation);"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "0 40"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "109 36"; extent = "47 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Iterations:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(smooth_factor) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 63"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; }; new GuiControl(tab_SmoothWater) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "154 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Water Area Smoothing Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 64"; extent = "77 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Agressiveness:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(watersmooth_iter) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; command = "Heightfield::saveTab($selectedOperation);Heightfield::preview($selectedOperation);"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "0 40"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "109 36"; extent = "47 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Iterations:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(watersmooth_factor) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 63"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; }; new GuiControl(tab_SmoothRidge) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "152 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Ridge Area Smoothing Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 64"; extent = "77 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Agressiveness:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(Ridgesmooth_iter) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; command = "Heightfield::saveTab($selectedOperation);Heightfield::preview($selectedOperation);"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "0 40"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "109 36"; extent = "47 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Iterations:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(Ridgesmooth_factor) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 63"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; }; new GuiControl(tab_Filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "101 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Height Filter Settings:"; maxLength = "255"; }; new GuiFilterCtrl(filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 29"; extent = "130 130"; minExtent = "8 8"; visible = "1"; command = "Heightfield::saveTab($selectedOperation);Heightfield::preview($selectedOperation);"; helpTag = "0"; controlPoints = "7"; filter = "0.000000 0.130770 0.161540 0.223080 0.369230 0.507690 1.000000"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "154 84"; extent = "30 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Result"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "68 167"; extent = "23 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Input"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 160"; extent = "16 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "min"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "127 160"; extent = "20 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "max"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "150 142"; extent = "16 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "min"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "150 28"; extent = "20 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "max"; maxLength = "255"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "189 139"; extent = "61 18"; minExtent = "8 8"; visible = "1"; variable = "filter.controlPoints"; command = "filter.controlPoints = $ThisControl.getValue();Heightfield::saveTab($selectedOperation);Heightfield::preview($selectedOperation);"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "187 118"; extent = "66 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Control Points"; maxLength = "255"; }; }; new GuiControl(tab_Turbulence) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "99 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Turbulence Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "65 34"; extent = "91 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Turbulence Factor:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(turbulence_factor) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "75 61"; extent = "81 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Radius of Effect:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(turbulence_radius) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 61"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "1 40"; increment = "1"; }; }; new GuiControl(tab_Thermal) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "122 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Thermal Erosion Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "112 36"; extent = "47 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Iterations:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 91"; extent = "80 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Material Loss %:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 63"; extent = "139 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Min Erosion Slope (degrees):"; maxLength = "255"; }; new GuiTextEditSliderCtrl(thermal_iter) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 36"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "0 50"; increment = "1"; }; new GuiTextEditSliderCtrl(thermal_slope) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 63"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%2.1f"; range = "0 89"; increment = "0.1"; }; new GuiTextEditSliderCtrl(thermal_cons) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 90"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%2.1f"; range = "0 100"; increment = "0.1"; }; }; new GuiControl(tab_Hydraulic) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "259 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "129 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Hydraulic Erosion Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "112 34"; extent = "47 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Iterations:"; maxLength = "255"; }; new GuiFilterCtrl(hydraulic_filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 57"; extent = "130 130"; minExtent = "8 8"; visible = "1"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; controlPoints = "7"; filter = "0.000000 0.166667 0.333333 0.500000 0.666667 0.833333 1.000000"; }; new GuiTextEditSliderCtrl(hydraulic_iter) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "0 50"; increment = "1"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 161"; extent = "64 18"; minExtent = "8 8"; visible = "1"; variable = "hydraulic_filter.controlPoints"; command = "hydraulic_filter.controlPoints = $ThisControl.getValue();Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 141"; extent = "69 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Control Points:"; maxLength = "255"; }; }; new GuiControl(tab_Sinus) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "259 199"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "72 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Sinus Settings:"; maxLength = "255"; }; new GuiFilterCtrl(sinus_filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "36 64"; extent = "130 130"; minExtent = "8 8"; visible = "1"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; controlPoints = "7"; filter = "0.176920 0.833330 0.876920 0.238460 0.215380 0.166660 0.000000"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 32"; extent = "70 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Random Seed:"; maxLength = "255"; }; new GuiTextEditCtrl(sinus_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "174 32"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "0"; maxLength = "255"; historySize = "5"; password = "0"; tabComplete = "0"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "177 66"; extent = "73 20"; minExtent = "8 8"; visible = "1"; command = "sinus_seed.setValue(terraFormer.generateSeed());Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; text = "New Seed"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "178 171"; extent = "64 18"; minExtent = "8 8"; visible = "1"; variable = "sinus_filter.controlPoints"; command = "sinus_filter.controlPoints = $ThisControl.getValue();Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "179 150"; extent = "69 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Control Points:"; maxLength = "255"; }; }; new GuiControl(tab_terrainFile) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 2"; extent = "53 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "TerrainFile:"; maxLength = "255"; }; new GuiScrollCtrl() { profile = "GuiScrollProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 20"; extent = "262 180"; minExtent = "8 8"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "dynamic"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; childMargin = "0 0"; new GuiTextListCtrl(terrainFile_textList) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "240 8"; minExtent = "8 8"; visible = "1"; command = "terrainFile_terrFileText.setValue(\"terrains/\" @ terrainFile_textList.getRowTextById(terrainFile_textList.getSelectedId()));Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColumnText = "0"; }; }; new GuiTextCtrl(terrainFile_terrFileText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 2"; extent = "8 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; }; }; new GuiControl(tab_General) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "83 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "General Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 53"; extent = "67 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Height Range:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(general_scale) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "108 52"; extent = "64 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "5 500"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "177 53"; extent = "33 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "meters"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "29 93"; extent = "74 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Water Level %:"; maxLength = "255"; }; new GuiSliderCtrl(general_water) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 113"; extent = "200 30"; minExtent = "8 8"; visible = "1"; variable = "value"; command = "general_water_meters.setValue(general_water.getValue()*general_scale.getValue()+general_min_height.getValue() @ \" meters\");Heightfield::saveTab();Heightfield::preview();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "5"; value = "0"; }; new GuiTextCtrl(general_water_meters) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "109 93"; extent = "42 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "0 meters"; maxLength = "255"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 158"; extent = "135 20"; minExtent = "8 8"; visible = "1"; command = "Heightfield::center();"; helpTag = "0"; text = "Center on Camera"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiTextCtrl(general_centerx) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "8 18"; minExtent = "8 8"; visible = "0"; helpTag = "0"; text = "0"; maxLength = "255"; }; new GuiTextCtrl(general_centery) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "8 18"; minExtent = "8 8"; visible = "0"; helpTag = "0"; text = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 28"; extent = "89 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Min Terrain Height:"; maxLength = "255"; }; new GuiTextEditSliderCtrl(general_min_height) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "108 27"; extent = "64 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "0 500"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "177 28"; extent = "33 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "meters"; maxLength = "255"; }; }; new GuiControl(tab_Bitmap) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "76 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Bitmap settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 43"; extent = "45 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Filename:"; maxLength = "255"; }; new GuiTextCtrl(bitmap_name) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 43"; extent = "8 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; }; new GuiButtonCtrl(bitmap_choose) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 65"; extent = "73 20"; minExtent = "8 8"; visible = "1"; command = "Heightfield::setBitmap();"; helpTag = "0"; text = "Choose..."; groupNum = "-1"; buttonType = "PushButton"; }; }; new GuiControl(tab_Blend) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiPopUpMenuCtrl(blend_option) { profile = "GuiPopUpMenuProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 118"; extent = "82 20"; minExtent = "8 8"; visible = "1"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; text = "Add"; maxLength = "255"; maxPopupHeight = "200"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "71 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Blend settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 31"; extent = "34 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Factor:"; maxLength = "255"; }; new GuiSliderCtrl(blend_factor) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "49 29"; extent = "200 30"; minExtent = "8 8"; visible = "1"; variable = "value"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "5"; value = "0.584211"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 64"; extent = "49 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Source A:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "23 156"; extent = "205 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "result = (A*factor) operation (B*(1-factor))"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 91"; extent = "48 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Source B:"; maxLength = "255"; }; new GuiTextEditCtrl(blend_srcB) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 89"; extent = "33 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "1"; maxLength = "255"; historySize = "5"; password = "0"; tabComplete = "0"; }; new GuiTextCtrl(blend_srcA) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 65"; extent = "92 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Previous Operation"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 118"; extent = "50 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Operation:"; maxLength = "255"; }; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "height"; position = "0 250"; extent = "275 210"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiPopUpMenuCtrl(Heightfield_options) { profile = "GuiPopUpMenuProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "199 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Options"; maxLength = "255"; maxPopupHeight = "200"; setText = "false"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "205 3"; extent = "53 20"; minExtent = "8 8"; visible = "1"; command = "Heightfield::onDelete();"; helpTag = "0"; text = "Delete"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiScrollCtrl() { profile = "EditorScrollProfile"; horizSizing = "width"; vertSizing = "height"; position = "5 27"; extent = "261 176"; minExtent = "8 8"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "1"; childMargin = "0 0"; new GuiTextListCtrl(Heightfield_operation) { profile = "GuiTextListProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "257 16"; minExtent = "8 8"; visible = "1"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "1"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "98 229"; extent = "80 20"; minExtent = "8 8"; visible = "1"; command = "Heightfield::apply();"; helpTag = "0"; text = "Apply"; groupNum = "-1"; buttonType = "PushButton"; }; }; new GuiTerrPreviewCtrl(HeightfieldPreview) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "top"; position = "4 198"; extent = "256 256"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; }; new GuiControl(ETexture) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 458"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTerrPreviewCtrl(TexturePreview) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "top"; position = "4 198"; extent = "256 256"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; new GuiControl(TextureTabParent) { profile = "EditorScrollProfile"; horizSizing = "left"; vertSizing = "height"; position = "370 0"; extent = "270 458"; minExtent = "8 8"; visible = "1"; helpTag = "0"; childMargin = "0 0"; constantThumbHeight = "1"; willFirstRespond = "1"; new GuiControl(tab_DistortMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 1"; extent = "261 202"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "126 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Fractal Distortion Settings:"; maxLength = "255"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 97"; extent = "77 20"; minExtent = "8 8"; visible = "1"; command = "dmask_seed.setValue(terraFormer.generateSeed());Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "New Seed"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiTextEditCtrl(dmask_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 71"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "0"; maxLength = "255"; historySize = "5"; password = "0"; tabComplete = "0"; }; new GuiTextEditSliderCtrl(dmask_rough) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 47"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; new GuiTextEditSliderCtrl(dmask_interval) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 23"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "3 36"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "90 23"; extent = "71 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Hill Frequency:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "103 47"; extent = "58 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Roughness:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "91 71"; extent = "70 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Random Seed:"; maxLength = "255"; }; new GuiFilterCtrl(dmask_filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 96"; extent = "143 93"; minExtent = "8 8"; visible = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; controlPoints = "7"; filter = "0.000000 0.166667 0.333333 0.500000 0.666667 0.833333 1.000000"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "173 165"; extent = "64 18"; minExtent = "8 8"; visible = "1"; variable = "dmask_filter.controlPoints"; command = "dmask_filter.controlPoints = $ThisControl.getValue();Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "173 147"; extent = "69 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Control Points:"; maxLength = "255"; }; }; new GuiControl(tab_FractalMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 0"; extent = "261 202"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "106 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Fractal Mask Settings:"; maxLength = "255"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 96"; extent = "77 20"; minExtent = "8 8"; visible = "1"; command = "fBmmask_seed.setValue(terraFormer.generateSeed());Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "New Seed"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiTextEditCtrl(fBmmask_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 70"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "0"; maxLength = "255"; historySize = "5"; password = "0"; tabComplete = "0"; }; new GuiTextEditSliderCtrl(fbmmask_rough) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 46"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; new GuiTextEditSliderCtrl(fbmmask_interval) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 22"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%1.0f"; range = "3 36"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "92 22"; extent = "71 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Hill Frequency:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "105 46"; extent = "58 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Roughness:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "93 70"; extent = "70 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Random Seed:"; maxLength = "255"; }; new GuiFilterCtrl(fBmmask_filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 94"; extent = "147 98"; minExtent = "8 8"; visible = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; controlPoints = "7"; filter = "0.000000 0.166670 0.333330 0.500000 0.666670 0.833330 1.000000"; }; new GuiCheckBoxCtrl(fBmDistort) { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 122"; extent = "82 20"; minExtent = "8 8"; visible = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "Use Distortion"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 174"; extent = "64 18"; minExtent = "8 8"; visible = "1"; variable = "fBmmask_filter.controlPoints"; command = "fBmmask_filter.controlPoints = $ThisControl.getValue();Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 155"; extent = "69 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Control Points:"; maxLength = "255"; }; }; new GuiControl(tab_HeightMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 0"; extent = "261 200"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "103 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Height Mask Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 26"; extent = "26 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Filter:"; maxLength = "255"; }; new GuiFilterCtrl(TextureHeightFilter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 26"; extent = "130 130"; minExtent = "8 8"; visible = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; controlPoints = "6"; filter = "0.000000 0.200000 0.400000 0.600000 0.800000 1.000000"; }; new GuiCheckBoxCtrl(heightDistort) { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "45 165"; extent = "129 20"; minExtent = "8 8"; visible = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "Use Fractal Distortion"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "185 134"; extent = "64 18"; minExtent = "8 8"; visible = "1"; variable = "TextureHeightFilter.controlPoints"; command = "TextureHeightFilter.controlPoints = $ThisControl.getValue();Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "185 115"; extent = "69 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Control Points:"; maxLength = "255"; }; }; new GuiControl(tab_SlopeMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 0"; extent = "261 200"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "100 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Slope Mask Settings:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 26"; extent = "26 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Filter:"; maxLength = "255"; }; new GuiFilterCtrl(TextureSlopeFilter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "45 27"; extent = "130 130"; minExtent = "8 8"; visible = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; controlPoints = "7"; filter = "0.000000 0.166667 0.333333 0.500000 0.666667 0.833333 1.000000"; }; new GuiCheckBoxCtrl(slopeDistort) { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "44 166"; extent = "129 20"; minExtent = "8 8"; visible = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "Use Fractal Distortion"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "185 134"; extent = "64 18"; minExtent = "8 8"; visible = "1"; variable = "TextureSlopeFilter.controlPoints"; command = "TextureSlopeFilter.controlPoints = $ThisControl.getValue();Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "185 115"; extent = "69 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Control Points:"; maxLength = "255"; }; }; new GuiControl(tab_WaterMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 0"; extent = "261 200"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "131 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Water Level Mask Settings:"; maxLength = "255"; }; new GuiCheckBoxCtrl(waterDistort) { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "63 165"; extent = "129 20"; minExtent = "8 8"; visible = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "Use Fractal Distortion"; groupNum = "-1"; buttonType = "ToggleButton"; }; }; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "371 249"; extent = "267 96"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiScrollCtrl() { profile = "EditorScrollProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "4 27"; extent = "261 65"; minExtent = "8 8"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "1"; childMargin = "0 0"; new GuiTextListCtrl(Texture_material) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "257 8"; minExtent = "8 8"; visible = "1"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "1"; fitParentWidth = "1"; clipColumnText = "0"; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "205 3"; extent = "53 20"; minExtent = "8 8"; visible = "1"; command = "Texture::deleteMaterial();"; helpTag = "0"; text = "Delete"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 3"; extent = "78 20"; minExtent = "8 8"; visible = "1"; command = "Texture::addMaterialTexture();"; helpTag = "0"; text = "Add Material..."; groupNum = "-1"; buttonType = "PushButton"; }; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "height"; position = "370 349"; extent = "270 112"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiPopUpMenuCtrl(Texture_operation_menu) { profile = "GuiPopUpMenuProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "199 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Options"; maxLength = "255"; maxPopupHeight = "200"; setText = "false"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "205 3"; extent = "53 20"; minExtent = "8 8"; visible = "1"; command = "Texture::deleteOperation();"; helpTag = "0"; text = "Delete"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiScrollCtrl() { profile = "EditorScrollProfile"; horizSizing = "width"; vertSizing = "height"; position = "5 27"; extent = "261 77"; minExtent = "8 8"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "1"; childMargin = "0 0"; new GuiTextListCtrl(Texture_operation) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "257 8"; minExtent = "8 8"; visible = "1"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "1"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "456 219"; extent = "80 20"; minExtent = "8 8"; visible = "1"; command = "Texture::applyMaterials();"; helpTag = "0"; text = "Apply"; groupNum = "-1"; buttonType = "PushButton"; }; }; new GuiTextCtrl(TESelectionInfo) { profile = "EditorTextProfile"; horizSizing = "right"; vertSizing = "top"; position = "254 430"; extent = "159 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; }; new GuiTextCtrl(TEMouseBrushInfo) { profile = "EditorTextProfile"; horizSizing = "right"; vertSizing = "top"; position = "6 430"; extent = "182 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; }; new GuiTextCtrl(TESelectionInfo1) { profile = "EditorTextProfileWhite"; horizSizing = "right"; vertSizing = "top"; position = "255 431"; extent = "159 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; }; new GuiTextCtrl(TEMouseBrushInfo1) { profile = "EditorTextProfileWhite"; horizSizing = "right"; vertSizing = "top"; position = "7 431"; extent = "182 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; maxLength = "255"; }; new GuiControl(EPainter) { profile = "EditorScrollProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "409 0"; extent = "231 446"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiBitmapCtrl(ETerrainMaterialBitmap0) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 24"; extent = "96 96"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = "fps/data/terrains/grassland/grass"; wrap = "1"; }; new GuiTextCtrl(ETerrainMaterialText0) { profile = "PainterTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 5"; extent = "28 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "grass"; maxLength = "255"; }; new GuiButtonCtrl(ETerrainMaterialChange0) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 125"; extent = "96 22"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.changeMaterial(0);"; helpTag = "0"; text = "Change..."; groupNum = "-1"; buttonType = "PushButton"; }; new GuiBorderButtonCtrl(ETerrainMaterialPaint0) { profile = "GuiBorderButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 6"; extent = "106 118"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.setPaintMaterial(0);"; helpTag = "0"; text = "Button"; groupNum = "-1"; buttonType = "RadioButton"; }; new GuiBitmapCtrl(ETerrainMaterialBitmap1) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 170"; extent = "96 96"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = "fps/data/terrains/grassland/grass"; wrap = "1"; }; new GuiTextCtrl(ETerrainMaterialText1) { profile = "PainterTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 151"; extent = "28 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "grass"; maxLength = "255"; }; new GuiButtonCtrl(ETerrainMaterialChange1) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 271"; extent = "96 22"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.changeMaterial(1);"; helpTag = "0"; text = "Change..."; groupNum = "-1"; buttonType = "PushButton"; }; new GuiBorderButtonCtrl(ETerrainMaterialPaint1) { profile = "GuiBorderButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 152"; extent = "106 118"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.setPaintMaterial(1);"; helpTag = "0"; text = "Button"; groupNum = "-1"; buttonType = "RadioButton"; }; new GuiBitmapCtrl(ETerrainMaterialBitmap2) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 312"; extent = "96 96"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = "fps/data/terrains/grassland/grass"; wrap = "1"; }; new GuiTextCtrl(ETerrainMaterialText2) { profile = "PainterTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 293"; extent = "28 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "grass"; maxLength = "255"; }; new GuiButtonCtrl(ETerrainMaterialChange2) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 413"; extent = "96 22"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.changeMaterial(2);"; helpTag = "0"; text = "Change..."; groupNum = "-1"; buttonType = "PushButton"; }; new GuiBorderButtonCtrl(ETerrainMaterialPaint2) { profile = "GuiBorderButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 294"; extent = "106 118"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.setPaintMaterial(2);"; helpTag = "0"; text = "Button"; groupNum = "-1"; buttonType = "RadioButton"; }; new GuiBitmapCtrl(ETerrainMaterialBitmap3) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "122 24"; extent = "96 96"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = "fps/data/terrains/grassland/grass"; wrap = "1"; }; new GuiTextCtrl(ETerrainMaterialText3) { profile = "PainterTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "123 5"; extent = "28 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "grass"; maxLength = "255"; }; new GuiButtonCtrl(ETerrainMaterialChange3) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "122 125"; extent = "96 22"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.changeMaterial(3);"; helpTag = "0"; text = "Change..."; groupNum = "-1"; buttonType = "PushButton"; }; new GuiBorderButtonCtrl(ETerrainMaterialPaint3) { profile = "GuiBorderButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "117 6"; extent = "106 118"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.setPaintMaterial(3);"; helpTag = "0"; text = "Button"; groupNum = "-1"; buttonType = "RadioButton"; }; new GuiBitmapCtrl(ETerrainMaterialBitmap4) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "122 170"; extent = "96 96"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = "fps/data/terrains/grassland/grass"; wrap = "1"; }; new GuiTextCtrl(ETerrainMaterialText4) { profile = "PainterTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "123 151"; extent = "28 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "grass"; maxLength = "255"; }; new GuiButtonCtrl(ETerrainMaterialChange4) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "122 271"; extent = "96 22"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.changeMaterial(4);"; helpTag = "0"; text = "Change..."; groupNum = "-1"; buttonType = "PushButton"; }; new GuiBorderButtonCtrl(ETerrainMaterialPaint4) { profile = "GuiBorderButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "117 152"; extent = "106 118"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.setPaintMaterial(4);"; helpTag = "0"; text = "Button"; groupNum = "-1"; buttonType = "RadioButton"; }; new GuiBitmapCtrl(ETerrainMaterialBitmap5) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "122 311"; extent = "96 96"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = "fps/data/terrains/grassland/grass"; wrap = "1"; }; new GuiTextCtrl(ETerrainMaterialText5) { profile = "PainterTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "123 292"; extent = "28 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "grass"; maxLength = "255"; }; new GuiButtonCtrl(ETerrainMaterialChange5) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "122 412"; extent = "96 22"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.changeMaterial(5);"; helpTag = "0"; text = "Change..."; groupNum = "-1"; buttonType = "PushButton"; }; new GuiBorderButtonCtrl(ETerrainMaterialPaint5) { profile = "GuiBorderButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "117 293"; extent = "106 118"; minExtent = "8 8"; visible = "1"; command = "ETerrainEditor.setPaintMaterial(5);"; helpTag = "0"; text = "Button"; groupNum = "-1"; buttonType = "RadioButton"; }; }; }; new GuiMenuBar(EditorMenuBar) { profile = "GuiMenuBarProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "640 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; }; //--- OBJECT WRITE END --- PK !(U-+o#o#gui/EditorSaveMissionDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EditorSaveMissionDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 81"; extent = "333 313"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Save Mission..."; resizeWidth = "1"; resizeHeight = "1"; canMove = "1"; canClose = "1"; canMinimize = "1"; canMaximize = "1"; minSize = "50 50"; new GuiControl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 50"; extent = "317 226"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiMediumBoldTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "249 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Select the files which you wish to save:"; }; new GuiCheckBoxCtrl(SaveMissionCheckBox) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 32"; extent = "132 22"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Mission File"; }; new GuiTextCtrl(SaveMissionText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 56"; extent = "64 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; new GuiTextCtrl(SaveTerrainText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 102"; extent = "56 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; new GuiCheckBoxCtrl(SaveTerrainCheckBox) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 77"; extent = "132 22"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Terrain"; }; new GuiCheckBoxCtrl(SaveHeightFieldScriptCheckBox) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 122"; extent = "132 22"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Heightfield Script"; }; new GuiTextCtrl(SaveHeightFieldScriptText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 148"; extent = "162 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; new GuiTextCtrl(SaveTextureScriptText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 194"; extent = "132 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; new GuiCheckBoxCtrl(SaveTerrainScriptCheckBox) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 167"; extent = "132 22"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Texture Script"; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "158 284"; extent = "72 22"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "EditorSaveMissionDlg.doSave();Canvas.popDialog(EditorSaveMissionDlg);"; helpTag = "0"; text = "OK"; }; new GuiTextEditCtrl(MissionNameTextEdit) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "87 26"; extent = "238 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; altCommand = "EditorSaveMissionDlg.missionName = $ThisControl.getValue();EditorSaveMissionDlg.updateTextFields();"; helpTag = "0"; historySize = "0"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 284"; extent = "72 22"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.popDialog(EditorSaveMissionDlg);"; helpTag = "0"; text = "Cancel"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 28"; extent = "66 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Mission Name"; }; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function EditorSaveMissionDlg::updateTextFields(%this) { SaveMissionText.setValue("missions/" @ %this.missionName @ ".mis"); SaveTerrainText.setValue("terrains/" @ %this.missionName @ ".ter"); SaveTextureScriptText.setValue("terrains/texture/" @ %this.missionName @ "_texture.cs"); SaveHeightFieldScriptText.setValue("terrains/heightfield/" @ %this.missionName @ "_heightfield.cs"); } function EditorSaveMissionDlg::onWake(%this) { %this.missionName = fileBase($MissionName); // MissionNameTextEdit.setValue(%this.missionName); %this.updateTextFields(); // set all to be saved if(%this.initialized != true) { SaveMissionCheckBox.setValue(1); SaveTerrainCheckBox.setValue(1); SaveTerrainScriptCheckBox.setValue(1); SaveHeightFieldScriptCheckBox.setValue(1); %this.initialized = true; } } function EditorSaveMissionDlg::doSave(%this) { // if(!isObject(MissionGroup)) { error("No mission exists to save!"); return; } // check the files for write access //--------------------------------- if(SaveMissionCheckBox.getValue()) { %file = "base/missions/" @ %this.missionName @ ".mis"; if(!isWriteableFileName(%file)) { error("Mission file '" @ %file @ "' is not writeable."); return; } } if(SaveTerrainCheckBox.getValue()) { %file = "base/terrains/" @ %this.missionName @ ".ter"; if(!isWriteableFileName(%file)) { error("Terrain file '" @ %file @ "' is not writeable."); return; } } if(SaveTerrainScriptCheckBox.getValue()) { %file = "base/terrains/texture/" @ %this.missionName @ "_texture.cs"; if(!isWriteableFileName(%file)) { error("Terrain texture script file '" @ %file @ "' is not writeable."); return; } } if(SaveHeightFieldScriptCheckBox.getValue()) { %file = "base/terrains/heightfield/" @ %this.missionName @ "_heightfield.cs"; if(!isWriteableFileName(%file)) { error("Terrain heightfield script file '" @ %file @ "' is not writeable."); return; } } // Now, save out the files... //--------------------------------- if(SaveMissionCheckBox.getValue()) { // rename the terrainFile field in the TerrainBlock obj if(SaveTerrainCheckBox.getValue()) if(isObject(terrain)) terrain.terrainFile = %this.missionName @ ".ter"; // missionGroup.save("missions/" @ %this.missionName @ ".mis"); $MissionName = %this.missionName @ ".mis"; } // requires that the terrain object be named 'terrain' if(SaveTerrainCheckBox.getValue()) if(isObject(terrain)) terrain.save(%this.missionName @ ".ter"); else warn(" Failed to save TerrainObject (no object exists)"); // if(SaveTerrainScriptCheckBox.getValue()) if(Texture_material.rowCount()) Texture::save(%this.missionName @ "_texture.cs"); else warn(" Failed to save Terrain Script file. Nothing to save."); // if(SaveHeightFieldScriptCheckBox.getValue()) if(Heightfield_operation.rowCount()) HeightField::doSaveHeightfield(%this.missionName @ "_heightfield.cs"); else warn(" Failed to save HeightField Script file. Nothing to save."); } PK !(,Sޮgui/EditorToolBarGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EditorToolBarGui) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "80 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Editor.close();"; helpTag = "0"; text = "Back"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "452 2"; extent = "80 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.setContent(TerraformerGui);"; helpTag = "0"; text = "Terraformer"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "370 2"; extent = "80 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Editor.setView(TerrainEditorView);"; helpTag = "0"; text = "Terrain Editor"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "288 2"; extent = "80 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Editor.setView(WorldEditorView);"; helpTag = "0"; text = "World Editor"; }; }; //--- OBJECT WRITE END --- PK !(]` gui/EditorToolCreatorGui.gui//--- OBJECT WRITE BEGIN --- new GuiScrollCtrl(EditorToolCreatorGui) { profile = "GuiScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; vScrollBar = "allwaysOn"; hScrollBar = "dynamic"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; new CreatorTree(Creator) { profile = "GuiTreeViewProfile"; }; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function Creator::init(%this) { %this.clear(); // %this.currentSel = -1; // %this.currentRoot = -1; // %this.currentObj = -1; $InstantGroup = "MissionGroup"; // *** INTERIORS %base = %this.addGroup(0, "Interiors"); %misc = %this.addGroup(%base, "Misc."); // %shapeGroup[0] = "Blood Eagle - Lush"; %shapeGroup[1] = "Diamond Sword - Volcanic"; %shapeGroup[2] = "Star Wolf - Ice"; %shapeGroup[3] = "Children of the Phoenix - Desert"; %shapeGroup[4] = "Bioderm - Badlands"; %groupShort[0] = "b"; %groupShort[1] = "d"; %groupShort[2] = "s"; %groupShort[3] = "p"; %groupShort[4] = "x"; // %shapeType[0] = "Towers"; %shapeType[1] = "Bunkers"; %shapeType[2] = "Base"; %shapeType[3] = "Platform"; %shapeType[4] = "Bridge"; %shapeType[5] = "Wall"; %shapeType[6] = "Unique"; %shapeType[7] = "Power"; %shapeType[8] = "Misc."; %shapeType[9] = "Vehicle"; %shapeType[10] = "Rocks"; %typeShort[0] = "towr"; %typeShort[1] = "bunk"; %typeShort[2] = "base"; %typeShort[3] = "plat"; %typeShort[4] = "brdg"; %typeShort[5] = "wall"; %typeShort[6] = "uniq"; %typeShort[7] = "powr"; %typeShort[8] = "misc"; %typeShort[9] = "vbay"; %typeShort[10] = "rock"; // create the groups %grpCount = 0; for(%i = 0; %shapeGroup[%i] !$= ""; %i++) { %parent = Creator.addGroup(%base, %shapeGroup[%i]); for(%j = 0; %shapeType[%j] !$= ""; %j++) { %group[%grpCount] = %this.addGroup(%parent, %shapeType[%j]); %grpCount++; } } // walk all the interiors and add them to the correct group %file = findFirstFile("interiors/*.dif"); while(%file !$= "") { %file = fileBase(%file); %grpCount = 0; %added = false; for(%i = 0; !%added && %shapeGroup[%i] !$= ""; %i++) { for(%j = 0; %shapeType[%j] !$= ""; %j++) { if(%this.fileNameMatch(%groupShort[%i], %typeShort[%j], %file)) { %this.addItem(%group[%grpCount], %file, "createInterior(" @ "\"" @ %file @ ".dif\"" @ ");"); %added = true; } %grpCount++; } } // throw it in the 'misc' directory if(!%added) %this.addItem(%misc, %file, "createInterior(" @ "\"" @ %file @ ".dif\"" @ ");"); %file = findNextFile("interiors/*.dif"); } // *** SHAPES - add in all the shapes now... %base = %this.addGroup(0, "Shapes"); %dataGroup = "DataBlockGroup"; for(%i = 0; %i < %dataGroup.getCount(); %i++) { %obj = %dataGroup.getObject(%i); if(%obj.catagory !$= "" || %obj.catagory != 0) { %grp = %this.addGroup(%base, %obj.catagory); %this.addItem(%grp, %obj.getName(), %obj.getClassName() @ "::create(" @ %obj.getName() @ ");"); } } // Statics %staticBase = %this.addGroup(0, "Static Objects"); for (%i = 0; %i < $NumStaticTSObjects; %i++) { echo("This: " SPC $StaticTSObjects[%i]); echo(getWord($StaticTSObjects[%i], 2)); %grp = %this.addGroup(%staticBase, getWord($StaticTSObjects[%i], 0)); echo("TSStatic::create(" @ getWord($StaticTSObjects[%i], 2) @");"); %this.addItem(%grp, getWord($StaticTSObjects[%i], 1), "TSStatic::create(\"" @ getWord($StaticTSObjects[%i], 2) @"\");"); } // *** OBJECTS - do the objects now... %objGroup[0] = "Environment"; %objGroup[1] = "Mission"; %objGroup[2] = "System"; %objGroup[3] = "AI"; %Environment_Item[0] = "Sky"; %Environment_Item[1] = "Sun"; %Environment_Item[2] = "Lightning"; %Environment_Item[3] = "Water"; %Environment_Item[4] = "Terrain"; %Environment_Item[5] = "AudioEmitter"; %Environment_Item[6] = "Precipitation"; %Environment_Item[7] = "ParticleEmitter"; %Mission_Item[0] = "MissionArea"; %Mission_Item[1] = "GameType"; %Mission_Item[2] = "Marker"; %Mission_Item[3] = "Forcefield"; %Mission_Item[4] = "Trigger"; %Mission_Item[5] = "PhysicalZone"; %Mission_Item[6] = "Camera"; %System_Item[0] = "SimGroup"; %AI_Item[0] = "Objective"; //%AI_Item[1] = "NavigationGraph"; // objects group %base = %this.addGroup(0, "Objects"); // create 'em for(%i = 0; %objGroup[%i] !$= ""; %i++) { %grp = %this.addGroup(%base, %objGroup[%i]); %groupTag = "%" @ %objGroup[%i] @ "_Item"; %done = false; for(%j = 0; !%done; %j++) { eval("%itemTag = " @ %groupTag @ %j @ ";"); if(%itemTag $= "") %done = true; else %this.addItem(%grp, %itemTag, "ObjectBuilderGui.build" @ %itemTag @ "();"); } } } function createInterior(%name) { %obj = new InteriorInstance() { position = "0 0 0"; rotation = "0 0 0"; interiorFile = %name; }; return(%obj); } function Creator::onAction(%this) { // %this.currentSel = -1; // %this.currentRoot = -1; // %this.currentObj = -1; %sel = %this.getSelected(); if(%sel == -1 || %this.isGroup(%sel) || !$MissionRunning) return; // the value is the callback function.. if(%this.getValue(%sel) $= "") return; %this.currentSel = %sel; %this.currentRoot = %this.getRootGroup(%sel); %this.create(%sel); } function Creator::create(%this, %sel) { // create the obj and add to the instant group %obj = eval(%this.getValue(%sel)); if(%obj == -1 || %obj == 0) return; // %this.currentObj = %obj; $InstantGroup.add(%obj); // drop it from the editor - only SceneObjects can be selected... wEditor.clearSelection(); wEditor.selectObject(%obj); wEditor.dropSelection(); } //function Creator::getRootGroup(%sel) //{ // if(%sel == -1 || %sel == 0) // return(-1); // // %parent = %this.getParent(%sel); // while(%parent != 0 || %parent != -1) // { // %sel = %parent; // %parent = %this.getParent(%sel); // } // // return(%sel); //} // //function Creator::getLastItem(%rootGroup) //{ // %traverse = %rootGroup + 1; // while(%this.getRootGroup(%traverse) == %rootGroup) // %traverse++; // return(%traverse - 1); //} // //function Creator::createNext(%this) //{ // if(%this.currentSel == -1 || %this.currentRoot == -1 || %this.currentObj == -1) // return; // // %sel = %this.currentSel; // %this.currentSel++; // // while(%this.currentSel != %sel) // { // if(%this.getRootGroup(%this.currentSel) != %this.currentRoot) // %this.currentSel = %this.currentRoot + 1; // // if(%this.isGroup(%this.currentSel)) // %this.currentSel++; // else // %sel = %this.currentSel; // } // // // // %this.currentObj.delete(); // %this.create(%sel); //} // //function Creator::createPrevious(%this) //{ // if(%this.currentSel == -1 || %this.currentGroup == -1 || %this.currentObj == -1) // return; // // %sel = %this.currentSel; // %this.currentSel--; // // while(%this.currentSel != %sel) // { // if(%this.getRootGroup(%this.currentSel) != %this.currentRoot) // %this.currentSel = getLastItem(%this.currentRoot); // // if(%this.isGroup(%this.currentSel)) // %this.currentSel--; // else // %sel = %this.currentSel; // } // // // // %this.currentObj.delete(); // %this.create(%sel); //} PK !(Ugui/EditorToolInspectorGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EditorToolInspectorGui) { profile = "GuiButtonProfile"; position = "0 0"; extent = "200 200"; horizSizing = "width"; vertSizing = "height"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "2 2"; extent = "40 20"; text = "Apply"; command = "inspector.apply(InspectorNameEdit.getValue());"; }; new GuiTextEditCtrl(InspectorNameEdit) { profile = "GuiTextEditProfile"; position = "44 2"; extent = "160 20"; text = ""; horizSizing = "width"; vertSizing = "bottom"; }; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; vScrollBar = "alwaysOn"; hScrollBar = "dynamic"; vertSizing = "height"; horizSizing = "width"; position = "0 24"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; new GuiInspector(Inspector) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; }; }; }; }; //--- OBJECT WRITE END --- function Inspector::init() { }PK !(l   gui/EditorToolMissionAreaGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(editortoolmissionareagui) { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiControl(AE_MainBar) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiCheckBoxCtrl() { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "60 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "AreaEditor.enableEditing"; command = "AreaEditor.enableEditing = $ThisControl.getValue();"; helpTag = "0"; text = "Edit Area"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "63 2"; extent = "60 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "AreaEditor.centerWorld();"; helpTag = "0"; text = "Center"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "125 2"; extent = "60 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "AreaEditor.enableMirroring = true;AE_MainBar.setVisible(0);AE_MirrorBar.setVisible(1);"; helpTag = "0"; text = "Mirror"; }; }; new GuiControl(AE_MirrorBar) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 20"; minExtent = "8 8"; visible = "0"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "30 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "if(AreaEditor.mirrorIndex == 0) AreaEditor.mirrorIndex = 7; else AreaEditor.mirrorIndex--;"; helpTag = "0"; text = "<--"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "37 1"; extent = "30 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "if(AreaEditor.mirrorIndex == 7) AreaEditor.mirrorIndex = 0; else AreaEditor.mirrorIndex++;"; helpTag = "0"; text = "-->"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "78 1"; extent = "60 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "AreaEditor.enableMirroring = false;tEditor.mirrorTerrain(AreaEditor.mirrorIndex);AreaEditor.updateTerrain();AE_MirrorBar.setVisible(0);AE_MainBar.setVisible(1);"; helpTag = "0"; text = "Apply"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "141 1"; extent = "60 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "AreaEditor.enableMirroring = false;AE_MirrorBar.setVisible(0);AE_MainBar.setVisible(1);"; helpTag = "0"; text = "Cancel"; }; }; new MissionAreaEditor(AreaEditor) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 20"; extent = "640 440"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; wrap = "0"; squareBitmap = "1"; enableEditing = "0"; renderCamera = "1"; handleFrameColor = "255 255 255 255"; handleFillColor = "0 0 0 255"; defaultObjectColor = "0 255 0 100"; waterObjectColor = "0 0 255 100"; missionBoundsColor = "255 0 0 255"; cameraColor = "255 0 0 255"; enableMirroring = "0"; mirrorIndex = "0"; mirrorLineColor = "255 0 255 255"; mirrorArrowColor = "255 0 255 128"; }; new GuiTextCtrl(AreaEditingText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "top"; position = "5 460"; extent = "640 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function AreaEditor::init(%this) { } function AreaEditor::onUpdate(%this, %area) { AreaEditingText.setValue( "X: " @ getWord(%area,0) @ " Y: " @ getWord(%area,1) @ " W: " @ getWord(%area,2) @ " H: " @ getWord(%area,3)); } function AreaEditor::onWorldOffset(%this, %offset) { } PK !(c8gui/EditorToolThumbnailGui.gui//--- OBJECT WRITE BEGIN --- new GuiScrollCtrl(ThumbnailView) { profile = "GuiScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; vScrollBar = "allwaysOn"; hScrollBar = "dynamic"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; new GuiBitmapCtrl(ThumbnailPreview) { profile = "GuiScrollContentProfile"; }; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function ThumbnailPreview::init(%this) { }PK !(mģ gui/EditorToolTreeViewGui.gui//--- OBJECT WRITE BEGIN --- new GuiScrollCtrl(EditorToolTreeViewGui) { profile = "GuiScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; vScrollBar = "alwaysOn"; hScrollBar = "dynamic"; position = "0 0"; extent = "200 400"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; // new GuiTreeViewCtrl(EditorTree) new GuiTreeView(EditorTree) { profile = "GuiTreeViewProfile"; position = "0 0"; extent = "300 300"; horizSizing = "width"; allowMultipleSelections = "true"; recurseSets = "true"; }; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function EditorTree::init(%this) { %this.open(MissionGroup); // context menu new GuiControl(ETContextPopupDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; new GuiPopUpMenuCtrl(ETContextPopup) { profile = "GuiButtonProfile"; position = "0 0"; extent = "0 0"; minExtent = "0 0"; maxPopupHeight = "200"; command = "canvas.popDialog(ETContextPopupDlg);"; }; }; ETContextPopup.setVisible(false); } function EditorTree::onInspect(%this, %obj) { Inspector.inspect(%obj); InspectorNameEdit.setValue(%obj.getName()); } function EditorTree::onSelect(%this, %obj) { if($AIEdit) aiEdit.selectObject(%obj); else wEditor.selectObject(%obj); } function EditorTree::onUnselect(%this, %obj) { if($AIEdit) aiEdit.unselectObject(%obj); else wEditor.unselectObject(%obj); } function EditorTree::onContextMenu(%this, %mousePos, %obj) { ETContextPopup.position = %mousePos; ETContextPopup.clear(); ETContextPopup.add("Delete", 0); canvas.pushDialog(ETContextPopupDlg); ETContextPopup.forceOnAction(); %this.contextObj = %obj; } function ETContextPopup::onSelect(%this, %index, %value) { switch(%index) { case 0: EditorTree.contextObj.delete(); } }PK !( gui/EditorToolbarDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EditorToolbarDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "editor.close();"; helpTag = "0"; text = "Back"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "123 4"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Editor.setEditor(WorldEditor);"; helpTag = "0"; text = "World Editor"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "207 4"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Editor.setEditor(TerrainEditor);"; helpTag = "0"; text = "Terrain Editor"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "291 4"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Editor.setEditor(Terraformer);"; helpTag = "0"; text = "Terraformer"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "375 4"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Editor.setEditor(AIEditor);"; helpTag = "0"; text = "AI Editor"; }; }; //--- OBJECT WRITE END --- PK !(-h gui/EmailBlockDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EmailBlockDlg) { profile = "DlgBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "154 64"; extent = "332 320"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "EDIT BLOCK LIST"; noTitleBar = "0"; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "32 265"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "EmailBlockRemove();"; helpTag = "0"; text = "REMOVE BLOCK"; simpleStyle = "0"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "height"; position = "22 42"; extent = "287 222"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 7"; extent = "279 208"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellTextList(EmailBlockList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "263 8"; minExtent = "8 8"; visible = "1"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0 169"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 28"; extent = "45 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Sender:"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "169 265"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(EmailBlockDlg);"; helpTag = "0"; text = "DONE"; simpleStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "179 28"; extent = "103 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "# Blocked Emails:"; }; }; }; //--- OBJECT WRITE END --- PK !(lgui/EmailComposeDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EMailComposeDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; state = "done"; key = "6"; new ShellWindowCtrl(EmailComposeWindow) { profile = "ShellWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "77 37"; extent = "500 408"; minExtent = "386 230"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMPOSE EMAIL"; maxLength = "255"; frameBase = "gui/window"; borderWidth = "2"; resizeWidth = "1"; resizeHeight = "1"; canMove = "1"; canClose = "1"; closeCommand = "EmailComposeDlg.Cancel();"; new ShellTextEditCtrl(Email_TOEdit) { profile = "NewTextEditProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "51 30"; extent = "443 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; maxLength = "2001"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellTextEditCtrl(Email_CCEdit) { profile = "NewTextEditProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "51 56"; extent = "443 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; maxLength = "2001"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellTextEditCtrl(EMail_Subject) { profile = "NewTextEditProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "51 82"; extent = "443 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$EmailSubject"; helpTag = "0"; maxLength = "48"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "11 117"; extent = "478 250"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "7 7"; extent = "448 236"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextEditCtrl(EmailBodyText) { profile = "ShellMessageTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "448 236"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "3600"; deniedSound = "InputDeniedSound"; }; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "96 368"; extent = "100 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailComposeDlg.Cancel();"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "306 368"; extent = "100 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EMailComposeDlg.SendMail();"; helpTag = "0"; text = "SEND"; simpleStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 91"; extent = "47 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Subject:"; maxLength = "255"; }; new ShellBitmapButton(ToButton) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 30"; extent = "50 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "LaunchAddressDlg();"; helpTag = "0"; text = "TO:"; simpleStyle = "0"; }; new ShellBitmapButton(CCButton) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 56"; extent = "50 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "LaunchAddressDlg();"; helpTag = "0"; text = "CC:"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(֜➖''gui/EmailGui.gui//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(EmailGui) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$ShellBackground"; helpTag = "0"; useVariable = "1"; new ShellPaneCtrl() { profile = "ShellPaneProfile"; horizSizing = "width"; vertSizing = "height"; position = "12 13"; extent = "620 423"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "EMAIL"; maxLength = "255"; noTitleBar = "0"; new ShellBitmapButton(EM_BlockEditBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "324 42"; extent = "90 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailEditBlocks();"; helpTag = "0"; text = "BLOCK LIST"; simpleStyle = "0"; }; new ShellBitmapButton(EM_AddBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "427 29"; extent = "93 38"; minExtent = "32 38"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailBlockSender();"; helpTag = "0"; text = "TRACK SENDER"; simpleStyle = "0"; }; new ShellBitmapButton(EM_DeleteBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "275 42"; extent = "65 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailMessageDelete();"; accelerator = "delete"; helpTag = "0"; text = "DELETE"; simpleStyle = "0"; }; new ShellBitmapButton(EM_ForwardBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "216 42"; extent = "75 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailMessageForward();"; helpTag = "0"; text = "FORWARD"; simpleStyle = "0"; }; new ShellBitmapButton(EM_ReplyToAllBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "152 42"; extent = "80 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailMessageReplyAll();"; helpTag = "0"; text = "REPLY ALL"; simpleStyle = "0"; }; new ShellBitmapButton(EM_ReplyBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "108 42"; extent = "60 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailMessageReply();"; helpTag = "0"; text = "REPLY"; simpleStyle = "0"; }; new ShellBitmapButton(em_NewMailbtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "71 42"; extent = "53 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailMessageNew();"; helpTag = "0"; text = "NEW"; simpleStyle = "0"; }; new GuiFrameSetCtrl(EM_Frame) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "18 70"; extent = "583 334"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; columns = "0"; rows = "0 146"; borderWidth = "4"; borderColor = "5 199 145 255"; borderEnable = "dynamic"; borderMovable = "dynamic"; autoBalance = "0"; fudgeFactor = "4"; new ShellFancyArrayScrollCtrl(EM_BrowserPane) { profile = "ShellServerBrowserProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "583 142"; minExtent = "8 72"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fixedHorizontal = "1"; vertSpacerBitmap = "gui/shll_vertspacer"; horzSpacerBitmap = "gui/shll_horzspacer"; new VirtualScrollCtrl() { profile = "ShellServerBrowserProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 16"; extent = "583 126"; minExtent = "8 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "0"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 0"; new VirtualScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "559 118"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "8 59"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; }; }; }; new GuiEmailBrowser(EM_Browser) { profile = "ShellServerBrowserProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "563 138"; minExtent = "8 20"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; startScrollRegion = "4 0"; headerBitmap = "gui/server_tabs"; sortArrowBitmap = "gui/shll_sortarrow"; fieldBase = "gui/shll_field"; barBase = "gui/shll_bar"; glowOffset = "4"; rowHeight = "19"; headerFontType = "Univers Condensed"; headerFontSize = "16"; headerFontColor = "8 19 6 255"; headerFontColorHL = "25 68 56 255"; separatorColor = "192 192 192 255"; drawSeparators = "0"; headerSort = "1"; allowReposition = "1"; noSelect = "0"; iconBase = "gui/email"; unreadFontType = "Univers Bold"; unreadFontSize = "16"; unreadFontColor = "6 245 215 255"; headerGlowOffset = "4"; }; }; new ShellScrollCtrl(EM_MessagePane) { profile = "NewScrollCtrlProfile"; horizSizing = "left"; vertSizing = "height"; position = "0 146"; extent = "583 188"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 7"; extent = "553 174"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextCtrl(EMailInboxBodyText) { profile = "ShellMessageTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "551 248"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; }; }; new ShellBitmapButton(EM_BuddyEditBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "504 29"; extent = "100 38"; minExtent = "32 38"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailEditBuddys();"; helpTag = "0"; text = "TRACKING LIST"; simpleStyle = "0"; }; new ShellBitmapButton(EM_BlockBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "398 42"; extent = "105 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailBlockSender();"; helpTag = "0"; text = "BLOCK SENDER"; simpleStyle = "0"; }; new ShellBitmapButton(em_GetMailBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 42"; extent = "75 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "GetEmailBtnClick();"; helpTag = "0"; text = "GET MAIL"; simpleStyle = "0"; }; new ShellRadioButton(rbInbox) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "15 24"; extent = "101 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EMailGui.ButtonClick(0);"; helpTag = "0"; text = "INBOX"; maxLength = "255"; groupNum = "0"; }; new ShellRadioButton(rbSendItems) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "222 24"; extent = "110 30"; minExtent = "26 27"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "SENT MAIL"; maxLength = "255"; groupNum = "0"; }; new ShellRadioButton(rbDeleted) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "113 24"; extent = "112 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EmailGui.buttonClick(1);"; helpTag = "0"; text = "DELETED MAIL"; maxLength = "255"; groupNum = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(v||gui/EnterIPDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(EnterIPDlg) { profile = "DlgBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "155 175"; extent = "330 130"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENTER IP ADDRESS"; maxLength = "255"; noTitleBar = "0"; new ShellTextEditCtrl(IPEntry) { profile = "NewTextEditProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "28 35"; extent = "273 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; altCommand = "EnterIPDlg.onDone();"; helpTag = "0"; maxLength = "24"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "43 75"; extent = "100 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.popDialog( EnterIPDlg );"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "187 75"; extent = "100 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "EnterIPDlg.onDone();"; helpTag = "0"; text = "DONE"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(_44gui/FilterEditDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(FilterEditDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "22 37"; extent = "600 390"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "EDIT GAME FILTER"; maxLength = "255"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "48 40"; extent = "80 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Filter Name:"; maxLength = "255"; }; new ShellTextEditCtrl(FilterEditName) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "124 32"; extent = "180 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "New Filter"; maxLength = "16"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 78"; extent = "60 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Rules Set:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 108"; extent = "60 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Game Type:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "239 78"; extent = "106 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Min Player Count:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "239 108"; extent = "106 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Max Player Count:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "42 244"; extent = "82 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Server Location:"; maxLength = "255"; }; new ShellPopupMenu(FilterEditGameType) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "83 69"; extent = "160 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Any"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new ShellTextEditCtrl(FilterEditMinPlayers) { profile = "NewTextEditNumericProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "341 70"; extent = "80 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "0"; maxLength = "3"; validate = "FilterEditDlg.setMinPlayers();"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "422 78"; extent = "84 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Max Bot Count:"; maxLength = "255"; }; new ShellTextEditCtrl(FilterEditMaxBots) { profile = "NewTextEditNumericProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "502 70"; extent = "80 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "16"; maxLength = "3"; validate = "FilterEditDlg.setMaxBots();"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellPopupMenu(FilterEditMissionType) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "83 99"; extent = "160 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Any"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new ShellTextEditCtrl(FilterEditMaxPlayers) { profile = "NewTextEditNumericProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "341 100"; extent = "80 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "255"; maxLength = "3"; validate = "FilterEditDlg.setMaxPlayers();"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "422 108"; extent = "84 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Min CPU Speed:"; maxLength = "255"; }; new ShellTextEditCtrl(FilterEditMinCPU) { profile = "NewTextEditNumericProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "502 100"; extent = "80 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "0"; maxLength = "4"; validate = "FilterEditDlg.setMinCPU();"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellToggleButton(FilterEditUsePingTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "38 145"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "FILTER BY MAX PING"; maxLength = "255"; }; new ShellTextEditCtrl(FilterEditMaxPing) { profile = "NewTextEditNumericProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "207 140"; extent = "80 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "0"; maxLength = "3"; validate = "FilterEditDlg.setMaxPing();"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellToggleButton(FilterEditDedicatedTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "396 145"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DEDICATED"; maxLength = "255"; }; new ShellToggleButton(FilterEditTDOnTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "38 175"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "TEAM DAMAGE ON"; maxLength = "255"; }; new ShellToggleButton(FilterEditWindowsTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "217 177"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "WINDOWS ONLY"; maxLength = "255"; }; new ShellToggleButton(FilterEditNoPwdTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "396 175"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "NOT PASSWORDED"; maxLength = "255"; }; new ShellToggleButton(FilterEditTDOffTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "38 205"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "TEAM DAMAGE OFF"; maxLength = "255"; }; new ShellToggleButton(FilterEditLinuxTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "217 205"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "LINUX ONLY"; maxLength = "255"; }; new ShellToggleButton(FilterEditCurVersionTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "396 205"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CURRENT VERSION"; maxLength = "255"; }; new ShellToggleButton(FilterEditLocMask0) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "38 266"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "FilterEditDlg.checkRegionMasks( 0 );"; helpTag = "0"; text = "NORTH AMERICA EAST"; maxLength = "255"; }; new ShellToggleButton(FilterEditLocMask2) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "217 266"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "FilterEditDlg.checkRegionMasks( 2 );"; helpTag = "0"; text = "SOUTH AMERICA"; maxLength = "255"; }; new ShellToggleButton(FilterEditLocMask3) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "396 266"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "FilterEditDlg.checkRegionMasks( 3 );"; helpTag = "0"; text = "AUSTRALIA"; maxLength = "255"; }; new ShellToggleButton(FilterEditLocMask1) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "38 294"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "FilterEditDlg.checkRegionMasks( 1 );"; helpTag = "0"; text = "NORTH AMERICA WEST"; maxLength = "255"; }; new ShellToggleButton(FilterEditLocMask5) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "217 294"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "FilterEditDlg.checkRegionMasks( 5 );"; helpTag = "0"; text = "EUROPE"; maxLength = "255"; }; new ShellToggleButton(FilterEditLocMask4) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "396 294"; extent = "165 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "FilterEditDlg.checkRegionMasks( 4 );"; helpTag = "0"; text = "ASIA"; maxLength = "255"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "83 335"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.popDialog(FilterEditDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "396 335"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "ChooseFilterDlg.saveFilter();"; helpTag = "0"; text = "SAVE"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(NA gui/FindServerDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(FindServerDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "155 156"; extent = "330 167"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "FIND SERVER"; maxLength = "255"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 45"; extent = "75 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Find Text:"; maxLength = "255"; }; new ShellTextEditCtrl(FS_SearchPattern) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "91 36"; extent = "205 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "FS_SearchPattern.validate();"; altCommand = "FindServerDlg::onGo();"; helpTag = "0"; maxLength = "24"; historySize = "5"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "85 76"; extent = "160 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::ServerBrowser::IgnoreCase"; helpTag = "0"; text = "IGNORE CASE"; maxLength = "255"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "43 112"; extent = "100 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.popDialog( FindServerDlg );"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton(FS_GoBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "187 112"; extent = "100 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "FindServerDlg.onGo();"; helpTag = "0"; text = "GO"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(Zgui/FrameOverlayGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(FrameOverlayGui) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "false"; helpTag = "0"; bypassHideCursor = "1"; new GuiConsoleTextCtrl(TextOverlayControl) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 5"; extent = "15 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; expression = "10"; }; }; //--- OBJECT WRITE END --- PK !(Նvvgui/GameGui.gui//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(GameGui) { profile = "GuiContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$ShellBackground"; helpTag = "0"; useVariable = "1"; new ShellPaneCtrl(GM_Frame) { profile = "ShellPaneProfile"; horizSizing = "width"; vertSizing = "height"; position = "12 13"; extent = "620 423"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "GAME"; longTextBuffer = "0"; maxLength = "255"; noTitleBar = "0"; new ShellTabFrame(GM_TabFrame) { profile = "ShellHorzTabFrameProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "22 54"; extent = "576 254"; minExtent = "26 254"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; isVertical = "0"; useCloseButton = "0"; edgeInset = "0"; }; new ShellTabGroupCtrl(GM_TabView) { profile = "TabGroupProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "30 25"; extent = "560 29"; minExtent = "38 29"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; glowOffset = "7"; tabSpacing = "2"; maxTabWidth = "150"; stretchToFit = "0"; }; new GuiControl(GM_JoinPane) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "31 62"; extent = "558 345"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "BrowserFilterLabelProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "48 26"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "FILTER:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "56 3"; extent = "104 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(GMJ_FilterText) { profile = "BrowserFilterTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "67 26"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "All Servers"; longTextBuffer = "0"; maxLength = "255"; }; }; new GuiTextCtrl(GMJ_StatusText) { profile = "BrowserStatusTextProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "162 3"; extent = "190 26"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Status Text..."; longTextBuffer = "0"; maxLength = "255"; }; new GuiProgressCtrl(GMJ_ProgressBar) { profile = "BrowserProgressProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "355 5"; extent = "154 18"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; }; new ShellBitmapButton(GMJ_StopBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "504 -4"; extent = "59 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "stopServerQuery();"; accelerator = "escape"; helpTag = "0"; text = "STOP"; simpleStyle = "0"; }; new ShellFancyArrayScrollCtrl() { profile = "ShellServerBrowserProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 25"; extent = "558 286"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fixedHorizontal = "0"; vertSpacerBitmap = "gui/shll_vertspacer"; horzSpacerBitmap = "gui/shll_horzspacer"; new VirtualScrollCtrl() { profile = "ShellServerBrowserProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "194 16"; extent = "364 270"; minExtent = "8 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "0"; hScrollBar = "alwaysOn"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 0"; new VirtualScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "340 246"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "840 8"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; }; }; }; new GuiServerBrowser(GMJ_Browser) { profile = "ShellServerBrowserProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "538 265"; minExtent = "8 20"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; altCommand = "Canvas.pushDialog(ServerInfoDlg);"; helpTag = "0"; startScrollRegion = "1 0"; headerBitmap = "gui/server_tabs"; sortArrowBitmap = "gui/shll_sortarrow"; barBase = "gui/shll_bar"; glowOffset = "4"; rowHeight = "19"; headerFontType = "Univers Condensed"; headerFontSize = "16"; headerFontColor = "8 19 6 255"; headerFontColorHL = "25 68 56 255"; separatorColor = "192 192 192 255"; drawSeparators = "0"; headerSort = "1"; allowReposition = "1"; noSelect = "0"; iconBase = "gui/shll_icon"; }; }; new ShellBitmapButton(GMJ_FilterBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "38 306"; extent = "110 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.pushDialog(ChooseFilterDlg);"; helpTag = "0"; text = "CHANGE FILTER"; simpleStyle = "0"; }; new ShellBitmapButton(GMJ_RefreshListBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "140 306"; extent = "110 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "GMJ_Browser.runQuery();"; helpTag = "0"; text = "REFRESH LIST"; simpleStyle = "0"; }; new ShellBitmapButton(GMJ_RefreshServerBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "242 306"; extent = "110 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "GMJ_Browser.refreshSelectedServer();"; helpTag = "0"; text = "REFRESH SERVER"; simpleStyle = "0"; }; new ShellBitmapButton(GMJ_InfoBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "344 306"; extent = "110 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.pushDialog(ServerInfoDlg);"; helpTag = "0"; text = "SERVER INFO"; simpleStyle = "0"; }; new ShellBitmapButton(GMJ_JoinBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "446 306"; extent = "110 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "JoinSelectedGame();"; helpTag = "0"; text = "JOIN GAME"; simpleStyle = "0"; }; }; new GuiControl(GM_HostPane) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "31 62"; extent = "558 345"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "center"; vertSizing = "center"; position = "0 16"; extent = "558 312"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "34 13"; extent = "60 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Game Type:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(GMH_MissionType) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "90 4"; extent = "165 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "GAME TYPE"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "35 40"; extent = "75 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Mission Name:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "height"; position = "31 54"; extent = "218 251"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 2"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 6"; extent = "210 239"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellTextList(GMH_MissionList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "210 8"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; altCommand = "tryToStartHostedGame();"; helpTag = "0"; enumerate = "1"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "bottom"; position = "266 4"; extent = "270 268"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 8"; extent = "80 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Server Name:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 0"; extent = "180 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$Host::GameName"; helpTag = "0"; longTextBuffer = "0"; maxLength = "24"; historySize = "0"; password = "0"; IRCName = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 38"; extent = "80 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Password:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 30"; extent = "180 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$Host::Password"; helpTag = "0"; longTextBuffer = "0"; maxLength = "16"; historySize = "0"; password = "0"; IRCName = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 68"; extent = "80 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Max Players:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellTextEditCtrl(GMH_MaxPlayersTE) { profile = "NewTextEditNumericProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 60"; extent = "180 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$Host::MaxPlayers"; helpTag = "0"; longTextBuffer = "0"; maxLength = "3"; validate = "validateMaxPlayers();"; historySize = "0"; password = "0"; IRCName = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new ShellBitmapButton(GMH_AdvancedBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 96"; extent = "180 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.pushDialog(AdvancedHostDlg);"; helpTag = "0"; text = "ADVANCED OPTIONS"; simpleStyle = "0"; }; new ShellToggleButton(GMH_BotsEnabledTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "88 132"; extent = "167 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$Host::BotsEnabled"; helpTag = "0"; text = "ENABLE BOTS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiControl(GMH_EnableBotsGroup) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "1 157"; extent = "270 105"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "11 5"; extent = "90 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Number of Bots:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(GMH_BotCountText) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "107 6"; extent = "16 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "(0)"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(GMH_MinCombatantSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 20"; extent = "185 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "setMinCombatants();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "15"; value = "0.27"; usePlusMinus = "1"; }; new GuiTextCtrl(GMH_BotDiffText) { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 45"; extent = "90 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Bot Difficulty:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(GMH_BotMinText) { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 63"; extent = "42 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Min:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(GMH_BotMinSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 60"; extent = "185 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "updateMinBotDifficulty();"; helpTag = "0"; range = "0.000000 0.990000"; ticks = "1000"; value = "0.99"; usePlusMinus = "1"; }; new GuiTextCtrl(GMH_BotMaxText) { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 86"; extent = "42 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Max:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(GMH_BotMaxSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 83"; extent = "185 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "updateMaxBotDifficulty();"; helpTag = "0"; range = "0.000000 0.990000"; ticks = "1000"; value = "0.99"; usePlusMinus = "1"; }; }; }; new ShellBitmapButton(GMH_StartGameBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "350 273"; extent = "180 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "StartHostedGame();"; helpTag = "0"; text = "START GAME"; simpleStyle = "0"; }; }; }; new GuiControl(GM_WarriorPane) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "31 62"; extent = "558 345"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 12"; extent = "74 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Warrior:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(GMW_WarriorPopup) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "80 3"; extent = "200 38"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Warrior"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "center"; position = "290 15"; extent = "257 322"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellBitmapButton(GMW_PlayerPageBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "94 4"; extent = "152 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "GM_WarriorPane.gotoPlayerPage();"; helpTag = "0"; text = "JUMP TO PLAYER PAGE"; simpleStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "18 55"; extent = "80 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Race/Gender:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(GMW_RaceGenderPopup) { profile = "ShellPopupProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "95 46"; extent = "152 38"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Race/Gender"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "18 92"; extent = "80 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Show:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(GMW_SkinPrefPopup) { profile = "ShellPopupProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "95 83"; extent = "152 38"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "All Skins"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "18 129"; extent = "80 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Skin:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(GMW_SkinPopup) { profile = "ShellPopupProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "95 120"; extent = "152 38"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Skin"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "18 166"; extent = "80 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Voice:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(GMW_VoicePopup) { profile = "ShellPopupProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "95 157"; extent = "152 38"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Voice"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; voiceIndex = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "114 198"; extent = "100 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Test Voice:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellBitmapButton(GMW_VoiceTestBtn) { profile = "SoundTestButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "214 195"; extent = "24 24"; minExtent = "24 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "GMW_VoicePopup.test();"; helpTag = "0"; simpleStyle = "1"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "94 236"; extent = "152 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "GM_WarriorPane.createNewAlias();"; helpTag = "0"; text = "NEW ALIAS"; simpleStyle = "0"; }; new ShellBitmapButton(GMW_DeleteWarriorBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "94 273"; extent = "152 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "GM_WarriorPane.deleteWarrior();"; helpTag = "0"; text = "DELETE ALIAS"; simpleStyle = "0"; }; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "width"; vertSizing = "height"; position = "25 41"; extent = "261 296"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiPlayerView(GMW_PlayerModel) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "1 1"; extent = "259 294"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; }; new ShellRadioButton(GMW_LightRdo) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "top"; position = "0 209"; extent = "80 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "GMW_PlayerModel.update();"; helpTag = "0"; text = "LIGHT"; longTextBuffer = "0"; maxLength = "255"; groupNum = "1"; }; new ShellRadioButton(GMW_MediumRdo) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "top"; position = "0 239"; extent = "80 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "GMW_PlayerModel.update();"; helpTag = "0"; text = "MEDIUM"; longTextBuffer = "0"; maxLength = "255"; groupNum = "1"; }; new ShellRadioButton(GMW_HeavyRdo) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "top"; position = "0 269"; extent = "80 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "GMW_PlayerModel.update();"; helpTag = "0"; text = "HEAVY"; longTextBuffer = "0"; maxLength = "255"; groupNum = "1"; }; }; }; new GuiTextCtrl(GM_VersionText) { profile = "VersionTextProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "396 4"; extent = "160 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; }; }; //--- OBJECT WRITE END --- PK !(dF F gui/GenDialog.gui//--- OBJECT WRITE BEGIN --- new GuiControl(GenDialog) { profile = "ShellWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellDlgFrame() { profile = "ShellDlgProfile"; horizSizing = "center"; vertSizing = "center"; position = "161 168"; extent = "317 143"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "LOCK TOPIC"; maxLength = "255"; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "169 99"; extent = "79 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.PopDIalog(\"GenDialog\");"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "233 99"; extent = "79 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "TopicsPopupMenu.ExecuteLock();"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 53"; extent = "298 52"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 0"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "274 44"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextEditCtrl(LockTopicReason) { profile = "ShellMessageTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "274 44"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "1"; maxChars = "80"; deniedSound = "InputDeniedSound"; }; }; }; new GuiTextCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 40"; extent = "286 17"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "REASON"; maxLength = "255"; }; }; }; //--- OBJECT WRITE END --- PK !(E[+*+*gui/GuiEditorGui.gui//---------------------------------------------------------------- new GuiControlProfile (HotPinkProfile) { opaque = true; fillColor = "255 128 128"; border = true; borderColor = "255 128 128"; fontType = "Arial"; fontSize = 12; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fixedExtent = true; justify = "center"; }; new GuiControl(GuiEditorGui) { profile = GuiDefaultProfile; position = "0 0"; extent = "800 600"; new GuiControl() // pink background { profile = HotPinkProfile; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; }; new GuiControl(GuiEditorContent) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; }; new GuiEditCtrl(GuiEditor) { profile = "GuiTextEditProfile"; // so it's tabable horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; }; new GuiFrameSetCtrl() { position = "640 0"; extent = "160 600"; profile = "GuiButtonProfile"; horizSizing = "width"; vertSizing = "height"; columns = "0"; rows = "0 300"; new GuiScrollCtrl() // tree view { profile = "GuiScrollCtrlProfile"; position = "0 0"; extent = "160 300"; horizSizing = "width"; vertSizing = "height"; vScrollBar = "alwaysOn"; hScrollBar = "dynamic"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; new GuiTreeView (GuiEditorTreeView) { profile = "GuiTreeViewProfile"; position = "0 0"; horizSizing = "width"; }; }; }; new GuiControl() { // inspector profile = "GuiButtonProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "160 300"; new GuiButtonCtrl () { profile = "GuiButtonProfile"; position = "4, 4"; extent = "40 16"; font = "12 252 Arial"; fontHL = "12 253 Arial"; text = "APPLY"; command = "GuiEditorInspectApply();"; fillColor = "249"; borderColor = "249"; selectBorderColor = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; position = "52 4"; extent = "30 16"; font = "12 244 Arial"; text = "Name:"; }; new GuiTextEditCtrl (GuiEditorInspectName) { profile = "GuiTextEditProfile"; position = "84 3"; extent = "72 18"; text = ""; horizSizing = "width"; vertSizing = "bottom"; }; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; position = "0 24"; extent = "160 276"; horizSizing = "width"; vertSizing = "height"; vScrollBar = "alwaysOn"; hScrollBar = "alwaysOff"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; extent = "140 274"; horizSizing = "width"; vertSizing = "height"; new GuiInspector (GuiEditorInspectFields) { profile = "GuiDefaultProfile"; position = "0 0"; extent = "140 0"; horizSizing = "width"; vertSizing = "bottom"; }; }; }; }; }; // toolbar new GuiControl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "height"; position = "0 480"; extent = "640 120"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "4 24"; extent = "70 16"; text = "Align Left"; command = "GuiEditor.Justify(0);"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "80 24"; extent = "70 16"; text = "Align Right"; command = "GuiEditor.Justify(2);"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "156 24"; extent = "70 16"; text = "Center Horiz"; command = "GuiEditor.Justify(1);"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "232 24"; extent = "70 16"; text = "Align Top"; command = "GuiEditor.Justify(3);"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "308 24"; extent = "70 16"; text = "Align Bottom"; command = "GuiEditor.Justify(4);"; }; new GuiControlListPopup(GuiEditorClassPopup) { profile = "GuiButtonProfile"; position = "382 24"; extent = "180 16"; }; new GuiPopUpMenuCtrl(GuiEditorContentList) { profile = "GuiButtonProfile"; position = "382 44"; extent = "180 16"; }; new GuiButtonCtrl () { profile = "GuiButtonProfile"; position = "570 24"; extent = "60 16"; text = "New..."; command = "GuiEditorStartCreate();"; }; new GuiButtonCtrl () { profile = "GuiButtonProfile"; position = "570 44"; extent = "60 16"; text = "Save"; command = "GuiEditorSaveGui();"; }; new GuiButtonCtrl ("GuiEditorButtonToggle") { profile = "GuiButtonProfile"; position = "4 44"; extent = "70 16"; text = "Stop Edit"; command = "GuiEdit();"; }; new GuiButtonCtrl () { profile = "GuiButtonProfile"; position = "80 44"; extent = "70 16"; text = "Space Vert"; command = "GuiEditor.Justify(5);"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "156 44"; extent = "70 16"; text = "Space Horiz"; command = "GuiEditor.Justify(6);"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "232 44"; extent = "70 16"; text = "Bring Front"; command = "GuiEditor.BringToFront();"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "308 44"; extent = "70 16"; text = "Send Back"; command = "GuiEditor.PushToBack();"; }; }; }; new GuiControl(NewGuiDialog) { profile = "GuiDialogProfile"; position = "0 0"; extent = "640 480"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; position = "220 146"; extent = "200 188"; text = "Create new GUI"; canMove = "false"; canClose = "false"; canMinimize = "false"; canMaximize = "false"; horizSizing = "center"; vertSizing = "center"; new GuiTextCtrl() { profile = "GuiTextProfile"; position = "20 28"; text = "GUI Name:"; }; new GuiTextEditCtrl(NewGuiDialogName) { profile = "GuiTextEditProfile"; position = "20 44"; extent = "160 20"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; position = "20 68"; text = "Class:"; }; new GuiControlListPopup(NewGuiDialogClass) { profile = "GuiTextEditProfile"; position = "20 84"; extent = "160 20"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "56 156"; extent = "40 16"; text = "Create"; command = "GuiEditorCreate();"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; position = "104 156"; extent = "40 16"; text = "Cancel"; command = "Canvas.popDialog(NewGuiDialog);"; }; }; }; function GuiEditorStartCreate() { NewGuiDialogClass.setText("GuiControl"); NewGuiDialogClass.sort(); NewGuiDialogName.setValue("NewGui"); Canvas.pushDialog(NewGuiDialog); } function GuiEditorCreate() { %name = NewGuiDialogName.getValue(); %class = NewGuiDialogClass.getText(); Canvas.popDialog(NewGuiDialog); %obj = eval("return new " @ %class @ "(" @ %name @ ");"); GuiEditorOpen(%obj); } function GuiEditorSaveGui() { %obj = GuiEditorContent.getObject(0); if(%obj == -1 || %obj.getName() $= "") return; %obj.save("gui/" @ %obj.getName() @ ".gui"); } function GuiEdit(%val) { if(%val != 0) return; %content = Canvas.getContent(); if(%content == GuiEditorGui.getId()) { //GlobalActionMap.bind(mouse, button1, mouselook); %obj = GuiEditorContent.getObject(0); if(%obj != -1) { GuiGroup.add(%obj); Canvas.setContent(%obj); } } else { //GlobalActionMap.unbind(mouse, button1); GuiEditorOpen(%content); } } function GuiEditorOpen(%content) { Canvas.setContent(GuiEditorGui); while((%obj = GuiEditorContent.getObject(0)) != -1) GuiGroup.add(%obj); // get rid of anything being edited %i = 0; GuiEditorContentList.clear(); while((%obj = GuiGroup.getObject(%i)) != -1) { if(%obj.getName() !$= Canvas) { if(%obj.getName() $= "") %name = "(unnamed) - " @ %obj; else %name = %obj.getName() @ " - " @ %obj; GuiEditorContentList.add(%name, %obj); } %i++; } GuiEditorContent.add(%content); GuiEditorContentList.sort(); GuiEditorClassPopup.sort(); if(%content.getName() $= "") %name = "(unnamed) - " @ %content; else %name = %content.getName() @ " - " @ %content; GuiEditorContentList.setText(%name); GuiEditorClassPopup.setText("New Control"); GuiEditor.setRoot(%content); %content.resize(0,0,640,480); GuiEditorTreeView.open(%content); } function GuiEditorContentList::onSelect(%this, %id) { GuiEditorOpen(%id); } function GuiEditorClassPopup::onSelect(%this, %id) { %class = %this.getText(); %obj = eval("return new " @ %class @ "();"); GuiEditor.addNewCtrl(%obj); GuiEditorClassPopup.setText("New Control"); } function GuiEditorTreeView::onSelect(%this, %obj) { GuiEditorInspectFields.inspect(%obj); GuiEditorInspectName.setValue(%obj.getName()); GuiEditor.select(%obj); } function GuiEditorInspectApply() { GuiEditorInspectFields.apply(GuiEditorInspectName.getValue()); } function GuiEditor::onSelect(%this, %ctrl) { GuiEditorInspectFields.inspect(%ctrl); GuiEditorInspectName.setValue(%ctrl.getName()); } if (!isDemo()) GlobalActionMap.bind(keyboard, "alt f1", GuiEdit); PK !( V00gui/GuiTestGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(GuiTestGui) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 440"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "canvas.setContent(TestGui);"; helpTag = "0"; text = "BACK"; }; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 7"; extent = "622 430"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "GuiWindowCtrl test"; resizeWidth = "1"; resizeHeight = "1"; canMove = "1"; canClose = "1"; canMinimize = "1"; canMaximize = "1"; minSize = "50 50"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 40"; extent = "74 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "GuiTextCtrl test"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 80"; extent = "200 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "GuiTextEditCtrl test"; historySize = "5"; maxLength = "255"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 120"; extent = "120 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "GuiButtonCtrl test"; }; new GuiRadioCtrl() { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 160"; extent = "125 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "$TestRadio = 1;"; helpTag = "0"; text = "GuiRadioCtrl1 test"; groupNum = "1"; }; new GuiRadioCtrl() { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 190"; extent = "125 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "$TestRadio = 2;"; helpTag = "0"; text = "GuiRadioCtrl2 test"; groupNum = "1"; }; new GuiRadioCtrl() { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 220"; extent = "125 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "$TestRadio = 3;"; helpTag = "0"; text = "GuiRadioCtrl3 test"; groupNum = "1"; }; new GuiCheckBoxCtrl() { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 270"; extent = "125 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "CheckBoxCtrl1 test"; }; new GuiCheckBoxCtrl() { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 300"; extent = "125 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "CheckBoxCtrl2 test"; }; new GuiCheckBoxCtrl() { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 330"; extent = "125 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "CheckBoxCtrl3 test"; }; new GuiPopUpMenuCtrl(Menu1) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 35"; extent = "125 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Menu1"; maxPopupHeight = "200"; }; new GuiPopUpMenuCtrl(Menu2) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "360 35"; extent = "125 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Menu2"; maxPopupHeight = "200"; }; new GuiPopUpMenuCtrl(Menu3) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 375"; extent = "125 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Menu3"; maxPopupHeight = "200"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 133"; extent = "104 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "50"; historySize = "0"; maxLength = "255"; format = "%3.2f"; range = "0 100"; increment = "1"; }; new GuiScrollCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 160"; extent = "200 200"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOn"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; new GuiScrollContentCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "180 180"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiArrayCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "400 400"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; }; }; new GuiScrollCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "371 252"; extent = "238 170"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "dynamic"; vScrollBar = "dynamic"; constantThumbHeight = "0"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "236 168"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiMLTextEditCtrl() { profile = "GuiBigTextProfileWhite"; horizSizing = "width"; vertSizing = "top"; position = "0 0"; extent = "208 23"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; lineSpacing = "0"; }; }; }; new GuiScrollCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "376 61"; extent = "239 188"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "237 186"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiMessageVectorCtrl(GMVControl) { profile = "GuiBigTextProfileWhite"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "215 35"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; lineSpacing = "0"; lineContinuedIndex = "5"; allowedMatches[0] = "http"; allowedMatches[1] = "t2server"; matchColor = "0 0 1 1"; textColors1 = "1 0 0 1"; textColors5 = "1 0 1 1"; textColors9 = "0 0.5 0 1"; textColors2 = "0 1 0 1"; textColors6 = "0 1 1 1"; textColors3 = "0 0 1 1"; textColors7 = "1 1 1 1"; textColors0 = "0 0 0 1"; textColors4 = "1 1 0 1"; textColors8 = "0.5 0 0 1"; }; }; }; }; }; //--- OBJECT WRITE END --- Menu1.add(TestData0, 0); Menu1.add(TestData1, 1); Menu1.add(TestData2, 2); Menu1.add(TestData3, 3); Menu1.add(TestData4, 4); Menu1.add(TestData5, 5); Menu1.add(TestData6, 6); Menu1.add(TestData7, 7); Menu1.add(TestData8, 8); Menu1.add(TestData9, 9); Menu1.add(TestData10,10); Menu1.add(TestData11,11); Menu1.add(TestData12,12); Menu1.add(TestData13,13); Menu1.add(TestData14,14); Menu1.add(TestData15,15); Menu1.add(TestData16,16); Menu1.add(TestData17,17); Menu1.add(TestData18,18); Menu1.add(TestData19,19); Menu1.add(TestData20,20); Menu1.add(TestData21,21); Menu1.add(TestData22,22); Menu1.add(TestData23,23); Menu1.add(TestData24,24); Menu1.add(TestData25,25); Menu1.add(TestData26,26); Menu1.add(TestData27,27); Menu1.add(TestData28,28); Menu1.add(TestData29,29); Menu1.add(TestData30,30); Menu1.add(TestData31,31); Menu1.add(TestData32,32); Menu1.add(TestData33,33); Menu1.add(TestData34,34); Menu1.add(TestData35,35); Menu1.add(TestData36,36); Menu1.add(TestData37,37); Menu1.add(TestData38,38); Menu1.add(TestData39,39); Menu1.add(TestData40,40); Menu1.add(TestData41,41); Menu1.add(TestData42,42); Menu1.add(TestData43,43); Menu1.add(TestData44,44); Menu1.add(TestData45,45); Menu2.add(TestData1, 0); Menu2.add(TestData2, 1); Menu2.add(TestData3, 2); Menu2.add(TestData4, 3); Menu2.add(TestData5, 4); Menu2.add(TestData6, 5); Menu2.add(TestData7, 6); Menu3.add(TestData0, 0); Menu3.add(TestData1, 1); Menu3.add(TestData2, 2); Menu3.add(TestData3, 3); Menu3.add(TestData4, 4); Menu3.add(TestData5, 5); Menu3.add(TestData6, 6); Menu3.add(TestData7, 7); Menu3.add(TestData8, 8); Menu3.add(TestData9, 9); Menu3.add(TestData10,10); Menu3.add(TestData11,11); Menu3.add(TestData12,12); Menu3.add(TestData13,13); Menu3.add(TestData14,14); Menu3.add(TestData15,15); Menu3.add(TestData16,16); Menu3.add(TestData17,17); Menu3.add(TestData18,18); Menu3.add(TestData19,19); Menu3.add(TestData20,20); Menu3.add(TestData21,21); Menu3.add(TestData22,22); Menu3.add(TestData23,23); Menu3.add(TestData24,24); Menu3.add(TestData25,25); Menu3.add(TestData26,26); Menu3.add(TestData27,27); Menu3.add(TestData28,28); Menu3.add(TestData29,29); Menu3.add(TestData30,30); Menu3.add(TestData31,31); Menu3.add(TestData32,32); Menu3.add(TestData33,33); Menu3.add(TestData34,34); Menu3.add(TestData35,35); Menu3.add(TestData36,36); Menu3.add(TestData37,37); Menu3.add(TestData38,38); Menu3.add(TestData39,39); Menu3.add(TestData40,40); Menu3.add(TestData41,41); Menu3.add(TestData42,42); Menu3.add(TestData43,43); Menu3.add(TestData44,44); Menu3.add(TestData45,45); $mvid1 = new MessageVector(); $mvid1.pushBackLine("a URL: http://www.test.com/other not part of the url", 0); $mvid1.pushBackLine("a server: t2server://5assedmonkey.com:8080/", 0); $mvid1.pushBackLine("a server: http://t2server://malformed/", 0); $mvid1.pushBackLine("a http://small server", 0); $mvid2 = new MessageVector(); $mvid2.pushBackLine(" This is a completely separate text vector", 0); $mvid2.pushBackLine("It contains no URLS, only two servers, t2server://5assedmonkey.com:28000/ and t2server://5assedmonkey.com:28001/", 0); $mvid2.pushBackLine("It does contain a malformed URL: http://t2server://malformed/", 0); $mvid2.pushBackLine("That URL should show up in http blue. The tribes server url should be in tribes server red.", 0); function GMVControl::urlClickCallback(%this, %url) { echo("Overridden click callback"); Parent::urlClickCallback(%this, %url); } PK !(! c"c"gui/HUDDlgs.gui//--- OBJECT WRITE BEGIN --- new GuiControl(InventoryScreen) { profile = "GuiDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "45 12"; extent = "550 443"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "INVENTORY"; noTitleBar = "0"; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "top"; position = "205 388"; extent = "140 38"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; command = "InventoryScreen.onDone();"; text = "DONE"; }; new ShellFieldCtrl(INV_Root) { profile = "GuiChatBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "29 36"; extent = "492 351"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new ShellTabFrame() { profile = "ShellTabFrameProfile"; horizSizing = "left"; vertSizing = "height"; position = "207 9"; extent = "254 333"; minExtent = "254 26"; visible = "1"; helpTag = "0"; isVertical = "1"; useCloseButton = "0"; edgeInset = "0"; }; }; }; }; //--- OBJECT WRITE END --- //--- OBJECT WRITE BEGIN --- new GuiControl(vehicleHud) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "53 67"; extent = "542 328"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "VEHICLE STATION"; noTitleBar = "0"; new ShellFieldCtrl(VIN_Root) { profile = "GuiChatBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "29 36"; extent = "484 236"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new ShellTabFrame() { profile = "ShellTabFrameProfile"; horizSizing = "right"; vertSizing = "height"; position = "206 9"; extent = "254 217"; minExtent = "254 26"; visible = "1"; helpTag = "0"; isVertical = "1"; useCloseButton = "0"; edgeInset = "0"; }; new HudBitmapCtrl(VIN_Picture) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "215 19"; extent = "256 158"; minExtent = "8 8"; visible = "1"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 1.000000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; autoCenter = "0"; autoResize = "1"; flipVertical = "0"; flipHorizontal = "0"; }; new ShellFieldCtrl() { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "220 183"; extent = "133 29"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiTextCtrl(VIN_RemainingText) { profile = "ShellMediumTextCenterProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "8 5"; extent = "117 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "3 Remaining"; }; }; new ShellBitmapButton(VIN_BuyBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "356 180"; extent = "124 38"; minExtent = "32 38"; visible = "1"; command = "VehicleHud.onBuy();"; helpTag = "0"; text = "BUY"; simpleStyle = "0"; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "top"; position = "201 273"; extent = "140 38"; minExtent = "32 38"; visible = "1"; command = "VehicleHud.onCancel();"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- //--- OBJECT WRITE BEGIN --- new GuiControl(ScoreScreen) { profile = "GuiDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl(ScoreParent) { profile = "ShellPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "0 0"; extent = "640 480"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "SCORE"; noTitleBar = "0"; new ShellFieldCtrl(ScoreHeaderField) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "23 32"; extent = "594 36"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(ScoreHeaderText) { profile = "ScoreHeaderTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "586 28"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; }; }; new ShellFieldCtrl(ScoreField) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "23 72"; extent = "594 386"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(ScoreSubheaderText) { profile = "ScoreSubheaderTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "586 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; }; new ShellScrollCtrl(ScoreScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "height"; position = "1 26"; extent = "592 358"; minExtent = "24 24"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 7"; extent = "578 344"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiControl(ScoreContent) { profile = "GuiScrollContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "586 8"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; }; }; }; }; }; //--- OBJECT WRITE END --- //--- OBJECT WRITE BEGIN --- new GuiControl(MessageHud) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; bypassHideCursor = "1"; new ShellFieldCtrl(MessageHud_Frame) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "120 375"; extent = "356 24"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(MessageHud_Text) { profile = "GuiMessageEditHudTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 5"; extent = "10 22"; minExtent = "8 8"; visible = "1"; }; new GuiTextEditCtrl(MessageHud_Edit) { profile = "GuiMessageEditHudProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 5"; extent = "10 22"; minExtent = "8 8"; visible = "1"; altCommand = "$ThisControl.eval();"; escapeCommand = "MessageHud_Edit.onEscape();"; historySize = "5"; maxLength = "120"; }; }; }; //--- OBJECT WRITE END --- //--- OBJECT WRITE BEGIN --- new GuiControl(ChatMenuHudDlg) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; bypassHideCursor = "1"; new ShellFieldCtrl(ChatMenuHud) { profile = "GuiVMenuProfile"; horizSizing = "right"; vertSizing = "top"; position = "8 209"; extent = "143 0"; minExtent = "8 8"; visible = "1"; }; }; //--- OBJECT WRITE END --- PK !($O.S S gui/HelpDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(HelpDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "center"; vertSizing = "center"; position = "75 36"; extent = "483 393"; minExtent = "300 200"; visible = "1"; helpTag = "0"; text = "Help"; maxLength = "255"; resizeWidth = "1"; resizeHeight = "1"; canMove = "1"; canClose = "1"; canMinimize = "1"; canMaximize = "1"; minSize = "50 50"; closeCommand = "Canvas.popDialog(HelpDlg);"; new GuiScrollCtrl() { profile = "GuiScrollProfile"; horizSizing = "right"; vertSizing = "height"; position = "8 26"; extent = "132 356"; minExtent = "8 8"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; childMargin = "0 0"; new GuiTextListCtrl(HelpFileList) { profile = "GuiTextListProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "130 8"; minExtent = "8 8"; visible = "1"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColumnText = "0"; }; }; new GuiScrollCtrl() { profile = "GuiScrollProfile"; horizSizing = "width"; vertSizing = "height"; position = "146 26"; extent = "328 356"; minExtent = "8 8"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; childMargin = "0 0"; new GuiMLTextCtrl(HelpText) { profile = "GuiMLTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "1 1"; extent = "310 16"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; }; }; }; }; //--- OBJECT WRITE END --- PK !('gui/IHVTest.gui//--- OBJECT WRITE BEGIN --- new GuiControl(IHVTest) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "34 52"; extent = "209 318"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "1"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "189 316"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextListCtrl(RecordingsList) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "52 80"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; enumerate = "1"; resizeCell = "1"; columns = "0"; }; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "34 379"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "quit();"; helpTag = "0"; text = "Exit"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "143 379"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "IHVStartSelectedDemo();"; helpTag = "0"; text = "Start Demo"; }; new GuiTextCtrl() { profile = "GuiBigTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 5"; extent = "268 40"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "IHV Test Recordings"; }; new GuiCheckBoxCtrl(ArbMultitexture) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "290 52"; extent = "235 24"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "$pref::OpenGL::disableARBMultitexture"; helpTag = "0"; text = "Disable ARB_multitexture"; }; new GuiCheckBoxCtrl(FogCoord) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "290 80"; extent = "235 24"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "$pref::OpenGL::disableEXTFogCoord"; helpTag = "0"; text = "Disable EXT_fog_coord"; }; new GuiCheckBoxCtrl(TexEnvCombine) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "290 108"; extent = "235 24"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "$pref::OpenGL::disableEXTTexEnvCombine"; helpTag = "0"; text = "Disable EXT_texture_env_combine"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "290 211"; extent = "235 24"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "toggleFullscreen();"; helpTag = "0"; text = "Toggle Fullscreen"; }; new GuiCheckBoxCtrl(CVArray) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "290 136"; extent = "235 24"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "$pref::OpenGL::disableEXTCompiledVertexArray"; helpTag = "0"; text = "Disable EXT_compiled_vertex_array"; }; new GuiCheckBoxCtrl(timedemo) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "290 239"; extent = "235 24"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Timedemo style playback"; }; new GuiTextCtrl(DemoStats) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "245 286"; extent = "325 24"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Last Demo: None"; }; }; //--- OBJECT WRITE END --- function IHVTest::onWake(%gui) { RecordingsList.clear(); %search = "recordings/*.rec"; %ct = 0; for(%file = findFirstFile(%search); %file !$= ""; %file = findNextFile(%search)) { %fileName = fileBase(%file); RecordingsList.addRow(%ct++, %fileName); } RecordingsList.sort(0); } function IHVStartSelectedDemo() { %sel = RecordingsList.getSelectedId(); %file = RecordingsList.getRowTextById(%sel); Canvas.setContent(PlayGui); $TSControl::FrameCount = 0; playDemo("recordings/" @ %file @ ".rec"); } function TexEnvCombine::onAction() { $pref::OpenGL::disableEXTTexEnvCombine = !$pref::OpenGL::disableEXTTexEnvCombine; } function FogCoord::onAction() { $pref::OpenGL::disableEXTFogCoord = !$pref::OpenGL::disableEXTFogCoord; } function CVArray::onAction() { $pref::OpenGL::disableEXTCompiledVertexArray = !$pref::OpenGL::disableEXTCompiledVertexArray; } function ARBMultitexture::onAction() { $pref::OpenGL::disableARBMultitexture = !$pref::OpenGL::disableARBMultitexture; } function timedemo::onAction() { echo("here"); if ($timeAdvance == 0) { $timeAdvance = 30; } else { $timeAdvance = 0; } } function resetDemoStats() { %mspf = $Demo::playbackTime / $TSControl::frameCount; %fps = 1000 / %mspf; DemoStats.setValue("Last Demo: " @ $TSControl::frameCount @ " frames, " @ %fps @ " fps (" @ %mspf @ " mspf)"); } PK !('* ogui/ImmSplashDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(ImmSplashDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiControl() { profile = "GuiModelessDialogProfile"; horizSizing = "center"; vertSizing = "center"; position = "40 150"; extent = "540 168"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiBitmapCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "540 168"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = "gui/ImmersionLogo.png"; wrap = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(oF gui/InspectAddFieldDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(InspectAddFieldDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "center"; vertSizing = "center"; position = "209 177"; extent = "221 125"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Add dynamic field..."; resizeWidth = "1"; resizeHeight = "1"; canMove = "1"; canClose = "1"; canMinimize = "1"; canMaximize = "1"; minSize = "50 50"; closeCommand = "Canvas.popDialog(InspectAddFieldDlg);"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 32"; extent = "30 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Name:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "21 58"; extent = "31 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Value:"; }; new GuiTextEditCtrl(InspectAddFieldValue) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "62 58"; extent = "146 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; historySize = "0"; maxLength = "255"; }; new GuiTextEditCtrl(InspectAddFieldName) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "62 32"; extent = "146 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; historySize = "0"; maxLength = "255"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "25 88"; extent = "73 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "OK"; command = "canvas.popDialog(InspectAddFieldDlg);InspectAddFieldDlg.doAction();"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "125 88"; extent = "73 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "CANCEL"; command = "canvas.popDialog(InspectAddFieldDlg);"; }; }; }; //--- OBJECT WRITE END --- PK !(Hŵgui/InspectDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(InspectDlg) { profile = "GuiDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "False"; helpTag = "0"; new GuiWindowCtrl(InspectTitle) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 20"; extent = "200 400"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; resizeWidth = "True"; resizeHeight = "True"; canMove = "True"; canClose = "True"; canMinimize = "True"; canMaximize = "True"; minSize = "50 50"; closeCommand = "Canvas.popDialog(InspectDlg);"; font = "12 244 Arial"; selectfillColor = "253"; fillColor = "250"; opaque = "true"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 24"; extent = "40 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "InspectApply();"; helpTag = "0"; text = "APPLY"; selectBorderColor = "255"; borderColor = "249"; fillColor = "249"; fontHL = "12 253 Arial"; font = "12 252 Arial"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "56 24"; extent = "29 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Name:"; font = "12 244 Arial"; }; new GuiTextEditCtrl(InspectObjectName) { profile = "GuiTextEditProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "98 23"; extent = "72 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; historySize = "0"; }; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "8 44"; extent = "184 348"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "False"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "1 1"; extent = "164 346"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiInspector(InspectFields) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "184 8"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; }; }; }; }; new GuiWindowCtrl(InspectTreeTitle) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "232 20"; extent = "200 400"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "TREE VIEW"; resizeWidth = "True"; resizeHeight = "True"; canMove = "True"; canClose = "True"; canMinimize = "True"; canMaximize = "True"; minSize = "50 50"; closeCommand = "Canvas.popDialog(InspectDlg);"; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "8 24"; extent = "184 368"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "dynamic"; vScrollBar = "alwaysOn"; constantThumbHeight = "False"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "164 366"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTreeView(InspectTreeView) { profile = "GuiTreeViewProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "64 64"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; }; }; }; }; }; //--- OBJECT WRITE END --- function Inspect(%obj) { Canvas.popDialog("InspectDlg"); Canvas.pushDialog("InspectDlg", 30); InspectFields.inspect(%obj); InspectObjectName.setValue(%obj.getName()); InspectTitle.setValue(%obj.getId() @ ": " @ %obj.getName()); } function InspectApply() { InspectFields.apply(InspectObjectName.getValue()); } function InspectTreeView::onSelect(%this, %obj) { Inspect(%obj); } function Tree(%obj) { Canvas.popDialog("InspectDlg"); Canvas.pushDialog("InspectDlg", 20); InspectTreeView.open(%obj); } function GuiInspector::addDynamicField(%this, %obj) { InspectAddFieldDlg.object = %obj; InspectAddFieldDlg.inspector = %this; InspectAddFieldName.setValue(""); InspectAddFieldValue.setValue(""); Canvas.pushDialog(InspectAddFieldDlg, 99); } function InspectAddFieldDlg::doAction(%this) { if(InspectAddFieldName.getValue() $= "" || InspectAddFieldValue.getValue() $= "") return; eval(%this.object @ "." @ firstWord(InspectAddFieldName.getValue()) @ " = " @ InspectAddFieldValue.getValue() @ ";"); %this.inspector.inspect(%this.object); } PK !(Egui/InteriorDebug.guinew GuiControl(interiorDebugDialog) { profile = "GuiDialogProfile"; new GuiWindowCtrl() { profile = GuiWindowProfile; position = "25 25"; extent = "240 200"; text = "Interior Debug Options"; closeCommand = "Canvas.popDialog(interiorDebugDialog);"; new GuiTextCtrl() { profile = "GuiCenterTextProfile"; position = "20 25"; extent = "200 20"; text = "Render Mode:"; }; new GuiPopUpMenuCtrl(InteriorRenderMode) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 45"; extent = "200 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Options"; maxPopupHeight = "200"; setText = "false"; }; new GuiTextCtrl() { profile = "GuiCenterTextProfile"; position = "20 73"; extent = "200 20"; text = "Options:"; }; new GuiButtonCtrl(InteriorAlarmMode) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "45 93"; extent = "150 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "false"; modal = "True"; helpTag = "0"; text = "Toggle Alarm Mode"; }; new GuiCheckBoxCtrl(InteriorFocusDebugModes) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "45 115"; extent = "150 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "false"; modal = "True"; helpTag = "0"; text = "Focus Debug Modes"; }; new GuiCheckBoxCtrl(InteriorDontRestrict) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "45 137"; extent = "150 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "false"; modal = "True"; helpTag = "0"; text = "Don't Restrict outside"; }; }; }; $InteriorRenderModes[0] = "Normal"; $InteriorRenderModes[1] = "Render as Lines"; $InteriorRenderModes[2] = "Show Detail Polys"; $InteriorRenderModes[3] = "Show Ambiguous Polys"; $InteriorRenderModes[4] = "Show Orphaned Polys"; $InteriorRenderModes[5] = "Show Lightmap"; $InteriorRenderModes[6] = "Show Only Textures"; $InteriorRenderModes[7] = "Show Portal Zones"; $InteriorRenderModes[8] = "Show Ambient lit Surfaces"; $InteriorRenderModes[9] = "[* Show Collision Fans *]"; $InteriorRenderModes[10] = "[* Show Triangle Strips *]"; $InteriorRenderModes[11] = "[* Show Null Surfaces *]"; $InteriorRenderModes[12] = "[* Show Large Textures *]"; $InteriorRenderModes[13] = "[* Show Hull Surfaces *]"; $InteriorRenderModes[14] = "[* Show Vehicle Hull Surfaces *]"; $InteriorRenderModes[15] = "[* Show vertex colors *]"; $InteriorRenderModes[16] = "[* Show detail level *]"; $NumInteriorRenderModes = 17; for ($i = 0; $i < $NumInteriorRenderModes; $i++) { InteriorRenderMode.add($InteriorRenderModes[$i], $i); } InteriorRenderMode.setText($InteriorRenderModes[0]); function InteriorRenderMode::onSelect(%object, %idNum) { %name = %object.getValue(); %renderMode = 0; for (%i = 0; %i < $NumInteriorRenderModes; %i++) { if (%name $= $InteriorRenderModes[%i]) { %renderMode = %i; break; } } setInteriorRenderMode(%renderMode); if(%renderMode == 1) // line mode $T2::renderoutline = true; else $T2::renderoutline = false; } $InteriorPreviewGuiAlarmMode = "off"; function InteriorAlarmMode::onAction() { if ($InteriorPreviewGuiAlarmMode $= "on") $InteriorPreviewGuiAlarmMode = "off"; else $InteriorPreviewGuiAlarmMode = "on"; TestObject.setAlarmMode($InteriorPreviewGuiAlarmMode); } function InteriorFocusDebugModes::onAction() { setInteriorFocusedDebug(InteriorFocusDebugModes.getValue()); } function InteriorDontRestrict::onAction() { $Interior::DontRestrictOutside = InteriorDontRestrict.getValue(); } function interiorDebugDialog::onWake( %this ) { } function interiorDebugDialog::onSleep( %this ) { } PK !(~ gui/InteriorPreviewGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(interiorPreviewGui) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GameTSCtrl() { profile = "GuiButtonProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; beaconBaseTextureName = "gui/beacon_base"; beaconTargetTextureName = "gui/crosshairs"; beaconTargetPeriod = "4000"; beaconsVisible = "1"; enemyBeaconLineBeginColor = "0.000000 1.000000 0.000000 0.200000"; enemyBeaconLineEndColor = "0.000000 1.000000 0.000000 0.800000"; vehicleBeaconLineBeginColor = "1.000000 0.000000 0.000000 0.200000"; vehicleBeaconLineEndColor = "1.000000 0.000000 0.000000 0.800000"; friendBeaconLineBeginColor = "1.000000 1.000000 0.000000 0.200000"; friendBeaconLineEndColor = "1.000000 1.000000 0.000000 0.800000"; beaconLineWidth = "2.5"; beaconTextYOffset = "14"; showAlternateTarget = "0"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "22 438"; extent = "100 20"; minExtent = "8 8"; visible = "1"; command = "quit();"; helpTag = "0"; text = "Exit"; }; new ShellFieldCtrl(metricsIMain) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "10 160"; extent = "242 275"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(title) { profile = "CenterPrintTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "63 7"; extent = "110 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Mapper Metrics"; longTextBuffer = "0"; maxLength = "255"; lineSpacing = "2"; maxChars = "-1"; allowColorChars = "0"; }; new GuiTextCtrl(ThreeSpacePolysText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 148"; extent = "85 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "TS Polys: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(InteriorPolysText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 118"; extent = "98 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Interior Polys: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(TerrainPolysText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 88"; extent = "99 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Terrain Polys: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(TotalPolysText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 226"; extent = "101 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Scene Polys: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(WaterPolysText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 178"; extent = "127 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Water Polys: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(FrameRateText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 40"; extent = "87 26"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Frame Rate: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiConsoleVariableCtrl(frameRate) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 40"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$FPS::Real"; }; new GuiConsoleVariableCtrl(ThreeSpacePolys) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 148"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$OpenGL::triCount3"; }; new GuiConsoleVariableCtrl(InteriorPolys) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 118"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$OpenGL::triCount2"; }; new GuiConsoleVariableCtrl(TerrainPolys) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 88"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$OpenGL::triCount1"; }; new GuiConsoleVariableCtrl(TotalPolys) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 226"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$OpenGL::triCount"; }; new GuiConsoleVariableCtrl(WaterPolys) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 179"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$Water::triCount"; }; }; }; //--- OBJECT WRITE END --- function toggleMouse() { if(Canvas.isCursorOn()) CursorOff(); else CursorOn(); } function interiorDebug(%val) { if ( !%val ) Canvas.pushDialog( interiorDebugDialog ); } function InteriorPreviewGui::onWake(%this) { GlobalActionMap.bindcmd( keyboard, "tab", "", "toggleMouse();" ); GlobalActionMap.bindcmd( keyboard, "f9", "", "interiorDebug();" ); GlobalActionMap.bindcmd( keyboard, escape, "", "quit();" ); if ( isObject( previewMap ) ) { previewMap.pop(); previewMap.delete(); } new ActionMap( previewMap ); previewMap.bind( keyboard, w, moveforward ); previewMap.bind( keyboard, s, movebackward ); previewMap.bind( keyboard, a, moveleft ); previewMap.bind( keyboard, d, moveright ); previewMap.bind( keyboard, e, moveup ); previewMap.bind( keyboard, c, movedown ); previewMap.bindCmd( keyboard, k, "cycleDebugRenderMode();", "" ); previewMap.copyBind( moveMap, yaw ); previewMap.copyBind( moveMap, pitch ); previewMap.push(); } function InteriorPreviewGui::onSleep(%this) { previewMap.pop(); previewMap.delete(); GlobalActionMap.unbind(keyboard, "tab"); GlobalActionMap.unbind(keyboard, "f9"); lockMouse(false); } PK !(%WT6gui/JoinChatDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(JoinChatDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl(JoinChatPane) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 60"; extent = "400 360"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHOOSE CHAT CHANNEL"; maxLength = "255"; noTitleBar = "0"; new ShellFancyArrayScrollCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "48 39"; extent = "304 227"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fixedHorizontal = "1"; vertSpacerBitmap = "gui/shll_vertspacer"; horzSpacerBitmap = "gui/shll_horzspacer"; new VirtualScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 16"; extent = "304 211"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "0"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 0"; new VirtualScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "280 203"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "288 9616"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; }; }; }; new ShellFancyTextList(JoinChatList) { profile = "ShellServerBrowserProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "284 223"; minExtent = "8 20"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; altCommand = "JoinChatDlg.join();"; helpTag = "0"; startScrollRegion = "0 0"; headerBitmap = "gui/server_tabs"; sortArrowBitmap = "gui/shll_sortarrow"; fieldBase = "gui/shll_field"; barBase = "gui/shll_bar"; glowOffset = "4"; rowHeight = "19"; headerFontSize = "0"; headerFontColor = "8 19 6 255"; headerFontColorHL = "25 68 56 255"; separatorColor = "192 192 192 255"; drawSeparators = "0"; headerSort = "1"; allowReposition = "0"; noSelect = "0"; allowColorChars = "0"; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "48 305"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.popDialog(JoinChatDlg); LaunchTabView.viewTab(\"CHAT\",ChatGui,0);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "center"; vertSizing = "top"; position = "67 269"; extent = "272 36"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellTextEditCtrl(JoinChatName) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "48 0"; extent = "223 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "JoinChatName.onCharInput();"; altCommand = "JoinChatDlg.join();"; helpTag = "0"; maxLength = "24"; historySize = "0"; password = "0"; tabComplete = "0"; deniedSound = "InputDeniedSound"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 8"; extent = "44 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Channel:"; maxLength = "255"; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "228 305"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "JoinChatDlg.join();"; helpTag = "0"; text = "JOIN CHAT"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(C**gui/JoystickConfigDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(JoystickConfigDlg) { profile = "DlgBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; pane = "0"; new ShellPaneCtrl(JoystickConfigFrame) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "95 50"; extent = "450 380"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CONFIGURE JOYSTICK"; maxLength = "255"; noTitleBar = "0"; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "top"; position = "155 325"; extent = "140 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.popDialog(JoystickConfigDlg);"; helpTag = "0"; text = "DONE"; simpleStyle = "0"; }; new ShellTabFrame() { profile = "ShellTabFrameProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "129 37"; extent = "254 283"; minExtent = "254 26"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; isVertical = "1"; useCloseButton = "0"; edgeInset = "0"; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "140 47"; extent = "278 263"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 48"; extent = "60 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Action:"; maxLength = "255"; }; new ShellPopupMenu(JoyAxisActionMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "63 39"; extent = "200 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 80"; extent = "57 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Sensitivity:"; maxLength = "255"; }; new GuiTextCtrl(JoySensText) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "109 80"; extent = "28 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "(0.5)"; maxLength = "255"; }; new ShellSliderCtrl(JoyAxisSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "57 95"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "JoySensText.update();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0.5"; usePlusMinus = "1"; }; new ShellToggleButton(InvertJoyAxisTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "75 167"; extent = "127 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INVERT"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 120"; extent = "57 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Dead Zone:"; maxLength = "255"; }; new GuiTextCtrl(DeadZoneText) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "109 120"; extent = "28 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "(0.5)"; maxLength = "255"; }; new ShellSliderCtrl(DeadZoneSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "57 135"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "DeadZoneText.update();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "100"; value = "0.5"; usePlusMinus = "1"; }; //new ShellToggleButton(JoyAxisRelativeTgl) { // profile = "ShellRadioProfile"; // horizSizing = "right"; // vertSizing = "bottom"; // position = "75 197"; // extent = "127 30"; // minExtent = "26 27"; // visible = "1"; // hideCursor = "0"; // bypassHideCursor = "0"; // helpTag = "0"; // text = "RELATIVE"; // maxLength = "255"; //}; }; }; }; //--- OBJECT WRITE END --- PK !(nOOgui/LaunchGui.gui//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(LaunchGui) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; variable = "$ShellBackground"; helpTag = "0"; useVariable = "1"; }; //--- OBJECT WRITE END --- PK !(Zgui/LaunchToolbarDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(LaunchToolbarDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; ctrlCount = "0"; new GuiControl(LaunchToolbarPane) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "top"; position = "-2 436"; extent = "644 44"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new ShellLaunchMenu(LaunchToolbarMenu) { profile = "LaunchMenuProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 0"; extent = "115 56"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "LAUNCH"; maxPopupHeight = "200"; buttonFontType = "Sui Generis"; buttonFontSize = "14"; }; new ShellTabGroupCtrl(LaunchTabView) { profile = "LaunchTabProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "120 11"; extent = "520 29"; minExtent = "38 29"; visible = "1"; helpTag = "0"; glowOffset = "0"; tabSpacing = "1"; maxTabWidth = "160"; stretchToFit = "0"; }; }; new ShellBitmapButton(LaunchToolbarCloseButton) { profile = "CloseButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "583 13"; extent = "33 26"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; command = "LaunchTabView.closeCurrentTab();"; text = ""; simpleStyle = "1"; }; }; //--- OBJECT WRITE END --- PK !(ݏegui/LoadingGui.gui//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(LoadingGui) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; variable = "$ShellBackground"; helpTag = "0"; useVariable = "1"; qLineCount = "0"; new ShellPaneCtrl() { profile = "ShellPaneProfile"; horizSizing = "width"; vertSizing = "height"; position = "28 13"; extent = "584 459"; minExtent = "48 92"; visible = "1"; helpTag = "0"; maxLength = "255"; noTitleBar = "1"; new GuiProgressCtrl(LoadingProgress) { profile = "ShellProgressBarProfile"; horizSizing = "right"; vertSizing = "top"; position = "81 410"; extent = "262 25"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiTextCtrl(LoadingProgressTxt) { profile = "ShellProgressBarTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 3"; extent = "262 19"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "LOADING MISSION"; maxLength = "255"; }; }; new GuiTextCtrl(LOAD_MapName) { profile = "ShellSubHeaderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 6"; extent = "90 32"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Map Name"; maxLength = "255"; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "bottom"; position = "26 34"; extent = "312 165"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(LOAD_MapText) { profile = "ShellLoadTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "312 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; }; }; new GuiTextCtrl(LOAD_MissionType) { profile = "ShellSubHeaderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 207"; extent = "115 32"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Mission Type"; maxLength = "255"; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "bottom"; position = "26 235"; extent = "312 165"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(LOAD_GameText) { profile = "ShellLoadTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "312 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; }; }; new GuiControl() { profile = "ShellLoadFrameProfile"; horizSizing = "relative"; vertSizing = "relative"; position = "349 8"; extent = "212 428"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiChunkedBitmapCtrl(LOAD_MapPic) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "1 1"; extent = "210 426"; minExtent = "8 8"; visible = "1"; helpTag = "0"; bitmap = "gui/loading.png"; useVariable = "0"; }; }; new ShellBitmapButton() { profile = "ShellButtonNoTabProfile"; horizSizing = "right"; vertSizing = "top"; position = "14 404"; extent = "70 38"; minExtent = "32 38"; visible = "1"; command = "Disconnect();"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(J%""gui/LobbyGui.gui//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(LobbyGui) { profile = "GuiContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; variable = "$ShellBackground"; helpTag = "0"; useVariable = "1"; new ShellPaneCtrl() { profile = "ShellPaneProfile"; horizSizing = "width"; vertSizing = "height"; position = "20 20"; extent = "600 440"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "LOBBY"; noTitleBar = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "relative"; vertSizing = "bottom"; position = "23 36"; extent = "276 140"; minExtent = "16 18"; visible = "1"; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "4 0"; extent = "268 27"; minExtent = "16 18"; visible = "1"; helpTag = "0"; new GuiTextCtrl(LobbyServerName) { profile = "ShellLargeLabelProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "3 2"; extent = "262 26"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = ""; }; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 28"; extent = "276 111"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "7 7"; extent = "262 97"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(LobbyStatusText) { profile = "ShellTextArrayProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "242 16"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; }; }; }; }; new ShellFancyArrayScrollCtrl() { profile = "ShellServerBrowserProfile"; horizSizing = "relative"; vertSizing = "height"; position = "23 175"; extent = "275 209"; minExtent = "24 72"; visible = "1"; helpTag = "0"; fixedHorizontal = "0"; vertSpacerBitmap = "gui/shll_vertspacer"; horzSpacerBitmap = "gui/shll_horzspacer"; new VirtualScrollCtrl() { profile = "ShellServerBrowserProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 16"; extent = "275 193"; minExtent = "8 52"; visible = "1"; helpTag = "0"; willFirstRespond = "0"; hScrollBar = "alwaysOn"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 0"; new VirtualScrollContentCtrl() { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "251 169"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "8 8"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; }; }; new ShellFancyTextList(LobbyPlayerList) { profile = "LobbyPlayerListProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "255 188"; minExtent = "8 20"; visible = "1"; helpTag = "0"; startScrollRegion = "3 0"; headerBitmap = "gui/server_tabs"; sortArrowBitmap = "gui/shll_sortarrow"; fieldBase = "gui/shll_field"; barBase = "gui/shll_bar"; glowOffset = "4"; rowHeight = "19"; headerFontType = "Univers Condensed"; headerFontSize = "16"; headerFontColor = "8 19 6 255"; headerFontColorHL = "25 68 56 255"; separatorColor = "192 192 192 255"; drawSeparators = "0"; headerSort = "1"; allowReposition = "0"; noSelect = "1"; }; }; new GuiControl() { profile = "NewScrollCtrlProfile"; horizSizing = "relative"; vertSizing = "bottom"; position = "298 32"; extent = "275 143"; minExtent = "24 52"; visible = "1"; helpTag = "0"; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "275 143"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 7"; extent = "261 129"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellTextList(LobbyVoteMenu) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 8"; minExtent = "8 8"; visible = "1"; altCommand = "lobbyVote();"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new ShellBitmapButton(LobbyCancelBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "178 1"; extent = "80 38"; minExtent = "32 38"; visible = "0"; command = "LobbyVoteMenu.reset();"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; }; new ShellScrollCtrl(LobbyMessageScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "relative"; vertSizing = "height"; position = "298 174"; extent = "275 178"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "7 7"; extent = "245 164"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMessageVectorCtrl(LobbyMessageVector) { profile = "GuiChatHudProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "245 12"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "0"; lineContinuedIndex = "10"; matchColor = "0 0 255 255"; maxColorIndex = 5; }; }; }; new ShellTextEditCtrl(LobbyChatEnter) { profile = "NewTextEditProfile"; horizSizing = "relative"; vertSizing = "top"; position = "293 350"; extent = "285 38"; minExtent = "32 38"; visible = "1"; altCommand = "LobbyChatEnter.send();"; escapeCommand = "LobbyChatEnter.onEscape();"; helpTag = "0"; historySize = "0"; maxLength = "120"; password = "0"; glowOffset = "9 9"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "195 385"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.pushDialog(OptionsDlg);"; helpTag = "0"; text = "SETTINGS"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "315 385"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "lobbyDisconnect();"; helpTag = "0"; text = "LEAVE GAME"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "435 385"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "lobbyReturnToGame();"; accelerator = "escape"; helpTag = "0"; text = "RETURN TO GAME"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !((־;;gui/LoginDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(LoginDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "72 143"; extent = "495 194"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "LOGIN"; maxLength = "255"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "37 47"; extent = "85 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Account Name:"; maxLength = "255"; }; new ShellTextEditCtrl(LoginEditBox) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "118 39"; extent = "180 38"; minExtent = "32 38"; visible = "1"; variable = "$LoginName"; altCommand = "LoginProcess();"; helpTag = "0"; maxLength = "16"; historySize = "0"; password = "0"; glowOffset = "9 9"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "37 77"; extent = "85 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Password:"; maxLength = "255"; }; new GuiLoginPasswordCtrl(LoginPasswordBox) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "118 69"; extent = "180 38"; minExtent = "32 38"; visible = "1"; variable = "$LoginPassword"; altCommand = "LoginProcess();"; helpTag = "0"; maxLength = "16"; historySize = "0"; password = "1"; glowOffset = "9 9"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "300 39"; extent = "147 38"; minExtent = "32 38"; visible = "1"; command = "LoginProcess(false);"; helpTag = "0"; text = "LOG IN"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "300 69"; extent = "147 38"; minExtent = "32 38"; visible = "1"; command = "CreateAccount();"; helpTag = "0"; text = "CREATE NEW ACCOUNT"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "300 99"; extent = "147 38"; minExtent = "32 38"; visible = "1"; command = "LoginProcess(true);"; helpTag = "0"; text = "EDIT ACCOUNT"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "300 129"; extent = "147 38"; minExtent = "32 38"; visible = "1"; command = "quit();"; accelerator = "escape"; helpTag = "0"; text = "QUIT"; simpleStyle = "0"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "122 104"; extent = "167 27"; minExtent = "26 27"; visible = "1"; variable = "$pref::RememberPassword"; helpTag = "0"; text = "REMEMBER PASSWORD"; maxLength = "255"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "118 129"; extent = "180 38"; minExtent = "32 38"; visible = "1"; command = "PasswordProcess(true);"; helpTag = "0"; text = "EMAIL ME MY PASSWORD"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !( ~~gui/LoginMessageBoxDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(LoginMessageBoxDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl(LoginMessageBoxFrame) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "170 137"; extent = "300 206"; minExtent = "48 92"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(LoginMessageBoxText) { profile = "ShellMediumTextProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "32 39"; extent = "236 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; }; new ShellBitmapButton(LoginMessageBoxButton) { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "70 140"; extent = "120 38"; minExtent = "32 38"; visible = "1"; command = "LoginMessageBoxButtonProcess();"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(ø:CCgui/MessageBoxDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(MessageBoxOKDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl(MBOKFrame) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "170 137"; extent = "300 206"; minExtent = "48 92"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(MBOKText) { profile = "ShellMediumTextProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "32 39"; extent = "236 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; }; new ShellBitmapButton(MBOKButton) { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "90 151"; extent = "120 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(MessageBoxOKDlg);"; accelerator = "return"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- //--- OBJECT WRITE BEGIN --- new GuiControl(MessageBoxYesNoDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl(MBYesNoFrame) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "170 137"; extent = "300 206"; minExtent = "48 92"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(MBYesNoText) { profile = "ShellMediumTextProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "32 39"; extent = "236 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; }; new ShellBitmapButton(MBYesNoButtonYes) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 151"; extent = "120 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(MessageBoxYesNoDlg);"; accelerator = "enter"; helpTag = "0"; text = "YES"; simpleStyle = "0"; }; new ShellBitmapButton(MBYesNoButtonNo) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "154 151"; extent = "120 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(MessageBoxYesNoDlg);"; accelerator = "escape"; helpTag = "0"; text = "NO"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- //--- OBJECT WRITE BEGIN --- new GuiControl(MessageBoxOKCancelDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl(MBOKCancelFrame) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "170 137"; extent = "300 206"; minExtent = "48 92"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(MBOKCancelText) { profile = "ShellMediumTextProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "32 39"; extent = "236 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; }; new ShellBitmapButton(MBOKCancelButtonOK) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "154 151"; extent = "120 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(MessageBoxOKCancelDlg);"; accelerator = "return"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; new ShellBitmapButton(MBOKCancelButtonCancel) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 151"; extent = "120 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(MessageBoxOKCancelDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(gui/MessagePopupDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(MessagePopupDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl(MessagePopFrame) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "165 194"; extent = "310 108"; minExtent = "48 92"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(MessagePopText) { profile = "ShellMediumTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "32 40"; extent = "247 32"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; }; }; }; //--- OBJECT WRITE END --- PK !(˵gui/MouseConfigDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(MouseConfigDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "125 104"; extent = "390 271"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "CONFIGURE MOUSE"; noTitleBar = "0"; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "50 216"; extent = "120 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(MouseConfigDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "220 216"; extent = "120 38"; minExtent = "32 38"; visible = "1"; command = "MouseConfigDlg::onOK();"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 36"; extent = "94 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "X-Axis Sensitivity:"; }; new GuiTextCtrl(MouseXText) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "185 36"; extent = "28 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "(0.5)"; }; new ShellSliderCtrl(MouseXSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "96 51"; extent = "170 24"; minExtent = "12 24"; visible = "1"; variable = "value"; altCommand = "MouseXSlider.sync();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0.480769"; usePlusMinus = "1"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "247 73"; extent = "71 30"; minExtent = "26 27"; visible = "1"; variable = "$pref::Input::LinkMouseSensitivity"; helpTag = "0"; text = "LINK"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 85"; extent = "93 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Y-Axis Sensitivity:"; }; new GuiTextCtrl(MouseYText) { profile = "ShellAltTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "184 85"; extent = "28 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "(0.5)"; }; new ShellSliderCtrl(MouseYSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "96 100"; extent = "170 24"; minExtent = "12 24"; visible = "1"; variable = "value"; altCommand = "MouseYSlider.sync();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0.480769"; usePlusMinus = "1"; }; new ShellToggleButton(InvertMouseTgl) { profile = "ShellRadioProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "125 138"; extent = "140 30"; minExtent = "26 27"; visible = "1"; helpTag = "0"; text = "INVERT Y-AXIS"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 183"; extent = "100 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Mouse Wheel:"; }; new ShellPopupMenu(MouseZActionMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "144 174"; extent = "180 36"; minExtent = "49 36"; visible = "1"; helpTag = "0"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(,pgui/MoveThreadDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(MoveThreadDlg) { profile = "DlgBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl(MoveThreadDlgPane) { profile = "ShellPaneProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 155"; extent = "277 125"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "MOVE THREAD"; maxLength = "255"; noTitleBar = "0"; new ShellPopupMenu(MoveToForumList) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "17 43"; extent = "247 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "27 35"; extent = "225 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select New Forum:"; maxLength = "255"; }; new ShellBitmapButton(mtdOKbtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "201 72"; extent = "65 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "TopicsPopupMenu.ExecuteMove();"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; new ShellBitmapButton(mtdCancelbtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "142 72"; extent = "75 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.PopDIalog(\"MoveThreadDlg\");"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(V55gui/NewMissionGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(NewMissionGui) { profile = "GuiDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 83"; extent = "228 276"; minExtent = "100 100"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "CREATE NEW MISSION"; resizeWidth = "False"; resizeHeight = "False"; canMove = "True"; canClose = "True"; canMinimize = "False"; canMaximize = "False"; minSize = "50 50"; closeCommand = "Canvas.popDialog(NewMissionGui);"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 30"; extent = "68 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Mission Name:"; }; new GuiTextEditCtrl(MissionNameEdit) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "82 30"; extent = "120 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; historySize = "0"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "27 239"; extent = "80 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "CreateMission();Canvas.popDialog(NewMissionGui);"; helpTag = "0"; text = "OK"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "121 239"; extent = "80 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.popDialog(NewMissionGui);"; helpTag = "0"; text = "CANCEL"; }; new GuiControl() { profile = "GuiScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "15 110"; extent = "198 114"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 40"; extent = "145 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "MISSION TYPE OPTIONS HERE"; }; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "15 55"; extent = "64 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Base Terrain:"; }; new GuiPopUpMenuCtrl(TerrainFileMenu) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "82 55"; extent = "120 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; maxPopupHeight = "200"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "27 88"; extent = "26 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Type:"; }; new GuiPopUpMenuCtrl(MissionTypeMenu) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "59 86"; extent = "120 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; maxPopupHeight = "200"; }; }; }; //--- OBJECT WRITE END --- function CreateMission() { if($MissionRunning) return; %missionName = MissionNameEdit.getValue() @ ".mis"; if(%missionName $= "") return; echo("--- Creating mission: " @ %missionName); // do the terrain %terrainName = MissionNameEdit.getValue() @ ".ter"; %baseTerrain = TerrainFileMenu.getValue() @ ".ter"; %graphName = MissionNameEdit.getValue() @ ".nav"; %obj = new TerrainBlock(BaseTerrain) { position = "0 0 0 1"; rotation = "0 0 0 0"; scale = "1 1 1"; terrainFile = %baseTerrain; squareSize = "8"; visibleDistance = "1200"; hazeDistance = "250"; emptySquares = "250"; }; if(%obj == -1) { echo("!!! Failed to create base terrain: " @ %baseTerrain); return; } BaseTerrain.save(%terrainName); BaseTerrain.delete(); rebuildModPaths(); // create a mission... new SimGroup(MissionGroup) { new MissionArea(MissionArea) { area = "512 512 1024 1024"; }; new Sun() { position = "0 0 0 1"; rotation = "0 0 0 0"; scale = "1 1 1"; direction = "0.5 0.5 -0.5"; ambient = "0.2 0.2 0.2 1.0"; color = "0.6 0.6 0.6 1.0"; }; new TerrainBlock(Terrain) { position = "0 0 0 1"; rotation = "0 0 0 0"; scale = "1 1 1"; terrainFile = %terrainName; squareSize = "8"; visibleDistance = "1200"; hazeDistance = "250"; emptySquares = "250"; }; new NavigationGraph(NavGraph) { position = "0 0 0 1"; rotation = "0 0 0 0"; scale = "1 1 1"; GraphFile = %graphName; }; }; MissionGroup.save("missions/" @ %missionName); MissionGroup.delete(); // create a server and connect setNetPort($Host::Port); $ServerName = $Host::GameName; CreateServer(%missionName); localConnect(); Canvas.setContent(PlayGui); } function NewMissionGui::onWake(%this) { // $NewMissionName = "NewMission"; MissionNameEdit.setValue("NewMission"); // fill the terrain list... TerrainFileMenu.clear(); %spec = "terrains/*.ter"; %count = 0; for(%file = findFirstFile(%spec); %file !$= ""; %file = findNextFile(%spec)) { TerrainFileMenu.add(fileBase(%file), %count); %count++; } TerrainFileMenu.setSelected(0); // fill the mission types.. bunk for now MissionTypeMenu.clear(); MissionTypeMenu.add("Capture the Flag", 0); MissionTypeMenu.add("Defend and Destroy", 1); MissionTypeMenu.add("Find and Retrieve", 2); MissionTypeMenu.add("Death Match", 3); MissionTypeMenu.add("Rabbit", 4); MissionTypeMenu.add("Football", 5); MissionTypeMenu.add("Flag Hunters", 6); MissionTypeMenu.setSelected(0); } PK !(}gui/NewWarriorDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(NewWarriorDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "155 167"; extent = "330 145"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "NEW WARRIOR"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 52"; extent = "81 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Name:"; }; new ShellTextEditCtrl(NW_NameEdit) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "97 44"; extent = "180 38"; minExtent = "32 38"; visible = "1"; command = "NW_NameEdit.checkValidPlayerName();"; altCommand = "NW_NameEdit.processEnter();"; helpTag = "0"; historySize = "0"; maxLength = "16"; password = "0"; glowOffset = "9 9"; }; new ShellBitmapButton(NW_DoneBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "182 90"; extent = "108 38"; minExtent = "32 38"; visible = "1"; command = "NewWarriorDlg.createPlayer();"; helpTag = "0"; text = "DONE"; simpleStyle = "0"; }; new ShellBitmapButton(NW_CancelBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 90"; extent = "108 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(NewWarriorDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(H?gui/OptionsDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(OptionsDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; pane = "VIDEO"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "20 30"; extent = "600 420"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "SETTINGS"; longTextBuffer = "0"; maxLength = "255"; noTitleBar = "0"; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "34 362"; extent = "82 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.popDialog(OptionsDlg);"; helpTag = "0"; text = "DONE"; simpleStyle = "0"; }; new ShellTabButton(OP_VideoTab) { profile = "ShellTabProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "19 46"; extent = "108 38"; minExtent = "48 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "OptionsDlg.setPane(Video);"; helpTag = "0"; text = "VIDEO"; longTextBuffer = "0"; maxLength = "255"; simpleStyle = "0"; }; new ShellTabButton(OP_GraphicsTab) { profile = "ShellTabProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "19 76"; extent = "108 38"; minExtent = "48 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "OptionsDlg.setPane(Graphics);"; helpTag = "0"; text = "GRAPHICS"; longTextBuffer = "0"; maxLength = "255"; simpleStyle = "0"; }; new ShellTabButton(OP_TexturesTab) { profile = "ShellTabProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "19 106"; extent = "108 38"; minExtent = "48 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "OptionsDlg.setPane(Textures);"; helpTag = "0"; text = "TEXTURES"; longTextBuffer = "0"; maxLength = "255"; simpleStyle = "0"; }; new ShellTabButton(OP_SoundTab) { profile = "ShellTabProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "19 136"; extent = "108 38"; minExtent = "48 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "OptionsDlg.setPane(Sound);"; helpTag = "0"; text = "SOUND"; longTextBuffer = "0"; maxLength = "255"; simpleStyle = "0"; }; new ShellTabButton(OP_VoiceTab) { profile = "ShellTabProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "19 166"; extent = "108 38"; minExtent = "48 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "OptionsDlg.setPane(Voice);"; helpTag = "0"; text = "VOICE"; longTextBuffer = "0"; maxLength = "255"; simpleStyle = "0"; }; new ShellTabButton(OP_ControlsTab) { profile = "ShellTabProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "19 196"; extent = "108 38"; minExtent = "48 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "OptionsDlg.setPane(Controls);"; helpTag = "0"; text = "CONTROLS"; longTextBuffer = "0"; maxLength = "255"; simpleStyle = "0"; }; new ShellTabButton(OP_NetworkTab) { profile = "ShellTabProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "19 226"; extent = "108 38"; minExtent = "48 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "OptionsDlg.setPane(Network);"; helpTag = "0"; text = "NETWORK"; longTextBuffer = "0"; maxLength = "255"; simpleStyle = "0"; }; new ShellTabButton(OP_GameTab) { profile = "ShellTabProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "19 256"; extent = "108 38"; minExtent = "48 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "OptionsDlg.setPane(Game);"; helpTag = "0"; text = "GAME"; longTextBuffer = "0"; maxLength = "255"; simpleStyle = "0"; }; new ShellTabFrame() { profile = "ShellTabFrameProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "127 31"; extent = "254 368"; minExtent = "254 26"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; isVertical = "1"; useCloseButton = "0"; edgeInset = "0"; }; new ShellFieldCtrl(OP_VideoPane) { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 42"; extent = "437 346"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 16"; extent = "100 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Video Driver:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_VideoDriverMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "99 7"; extent = "140 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Driver"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 54"; extent = "100 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Resolution:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_ResMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "99 45"; extent = "140 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Resolution"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 92"; extent = "100 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Bit Depth:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_BPPMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "99 83"; extent = "140 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Default"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new ShellToggleButton(OP_FullScreenTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "102 125"; extent = "127 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "FULL SCREEN"; longTextBuffer = "0"; maxLength = "255"; }; new ShellBitmapButton(OP_ApplyBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "275 176"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "OptionsDlg.applyGraphicChanges();"; helpTag = "0"; text = "APPLY CHANGES"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "275 8"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.pushDialog(DriverInfoDlg);"; helpTag = "0"; text = "DRIVER INFO"; simpleStyle = "0"; }; new ShellToggleButton(OP_VSyncTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "133 243"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DISABLE VERTICAL SYNC"; longTextBuffer = "0"; maxLength = "255"; }; }; new ShellFieldCtrl(OP_GraphicsPane) { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 42"; extent = "437 346"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 6"; extent = "97 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Gamma Correction:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_GammaSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 21"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "updateGammaCorrection();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0.385965"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 6"; extent = "72 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Terrain Detail:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_TerrainSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "36 21"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; command = "updateTerrainDetail();"; helpTag = "0"; range = "0.000000 25.000000"; ticks = "26"; value = "23"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 44"; extent = "67 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Shape Detail:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_ShapeSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 59"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "19"; value = "1"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "27 44"; extent = "77 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Shadow Detail:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_ShadowSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "37 59"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0.596491"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "27 82"; extent = "72 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Interior Detail:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_InteriorDetailSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "37 97"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.300000 1.000000"; ticks = "1000"; value = "0.950877"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 82"; extent = "85 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Visible Distance:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_VisibleDistanceSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 97"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.600000 1.000000"; ticks = "400"; value = "1"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "27 120"; extent = "84 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Particle Density:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_ParticleDensitySlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "37 135"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 3.000000"; ticks = "1000"; value = "3"; usePlusMinus = "1"; }; new GuiTextCtrl(OP_DynamicLightText) { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 120"; extent = "160 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Dynamic Light Visible Distance:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(OP_DynamicLightText_Disabled) { profile = "DisabledTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 120"; extent = "160 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Dynamic Light Visible Distance:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_DynamicLightSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 135"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 100.000000"; ticks = "100"; value = "92.1053"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 168"; extent = "70 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Sky Detail:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_SkyDetailMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "146 159"; extent = "200 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Default"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "35 198"; extent = "114 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "First Person Draw:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_PlayerRenderMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "146 189"; extent = "200 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Default"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 226"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::precipitationOn"; helpTag = "0"; text = "PRECIPITATION"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 226"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Interior::DynamicLights"; command = "updateDynamicLightSliderState();"; helpTag = "0"; text = "DYNAMIC INTERIOR LIGHTS"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 256"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::decalsOn"; helpTag = "0"; text = "DECALS"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 256"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Terrain::dynamicLights"; command = "updateDynamicLightSliderState();"; helpTag = "0"; text = "DYNAMIC TERRAIN LIGHTS"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 286"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Terrain::enableDetails"; helpTag = "0"; text = "TERRAIN DETAILS"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(OP_IntTexturedFogTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 286"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INTERIOR TEXTURED FOG"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 316"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::useOldShieldEffect"; helpTag = "0"; text = "HI-RES SHIELD EFFECTS"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(OP_VertexLightTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 316"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "VERTEX LIGHTING"; longTextBuffer = "0"; maxLength = "255"; }; }; new ShellFieldCtrl(OP_TexturesPane) { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 42"; extent = "437 346"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "37 16"; extent = "100 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Texture Quality:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_TexQualityMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "134 7"; extent = "140 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Default"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 85"; extent = "114 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Terrain Texture Detail:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_TerrainTexSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "36 100"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 6.000000"; ticks = "7"; value = "5"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 85"; extent = "109 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Shape Texture Detail:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_ShapeTexSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 100"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "6"; value = "1"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 123"; extent = "119 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Building Texture Detail:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_BuildingTexSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "36 138"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "6"; value = "0.8"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 123"; extent = "97 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Sky Texture Detail:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_SkyTexSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 138"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "6"; value = "0.8"; usePlusMinus = "1"; }; new GuiTextCtrl(OP_CompressLabel) { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "17 46"; extent = "120 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Texture Compression:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(OP_CompressLabel_Disabled) { profile = "DisabledTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 46"; extent = "135 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Texture Compression:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_CompressMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "134 37"; extent = "140 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "None"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl(OP_AnisotropyLabel) { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 179"; extent = "58 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Anisotropy:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(OP_AnisotropyLabel_Disabled) { profile = "DisabledTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 179"; extent = "58 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Anisotropy:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_AnisotropySlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "37 194"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0"; usePlusMinus = "1"; }; new ShellToggleButton(OP_EnvMapTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 180"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::environmentMaps"; helpTag = "0"; text = "ENVIRONMENT MAPS"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(OP_IntEnvMapTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 210"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Interior::ShowEnvironmentMaps"; helpTag = "0"; text = "INTERIOR ENV. MAPS"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(OP_HiResSkinTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 250"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "HI-RES PLAYER SKINS"; longTextBuffer = "0"; maxLength = "255"; }; }; new ShellFieldCtrl(OP_SoundPane) { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 42"; extent = "437 346"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 16"; extent = "72 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "3D Provider:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_AudioProviderMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 7"; extent = "268 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Provider"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new ShellBitmapButton(OP_AudioResetProvider) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "339 7"; extent = "79 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "RESET"; simpleStyle = "0"; }; new ShellToggleButton(OP_AudioEnvironmentTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "249 42"; extent = "160 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Audio::environmentEnabled"; helpTag = "0"; text = "ENVIRONMENT ENABLED"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 46"; extent = "72 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Speakers:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_AudioSpeakerMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 37"; extent = "169 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Speaker"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 97"; extent = "72 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Frequency:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_AudioFrequencyMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "80 88"; extent = "169 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Frequency"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 127"; extent = "72 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Bit Rate:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_AudioBitRateMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "80 118"; extent = "100 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Bit Rate"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "221 127"; extent = "60 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Channels:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_AudioChannelsMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "278 118"; extent = "100 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select # Channels"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 177"; extent = "79 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Master Volume:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_MasterVolumeSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "36 192"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "updateMasterVolume();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0.894737"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 177"; extent = "79 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Effects Volume:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_EffectsVolumeSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 192"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0.938596"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 215"; extent = "60 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Gui Volume:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_GuiVolumeSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "36 230"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "updateGuiVolume();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0.692982"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 215"; extent = "97 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Voice Bind Volume:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_VoiceBindVolumeSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 230"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0.824561"; usePlusMinus = "1"; }; new ShellToggleButton(OP_MusicTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 266"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Audio::musicEnabled"; helpTag = "0"; text = "MP3 MUSIC"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(OP_MusicVolumeLabel) { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 257"; extent = "74 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Music Volume:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(OP_MusicVolumeLabel_Disabled) { profile = "DisabledTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 253"; extent = "74 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Music Volume:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_MusicVolumeSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 268"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "updateMusicVolume();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "0.859649"; usePlusMinus = "1"; }; }; new ShellFieldCtrl(OP_VoicePane) { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 42"; extent = "437 346"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellToggleButton(OP_MicrophoneEnabledTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 13"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Audio::enableVoiceCapture"; helpTag = "0"; text = "MICROPHONE ENABLED"; longTextBuffer = "0"; maxLength = "255"; }; new ShellBitmapButton(OP_RecordTestBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "232 8"; extent = "173 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "alxCaptureStart(true);"; helpTag = "0"; text = "TEST RECORD"; simpleStyle = "0"; }; new GuiTextCtrl(OP_MicVolumeLabel) { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "28 43"; extent = "102 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Microphone Volume:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(OP_MicVolumeLabel_Disabled) { profile = "DisabledTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "28 43"; extent = "102 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Microphone Volume:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_MicrophoneVolumeSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "38 58"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "1000"; value = "1"; usePlusMinus = "1"; }; new GuiTextCtrl(OP_InputBoostLabel) { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 43"; extent = "123 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Microphone Input Boost:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(OP_InputBoostLabel_Disabled) { profile = "DisabledTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 43"; extent = "123 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Microphone Input Boost:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(OP_InputBoostPercentTxt) { profile = "ShellTextCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "271 61"; extent = "110 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "100%"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_InputBoostSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 58"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; altCommand = "updateInputBoost();"; helpTag = "0"; range = "1.000000 5.000000"; ticks = "5000"; value = "3.70175"; usePlusMinus = "1"; }; new GuiTextCtrl(OP_VoiceListenLabel) { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 96"; extent = "140 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Voice Listen Codec(s):"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_VoiceListenMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "183 87"; extent = "129 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Quality"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl(OP_VoiceSendLabel) { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 126"; extent = "140 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Voice Send Codec:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_VoiceSendMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "183 117"; extent = "129 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Quality"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl(OP_VoiceListenLabel_Disabled) { profile = "DisabledTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 96"; extent = "140 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Voice Listen Quality:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(OP_VoiceSendLabel_Disabled) { profile = "DisabledTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 126"; extent = "140 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Voice Send Quality:"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(OP_VoiceCodecInfo) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "25 159"; extent = "395 140"; minExtent = "8 140"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new ShellFieldCtrl(OP_ControlsPane) { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 42"; extent = "437 346"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; group = "Main"; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "height"; position = "2 31"; extent = "290 283"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 2"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 6"; extent = "266 271"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellTextList(OP_RemapList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "266 8"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; altCommand = "OP_RemapList.doRemap();"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "2 150"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "292 8"; extent = "140 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "restoreDefaultMappings();"; helpTag = "0"; text = "RESTORE DEFAULTS"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "292 38"; extent = "140 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "ShellGetLoadFilename( \"LOAD CONTROL CONFIG\", \"prefs/*.cs\", \"isMapFile\", \"loadMapFile\" );"; helpTag = "0"; text = "LOAD"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "292 68"; extent = "140 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "ShellGetSaveFilename( \"SAVE CONTROL CONFIG\", \"prefs/*.cs\", \"isMapFile\", \"saveMapFile\", $pref::Input::ActiveConfig );"; helpTag = "0"; text = "SAVE AS"; simpleStyle = "0"; }; new ShellToggleButton(OP_MouseTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "296 116"; extent = "126 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Input::MouseEnabled"; helpTag = "0"; text = "DINPUT MOUSE"; longTextBuffer = "0"; maxLength = "255"; }; new ShellBitmapButton(OP_ConfigureMouseBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "292 146"; extent = "140 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.pushDialog(MouseConfigDlg);"; helpTag = "0"; text = "CONFIGURE MOUSE"; simpleStyle = "0"; }; new ShellToggleButton(OP_JoystickTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "296 194"; extent = "126 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENABLE JOYSTICK"; longTextBuffer = "0"; maxLength = "255"; }; new ShellBitmapButton(OP_ConfigureJoystickBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "292 224"; extent = "140 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.pushDialog(JoystickConfigDlg);"; helpTag = "0"; text = "CONFIGURE JOYSTICK"; simpleStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "top"; position = "32 317"; extent = "124 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Toggle Console Key:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "top"; position = "161 316"; extent = "128 23"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiButtonCtrl(OP_ConsoleKeyBtn) { profile = "ShellActiveTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "3 3"; extent = "122 17"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "OP_ConsoleKeyBtn.doRemap();"; helpTag = "0"; text = "grave"; }; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 9"; extent = "100 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Control Group:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_ControlGroupMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "118 0"; extent = "180 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Control Group"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; }; new ShellFieldCtrl(OP_NetworkPane) { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 42"; extent = "437 346"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 16"; extent = "60 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Presets:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_NetworkPresetsMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "73 8"; extent = "151 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Preset"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; updateSettings = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 52"; extent = "65 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Packet Rate:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_PacketRateSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "36 67"; extent = "170 24"; minExtent = "12 24"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "2.000000 32.000000"; ticks = "31"; value = "32"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 52"; extent = "62 22"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Packet Size:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_PacketSizeSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "241 67"; extent = "170 24"; minExtent = "12 24"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "100.000000 450.000000"; ticks = "36"; value = "450"; usePlusMinus = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 47"; extent = "99 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Client Update Rate:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_UpdateRateSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "36 62"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; command = "updateNetworkSettings();"; helpTag = "0"; range = "8.000000 32.000000"; ticks = "25"; value = "32"; usePlusMinus = "1"; }; new GuiTextCtrl(OP_MasterServerTxt) { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 222"; extent = "200 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Display on Master Server:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_MasterServerMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "208 214"; extent = "180 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Display Option"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "67 253"; extent = "144 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Server Location:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_RegionMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "208 244"; extent = "180 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Region"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new ShellToggleButton(OP_CheckEmailTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "123 283"; extent = "190 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Net::CheckEmail"; helpTag = "0"; text = "CHECK EMAIL WHILE PLAYING"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(OP_ChatDisconnectTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "123 311"; extent = "190 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Net::DisconnectChat"; helpTag = "0"; text = "DISCONNECT FROM CHAT"; longTextBuffer = "0"; maxLength = "255"; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "183 100"; extent = "227 103"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new HudNetDisplay(OP_NetworkDisplayHud) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 1"; extent = "223 101"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; historySize = "100"; updatePeriod = "50"; renderField[0] = "1"; renderField[1] = "1"; renderField[2] = "0"; renderField[3] = "1"; renderField[4] = "0"; renderField[5] = "1"; fieldColors[0] = "0 220 0 255"; fieldColors[1] = "220 0 0 255"; fieldColors[2] = "220 220 220 255"; fieldColors[3] = "120 120 120 255"; fieldColors[4] = "0 190 240 255"; fieldColors[5] = "0 120 170 255"; lowerBound[0] = "0"; lowerBound[1] = "0"; lowerBound[2] = "0"; lowerBound[3] = "0"; lowerBound[4] = "0"; lowerBound[5] = "0"; upperBound[0] = "500"; upperBound[1] = "100"; upperBound[2] = "32"; upperBound[3] = "4096"; upperBound[4] = "32"; upperBound[5] = "4096"; infoCallback = "1"; renderGraph = "1"; }; }; new ShellFieldCtrl(OP_NetworkDisplayTextFrame) { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "25 100"; extent = "149 103"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; }; }; new ShellFieldCtrl(OP_GamePane) { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 42"; extent = "437 346"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 8"; extent = "65 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Zoom Speed:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellSliderCtrl(OP_ZoomSpeedSlider) { profile = "ShellSliderProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "36 23"; extent = "170 24"; minExtent = "12 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "value"; helpTag = "0"; range = "0.000000 500.000000"; ticks = "501"; value = "500"; usePlusMinus = "1"; }; new ShellBitmapButton(OP_EditChatMenuBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "237 11"; extent = "173 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.popDialog( OptionsDlg ); Canvas.pushDialog(EditChatMenuGui);"; helpTag = "0"; text = "EDIT CHAT MENU"; simpleStyle = "0"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 64"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::toggleVehicleView"; helpTag = "0"; text = "3RD PERSON VEHICLE"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 64"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::SkipIntro"; helpTag = "0"; text = "SKIP INTRO"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 94"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Vehicle::InvertYAxis"; command = "toggleInvertYAxis();"; helpTag = "0"; text = "INVERT VEHICLE Y-AXIS"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton(OP_ForceFeedbackTgl) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 94"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$Pref::useImmersion"; command = "toggleImmersion();"; helpTag = "0"; text = "ENABLE FORCE FEEDBACK"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 124"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::Vehicle::pilotTeleport"; command = "toggleVehicleTeleportPref();"; helpTag = "0"; text = "TELEPORT TO VEHICLES"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 124"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::usePrefSkins"; helpTag = "0"; text = "SHOW PERSONAL SKINS"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 154"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::enableBadWordFilter"; helpTag = "0"; text = "ENABLE BAD WORD FILTER"; longTextBuffer = "0"; maxLength = "255"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "236 154"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::RenderOOBGrid"; helpTag = "0"; text = "SHOW OUT OF BOUNDS GRID"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(OP_LaunchScreenTxt) { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 233"; extent = "100 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Launch Screen:"; longTextBuffer = "0"; maxLength = "255"; }; new ShellPopupMenu(OP_LaunchScreenMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "176 224"; extent = "180 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Select Screen"; longTextBuffer = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new ShellToggleButton() { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "31 185"; extent = "170 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::ignoreTeamRepairMessages"; helpTag = "0"; text = "IGNORE REPAIR MESSAGES"; longTextBuffer = "0"; maxLength = "255"; }; }; }; }; //--- OBJECT WRITE END --- PK !( ==gui/PanoramaGui.gui//--- OBJECT WRITE BEGIN --- new GameTSCtrl(PanoramaGui) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; //--- OBJECT WRITE END --- PK !(;rrgui/PasswordDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(PasswordDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "147 142"; extent = "345 172"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "PASSWORD"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellMediumTextProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "54 42"; extent = "236 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "This server requires a password."; }; new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "78 68"; extent = "180 38"; minExtent = "32 38"; visible = "1"; variable = "$JoinGamePassword"; altCommand = "PasswordDlg.accept();"; helpTag = "0"; historySize = "0"; maxLength = "16"; password = "0"; glowOffset = "9 9"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "35 117"; extent = "120 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(PasswordDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "190 117"; extent = "120 38"; minExtent = "32 38"; visible = "1"; command = "PasswordDlg.accept();"; helpTag = "0"; text = "OK"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(-_6wwgui/PickTeamDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(PickTeamDlg) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; mouseOn = "1"; new ShellPaneCtrl(PickTeamFrame) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "220 115"; extent = "250 250"; minExtent = "48 92"; visible = "1"; helpTag = "0"; noTitleBar = "0"; new ShellBitmapButton("PickTeamAButton") { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "top"; position = "158 60"; extent = "120 60"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = ""; command = "clientCmdprocessPickTeam(1);"; }; new ShellBitmapButton("PickTeamBButton") { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "top"; position = "158 95"; extent = "120 60"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = ""; command = "clientCmdprocessPickTeam(2);"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "top"; position = "158 130"; extent = "120 60"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Observer"; command = "clientCmdprocessPickTeam(4);"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "top"; position = "158 165"; extent = "120 60"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Automatic"; command = "clientCmdprocessPickTeam(3);"; }; }; }; //--- OBJECT WRITE END --- PK !(hEqHqHgui/PlayGui.gui//--- OBJECT WRITE BEGIN --- new GameTSCtrl(PlayGui) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "1"; bypassHideCursor = "0"; helpTag = "0"; beaconBaseTextureName = "gui/beacon_base"; beaconTargetTextureName = "gui/crosshairs"; beaconTargetPeriod = "4000"; beaconsVisible = "1"; enemyBeaconLineBeginColor = "0.000000 1.000000 0.000000 0.200000"; enemyBeaconLineEndColor = "0.000000 1.000000 0.000000 0.800000"; vehicleBeaconLineBeginColor = "1.000000 0.000000 0.000000 0.200000"; vehicleBeaconLineEndColor = "1.000000 0.000000 0.000000 0.800000"; friendBeaconLineBeginColor = "1.000000 1.000000 0.000000 0.200000"; friendBeaconLineEndColor = "1.000000 1.000000 0.000000 0.800000"; beaconLineWidth = "2.5"; beaconTextYOffset = "14"; showAlternateTarget = "0"; frinedBeaconLineEndColor = "1 1 0 0.8"; new HudScoreCtrl(objectiveHud) { profile = "HudScoreProfile"; horizSizing = "right"; vertSizing = "top"; position = "8 437"; extent = "245 37"; minExtent = "16 37"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; verticalInset = "3 0"; horizontalInset = "2 2"; teamScore2 = "4967"; teamName1 = "4964"; flagLabel2 = "4969"; teamScore1 = "4966"; flagLocation2 = "4971"; flagLocation1 = "4970"; teamName2 = "4965"; flagLabel1 = "4968"; new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "65 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "75 3"; extent = "20 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 3"; extent = "30 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "FLAG"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "135 3"; extent = "105 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextObjHudLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "65 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "75 19"; extent = "20 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 19"; extent = "30 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "FLAG"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextObjHudLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "135 19"; extent = "105 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; }; new HudBitmapCtrl(hudClusterBack) { profile = "GuiButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "444 8"; extent = "188 81"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.9"; bitmap = "gui/hud_new_cog"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; new HudBitmapCtrl(hudCompassBack) { profile = "GuiButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "109 2"; extent = "77 77"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.9"; bitmap = "gui/hud_new_compass"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; }; new GuiControl(compassHud) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "107 2"; extent = "81 77"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; opacity = "1.0"; new HudCompass(compass) { profile = "clockProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "0 0"; extent = "81 77"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; textColor = "0 255 0 255"; }; }; new HudPulsingBitmap(sensorHudBack) { profile = "GuiButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "134 26"; extent = "27 29"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.9"; bitmap = "gui/hud_new_ping"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; color = "3 255 110 255"; pulse = "0"; pulseRate = "1000"; }; new HudPulsingBitmap(sensorHud) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "134 26"; extent = "27 29"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.9"; bitmap = "gui/hud_new_ping"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; color = "255 255 255 255"; pulse = "1"; pulseRate = "1000"; jam = "0"; pingColor = "255 22 22"; ping = "0"; jamColor = "253 255 2"; }; new HudEnergy(energyHud) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "8 23"; extent = "93 5"; minExtent = "93 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.353000 0.373000 0.933000 0.800000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.8"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; subRegion = "0 0 93 10"; displayMounted = "0"; pulseRate = "500"; pulseThreshold = "0.3"; verticalFill = "0"; value = "0"; }; new HudDamage(damageHud) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "8 5"; extent = "93 8"; minExtent = "93 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.000000 1.000000 0.000000 0.800000"; frameColor = "0.000000 1.000000 0.000000 0.000000"; opacity = "0.8"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; subRegion = "0 0 93 10"; displayMounted = "0"; pulseRate = "500"; pulseThreshold = "0.3"; verticalFill = "0"; value = "0"; }; new HudHeat(HeatHud) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "8 30"; extent = "93 3"; minExtent = "93 3"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "1.000000 0.000000 0.000000 0.800000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.8"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; subRegion = "0 0 100 10"; displayMounted = "0"; pulseRate = "500"; pulseThreshold = "0.3"; verticalFill = "0"; value = "0"; heatWarning = "0.6"; }; }; new HudClock(clockHUD) { profile = "clockProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "559 38"; extent = "65 23"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.9"; bitmap = "gui/hud_mistimer"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; subRegion = "0 2 65 15"; }; new ShellFieldCtrl(NetGraphHudFrame) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "266 8"; extent = "176 50"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new HudNetDisplay(NetGraphHud) { profile = "HudScoreProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "1 1"; extent = "174 48"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; historySize = "100"; updatePeriod = "50"; renderField[0] = "1"; renderField[1] = "1"; renderField[2] = "0"; renderField[3] = "1"; renderField[4] = "0"; renderField[5] = "1"; fieldColors[0] = "0 220 0 255"; fieldColors[1] = "220 0 0 255"; fieldColors[2] = "220 220 220 255"; fieldColors[3] = "120 120 120 255"; fieldColors[4] = "0 190 240 255"; fieldColors[5] = "0 120 170 255"; lowerBound[0] = "0"; lowerBound[1] = "0"; lowerBound[2] = "0"; lowerBound[3] = "0"; lowerBound[4] = "0"; lowerBound[5] = "0"; upperBound[0] = "500"; upperBound[1] = "100"; upperBound[2] = "32"; upperBound[3] = "4096"; upperBound[4] = "32"; upperBound[5] = "4096"; infoCallback = "0"; renderGraph = "1"; }; }; new GuiControl(NetBarHudFrame) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "290 0"; extent = "129 68"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new HudNetDisplay(NetBarHud) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "1 1"; extent = "174 48"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; historySize = "2"; updatePeriod = "50"; renderField[0] = "1"; renderField[1] = "1"; renderField[2] = "1"; renderField[3] = "1"; renderField[4] = "1"; renderField[5] = "1"; fieldColors[0] = "0 220 0 255"; fieldColors[1] = "220 0 0 255"; fieldColors[2] = "220 220 220 255"; fieldColors[3] = "120 120 120 255"; fieldColors[4] = "0 190 240 255"; fieldColors[5] = "0 120 170 255"; lowerBound[0] = "0"; lowerBound[1] = "0"; lowerBound[2] = "0"; lowerBound[3] = "0"; lowerBound[4] = "0"; lowerBound[5] = "0"; upperBound[0] = "500"; upperBound[1] = "100"; upperBound[2] = "32"; upperBound[3] = "4096"; upperBound[4] = "32"; upperBound[5] = "4096"; infoCallback = "1"; renderGraph = "0"; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 27"; extent = "120 18"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new HudBarBaseCtrl(NetBarHudSendBar) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "120 18"; minExtent = "120 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.000000 0.800000 0.000000 1.000000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.6"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; subRegion = "2 2 116 15"; displayMounted = "0"; pulseRate = "500"; pulseThreshold = "0.3"; verticalFill = "0"; value = "0.868807"; }; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 46"; extent = "120 18"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new HudBarBaseCtrl(NetBarHudReceiveBar) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "120 18"; minExtent = "120 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.000000 0.800000 0.000000 1.000000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.6"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; subRegion = "2 2 116 15"; displayMounted = "0"; pulseRate = "500"; pulseThreshold = "0.3"; verticalFill = "0"; value = "0.911488"; }; }; new GuiTextCtrl(NetBarHudPingText) { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 9"; extent = "35 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "0ms"; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(NetBarHudPacketLossText) { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "76 9"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "0%"; longTextBuffer = "0"; maxLength = "255"; }; }; new GuiControl(retCenterHud) { profile = "GuiDefaultProfile"; horizSizing = "center"; vertSizing = "center"; position = "192 112"; extent = "256 256"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; wrap = "0"; new HudCrosshair(reticleHud) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "112 112"; extent = "32 32"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.5"; bitmap = "gui/ret_blaster"; autoCenter = "1"; autoResize = "1"; flipVertical = "0"; flipHorizontal = "0"; }; new GuiTextCtrl(ammoHud) { profile = "GuiAmmoHudProfile"; horizSizing = "left"; vertSizing = "top"; position = "75 150"; extent = "80 20"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; new HudPulsingBitmap(deploySensor) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "90 90"; extent = "75 75"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.5"; bitmap = "gui/hud_ping"; autoCenter = "1"; autoResize = "1"; flipVertical = "0"; flipHorizontal = "0"; color = "0 0 0 0"; pulse = "0"; pulseRate = "1000"; }; new HudCrosshair(reticleFrameHud) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "96 96"; extent = "64 64"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.5"; bitmap = "gui/hud_retrng"; autoCenter = "1"; autoResize = "1"; flipVertical = "0"; flipHorizontal = "0"; }; }; new HudInventory(inventoryHud) { profile = "GuiHudCounterProfile"; horizSizing = "left"; vertSizing = "top"; position = "486 434"; extent = "116 38"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.9"; ammoOffset = "6 24"; backGroundOffset = "0 0"; highLightOffset = "0 0"; iconOffset = "1 1"; backGroundSpace = "2"; }; new GuiBitmapCtrl(backpackFrame) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "top"; position = "457 434"; extent = "27 38"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; bitmap = "gui/hud_new_panel"; wrap = "0"; new GuiBitmapCtrl(backpackIcon) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "top"; position = "0 3"; extent = "25 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; wrap = "0"; }; new GuiTextCtrl(backpackText) { profile = "GuiPackTextProfile"; horizSizing = "left"; vertSizing = "top"; position = "1 24"; extent = "25 16"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; longTextBuffer = "0"; maxLength = "255"; }; }; new HudWeapons(weaponsHud) { profile = "GuiHudCounterProfile"; horizSizing = "left"; vertSizing = "top"; position = "604 194"; extent = "32 160"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.9"; ammoOffset = "6 24"; backGroundOffset = "0 0"; highLightOffset = "0 0"; iconOffset = "1 1"; backGroundSpace = "2"; }; new HudNavDisplay(navHud) { profile = "GuiHudNavProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.5"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; renderXYProjection = "0"; renderEdgeMarkers = "1"; markerHitRadius = "2"; markerAngle = "30"; markerLen = "20"; defaultMarkerColor = "0 255 220 220"; acquireScreenRadius = "75"; playerEyeZOffset = "0.4"; damageRectSize = "50 12"; infoOffset = "24 24"; minProjectSize = "10"; acquireBoxCheckDistance = "50"; targetLockedFrameColor = "255 0 0 255"; damageFrameColor = "255 255 255 255"; minMarkerScale = "0.5"; markerScaleDistance = "1000"; markerImageNames[0] = "small_triangle"; markerImageNames[1] = "small_square"; markerImageNames[2] = "small_diamond"; markerImageNames[3] = "small_cross"; markerImageNames[4] = "small_circle"; markerTextEdgeOffset = "2"; renderMarkerText = "1"; protectedStatics = "0"; enemyBeaconColor = "0 255 0 255"; friendBeaconColor = "255 255 0 255"; vehicleBeaconColor = "0 255 0 255"; imageOffset = "2"; missileMarker1 = "gui/RET_missile_marker"; missileMarker2 = "gui/RET_missile_marker_red"; missileFlash1 = "gui/RET_missile_horizflash_red"; missileFlash2 = "gui/RET_missile_vertflash_red"; LOSMarkerUpdate = "250"; }; new GuiDashBoardCtrl(dashboardHud) { profile = "GuiDefaultProfile"; horizSizing = "center"; vertSizing = "top"; position = "0 360"; extent = "640 120"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; wrap = "0"; new HudVehicleWeapon(vWeaponsBox) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "180 25"; extent = "70 40"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "0.8"; ammoOffset = "10 30"; backGroundOffset = "5 4"; highLightOffset = "0 0"; iconOffset = "7 4"; backGroundSpace = "8"; }; }; new ShellFieldCtrl(voiceCommHud) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 92"; extent = "160 70"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(vcRecordingHud) { profile = "GuiRecordingHudProfile"; horizSizing = "center"; vertSizing = "top"; position = "0 0"; extent = "160 20"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Recording"; longTextBuffer = "0"; maxLength = "255"; }; }; new GuiTextCtrl(controlObjectText) { profile = "ShellBigTextProfile"; horizSizing = "center"; vertSizing = "top"; position = "130 440"; extent = "380 26"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Press \'\c2Escape\cr\' to return to game."; longTextBuffer = "0"; maxLength = "255"; }; new ShellFieldCtrl(centerPrintDlg) { profile = "GuiChatBackProfile"; horizSizing = "center"; vertSizing = "center"; position = "45 230"; extent = "550 20"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextCtrl(CenterPrintText) { profile = "CenterPrintTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "0 0"; extent = "546 18"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new ShellFieldCtrl(bottomPrintDlg) { profile = "GuiChatBackProfile"; horizSizing = "center"; vertSizing = "top"; position = "45 375"; extent = "550 56"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextCtrl(BottomPrintText) { profile = "CenterPrintTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "0 0"; extent = "546 36"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudZoom(ZoomHud) { profile = "ZoomHudProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "8 8"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; }; new ShellFieldCtrl(metricsMain) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "10 160"; extent = "242 275"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(title) { profile = "CenterPrintTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "63 7"; extent = "110 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Mapper Metrics"; longTextBuffer = "0"; maxLength = "255"; lineSpacing = "2"; maxChars = "-1"; allowColorChars = "0"; }; new GuiTextCtrl(ThreeSpacePolysText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 148"; extent = "85 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "TS Polys: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(InteriorPolysText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 118"; extent = "98 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Interior Polys: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(TerrainPolysText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 88"; extent = "99 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Terrain Polys: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(TotalPolysText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 226"; extent = "101 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Scene Polys: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(WaterPolysText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 178"; extent = "127 20"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Water Polys: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiTextCtrl(FrameRateText) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 40"; extent = "87 26"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Frame Rate: "; longTextBuffer = "0"; maxLength = "255"; }; new GuiConsoleVariableCtrl(frameRate) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 40"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$FPS::Real"; }; new GuiConsoleVariableCtrl(ThreeSpacePolys) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 148"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$OpenGL::triCount3"; }; new GuiConsoleVariableCtrl(InteriorPolys) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 118"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$OpenGL::triCount2"; }; new GuiConsoleVariableCtrl(TerrainPolys) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 88"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$OpenGL::triCount1"; }; new GuiConsoleVariableCtrl(TotalPolys) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 226"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$OpenGL::triCount"; }; new GuiConsoleVariableCtrl(WaterPolys) { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 179"; extent = "70 25"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; expression = "$Water::triCount"; }; }; new GuiControl(helpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(objHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 365"; extent = "140 65"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(objHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "66 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "OBJECTIVES"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(objHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(objHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "160 425"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(chatHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 85"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(chatHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "31 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHAT"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(chatHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(chatHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 75"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(energyHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "320 75"; extent = "145 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(energyHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "43 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENERGY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(energyHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(energyHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "450 35"; extent = "5 45"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(compassHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "480 90"; extent = "150 100"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(compassHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "55 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMPASS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(compassHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(compassHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "595 80"; extent = "5 25"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(damageHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 10"; extent = "150 50"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(damageHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DAMAGE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(damageHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(damageHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "425 15"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new GuiControl(reticleTextFrame) { profile = "GuiHelpTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(reticleHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "20 140"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(reticleHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "44 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "RETICLE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(reticleHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(reticleHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "155 145"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new ShellFieldCtrl(inventoryHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "420 340"; extent = "140 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(inventoryHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "62 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INVENTORY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(inventoryHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(inventoryHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "490 420"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(weaponsHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "460 240"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(weaponsHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "54 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "WEAPONS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(weaponsHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(weaponsHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "590 300"; extent = "20 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new GuiControl(helpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(objHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 365"; extent = "140 65"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(objHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "66 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "OBJECTIVES"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(objHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(objHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "160 425"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(chatHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 85"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(chatHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "31 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHAT"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(chatHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(chatHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 75"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(energyHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "320 75"; extent = "145 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(energyHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "43 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENERGY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(energyHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(energyHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "450 35"; extent = "5 45"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(compassHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "480 90"; extent = "150 100"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(compassHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "55 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMPASS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(compassHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(compassHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "595 80"; extent = "5 25"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(damageHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 10"; extent = "150 50"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(damageHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DAMAGE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(damageHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(damageHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "425 15"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new GuiControl(reticleTextFrame) { profile = "GuiHelpTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(reticleHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "20 140"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(reticleHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "44 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "RETICLE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(reticleHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(reticleHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "155 145"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new ShellFieldCtrl(inventoryHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "420 340"; extent = "140 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(inventoryHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "62 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INVENTORY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(inventoryHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(inventoryHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "490 420"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(weaponsHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "460 240"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(weaponsHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "54 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "WEAPONS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(weaponsHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(weaponsHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "590 300"; extent = "20 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new GuiControl(helpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(objHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 365"; extent = "140 65"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(objHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "66 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "OBJECTIVES"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(objHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(objHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "160 425"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(chatHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 85"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(chatHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "31 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHAT"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(chatHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(chatHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 75"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(energyHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "320 75"; extent = "145 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(energyHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "43 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENERGY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(energyHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(energyHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "450 35"; extent = "5 45"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(compassHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "480 90"; extent = "150 100"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(compassHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "55 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMPASS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(compassHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(compassHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "595 80"; extent = "5 25"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(damageHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 10"; extent = "150 50"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(damageHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DAMAGE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(damageHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(damageHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "425 15"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new GuiControl(reticleTextFrame) { profile = "GuiHelpTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(reticleHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "20 140"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(reticleHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "44 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "RETICLE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(reticleHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(reticleHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "155 145"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new ShellFieldCtrl(inventoryHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "420 340"; extent = "140 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(inventoryHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "62 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INVENTORY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(inventoryHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(inventoryHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "490 420"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(weaponsHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "460 240"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(weaponsHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "54 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "WEAPONS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(weaponsHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(weaponsHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "590 300"; extent = "20 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new GuiControl(helpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(objHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 365"; extent = "140 65"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(objHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "66 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "OBJECTIVES"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(objHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(objHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "160 425"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(chatHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 85"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(chatHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "31 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHAT"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(chatHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(chatHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 75"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(energyHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "320 75"; extent = "145 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(energyHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "43 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENERGY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(energyHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(energyHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "450 35"; extent = "5 45"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(compassHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "480 90"; extent = "150 100"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(compassHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "55 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMPASS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(compassHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(compassHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "595 80"; extent = "5 25"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(damageHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 10"; extent = "150 50"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(damageHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DAMAGE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(damageHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(damageHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "425 15"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new GuiControl(reticleTextFrame) { profile = "GuiHelpTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(reticleHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "20 140"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(reticleHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "44 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "RETICLE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(reticleHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(reticleHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "155 145"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new ShellFieldCtrl(inventoryHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "420 340"; extent = "140 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(inventoryHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "62 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INVENTORY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(inventoryHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(inventoryHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "490 420"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(weaponsHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "460 240"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(weaponsHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "54 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "WEAPONS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(weaponsHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(weaponsHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "590 300"; extent = "20 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new GuiControl(helpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(objHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 365"; extent = "140 65"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(objHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "66 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "OBJECTIVES"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(objHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(objHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "160 425"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(chatHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 85"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(chatHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "31 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHAT"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(chatHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(chatHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 75"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(energyHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "320 75"; extent = "145 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(energyHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "43 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENERGY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(energyHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(energyHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "450 35"; extent = "5 45"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(compassHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "480 90"; extent = "150 100"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(compassHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "55 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMPASS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(compassHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(compassHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "595 80"; extent = "5 25"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(damageHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 10"; extent = "150 50"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(damageHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DAMAGE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(damageHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(damageHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "425 15"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new GuiControl(reticleTextFrame) { profile = "GuiHelpTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(reticleHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "20 140"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(reticleHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "44 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "RETICLE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(reticleHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(reticleHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "155 145"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new ShellFieldCtrl(inventoryHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "420 340"; extent = "140 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(inventoryHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "62 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INVENTORY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(inventoryHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(inventoryHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "490 420"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(weaponsHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "460 240"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(weaponsHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "54 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "WEAPONS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(weaponsHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(weaponsHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "590 300"; extent = "20 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new GuiControl(helpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(objHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 365"; extent = "140 65"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(objHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "66 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "OBJECTIVES"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(objHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(objHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "160 425"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(chatHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 85"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(chatHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "31 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHAT"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(chatHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(chatHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 75"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(energyHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "320 75"; extent = "145 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(energyHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "43 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENERGY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(energyHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(energyHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "450 35"; extent = "5 45"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(compassHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "480 90"; extent = "150 100"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(compassHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "55 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMPASS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(compassHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(compassHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "595 80"; extent = "5 25"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(damageHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 10"; extent = "150 50"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(damageHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DAMAGE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(damageHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(damageHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "425 15"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new GuiControl(reticleTextFrame) { profile = "GuiHelpTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(reticleHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "20 140"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(reticleHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "44 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "RETICLE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(reticleHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(reticleHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "155 145"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new ShellFieldCtrl(inventoryHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "420 340"; extent = "140 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(inventoryHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "62 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INVENTORY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(inventoryHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(inventoryHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "490 420"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(weaponsHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "460 240"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(weaponsHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "54 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "WEAPONS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(weaponsHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(weaponsHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "590 300"; extent = "20 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new GuiControl(helpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(objHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 365"; extent = "140 65"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(objHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "66 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "OBJECTIVES"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(objHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(objHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "160 425"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(chatHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 85"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(chatHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "31 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHAT"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(chatHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(chatHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 75"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(energyHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "320 75"; extent = "145 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(energyHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "43 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENERGY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(energyHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(energyHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "450 35"; extent = "5 45"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(compassHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "480 90"; extent = "150 100"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(compassHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "55 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMPASS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(compassHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(compassHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "595 80"; extent = "5 25"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(damageHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 10"; extent = "150 50"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(damageHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DAMAGE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(damageHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(damageHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "425 15"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new GuiControl(reticleTextFrame) { profile = "GuiHelpTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(reticleHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "20 140"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(reticleHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "44 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "RETICLE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(reticleHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(reticleHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "155 145"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new ShellFieldCtrl(inventoryHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "420 340"; extent = "140 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(inventoryHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "62 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INVENTORY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(inventoryHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(inventoryHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "490 420"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(weaponsHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "460 240"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(weaponsHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "54 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "WEAPONS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(weaponsHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(weaponsHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "590 300"; extent = "20 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new GuiControl(helpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(objHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 365"; extent = "140 65"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(objHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "66 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "OBJECTIVES"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(objHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(objHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "160 425"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(chatHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 85"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(chatHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "31 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHAT"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(chatHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(chatHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 75"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(energyHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "320 75"; extent = "145 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(energyHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "43 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENERGY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(energyHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(energyHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "450 35"; extent = "5 45"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(compassHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "480 90"; extent = "150 100"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(compassHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "55 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMPASS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(compassHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(compassHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "595 80"; extent = "5 25"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(damageHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 10"; extent = "150 50"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(damageHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DAMAGE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(damageHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(damageHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "425 15"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new GuiControl(reticleTextFrame) { profile = "GuiHelpTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(reticleHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "20 140"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(reticleHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "44 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "RETICLE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(reticleHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(reticleHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "155 145"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new ShellFieldCtrl(inventoryHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "420 340"; extent = "140 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(inventoryHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "62 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INVENTORY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(inventoryHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(inventoryHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "490 420"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(weaponsHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "460 240"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(weaponsHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "54 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "WEAPONS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(weaponsHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(weaponsHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "590 300"; extent = "20 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new GuiControl(helpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(objHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 365"; extent = "140 65"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(objHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "66 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "OBJECTIVES"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(objHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(objHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "160 425"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(chatHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 85"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(chatHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "31 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "CHAT"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(chatHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(chatHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 75"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(energyHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "320 75"; extent = "145 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(energyHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "43 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "ENERGY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(energyHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(energyHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "450 35"; extent = "5 45"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(compassHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "480 90"; extent = "150 100"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(compassHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "55 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMPASS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(compassHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(compassHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "595 80"; extent = "5 25"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "1"; }; new ShellFieldCtrl(damageHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 10"; extent = "150 50"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(damageHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "48 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "DAMAGE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(damageHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(damageHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "425 15"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new GuiControl(reticleTextFrame) { profile = "GuiHelpTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(reticleHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "20 140"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; new GuiTextCtrl(reticleHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "44 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "RETICLE"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(reticleHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(reticleHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "155 145"; extent = "25 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new ShellFieldCtrl(inventoryHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "420 340"; extent = "140 85"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(inventoryHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "62 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "INVENTORY"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(inventoryHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(inventoryHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "490 420"; extent = "5 20"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; new ShellFieldCtrl(weaponsHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "460 240"; extent = "140 70"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiTextCtrl(weaponsHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "54 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "WEAPONS"; longTextBuffer = "0"; maxLength = "255"; }; new GuiMLTextCtrl(weaponsHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 16"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "1"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; new HudHelpTag(weaponsHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "590 300"; extent = "20 5"; minExtent = "5 5"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1"; flip = "0"; }; }; new ShellPaneCtrl(siegeHalftimeHud) { profile = "ShellPaneProfile"; horizSizing = "relative"; vertSizing = "height"; position = "296 4"; extent = "340 472"; minExtent = "48 92"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "HALFTIME"; longTextBuffer = "0"; maxLength = "255"; noTitleBar = "0"; new ShellFieldCtrl() { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "261 4"; extent = "54 18"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new HudClock(SiegeHalftimeClock) { profile = "SiegeHalftimeClockProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "-6 -3"; extent = "65 23"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fillColor = "0.250000 0.250000 0.250000 0.250000"; frameColor = "0.000000 1.000000 0.000000 1.000000"; opacity = "1.0"; bitmap = "gui/hud_mistimer.png"; autoCenter = "0"; autoResize = "0"; flipVertical = "0"; flipHorizontal = "0"; subRegion = "0 2 65 15"; }; }; new ShellFieldCtrl(SiegeHalftimeHeader) { profile = "GuiChatBackProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "21 32"; extent = "298 24"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; }; new GuiMLTextCtrl(SiegeHalftimeHeaderText) { profile = "DebriefHeadlineTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "25 35"; extent = "290 18"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "1"; maxChars = "255"; deniedSound = "InputDeniedSound"; }; new ShellScrollCtrl(SiegeHalftimeScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "18 130"; extent = "304 323"; minExtent = "24 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/hud_new_window"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "7 7"; extent = "290 309"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextCtrl(SiegeHalftimeText) { profile = "DebriefTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "274 18"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "1"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; }; }; }; //--- OBJECT WRITE END --- PK !(X$gui/RecordingsDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(RecordingsDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "60 61"; extent = "530 360"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "SELECT RECORDING"; longTextBuffer = "0"; maxLength = "255"; noTitleBar = "0"; new ShellFancyArrayScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "center"; vertSizing = "height"; position = "23 37"; extent = "484 266"; minExtent = "32 32"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fixedHorizontal = "1"; vertSpacerBitmap = "gui/shll_vertspacer"; horzSpacerBitmap = "gui/shll_horzspacer"; new ShellFancyTextList(RecordingsDlgList) { profile = "ShellServerBrowserProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "464 262"; minExtent = "8 20"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; startScrollRegion = "3 0"; headerBitmap = "gui/server_tabs"; sortArrowBitmap = "gui/shll_sortarrow"; fieldBase = "gui/shll_field"; barBase = "gui/shll_bar"; glowOffset = "4"; rowHeight = "19"; headerFontType = "Univers Condensed"; headerFontSize = "16"; headerFontColor = "8 19 6 255"; headerFontColorHL = "25 68 56 255"; separatorColor = "192 192 192 255"; drawSeparators = "0"; headerSort = "1"; allowReposition = "1"; noSelect = "0"; allowColorChars = "1"; altCommand = "startSelectedDemo();"; }; }; new ShellBitmapButton(PR_CancelBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "386 304"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "Canvas.popDialog(RecordingsDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton(PR_StartDemoBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "16 304"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "StartSelectedDemo();"; helpTag = "0"; text = "PLAY"; simpleStyle = "0"; }; new ShellBitmapButton(PR_DeleteDemoBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "134 304"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "DeleteSelectedDemo();"; helpTag = "0"; text = "DELETE"; simpleStyle = "0"; }; new ShellBitmapButton(PR_RenameDemoBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "252 304"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "RenameSelectedDemo();"; helpTag = "0"; text = "RENAME"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(S;66gui/RemapDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(RemapDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "1"; bypassHideCursor = "0"; helpTag = "0"; new ShellPaneCtrl(RemapFrame) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "71 172"; extent = "498 126"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "REMAP"; new GuiMLTextCtrl(RemapText) { profile = "ShellMediumTextProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "49 47"; extent = "400 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; lineSpacing = "2"; }; new GuiInputCtrl(RemapInputCtrl) { profile = "GuiInputCtrlProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "0 0"; extent = "64 64"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(ԽTTgui/ServerInfoDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(ServerInfoDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellWindowCtrl(SI_Window) { profile = "ShellWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 105"; extent = "350 270"; minExtent = "200 200"; visible = "1"; helpTag = "0"; text = "INFO"; frameBase = "gui/window"; borderWidth = "2"; resizeWidth = "1"; resizeHeight = "1"; canMove = "1"; canClose = "1"; closeCommand = "Canvas.popDialog(ServerInfoDlg);"; new GuiFrameSetCtrl(SI_Frame) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "7 32"; extent = "336 202"; minExtent = "8 8"; visible = "1"; helpTag = "0"; columns = "0"; rows = "0 130"; borderWidth = "4"; borderColor = "25 68 56 206"; borderEnable = "dynamic"; borderMovable = "dynamic"; autoBalance = "0"; fudgeFactor = "4"; new ShellScrollCtrl(SI_InfoScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "336 96"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "7 7"; extent = "306 88"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(SI_InfoWindow) { profile = "ShellAltTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "306 52"; minExtent = "24 52"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; }; }; }; new ShellScrollCtrl(SI_ContentScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 100"; extent = "336 162"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "7 7"; extent = "306 174"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiMLTextCtrl(SI_ContentWindow) { profile = "InfoWindowProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "306 52"; minExtent = "24 52"; visible = "1"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "1"; }; }; }; }; new ShellBitmapButton(SI_RefreshBtn) { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "top"; position = "105 230"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "SI_RefreshBtn.setActive(false); GMJ_Browser.refreshSelectedServer();"; helpTag = "0"; text = "REFRESH"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(́ڃ\ \ gui/ShellLoadFileDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(ShellLoadFileDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl(LOAD_Title) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "135 95"; extent = "370 290"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "LOAD FILE"; noTitleBar = "0"; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "47 33"; extent = "276 200"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 7"; extent = "262 186"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellTextList(LOAD_FileList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "268 8"; minExtent = "8 8"; visible = "1"; altCommand = "Canvas.popDialog(ShellLoadFileDlg);"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0 275"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "38 235"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(ShellLoadFileDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton(LOAD_LoadBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "top"; position = "204 235"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(ShellLoadFileDlg);"; helpTag = "0"; text = "LOAD"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(_E$ $ gui/ShellSaveFileDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(ShellSaveFileDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl(SAVE_Title) { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "135 95"; extent = "370 290"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "SAVE FILE"; noTitleBar = "0"; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "61 208"; extent = "60 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "File Name:"; }; new ShellTextEditCtrl(SAVE_FileName) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "117 200"; extent = "184 38"; minExtent = "32 38"; visible = "1"; command = "SAVE_FileName.checkValid();"; altCommand = "Canvas.popDialog(ShellSaveFileDlg);"; helpTag = "0"; historySize = "0"; maxLength = "32"; password = "0"; glowOffset = "9 9"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "38 235"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(ShellSaveFileDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton(SAVE_SaveBtn) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "204 235"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(ShellSaveFileDlg);"; helpTag = "0"; text = "SAVE"; simpleStyle = "0"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "47 33"; extent = "276 169"; minExtent = "24 52"; visible = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 7"; extent = "262 155"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellTextList(SAVE_FileList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "268 8"; minExtent = "8 8"; visible = "1"; altCommand = "SAVE_FileList.onDoubleClick();"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0 275"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; }; }; //--- OBJECT WRITE END --- PK !(]I~~gui/SinglePlayerEscapeDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(SinglePlayerEscapeDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "226 151"; extent = "188 178"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "PAUSE"; noTitleBar = "0"; new ShellBitmapButton(SinglePlayerEscLeaveBtn) { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "30 31"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "SinglePlayerEscapeDlg.leaveGame();"; helpTag = "0"; text = "LEAVE GAME"; simpleStyle = "0"; }; new ShellBitmapButton(SinglePlayerEscSettingsBtn) { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "30 66"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "SinglePlayerEscapeDlg.gotoSettings();"; helpTag = "0"; text = "SETTINGS"; simpleStyle = "0"; }; new ShellBitmapButton(SinglePlayerEscReturnBtn) { profile = "ShellButtonProfile"; horizSizing = "center"; vertSizing = "top"; position = "30 123"; extent = "128 38"; minExtent = "32 38"; visible = "1"; command = "SinglePlayerEscapeDlg.returnToGame();"; accelerator = "escape"; helpTag = "0"; text = "RESUME GAME"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !( e  gui/TSShowDetailControlDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TSShowDetailControlDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "False"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "195 259"; extent = "220 140"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Detail Control"; resizeWidth = "True"; resizeHeight = "True"; canMove = "True"; canClose = "True"; canMinimize = "True"; canMaximize = "True"; minSize = "50 50"; closeCommand = "Canvas.popDialog(TSShowDetailControlDlg);"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 28"; extent = "27 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; command = "showToggleDetail();"; helpTag = "0"; text = "==>"; }; new GuiTextCtrl(showDetailInfoText1) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 89"; extent = "184 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Slider Sets Detail"; FONT = "12 244 Arial"; justify = "center"; }; new GuiTextCtrl(showDetailInfoText2) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 112"; extent = "184 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Slider Sets Detail"; FONT = "12 244 Arial"; justify = "center"; }; new GuiTextCtrl(showDetailText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 30"; extent = "80 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Slider Sets Detail"; FONT = "12 244 Arial"; justify = "center"; }; new GuiSliderCtrl(showDetailSlider) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 57"; extent = "153 23"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "5"; value = "0"; tab = "true"; }; }; }; //--- OBJECT WRITE END --- $showAutoDetail = false; function showToggleDetail() { if ($showAutoDetail) { showDetailText.setValue("Slider Sets Detail Level"); showSetDetailSlider(); $showAutoDetail = false; } else { showDetailText.setValue("Auto Detail Using Distance"); $showAutoDetail = true; } } PK !(~QQgui/TSShowEditScale.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TSShowEditScale) { profile = "GuiDefaultProfile"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; position = "100 100"; extent = "180 100"; text = "Edit Scale"; new GuiTextEditCtrl(showScale) { profile = "GuiTextEditProfile"; position = "80 20"; extent = "50 20"; altCommand = "showSetScale(threadList.getValue(),showScale.getValue()); Canvas.popDialog(TSShowEditScale);"; }; new GuiButtonCtrl () { profile = "GuiButtonProfile"; position = "20 50"; extent = "60 20"; text = "Ok"; command = "showSetScale(threadList.getValue(),showScale.getValue()); Canvas.popDialog(TSShowEditScale);"; }; new GuiButtonCtrl () { profile = "GuiButtonProfile"; position = "110 50"; extent = "60 20"; text = "Cancel"; command = "Canvas.popDialog(TSShowEditScale);"; }; }; }; //--- OBJECT WRITE END --- PK !(ELgui/TSShowGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TSShowGui) { profile = "GuiDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new ShowTSCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "800 600"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 271"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "showSetFileList(\"base/shapes\",\"dts\",\"showShapeLoad(showFileList.getValue());\"); Canvas.pushDialog(TSShowLoadDlg,99);"; helpTag = "0"; text = "Load Shape"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 301"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "showSetFileList(\"base/shapes\",\"dsq\",\"showSequenceLoad(showFileList.getValue());\"); Canvas.pushDialog(TSShowLoadDlg,99);"; helpTag = "0"; text = "Load Sequence"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 361"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.pushDialog(TSShowDetailControlDlg,99);"; helpTag = "0"; text = "Detail Control"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 390"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.pushDialog(TSShowLightDlg,99);"; helpTag = "0"; text = "Lighting"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 420"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.pushDialog(TSShowMiscDlg,99);"; helpTag = "0"; text = "Misc"; }; new GuiButtonCtrl(showExitButton) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 450"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "showPopAll(); showMoveMap.pop(); quit();"; helpTag = "0"; text = "Quit"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 331"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.pushDialog(TSShowThreadControlDlg,99); showUpdateThreadControl();"; helpTag = "0"; text = "Thread control"; }; }; //--- OBJECT WRITE END --- $showMission = "emptyMission"; function showPopAll() { Canvas.popDialog(TSShowThreadControlDlg); Canvas.popDialog(TSShowTransitionDlg); Canvas.popDialog(TSShowLoadDialog); Canvas.popDialog(TSShowLightDlg); Canvas.popDialog(TSShowMiscDialog); Canvas.popDialog(TShowEditScale); Canvas.popDialog(TSShowDetailControlDlg); } function startShow() { $ServerName = "show"; CreateServer("emptyMission", "ctf"); localConnect(); Canvas.setContent(TSShowGui); // if (!$missionRunning) // { // DestroyServer(); // $missionSequence = 0; // new SimGroup( ServerGroup); // loadMission($showMission, true); // localConnect(); // } // // allowConnections(false); } function showSetSpeed(%speed) { if(%speed) $showMovementSpeed = %speed; } function showMoveleft(%val) { $showLeftAction = %val; } function showMoveright(%val) { $showRightAction = %val; } function showMoveforward(%val) { $showForwardAction = %val; } function showMovebackward(%val) { $showBackwardAction = %val; } function showMoveup(%val) { $showUpAction = %val; } function showMovedown(%val) { $showDownAction = %val; } function showYaw(%val) { $showYaw += %val * 0.01; } function showPitch(%val) { $showPitch += %val * 0.01; } function toggleMouse() { if(Canvas.isCursorOn()) CursorOff(); else CursorOn(); } function TSShowGui::onWake(%this) { if ( !Canvas.isCursorOn() ) CursorOn(); GlobalActionMap.bindcmd(keyboard, "tab", "", "toggleMouse();"); showMoveMap.push(); } function TSShowGui::onSleep(%this) { GlobalActionMap.unbind(keyboard, "tab"); showMoveMap.pop(); lockMouse(false); CursorOn(); } new ActionMap(showMoveMap); showMoveMap.bind(keyboard, a, showMoveleft); showMoveMap.bind(keyboard, d, showMoveright); showMoveMap.bind(keyboard, w, showMoveforward); showMoveMap.bind(keyboard, s, showMovebackward); showMoveMap.bind(keyboard, e, showMoveup); showMoveMap.bind(keyboard, c, showMovedown); showMoveMap.bind(keyboard, z, showTurnLeft); showMoveMap.bind(keyboard, x, showTurnRight); showMoveMap.bind(keyboard, 1, S, 0.10, showSetSpeed); showMoveMap.bind(keyboard, 2, S, 0.25, showSetSpeed); showMoveMap.bind(keyboard, 3, S, 0.50, showSetSpeed); showMoveMap.bind(keyboard, 4, S, 1.00, showSetSpeed); showMoveMap.bind(keyboard, 5, S, 1.50, showSetSpeed); showMoveMap.bind(keyboard, 6, S, 2.00, showSetSpeed); showMoveMap.bind(keyboard, 7, S, 3.00, showSetSpeed); showMoveMap.bind(keyboard, 8, S, 5.00, showSetSpeed); showMoveMap.bind(keyboard, 9, S, 10.00, showSetSpeed); showMoveMap.bind(keyboard, 0, S, 20.00, showSetSpeed); showMoveMap.bind(mouse, xaxis, showYaw); showMoveMap.bind(mouse, yaxis, showPitch); PK !(eEYYgui/TSShowLightDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl (TSShowLightDlg) { profile = "DialogProfile"; modal = false; new GuiWindowCtrl() { profile = "GuiWindowProfile"; closeCommand = "Canvas.popDialog(TSShowLightDlg);"; position = "20 20"; extent = "150 400"; text = "Light Control"; new GuiTextCtrl() { profile = "GuiTextProfile"; position = "20 30"; extent = "50 16"; font = "12 244 Arial"; justify = "center"; text = "Environment mapping:"; }; new GuiSliderCtrl( "emapAlpha") { profile = "GuiSliderProfile"; position = "20 50"; extent = "100 20"; tab = "true"; range = "0.0 1.0"; value = 0.0; ticks = 5; }; new GuiTextCtrl() { profile = "GuiTextProfile"; position = "20 70"; extent = "50 16"; font = "12 244 Arial"; justify = "center"; text = "Ambient Red:"; }; new GuiSliderCtrl( "ambR") { profile = "GuiSliderProfile"; position = "20 90"; extent = "100 20"; tab = "true"; range = "0.0 1.0"; value = 0.5; ticks = 5; }; new GuiTextCtrl() { profile = "GuiTextProfile"; position = "20 110"; extent = "50 16"; font = "12 244 Arial"; justify = "center"; text = "Ambient Green:"; }; new GuiSliderCtrl( "ambG") { profile = "GuiSliderProfile"; position = "20 130"; extent = "100 20"; tab = "true"; range = "0.0 1.0"; value = 0.5; ticks = 5; }; new GuiTextCtrl() { profile = "GuiTextProfile"; position = "20 150"; extent = "50 16"; font = "12 244 Arial"; justify = "center"; text = "Ambient Blue:"; }; new GuiSliderCtrl( "ambB") { profile = "GuiSliderProfile"; position = "20 170"; extent = "100 20"; tab = "true"; range = "0.0 1.0"; value = 0.5; ticks = 5; }; new GuiTextCtrl() { profile = "GuiTextProfile"; position = "20 190"; extent = "50 16"; font = "12 244 Arial"; justify = "center"; text = "Directional Red:"; }; new GuiSliderCtrl( "diffR") { profile = "GuiSliderProfile"; position = "20 210"; extent = "100 20"; tab = "true"; range = "0.0 1.0"; value = 0.5; ticks = 5; }; new GuiTextCtrl() { profile = "GuiTextProfile"; position = "20 230"; extent = "50 16"; font = "12 244 Arial"; justify = "center"; text = "Directional Green:"; }; new GuiSliderCtrl( "diffG") { profile = "GuiSliderProfile"; position = "20 250"; extent = "100 20"; tab = "true"; range = "0.0 1.0"; value = 0.5; ticks = 5; }; new GuiTextCtrl() { profile = "GuiTextProfile"; position = "20 270"; extent = "50 16"; font = "12 244 Arial"; justify = "center"; text = "Directional Blue:"; }; new GuiSliderCtrl( "diffB") { profile = "GuiSliderProfile"; position = "20 290"; extent = "100 20"; tab = "true"; range = "0.0 1.0"; value = 0.5; ticks = 5; }; new GuiButtonCtrl () { profile = "GuiButtonProfile"; position = "40 330"; extent = "60 20"; text = "Set Direction"; command = "showSetLightDirection();"; }; new GuiButtonCtrl () { profile = "GuiButtonProfile"; position = "40 360"; extent = "60 20"; text = "OK"; command = "Canvas.popDialog(TSShowLightDlg);"; }; }; }; //--- OBJECT WRITE END --- PK !(j< gui/TSShowLoadDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TSShowLoadDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 100"; extent = "180 240"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Load"; resizeWidth = "True"; resizeHeight = "True"; canMove = "True"; canClose = "True"; canMinimize = "True"; canMaximize = "True"; minSize = "50 50"; closeCommand = "Canvas.popDialog(TSShowLoadDlg);"; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 35"; extent = "140 160"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "False"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "120 158"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextListCtrl(showFileList) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "64 64"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; altCommand = "eval($showFileCommand); Canvas.popDialog(TSShowLoadDlg);"; helpTag = "0"; enumerate = "False"; resizeCell = "True"; columns = "0"; noDuplicates = "false"; }; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 205"; extent = "60 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "eval($showFileCommand); Canvas.popDialog(TSShowLoadDlg);"; helpTag = "0"; text = "Load"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 205"; extent = "60 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.popDialog(TSShowLoadDlg);"; helpTag = "0"; text = "Cancel"; }; }; }; //--- OBJECT WRITE END --- PK !(: gui/TSShowMiscDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TSShowMiscDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "False"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "140 220"; extent = "190 240"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Misc"; resizeWidth = "True"; resizeHeight = "True"; canMove = "True"; canClose = "True"; canMinimize = "True"; canMaximize = "True"; minSize = "50 50"; closeCommand = "Canvas.popDialog(TSShowMiscDlg);"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 30"; extent = "150 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showToggleRoot();"; helpTag = "0"; text = "Toggle Animate Ground"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 65"; extent = "150 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showToggleStick();"; helpTag = "0"; text = "Toggle Stick To Ground"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 100"; extent = "150 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showSetKeyboard(true); showSetCamera(true);"; helpTag = "0"; text = "Keyboard Controls Shape"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 135"; extent = "150 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showSetKeyboard(false);"; helpTag = "0"; text = "Keyboard Controls Camera"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 170"; extent = "150 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showSetCamera(true); showSetKeyboard(false);"; helpTag = "0"; text = "Camera Orbits Shape"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 205"; extent = "150 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showSetCamera(false); showSetKeyboard(false);"; helpTag = "0"; text = "Camera Moves Freely"; }; }; }; //--- OBJECT WRITE END --- PK !(=Q++gui/TSShowThreadControlDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TSShowThreadControlDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "False"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "451 403"; extent = "327 187"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Thread Control"; resizeWidth = "True"; resizeHeight = "True"; canMove = "True"; canClose = "True"; canMinimize = "True"; canMaximize = "True"; minSize = "50 50"; closeCommand = "Canvas.popDialog(TSShowThreadControlDlg);"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 30"; extent = "42 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Threads:"; FONT = "12 244 Arial"; justify = "center"; }; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 50"; extent = "50 100"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "False"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "30 98"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextListCtrl(threadList) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "50 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showUpdateThreadControl();"; helpTag = "0"; enumerate = "False"; resizeCell = "True"; columns = "0"; noDuplicates = "false"; }; }; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "90 30"; extent = "57 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Sequences:"; FONT = "12 244 Arial"; }; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "60 50"; extent = "150 100"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; willFirstRespond = "True"; hScrollBar = "dynamic"; vScrollBar = "alwaysOn"; constantThumbHeight = "False"; text = "Sequences:"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "130 80"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiTextListCtrl(sequenceList) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "150 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showSelectSequence();"; altCommand = "showSelectSequence();"; helpTag = "0"; enumerate = "False"; resizeCell = "True"; columns = "0"; noDuplicates = "false"; }; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 27"; extent = "84 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showPlay(threadList.getValue());"; helpTag = "0"; text = "Play"; }; new GuiTextCtrl(showScaleValue) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "133 162"; extent = "8 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; FONT = "12 244 Arial"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 47"; extent = "84 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showStop(threadList.getValue());"; helpTag = "0"; text = "Stop"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 79"; extent = "84 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; command = "Canvas.pushDialog(TSShowTransitionDlg,199);"; helpTag = "0"; text = "Transition..."; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 110"; extent = "84 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showNewThread();"; helpTag = "0"; text = "New Thread"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 129"; extent = "84 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showDeleteThread(threadList.getValue());"; helpTag = "0"; text = "Delete Thread"; }; new GuiSliderCtrl(threadPosition) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "27 160"; extent = "100 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "5"; value = "0"; tab = "true"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "230 161"; extent = "84 16"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "showScale.setText(\"\"); Canvas.pushDialog(TSShowEditScale,199);"; helpTag = "0"; text = "Edit Scale"; }; new GuiTextCtrl(transitionSignal) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 162"; extent = "8 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(ƿ rrgui/TSShowTranDurEditDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TSShowTranDurEditDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "260 425"; extent = "181 87"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Edit Transition Duration"; resizeWidth = "True"; resizeHeight = "True"; canMove = "True"; canClose = "True"; canMinimize = "True"; canMaximize = "True"; minSize = "50 50"; new GuiTextEditCtrl(showTransitionDuration) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "24 25"; extent = "50 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; altCommand = "$showTransitionDuration = showTransitionDuration.getValue(); transitionDurationText.setValue($showTransitionDuration); Canvas.popDialog(TSShowTranDurEditDlg);"; helpTag = "0"; historySize = "0"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 27"; extent = "60 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "$showTransitionDuration = showTransitionDuration.getValue(); transitionDurationText.setValue($showTransitionDuration); Canvas.popDialog(TSShowTranDurEditDlg);"; helpTag = "0"; text = "Ok"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 54"; extent = "60 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; command = "Canvas.popDialog(TSShowTranDurEditDlg);"; helpTag = "0"; text = "Cancel"; }; }; }; //--- OBJECT WRITE END --- PK !(jkgui/TSShowTransitionDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TSShowTransitionDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "False"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 378"; extent = "249 195"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Transition Control"; resizeWidth = "True"; resizeHeight = "True"; canMove = "True"; canClose = "True"; canMinimize = "True"; canMaximize = "True"; minSize = "50 50"; closeCommand = "Canvas.popDialog(TSShowTransitionDlg);"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 28"; extent = "27 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; command = "showToggleTransition();"; helpTag = "0"; text = "==>"; }; new GuiTextCtrl(showTransitionToText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 30"; extent = "67 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Set Sequence"; justify = "center"; FONT = "12 244 Arial"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 56"; extent = "27 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; command = "showToggleTransitionPos();"; helpTag = "0"; text = "==>"; }; new GuiTextCtrl(showTransitionPosText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 58"; extent = "147 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Transition To Synched Position"; justify = "center"; FONT = "12 244 Arial"; }; new GuiSliderCtrl(transitionPosition) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 125"; extent = "100 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; variable = "value"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "5"; value = "0"; tab = "true"; }; new GuiTextCtrl(transitionDurationText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "132 170"; extent = "14 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "0.2"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "15 159"; extent = "85 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; command = "Canvas.pushDialog(TSShowTranDurEditDlg);"; helpTag = "0"; text = "Edit Duration"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "119 152"; extent = "42 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; text = "Duration:"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 87"; extent = "27 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; command = "showToggleTransitionTargetPlay();"; helpTag = "0"; text = "==>"; }; new GuiTextCtrl(showTransitionTargetPlayText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 89"; extent = "190 18"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; modal = "True"; helpTag = "0"; text = "Target sequence plays during transition"; FONT = "12 244 Arial"; justify = "center"; }; }; }; //--- OBJECT WRITE END --- $showTransition = false; $showTransitionSynched = true; $showTransitionDuration = 0.2; $showTransitionTargetPlay = true; function showToggleTransitionTargetPlay() { if ($showTransitionTargetPlay) { showTransitionTargetPlayText.setValue("Target sequence pauses during transition"); $showTransitionTargetPlay = false; } else { showTransitionTargetPlayText.setValue("Target sequence plays during transition"); $showTransitionTargetPlay = true; } } function showToggleTransition() { if ($showTransition) { showTransitionToText.setValue("Set Sequence"); $showTransition=false; } else { showTransitionToText.setValue("Transition To Sequence"); $showTransition=true; } } function showToggleTransitionPos() { if ($showTransitionSynched) { showTransitionPosText.setValue("Transition to Slider Position"); $showTransitionSynched=false; } else { showTransitionPosText.setValue("Transition To Synched Position"); $showTransitionSynched=true; } } PK !(>>gui/TaskHudDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TaskHudDlg) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; helpTag = "0"; bypassHideCursor = "1"; new ShellFieldCtrl() { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "8 230"; extent = "380 204"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiControl() { profile = "TaskHudBox"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "378 19"; minExtent = "8 8"; visible = "1"; helpTag = "0"; }; new GuiTextCtrl() { profile = "TaskHudTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 2"; extent = "60 16"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Issued By"; }; new GuiTextCtrl() { profile = "TaskHudTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "164 2"; extent = "80 16"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Description"; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 20"; extent = "377 200"; new GuiTextListCtrl(TaskList) { profile = "TaskHudProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "377 8"; minExtent = "8 8"; visible = "1"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "2 160"; fitParentWidth = "1"; clipColumnText = "1"; }; }; }; }; //--- OBJECT WRITE END --- PK !(|# gui/TerraformerFullScreenGui.gui//--- OBJECT WRITE BEGIN --- new GameTSCtrl(TerraformerFullscreenGui) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "19 541"; extent = "100 20"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; command = "quit();"; helpTag = "0"; text = "Exit"; }; }; //--- OBJECT WRITE END --- PK !(egui/TerraformerGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TerraformerGui) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; modal = "True"; helpTag = "0"; }; new GuiControl(TerraformerToolbarBackgroundGui) { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "640 30"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; }; //--- OBJECT WRITE END --- function TerraformerGui::getPrefs(%this) { %this.currentView = getPrefSetting($pref::Terraformer::currentView, "HeightfieldView"); } function TerraformerGui::setPrefs(%this) { $pref::Terraformer::currentView = %this.currentView; } function TerraformerGui::init(%this) { %this.getPrefs(); // if(!isObject("terraformer")) { echo("making a terraformer"); new Terraformer("terraformer"); $SelectedOperation = -1; $NextOperationId = 1; $HeightfieldDirtyRow = -1; } TerraformerHeightfieldGui.init(); TerraformerTextureGui.init(); } function TerraformerGui::onWake(%this) { if(!isObject("editor")) %this.init(); %this.setView(%this.currentView); } function TerraformerGui::onSleep(%this) { %this.setPrefs(); } function TerraformerGui::setView(%this, %view) { // clear while(%this.getCount()) %this.remove(%this.getObject(0)); // switch$(%view) { case "HeightfieldView": %this.add(TerraformerHeightfieldGui); TerraformerHeightfieldGui.refresh(); case "TextureView": %this.add(TerraformerTextureGui); TerraformerTextureGui.refresh(); default: error("TerraformerGui::setView: invalid view '" @ %view @ "'"); return; } %this.add(TerraformerToolbarBackgroundGui); %this.currentView = %view; } PK !(&<<!gui/TerraformerHeightfieldGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TerraformerHeightfieldGui) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiFrameSetCtrl(HeightfieldhRootFrame) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 30"; extent = "640 450"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; columns = "0 279 374"; rows = "0"; borderWidth = "4"; borderColor = "0 76 248 255"; borderEnable = "alwaysOff"; borderMovable = "alwaysOff"; autoBalance = "0"; new GuiFrameSetCtrl(HeightfieldLeftFrame) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "height"; position = "0 0"; extent = "275 450"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; columns = "0"; rows = "0 250"; borderWidth = "4"; borderColor = "0 4 248 255"; borderEnable = "alwaysOff"; borderMovable = "alwaysOff"; autoBalance = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "275 246"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiBigTextProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "21 -2"; extent = "232 40"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Heightfield Editor"; }; new GuiScrollCtrl(HeightfieldTabParent) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 35"; extent = "266 205"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOff"; constantThumbHeight = "1"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "264 203"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiControl(tab_fBm) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "100 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "fBm Fractal Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 35"; extent = "71 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Hill Frequency:"; }; new GuiTextEditSliderCtrl(fbm_interval) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "1 24"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "99 60"; extent = "58 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Roughness:"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 136"; extent = "77 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "fBm_seed.setValue(terraFormer.generateSeed());Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; text = "New Seed"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "87 110"; extent = "70 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Random Seed:"; }; new GuiTextEditCtrl(fBm_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 110"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "0"; historySize = "5"; }; new GuiTextEditSliderCtrl(fbm_rough) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 60"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "128 85"; extent = "29 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Detail:"; }; new GuiPopUpMenuCtrl(fbm_detail) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 85"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; maxPopupHeight = "200"; }; }; new GuiControl(tab_RMF) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "125 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Rigid MultiFractal Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "87 35"; extent = "71 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Hill Frequency:"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 137"; extent = "73 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "rmf_seed.setValue(terraFormer.generateSeed());Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; text = "New Seed"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "101 60"; extent = "58 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Roughness:"; }; new GuiTextEditSliderCtrl(rmf_interval) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "1 16"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "90 111"; extent = "67 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Random Seed"; }; new GuiTextEditCtrl(rmf_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 110"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "0"; historySize = "5"; }; new GuiTextEditSliderCtrl(rmf_rough) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 60"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "128 85"; extent = "29 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Detail:"; }; new GuiPopUpMenuCtrl(rmf_detail) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 85"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; maxPopupHeight = "200"; }; }; new GuiControl(tab_Canyon) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "118 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Canyon Fractal Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "124 61"; extent = "34 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Chaos:"; }; new GuiTextEditSliderCtrl(canyon_freq) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "4 10"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "63 35"; extent = "95 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Canyon Frequency:"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 114"; extent = "73 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "canyon_seed.setValue(terraFormer.generateSeed());Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; text = "New Seed"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "88 89"; extent = "70 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Random Seed:"; }; new GuiTextEditCtrl(canyon_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 89"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "0"; historySize = "5"; }; new GuiTextEditSliderCtrl(canyon_factor) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 62"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; }; new GuiControl(tab_Smooth) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "95 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Smoothing Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 64"; extent = "77 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Agressiveness:"; }; new GuiTextEditSliderCtrl(smooth_iter) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::saveTab($selectedOperation);Heightfield::preview($selectedOperation);"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "0 40"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "109 36"; extent = "47 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Iterations:"; }; new GuiTextEditSliderCtrl(smooth_factor) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 63"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; }; new GuiControl(tab_SmoothWater) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "154 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Water Area Smoothing Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 64"; extent = "77 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Agressiveness:"; }; new GuiTextEditSliderCtrl(watersmooth_iter) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::saveTab($selectedOperation);Heightfield::preview($selectedOperation);"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "0 40"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "109 36"; extent = "47 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Iterations:"; }; new GuiTextEditSliderCtrl(watersmooth_factor) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 63"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; }; new GuiControl(tab_SmoothRidge) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "152 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Ridge Area Smoothing Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 64"; extent = "77 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Agressiveness:"; }; new GuiTextEditSliderCtrl(Ridgesmooth_iter) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::saveTab($selectedOperation);Heightfield::preview($selectedOperation);"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "0 40"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "109 36"; extent = "47 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Iterations:"; }; new GuiTextEditSliderCtrl(Ridgesmooth_factor) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 63"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; }; new GuiControl(tab_Filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "101 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Height Filter Settings:"; }; new GuiFilterCtrl(filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 29"; extent = "130 130"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Heightfield::saveTab($selectedOperation);Heightfield::preview($selectedOperation);"; helpTag = "0"; controlPoints = "7"; filter = "0.000000 0.166667 0.333333 0.500000 0.666667 0.833333 1.000000"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "154 84"; extent = "30 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Result"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "68 167"; extent = "23 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Input"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 160"; extent = "16 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "min"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "127 160"; extent = "20 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "max"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "150 142"; extent = "16 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "min"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "150 28"; extent = "20 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "max"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "189 139"; extent = "61 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "filter.controlPoints"; command = "filter.controlPoints = $ThisControl.getValue();Heightfield::saveTab($selectedOperation);Heightfield::preview($selectedOperation);"; helpTag = "0"; historySize = "0"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "187 118"; extent = "66 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Control Points"; }; }; new GuiControl(tab_Turbulence) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "99 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Turbulence Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "65 34"; extent = "91 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Turbulence Factor:"; }; new GuiTextEditSliderCtrl(turbulence_factor) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "75 61"; extent = "81 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Radius of Effect:"; }; new GuiTextEditSliderCtrl(turbulence_radius) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 61"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "1 40"; increment = "1"; }; }; new GuiControl(tab_Thermal) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "122 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Thermal Erosion Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "112 36"; extent = "47 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Iterations:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "79 91"; extent = "80 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Material Loss %:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 63"; extent = "139 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Min Erosion Slope (degrees):"; }; new GuiTextEditSliderCtrl(thermal_iter) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 36"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "0 50"; increment = "1"; }; new GuiTextEditSliderCtrl(thermal_slope) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 63"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%2.1f"; range = "0 89"; increment = "0.1"; }; new GuiTextEditSliderCtrl(thermal_cons) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 90"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%2.1f"; range = "0 100"; increment = "0.1"; }; }; new GuiControl(tab_Hydraulic) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "259 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "129 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Hydraulic Erosion Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "112 34"; extent = "47 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Iterations:"; }; new GuiFilterCtrl(hydraulic_filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 57"; extent = "130 130"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; controlPoints = "7"; filter = "0.000000 0.166667 0.333333 0.500000 0.666667 0.833333 1.000000"; }; new GuiTextEditSliderCtrl(hydraulic_iter) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "0 50"; increment = "1"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 161"; extent = "64 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "hydraulic_filter.controlPoints"; command = "hydraulic_filter.controlPoints = $ThisControl.getValue();Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; historySize = "0"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 141"; extent = "69 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Control Points:"; }; }; new GuiControl(tab_Sinus) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "259 199"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "72 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Sinus Settings:"; }; new GuiFilterCtrl(sinus_filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "36 64"; extent = "130 130"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; controlPoints = "7"; filter = "0.176920 0.833330 0.876920 0.238460 0.215380 0.166660 0.000000"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 32"; extent = "70 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Random Seed:"; }; new GuiTextEditCtrl(sinus_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "174 32"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "0"; historySize = "5"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "177 66"; extent = "73 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "sinus_seed.setValue(terraFormer.generateSeed());Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; text = "New Seed"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "178 171"; extent = "64 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "sinus_filter.controlPoints"; command = "sinus_filter.controlPoints = $ThisControl.getValue();Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; historySize = "0"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "179 150"; extent = "69 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Control Points:"; }; }; new GuiControl(tab_terrainFile) { profile = "EditorContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 2"; extent = "53 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "TerrainFile:"; }; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 20"; extent = "262 180"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "dynamic"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "242 178"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextListCtrl(terrainFile_textList) { profile = "GuiTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "64 64"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "terrainFile_terrFileText.setValue(\"terrains/\" @ terrainFile_textList.getRowTextById(terrainFile_textList.getSelectedId()));Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "0"; }; }; }; new GuiTextCtrl(terrainFile_terrFileText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 2"; extent = "8 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; }; new GuiControl(tab_General) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "83 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "General Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 53"; extent = "67 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Height Range:"; }; new GuiTextEditSliderCtrl(general_scale) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "108 52"; extent = "64 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "5 500"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "177 53"; extent = "33 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "meters"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "29 93"; extent = "74 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Water Level %:"; }; new GuiSliderCtrl(general_water) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 113"; extent = "200 30"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "value"; command = "general_water_meters.setValue(general_water.getValue()*general_scale.getValue()+general_min_height.getValue() @ \" meters\");Heightfield::saveTab();Heightfield::preview();"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "5"; value = "0"; }; new GuiTextCtrl(general_water_meters) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "109 93"; extent = "42 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "0 meters"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 158"; extent = "135 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Heightfield::center();"; helpTag = "0"; text = "Center on Camera"; }; new GuiTextCtrl(general_centerx) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "8 18"; minExtent = "8 8"; visible = "0"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "0"; }; new GuiTextCtrl(general_centery) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "8 18"; minExtent = "8 8"; visible = "0"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "0"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 28"; extent = "89 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Min Terrain Height:"; }; new GuiTextEditSliderCtrl(general_min_height) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "108 27"; extent = "64 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; format = "%1.0f"; range = "0 500"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "177 28"; extent = "33 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "meters"; }; }; new GuiControl(tab_Bitmap) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "76 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Bitmap settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 43"; extent = "45 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Filename:"; }; new GuiTextCtrl(bitmap_name) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 43"; extent = "8 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; new GuiButtonCtrl(bitmap_choose) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 65"; extent = "73 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Heightfield::setBitmap();"; helpTag = "0"; text = "Choose..."; }; }; new GuiControl(tab_Blend) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 198"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiPopUpMenuCtrl(blend_option) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 118"; extent = "82 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; text = "Add"; maxPopupHeight = "200"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 6"; extent = "71 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Blend settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 31"; extent = "34 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Factor:"; }; new GuiSliderCtrl(blend_factor) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "49 29"; extent = "200 30"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "value"; command = "Heightfield::saveTab();Heightfield::preview($selectedOperation);"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "5"; value = "0.4"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 64"; extent = "49 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Source A:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "23 156"; extent = "205 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "result = (A*factor) operation (B*(1-factor))"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 91"; extent = "48 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Source B:"; }; new GuiTextEditCtrl(blend_srcB) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 89"; extent = "33 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "1"; historySize = "5"; }; new GuiTextCtrl(blend_srcA) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "64 65"; extent = "92 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Previous Operation"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 118"; extent = "50 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Operation:"; }; }; }; }; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 250"; extent = "275 200"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiPopUpMenuCtrl(Heightfield_options) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "199 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Options"; maxPopupHeight = "200"; setText = "false"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "205 3"; extent = "53 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::onDelete();"; helpTag = "0"; text = "Delete"; }; new GuiScrollCtrl() { profile = "GuiButtonProfile"; horizSizing = "width"; vertSizing = "height"; position = "5 27"; extent = "266 166"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "1"; new GuiScrollContentCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "264 164"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextListCtrl(Heightfield_operation) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "12 16"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "1"; }; }; }; }; }; new GuiFrameSetCtrl(HeightfieldCenterFrame) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "height"; position = "279 0"; extent = "91 450"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; columns = "0"; rows = "0"; borderWidth = "4"; borderColor = "0 4 248 255"; borderEnable = "alwaysOff"; borderMovable = "alwaysOff"; autoBalance = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "91 450"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "4 2"; extent = "82 445"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 27"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::load(Lush);"; helpTag = "0"; text = "Lush"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 52"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::load(Swamp);"; helpTag = "0"; text = "Swamp"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 77"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::load(BadLands);"; helpTag = "0"; text = "BadLands"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 102"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::load(Ice);"; helpTag = "0"; text = "Ice"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 127"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::load(Desert);"; helpTag = "0"; text = "Desert"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 152"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::load(Lava);"; helpTag = "0"; text = "Lava"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 400"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::saveTab();TerraformerGui.setView(TextureView);"; helpTag = "0"; text = "Texture"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 275"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::apply();"; helpTag = "0"; text = "Apply"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 332"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::save();"; helpTag = "0"; text = "Save"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 309"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Heightfield::load();"; helpTag = "0"; text = "Load"; }; new GuiButtonCtrl(ExportHeightfield) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 355"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Export"; }; }; }; }; new GuiFrameSetCtrl(HeightfieldRightFrame) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "height"; position = "374 0"; extent = "266 450"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; columns = "0"; rows = "0 266"; borderWidth = "2"; borderColor = "0 4 248 255"; borderEnable = "alwaysOff"; borderMovable = "alwaysOff"; autoBalance = "0"; new GuiControl() { profile = "GuiContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "266 264"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTerrPreviewCtrl(HeightfieldPreview) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "256 256"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; }; new GuiControl() { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 266"; extent = "266 184"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GameTSCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 4"; extent = "255 174"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; }; }; }; }; }; //--- OBJECT WRITE END --- function tab_Blend::reset(%this) { blend_option.clear(); blend_option.add("Add", 0); blend_option.add("Subtract", 1); blend_option.add("Max", 2); blend_option.add("Min", 3); blend_option.add("Multiply", 4); } function tab_fBm::reset(%this) { fBm_detail.clear(); fBm_detail.add("Very Low", 0); fBm_detail.add("Low", 1); fBm_detail.add("Normal", 2); fBm_detail.add("High", 3); fBm_detail.add("Very High", 4); } function tab_RMF::reset(%this) { rmf_detail.clear(); rmf_detail.add("Very Low", 0); rmf_detail.add("Low", 1); rmf_detail.add("Normal", 2); rmf_detail.add("High", 3); rmf_detail.add("Very High", 4); } function tab_terrainFile::reset(%this) { // update tab controls.. terrainFile_textList.clear(); %filespec = "terrains/*.ter"; for(%file = findFirstFile(%filespec); %file !$= ""; %file = findNextFile(%filespec)) terrainFile_textList.addRow(%i++, fileBase(%file) @ fileExt(%file)); } //-------------------------------------- function Heightfield::resetTabs() { tab_terrainFile.reset(); tab_fbm.reset(); tab_rmf.reset(); // tab_canyon.reset(); // tab_smooth.reset(); // tab_smoothWater.reset(); // tab_smoothRidge.reset(); // tab_filter.reset(); // tab_turbulence.reset(); // tab_thermal.reset(); // tab_hydraulic.reset(); // tab_general.reset(); // tab_bitmap.reset(); tab_blend.reset(); // tab_sinus.reset(); } //-------------------------------------- function TerraformerHeightfieldGui::init(%this) { Heightfield_options.clear(); Heightfield_options.setText("Operation"); Heightfield_options.add("fBm Fractal",0); Heightfield_options.add("Rigid MultiFractal",1); Heightfield_options.add("Canyon Fractal",2); Heightfield_options.add("Sinus",3); Heightfield_options.add("Bitmap",4); Heightfield_options.add("Turbulence",5); Heightfield_options.add("Smoothing",6); Heightfield_options.add("Smooth Water",7); Heightfield_options.add("Smooth Ridges/Valleys", 8); Heightfield_options.add("Filter",9); Heightfield_options.add("Thermal Erosion",10); Heightfield_options.add("Hydraulic Erosion",11); Heightfield_options.add("Blend",12); Heightfield_options.add("Terrain File",13); Heightfield::resetTabs(); %this.refresh(); } function TerraformerHeightfieldGui::refresh(%this) { if (Heightfield_operation.rowCount() == 0) { Heightfield_operation.clear(); %id1 = Heightfield::add("General\tTab_general\tgeneral_min_height\t50\tgeneral_scale\t300\tgeneral_water\t0.000\tgeneral_centerx\t0\tgeneral_centery\t0"); Heightfield_operation.setSelectedById(%id1); } Heightfield::resetTabs(); Heightfield::preview(); } //-------------------------------------- function Heightfield_options::onSelect(%this, %_id, %text) { Heightfield_options.setText("Operation"); %id = -1; %rowCount = Heightfield_operation.rowCount(); // FORMAT // item name // tab name // control name // control value switch$(%text) { case "Terrain File": %id = HeightField::add("Terrain File\ttab_terrainFile\tterrainFile_terrFileText\tterrains/terr1.ter\tterrainFile_textList\tterr1.ter"); case "fBm Fractal": %id = Heightfield::add("fBm Fractal\ttab_fBm\tfbm_interval\t9\tfbm_rough\t0.000\tfBm_detail\tNormal\tfBm_seed\t" @ terraformer.generateSeed()); case "Rigid MultiFractal": %id = Heightfield::add("Rigid MultiFractal\ttab_RMF\trmf_interval\t4\trmf_rough\t0.000\trmf_detail\tNormal\trmf_seed\t" @ terraformer.generateSeed()); case "Canyon Fractal": %id = Heightfield::add("Canyon Fractal\ttab_Canyon\tcanyon_freq\t5\tcanyon_factor\t0.500\tcanyon_seed\t" @ terraformer.generateSeed()); case "Sinus": %id = Heightfield::add("Sinus\ttab_Sinus\tsinus_filter\t1 0.83333 0.6666 0.5 0.33333 0.16666 0\tsinus_seed\t" @ terraformer.generateSeed()); case "Bitmap": %id = Heightfield::add("Bitmap\ttab_Bitmap\tbitmap_name\t"); Heightfield::setBitmap(); } if (Heightfield_operation.rowCount() >= 1) { switch$(%text) { case "Smoothing": %id = Heightfield::add("Smoothing\ttab_Smooth\tsmooth_factor\t0.500\tsmooth_iter\t0"); case "Smooth Water": %id = Heightfield::add("Smooth Water\ttab_SmoothWater\twatersmooth_factor\t0.500\twatersmooth_iter\t0"); case "Smooth Ridges/Valleys": %id = Heightfield::add("Smooth Ridges/Valleys\ttab_SmoothRidge\tridgesmooth_factor\t0.8500\tridgesmooth_iter\t1"); case "Filter": %id = Heightfield::add("Filter\ttab_Filter\tfilter\t0 0.16666667 0.3333333 0.5 0.6666667 0.8333333 1"); case "Turbulence": %id = Heightfield::add("Turbulence\ttab_Turbulence\tturbulence_factor\t0.250\tturbulence_radius\t10"); case "Thermal Erosion": %id = Heightfield::add("Thermal Erosion\ttab_Thermal\tthermal_slope\t30\tthermal_cons\t80.0\tthermal_iter\t0"); case "Hydraulic Erosion": %id = Heightfield::add("Hydraulic Erosion\ttab_Hydraulic\thydraulic_iter\t0\thydraulic_filter\t0 0.16666667 0.3333333 0.5 0.6666667 0.8333333 1"); } } if (Heightfield_operation.rowCount() >= 2) { if("Blend" $= %text) %id = Heightfield::add("Blend\ttab_Blend\tblend_factor\t0.500\tblend_srcB\t" @ %rowCount-2 @"\tblend_option\tadd"); } // select it if (%id != -1) Heightfield_operation.setSelectedById(%id); } //-------------------------------------- function Heightfield::eval(%id) { if (%id == -1) return; %data = restWords(Heightfield_operation.getRowTextById(%id)); %label = getField(%data,0); %row = Heightfield_operation.getRowNumById(%id); echo("Heightfield::eval:" @ %row @ " " @ %label ); switch$(%label) { case "General": if (Terrain.squareSize>0) %size = Terrain.squareSize; else %size = 8; terraformer.setTerrainInfo( 256, %size, getField(%data,3), getField(%data,5), getField(%data,7) ); terraformer.setShift( getField(%data,9), getField(%data,11) ); terraformer.terrainData(%row); case "Terrain File": terraformer.terrainFile(%row, getField(%data,3)); case "fBm Fractal": terraformer.fBm( %row, getField(%data,3), getField(%data,5), getField(%data,7), getField(%data,9) ); case "Sinus": terraformer.sinus( %row, getField(%data,3), getField(%data,5) ); case "Rigid MultiFractal": terraformer.rigidMultiFractal( %row, getField(%data,3), getField(%data,5), getField(%data,7), getField(%data,9) ); case "Canyon Fractal": terraformer.canyon( %row, getField(%data,3), getField(%data,5), getField(%data,7) ); case "Smoothing": terraformer.smooth( %row-1, %row, getField(%data,3), getField(%data,5) ); case "Smooth Water": terraformer.smoothWater( %row-1, %row, getField(%data,3), getField(%data,5) ); case "Smooth Ridges/Valleys": terraformer.smoothRidges( %row-1, %row, getField(%data,3), getField(%data,5) ); case "Filter": terraformer.filter( %row-1, %row, getField(%data,3) ); case "Turbulence": terraformer.turbulence( %row-1, %row, getField(%data,3), getField(%data,5) ); case "Thermal Erosion": terraformer.erodeThermal( %row-1, %row, getField(%data,3), getField(%data,5),getField(%data,7) ); case "Hydraulic Erosion": terraformer.erodeHydraulic( %row-1, %row, getField(%data,3), getField(%data,5) ); case "Bitmap": terraformer.loadGreyscale(%row, getField(%data,3)); case "Blend": %rowCount = Heightfield_operation.rowCount(); if(%rowCount > 2) { %a = Heightfield_operation.getRowNumById(%id)-1; %b = getField(%data, 5); echo("Blend: " @ %data); echo("Blend: " @ getField(%data,3) @ " " @ getField(%data,7)); if(%a < %rowCount || %a > 0 || %b < %rowCount || %b > 0 ) terraformer.blend(%a, %b, %row, getField(%data,3), getField(%data,7) ); else echo("Heightfield Editor: Blend parameters out of range."); } } } //-------------------------------------- function Heightfield::add(%entry) { Heightfield::saveTab(); Heightfield::hideTab(); %id = $NextOperationId++; if ($selectedOperation != -1) { %row = Heightfield_operation.getRowNumById($selectedOperation) + 1; %entry = %row @ " " @ %entry; Heightfield_operation.addRow(%id, %entry, %row); // insert // adjust row numbers for(%i = %row+1; %i < Heightfield_operation.rowCount(); %i++) { %id = Heightfield_operation.getRowId(%i); %text = Heightfield_operation.getRowTextById(%id); %text = setWord(%text, 0, %i); Heightfield_operation.setRowById(%id, %text); } } else { %entry = Heightfield_operation.rowCount() @ " " @ %entry; Heightfield_operation.addRow(%id, %entry); // add to end } %row = Heightfield_operation.getRowNumById(%id); if (%row <= $HeightfieldDirtyRow) $HeightfieldDirtyRow = %row; return %id; } //-------------------------------------- function Heightfield::onDelete(%id) { if (%id $= "") %id = $selectedOperation; %row = Heightfield_operation.getRowNumById(%id); // don't delete the first entry if (%row == 0) return; Heightfield_operation.removeRow(%row); // adjust row numbers for(%i = %row; %i < Heightfield_operation.rowCount(); %i++) { %id2 = Heightfield_operation.getRowId(%i); %text = Heightfield_operation.getRowTextById(%id2); %text = setWord(%text, 0, %i); Heightfield_operation.setRowById(%id2, %text); } // adjust the Dirty Row position if ($HeightfieldDirtyRow >= %row) $HeightfieldDirtyRow = %row; // find the next row to select %rowCount = Heightfield_operation.rowCount()-1; if (%row > %rowCount) %row = %rowCount; if (%id == $selectedOperation) $selectedOperation = -1; %id = Heightfield_operation.getRowId(%row); Heightfield_operation.setSelectedById(%id); } //-------------------------------------- function Heightfield_operation::onSelect(%this, %id, %text) { Heightfield::saveTab(); Heightfield::hideTab(); $selectedOperation = %id; Heightfield::restoreTab($selectedOperation); Heightfield::showTab($selectedOperation); Heightfield::preview($selectedOperation); } //-------------------------------------- function Heightfield::restoreTab(%id) { if (%id == -1) return; Heightfield::hideTab(); %data = restWords(Heightfield_operation.getRowTextById(%id)); %fieldCount = getFieldCount(%data); for (%field=2; %field<%fieldCount; %field += 2) { %obj = getField(%data, %field); %obj.setValue( getField(%data, %field+1) ); } } //-------------------------------------- function Heightfield::saveTab() { if ($selectedOperation == -1) return; %data = Heightfield_operation.getRowTextById($selectedOperation); %rowNum = getWord(%data, 0); %data = restWords(%data); %newdata = getField(%data,0) @ "\t" @ getField(%data,1); %fieldCount = getFieldCount(%data); for (%field=2; %field < %fieldCount; %field += 2) { %obj = getField(%data, %field); %newdata = %newdata @ "\t" @ %obj @ "\t" @ %obj.getValue(); } // keep track of the top-most dirty operation // so we know who to evaluate later if (%data !$= %newdata) { %row = Heightfield_operation.getRowNumById($selectedOperation); if (%row <= $HeightfieldDirtyRow && %row > 0) $HeightfieldDirtyRow = %row; } Heightfield_operation.setRowById($selectedOperation, %rowNum @ " " @ %newdata); } //-------------------------------------- function Heightfield::preview(%id) { %rowCount = Heightfield_operation.rowCount(); if (%id $= "") %id = Heightfield_operation.getRowId(%rowCount-1); %row = Heightfield_operation.getRowNumById(%id); Heightfield::refresh(%row); terraformer.previewScaled(HeightfieldPreview, %row); } //-------------------------------------- function Heightfield::refresh(%last) { if (%last $= "") %last = Heightfield_operation.rowCount()-1; // always update the general info Heightfield::eval(Heightfield_operation.getRowId(0)); for( 0; $HeightfieldDirtyRow<=%last; $HeightfieldDirtyRow++) { %id = Heightfield_operation.getRowId($HeightfieldDirtyRow); Heightfield::eval(%id); } } //-------------------------------------- function Heightfield::apply(%id) { %rowCount = Heightfield_operation.rowCount(); if (%rowCount < 1) return; if (%id $= "") %id = Heightfield_operation.getRowId(%rowCount-1); %row = Heightfield_operation.getRowNumById(%id); HeightfieldPreview.setRoot(); Heightfield::refresh(%row); terraformer.setTerrain(%row); terraformer.setCameraPosition(0,0,0); } //-------------------------------------- $TerraformerSaveRegister = 0; function Heightfield::saveBitmap(%name) { if(%name $= "") getSaveFilename("terrains/heightfield/*png", "Heightfield::doSaveBitmap"); else Heightfield::doSaveBitmap(%name); } function Heightfield::doSaveBitmap(%name) { terraformer.saveGreyscale($TerraformerSaveRegister, %name); } //-------------------------------------- function Heightfield::save(%name) { Heightfield::saveTab(); if(%name $= "") getSaveFilename("terrains/heightfield/*cs", "Heightfield::doSaveHeightfield"); else Heightfield::doSaveHeightfield(%name); } //-------------------------------------- function Heightfield::doSaveHeightfield(%name) { %name = fileBase(%name); if (%name $= "") return; new fileObject("saveFile"); saveFile.openForWrite("terrains/heightfield/" @ %name @ ".cs"); // loop through each operation and save it to disk %rowCount = Heightfield_operation.rowCount(); for(%row = 0; %row < %rowCount; %row++) { %data = restWords(Heightfield_operation.getRowText(%row)); %data = "Heightfield::add(\"" @ expandEscape(%data) @ "\");"; saveFile.writeLine(%data); } saveFile.close(); saveFile.delete(); } //-------------------------------------- function Heightfield::load(%name) { if(%name $= "") getLoadFilename("terrains/heightfield/*.cs", "Heightfield::doLoadHeightfield"); else Heightfield::doLoadHeightfield(%name); } //-------------------------------------- function Heightfield::doLoadHeightfield(%name) { %name = fileBase(%name); if (%name $= "") return; %name = "terrains/heightfield/" @ %name @ ".cs"; Heightfield_operation.clear(); $selectedOperation = -1; $HeightfieldDirtyRow = -1; // zero out all shifting terraformer.setCameraPosition(0,0); HeightfieldPreview.reset(); exec(%name); if (Heightfield_operation.rowCount() == 0) { // if there was a problem executing the script restore // the operations list to a known state Heightfield_operation.clear(); Heightfield::add("General\tTab_general\tgeneral_min_height\t50\tgeneral_scale\t300\tgeneral_water\t0.000\tgeneral_centerx\t0\tgeneral_centery\t0"); } %data = restWords(Heightfield_operation.getRowText(0)); %x = getField(%data,7); %y = getField(%data,9); HeightfieldPreview.setOrigin(%x, %y); Heightfield_operation.setSelectedById(Heightfield_operation.getRowId(0)); terraformer.setCameraPosition(%x,%y); } //-------------------------------------- function Heightfield::setBitmap() { getLoadFilename("terrains/heightfield/*.png", "Heightfield::doSetBitmap"); } //-------------------------------------- function Heightfield::doSetBitmap(%name) { %name = fileBase(%name); if (%name !$= "") %name = "terrains/heightfield/" @ %name @ ".png"; bitmap_name.setValue(%name); Heightfield::saveTab(); Heightfield::preview($selectedOperation); } //-------------------------------------- function Heightfield::hideTab() { tab_terrainFile.setVisible(false); tab_fbm.setvisible(false); tab_rmf.setvisible(false); tab_canyon.setvisible(false); tab_smooth.setvisible(false); tab_smoothWater.setvisible(false); tab_smoothRidge.setvisible(false); tab_filter.setvisible(false); tab_turbulence.setvisible(false); tab_thermal.setvisible(false); tab_hydraulic.setvisible(false); tab_general.setvisible(false); tab_bitmap.setvisible(false); tab_blend.setvisible(false); tab_sinus.setvisible(false); } //-------------------------------------- function Heightfield::showTab(%id) { Heightfield::hideTab(); %data = restWords(Heightfield_operation.getRowTextById(%id)); %tab = getField(%data,1); echo("Tab data: " @ %data @ " tab: " @ %tab); %tab.setVisible(true); } //-------------------------------------- function Heightfield::center() { %camera = terraformer.getCameraPosition(); %x = getWord(%camera, 0); %y = getWord(%camera, 1); HeightfieldPreview.setOrigin(%x, %y); %origin = HeightfieldPreview.getOrigin(); %x = getWord(%origin, 0); %y = getWord(%origin, 1); %root = HeightfieldPreview.getRoot(); %x += getWord(%root, 0); %y += getWord(%root, 1); general_centerx.setValue(%x); general_centery.setValue(%y); Heightfield::saveTab(); } function ExportHeightfield::onAction() { error("Time to export the heightfield..."); if (Heightfield_operation.getSelectedId() != -1) { $TerraformerSaveRegister = getWord(Heightfield_operation.getValue(), 0); Heightfield::saveBitmap(""); } } PK !(11gui/TerraformerTextureGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TerraformerTextureGui) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiFrameSetCtrl(TextureRootFrame) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 30"; extent = "640 450"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; columns = "0 279 374"; rows = "0"; borderWidth = "4"; borderColor = "0 52 56 255"; borderEnable = "alwaysOff"; borderMovable = "alwaysOff"; autoBalance = "0"; new GuiFrameSetCtrl(TextureLeftFrame) { profile = "GuiDefaultProfile"; horizSizing = "left"; vertSizing = "height"; position = "0 0"; extent = "275 450"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; columns = "0"; rows = "0 250 350"; borderWidth = "4"; borderColor = "0 52 56 255"; borderEnable = "alwaysOff"; borderMovable = "alwaysOff"; autoBalance = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "275 246"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiBigTextProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "44 -2"; extent = "186 40"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Texture Editor"; }; new GuiScrollCtrl(TextureTabParent) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 35"; extent = "266 205"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "1"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "264 203"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiControl(tab_DistortMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 202"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "126 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Fractal Distortion Settings:"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 97"; extent = "77 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "dmask_seed.setValue(terraFormer.generateSeed());Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "New Seed"; }; new GuiTextEditCtrl(dmask_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 71"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "0"; historySize = "5"; maxLength = "255"; }; new GuiTextEditSliderCtrl(dmask_rough) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 47"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; maxLength = "255"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; new GuiTextEditSliderCtrl(dmask_interval) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 23"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; maxLength = "255"; format = "%1.0f"; range = "3 36"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "90 23"; extent = "71 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Hill Frequency:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "103 47"; extent = "58 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Roughness:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "91 71"; extent = "70 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Random Seed:"; }; new GuiFilterCtrl(dmask_filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 96"; extent = "143 93"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; controlPoints = "7"; filter = "0.000000 0.166667 0.333333 0.500000 0.666667 0.833333 1.000000"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "173 165"; extent = "64 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "dmask_filter.controlPoints"; command = "dmask_filter.controlPoints = $ThisControl.getValue();Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; historySize = "0"; maxLength = "255"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "173 147"; extent = "69 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Control Points:"; }; }; new GuiControl(tab_FractalMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 202"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "106 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Fractal Mask Settings:"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 96"; extent = "77 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "fBmmask_seed.setValue(terraFormer.generateSeed());Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "New Seed"; }; new GuiTextEditCtrl(fBmmask_seed) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 70"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "0"; historySize = "5"; maxLength = "255"; }; new GuiTextEditSliderCtrl(fbmmask_rough) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 46"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; maxLength = "255"; format = "%0.3f"; range = "0 1"; increment = "0.001"; }; new GuiTextEditSliderCtrl(fbmmask_interval) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 22"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; maxLength = "255"; format = "%1.0f"; range = "3 36"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "92 22"; extent = "71 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Hill Frequency:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "105 46"; extent = "58 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Roughness:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "93 70"; extent = "70 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Random Seed:"; }; new GuiFilterCtrl(fBmmask_filter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 94"; extent = "147 98"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; controlPoints = "7"; filter = "0.000000 0.166670 0.333330 0.500000 0.666670 0.833330 1.000000"; }; new GuiCheckBoxCtrl(fBmDistort) { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "166 122"; extent = "82 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "Use Distortion"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 174"; extent = "64 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "fBmmask_filter.controlPoints"; command = "fBmmask_filter.controlPoints = $ThisControl.getValue();Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; historySize = "0"; maxLength = "255"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 155"; extent = "69 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Control Points:"; }; }; new GuiControl(tab_HeightMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 200"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "103 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Height Mask Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 26"; extent = "26 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Filter:"; }; new GuiFilterCtrl(TextureHeightFilter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "46 26"; extent = "130 130"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; controlPoints = "6"; filter = "0.000000 0.200000 0.400000 0.600000 0.800000 1.000000"; }; new GuiCheckBoxCtrl(heightDistort) { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "45 165"; extent = "129 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "Use Fractal Distortion"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "185 134"; extent = "64 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "TextureHeightFilter.controlPoints"; command = "TextureHeightFilter.controlPoints = $ThisControl.getValue();Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; historySize = "0"; maxLength = "255"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "185 115"; extent = "69 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Control Points:"; }; }; new GuiControl(tab_SlopeMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 200"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "100 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Slope Mask Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 26"; extent = "26 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Filter:"; }; new GuiFilterCtrl(TextureSlopeFilter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "45 27"; extent = "130 130"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; controlPoints = "7"; filter = "0.000000 0.166667 0.333333 0.500000 0.666667 0.833333 1.000000"; }; new GuiCheckBoxCtrl(slopeDistort) { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "44 166"; extent = "129 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "Use Fractal Distortion"; }; new GuiTextEditSliderCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "185 134"; extent = "64 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "TextureSlopeFilter.controlPoints"; command = "TextureSlopeFilter.controlPoints = $ThisControl.getValue();Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; historySize = "0"; maxLength = "255"; format = "%3.0f"; range = "2 20"; increment = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "185 115"; extent = "69 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Control Points:"; }; }; new GuiControl(tab_WaterMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 200"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "131 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Water Level Mask Settings:"; }; new GuiCheckBoxCtrl(waterDistort) { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "63 165"; extent = "129 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "Use Fractal Distortion"; }; }; new GuiControl(tab_ShorelineMask) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "261 200"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 1"; extent = "131 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Shoreline Mask Settings:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 46"; extent = "10 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Tolerance (meters):"; }; new GuiTextEditSliderCtrl(shorelineTolerance) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "168 46"; extent = "78 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; maxLength = "255"; format = "%3.1f"; range = "0 100"; increment = "1.0"; }; new GuiCheckBoxCtrl(shorelineDistort) { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "63 165"; extent = "129 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::saveOperation();Texture::previewOperation();"; helpTag = "0"; text = "Use Fractal Distortion"; }; }; }; }; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 250"; extent = "275 96"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiPopUpMenuCtrl(Texture_material_menu) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "199 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Options"; maxPopupHeight = "200"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "205 3"; extent = "53 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::deleteMaterial();"; helpTag = "0"; text = "Delete"; }; new GuiScrollCtrl() { profile = "GuiButtonProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "5 27"; extent = "266 65"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "1"; new GuiScrollContentCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "264 63"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextListCtrl(Texture_material) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "9 8"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "1"; }; }; }; }; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 350"; extent = "275 100"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiPopUpMenuCtrl(Texture_operation_menu) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "199 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Options"; maxPopupHeight = "200"; setText = "false"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "205 3"; extent = "53 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::deleteOperation();"; helpTag = "0"; text = "Delete"; }; new GuiScrollCtrl() { profile = "GuiButtonProfile"; horizSizing = "width"; vertSizing = "height"; position = "5 27"; extent = "266 65"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "1"; new GuiScrollContentCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "1 1"; extent = "264 63"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextListCtrl(Texture_operation) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 1"; extent = "9 8"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; enumerate = "0"; resizeCell = "1"; columns = "1"; }; }; }; }; }; new GuiFrameSetCtrl(TextureCenterFrame) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "height"; position = "279 0"; extent = "91 450"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; columns = "0"; rows = "0"; borderWidth = "4"; borderColor = "0 52 56 255"; borderEnable = "alwaysOff"; borderMovable = "alwaysOff"; autoBalance = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "91 450"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiControl() { profile = "GuiCheckBoxProfile"; horizSizing = "center"; vertSizing = "bottom"; position = "4 2"; extent = "82 445"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 27"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::load(Lush);"; helpTag = "0"; text = "Lush"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 52"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::load(Swamp);"; helpTag = "0"; text = "Swamp"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 77"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::load(BadLands);"; helpTag = "0"; text = "BadLands"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 102"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::load(Ice);"; helpTag = "0"; text = "Ice"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 127"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::load(Desert);"; helpTag = "0"; text = "Desert"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 152"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::load(Lava);"; helpTag = "0"; text = "Lava"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 400"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "TerraformerGui.setView(HeightfieldView);"; helpTag = "0"; text = "Heightfield"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 275"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::applyMaterials();"; helpTag = "0"; text = "Apply"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 332"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::save();"; helpTag = "0"; text = "Save"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 309"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Texture::load();"; helpTag = "0"; text = "Load"; }; new GuiCheckBoxCtrl(doTestBmp) { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 216"; extent = "74 21"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "test bmp"; command = "$terrainTestBmp = $ThisControl.getValue();"; }; }; }; }; new GuiFrameSetCtrl(TextureRightFrame) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "height"; position = "374 0"; extent = "266 450"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; columns = "0"; rows = "0 266"; borderWidth = "2"; borderColor = "0 52 56 255"; borderEnable = "alwaysOff"; borderMovable = "alwaysOff"; autoBalance = "0"; new GuiControl() { profile = "GuiContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "266 264"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTerrPreviewCtrl(TexturePreview) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 4"; extent = "256 256"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; }; new GuiControl() { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 266"; extent = "266 184"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GameTSCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 4"; extent = "255 204"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; }; }; }; }; }; //--- OBJECT WRITE END --- $nextTextureId = 1; $nextTextureRegister = 1000; $selectedMaterial = -1; $selectedTextureOperation = -1; //-------------------------------------- function TerraformerTextureGui::init(%this) { Texture_material_menu.clear(); Texture_material_menu.setText("Materials"); %index = 0; %search = "textures/terrain/*.png"; for(%file = findFirstFile(%search); %file !$= ""; %file = findNextFile(%search)) { %file = fileBase(%file); Texture_material_menu.add(%file, %index++); } Texture_material_menu.sort(); Texture_operation_menu.clear(); Texture_operation_menu.setText("Placement Operations"); Texture_operation_menu.add("Place by Fractal", 1); Texture_operation_menu.add("Place by Height", 2); Texture_operation_menu.add("Place by Slope", 3); Texture_operation_menu.add("Place by Water Level", 4); Texture_operation_menu.add("Place by Shoreline", 5); %this.refresh(); } function TerraformerTextureGui::refresh(%this) { $HeightfieldSrcRegister = Heightfield_operation.rowCount()-1; // sync up the preview windows TexturePreview.setValue(HeightfieldPreview.getValue()); if (Texture_material.rowCount() == 0) { Texture_operation.clear(); $nextTextureRegister = 1000; } else { // it's difficult to tell if the heightfield was modified so // just in case flag all dependent operations as dirty. %rowCount = Texture_material.rowCount(); for (%row = 0; %row < %rowCount; %row++) { %data = Texture_material.getRowText(%row); %entry= getRecord(%data,0); %reg = getField(%entry,1); $dirtyTexture[ %reg ] = true; %opCount = getRecordCount(%data); for (%op = 2; %op < %opCount; %op++) { %entry= getRecord(%data,%op); %label= getField(%entry,0); if (%label !$= "Place by Fractal" && %label !$= "Fractal Distortion") { %reg = getField(%entry,2); $dirtyTexture[ %reg ] = true; } } } Texture::previewMaterial(); } } //-------------------------------------- function Texture_material_menu::onSelect(%this, %id, %text) { %this.setText("Materials"); // FORMAT // material name // register // operation // name // tab name // register // distortion register // {field,value}, ... // operation // ... Texture::saveMaterial(); Texture::hideTab(); %id = Texture::addMaterial(%text @ "\t" @ $nextTextureRegister++); if (%id != -1) { Texture_material.setSelectedById(%id); Texture::addOperation("Fractal Distortion\ttab_DistortMask\t" @ $nextTextureRegister++ @ "\t0\tdmask_interval\t20\tdmask_rough\t0\tdmask_seed\t" @ terraFormer.generateSeed() @ "\tdmask_filter\t0.00000 0.00000 0.13750 0.487500 0.86250 1.00000 1.00000"); } } //-------------------------------------- function Texture_material::onSelect(%this, %id, %text) { Texture::saveMaterial(); if (%id != $selectedMaterial) { $selectedTextureOperation = -1; Texture_operation.clear(); Texture::hideTab(); Texture::restoreMaterial(%id); } Texture::previewMaterial(%id); $selectedMaterial = %id; $selectedTextureOperation = -1; Texture_operation.clearSelection(); } //-------------------------------------- function Texture_operation_menu::onSelect(%this, %id, %text) { %this.setText("Placement Operations"); %id = -1; if ($selectedMaterial == -1) return; %dreg = getField(Texture_operation.getRowText(0),2); switch$ (%text) { case "Place by Fractal": %id = Texture::addOperation("Place by Fractal\ttab_FractalMask\t" @ $nextTextureRegister++ @ "\t" @ %dreg @ "\tfbmmask_interval\t16\tfbmmask_rough\t0.000\tfbmmask_seed\t" @ terraFormer.generateSeed() @ "\tfbmmask_filter\t0.000000 0.166667 0.333333 0.500000 0.666667 0.833333 1.000000\tfBmDistort\ttrue"); case "Place by Height": %id = Texture::addOperation("Place by Height\ttab_HeightMask\t" @ $nextTextureRegister++ @ "\t" @ %dreg @ "\ttextureHeightFilter\t0 0.2 0.4 0.6 0.8 1.0\theightDistort\ttrue"); case "Place by Slope": %id = Texture::addOperation("Place by Slope\ttab_SlopeMask\t" @ $nextTextureRegister++ @ "\t" @ %dreg @ "\ttextureSlopeFilter\t0 0.2 0.4 0.6 0.8 1.0\tslopeDistort\ttrue"); case "Place by Water Level": %id = Texture::addOperation("Place by Water Level\ttab_WaterMask\t" @ $nextTextureRegister++ @ "\t" @ %dreg @ "\twaterDistort\ttrue"); case "Place by Shoreline": %id = Texture::addOperation("Place by Shoreline\ttab_ShorelineMask\t" @ $nextTextureRegister++ @ "\t" @ %dreg @ "\tshorelineTolerance\t10\tshorelineDistort\ttrue"); } // select it Texture::hideTab(); if (%id != -1) Texture_operation.setSelectedById(%id); } //-------------------------------------- function Texture_operation::onSelect(%this, %id, %text) { Texture::saveOperation(); if (%id !$= $selectedTextureOperation) { Texture::hideTab(); Texture::restoreOperation(%id); Texture::showTab(%id); } Texture::previewOperation(%id); $selectedTextureOperation = %id; } //-------------------------------------- function Texture::deleteMaterial(%id) { if (%id $= "") %id = $selectedMaterial; if (%id == -1) return; %row = Texture_material.getRowNumById(%id); Texture_material.removeRow(%row); // find the next row to select %rowCount = Texture_material.rowCount()-1; if (%row > %rowCount) %row = %rowCount; if (%id == $selectedMaterial) $selectedMaterial = -1; Texture_operation.clear(); %id = Texture_material.getRowId(%row); Texture_material.setSelectedById(%id); } //-------------------------------------- function Texture::deleteOperation(%id) { if (%id $= "") %id = $selectedTextureOperation; if (%id == -1) return; %row = Texture_operation.getRowNumById(%id); // don't delete the first entry if (%row == 0) return; Texture_operation.removeRow(%row); // find the next row to select %rowCount = Texture_operation.rowCount()-1; if (%row > %rowCount) %row = %rowCount; if (%id == $selectedTextureOperation) $selectedTextureOperation = -1; %id = Texture_operation.getRowId(%row); Texture_operation.setSelectedById(%id); } //-------------------------------------- function Texture::applyMaterials() { Texture::saveMaterial(); %count = Texture_material.rowCount(); if (%count > 0) { %data = getRecord(Texture_material.getRowText(0),0); %mat_list = getField( %data, 0); %reg_list = getField( %data, 1); Texture::evalMaterial(Texture_material.getRowId(0)); for (%i=1; %i<%count; %i++) { Texture::evalMaterial(Texture_material.getRowId(%i)); %data = getRecord(Texture_material.getRowText(%i),0); %mat_list = %mat_list @ " " @ getField( %data, 0); %reg_list = %reg_list @ " " @ getField( %data, 1); } terraformer.setMaterials(%reg_list, %mat_list); } } //-------------------------------------- function Texture::previewMaterial(%id) { if (%id $= "") %id = $selectedMaterial; if (%id == -1) return; %data = Texture_material.getRowTextById(%id); %row = Texture_material.getRowNumById(%id); %reg = getField(getRecord(%data,0),1); Texture::evalMaterial(%id); terraformer.preview(TexturePreview, %reg); } //-------------------------------------- function Texture::evalMaterial(%id) { if (%id $= "") %id = $selectedMaterial; if (%id == -1) return; %data = Texture_material.getRowTextbyId(%id); %reg = getField(getRecord(%data,0), 1); // make sure all operation on this material are up to date // and accumulate register data for each %opCount = getRecordCount(%data); if (%opCount >= 2) // record0=material record1=fractal { %entry = getRecord(%data, 1); Texture::evalOperationData(%entry, 1); for (%op=2; %op<%opCount; %op++) { %entry = getRecord(%data, %op); %reg_list = %reg_list @ getField(%entry, 2) @ " "; Texture::evalOperationData(%entry, %op); } // merge the masks in to the dst reg terraformer.mergeMasks(%reg_list, %reg); } } //-------------------------------------- function Texture::evalOperation(%id) { if (%id $= "") %id = $selectedTextureOperation; if (%id == -1) return; %data = Texture_operation.getRowTextById(%id); %row = Texture_operation.getRowNumById(%id); if (%row != 0) Texture::evalOperation( Texture_operation.getRowId(0) ); Texture::evalOperationData(%data, %row); } //-------------------------------------- function Texture::evalOperationData(%data, %row) { %label = getField(%data, 0); %reg = getField(%data, 2); %dreg = getField(%data, 3); %id = Texture_material.getRowId(%row); if ( $dirtyTexture[%reg] == false ) { return; } switch$ (%label) { case "Fractal Distortion": terraformer.maskFBm( %reg, getField(%data,5), getField(%data,7), getField(%data,9), getField(%data,11), false, 0 ); case "Place by Fractal": terraformer.maskFBm( %reg, getField(%data,5), getField(%data,7), getField(%data,9), getField(%data,11), getField(%data,13), %dreg ); case "Place by Height": terraformer.maskHeight( $HeightfieldSrcRegister, %reg, getField(%data,5), getField(%data,7), %dreg ); case "Place by Slope": terraformer.maskSlope( $HeightfieldSrcRegister, %reg, getField(%data,5), getField(%data,7), %dreg ); case "Place by Water Level": terraformer.maskWater( $HeightfieldSrcRegister, %reg, getField(%data,5), %dreg ); case "Place by Shoreline": terraformer.maskShoreline( $HeightfieldSrcRegister, %reg, getField(%data,5), getField(%data, 7), %dreg ); } $dirtyTexture[%reg] = false; } //-------------------------------------- function Texture::previewOperation(%id) { if (%id $= "") %id = $selectedTextureOperation; if (%id == -1) return; %row = Texture_operation.getRowNumById(%id); %data = Texture_operation.getRowText(%row); %reg = getField(%data,2); Texture::evalOperation(%id); terraformer.preview(TexturePreview, %reg); } //-------------------------------------- function Texture::restoreMaterial(%id) { if (%id == -1) return; %data = Texture_material.getRowTextById(%id); Texture_operation.clear(); %recordCount = getRecordCount(%data); for (%record=1; %record<%recordCount; %record++) { %entry = getRecord(%data, %record); Texture_operation.addRow($nextTextureId++, %entry); } } //-------------------------------------- function Texture::saveMaterial() { %id = $selectedMaterial; if (%id == -1) return; Texture::SaveOperation(); %data = Texture_Material.getRowTextById(%id); %newData = getRecord(%data,0); %rowCount = Texture_Operation.rowCount(); for (%row=0; %row<%rowCount; %row++) %newdata = %newdata @ "\n" @ Texture_Operation.getRowText(%row); Texture_Material.setRowById(%id, %newdata); } //-------------------------------------- function Texture::restoreOperation(%id) { if (%id == -1) return; %data = Texture_operation.getRowTextById(%id); %fieldCount = getFieldCount(%data); for (%field=4; %field<%fieldCount; %field += 2) { %obj = getField(%data, %field); %obj.setValue( getField(%data, %field+1) ); } } //-------------------------------------- function Texture::saveOperation() { %id = $selectedTextureOperation; if (%id == -1) return; %data = Texture_operation.getRowTextById(%id); %newData = getField(%data,0) @ "\t" @ getField(%data,1) @ "\t" @ getField(%data,2) @ "\t" @ getField(%data,3); // go through each object and update its value %fieldCount = getFieldCount(%data); for (%field=4; %field<%fieldCount; %field += 2) { %obj = getField(%data, %field); %newdata = %newdata @ "\t" @ %obj @ "\t" @ %obj.getValue(); } %dirty = (%data !$= %newdata); %reg = getField(%data, 2); $dirtyTexture[%reg] = %dirty; Texture_operation.setRowById(%id, %newdata); // mark the material register as dirty too if (%dirty == true) { %data = Texture_Material.getRowTextById($selectedMaterial); %reg = getField(getRecord(%data,0), 1); $dirtyTexture[ %reg ] = true; } // if row is zero the fractal mask was modified // mark everything else in the list as dirty %row = Texture_material.getRowNumById(%id); if (%row == 0) { %rowCount = Texture_operation.rowCount(); for (%r=1; %r<%rowCount; %r++) { %data = Texture_operation.getRowText(%r); $dirtyTexture[ getField(%data,2) ] = true; } } } //-------------------------------------- function Texture::addMaterial(%entry) { %id = $nextTextureId++; Texture_material.addRow(%id, %entry); %reg = getField(%entry, 1); $dirtyTexture[%reg] = true; return %id; } //-------------------------------------- function Texture::addOperation(%entry) { // Assumes: operation is being added to selected material %id = $nextTextureId++; Texture_operation.addRow(%id, %entry); %reg = getField(%entry, 2); $dirtyTexture[%reg] = true; return %id; } //-------------------------------------- function Texture::save(%name) { Texture::saveMaterial(); if(%name $= "") getSaveFilename("terrains/texture/*cs", "Texture::doSaveTexture"); else Texture::doSaveTexture(%name); } //-------------------------------------- function Texture::doSaveTexture(%name) { %name = fileBase(%name); if (%name $= "") return; new fileObject("saveFile"); saveFile.openForWrite("terrains/texture/" @ %name @ ".cs"); // loop through each operation and save it to disk %rowCount = Texture_material.rowCount(); for(%row = 0; %row < %rowCount; %row++) { %data = Texture_material.getRowText(%row); %data = "Texture::addMaterial(\"" @ expandEscape(%data) @ "\");"; saveFile.writeLine(%data); } saveFile.close(); saveFile.delete(); } //-------------------------------------- function Texture::load(%name) { if(%name $= "") getLoadFilename("terrains/texture/*cs", "Texture::doLoadTexture"); else Texture::doLoadTexture(%name); } //-------------------------------------- function Texture::doLoadTexture(%name) { %name = fileBase(%name); if (%name $= "") return; %name = "terrains/texture/" @ %name @ ".cs"; Texture_material.clear(); Texture_operation.clear(); $selectedMaterial = -1; $selectedTextureOperation = -1; if ( !exec(%name) ) { // if there was a problem executing the script restore // the operations list to a known state Texture_material.clear(); Texture_operation.clear(); } else { // initialize dirty register array // patch up register usage // ...and deterime what the next register should be. $nextTextureRegister = 1000; %rowCount = Texture_material.rowCount(); for (%row = 0; %row < %rowCount; %row++) { $dirtyTexture[ $nextTextureRegister ] = true; %data = Texture_material.getRowText(%row); %rec = getRecord(%data, 0); %rec = setField(%rec, 1, $nextTextureRegister); %data = setRecord(%data, 0, %rec); $nextTextureRegister++; %opCount = getRecordCount(%data); for (%op = 1; %op < %opCount; %op++) { if (%op == 1) %frac_reg = $nextTextureRegister; $dirtyTexture[ $nextTextureRegister ] = true; %rec = getRecord(%data,%op); %rec = setField(%rec, 2, $nextTextureRegister); %rec = setField(%rec, 3, %frac_reg); %data = setRecord(%data, %op, %rec); $nextTextureRegister++; } %id = Texture_material.getRowId(%row); Texture_material.setRowById(%id, %data); } $selectedMaterial = -1; Texture_material.setSelectedById(Texture_material.getRowId(0)); } } //-------------------------------------- function Texture::hideTab() { tab_DistortMask.setVisible(false); tab_FractalMask.setVisible(false); tab_HeightMask.setVisible(false); tab_SlopeMask.setVisible(false); tab_waterMask.setVisible(false); tab_shorelineMask.setVisible(false); } //-------------------------------------- function Texture::showTab(%id) { Texture::hideTab(); %data = Texture_operation.getRowTextById(%id); %tab = getField(%data,1); %tab.setVisible(true); } PK !(**!gui/TerrainEditorButtonbarDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(terraineditorbuttonbardlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiChunkedBitmapCtrl() { profile = "EditorContentProfile"; horizSizing = "right"; vertSizing = "height"; position = "0 30"; extent = "90 449"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 4"; extent = "84 119"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 38"; extent = "32 32"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.undo();"; helpTag = "0"; text = "Undo"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 3"; extent = "32 32"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.pushDialog(EditorSaveMissionDlg);"; helpTag = "0"; text = "Save"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "43 38"; extent = "32 32"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.redo();"; helpTag = "0"; text = "Redo"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 94"; extent = "60 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.resetSelWeights(true);"; helpTag = "0"; text = "Reset Sel"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 72"; extent = "60 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.clearSelection();"; helpTag = "0"; text = "Clear Sel"; }; new GuiButtonCtrl(TELoadTerrainButton) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "43 3"; extent = "32 32"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Load"; }; }; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 125"; extent = "84 185"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiRadioCtrl(TELowerHeightActionRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 22"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.processActionRadio(lowerHeight);"; helpTag = "0"; text = "Lower"; groupNum = "0"; }; new GuiRadioCtrl(TERaiseHeightActionRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 2"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.processActionRadio(raiseHeight);"; helpTag = "0"; text = "Raise"; groupNum = "0"; }; new GuiRadioCtrl(TESetHeightActionRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 42"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.processActionRadio(setHeight);"; helpTag = "0"; text = "Set Height"; groupNum = "0"; }; new GuiRadioCtrl(TESetEmptyActionRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 62"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.processActionRadio(setEmpty);"; helpTag = "0"; text = "Set Empty"; groupNum = "0"; }; new GuiRadioCtrl(TEClearEmptyActionRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 82"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.processActionRadio(clearEmpty);"; helpTag = "0"; text = "Clear Empty"; groupNum = "0"; }; new GuiRadioCtrl(TEFlattenHeightActionRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 102"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.processActionRadio(flattenHeight);"; helpTag = "0"; text = "Flatten"; groupNum = "0"; }; new GuiRadioCtrl(TESmoothHeightActionRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 122"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.processActionRadio(smoothHeight);"; helpTag = "0"; text = "Smooth"; groupNum = "0"; }; new GuiRadioCtrl(TESetMaterialActionRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 142"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.processActionRadio(setMaterialGroup);"; helpTag = "0"; text = "Set Material"; groupNum = "0"; }; new GuiRadioCtrl(TEAdjustHeightActionRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 162"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.processActionRadio(brushAdjustHeight);"; helpTag = "0"; text = "Adjust Height"; groupNum = "0"; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 312"; extent = "75 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.pushDialog(TerrainEditorValuesSettingsGui, 99);"; helpTag = "0"; text = "Settings..."; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 334"; extent = "75 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.pushDialog(TerrainEditorTextureSelectGui, 99);"; helpTag = "0"; text = "Material..."; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 356"; extent = "75 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.clearModifiedFlags();"; helpTag = "0"; text = "Clear Modified"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 405"; extent = "73 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Camera speed:"; }; new GuiSliderCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "5 420"; extent = "80 20"; minExtent = "80 20"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "value"; command = "$Camera::movementSpeed = $ThisControl.getValue();"; helpTag = "0"; range = "5.000000 200.000000"; ticks = "10"; value = "149.857"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 378"; extent = "75 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "tEditor.swapInLoneMaterial(\"terrain.outline\");"; helpTag = "0"; text = "Swap Outline"; }; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function TerrainEditorButtonBarDlg::init(%this) { } //------------------------------------------------------------------------------ function TerrainEditor::processActionRadio(%this, %name) { %this.currentAction = %name; switch$(%this.currentMode) { case "select": %this.processAction(%name); case "paint": %this.setAction(%name); if(%this.processUsesBrush) %this.processAction(%name); case "adjust": %this.processAction(%name); } // switch$(%this.currentAction) { case "setEmpty": %this.renderVertexSelection = false; case "clearEmpty": %this.renderVertexSelection = false; case "setMaterialGroup": %this.renderVertexSelection = false; default: %this.renderVertexSelection = true; } } //------------------------------------------------------------------------------ function TELoadTerrainButton::onAction(%this) { getLoadFilename("terrains/*.ter", %this @ ".gotFileName"); } function TELoadTerrainButton::gotFileName(%this, %name) { // %pos = "0 0 0"; %squareSize = "8"; %visibleDistance = "1200"; // delete current if(isObject(terrain)) { %pos = terrain.position; %squareSize = terrain.squareSize; %visibleDistance = terrain.visibleDistance; terrain.delete(); } // create new new TerrainBlock(terrain) { position = %pos; terrainFile = %name; squareSize = %squareSize; visibleDistance = %visibleDistance; }; tEditor.attachTerrain(); } PK !(]@@$gui/TerrainEditorExtraToolbarDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TerrainEditorExtraToolbarDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "90 30"; extent = "550 420"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 3"; extent = "249 24"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiRadioCtrl(TEPaintModeRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 2"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Paint"; groupNum = "0"; }; new GuiRadioCtrl(TESelectModeRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 2"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Select"; groupNum = "0"; }; new GuiRadioCtrl(TEAdjustModeRadio) { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 2"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Adjust Sel"; groupNum = "0"; }; }; new GuiPopUpMenuCtrl(TEBrushSizeMenu) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "424 6"; extent = "80 20"; minExtent = "80 20"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Brush Size"; maxPopupHeight = "200"; }; new GuiPopUpMenuCtrl(TEBrushTypeMenu) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "341 6"; extent = "80 20"; minExtent = "80 20"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Brush Type"; maxPopupHeight = "200"; }; new GuiCheckBoxCtrl() { profile = "GuiRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "255 5"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Soft Brush"; variable = "tEditor.enableSoftBrushes"; command = "tEditor.enableSoftBrushes = $ThisControl.getValue();"; }; }; }; //--- OBJECT WRITE END --- function TerrainEditorExtraToolbarDlg::init(%this) { %this.updateCurrentMode(); %this.updateCurrentAction(); %this.initMenus(); } function TerrainEditorExtraToolbarDlg::initMenus(%this) { // TEBrushTypeMenu.clear(); TEBrushTypeMenu.add("Box Brush", 0); TEBrushTypeMenu.add("Circle Brush", 1); TEBrushTypeMenu.setText("Brush Type"); // TEBrushSizeMenu.clear(); TEBrushSizeMenu.setText("Brush Size"); for(%i = 0; %i < 6; %i++) TEBrushSizeMenu.add("Level " @ %i, %i); } //------------------------------------------------------------------------------ function TEBrushSizeMenu::onSelect(%this, %id, %text) { %this.setText("Brush Size"); tEditor.setBrushSize(1 << %id, 1 << %id); } function TEBrushTypeMenu::onSelect(%this, %id, %text) { %this.setText("Brush Type"); switch(%id) { case 0: tEditor.setBrushType(box); case 1: tEditor.setBrushType(ellipse); } } //------------------------------------------------------------------------------ function TESelectModeRadio::onAction(%this) { tEditor.currentMode = "select"; tEditor.selectionHidden = false; tEditor.setAction("select"); } function TEAdjustModeRadio::onAction(%this) { tEditor.currentMode = "adjust"; tEditor.selectionHidden = false; tEditor.setAction("adjustHeight"); } function TEPaintModeRadio::onAction(%this) { tEditor.currentMode = "paint"; tEditor.selectionHidden = true; tEditor.setAction(tEditor.currentAction); } //------------------------------------------------------------------------------ function TerrainEditorExtraToolbarDlg::updateCurrentMode(%this) { switch$(tEditor.currentMode) { case "select": TESelectModeRadio.setValue(1); case "adjust": TEAdjustModeRadio.setValue(1); case "paint": TEPaintModeRadio.setValue(1); } } function TerrainEditorExtraToolbarDlg::updateCurrentAction(%this) { switch$(tEditor.currentAction) { case "raiseHeight": TERaiseHeightActionRadio.setValue(1); case "lowerHeight": TELowerHeightActionRadio.setValue(1); case "setHeight": TESetHeightActionRadio.setValue(1); case "setEmpty": TESetEmptyActionRadio.setValue(1); case "clearEmpty": TEClearEmptyActionRadio.setValue(1); case "flattenHeight": TEFlattenHeightActionRadio.setValue(1); case "smoothHeight": TESmoothHeightActionRadio.setValue(1); case "setMaterialGroup": TESetMaterialActionRadio.setValue(1); case "brushAdjustHeight": TEAdjustHeightActionRadio.setValue(1); } }PK !()Ѱ gui/TerrainEditorFramesetDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TerrainEditorFrameSetDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiFrameSetCtrl(TerrainEditorFrameSet) { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "90 60"; extent = "550 390"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; columns = "0 420"; rows = "0"; borderWidth = "4"; borderColor = "206 206 206 206"; borderEnable = "dynamic"; borderMovable = "dynamic"; autoBalance = "0"; new GuiControl(TerrainEditorFrame) { profile = "EditTSControlProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "420 390"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; borderWidth = "2"; }; new GuiFrameSetCtrl(TerrainEditorToolFrameSet) { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "420 0"; extent = "130 390"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; columns = "0"; rows = "0"; borderWidth = "2"; borderColor = "206 206 206 206"; borderEnable = "dynamic"; borderMovable = "dynamic"; autoBalance = "0"; }; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function TerrainEditorFrameSetDlg::getPrefs(%this) { %toolPaneOffset = getPrefSetting($Pref::TerrainEditor::toolPaneOffset, 420); %toolCount = getPrefSetting($Pref::TerrainEditor::activeToolCount, 0); // set the tools for(%i = 0; %i < %toolCount; %i++) { if($pref::TerrainEditor::activeTool[%i] $= "") return; %this.addTool(getWord($pref::TerrainEditor::activeTool[%i], 0)); %offsets[%i] = getWord($pref::TerrainEditor::activeTool[%i], 1); } for(%i = 0; %i < %toolCount; %i++) TerrainEditorToolFrameSet.setRowOffset(%i, %offsets[%i]); if(%toolCount) TerrainEditorFrameSet.setColumnOffset(1, %toolPaneOffset); } function TerrainEditorFrameSetDlg::setPrefs(%this) { // if(TerrainEditorFrameSet.getColumnCount() > 1) $pref::TerrainEditor::toolPaneOffset = TerrainEditorFrameSet.getColumnOffset(1); else $pref::TerrainEditor::toolPaneOffset = %this.toolPaneOffset; $pref::TerrainEditor::activeToolCount = %this.activeToolCount; %tools = TerrainEditorToolFrameSet; for(%i = 0; %i < %this.activeToolCount; %i++) { %obj = %tools.getObject(%i); %offset = %tools.getRowOffset(%i); %val = %obj.getName() @ " " @ %offset; $pref::TerrainEditor::activeTool[%i] = %val; } } function TerrainEditorFrameSetDlg::init(%this) { TerrainEditorFrame.add(tEditor); %this.resetFrames(); %this.getPrefs(); } function TerrainEditorFrameSetDlg::onWake(%this) { TerrainEditorMap.push(); %this.getPrefs(); } function TerrainEditorFrameSetDlg::onSleep(%this) { TerrainEditorMap.pop(); %this.setPrefs(); } function TerrainEditorFrameSetDlg::resetFrames(%this) { // update the tool pane %tools = TerrainEditorToolFrameSet; while(%tools.getRowCount() > %tools.getCount()) %tools.removeRow(); while(%tools.getRowCount() < %tools.getCount()) %tools.addRow(); // update the frame view %frameSet = TerrainEditorFrameSet; if(!%tools.getCount() && (%frameSet.getColumnCount() > 1)) { %frameSet.toolPaneOffset = %frameSet.getColumnOffset(1); %frameSet.removeColumn(); } if(%tools.getCount() && (%frameSet.getColumnCount() == 1)) { %frameSet.addColumn(); %frameSet.setColumnOffset(1, %frameSet.toolPaneOffset); } if(%tools.getCount()) %this.toolPaneOffset = TerrainEditorFrameSet.getColumnOffset(1); %this.activeToolCount = %tools.getCount(); } function TerrainEditorFrameSetDlg::addTool(%this, %tool) { TerrainEditorToolFrameSet.add(%tool); %this.resetFrames(); } function TerrainEditorFrameSetDlg::removeTool(%this, %tool) { TerrainEditorToolFrameSet.remove(%tool); %this.resetFrames(); } function TerrainEditorFrameSetDlg::update(%this) { // check the frame to see if it is visible if(TerrainEditorToolFrameSet.getCount()) { %res = getResolution(); // 90 = width of button bar %width = getWord(%res, 0) - 90; if(TerrainEditorFrameSet.getColumnOffset(1) > %width - editor.minToolFrameWidth) TerrainEditorFrameSet.setColumnOffset(1, %width - editor.minToolFrameWidth); } } PK !(QZgui/TerrainEditorGui.gui//--- OBJECT WRITE BEGIN --- new TerrainEditor(tEditor) { profile = ""; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "420 420"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function TerrainEditor::getPrefs(%this) { // persist these... %this.softSelecting = 1; %this.currentAction = "raiseHeight"; %this.currentMode = "select"; } function TerrainEditor::setPrefs(%this) { } function TerrainEditor::init(%this) { %this.getPrefs(); tEditor.attachTerrain(); } function TerrainEditor::onGuiUpdate(%this, %text) { TerrainEditorStatusBarDlg.update(%text); TerrainEditorFrameSetDlg.update(); } function TerrainEditor::offsetBrush(%this, %x, %y) { %curPos = %this.getBrushPos(); %this.setBrushPos(getWord(%curPos, 0) + %x, getWord(%curPos, 1) + %y); } function TerrainEditor::swapInLoneMaterial(%this, %name) { // swapped? if(%this.baseMaterialsSwapped $= "true") { %this.baseMaterialsSwapped = "false"; tEditor.popBaseMaterialInfo(); } else { %this.baseMaterialsSwapped = "true"; %this.pushBaseMaterialInfo(); %this.setLoneBaseMaterial(%name); } // flushTextureCache(); } //------------------------------------------------------------------------------ // keys new ActionMap(TerrainEditorMap); TerrainEditorMap.bindCmd(keyboard, "ctrl z", "tEditor.undo();", ""); TerrainEditorMap.bindCmd(keyboard, "ctrl y", "tEditor.redo();", ""); TerrainEditorMap.bindCmd(keyboard, "left", "tEditor.offsetBrush(-1, 0);", ""); TerrainEditorMap.bindCmd(keyboard, "right", "tEditor.offsetBrush(1, 0);", ""); TerrainEditorMap.bindCmd(keyboard, "up", "tEditor.offsetBrush(0, 1);", ""); TerrainEditorMap.bindCmd(keyboard, "down", "tEditor.offsetBrush(0, -1);", ""); TerrainEditorMap.bindCmd(keyboard, "1", "TERaiseHeightActionRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "2", "TELowerHeightActionRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "3", "TESetHeightActionRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "4", "TESetEmptyActionRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "5", "TEClearEmptyActionRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "6", "TEFlattenHeightActionRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "7", "TESmoothHeightActionRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "8", "TESetMaterialActionRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "9", "TEAdjustHeightActionRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "shift 1", "tEditor.processUsesBrush = true;TERaiseHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", ""); TerrainEditorMap.bindCmd(keyboard, "shift 2", "tEditor.processUsesBrush = true;TELowerHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", ""); TerrainEditorMap.bindCmd(keyboard, "shift 3", "tEditor.processUsesBrush = true;TESetHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", ""); TerrainEditorMap.bindCmd(keyboard, "shift 4", "tEditor.processUsesBrush = true;TESetEmptyActionRadio.setValue(1);tEditor.processUsesBrush = false;", ""); TerrainEditorMap.bindCmd(keyboard, "shift 5", "tEditor.processUsesBrush = true;TEClearEmptyActionRadio.setValue(1);tEditor.processUsesBrush = false;", ""); TerrainEditorMap.bindCmd(keyboard, "shift 6", "tEditor.processUsesBrush = true;TEFlattenHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", ""); TerrainEditorMap.bindCmd(keyboard, "shift 7", "tEditor.processUsesBrush = true;TESmoothHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", ""); TerrainEditorMap.bindCmd(keyboard, "shift 8", "tEditor.processUsesBrush = true;TESetMaterialActionRadio.setValue(1);tEditor.processUsesBrush = false;", ""); TerrainEditorMap.bindCmd(keyboard, "shift 9", "tEditor.processUsesBrush = true;TEAdjustHeightActionRadio.setValue(1);tEditor.processUsesBrush = false;", ""); TerrainEditorMap.bindCmd(keyboard, "h", "TESelectModeRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "j", "TEPaintModeRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "k", "TEAdjustModeRadio.setValue(1);", ""); TerrainEditorMap.bindCmd(keyboard, "o", "Canvas.pushDialog(TerrainEditorValuesSettingsGui, 99);", ""); TerrainEditorMap.bindCmd(keyboard, "m", "Canvas.pushDialog(TerrainEditorTextureSelectGui, 99);", ""); TerrainEditorMap.bindCmd(keyboard, "backspace", "tEditor.clearSelection();", ""); PK !(>϶!gui/TerrainEditorStatusbarDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TerrainEditorStatusbarDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "top"; position = "0 450"; extent = "640 30"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextCtrl(TEMouseBrushInfo) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 6"; extent = "85 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; new GuiTextCtrl(TESelectionInfo) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "209 7"; extent = "65 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function TerrainEditorStatusbarDlg::init(%this) { TEMouseBrushInfo.setValue("Mouse Brush Info"); TESelectionInfo.setValue("Selection Info"); } function TerrainEditorStatusbarDlg::update(%this, %info) { TEMouseBrushInfo.setValue(" (Mouse Brush) #: " @ getWord(%info, 0) @ " avg: " @ getWord(%info, 1)); TESelectionInfo.setValue(" (Selection) #: " @ getWord(%info, 2) @ " avg: " @ getWord(%info, 3)); } PK !(%gui/TerrainEditorTextureSelectGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TerrainEditorTextureSelectGui) { profile = "GuiDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "134 84"; extent = "217 286"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Texture group selection"; resizeWidth = "0"; resizeHeight = "0"; canMove = "1"; canClose = "1"; canMinimize = "0"; canMaximize = "0"; minSize = "50 50"; closeCommand = "Canvas.popDialog(TerrainEditorTextureSelectGui);"; new GuiControl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 50"; extent = "200 200"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiBitmapCtrl(TerrainTextureBitmapCtrl) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "200 200"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; wrap = "0"; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "113 257"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "setGroupIndex(TextureSelectionSlider.getValue());Canvas.popDialog(TerrainEditorTextureSelectGui);"; helpTag = "0"; text = "Ok"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "23 257"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.popDialog(TerrainEditorTextureSelectGui);"; helpTag = "0"; text = "Cancel"; }; new GuiSliderCtrl(TextureSelectionSlider) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 24"; extent = "200 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "value"; command = "setTextureBitmap($ThisControl.getValue());"; helpTag = "0"; range = "0.000000 1.000000"; ticks = "0"; value = "0"; tab = "true"; }; }; }; //--- OBJECT WRITE END --- function TerrainTextureBitmapCtrl::onAction(%this) { // dummy to remove console spam } function TerrainEditorTextureSelectGui::onWake(%this) { %numTextures = tEditor.getNumTextures(); if(%numTextures == 0) return; if(tEditor.materialGroup < 0 || tEditor.materialGroup > %numTextures) tEditor.materialGroup = 0; TextureSelectionSlider.ticks = %numTextures - 1; TextureSelectionSlider.range = "0 " @ %numTextures; TextureSelectionSlider.setValue(tEditor.materialGroup + 0.5); TerrainTextureBitmapCtrl.setBitmap(tEditor.getTextureName(tEditor.materialGroup)); } function setGroupIndex(%val) { %numTextures = tEditor.getNumTextures(); if(%val < 0 || (%val > %numTextures)) return; %group = mFloor(%val); if(%group == %numTextures) %group--; tEditor.materialGroup = %group; } function setTextureBitmap(%val) { %numTextures = tEditor.getNumTextures(); if(%val < 0 || (%val > %numTextures)) return; %idx = mFloor(%val); if(%idx == %numTextures) %idx--; TerrainTextureBitmapCtrl.setBitmap(tEditor.getTextureName(%idx)); } PK !(Sgui/TerrainEditorToolbarDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TerrainEditorToolbarDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "640 30"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiCheckBoxCtrl(TerrainEditorMissionAreaCheckBox) { profile = "GuiRadioProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "541 4"; extent = "93 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "if($ThisControl.getValue()) TerrainEditorFrameSetDlg.addTool(EditorToolMissionAreaGui); else TerrainEditorFrameSetDlg.removeTool(EditorToolMissionAreaGui);"; helpTag = "0"; text = "Mission Area"; }; }; }; //--- OBJECT WRITE END --- function TerrainEditorToolbarDlg::init(%this) { TerrainEditorMissionAreaCheckBox.setValue(TerrainEditorToolFrameSet.isMember(EditorToolMissionAreaGui)); } PK !("O!!!gui/TerrainEditorVSettingsGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TerrainEditorValuesSettingsGui) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "center"; vertSizing = "center"; position = "117 113"; extent = "408 247"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Terrain Action Values"; maxLength = "255"; resizeWidth = "0"; resizeHeight = "0"; canMove = "1"; canClose = "0"; canMinimize = "0"; canMaximize = "0"; minSize = "50 50"; closeCommand = "Canvas.popDIalog(TerrainEditorValuesSettingsGui);"; new GuiControl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "198 27"; extent = "203 115"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 12"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "ETerrainEditor.adjustHeightVal"; command = "ETerrainEditor.adjustHeightVal = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 37"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "ETerrainEditor.setHeightVal"; command = "ETerrainEditor.setHeightVal = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 62"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "ETerrainEditor.scaleVal"; command = "ETerrainEditor.scaleVal = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 87"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "ETerrainEditor.smoothFactor"; command = "ETerrainEditor.smoothFactor = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 12"; extent = "64 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Adjust Height"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 37"; extent = "49 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Set Height"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 62"; extent = "60 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Scale Height"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 87"; extent = "70 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Smooth Factor"; maxLength = "255"; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "218 205"; extent = "80 20"; minExtent = "8 8"; visible = "1"; command = "Canvas.popDIalog(TerrainEditorValuesSettingsGui);"; helpTag = "0"; text = "OK"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiControl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 27"; extent = "188 212"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiFilterCtrl(TESoftSelectFilter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 22"; extent = "155 162"; minExtent = "8 8"; visible = "1"; helpTag = "0"; controlPoints = "7"; filter = "1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 4"; extent = "67 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Soft Selection"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 189"; extent = "8 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "0"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 26"; extent = "8 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "1"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "60 190"; extent = "45 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = ""; maxLength = "255"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "125 187"; extent = "50 18"; minExtent = "8 8"; visible = "1"; variable = "ETerrainEditor.softSelectRadius"; command = "ETerrainEditor.softSelectRadius = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; }; new GuiButtonCtrl(TESettingsApplyButton) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "307 205"; extent = "80 20"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Apply"; groupNum = "-1"; buttonType = "PushButton"; }; }; }; //--- OBJECT WRITE END --- PK !( l11&gui/TerrainEditorValuesSettingsGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TerrainEditorValuesSettingsGui) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "117 113"; extent = "408 247"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Terrain Action Values"; resizeWidth = "0"; resizeHeight = "0"; canMove = "1"; canClose = "1"; canMinimize = "0"; canMaximize = "0"; minSize = "50 50"; closeCommand = "Canvas.popDIalog(TerrainEditorValuesSettingsGui);"; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "197 25"; extent = "203 115"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 12"; extent = "107 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "tEditor.adjustHeightVal"; command = "tEditor.adjustHeightVal = $ThisControl.getValue();"; helpTag = "0"; historySize = "0"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 37"; extent = "107 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "tEditor.setHeightVal"; command = "tEditor.setHeightVal = $ThisControl.getValue();"; helpTag = "0"; historySize = "0"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 62"; extent = "107 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "tEditor.scaleVal"; command = "tEditor.scaleVal = $ThisControl.getValue();"; helpTag = "0"; historySize = "0"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "86 87"; extent = "107 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "tEditor.smoothFactor"; command = "tEditor.smoothFactor = $ThisControl.getValue();"; helpTag = "0"; historySize = "0"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 12"; extent = "64 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Adjust Height"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 37"; extent = "49 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Set Height"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "11 62"; extent = "60 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Scale Height"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 87"; extent = "70 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Smooth Factor"; }; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "218 205"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.popDIalog(TerrainEditorValuesSettingsGui);"; helpTag = "0"; text = "OK"; }; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 25"; extent = "188 212"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiFilterCtrl(TESoftSelectFilter) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 22"; extent = "155 162"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; controlPoints = "7"; filter = "1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 4"; extent = "67 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Soft Selection"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 189"; extent = "8 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "0"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 26"; extent = "8 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "1"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "60 190"; extent = "45 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = ""; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "125 187"; extent = "50 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; variable = "tEditor.softSelectRadius"; command = "tEditor.softSelectRadius = $ThisControl.getValue();"; helpTag = "0"; historySize = "0"; }; }; new GuiButtonCtrl(TESettingsApplyButton) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "307 205"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Apply"; }; }; }; //--- OBJECT WRITE END --- function TerrainEditorSettingsGui::onWake(%this) { TESoftSelectFilter.setValue(tEditor.softSelectFilter); } function TerrainEditorSettingsGui::onSleep(%this) { tEditor.softSelectFilter = TESoftSelectFilter.getValue(); } function TESettingsApplyButton::onAction(%this) { tEditor.softSelectFilter = TESoftSelectFilter.getValue(); tEditor.resetSelWeights(true); tEditor.processAction("softSelect"); }PK !({*  gui/TestGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TestGui) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiControl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "top"; position = "86 239"; extent = "171 194"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiBigTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 13"; extent = "53 40"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; text = "Test"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 85"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.setContent(GuiTestGui);"; helpTag = "0"; text = "GUI Test"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "84 59"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "startShow();"; helpTag = "0"; text = "TS Show"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "70 7"; extent = "94 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "1"; modal = "1"; command = "Canvas.setContent(LaunchGui);"; helpTag = "0"; text = "Back to Launch"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "32 163"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.pushDialog(NewMissionGui, 99);"; helpTag = "0"; text = "Create Mission"; }; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "32 137"; extent = "100 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "Canvas.setContent(EditChatMenuGui);"; helpTag = "0"; text = "Edit Chat Menu"; }; }; }; //--- OBJECT WRITE END --- PK !(UUgui/TrainingGui.gui//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(TrainingGui) { profile = "GuiContentProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$ShellBackground"; helpTag = "0"; useVariable = "1"; new ShellPaneCtrl() { profile = "ShellPaneProfile"; horizSizing = "width"; vertSizing = "height"; position = "12 13"; extent = "620 423"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "TRAINING"; maxLength = "255"; noTitleBar = "0"; new ShellFieldCtrl(TrainingPicFrame) { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "30 186"; extent = "175 175"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiBitmapCtrl(TrainingPic) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "2 3"; extent = "169 169"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; wrap = "0"; }; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "left"; vertSizing = "top"; position = "236 377"; extent = "74 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Difficulty:"; maxLength = "255"; }; new ShellPopupMenu(TrainingDifficultyMenu) { profile = "ShellPopupProfile"; horizSizing = "left"; vertSizing = "top"; position = "307 368"; extent = "137 36"; minExtent = "49 36"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; maxLength = "255"; maxPopupHeight = "200"; buttonBitmap = "gui/shll_pulldown"; rolloverBarBitmap = "gui/shll_pulldownbar_rol"; selectedBarBitmap = "gui/shll_pulldownbar_act"; noButtonStyle = "0"; }; new ShellScrollCtrl() { profile = "NewScrollCtrlProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "26 31"; extent = "183 146"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 7"; extent = "169 132"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellTextList(TrainingMissionList) { profile = "ShellTextArrayProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "169 8"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; enumerate = "1"; resizeCell = "1"; columns = "0 200"; fitParentWidth = "1"; clipColumnText = "0"; }; }; }; new ShellToggleButton(TrainingPlayTgl) { profile = "ShellRadioProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "448 27"; extent = "140 30"; minExtent = "26 27"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$pref::TrainingPlayBriefing"; helpTag = "0"; text = "Play Briefing"; maxLength = "255"; }; new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "444 31"; extent = "122 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "Play Briefing:"; maxLength = "255"; }; new ShellBitmapButton(TrainingPlayBtn) { profile = "SoundTestButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "568 28"; extent = "24 24"; minExtent = "24 24"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "TrainingGui.toggleBriefing();"; helpTag = "0"; simpleStyle = "1"; }; new GuiTextCtrl() { profile = "ShellTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "219 31"; extent = "99 22"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "MISSION BRIEFING"; maxLength = "255"; }; new ShellScrollCtrl(TrainingBriefingScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "214 50"; extent = "378 318"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "3 3"; fieldBase = "gui/shll_field"; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "7 7"; extent = "348 304"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextCtrl(TrainingBriefingText) { profile = "ShellLoadTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "348 18"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "469 368"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "TrainingGui.startTraining();"; helpTag = "0"; text = "START"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !({:gui/TribeAdminMemberDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(TribeAdminMemberDlg) { profile = "DlgBackProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; vTribe = "T2 ADMINISTRATION"; vPerm = "4"; vPlayer = "QIX"; new ShellPaneCtrl() { profile = "ShellDlgPaneProfile"; horizSizing = "center"; vertSizing = "center"; position = "167 110"; extent = "306 260"; minExtent = "48 92"; visible = "1"; helpTag = "0"; text = "MEMBER PROFILE"; maxLength = "255"; noTitleBar = "0"; new ShellTextEditCtrl(E_Title) { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "42 45"; extent = "221 38"; minExtent = "32 38"; visible = "1"; helpTag = "0"; maxLength = "16"; historySize = "0"; password = "0"; glowOffset = "9 9"; }; new GuiTextCtrl(t_whois) { profile = "ShellTopicTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "53 34"; extent = "197 22"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "WARRIOR TITLE"; maxLength = "255"; }; new ShellRadioButton(tb_sysAdmin) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 83"; extent = "205 30"; minExtent = "26 27"; visible = "1"; command = "TAM_onAction(4);"; helpTag = "0"; text = " RANK 4: Tribe Admin 1"; maxLength = "255"; groupNum = "1"; }; new ShellRadioButton(tb_tribeController) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 103"; extent = "205 30"; minExtent = "26 27"; visible = "1"; command = "TAM_onAction(3);"; helpTag = "0"; text = " RANK 3: Tribe Admin 2"; maxLength = "255"; groupNum = "1"; }; new ShellRadioButton(tb_tribeAdmin) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 123"; extent = "205 30"; minExtent = "26 27"; visible = "1"; command = "TAM_onAction(2);"; helpTag = "0"; text = " RANK 2: Tribe Admin 3"; maxLength = "255"; groupNum = "1"; }; new ShellRadioButton(tb_tribeMember) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 143"; extent = "205 30"; minExtent = "26 27"; visible = "1"; command = "TAM_onAction(1);"; helpTag = "0"; text = " RANK 1: Tribe Member"; maxLength = "255"; groupNum = "1"; }; new ShellRadioButton(tb_onProbation) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "47 163"; extent = "205 30"; minExtent = "26 27"; visible = "1"; command = "TAM_onAction(0);"; helpTag = "0"; text = "RANK 0: On Probation"; maxLength = "255"; groupNum = "1"; }; new ShellBitmapButton(b_Cancel) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "43 195"; extent = "115 38"; minExtent = "32 38"; visible = "1"; command = "Canvas.popDialog(TribeAdminMemberDlg);"; accelerator = "escape"; helpTag = "0"; text = "CANCEL"; simpleStyle = "0"; }; new ShellBitmapButton(b_Update) { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "141 195"; extent = "121 38"; minExtent = "32 38"; visible = "1"; command = "SetMemberProfile();"; helpTag = "0"; text = "UPDATE"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !(XII!gui/TribeAndWarriorBrowserGui.gui//--- OBJECT WRITE BEGIN --- new GuiChunkedBitmapCtrl(TribeAndWarriorBrowserGui) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; variable = "$ShellBackground"; helpTag = "0"; useVariable = "1"; new ShellPaneCtrl() { profile = "ShellPaneProfile"; horizSizing = "width"; vertSizing = "height"; position = "12 13"; extent = "620 423"; minExtent = "48 92"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "COMMUNITY BROWSER"; maxLength = "255"; noTitleBar = "0"; new ShellTabFrame(TWBTabFrame) { profile = "ShellHorzTabFrameProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "22 54"; extent = "576 254"; minExtent = "26 254"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; isVertical = "0"; useCloseButton = "0"; edgeInset = "0"; }; new ShellTabGroupCtrl(TWBTabView) { profile = "TabGroupProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "30 25"; extent = "560 29"; minExtent = "38 29"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; glowOffset = "7"; tabSpacing = "2"; maxTabWidth = "150"; stretchToFit = "0"; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "width"; vertSizing = "height"; position = "33 63"; extent = "554 303"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl(TribePane) { profile = "ShellFieldProfile"; horizSizing = "width"; vertSizing = "height"; position = "3 27"; extent = "550 272"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "width"; vertSizing = "height"; position = "237 20"; extent = "310 250"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellScrollCtrl(TWBScroll) { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "2 6"; extent = "306 242"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "5 5"; fieldBase = " "; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "9 9"; extent = "272 224"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextCtrl(TWBText) { profile = "NewTextEditProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "272 262"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "1"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; }; }; new ShellFieldCtrl() { profile = "ShellPaneProfile"; horizSizing = "right"; vertSizing = "height"; position = "3 3"; extent = "234 267"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiChunkedBitmapCtrl(TeamPix) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 2"; extent = "228 150"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; bitmap = "texticons/twb/twb_Lineup.jpg"; useVariable = "0"; wrap = "0"; }; new ShellFancyArrayScrollCtrl(ML1) { profile = "ShellServerBrowserProfile"; horizSizing = "width"; vertSizing = "height"; position = "-2 151"; extent = "237 118"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fixedHorizontal = "1"; vertSpacerBitmap = "gui/shll_vertspacer"; horzSpacerBitmap = "gui/shll_horzspacer"; new VirtualScrollCtrl(ML2) { profile = "ShellServerBrowserProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 16"; extent = "237 102"; minExtent = "8 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "0"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 3"; new VirtualScrollContentCtrl(ML3) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 7"; extent = "213 88"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiControl(ML4) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "8 392"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; }; }; }; new ShellFancyTextList(MemberList) { profile = "ShellBrowserListProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "217 114"; minExtent = "8 20"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; altCommand = "TribePane.RosterDblClick();"; helpTag = "0"; startScrollRegion = "3 0"; headerBitmap = "gui/server_tabs"; sortArrowBitmap = "gui/shll_sortarrow"; fieldBase = "gui/shll_field"; barBase = "gui/shll_bar"; glowOffset = "4"; rowHeight = "15"; headerFontType = "Univers Condensed"; headerFontSize = "16"; headerFontColor = "8 19 6 255"; headerFontColorHL = "25 68 56 255"; separatorColor = "192 192 192 255"; drawSeparators = "0"; headerSort = "1"; allowReposition = "1"; noSelect = "0"; allowColorChars = "1"; }; }; }; new ShellRadioButton(TW_Admin) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "486 -2"; extent = "63 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "TribePane.ButtonClick(4);"; helpTag = "0"; text = "ADMIN"; maxLength = "255"; groupNum = "4"; }; new ShellRadioButton(TL_Invites) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "423 -2"; extent = "66 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "TribePane.ButtonClick(3);"; helpTag = "0"; text = "INVITES"; maxLength = "255"; groupNum = "5"; }; new ShellRadioButton(TL_Profile) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "233 -2"; extent = "65 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "TribePane.ButtonClick(0);"; helpTag = "0"; text = "PROFILE"; maxLength = "255"; groupNum = "4"; }; new ShellRadioButton(TL_Roster) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "295 -2"; extent = "65 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "TribePane.ButtonClick(1);"; helpTag = "0"; text = "ROSTER"; maxLength = "255"; groupNum = "5"; }; new ShellRadioButton(TL_News) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "357 -2"; extent = "69 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "TribePane.ButtonClick(2);"; helpTag = "0"; text = "OPTIONS"; maxLength = "255"; groupNum = "4"; }; }; new ShellFieldCtrl(PlayerPane) { profile = "ShellFieldProfile"; horizSizing = "width"; vertSizing = "height"; position = "3 27"; extent = "550 272"; minExtent = "16 18"; visible = "0"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "width"; vertSizing = "height"; position = "237 20"; extent = "310 250"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new ShellScrollCtrl(W_Scroll) { profile = "NewScrollCtrlProfile"; horizSizing = "width"; vertSizing = "height"; position = "2 2"; extent = "306 246"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "1"; hScrollBar = "alwaysOff"; vScrollBar = "dynamic"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 0"; fieldBase = " "; new GuiScrollContentCtrl() { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "4 4"; extent = "298 238"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiMLTextCtrl(W_Text) { profile = "NewTextEditProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "286 100"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; lineSpacing = "2"; allowColorChars = "0"; maxChars = "-1"; deniedSound = "InputDeniedSound"; }; }; }; }; new ShellFieldCtrl() { profile = "ShellFieldProfile"; horizSizing = "right"; vertSizing = "height"; position = "3 3"; extent = "234 267"; minExtent = "16 18"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiChunkedBitmapCtrl(PlayerPix) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 3"; extent = "228 150"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; bitmap = "texticons/twb/twb_Laserrifle.jpg"; useVariable = "0"; wrap = "0"; }; new ShellFancyArrayScrollCtrl(W_ML1) { profile = "ShellServerBrowserProfile"; horizSizing = "width"; vertSizing = "height"; position = "-2 151"; extent = "237 116"; minExtent = "24 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; fixedHorizontal = "1"; vertSpacerBitmap = "gui/shll_vertspacer"; horzSpacerBitmap = "gui/shll_horzspacer"; new VirtualScrollCtrl(W_ML2) { profile = "ShellServerBrowserProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 16"; extent = "237 100"; minExtent = "8 52"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; willFirstRespond = "0"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; constantThumbHeight = "0"; defaultLineHeight = "15"; childMargin = "0 3"; new VirtualScrollContentCtrl(W_ML3) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 7"; extent = "213 86"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; new GuiControl(W_ML4) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "8 8"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; }; }; }; new ShellFancyTextList(W_MemberList) { profile = "ShellBrowserListProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "217 112"; minExtent = "8 20"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; altCommand = "PlayerPane.DblClick();"; helpTag = "0"; startScrollRegion = "3 0"; headerBitmap = "gui/server_tabs"; sortArrowBitmap = "gui/shll_sortarrow"; fieldBase = "gui/shll_field"; barBase = "gui/shll_bar"; glowOffset = "4"; rowHeight = "15"; headerFontSize = "0"; headerFontColor = "8 19 6 255"; headerFontColorHL = "25 68 56 255"; separatorColor = "192 192 192 255"; drawSeparators = "0"; headerSort = "1"; allowReposition = "0"; noSelect = "0"; allowColorChars = "1"; }; }; }; new ShellRadioButton(W_Admin) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "495 -2"; extent = "64 30"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "PlayerPane.ButtonClick(5);"; helpTag = "0"; text = "ADMIN"; maxLength = "255"; groupNum = "4"; }; new ShellRadioButton(W_BuddyList) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "420 -2"; extent = "78 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "PlayerPane.ButtonClick(3);"; helpTag = "0"; text = "BUDDYLIST"; maxLength = "255"; groupNum = "5"; }; new ShellRadioButton(W_Profile) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "233 -2"; extent = "67 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "PlayerPane.ButtonClick(0);"; helpTag = "0"; text = "PROFILE"; maxLength = "255"; groupNum = "4"; }; new ShellRadioButton(W_History) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "296 -2"; extent = "69 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "PlayerPane.ButtonClick(1);"; helpTag = "0"; text = "HISTORY"; maxLength = "255"; groupNum = "4"; }; new ShellRadioButton(W_Tribes) { profile = "ShellRadioProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "361 -2"; extent = "62 27"; minExtent = "26 27"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "PlayerPane.ButtonClick(2);"; helpTag = "0"; text = "TRIBES"; maxLength = "255"; groupNum = "5"; }; }; new GuiTextCtrl(twbTitle) { profile = "ShellBigTextProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "7 5"; extent = "8 26"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; text = "EAST [DEV]"; maxLength = "255"; }; }; new ShellBitmapButton(TWBClosePaneBtn) { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "552 60"; extent = "43 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "TWBTabView.closeCurrentPane();"; accelerator = "escape"; helpTag = "0"; text = "X"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "221 368"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "CreateTribe();"; helpTag = "0"; text = "CREATE TRIBE"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "341 368"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "SearchTribes();"; helpTag = "0"; text = "TRIBE SEARCH"; simpleStyle = "0"; }; new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "left"; vertSizing = "top"; position = "461 368"; extent = "128 38"; minExtent = "32 38"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; command = "SearchWarriors();"; helpTag = "0"; text = "WARRIOR SEARCH"; simpleStyle = "0"; }; }; }; //--- OBJECT WRITE END --- PK !( 1) $pref::WorldEditor::toolPaneOffset = WorldEditorFrameSet.getColumnOffset(1); else $pref::WorldEditor::toolPaneOffset = %this.toolPaneOffset; $pref::WorldEditor::activeToolCount = %this.activeToolCount; %tools = WorldEditorToolFrameSet; for(%i = 0; %i < %this.activeToolCount; %i++) { %obj = %tools.getObject(%i); %offset = %tools.getRowOffset(%i); %val = %obj.getName() @ " " @ %offset; $pref::WorldEditor::activeTool[%i] = %val; } } function WorldEditorFrameSetDlg::init(%this) { WorldEditorFrame.add(wEditor); %this.resetFrames(); %this.getPrefs(); } function WorldEditorFrameSetDlg::onWake(%this) { WorldEditorMap.push(); %this.getPrefs(); } function WorldEditorFrameSetDlg::onSleep(%this) { WorldEditorMap.pop(); // %this.setPrefs(); } function WorldEditorFrameSetDlg::update(%this) { // check the frame to see if it is visible if(WorldEditorToolFrameSet.getCount()) { %res = getResolution(); // 90 = width of button bar %width = getWord(%res, 0) - 90; if(WorldEditorFrameSet.getColumnOffset(1) > %width - editor.minToolFrameWidth) WorldEditorFrameSet.setColumnOffset(1, %width - editor.minToolFrameWidth); } } function WorldEditorFrameSetDlg::resetFrames(%this) { // update the tool pane %tools = WorldEditorToolFrameSet; while(%tools.getRowCount() > %tools.getCount()) %tools.removeRow(); while(%tools.getRowCount() < %tools.getCount()) %tools.addRow(); // update the frame view %frameSet = WorldEditorFrameSet; if(!%tools.getCount() && (%frameSet.getColumnCount() > 1)) { %frameSet.toolPaneOffset = %frameSet.getColumnOffset(1); %frameSet.removeColumn(); } if(%tools.getCount() && (%frameSet.getColumnCount() == 1)) { %frameSet.addColumn(); %frameSet.setColumnOffset(1, %frameSet.toolPaneOffset); } if(%tools.getCount()) %this.toolPaneOffset = WorldEditorFrameSet.getColumnOffset(1); %this.activeToolCount = %tools.getCount(); } function WorldEditorFrameSetDlg::addTool(%this, %tool) { WorldEditorToolFrameSet.add(%tool); %this.resetFrames(); } function WorldEditorFrameSetDlg::removeTool(%this, %tool) { WorldEditorToolFrameSet.remove(%tool); %this.resetFrames(); } PK !(7J 3636gui/WorldEditorGui.gui//--- OBJECT WRITE BEGIN --- new WorldEditor(wEditor) { profile = ""; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "420 420"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function WorldEditor::getPrefs(%this) { // same defaults as WorldEditor ctor %this.planarMovement = getPrefSetting($pref::WorldEditor::planarMovement, true); %this.undoLimit = getPrefSetting($pref::WorldEditor::undoLimit, 40); %this.dropType = getPrefSetting($pref::WorldEditor::dropType, "screenCenter"); %this.projectDistance = getPrefSetting($pref::WorldEditor::projectDistance, 2000); %this.boundingBoxCollision = getPrefSetting($pref::WorldEditor::boundingBoxCollision, true); %this.renderPlane = getPrefSetting($pref::WorldEditor::renderPlane, true); %this.renderPlaneHashes = getPrefSetting($pref::WorldEditor::renderPlaneHashes, true); %this.gridColor = getPrefSetting($pref::WorldEditor::gridColor, "255 255 255 20"); %this.planeDim = getPrefSetting($pref::WorldEditor::planeDim, 500); %this.gridSize = getPrefSetting($pref::WorldEditor::gridSize, "10 10 10"); %this.renderPopupBackground = getPrefSetting($pref::WorldEditor::renderPopupBackground, true); %this.popupBackgroundColor = getPrefSetting($pref::WorldEditor::popupBackgroundColor, "100 100 100"); %this.popupTextColor = getPrefSetting($pref::WorldEditor::popupTextColor, "255 255 0"); %this.selectHandle = getPrefSetting($pref::WorldEditor::selectHandle, "gui/Editor_SelectHandle.png"); %this.defaultHandle = getPrefSetting($pref::WorldEditor::defaultHandle, "gui/Editor_DefaultHandle.png"); %this.lockedHandle = getPrefSetting($pref::WorldEditor::lockedHandle, "gui/Editor_LockedHandle.png"); %this.objectTextColor = getPrefSetting($pref::WorldEditor::objectTextColor, "255 255 255"); %this.objectsUseBoxCenter = getPrefSetting($pref::WorldEditor::objectsUseBoxCenter, true); %this.axisGizmoMaxScreenLen = getPrefSetting($pref::WorldEditor::axisGizmoMaxScreenLen, 200); %this.axisGizmoActive = getPrefSetting($pref::WorldEditor::axisGizmoActive, true); %this.mouseMoveScale = getPrefSetting($pref::WorldEditor::mouseMoveScale, 0.2); %this.mouseRotateScale = getPrefSetting($pref::WorldEditor::mouseRotateScale, 0.01); %this.mouseScaleScale = getPrefSetting($pref::WorldEditor::mouseScaleScale, 0.01); %this.minScaleFactor = getPrefSetting($pref::WorldEditor::minScaleFactor, 0.1); %this.maxScaleFactor = getPrefSetting($pref::WorldEditor::maxScaleFactor, 4000); %this.objSelectColor = getPrefSetting($pref::WorldEditor::objSelectColor, "255 0 0"); %this.objMouseOverSelectColor = getPrefSetting($pref::WorldEditor::objMouseOverSelectColor, "0 0 255"); %this.objMouseOverColor = getPrefSetting($pref::WorldEditor::objMouseOverColor, "0 255 0"); %this.showMousePopupInfo = getPrefSetting($pref::WorldEditor::showMousePopupInfo, true); %this.dragRectColor = getPrefSetting($pref::WorldEditor::dragRectColor, "255 255 0"); %this.renderObjText = getPrefSetting($pref::WorldEditor::renderObjText, true); %this.renderObjHandle = getPrefSetting($pref::WorldEditor::renderObjHandle, true); %this.faceSelectColor = getPrefSetting($pref::WorldEditor::faceSelectColor, "0 0 100 100"); %this.renderSelectionBox = getPrefSetting($pref::WorldEditor::renderSelectionBox, true); %this.selectionBoxColor = getPrefSetting($pref::WorldEditor::selectionBoxColor, "255 255 0"); %this.snapToGrid = getPrefSetting($pref::WorldEditor::snapToGrid, false); %this.snapRotations = getPrefSetting($pref::WorldEditor::snapRotations, false); %this.rotationSnap = getPrefSetting($pref::WorldEditor::rotationSnap, "15"); // %this.currentMode = "move"; } function WorldEditor::setPrefs(%this) { $pref::WorldEditor::planarMovement = %this.planarMovement; $pref::WorldEditor::undoLimit = %this.undoLimit; $pref::WorldEditor::dropType = %this.dropType; $pref::WorldEditor::projectDistance = %this.projectDistance; $pref::WorldEditor::boundingBoxCollision = %this.boundingBoxCollision; $pref::WorldEditor::renderPlane = %this.renderPlane; $pref::WorldEditor::renderPlaneHashes = %this.renderPlaneHashes; $pref::WorldEditor::gridColor = %this.GridColor; $pref::WorldEditor::planeDim = %this.planeDim; $pref::WorldEditor::gridSize = %this.GridSize; $pref::WorldEditor::renderPopupBackground = %this.renderPopupBackground; $pref::WorldEditor::popupBackgroundColor = %this.PopupBackgroundColor; $pref::WorldEditor::popupTextColor = %this.PopupTextColor; $pref::WorldEditor::selectHandle = %this.selectHandle; $pref::WorldEditor::defaultHandle = %this.defaultHandle; $pref::WorldEditor::lockedHandle = %this.lockedHandle; $pref::WorldEditor::objectTextColor = %this.ObjectTextColor; $pref::WorldEditor::objectsUseBoxCenter = %this.objectsUseBoxCenter; $pref::WorldEditor::axisGizmoMaxScreenLen = %this.axisGizmoMaxScreenLen; $pref::WorldEditor::axisGizmoActive = %this.axisGizmoActive; $pref::WorldEditor::mouseMoveScale = %this.mouseMoveScale; $pref::WorldEditor::mouseRotateScale = %this.mouseRotateScale; $pref::WorldEditor::mouseScaleScale = %this.mouseScaleScale; $pref::WorldEditor::minScaleFactor = %this.minScaleFactor; $pref::WorldEditor::maxScaleFactor = %this.maxScaleFactor; $pref::WorldEditor::objSelectColor = %this.objSelectColor; $pref::WorldEditor::objMouseOverSelectColor = %this.objMouseOverSelectColor; $pref::WorldEditor::objMouseOverColor = %this.objMouseOverColor; $pref::WorldEditor::showMousePopupInfo = %this.showMousePopupInfo; $pref::WorldEditor::dragRectColor = %this.dragRectColor; $pref::WorldEditor::renderObjText = %this.renderObjText; $pref::WorldEditor::renderObjHandle = %this.renderObjHandle; $pref::WorldEditor::raceSelectColor = %this.faceSelectColor; $pref::WorldEditor::renderSelectionBox = %this.renderSelectionBox; $pref::WorldEditor::selectionBoxColor = %this.selectionBoxColor; $pref::WorldEditor::snapToGrid = %this.snapToGrid; $pref::WorldEditor::snapRotations = %this.snapRotations; $pref::WorldEditor::rotationSnap = %this.rotationSnap; } function WorldEditor::init(%this) { %this.getPrefs(); // add objclasses which we do not want to collide with %this.ignoreObjClass(TerrainBlock, Sky, AIObjective); // editing modes %this.numEditModes = 3; %this.editMode[0] = "move"; %this.editMode[1] = "rotate"; %this.editMode[2] = "scale"; %this.setMode(%this.currentMode); // context menu new GuiControl(WEContextPopupDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; new GuiPopUpMenuCtrl(WEContextPopup) { profile = "GuiButtonProfile"; position = "0 0"; extent = "0 0"; minExtent = "0 0"; maxPopupHeight = "200"; command = "canvas.popDialog(WEContextPopupDlg);"; }; }; WEContextPopup.setVisible(false); } //------------------------------------------------------------------------------ function WorldEditor::onDblClick(%this, %obj) { Inspector.inspect(%obj); InspectorNameEdit.setValue(%obj.getName()); } //------------------------------------------------------------------------------ function WorldEditor::doExport(%this, %file) { missionGroup.save("editor/" @ %file, true); } function WorldEditor::export(%this) { getSaveFilename("editor/*.mac", %this @ ".doExport", "selection.mac"); } function WorldEditor::doImport(%this, %file) { exec("editor/" @ %file); } function WorldEditor::import(%this) { getLoadFilename("editor/*.mac", %this @ ".doImport"); } //------------------------------------------------------------------------------ // modes function WorldEditor::getModeIndex(%this) { %mode = %this.getMode(); for(%i = 0; %i < %this.numEditModes; %i++) if(%mode $= %this.editMode[%i]) return %i; return 0; } function WorldEditor::nextMode(%this) { %idx = %this.getModeIndex(); // %idx++; if(%idx == %this.numEditModes) %idx = 0; %this.setMode(%this.editMode[%idx]); } function WorldEditor::previousMode(%this) { %idx = %this.getModeIndex(); // if(%idx == 0) %idx = %this.numEditModes - 1; else %idx--; %this.setMode(%this.editMode[%idx]); } function WorldEditor::onGuiUpdate(%this, %text) { WorldEditorFrameSetDlg.update(); AIEFrameSetDlg.update(); WorldEditorStatusbarDlg.update(); } function WorldEditor::anyObjectLocked(%this) { for(%i = 0; %i < %this.getSelectionSize(); %i++) { %obj = %this.getSelectedObject(%i); if(%obj.locked $= "true") return 1; } return 0; } function WorldEditor::anyObjectHidden(%this) { for(%i = 0; %i < %this.getSelectionSize(); %i++) { %obj = %this.getSelectedObject(%i); if(%obj.hidden $= "true") return 1; } return 0; } function WorldEditor::onContextMenu(%this, %mousePos) { if(!$missionRunning) return; WEContextPopup.position = %mousePos; WEContextPopup.clear(); if(%this.getSelectionSize() == 0) { if(%this.canPasteSelection()) WEContextPopup.add("Paste", 1); else return; } else { WEContextPopup.add("Copy", 0); if(%this.canPasteSelection()) WEContextPopup.add("Paste", 1); WEContextPopup.add("Cut", 2); if(%this.anyObjectLocked()) WEContextPopup.add("Unlock", 3); else WEContextPopup.add("Lock", 3); if(%this.anyObjectHidden()) WEContextPopup.add("Unhide", 4); else WEContextPopup.add("Hide", 4); } canvas.pushDialog(WEContextPopupDlg); WEContextPopup.forceOnAction(); } function WEContextPopup::onSelect(%this, %index, %value) { switch(%index) { case 0: if($AIedit) aiEdit.copySelection(); else wEditor.copySelection(); case 1: if($AIedit) aiEdit.pasteSelection(); else wEditor.pasteSelection(); case 2: if($AIedit) { aiEdit.copySelection(); aiEdit.deleteSelection(); } else { wEditor.copySelection(); wEditor.deleteSelection(); } case 3: wEditor.lockSelection(!wEditor.anyObjectLocked()); case 4: wEditor.hideSelection(!wEditor.anyObjectHidden()); } } function WorldEditor::dropCameraToSelection(%this) { if(%this.getSelectionSize() == 0) return; %pos = %this.getSelectionCentroid(); %cam = 2.camera.getTransform(); // set the pnt %cam = setWord(%cam, 0, getWord(%pos, 0)); %cam = setWord(%cam, 1, getWord(%pos, 1)); %cam = setWord(%cam, 2, getWord(%pos, 2)); 2.camera.setTransform(%cam); } // * pastes the selection at the same place (used to move obj from a group to another) function WorldEditor::moveSelectionInPlace(%this) { %saveDropType = %this.dropType; %this.dropType = "atCentroid"; %this.copySelection(); %this.deleteSelection(); %this.pasteSelection(); %this.dropType = %saveDropType; } // resets the scale and rotation on the selection set function WorldEditor::resetTransforms(%this) { %this.addUndoState(); for(%i = 0; %i < %this.getSelectionSize(); %i++) { %obj = %this.getSelectedObject(%i); %transform = %obj.getTransform(); %transform = setWord(%transform, 3, "0"); %transform = setWord(%transform, 4, "0"); %transform = setWord(%transform, 5, "1"); %transform = setWord(%transform, 6, "0"); // %obj.setTransform(%transform); %obj.setScale("1 1 1"); } } //------------------------------------------------------------------------------ // keys new ActionMap(WorldEditorMap); WorldEditorMap.bindCmd(keyboard, "space", "wEditor.nextMode();", ""); WorldEditorMap.bindCmd(keyboard, "ctrl c", "wEditor.copySelection();", ""); WorldEditorMap.bindCmd(keyboard, "ctrl x", "wEditor.copySelection();wEditor.deleteSelection();", ""); WorldEditorMap.bindCmd(keyboard, "delete", "wEditor.copySelection();wEditor.deleteSelection();", ""); WorldEditorMap.bindCmd(keyboard, "ctrl v", "wEditor.pasteSelection();", ""); WorldEditorMap.bindCmd(keyboard, "ctrl z", "wEditor.undo();", ""); WorldEditorMap.bindCmd(keyboard, "ctrl y", "wEditor.redo();", ""); WorldEditorMap.bindCmd(keyboard, "ctrl h", "wEditor.hideSelection(true);", ""); WorldEditorMap.bindCmd(keyboard, "alt h", "wEditor.hideSelection(false);", ""); WorldEditorMap.bindCmd(keyboard, "i", "Canvas.pushDialog(interiorDebugDialog);", ""); WorldEditorMap.bindCmd(keyboard, "o", "Canvas.pushDialog(WorldEditorSettingsDlg);", ""); WorldEditorMap.bindCmd(keyboard, "ctrl d", "wEditor.dropSelection();", ""); WorldEditorMap.bindCmd(keyboard, "ctrl q", "wEditor.dropCameraToSelection();", ""); WorldEditorMap.bindCmd(keyboard, "ctrl m", "wEditor.moveSelectionInPlace();", ""); WorldEditorMap.bindCmd(keyboard, "ctrl r", "wEditor.resetTransforms();", ""); PK !(}X$RRgui/WorldEditorSettingsDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(WorldEditorSettingsDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "center"; vertSizing = "center"; position = "90 55"; extent = "459 370"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "WorldEditor Settings"; maxLength = "255"; resizeWidth = "0"; resizeHeight = "0"; canMove = "1"; canClose = "0"; canMinimize = "0"; canMaximize = "0"; minSize = "50 50"; closeCommand = "Canvas.popDialog(WorldEditorSettingsDlg);"; new GuiButtonCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "307 332"; extent = "80 20"; minExtent = "8 8"; visible = "1"; command = "Canvas.popDialog(WorldEditorSettingsDlg);"; helpTag = "0"; text = "OK"; groupNum = "-1"; buttonType = "PushButton"; }; new GuiControl(WESettingsGeneralTab) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 27"; extent = "220 210"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 10"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.planarMovement"; command = "EWorldEditor.planarMovement = $ThisControl.getValue();"; helpTag = "0"; text = "Planar Movement"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 36"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.boundingBoxCollision"; command = "EWorldEditor.boundingBoxCollision = $ThisControl.getValue();"; helpTag = "0"; text = "Collide With Object\'s Bounding Box"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 88"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.axisGizmoActive"; command = "EWorldEditor.axisGizmoActive = $ThisControl.getValue();"; helpTag = "0"; text = "Axis Gizmo Active"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 62"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.objectsUseBoxCenter"; command = "EWorldEditor.objectsUseBoxCenter = $ThisControl.getValue();"; helpTag = "0"; text = "Objects Use Box Center"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 123"; extent = "83 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Min Scale Factor:"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 146"; extent = "83 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Min Scale Factor:"; maxLength = "255"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 123"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.minScaleFactor"; command = "EWorldEditor.minScaleFactor = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 146"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.maxScaleFactor"; command = "EWorldEditor.maxScaleFactor = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 178"; extent = "80 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Visible Distance:"; maxLength = "255"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "104 178"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "pref::Editor::visibleDistance"; command = "$pref::Editor::visibleDistance = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; }; new GuiControl(WESettingsDisplayTab) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 27"; extent = "220 210"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 10"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.renderPlane"; command = "EWorldEditor.renderPlane = $ThisControl.getValue();"; helpTag = "0"; text = "Render Plane"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 37"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.renderPlaneHashes"; command = "EWorldEditor.renderPlaneHashes = $ThisControl.getValue();"; helpTag = "0"; text = "Render Plane Hashes"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 64"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.renderObjText"; command = "EWorldEditor.renderObjText = $ThisControl.getValue();"; helpTag = "0"; text = "Render Object Text"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 119"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.renderSelectionBox"; command = "EWorldEditor.renderSelectionBox = $ThisControl.getValue();"; helpTag = "0"; text = "Render Selection Box"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "93 151"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.planeDim"; command = "EWorldEditor.planeDim = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "18 151"; extent = "59 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Plane Extent"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "18 175"; extent = "44 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Grid Size"; maxLength = "255"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "93 175"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.gridSize"; command = "EWorldEditor.gridSize = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 90"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.renderObjHandle"; command = "EWorldEditor.renderObjHandle = $ThisControl.getValue();"; helpTag = "0"; text = "Render Object Handle"; groupNum = "-1"; buttonType = "ToggleButton"; }; }; new GuiControl(WESettingsSnapTab) { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 52"; extent = "220 210"; minExtent = "8 8"; visible = "0"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 39"; extent = "44 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Grid Size"; maxLength = "255"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "97 39"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.gridSize"; command = "EWorldEditor.gridSize = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 10"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.snapToGrid"; command = "EWorldEditor.snapToGrid = $ThisControl.getValue();"; helpTag = "0"; text = "Snap To Grid"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 66"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.snapRotations"; command = "EWorldEditor.snapRotations = $ThisControl.getValue();"; helpTag = "0"; text = "Snap Rotations"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "22 95"; extent = "56 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Snap Angle"; maxLength = "255"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "97 95"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.rotationSnap"; command = "EWorldEditor.rotationSnap = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; }; new GuiControl(WESettingsMouseTab) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "7 241"; extent = "220 121"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "10 10"; extent = "200 24"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.showMousePopupInfo"; command = "EWorldEditor.showMousePopupInfo = $ThisControl.getValue();"; helpTag = "0"; text = "Show Mouse Popup Info"; groupNum = "-1"; buttonType = "ToggleButton"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "101 35"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.mouseMoveScale"; command = "EWorldEditor.mouseMoveScale = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "101 60"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.mouseRotateScale"; command = "EWorldEditor.mouseRotateScale = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "101 85"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.mouseScaleScale"; command = "EWorldEditor.mouseScaleScale = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 60"; extent = "61 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Rotate Scale"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 85"; extent = "57 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Scale Scale"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "12 35"; extent = "56 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Move Scale"; maxLength = "255"; }; }; new GuiControl(WESettingsMiscTab) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "231 241"; extent = "220 64"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 35"; extent = "78 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Project Distance"; maxLength = "255"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "9 9"; extent = "89 18"; minExtent = "8 8"; visible = "1"; helpTag = "0"; text = "Gizmo Screen Len"; maxLength = "255"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "101 35"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.projectDistance"; command = "EWorldEditor.projectDistance = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "101 9"; extent = "107 18"; minExtent = "8 8"; visible = "1"; variable = "EWorldEditor.axisGizmoMaxScreenLen"; command = "EWorldEditor.axisGizmoMaxScreenLen = $ThisControl.getValue();"; helpTag = "0"; maxLength = "255"; historySize = "0"; password = "0"; tabComplete = "0"; }; }; }; }; //--- OBJECT WRITE END --- PK !(S gui/WorldEditorStatusbarDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(WorldEditorStatusbarDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "top"; position = "0 450"; extent = "640 30"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "6 8"; extent = "39 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Mission:"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "244 8"; extent = "29 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Mode:"; }; new GuiControl() { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "274 6"; extent = "58 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiButtonCtrl(WEModeText) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "58 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; command = "nextMode();"; }; }; new GuiControl() { profile = "GuiContentProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "49 6"; extent = "188 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiTextCtrl(WEMissionNameText) { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 2"; extent = "8 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; }; }; }; //--- OBJECT WRITE END --- //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function WorldEditorStatusbarDlg::init(%this) { %this.update(); } function WorldEditorStatusBarDlg::update(%this) { if($MissionName $= "") WEMissionNameText.setValue(""); else WEMissionNameText.setValue($MissionName); if($aiEdit) WEModeText.setValue(aiEdit.getMode()); else WEModeText.setValue(wEditor.getMode()); } function nextMode() { if($aiEdit) aiEdit.nextMode(); else wEditor.nextMode(); }PK !(.V gui/WorldEditorToolbarDlg.gui//--- OBJECT WRITE BEGIN --- new GuiControl(WorldEditorToolbarDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiControl() { profile = "EditorContentProfile"; horizSizing = "width"; vertSizing = "bottom"; position = "0 0"; extent = "640 30"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "0"; helpTag = "0"; new GuiCheckBoxCtrl(WorldEditorCreatorCheckBox) { profile = "GuiRadioProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "381 5"; extent = "63 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "if($ThisControl.getValue()) WorldEditorFrameSetDlg.addTool(EditorToolCreatorGui); else WorldEditorFrameSetDlg.removeTool(EditorToolCreatorGui);"; helpTag = "0"; text = "Creator"; }; new GuiCheckBoxCtrl(WorldEditorTreeCheckBox) { profile = "GuiRadioProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "444 5"; extent = "63 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "if($ThisControl.getValue()) WorldEditorFrameSetDlg.addTool(EditorToolTreeViewGui); else WorldEditorFrameSetDlg.removeTool(EditorToolTreeViewGui);"; helpTag = "0"; text = "Tree"; }; new GuiCheckBoxCtrl(WorldEditorMissionAreaCheckBox) { profile = "GuiRadioProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "507 5"; extent = "63 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "if($ThisControl.getValue()) WorldEditorFrameSetDlg.addTool(EditorToolMissionAreaGui); else WorldEditorFrameSetDlg.removeTool(EditorToolMissionAreaGui);"; helpTag = "0"; text = "Mission"; }; new GuiCheckBoxCtrl(WorldEditorInspectorCheckBox) { profile = "GuiRadioProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "570 5"; extent = "63 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "if($ThisControl.getValue()) WorldEditorFrameSetDlg.addTool(EditorToolInspectorGui); else WorldEditorFrameSetDlg.removeTool(EditorToolInspectorGui);"; helpTag = "0"; text = "Inspector"; }; }; }; //--- OBJECT WRITE END --- function WorldEditorToolbarDlg::init(%this) { WorldEditorInspectorCheckBox.setValue(WorldEditorToolFrameSet.isMember("EditorToolInspectorGui")); WorldEditorMissionAreaCheckBox.setValue(WorldEditorToolFrameSet.isMember("EditorToolMissionAreaGui")); WorldEditorTreeCheckBox.setValue(WorldEditorToolFrameSet.isMember("EditorToolTreeViewGui")); WorldEditorCreatorCheckBox.setValue(WorldEditorToolFrameSet.isMember("EditorToolCreatorGui")); } PK !(t0T&&gui/cmdMapHelpText.guinew GuiControl(CmdMapHelpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new GuiControl(teamButtonBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 5"; extent = "160 50"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiTextCtrl(teamButtonHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "150 15"; minExtent = "8 8"; visible = "1"; text = "TEAMMATES"; }; new GuiMLTextCtrl(teamButtonText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "150 35"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(teamButtonLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "435 8"; extent = "20 5"; flip = "0"; visible = "1"; }; new GuiControl(tacticalButtonBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "270 57"; extent = "170 80"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiTextCtrl(tacticalButtonHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "170 15"; minExtent = "8 8"; visible = "1"; text = "TACTICAL ASSETS"; }; new GuiMLTextCtrl(tacticalButtonText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "170 65"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(tacticalButtonLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "430 60"; extent = "20 5"; flip = "0"; visible = "1"; }; new GuiControl(supportButtonBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 139"; extent = "160 65"; minExtent = "8 8"; visible = "1"; helpTag = "0"; new GuiTextCtrl(supportButtonHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "150 15"; minExtent = "8 8"; visible = "1"; text = "SUPPORT ASSETS"; }; new GuiMLTextCtrl(supportButtonText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "150 50"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new GuiControl(waypointButtonBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "160 110"; extent = "100 35"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; new GuiTextCtrl(waypointButtonHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "90 15"; minExtent = "8 8"; visible = "1"; text = "WAYPOINTS"; }; new GuiMLTextCtrl(waypointButtonText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "90 15"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new GuiControl(objectiveButtonBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "125 150"; extent = "150 35"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; new GuiTextCtrl(objectiveButtonHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "140 15"; minExtent = "8 8"; visible = "1"; text = "OBJECTIVES"; }; new GuiMLTextCtrl(objectiveButtonText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 20"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new GuiControl(sensorToolBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "top"; position = "160 208"; extent = "280 50"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(sensorToolHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "270 15"; minExtent = "8 8"; visible = "1"; text = "SENSOR"; }; new GuiMLTextCtrl(sensorToolText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "270 35"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new GuiControl(handToolBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "top"; position = "200 260"; extent = "240 65"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; new GuiTextCtrl(handToolHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "250 15"; minExtent = "8 8"; visible = "1"; text = "HAND/POINTER"; }; new GuiMLTextCtrl(handToolText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "250 50"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(handToolLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "435 323"; extent = "20 5"; flip = "0"; visible = "1"; }; new GuiControl(zoomToolBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "top"; position = "200 327"; extent = "240 50"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(zoomToolHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "235 15"; minExtent = "8 8"; visible = "1"; text = "ZOOM"; }; new GuiMLTextCtrl(zoomToolText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "230 35"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(zoomToolLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "435 365"; extent = "20 5"; flip = "0"; visible = "1"; }; new GuiControl(centerToolBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "top"; position = "200 379"; extent = "240 65"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(centerToolHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "230 15"; minExtent = "8 8"; visible = "1"; text = "CENTER MAP"; }; new GuiMLTextCtrl(centerToolText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "230 50"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(centerToolLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "435 400"; extent = "20 5"; flip = "0"; visible = "1"; }; new GuiControl(textToolBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "top"; position = "220 446"; extent = "220 35"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(textToolHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "210 15"; minExtent = "8 8"; visible = "1"; text = "TEXT ON/OFF"; }; new GuiMLTextCtrl(textToolText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "210 20"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new GuiControl(cameraToolBox) { profile = "GuiHelpBoxProfile"; horizSizing = "left"; vertSizing = "top"; position = "2 380"; extent = "190 95"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(cameraToolHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "180 15"; minExtent = "8 8"; visible = "1"; text = "CAMERA"; }; new GuiMLTextCtrl(cameraToolText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "180 80"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new GuiControl(generalHelpBox) { profile = "GuiHelpBoxProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 140"; extent = "120 235"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(generalHelpHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "110 15"; minExtent = "8 8"; visible = "1"; text = "COMMAND MAP"; }; new GuiMLTextCtrl(generalHelpText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "110 225"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; }; commanderMapGui.add(CmdMapHelpTextGui);PK !(MMgui/guiProfiles.cs //-------------------------------------------------------------------------- //-------------------------------------- Cursors // new GuiCursor(DefaultCursor) { hotSpot = "1 1"; bitmapName = "gui/CUR_3darrow"; }; new GuiCursor(ArrowNoCursor) { hotSpot = "1 1"; bitmapName = "gui/CUR_3darrowno"; }; new GuiCursor(ArrowWaitCursor) { hotSpot = "1 1"; bitmapName = "gui/CUR_3darrowwait"; }; new GuiCursor(ArrowHelpCursor) { hotSpot = "1 1"; bitmapName = "gui/CUR_3darrowhelp"; }; new GuiCursor(MoveCursor) { hotSpot = "11 11"; bitmapName = "gui/CUR_3dmove"; }; new GuiCursor(UpDownCursor) { hotSpot = "5 10"; bitmapName = "gui/CUR_3dupdown"; }; new GuiCursor(LeftRightCursor) { hotSpot = "9 5"; bitmapName = "gui/CUR_3dleftright"; }; new GuiCursor(DiagRightCursor) { hotSpot = "8 8"; bitmapName = "gui/CUR_3ddiagright"; }; new GuiCursor(DiagLeftCursor) { hotSpot = "8 8"; bitmapName = "gui/CUR_3ddiagleft"; }; new GuiCursor(RotateCursor) { hotSpot = "11 14"; bitmapName = "gui/CUR_rotate"; }; new GuiCursor(ResizeDownCursor) { hotSpot = "4 8"; bitmapName = "gui/CUR_3dresizeright"; }; new GuiCursor(GrabCursor) { hotSpot = "9 13"; bitmapName = "gui/CUR_Grab"; }; //-------------------------------------------------------------------------- //-------------------------------------- Profiles // new GuiControlProfile("GuiDialogProfile"); new GuiControlProfile("GuiModelessDialogProfile") { modal = false; }; new GuiControlProfile ("GuiContentProfile") { opaque = true; fillColor = "255 255 255"; }; new GuiControlProfile ("clockProfile") { fontType = "Univers Condensed"; fontSize = 12; fontColor = "255 255 255"; }; new GuiControlProfile ("SiegeHalftimeClockProfile") { fontType = "Univers Condensed"; fontSize = 18; fontColor = "255 255 255"; }; new GuiControlProfile ("GuiContentProfileNoClear") { opaque = false; fillColor = "255 255 255"; }; //-------------------------------------------------------------------------- // Base font definitions: //-------------------------------------------------------------------------- $ShellFont = "Univers"; $ShellFontSize = 16; $ShellMediumFontSize = 18; $ShellHeaderFont = "Sui Generis"; $ShellHeaderFontSize = 22; $ShellButtonFont = "Univers Condensed"; $ShellButtonFontSize = 16; $ShellLabelFont = "Univers Condensed"; $ShellLabelFontSize = 18; $ShellBoldFont = "Univers Bold"; $ShellColorBright = "173 255 250"; $ShellColorDark = "130 190 185"; $ShellColorVeryDark = "0 117 133"; // Color coding system for Player names in the game: $PlayerNameColor = "200 200 200"; $TribeTagColor = "220 220 20"; $SmurfNameColor = "150 150 250"; $BotNameColor = "60 220 150"; //-------------------------------------------------------------------------- // Beginning of the "New Shell" section: new GuiControlProfile ("ShellButtonProfile") { fontType = $ShellButtonFont; fontSize = $ShellButtonFontSize; fontColor = "8 19 6"; fontColorHL = "25 68 56"; fontColorNA = "5 5 5"; fontColorSEL = "25 68 56"; fixedExtent = true; justify = "center"; bitmap = "gui/shll_button"; textOffset = "0 10"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("ShellButtonNoTabProfile") { fontType = $ShellButtonFont; fontSize = $ShellButtonFontSize; fontColor = "8 19 6"; fontColorHL = "25 68 56"; fontColorNA = "5 5 5"; fontColorSEL = "25 68 56"; fixedExtent = true; justify = "center"; bitmap = "gui/shll_button"; textOffset = "0 10"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = false; canKeyFocus = true; }; new GuiControlProfile ("ShellRadioProfile") { fontType = $ShellButtonFont; fontSize = $ShellButtonFontSize; fontColor = "8 19 6"; fontColorHL = "25 68 56"; fontColorNA = "5 5 5"; fixedExtent = true; justify = "center"; bitmap = "gui/shll_radio"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("ShellTabProfile") { fontType = $ShellButtonFont; fontSize = $ShellButtonFontSize; fontColor = "8 19 6"; fontColorHL = "25 68 56"; fontColorNA = "5 5 5"; fontColorSEL = "8 19 6"; fixedExtent = true; justify = "center"; bitmap = "gui/shll_tabbutton"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("TabGroupProfile") { fontType = $ShellButtonFont; fontSize = $ShellButtonFontSize; fontColor = "8 19 6"; fontColorHL = "25 68 56"; fontColorNA = "5 5 5"; fontColorSEL = "8 19 6"; fixedExtent = true; bitmapBase = "gui/shll_horztabbutton"; justify = "center"; textOffset = "8 0"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("LaunchTabProfile") { fontType = $ShellButtonFont; fontSize = $ShellButtonFontSize; fontColor = "60 140 140"; fontColorHL = "6 245 215"; fontColorNA = "64 64 64"; fontColorSEL = "6 245 215"; fixedExtent = true; bitmapBase = "gui/lnch_tab"; justify = "center"; textOffset = "8 0"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("ShellTabFrameProfile") { bitmapBase = "gui/shll_tabframe"; }; new GuiControlProfile ("ShellHorzTabFrameProfile") { bitmapBase = "gui/shll_horztabframe"; }; new GuiControlProfile ("ShellPopupProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "8 19 6"; fontColorHL = "25 68 56"; fontColorNA = "5 5 5"; fontColorSEL = "8 19 6"; fixedExtent = true; justify = "center"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; bitmapBase = "gui/shll_scroll"; tab = true; canKeyFocus = true; }; new GuiControlProfile ("NewTextEditProfile") { fillColorHL = $ShellColorDark; fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "60 140 140"; fontColorHL = "25 68 56"; fontColorNA = "128 128 128"; cursorColor = $ShellColorBright; bitmap = "gui/shll_entryfield"; textOffset = "14 0"; autoSizeWidth = false; autoSizeHeight = false; tab = true; canKeyFocus = true; }; new GuiControlProfile ("NewTextEditNumericProfile") { fillColorHL = $ShellColorDark; fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "60 140 140"; fontColorHL = "25 68 56"; fontColorNA = "128 128 128"; cursorColor = $ShellColorBright; bitmap = "gui/shll_entryfield"; justify = "center"; textOffset = "14 0"; autoSizeWidth = false; autoSizeHeight = false; numbersOnly = true; tab = true; canKeyFocus = true; }; new GuiControlProfile ("NewTextEditCenterProfile") { fillColorHL = $ShellColorDark; fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "60 140 140"; fontColorHL = "25 68 56"; fontColorNA = "128 128 128"; cursorColor = $ShellColorBright; bitmap = "gui/shll_entryfield"; justify = "center"; autoSizeWidth = false; autoSizeHeight = false; tab = true; canKeyFocus = true; }; new GuiControlProfile ("NewScrollCtrlProfile") { bitmapBase = "gui/shll_scroll"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; }; new GuiControlProfile ("ShellFieldProfile") { bitmapBase = "gui/shll_field"; }; new GuiControlProfile ("ShellSliderProfile") { fontType = $ShellLabelFont; fontSize = $ShellFontSize; fontColor = "60 180 180"; fontColorNA = "128 128 128"; bitmapBase = "gui/shll_scroll"; canKeyFocus = true; soundButtonOver = sButtonOver; }; new GuiControlProfile ("ShellTextArrayProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "60 180 180"; fontColorHL = "6 245 215"; fontColorNA = "108 108 108"; fontColorSEL = "25 68 56"; bitmapBase = "gui/shll_bar"; tab = true; canKeyFocus = true; }; new GuiControlProfile ("ShellActiveTextProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "60 180 180"; fontColorHL = "6 245 215"; fontColorNA = "128 128 128"; fontColorSEL = "25 68 56"; justify = "center"; }; new GuiControlProfile ("ShellPaneProfile") { fontType = $ShellHeaderFont; fontSize = $ShellHeaderFontSize; fontColor = "5 5 5"; autoSizeWidth = false; autoSizeHeight = false; bitmapBase = "gui/shll"; }; new GuiControlProfile ("ShellDlgPaneProfile") { fontType = $ShellHeaderFont; fontSize = $ShellHeaderFontSize; fontColor = "5 5 5"; autoSizeWidth = false; autoSizeHeight = false; bitmapBase = "gui/dlg"; }; new GuiControlProfile ("ShellWindowProfile") { borderColor = "3 124 134"; fontType = $ShellHeaderFont; fontSize = $ShellHeaderFontSize; fontColor = "5 5 5"; autoSizeWidth = false; autoSizeHeight = false; bitmapBase = "gui/dlg"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; }; new GuiControlProfile ("ShellDlgProfile") { fontType = $ShellHeaderFont; fontSize = $ShellHeaderFontSize; fontColor = "5 5 5"; bitmap = "gui/dlg_box"; autoSizeWidth = false; autoSizeHeight = false; }; new GuiControlProfile ("BrowserH1Profile") { fontType = "Univers Condensed Bold"; fontSize = 28; fontColor = "40 247 113"; // green autoSizeWidth = false; autoSizeHeight = true; bitmapBase = "gui/shll"; }; new GuiControlProfile ("CloseButtonProfile") { bitmap = "gui/shll_menuclose"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("SoundTestButtonProfile") { bitmap = "gui/shll_soundbutton"; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("LaunchMenuProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "6 245 215"; fontColorHL = "74 251 228"; fontColorSEL = "4 41 45"; borderColor = "84 121 125 200"; fixedExtent = true; justify = "center"; bitmapBase = "gui/launch_btn"; textOffset = "0 19"; soundButtonDown = sLaunchMenuOpen; soundButtonOver = sLaunchMenuOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("LaunchBtnTopProfile") { fixedExtent = true; bitmapBase = "gui/launchtop_btn"; }; new GuiControlProfile ("ShellServerBrowserProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "60 180 180"; fontColorHL = "6 245 215"; fontColorNA = "128 128 128"; fontColorSEL = "25 68 56"; fontColors[4] = "20 167 93"; // Mod base color fontColors[5] = "40 217 113"; // Mod rollover color fontColors[6] = "5 60 30"; // Mod selected color fontColors[7] = "108 108 108"; // Differing build base color fontColors[8] = "168 168 168"; // Differing build rollover color fontColors[9] = "58 58 58"; // Differing build selected color bitmapBase = "gui/shll_scroll"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("ShellBrowserListProfile") { fontType = $ShellFont; fontSize = 12; fontColor = "20 220 20"; fontColorHL = "60 250 60"; fontColorNA = "128 128 128"; fontColorSEL = "0 60 0"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("LobbyPlayerListProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "60 180 180"; fontColorHL = "6 245 215"; fontColorNA = "128 128 128"; fontColorSEL = "25 68 56"; fontColors[6] = $PlayerNameColor; fontColors[7] = $TribeTagColor; fontColors[8] = $SmurfNameColor; fontColors[9] = $BotNameColor; bitmapBase = "gui/shll_scroll"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("ShellBrowserTitleProfile") { fontType = "Sui Generis"; fontSize = 32; fontColor = "173 255 250"; autoSizeWidth = true; autoSizeHeight = true; tab = false; canKeyFocus = false; }; //-------------------------------------------------------------------------- // End of "New Shell" section. new GuiControlProfile ("ShellHoloButtonProfile") { opaque = true; fillColor = $ShellColorVeryDark; fillColorNA = "128 128 128"; border = true; borderColor = $ShellColorBright; borderColorHL = "127 127 127"; borderColorNA = "192 192 192"; fontType = "Univers"; fontSize = 14; fontColor = $ShellColorBright; fontColorHL = $ShellColorDark; fontColorNA = "192 192 192"; fixedExtent = true; justify = "center"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; canKeyFocus = true; }; new GuiControlProfile ("GameHoloButtonProfile") { opaque = true; fillColor = "0 64 0 80"; border = true; borderColor = "0 255 0"; borderColorHL = "127 127 127"; fontType = "Univers"; fontSize = 14; fontColor = "0 255 0"; fontColorHL = "0 128 0"; fixedExtent = true; justify = "center"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; tab = true; }; new GuiControlProfile ("ShellHoloBox") { opaque = true; fillColor = "72 72 72 128"; border = true; borderColor = $ShellColorBright; }; new GuiControlProfile ("TaskHudBox") { opaque = true; fillColor = "72 72 72 128"; border = true; borderColor = "30 59 56 80"; }; new GuiControlProfile ("ShellOpaqueBox") { opaque = true; fillColor = $ShellColorVeryDark; border = true; borderColor = $ShellColorBright; }; new GuiControlProfile ("ShellScrollCtrlProfile") { border = true; borderColor = $ShellColorBright; bitmap = "gui/shellScroll"; }; new GuiControlProfile ("ShellTextProfile") { fontType = $ShellLabelFont; fontSize = $ShellLabelFontSize; fontColor = "66 229 244"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("ShellTextRightProfile") { fontType = $ShellLabelFont; fontSize = $ShellLabelFontSize; fontColor = "66 229 244"; justify = "right"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("ShellTextCenterProfile") { fontType = $ShellLabelFont; fontSize = $ShellLabelFontSize; fontColor = "66 229 244"; justify = "center"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("DisabledTextProfile") { fontType = $ShellLabelFont; fontSize = $ShellLabelFontSize; fontColor = "128 128 128"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("DisabledTextRightProfile") { fontType = $ShellLabelFont; fontSize = $ShellLabelFontSize; fontColor = "128 128 128"; justify = "right"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("ShellAltTextProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "66 219 234"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("ShellAltTextRightProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "66 219 234"; justify = "right"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("ShellAltTextCenterProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "66 219 234"; justify = "center"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("ShellStaticTextProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "66 219 234"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("VersionTextProfile") { fontType = "Univers Bold"; fontSize = $ShellMediumFontSize; fontColor = "0 0 0"; justify = "right"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("CenterPrintTextProfile") { fontType = $ShellFont; fontSize = $ShellMediumFontSize; fontColor = $ShellColorBright; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("ShellEditMOTDTextProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "66 219 234"; fontColorHL = "25 68 56"; fillColorHL = "50 233 206"; cursorColor = "200 240 240"; autoSizeWidth = false; autoSizeHeight = false; tab = true; canKeyFocus = true; }; new GuiControlProfile ("ShellTopicTextProfile") { fontType = $ShellFont; fontSize = $ShellMediumFontSize; fontColor = "100 200 200"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("BrowserFilterLabelProfile") { fontType = $ShellLabelFont; fontSize = 22; fontColor = "0 220 0"; justify = "left"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("BrowserFilterTextProfile") { fontType = $ShellLabelFont; fontSize = 22; fontColor = "66 219 234"; justify = "left"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("BrowserStatusTextProfile") { fontType = $ShellLabelFont; fontSize = 22; fontColor = "66 219 234"; justify = "right"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("BrowserProgressProfile") { opaque = false; fillColor = "79 253 181 180"; border = true; borderColor = "3 124 134"; }; new GuiControlProfile ("InfoWindowProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "66 219 234"; fontColors[6] = $PlayerNameColor; fontColors[7] = $TribeTagColor; fontColors[8] = $SmurfNameColor; fontColors[9] = $BotNameColor; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("ShellMessageTextProfile") { fontType = $ShellFont; fontSize = $ShellMediumFontSize; fontColor = "66 219 234"; fontColorHL = "25 68 56"; fillColorHL = "50 233 206"; cursorColor = "200 240 240"; autoSizeWidth = false; autoSizeHeight = false; tab = true; canKeyFocus = true; }; new GuiControlProfile ("ShellLoadTextProfile") { fontType = $ShellFont; fontSize = $ShellMediumFontSize; fontColor = "66 219 234"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("ShellLargeLabelProfile" ) { fontType = $ShellLabelFont; fontSize = 22; fontColor = "60 180 180"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("ShellMediumTextProfile") { fontType = $ShellFont; fontSize = $ShellMediumFontSize; fontColor = $ShellColorBright; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("ShellMediumTextCenterProfile") { fontType = $ShellFont; fontSize = $ShellMediumFontSize; fontColor = $ShellColorBright; autoSizeWidth = false; autoSizeHeight = true; justify = "center"; }; new GuiControlProfile ("DebriefHeadlineTextProfile") { fontType = $ShellLabelFont; fontSize = 28; fontColor = $ShellColorBright; autoSizeWidth = false; autoSizeHeight = true; tab = false; canKeyFocus = false; }; new GuiControlProfile ("DebriefTextProfile") { fontType = $ShellFont; fontSize = $ShellMediumFontSize; fontColor = "60 180 180"; fontColors[6] = $PlayerNameColor; fontColors[7] = $TribeTagColor; fontColors[8] = $SmurfNameColor; fontColors[9] = $BotNameColor; autoSizeWidth = false; autoSizeHeight = false; tab = false; canKeyFocus = false; }; new GuiControlProfile ("ScoreHeaderTextProfile") { fontType = $ShellLabelFont; fontSize = 28; fontColor = "0 255 255"; autoSizeWidth = false; autoSizeHeight = true; tab = false; canKeyFocus = false; }; new GuiControlProfile ("ScoreSubheaderTextProfile") { fontType = $ShellLabelFont; fontSize = 22; fontColor = "0 255 255"; autoSizeWidth = false; autoSizeHeight = true; tab = false; canKeyFocus = false; }; new GuiControlProfile ("ScoreTextProfile") { fontType = $ShellFont; fontSize = $ShellMediumFontSize; fontColor = "0 220 220"; autoSizeWidth = false; autoSizeHeight = false; tab = false; canKeyFocus = false; }; new GuiControlProfile ("ShellTreeViewProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "6 245 215"; fontColorHL = "6 245 215"; fontColorSEL = "25 68 56"; bitmapBase = "gui/shll_bar"; tab = true; canKeyFocus = true; }; new GuiControlProfile ("ShellBigTextProfile") { fontType = $ShellHeaderFont; fontSize = $ShellHeaderFontSize; fontColor = $ShellColorBright; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("HudScoreListProfile") { fontType = $ShellFont; fontSize = $ShellMediumFontSize; fontColor = "60 180 180"; }; new GuiControlProfile ("GuiHelpBoxProfile") { border = false; //borderColor = "3 144 156"; opaque = true; fillColor = "3 144 156 86"; }; new GuiControlProfile ("GuiHelpTextProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "169 215 250"; autoSizeWidth = false; autoSizeHeight = false; justify = "left"; }; new GuiControlProfile ("GuiHelpHeaderProfile") { fontType = $ShellLabelFont; fontSize = $ShellLabelFontSize; fontColor = "169 215 250"; autoSizeWidth = true; autoSizeHeight = true; justify = "left"; }; new GuiControlProfile ("GuiVoiceRedProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "180 0 0"; justify = "left"; }; new GuiControlProfile ("GuiVoiceGreenProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "0 180 0"; justify = "left"; }; new GuiControlProfile( "GuiDeathMsgHudProfile" ) { opaque = false; border = false; //borderColor = "255 255 0 128"; }; new GuiControlProfile ("GuiTextProfile") { fontType = "Univers"; fontSize = 16; fontColor = "0 0 0"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("GuiCenterTextProfile") { fontType = "Univers"; fontSize = 16; fontColor = "0 0 0"; fixedExtent = true; justify = "center"; }; new GuiControlProfile ("GuiBigTextProfile") { fontType = "Times"; fontSize = 36; fontColor = "0 0 0"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("GuiBigTextProfileWhite") { fontType = "Times"; fontSize = 24; fontColor = " 0 0 0"; fillColor = "255 255 255"; fontColorHL = "255 255 255"; fillColorHL = "0 0 0"; autoSizeWidth = true; autoSizeHeight = true; opaque = true; }; new GuiControlProfile("GuiBorderProfile") { border = "true"; borderColor = "40 205 170"; opaque = true; fillColor = "0 64 100 80"; }; new GuiControlProfile("ZoomHudProfile") { border = "true"; borderColor = "40 205 170"; opaque = false; fillColor = "0 64 100 80"; }; new GuiControlProfile("GuiDashBoxProfile") { border = "false"; opaque = false; }; new GuiControlProfile("GuiDashTextProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "154 208 253"; justify = "center"; }; new GuiControlProfile ("GuiTextBGLeftProfile") { fontType = "Univers Condensed"; fontSize = 20; fontColor = "70 235 200"; justify = "center"; }; new GuiControlProfile ("GuiTextBGCenterProfile") { fontType = "Univers"; fontSize = 16; fontColor = "70 235 200"; justify = "center"; }; new GuiControlProfile ("GuiTextBGRightProfile") { fontType = "Univers"; fontSize = 16; fontColor = "70 235 200"; justify = "right"; }; new GuiControlProfile ("GuiTextBGWhiteRightProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "90 255 220"; justify = "right"; }; new GuiControlProfile ("GuiHelpLineProfile") { borderColor = "231 101 26"; bitmap = "gui/hud_dot"; }; new GuiControlProfile ("GuiTextObjHudCenterProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "169 215 250"; fontColors[6] = $PlayerNameColor; fontColors[7] = $TribeTagColor; fontColors[8] = $SmurfNameColor; fontColors[9] = $BotNameColor; justify = "center"; }; new GuiControlProfile ("GuiTextObjHudLeftProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "169 215 250"; fontColors[6] = $PlayerNameColor; fontColors[7] = $TribeTagColor; fontColors[8] = $SmurfNameColor; fontColors[9] = $BotNameColor; justify = "left"; }; new GuiControlProfile ("GuiTextObjGreenLeftProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "23 236 67"; fontColors[6] = $PlayerNameColor; fontColors[7] = $TribeTagColor; fontColors[8] = $SmurfNameColor; fontColors[9] = $BotNameColor; justify = "left"; }; new GuiControlProfile ("GuiTextObjGreenCenterProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "23 236 67"; fontColors[6] = $PlayerNameColor; fontColors[7] = $TribeTagColor; fontColors[8] = $SmurfNameColor; fontColors[9] = $BotNameColor; justify = "center"; }; new GuiControlProfile ("DeathMsgTextProfile") { fontType = "Univers"; fontSize = 14; fontColor = "40 247 113"; // green justify = "left"; }; new GuiControlProfile("DebuggerWindowProfile") { border = "true"; borderColor = "255 255 255"; opaque = "true"; fillColor = "0 0 0"; }; new GuiControlProfile ("GuiTextEditProfile") { opaque = true; fillColor = "255 255 255"; fillColorHL = "128 128 128"; border = true; borderColor = "0 0 0"; fontType = "Lucida Console"; fontSize = 12; fontColor = "0 0 0"; fontColorHL = "255 255 255"; fontColorNA = "128 128 128"; textOffset = "0 2"; autoSizeWidth = false; autoSizeHeight = true; tab = true; canKeyFocus = true; }; new GuiControlProfile ("GuiInspectorTextEditProfile") { opaque = true; fillColor = "255 255 255"; fillColorHL = "128 128 128"; border = true; borderColor = "0 0 0"; fontType = "Univers"; fontSize = 16; fontColor = "0 0 0"; fontColorHL = "255 255 255"; autoSizeWidth = false; autoSizeHeight = true; tab = false; canKeyFocus = true; }; new GuiControlProfile ("GuiMessageEditHudProfile") { fontType = "verdana"; fontSize = 14; fontColor = "255 255 0"; cursorColor = "255 205 0"; autoSizeWidth = false; autoSizeHeight = true; tab = false; canKeyFocus = true; }; new GuiControlProfile ("GuiMessageEditHudTextProfile") { fontType = "verdana"; fontSize = 14; fontColor = "255 255 255"; autoSizeWidth = true; autoSizeHeight = true; tab = false; }; new GuiControlProfile("GuiAmmoHudProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "169 215 250"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile("GuiPackTextProfile") { fontType = "Univers"; fontSize = 12; fontColor = "169 215 250"; justify = "center"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile("GuiTempSpeedProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "240 0 240"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile("GuiRecordingHudProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "255 0 0"; justify = "center"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("GuiChatBackProfile") { bitmapbase = "gui/hud_new_window"; }; new GuiControlProfile ("HudScoreProfile") { bitmap = "gui/hud_new_scorewindow"; borderColor = "30 59 56"; }; new GuiControlProfile ("HudHelpTagProfile") { borderColor = "231 101 26"; bitmap = "gui/hud_dot"; }; new GuiControlProfile ("HudVoteBackProfile") { bitmapBase = "gui/hud_new_window_B"; }; new GuiControlProfile ("GuiVMenuProfile") { bitmapBase = "gui/hud_new_window"; fontType = $ShellFont; fontSize = $ShellMediumFontSize; }; new GuiControlProfile ("GuiChatHudProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "44 172 181"; // default color (death msgs, scoring, inventory) fontColors[1] = "4 235 105"; // client join/drop, tournament mode fontColors[2] = "219 200 128"; // gameplay, admin/voting, pack/deployable fontColors[3] = "77 253 95"; // team chat, spam protection message, client tasks fontColors[4] = "40 231 240"; // global chat fontColors[5] = "200 200 50 200"; // used in single player game // WARNING! Colors 6-9 are reserved for name coloring autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("GuiHudNavProfile") { // fontType = "Univers Condensed"; // fontSize = 16; // fontColor = "255 255 255"; // autoSizeWidth = false; // autoSizeHeight = true; fontColors[6] = $PlayerNameColor; fontColors[7] = $TribeTagColor; fontColors[8] = $SmurfNameColor; fontColors[9] = $BotNameColor; }; new GuiControlProfile ( "GuiHudVoiceMenuProfile" ) { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "70 235 200"; justify = "left"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ( "GuiHudVoiceCommandProfile" ) { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "40 205 210"; justify = "left"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("GuiCommandMsgHudProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "253 221 0"; autoSizeWidth = false; autoSizeHeight = true; tab = false; }; new GuiControlProfile ("GuiButtonProfile") { opaque = true; fillColor = "232 232 232"; border = true; borderColor = "0 0 0"; borderColorHL = "127 127 127"; fontType = "Univers Condensed"; fontSize = 16; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fixedExtent = true; justify = "center"; soundButtonDown = sButtonDown; soundButtonOver = sButtonOver; canKeyFocus = false; }; new GuiControlProfile ("GuiHudCounterProfile") { opaque = true; fillColor = "232 232 232"; border = false; borderColor = "0 0 0"; borderColorHL = "127 127 127"; fontType = $ShellFont; fontSize = 12; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fixedExtent = true; justify = "center"; }; new GuiControlProfile ("GuiRadioProfile") { opaque = false; fillColor = "232 232 232"; border = false; borderColor = "0 0 0"; fontType = "Univers"; fontSize = 14; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fixedExtent = true; justify = "center"; }; new GuiControlProfile ("GuiCheckBoxProfile") { opaque = false; fillColor = "232 232 232"; border = false; borderColor = "0 0 0"; fontType = "Univers"; fontSize = 14; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fixedExtent = true; justify = "center"; }; new GuiControlProfile ("GuiPopUpMenuProfile") { opaque = true; fillColor = "232 232 232"; border = true; borderColor = "0 0 0"; fontType = "Univers"; fontSize = 14; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fontColorSEL = "32 100 100"; fixedExtent = true; justify = "center"; }; new GuiControlProfile ("GuiWindowProfile") { opaque = true; fillColor = "200 200 200"; fillColorHL = "64 150 150"; fillColorNA = "150 150 150"; fontType = "Univers"; fontSize = 16; fontColor = "0 0 0"; fontColorHL = "0 0 0"; text = "GuiWindowCtrl test"; bitmap = "gui/darkWindow"; }; new GuiControlProfile ("GuiScrollCtrlProfile") { border = true; borderColor = "0 0 0"; bitmap = "gui/darkScroll"; }; new GuiControlProfile ("GuiScrollContentProfile") { opaque = false; autoSizeWidth = true; autoSizeHeight = true; border = false; }; new GuiControlProfile ("GuiTreeViewProfile") { fontType = "Lucida Console"; fontSize = 12; fontColor = "0 0 0"; fontColorHL = "255 255 255"; bitmap = "gui/treeView"; }; new GuiControlProfile ("GuiTextArrayProfile") { fontType = "Univers"; fontSize = 16; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fillColorHL = "200 200 200"; }; new GuiControlProfile ("GuiConsoleProfile") { fontType = "Lucida Console"; fontSize = 12; fontColor = "0 0 0"; fontColorHL = "130 130 130"; fontColorNA = "255 0 0"; fontColors[6] = "50 50 50"; fontColors[7] = "50 50 0"; fontColors[8] = "0 0 50"; fontColors[9] = "0 50 0"; }; new GuiControlProfile ("GuiConsoleTextProfile") { fontType = "Lucida Console"; fontSize = 12; fontColor = "0 0 0"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile("GuiMediumBoldTextProfile") { fontType = "Univers Condensed"; fontSize = 16; fontColor = "0 0 0"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile("EditTSControlProfile") { fontType = "Univers"; fontSize = 16; fontColor = "200 200 200"; autoSizeWidth = true; autoSizeHeight = true; fillColor = "255 255 0"; opaque = "true"; }; new GuiControlProfile("EditorContentProfile") { fontType = "Univers"; fontSize = 16; fontColor = "200 200 200"; autoSizeWidth = true; autoSizeHeight = true; fillColor = "220 220 220"; opaque = "true"; border = true; borderColor = "180 180 180"; }; new GuiControlProfile ("ShellProgressBarProfile") { opaque = false; fillColor = "44 152 162 100"; border = true; borderColor = "78 88 120"; }; new GuiControlProfile ("ShellProgressBarTextProfile") { fontType = $ShellLabelFont; fontSize = $ShellLabelFontSize; fontColor = "169 215 250"; justify = "center"; }; new GuiControlProfile ("ShellLoadFrameProfile" ) { border = true; borderColor = "78 88 120"; }; new GuiControlProfile ("ShellSubHeaderProfile" ) { fontType = "Univers Condensed Bold"; fontSize = 28; fontColor = "66 219 234"; justify = "left"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile( "DlgBackProfile" ) { opaque = true; fillColor = "0 0 0 160"; }; new GuiControlProfile( "MotdCProfile" ) { justify = "center"; opaque = true; autoSizeWidth = true; fillColor = "0 0 0 160"; fontType = "Univers Condensed"; fontSize = 14; fontColor = "000 219 234"; }; new GuiControlProfile( "GuiInputCtrlProfile" ) { tab = true; canKeyFocus = true; }; new GuiControlProfile( "TesterProfile" ) { border = true; borderColor = "255 255 0"; }; new GuiControlProfile ("TaskHudProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "66 229 244"; autoSizeWidth = true; autoSizeHeight = true; fontColors[1] = "0 200 0 200"; fontColors[2] = "200 0 0 200"; fontColors[3] = "0 0 200 200"; fontColors[6] = $PlayerNameColor; fontColors[7] = $TribeTagColor; fontColors[8] = $SmurfNameColor; fontColors[9] = $BotNameColor; }; new GuiControlProfile ("TaskHudTextProfile") { fontType = $ShellLabelFont; fontSize = $ShellFontSize; fontColor = "66 229 244"; autoSizeWidth = true; autoSizeHeight = true; }; new GuiControlProfile ("ShellChatMemberListProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "60 180 180"; fontColorHL = "6 245 215"; fontColorNA = "128 128 128"; fontColorSEL = "25 68 56"; fontColors[4] = "255 255 255"; // nick font color fontColors[5] = "200 255 255"; // nick highlighted color fontColors[6] = "0 0 0"; // nick selected color fontColors[7] = "255 255 0"; // tribe font color fontColors[8] = "200 255 0"; // tribe highlighted color fontColors[9] = "0 0 255"; // tribe selected color bitmapBase = "gui/shll_bar"; tab = true; canKeyFocus = true; }; new GuiControlProfile ("GuiChannelVectorProfile") { fontType = $ShellFont; fontSize = $ShellFontSize; fontColor = "249 250 194"; // default font color fontColors[1] = "255 255 255"; // nick font color fontColors[2] = "255 255 0"; // tribe font color fontColors[3] = "0 200 0"; // server font color fontColors[4] = "4 235 105"; // client join/drop, tournament mode fontColors[5] = "219 200 128"; // gameplay, admin/voting, pack/deployable fontColors[6] = "77 253 95"; // team chat, spam protection message, client tasks fontColors[7] = "40 231 240"; // global chat fontColors[8] = "200 200 50 200"; // used in single player game fontColors[9] = "66 219 234"; autoSizeWidth = false; autoSizeHeight = true; }; new GuiControlProfile ("GuiTempHeatProfile") { fontType = $ShellButtonFont; fontSize = $ShellFontSize; fontColor = "230 40 230"; justify = "center"; }; new GuiControlProfile ("GuiBubblePopupProfile") { border = false; opaque = true; fillColor = "3 144 156 200"; }; new GuiControlProfile ("GuiBubbleTextProfile") { fontType = $ShellFont; fontSize = $ShellMediumFontSize; fontColor = "100 200 200"; autoSizeWidth = false; autoSizeHeight = true; }; PK !(jgui/helpTextGui.guinew GuiControl(HelpTextGui) { profile = "GuiContentProfileNoClear"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "0"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; new ShellFieldCtrl(objHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "40 365"; extent = "140 65"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(objHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "130 14"; minExtent = "8 8"; visible = "1"; text = "OBJECTIVES"; }; new GuiMLTextCtrl(objHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 45"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(objHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "160 425"; extent = "5 20"; flip = "0"; visible = "1"; }; new ShellFieldCtrl(chatHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "14 85"; extent = "140 70"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(chatHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "130 14"; minExtent = "8 8"; visible = "1"; text = "CHAT"; }; new GuiMLTextCtrl(chatHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 55"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(chatHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "145 75"; extent = "5 20"; flip = "1"; visible = "1"; }; new ShellFieldCtrl(energyHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "320 75"; extent = "145 85"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(energyHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "135 14"; minExtent = "8 8"; visible = "1"; text = "ENERGY"; }; new GuiMLTextCtrl(energyHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 70"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(energyHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "450 35"; extent = "5 45"; flip = "1"; visible = "1"; }; new ShellFieldCtrl(compassHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "480 90"; extent = "150 100"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; new GuiTextCtrl(compassHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "140 14"; minExtent = "8 8"; visible = "1"; text = "COMPASS"; }; new GuiMLTextCtrl(compassHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 85"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(compassHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "595 80"; extent = "5 25"; flip = "1"; visible = "1"; }; new ShellFieldCtrl(damageHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "280 10"; extent = "150 50"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; new GuiTextCtrl(damageHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "140 14"; minExtent = "8 8"; visible = "1"; text = "DAMAGE"; }; new GuiMLTextCtrl(damageHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "140 35"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(damageHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "bottom"; position = "425 15"; extent = "25 5"; flip = "0"; visible = "1"; }; new GuiControl(reticleTextFrame) { profile = "GuiHelpTextProfile"; horizSizing = "center"; vertSizing = "center"; position = "120 90"; extent = "400 300"; visible = "1"; new ShellFieldCtrl(reticleHudBox) { profile = "GuiChatBackProfile"; horizSizing = "right"; vertSizing = "top"; position = "20 140"; extent = "140 70"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; new GuiTextCtrl(reticleHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "130 14"; minExtent = "8 8"; visible = "1"; text = "RETICLE"; }; new GuiMLTextCtrl(reticleHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 55"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(reticleHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "right"; vertSizing = "top"; position = "155 145"; extent = "25 5"; flip = "0"; visible = "1"; }; }; new ShellFieldCtrl(inventoryHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "420 340"; extent = "140 85"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(inventoryHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "130 14"; minExtent = "8 8"; visible = "1"; text = "INVENTORY"; }; new GuiMLTextCtrl(inventoryHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "130 70"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(inventoryHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "490 420"; extent = "5 20"; flip = "0"; visible = "1"; }; new ShellFieldCtrl(weaponsHudBox) { profile = "GuiChatBackProfile"; horizSizing = "left"; vertSizing = "top"; position = "460 240"; extent = "140 70"; minExtent = "8 8"; visible = "1"; new GuiTextCtrl(weaponsHudHeader) { profile = "GuiHelpHeaderProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 1"; extent = "130 14"; minExtent = "8 8"; visible = "1"; text = "WEAPONS"; }; new GuiMLTextCtrl(weaponsHudText) { profile = "GuiHelpTextProfile"; horizSizing = "width"; vertSizing = "height"; position = "4 15"; extent = "135 60"; minExtent = "8 8"; visible = "1"; lineSpacing = "1"; }; }; new HudHelpTag(weaponsHudLine) { profile = "GuiHelpLineProfile"; horizSizing = "left"; vertSizing = "top"; position = "590 300"; extent = "20 5"; flip = "0"; visible = "1"; }; }; PlayGui.add(helpTextGui);PK !(DIIgui/objectBuilderGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(ObjectBuilderGui) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiWindowCtrl(OBTargetWindow) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "217 74"; extent = "256 282"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; resizeWidth = "1"; resizeHeight = "1"; canMove = "1"; canClose = "0"; canMinimize = "0"; canMaximize = "0"; minSize = "50 50"; new GuiTextCtrl() { profile = "GuiCenterTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "13 31"; extent = "84 25"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Object Name:"; }; new GuiTextEditCtrl(OBObjectName) { profile = "GuiTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "105 31"; extent = "143 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; historySize = "0"; }; new GuiControl(OBContentWindow) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "8 56"; extent = "240 193"; minExtent = "0 0"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; }; new GuiButtonCtrl(OBOKButton) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "70 254"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "ObjectBuilderGui.onOK();"; helpTag = "0"; text = "OK"; }; new GuiButtonCtrl(OBCancelButton) { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 254"; extent = "80 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; command = "ObjectBuilderGui.onCancel();"; helpTag = "0"; text = "Cancel"; }; }; }; //--- OBJECT WRITE END --- function ObjectBuilderGui::init(%this) { %this.baseOffsetX = 9; %this.baseOffsetY = 10; %this.scriptFile = "editor/newObject.cs"; %this.defaultObjectName = ""; %this.defaultFieldStep = 26; %this.columnOffset = 95; %this.fieldNameExtent = "132 18"; %this.textEditExtent = "127 18"; %this.checkBoxExtent = "18 18"; %this.popupMenuExtent = "127 18"; %this.fileButtonExtent = "127 18"; // %this.numControls = 0; %this.reset(); } function ObjectBuilderGui::reset(%this) { %this.curXPos = %this.baseOffsetX; %this.curYPos = %this.baseOffsetY; %this.createCallback = ""; %this.currentControl = 0; // OBObjectName.setValue(%this.defaultObjectName); // %this.newObject = 0; %this.className = ""; %this.numFields = 0; // for(%i = 0; %i < %this.numControls; %i++) { %this.textControls[%i].delete(); %this.conrols[%i].delete(); } %this.numControls = 0; } //------------------------------------------------------------------------------ function ObjectBuilderGui::createFileType(%this, %index) { if(%index >= %this.numFields || %this.field[%index, name] $= "") { error("ObjectBuilderGui::createFileType: invalid field"); return; } // if(%this.field[%index, text] $= "") %name = %this.field[%index, name]; else %name = %this.field[%index, text]; // %this.textControls[%this.numControls] = new GuiTextCtrl() { profile = "GuiTextProfile"; text = %name; extent = %this.fieldNameExtent; position = %this.curXPos @ " " @ %this.curYPos; modal = "1"; }; // %this.controls[%this.numControls] = new GuiButtonCtrl() { profile = "GuiButtonProfile"; extent = %this.fileButtonExtent; position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos; modal = "1"; command = %this @ ".getFileName(" @ %index @ ");"; }; %val = %this.field[%index, value]; %this.controls[%this.numControls].setValue(fileBase(%val) @ fileExt(%val)); %this.numControls++; %this.curYPos += %this.defaultFieldStep; } function ObjectBuilderGui::getFileName(%this, %index) { if(%index >= %this.numFields || %this.field[%index, name] $= "") { error("ObjectBuilderGui::getFileName: invalid field"); return; } %val = %this.field[%index, value]; %path = filePath(%val); %ext = fileExt(%val); %this.currentControl = %index; getLoadFilename(%path @ "*" @ %ext, %this @ ".gotFileName"); } function ObjectBuilderGui::gotFileName(%this, %name) { %this.controls[%this.currentControl].setValue(%name); } //------------------------------------------------------------------------------ function ObjectBuilderGui::createDataBlockType(%this, %index) { if(%index >= %this.numFields || %this.field[%index, name] $= "") { error("ObjectBuilderGui::createDataBlockType: invalid field"); return; } // if(%this.field[%index, text] $= "") %name = %this.field[%index, name]; else %name = %this.field[%index, text]; // %this.textControls[%this.numControls] = new GuiTextCtrl() { profile = "GuiTextProfile"; text = %name; extent = %this.fieldNameExtent; position = %this.curXPos @ " " @ %this.curYPos; modal = "1"; }; // %this.controls[%this.numControls] = new GuiPopupMenuCtrl() { profile = "GuiButtonProfile"; extent = %this.popupMenuExtent; position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos; modal = "1"; maxPopupHeight = "200"; }; %classname = getWord(%this.field[%index, value], 0); %this.controls[%this.numControls].add("", -1); // add the datablocks for(%i = 0; %i < DataBlockGroup.getCount(); %i++) { %obj = DataBlockGroup.getObject(%i); if(%obj.getClassName() $= %classname) %this.controls[%this.numControls].add(%obj.getName(), %i); } %this.controls[%this.numControls].setValue(getWord(%this.field[%index, value], 1)); %this.numControls++; %this.curYPos += %this.defaultFieldStep; } function ObjectBuilderGui::createBoolType(%this, %index) { if(%index >= %this.numFields || %this.field[%index, name] $= "") { error("ObjectBuilderGui::createBoolType: invalid field"); return; } // if(%this.field[%index, value] $= "") %value = 0; else %value = %this.field[%index, value]; // if(%this.field[%index, text] $= "") %name = %this.field[%index, name]; else %name = %this.field[%index, text]; // %this.textControls[%this.numControls] = new GuiTextCtrl() { profile = "GuiTextProfile"; text = %name; extent = %this.fieldNameExtent; position = %this.curXPos @ " " @ %this.curYPos; modal = "1"; }; // %this.controls[%this.numControls] = new GuiCheckBoxCtrl() { profile = "GuiCheckBoxProfile"; extent = %this.checkBoxExtent; position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos; modal = "1"; }; %this.controls[%this.numControls].setValue(%value); %this.numControls++; %this.curYPos += %this.defaultFieldStep; } function ObjectBuilderGui::createStringType(%this, %index) { if(%index >= %this.numFields || %this.field[%index, name] $= "") { error("ObjectBuilderGui::createStringType: invalid field"); return; } // if(%this.field[%index, text] $= "") %name = %this.field[%index, name]; else %name = %this.field[%index, text]; // %this.textControls[%this.numControls] = new GuiTextCtrl() { profile = "GuiTextProfile"; text = %name; extent = %this.fieldNameExtent; position = %this.curXPos @ " " @ %this.curYPos; modal = "1"; }; // %this.controls[%this.numControls] = new GuiTextEditCtrl() { profile = "GuiTextEditProfile"; extent = %this.textEditExtent; text = %this.field[%index, value]; position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos; modal = "1"; }; %this.numControls++; %this.curYPos += %this.defaultFieldStep; } //------------------------------------------------------------------------------ function ObjectBuilderGui::adjustSizes(%this) { if(%this.numControls == 0) %this.curYPos = 0; OBTargetWindow.extent = "256 " @ %this.curYPos + 88; OBContentWindow.extent = "240 " @ %this.curYPos; OBOKButton.position = "70 " @ %this.curYPos + 62; OBCancelButton.position = "156 " @ %this.curYPos + 62; } function ObjectBuilderGui::process(%this) { if(%this.className $= "") { error("ObjectBuilderGui::process: classname is not specified"); return; } OBTargetWindow.setValue("Building Object: " @ %this.className); // for(%i = 0; %i < %this.numFields; %i++) { switch$(%this.field[%i, type]) { case "TypeBool": %this.createBoolType(%i); case "TypeDataBlock": %this.createDataBlockType(%i); case "TypeFile": %this.createFileType(%i); default: %this.createStringType(%i); } } // add the controls for(%i = 0; %i < %this.numControls; %i++) { OBContentWindow.add(%this.textControls[%i]); OBContentWindow.add(%this.controls[%i]); } // %this.adjustSizes(); // Canvas.pushDialog(%this); } function ObjectBuilderGui::processNewObject(%this, %obj) { if(%this.createCallback !$= "") eval(%this.createCallback); if(!isObject(EWorldEditor)) return; $InstantGroup.add(%obj); EWorldEditor.clearSelection(); EWorldEditor.selectObject(%obj); EWorldEditor.dropSelection(); } function ObjectBuilderGui::onOK(%this) { // get current values for(%i = 0; %i < %this.numControls; %i++) %this.field[%i, value] = %this.controls[%i].getValue(); // %file = new FileObject(); %file.openForWrite(%this.scriptFile); %file.writeLine(%this @ ".newObject = new " @ %this.className @ "(" @ OBObjectName.getValue() @ ") {"); for(%i = 0; %i < %this.numFields; %i++) %file.writeLine(" " @ %this.field[%i, name] @ " = \"" @ %this.field[%i, value] @ "\";"); %file.writeLine("};"); %file.close(); %file.delete(); // exec(%this.scriptFile); if(%this.newObject != 0) %this.processNewObject(%this.newObject); %this.reset(); Canvas.popDialog(%this); } function ObjectBuilderGui::onCancel(%this) { %this.reset(); Canvas.popDialog(%this); } function ObjectBuilderGui::addField(%this, %name, %type, %text, %value) { %this.field[%this.numFields, name] = %name; %this.field[%this.numFields, type] = %type; %this.field[%this.numFields, text] = %text; %this.field[%this.numFields, value] = %value; %this.numFields++; } //------------------------------------------------------------------------------ // Environment //------------------------------------------------------------------------------ function ObjectBuilderGui::buildSky(%this) { %this.className = "Sky"; %this.addField("materialList", "TypeFile", "Material list", "Lush_l4.dml"); %this.addField("cloudSpeed[0]", "TypePoint2", "Cloud0 Speed", "0.0000003 0.0000003"); %this.addField("cloudSpeed[1]", "TypePoint2", "Cloud1 Speed", "0.0000006 0.0000006"); %this.addField("cloudSpeed[2]", "TypePoint2", "Cloud2 Speed", "0.0000009 0.0000009"); %this.addField("cloudHeightPer[0]", "TypeFloat", "Cloud0 Height", "0.349971"); %this.addField("cloudHeightPer[1]", "TypeFloat", "Cloud1 Height", "0.25"); %this.addField("cloudHeightPer[2]", "TypeFloat", "Cloud2 Height", "0.199973"); %this.addField("visibleDistance", "TypeFloat", "Visible distance", "900"); %this.addField("fogDistance", "TypeFloat", "Fog distance", "600"); %this.addField("fogColor", "TypeColor", "Fog color", "0.5 0.5 0.5"); %this.addField("fogVolume1", "TypePoint3", "Fog volume", "120 0 100"); %this.addField("fogVolume2", "TypePoint3", "Fog volume", "0 0 0"); %this.addField("fogVolume3", "TypePoint3", "Fog volume", "0 0 0"); %this.process(); } function ObjectBuilderGui::buildSun(%this) { %this.className = "Sun"; %this.addField("direction", "TypeVector", "Direction", "1 1 -1"); %this.addField("color", "TypeColor", "Sun color", "0.8 0.8 0.8"); %this.addField("ambient", "TypeColor", "Ambient color", "0.2 0.2 0.2"); %this.process(); } function ObjectBuilderGui::buildLightning(%this) { %this.className = "Lightning"; %this.addField("dataBlock", "TypeDataBlock", "Data block", "LightningData DefaultStorm"); %this.process(); } function ObjectBuilderGui::buildWater(%this) { %this.className = "WaterBlock"; // jff: this object needs some work!! %this.addField("extent", "TypePoint3", "Extent", "100 100 10"); %this.addField("textureSize", "TypePoint2", "Texture size", "32 32"); %this.addField("params[0]", "TypePoint4", "Wave Param0", "0.32 -0.67 0.066 0.5"); %this.addField("params[1]", "TypePoint4", "Wave Param1", "0.63 -2.41 0.33 0.21"); %this.addField("params[2]", "TypePoint4", "Wave Param2", "0.39 0.39 0.2 0.133"); %this.addField("params[3]", "TypePoint4", "Wave Param3", "1.21 -0.61 0.13 -0.33"); %this.addField("floodFill", "TypeBool", "Flood fill?", "true"); %this.addField("seedPoints", "TypeString", "Seed points", "0 0 1 0 1 1 0 1"); %this.process(); } function ObjectBuilderGui::buildTerrain(%this) { %this.className = "TerrainBlock"; %this.createCallback = "tEditor.attachTerrain();"; %this.addField("terrainFile", "TypeFile", "Terrain file", "terrains/terr1.ter"); %this.addField("squareSize", "TypeInt", "Square size", "8"); %this.process(); } function ObjectBuilderGui::buildAudioEmitter(%this) { %this.className = "AudioEmitter"; %this.addField("profile", "TypeDataBlock", "Sound Profile", "AudioProfile"); %this.addField("description", "TypeDataBlock", "Sound Description", "AudioDescription"); %this.addField("fileName", "TypeFile", "Audio file", ""); %this.addField("useProfileDescription", "TypeBool", "Use profile's desc?", "false"); %this.addFIeld("volume", "TypeFloat", "Volume", "1.0"); %this.addField("isLooping", "TypeBool", "Looping?", "true"); %this.addField("is3D", "TypeBool", "Is 3D sound?", "true"); %this.addField("minDistance", "TypeFloat", "Min distance", "20.0"); %this.addField("maxDistance", "TypeFloat", "Max distance", "100.0"); %this.addField("coneInsideAngle", "TypeInt", "Cone inside angle", "360"); %this.addField("coneOutsideAngle", "TypeInt", "Cone outside angle", "360"); %this.addField("coneOutsideVolume", "TypeFloat", "Cone outside volume", "1.0"); %this.addField("coneVector", "TypePoint3", "Cone Vector", "0 0 1"); %this.addField("loopCount", "TypeInt", "Loop count", "-1"); %this.addField("minLoopGap", "TypeInt", "Min loop gap (ms)", "0"); %this.addField("maxLoopGap", "TypeInt", "Max loop gap (ms)", "0"); %this.addField("type", "TypeEnum", "Audio type", "EffectAudioType"); %this.process(); } function ObjectBuilderGui::buildPrecipitation(%this) { %this.className = "Precipitation"; %this.addField("nameTag", "TypeString", "Name", ""); %this.addField("dataBlock", "TypeDataBlock", "Precipitation data", "PrecipitationData"); %this.process(); } function ObjectBuilderGui::buildParticleEmitter(%this) { %this.className = "ParticleEmissionDummy"; %this.addField("dataBlock", "TypeDataBlock", "datablock", "ParticleEmissionDummyData"); %this.addField("emitter", "TypeDataBlock", "Particle data", "ParticleEmitterData"); %this.process(); } //------------------------------------------------------------------------------ // Mission //------------------------------------------------------------------------------ function ObjectBuilderGui::buildMissionArea(%this) { %this.className = "MissionArea"; %this.addField("area", "TypeRect", "Bounding area", "0 0 1024 1024"); %this.process(); } function ObjectBuilderGui::buildMarker(%this) { %this.className = "Marker"; %this.process(); } function ObjectBuilderGui::buildForcefield(%this) { %this.className = "ForcefieldBare"; %this.addField("dataBlock", "TypeDataBlock", "Data Block", "ForceFieldBareData defaultForceFieldBare"); %this.process(); } function ObjectBuilderGui::buildTrigger(%this) { %this.className = "Trigger"; %this.addField("dataBlock", "TypeDataBlock", "Data Block", "TriggerData defaultTrigger"); %this.addField("polyhedron", "TypeTriggerPolyhedron", "Polyhedron", "0 0 0 1 0 0 0 -1 0 0 0 1"); %this.process(); } function ObjectBuilderGui::buildPhysicalZone(%this) { %this.className = "PhysicalZone"; %this.addField("polyhedron", "TypeTriggerPolyhedron", "Polyhedron", "0 0 0 1 0 0 0 -1 0 0 0 1"); %this.process(); } function ObjectBuilderGui::buildCamera(%this) { %this.className = "Camera"; %this.addField("position", "TypePoint3", "Position", "0 0 0"); %this.addField("rotation", "TypePoint4", "Rotation", "1 0 0 0"); %this.addField("dataBlock", "TypeDataBlock", "Data block", "CameraData Observer"); %this.addField("team", "TypeInt", "Team", "0"); %this.process(); } //------------------------------------------------------------------------------ // System //------------------------------------------------------------------------------ function ObjectBuilderGui::buildSimGroup(%this) { %this.className = "SimGroup"; %this.process(); } //------------------------------------------------------------------------------ // AI //------------------------------------------------------------------------------ function ObjectBuilderGui::buildObjective(%this) { %this.className = "AIObjective"; %this.process(); } function ObjectBuilderGui::buildNavigationGraph(%this) { %this.className = "NavigationGraph"; %this.process(); } PK !(۫ gui/sceneLightingGui.gui//--- OBJECT WRITE BEGIN --- new GuiControl(SceneLightingGui) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; new GuiWindowCtrl() { profile = "GuiWindowProfile"; horizSizing = "center"; vertSizing = "center"; position = "180 180"; extent = "280 88"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "Please wait..."; resizeWidth = "0"; resizeHeight = "0"; canMove = "0"; canClose = "0"; canMinimize = "0"; canMaximize = "0"; minSize = "50 50"; new GuiProgressCtrl() { profile = "GuiButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "21 51"; extent = "245 20"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; variable = "$SceneLighting::lightingProgress"; value = "0.f"; modal = "1"; helpTag = "0"; }; new GuiTextCtrl() { profile = "GuiTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "28 31"; extent = "231 18"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = "The mission is currently being relit. Please wait."; }; }; }; //--- OBJECT WRITE END --- PK !(۽help/1. About.hflAbout the Mission Editor... The GarageGames Torque Engine Mission Editor is included as part of the Torque Game Engine, and now as an integrated tool in Sierra's Tribes 2. For a general overview of the mission editor, see the Mission Editor Overview. PK !(VՊ#help/2. Mission Editor Overview.hflMission Editor... Mission Editor Overview The Mission Editor is the in-game tool for creating and editing landscapes and placing objects in the 3D world. Press the F11 key while in the game to toggle the Mission Editor on and off. The mission editor will start editing the currently loaded mission. The Mission Editor is composed of the following tools, selectable from the Window menu: World Editor - Full screen object movement and selection. World Editor Inspector - Used to inspect the properties of mission objects World Editor Creator - Used to create new mission objects Mission Area Editor - Used to adjust the bounds of the mission area, as well as mirror terrain data Terrain Editor - Tool for manually adjusting the terrain heightfield and square properties Terrain Terraform Editor - Tool for procedurally generating the terrain heightfield from fractal operations Terrain Texture Editor - Tool for procedurally generating the terrain textures based on rules Terrain Texture Painter - Tool for manually painting terrain textures on the terrain There are several editor functions and menus that are available in all mission editor modes: Basic Movement The normal movement keys can be used to control both the player and the camera. The right mouse button is used to rotate the camera or adjust the player's view. File Menu New Mission... - Creates a new empty mission with a default terrain and sky Open Mission... - Opens an existing mission for editing Save Mission - Saves changes to the current mission to disk Save Mission As... - Saves the current mission under a new name Import Terraform Data... - Imports terraform rules from an existing terrain file Import Texture Data... - Imports terrain texture rules from an existing terrain file Export Terraform Bitmap... - Only active from the Terrain Terraform Editor - exports the current terraform map to a bitmap Edit Menu Undo - Undoes the last action in terrain or world editing. Not all actions can be undone Redo - Redoes the last undone action Cut - Cuts the selected objects in the world editor from the mission to the clipboard Copy - Copys the selected objects in the world editor to the clipboard Paste - Pastes the current clipboard contents into the mission Select All - Selects all mission objects in the world editor Select None - Clears the current selection in the world and terrain editors Relight Scene - Recomputes mission static lighting World Editor Settings... - Accesses the settings dialog for the World Editor Terrain Editor Settings... - Accesses the settings dialog for the Terrain Editor Camera Menu Drop Camera At Player - Moves the camera object to the location of the player, and sets the mode to camera movement mode Drop Player At Camera - Moves the player object to the location of the movable camera, and sets the mode to player movement mode Toggle Camera - Toggles between player and camera movement mode Slowest...Fastest - Adjusts the speed of the camera PK !(qg:help/3. World Editor.hflWorld Editor... World Editor Basics The World Editor has three seperate "windows" in the Mission Editor: World Editor - a full screen object manipulator World Editor Inspector - used for inspecting and editing the properties of objects World Editor Creator - used for creating new mission objects The World Editor main view is a view of the 3D world. Objects in this view (interiors, shapes, markers, etc) can be manipulated with the mouse and keyboard. The following mouse and keyboard functions exist: Clicking on an unselected object - deselects all currently selected objects and selects the clicked object Clicking in empty space - click-drags a box around objects, and selects all objects in the box Shift-clicking on an object - toggles selection of the clicked object Mouse dragging a selected object - moves the selected objects, either on a horizontal plane, or sticking to the terrain, depending on the setting of the "Planar Movement" checkbox in the World Editor Settings dialog Control-clicking and drag - moves the selected objects vertically Alt-clicking and drag - rotates the selected objects about the vertical axis Alt-control-clicking and drag - scales the selected object by a face on the bounding box If gizmos are enabled in the World Editor Settings dialog, they can also be clicked and dragged: click-drag gizmo axis - move selection along that axis alt-click-drag gizmo axis - rotate selection on that axis alt-control-click-drag gizmo axis - scale along that axis World Menu The World Menu contains world editor specific options for controlling properties of the current selection, as well as choosing where new objects are dropped. The following list describes the world menu options: Lock Selection - Locks the current selection so that it cannot be manipulated from the world editor view Unlock Selection - Unlocks a locked selection Hide Selection - Hides the current selection to reduce clutter while editing Show Selection - Shows hidden objects in the selection Delete Selection - Deletes the currently selected objects Camera To Selection - Moves the camera to the selected objects Reset Transforms - Resets the rotation and scale on the selected objects Drop Selection - Re-drops the selected objects into the mission according to the drop rule (see below) Add Selection to Instant Group - Moves the currently selected objects into the current Instant Group. Drop at Origin - New objects will be created at the origin Drop at Camera - New objects will be created at the camera's location Drop at Camera w/Rot - New objects will be created at the camera's location with the camera's current orientation Drop below Camera - New objects will be created below the camera's location Drop at Screen Center - New objects will be created in the world where the view direction hits an object Drop at Centroid - New objects will be created in the world at the center of the selection Drop to Ground - New objects will be dropped at the terrain ground level World Editor Tree The World Editor tree view is displayed in the upper right screen quadrant in both the World Editor Inspector and the World Editor Creator. This tree displays the hierarchy of the mission data file. Objects selected in the tree will also be selected in the main view. There is a special group selection call the Instant Group. This group is where objects that are pasted are placed, as well as where objects created from the World Editor Creator are placed. In the World Editor tree view the instant group is displayed with a grey hilight. To change the current instant group, Alt-click on a group in the tree view. World Editor Inspector The World Editor Inspector allows the user to specify properties of mission objects. When an object is selected in Inspector mode, that object's properties will be displayed in the lower right quadrant of the screen. Once properties are edited, clicking the apply button will set those properties into the object. Dynamic properties can be assigned to objects with the Dynamic Fields Add button. Dynamic fields are accessable through the scripting language and are used to add game-specific properties to mission objects. World Editor Creator The World Editor Creator displays a tree view in the lower left corner of the screen. This tree contains all objects that can be created in a mission. PK !(qܹ  help/4. Mission Area Editor.hflMission Area Editor... The Mission Area Editor displays an overhead height map in the upper right corner of the screen, with markers for mission objects, a box for the mission area and a pair of lines denoting the current field of view. Clicking anywhere on the display will move the current view object (either camera or player) to that location in the mission. To edit the mission area, click on the "Edit Area" checkbox. This will display 8 resizing knobs on the mission area box, that can be dragged with the mouse. The "Center" button will cause the terrain file data to be repositioned and centered at 0,0 in the center of the mission area box. To mirror the terrain, click on the Mirror button. This will put the mission area editor in mirror mode. The left and right arrow buttons adjust the mirror plane angle to one of 8 different angles (2 axis aligned, 2 45-degree splits), and the Apply button will mirror the terrain across the mirror plane. PK !()b*help/5. Terrain Editor.hflTerrain Editor... The terrain editor is used to manually modify the terrain height map and square properties. Terrain editing is accomplished using the brush. The brush is a selection of terrain points or squares centered around the mouse cursor. The brush is either a circle or square area, and can be one of several size selected from the brush menu. The brush can also be either a hard brush - where the affect on the terrain is the same across the surface of the brush - or a soft brush - where the brush's influence on terrain diminishes towards the edges of the brush. The Terrain Editor Settings dialog filter view controls the falloff of the soft brush. The following terrain editing action modes can be selected from the Action menu. Select - Painting with the brush selects grid points Adjust Selection - The currently selected grid points can be raised or lowered as a group Add Dirt - "Dirt" is added at the center of the brush Excavate - "Dirt" is removed from the center of the brush Ajust Height - The brush selection can be dragged to raise or lower it Flatten - The brush surface is set to a flat plane height Smooth - Rough areas are made more smooth in the bounds of the brush Set Height - The terrain within the brush is set to a constant height (configurable in the Terrain Editor Settings) Set Empty - The squares covered by the brush are made into holes in the terrain Clear Empty - The squares covered by the brush are made solid Paint Material - The current terrain texture material will be painted with the brush PK !(’$help/6. Terrain Terraform Editor.hflTerrain Terraform Editor... The Terrain Terraform Editor is used to algorithmically generate terrain heightfields. Heightfield operations are arranged in a stack, with some operations using the results of previous operations to produce new heightfields. The results of the last operation on the stack can be applied to the terrain using the Apply button. The Terraform Editor has two panes - the top pane displays information about the currently selected operation, and the bottom pane shows the current operation stack. Between the two is a pull down menu for the creation of new operations. The first operation in the stack is always the General operation (which can't be deleted). The following operations are supported in the editor: fBm Fractal - Fractal for creating bumpy hills Rigid Multifractal - Fractal for creating ridges and sweeping valleys Canyon Fractal - Fractal for creating vertical canyon ridges Sinus - Overlapping sine wave patterns with different frequencies useful for creating rolling hills Bitmap - Used to import an existing 256x256 bitmap as a heightfield Turbulence - perturbs another operation on the stack Smoothing - smooths another operation on the stack Smooth Water - smooths water Smooth Ridges/valleys - smooths an existing operation on edge boundaries Filter - filters an existing operation based on a curve Thermal Erosion - erodes an existing operation using a thermal erosion algorithm Hydraulic Erosion - erodes an existing operation using a hydraulic erosion algorithm Blend - blends two existing operations acording to a scale factor and mathmatical operator Terrain File - loads an existing terrain file onto the stack PK !(cCsaa"help/7. Terrain Texture Editor.hflTerrain Texture Editor... The Terrain Texture Editor is used to algorithmically place terrain texures based on the heightfield at the bottom of the terraformer heightfield stack. The texture editor has three main interface elements on the right side of the screen - from top to bottom they are the operation inspector pane, the material list, and the placement operation list. Essentially, terrain materials (textures) are added with the "Add Material" button. This will look for any texture (.png or .jpg) in a subdirectory of any directory named "terrains". Once a material is added to the terrain, the user can select one of several placement operations that govern where that material will be placed on the terrain - they are: Place by Fractal - Places the terrain texture randomly across the terrain based on a brownian motion fractal. Place by Height - Places the texture based on an elevation filter Place by Slope - Places the texture based on a slope filter Place by Water Level - Places the texture based on the water level parameter in the terraform editor Pressing the "Apply" button applies the current texture operation list to the terrain file.PK !(Mޠ>zz#help/8. Terrain Texture Painter.hflTerrain Texture Painter... The Terrain Texture Painter tool is used to manually paint terrain textures on the terrain. Users can select up to six different textures in the boxes in the upper right corner of the screen. Selecting a texture will place a black box around it. The terrain brush can then be used to paint the texture on the terrain. Terrains with more than four textures may exhibit rendering irregularities if all those textures are used in the same area of a map. In general it is wise to use four or fewer textures on any individual terrain map. PK !(Bs}s}scripts/BountyGame.cs//--- GAME RULES BEGIN --- //Eliminate Targets in order assigned; eliminate Pursuer(s) without penalty //Killing a Bystander who was a former Target returns him to your Target pool //Killing 3 or more Targets in a row without dying earns a bonus //Killing all Targets first earns a bonus //Red = Target, Green = Bystander //--- GAME RULES END --- //Spec Note: Upon entry to game - // All opponents have green triangles. // Once you select your target, that player's triangle appears red (for you). // If someone who has you as a target (a Pursuer) damages you, his triangle disappears altogether (for you). // Once your target is eliminated, he respawns with a green triangle. // If your Pursuer kills you, he has a green triangle again when you respawn (unless he becomes your target). exec("scripts/aiBountyGame.cs"); $InvBanList[Bounty, "TurretOutdoorDeployable"] = 1; $InvBanList[Bounty, "TurretIndoorDeployable"] = 1; $InvBanList[Bounty, "ElfBarrelPack"] = 1; $InvBanList[Bounty, "MortarBarrelPack"] = 1; $InvBanList[Bounty, "PlasmaBarrelPack"] = 1; $InvBanList[Bounty, "AABarrelPack"] = 1; $InvBanList[Bounty, "MissileBarrelPack"] = 1; $InvBanList[Bounty, "Mine"] = 1; //-----------------Bounty Game score inits -------------- // .objectiveTargetKills .bystanderKills .predatorKills .suicides .deaths function BountyGame::initGameVars(%game) { %game.SCORE_PER_TARGETKILL = 1; %game.SCORE_PER_BYSTANDERKILL = -1; %game.SCORE_PER_SUICIDE = -1; %game.SCORE_PER_DEATH = 0; %game.SCORE_PER_COMPLETION_BONUS = 5; %game.SIZE_STREAK_TO_AWARD = 3; //award bonus for a winning streak this big or better %game.WARN_AT_NUM_OBJREM = 2; //display warning when player has only this many or less objectives left %game.MAX_CHEATDEATHS_ALLOWED = 1; //number of times a player can die by cntrl-k or die by leaving mission area before being labeled a cheater %game.waypointFrequency = 24000; %game.waypointDuration = 6000; } function BountyGame::startMatch(%game) { //call the default DefaultGame::startMatch(%game); //now give everyone who's already playing a target %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); %game.nextObjective(%cl); } } function BountyGame::allowsProtectedStatics(%game) { return true; } function BountyGame::setUpTeams(%game) { if ((%group = nameToID("MissionGroup/Teams")) == -1) return; %dropSet = new SimSet("TeamDrops0"); MissionCleanup.add(%dropSet); %group.setTeam(0); game.numTeams = 1; setSensorGroupCount(32); //now set up the sensor group colors - specific for bounty - everyone starts out green to everone else... for(%i = 0; %i < 32; %i++) setSensorGroupColor(%i, 0xfffffffe, "0 255 0 255"); } function BountyGame::pickTeamSpawn(%game, %team) { DefaultGame::pickTeamSpawn(%game, 0); } function BountyGame::claimSpawn(%game, %obj, %newTeam, %oldTeam) { %newSpawnGroup = nameToId("MissionCleanup/TeamDrops0"); %newSpawnGroup.add(%obj); } function BountyGame::clientJoinTeam( %game, %client, %team, %respawn ) { %game.assignClientTeam( %client ); // Spawn the player: %game.spawnPlayer( %client, %respawn ); } function BountyGame::assignClientTeam(%game, %client) { %client.team = 0; //initialize the team array for (%i = 1; %i < 32; %i++) %game.teamArray[%i] = false; %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team != 0) %game.teamArray[%cl.team] = true; } //now loop through the team array, looking for an empty team for (%i = 1; %i < 32; %i++) { if (! %game.teamArray[%i]) { %client.team = %i; break; } } // set player's skin pref here setTargetSkin(%client.target, %client.skin); %client.justEntered = true; // Let everybody know you are no longer an observer: messageAll( 'MsgClientJoinTeam', '\c1%1 has joined the fray.', %client.name, "", %client, 1 ); updateCanListenState( %client ); logEcho(%client.nameBase@" (cl "@%client@") entered game"); } function BountyGame::playerSpawned(%game, %player, %armor) { DefaultGame::playerSpawned(%game, %player, %armor); %client = %player.client; if (%client.justEntered) { %client.justEntered = ""; %game.updateHitLists(); } %client.isPlaying = true; // if client spawned and has no target (e.g. when first enters game), give him one // if client came from observer mode, should still have a target if (!%client.objectiveTarget && $MatchStarted) %game.nextObjective(%client); //make sure the colors for this client are correct %game.updateColorMask(%client); //show the waypoint for this player... %client.damagedTargetTime = 0; cancel(%client.waypointSchedule); %game.showTargetWaypoint(%client); //also, anyone who has this client as an objective target, update their waypoint as well... for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.objectiveTarget == %client) { %cl.damagedTargetTime = 0; cancel(%cl.waypointSchedule); %game.showTargetWaypoint(%cl); } } } function BountyGame::equip(%game, %player) { for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); //%player.setArmor("Light"); %player.setInventory(EnergyPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.setInventory(Beacon, 3); %player.setInventory(TargetingLaser, 1); %player.weaponCount = 3; %player.use("Blaster"); } function BountyGame::updateColorMask(%game, %client) { //set yourself to red, so your objectives will be red %redMask = 0; %blueMask = 0; %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); //first, see if the client is your target if (%cl == %client.objectiveTarget) %redMask |= (1 << %cl.team); //else see if the have you as a target, and have damaged you... else if (%cl.objectiveTarget == %client && %cl.damagedObjectiveTarget) %blueMask |= (1 << %cl.team); } //first everyone to green setSensorGroupColor(%client.team, 0xfffffffe, "0 255 0 255"); //now set the red mask (your target) setSensorGroupColor(%client.team, %redMask, "255 0 0 255"); //finally, set the blue mask (by setting alpha to 0 the damage/triangle will not appear, though // names still can).. if none were desired then making this group never visible would be // the better solution setSensorGroupColor(%client.team, %blueMask, "0 0 255 0"); } function BountyGame::showTargetWaypoint(%game, %client) { //AI's simply detect their target if (%client.isAIControlled()) { if (AIClientIsAlive(%client.objectiveTarget)) %client.clientDetected(%client.objectiveTarget); return; } //only show the target waypoint if the target hasn't been damaged within the frequency period if (getSimTime() - %client.damagedTargetTime < %game.waypointFrequency) { %client.waypointSchedule = %game.schedule(%game.waypointFrequency, "showTargetWaypoint", %client); return; } //flash a waypoint on the %client's current objective %clTarget = %client.objectiveTarget; if (!AIClientIsAlive(%clTarget) || !AIClientIsAlive(%client)) return; //set the vis mask %visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup()); %visMask |= (1 << %client.getSensorGroup()); setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask); //scope the client, then set the always vis mask... if (isObject(%clTarget.player)) { //always keep the target in scope... %clTarget.player.scopeToClient(%client); //now issue a command to kill the target %client.setTargetId(%clTarget.target); commandToClient(%client, 'TaskInfo', %client, -1, false, "Attack Target"); %client.sendTargetTo(%client, true); //send the "waypoint is here sound" - QIX, need a sound! messageClient(%client, 'MsgBountyWaypoint', '~wfx/misc/target_waypoint.wav'); } //schedule the time to hide the waypoint %client.waypointSchedule = %game.schedule(%game.waypointDuration, "hideTargetWaypoint", %client); } function BountyGame::hideTargetWaypoint(%game, %client) { //AI's simply detect their target if (%client.isAIControlled()) { if (AIClientIsAlive(%client.objectiveTarget)) %client.clientDetected(%client.objectiveTarget); return; } //flash a waypoint on the %client's current objective %clTarget = %client.objectiveTarget; if (!isObject(%clTarget)) return; //clear scope the client, then unset the always vis mask... %visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup()); %visMask &= ~(1 << %client.getSensorGroup()); setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask); //kill the actually task... removeClientTargetType(%client, "AssignedTask"); //schedule the next time the waypoint should flash %client.waypointSchedule = %game.schedule(%game.waypointFrequency, "showTargetWaypoint", %client); } function BountyGame::nextObjective(%game, %client) { %numValidTargets = %game.buildListValidTargets(%client); if (%numValidTargets > 0) { // if there are valid targets (other players that client hasn't killed) %client.objectiveTarget = %game.selectNewTarget(%client, %numValidTargets); %client.objectiveTargetName = detag((%client.objectiveTarget).name); %client.damagedObjectiveTarget = false; // this client has now been assigned a target %client.hasHadTarget = true; messageClient(%client, 'msgBountyTargetIs', '\c2Your target is %1.', %client.objectiveTarget.name); //for the client, set his mask to see his target as red, anyone who as him as a target and has damaged him is blue //and everyone else is green... %game.updateColorMask(%client); //set a temporary waypoint so you can find your new target if (%client.isAIControlled()) %game.aiBountyAssignTarget(%client, %client.objectiveTarget); //show the waypoint... %client.damagedTargetTime = 0; cancel(%client.waypointSchedule); %game.showTargetWaypoint(%client); logEcho(%client.nameBase@" (pl "@%client.player@"/cl "@%client@") assigned objective"); } else { if (%client.hasHadTarget) { // if there aren't any more valid targets and you've been assigned one, // that means you've killed everyone -- game over! %game.awardScoreCompletionBonus(%client); %game.gameOver(); cycleMissions(); } else { cancel(%client.awaitingTargetThread); %client.awaitingTargetThread = %game.schedule(500, "nextObjective", %client); //waiting for an opponent to join, keep checking 2x per second. } } } function BountyGame::buildListValidTargets(%game, %cl) { %availTargets = 0; %numClients = ClientGroup.getCount(); for (%cIndex = 0; %cIndex < %numClients; %cIndex++) { %opponent = ClientGroup.getObject(%cIndex); //make sure the target isn't yourself, or an observer if (%opponent != %cl && %opponent.team > 0 && !%opponent.isNotInGame) { //make sure candidate for list has not already been killed by client if (!%cl.eliminated[%opponent]) { %cl.validList[%availTargets] = %opponent; %availTargets++; } } } //returns length of list (number of players eligible as targets to this client) %game.hudUpdateObjRem(%cl, %availTargets); if ((%availTargets <= %game.WARN_AT_NUM_OBJREM) && (%cl.hasHadTarget)) %game.announceEminentWin(%cl, %availTargets); return %availTargets; } function BountyGame::selectNewTarget(%game, %cl, %numValidTargets) { // pick a player at random from eligible target list %targetIndex = mFloor(getRandom() * (%numValidTargets - 0.01)); //echo("picking index " @ %targetIndex @ " from ValidList"); return %cl.validList[%targetIndex]; } function BountyGame::updateHitLists(%game) { %numClients = ClientGroup.getCount(); for (%cIndex = 0; %cIndex < %numClients; %cIndex++) { %cl = ClientGroup.getObject(%cIndex); %game.buildListValidTargets(%cl); } } function BountyGame::timeLimitReached(%game) { %game.gameOver(); cycleMissions(); } function BountyGame::gameOver(%game) { //call the default DefaultGame::gameOver(%game); //send the message 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); cancel(%client.waypointSchedule); cancel(%client.forceRespawnThread); } } function BountyGame::clientMissionDropReady(%game, %client) { %game.resetScore(%client); messageClient(%client, 'MsgClientReady', "", %game.class); messageClient(%client, 'MsgBountyTargetIs', "", ""); messageClient(%client, 'MsgYourScoreIs', "", 0); //%objRem = %game.buildListValidTargets(%client); //messageClient(%client, 'MsgBountyObjRem', "", %objRem); //messageClient(%client, 'MsgYourRankIs', "", -1); messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); DefaultGame::clientMissionDropReady(%game, %client); } function BountyGame::AIHasJoined(%game, %client) { //let everyone know the player has joined the game //messageAllExcept(%client, -1, 'MsgClientJoinTeam', '%1 has joined the fray.', %client.name, "", %client, 1); } function BountyGame::forceRespawn(%game, %client) { //make sure the player hasn't already respawned if (isObject(%client.player)) return; commandToClient(%client, 'setHudMode', 'Standard'); Game.spawnPlayer( %client, true ); %client.camera.setFlyMode(); %client.setControlObject(%client.player); } function BountyGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc) { DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc); // you had your shot %clVictim.isPlaying = false; cancel(%clVictim.awaitingTargetThread); // any time a person dies, the kill streak is reset %clVictim.killStreak = 0; //force the player to respawn if (!%clVictim.isAIControlled()) %clVictim.forceRespawnThread = %game.schedule(5000, forceRespawn, %clVictim); } function BountyGame::onClientLeaveGame(%game, %clientId) { DefaultGame::onClientLeaveGame(%game, %clientId); %clientId.isNotInGame = true; %numClients = ClientGroup.getCount(); for (%index = 0; %index < %numClients; %index++) { %possPredator = ClientGroup.getObject(%index); // make sure this guy gets erased from everyone's eliminated list %possPredator.eliminated[%clientId] = ""; //no need for this - anyone who has him as a target will have their colors reset in game.nextObjective() //reset everyones triangles to friendly and visible so the next guy that joins, doesn't get the old settings //setTargetFriendlyMask(%possPredator.target, getTargetFriendlyMask(%possPredator.target) | (1< %game.MAX_CHEATDEATHS_ALLOWED); } function BountyGame::testSuicide(%game, %victimID, %killerID, %damageType) { return ((%victimID == %killerID) || (%damageType == $DamageType::Ground) || (%damageType == $DamageType::Suicide) || (%damageType == $DamageType::OutOfBounds)); } function BountyGame::testTargetKill(%game, %clVictim, %clKiller) { // was the person you just killed your target? return (%clKiller.objectiveTarget == %clVictim); } function BountyGame::testPredatorKill(%game, %clVictim, %clKiller) { // were you the target of the person you just killed? return (%clVictim.objectiveTarget == %clKiller); } function BountyGame::awardScoreSuicide(%game, %clVictim, %damageType) { //now loop through the client, and award the kill to any attacker who damaged the client within 20 secs... for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.objectiveTarget == %clVictim) { %game.awardScoreTargetKill(%clVictim, %cl, true); messageClient(%clVictim, 'msgBountyTarKil', '\c2You eliminated yourself. %1 has been awarded the bounty!', %cl.name); } } //update the "cheated" count if (%damageType == $DamageType::Suicide) { %clVictim.cheated++; DefaultGame::awardScoreSuicide(%game, %clVictim); } %game.recalcScore(%clVictim); %clVictim.killStreak = 0; } function BountyGame::awardScoreTargetKill(%game,%clVictim, %clKiller, %victimSuicided) { // congratulations, you killed your target %clKiller.objectiveTargetKills++; %clKiller.kills = %clKiller.objectiveTargetKills; %clKiller.eliminated[%clVictim] = true; if (%victimSuicided) { if (%clVictim.gender $= "Female") messageClient(%clKiller, 'msgBountyTarKil', '\c2Target %1 helped you out by eliminating herself!', %clVictim.name); else messageClient(%clKiller, 'msgBountyTarKil', '\c2Target %1 helped you out by eliminating himself!', %clVictim.name); } else messageClient(%clKiller, 'msgBountyTarKil', '\c2You eliminated target %1!', %clVictim.name); if (%game.SCORE_PER_TARGETKILL != 0) %game.recalcScore(%clKiller); %clKiller.killStreak++; %clVictim.killStreak = 0; if (%clKiller.killStreak >= %game.SIZE_STREAK_TO_AWARD) //award points for a kill streak %game.awardScoreKillStreak(%clKiller); //the victim is no longer the objective of the killer, reset his colors. //The colors for the killer will be reset in game.nextObjective() %clKiller.objectiveTarget = ""; %game.updateColorMask(%clVictim); %game.nextObjective(%clKiller); //since the killer scored, update everyone who's got him as a target... for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.objectiveTarget == %clKiller) { %cl.damagedTargetTime = 0; cancel(%cl.waypointSchedule); %game.showTargetWaypoint(%cl); } } } function BountyGame::awardScoreBystanderKill(%game, %clVictim, %clKiller) { // uh oh, you killed someone other than your target or the person targeting you %clKiller.bystanderKills++; //%clVictim.killStreak = 0; //don't penalize the bystander right now, maybe change this later // if you'd already killed him legally, he's back on your prospective target list if (mAbs(%game.SCORE_PER_BYSTANDERKILL) > 1) %plural = (%game.SCORE_PER_BYSTANDERKILL > 1 ? "s" : ""); if (%game.SCORE_PER_BYSTANDERKILL != 0) { messageClient(%clKiller, 'msgBountyBysKil', '\c0You have been penalized %1 point%2 for killing bystander %3.', mAbs(%game.SCORE_PER_BYSTANDERKILL), %plural, %clVictim.name); messageClient(%clVictim, 'msgBountyBystander', '\c2You were the victim of %1\'s lousy aim! He was penalized.', %clKiller.name); %game.recalcScore(%clKiller); } //add a target back to your list (any target) %targetCount = 0; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%clKiller.eliminated[%cl]) { %addTargetsArray[%targetCount] = %cl; %targetCount++; } } //see if we found any targets we can add back on... if (%targetCount > 0) { %clKiller.eliminated[%addTargetsArray[mFloor(getRandom() * (%targetCount - 0.01))]] = false; messageClient(%clKiller, 'msgBountyBysRedo', '\c2One target has been added back onto your Bounty list.'); } %clKiller.killStreak = 0; } function BountyGame::awardScorePredatorKill(%game, %clVictim, %clKiller) { %clVictim.killStreak = 0; messageClient(%clKiller, 'msgBountyPredKill', '\c0You have temporarily fended off %1.', %clVictim.name); //now, try to assign a new objective target for clVictim... %game.nextObjective(%clVictim); //also update the color mask for the killer... %game.updateColorMask(%clKiller); } function BountyGame::awardScoreKillStreak(%game, %cl) { %bonus = (%cl.killStreak - %game.SIZE_STREAK_TO_AWARD) + 1; %cl.streakPoints += %bonus; messageClient(%cl,'msgBountyPlrStrkBonus', '\c0You received a %1 point bonus for a %2 kill streak!', %bonus, %cl.killStreak); messageAll('msgBountyStreakBonus', '\c0%1 has eliminated %2 targets in a row!', %cl.name, %cl.killStreak, %bonus); //send bonus for sound parsing //callback exists in client.cs for 'msgBountyStreakBonus', to play repeating bell sound length dependent on streak } function BountyGame::awardScoreCompletionBonus(%game, %cl) { // you killed everybody who was on your list %cl.compBonus = 1; if (%game.SCORE_PER_COMPLETION_BONUS != 0) messageAll('msgBountyCompBonus', '\c2%1 receives a %2 point bonus for completing all objectives.', %cl.name, %game.SCORE_PER_COMPLETION_BONUS); %game.recalcScore(%cl); } function BountyGame::announceEminentWin(%game, %cl, %objRem) { %wav = "~wfx/misc/bounty_objRem" @ %objRem @ ".wav"; %plural = (%objRem > 1 ? "s" : ""); if (%objRem > 0) messageAll('msgBountyEminent', '\c2%1 has only %2 target%3 left!%4', %cl.name, %objRem, %plural, %wav); else messageAll('msgBountyOver', '\c2%1 has eliminated all targets!~wfx/misc/bounty_completed.wav', %cl.name); } function BountyGame::announceCheater(%game, %client) { if (%client.cheated > 1) %plural = "s"; else %plural = ""; messageAll('msgCheater', '%1 has suicided \c2%2 \c0time%3!', %client.name, %client.cheated, %plural); } function BountyGame::recalcScore(%game, %cl) { %cl.score = %cl.objectiveTargetKills * %game.SCORE_PER_TARGETKILL; %cl.score += %cl.bystanderKills * %game.SCORE_PER_BYSTANDERKILL; %cl.score += %cl.suicides * %game.SCORE_PER_SUICIDE; %cl.score += %cl.compBonus * %game.SCORE_PER_COMPLETION_BONUS; %cl.score += %cl.streakPoints; //this awarded in awardScoreKillStreak messageClient(%cl, 'MsgYourScoreIs', "", %cl.score); %game.recalcTeamRanks(%cl); } function BountyGame::resetScore(%game, %cl) { %cl.score = 0; %cl.kills = 0; %cl.objectiveTargetKills = 0; %cl.bystanderKills = 0; %cl.suicides = 0; %cl.compBonus = 0; %cl.streakPoints = 0; cancel(%cl.awaitingTargetThread); %cl.killstreak = ""; %cl.cheated = ""; %cl.hasHadTarget = false; //reset %cl's hit list //note that although this only clears clients (enemies) currently in the game, //clients (enemies) who left early should have been cleared at that time. %numClients = ClientGroup.getCount(); for (%count = 0; %count < %numClients; %count++) { %enemy = ClientGroup.getObject(%count); %cl.eliminated[%enemy] = ""; } } function BountyGame::hudUpdateObjRem(%game, %client, %availTargets) { // how many people do you have left to kill? messageClient(%client, 'msgBountyObjRem', "", %availTargets); } function BountyGame::enterMissionArea(%game, %playerData, %player) { %player.client.outOfBounds = false; messageClient(%player.client, 'EnterMissionArea', '\c1You are back in the mission area.'); cancel(%player.alertThread); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") entered mission area"); } function BountyGame::leaveMissionArea(%game, %playerData, %player) { if(%player.getState() $= "Dead") return; %player.client.outOfBounds = true; messageClient(%player.client, 'LeaveMissionArea', '\c1You have left the mission area. Return or take damage.~wfx/misc/warning_beep.wav'); %player.alertThread = %game.schedule(1000, "AlertPlayer", 3, %player); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") left mission area"); } function BountyGame::AlertPlayer(%game, %count, %player) { if(%count > 1) %player.alertThread = %game.schedule(1000, "AlertPlayer", %count - 1, %player); else %player.alertThread = %game.schedule(1000, "MissionAreaDamage", %player); } function BountyGame::MissionAreaDamage(%game, %player) { if(%player.getState() !$= "Dead") { %player.setDamageFlash(0.1); %prevHurt = %player.getDamageLevel(); %player.setDamageLevel(%prevHurt + 0.05); // a little redundancy to see if the lastest damage killed the player if(%player.getState() $= "Dead") %game.onClientKilled(%player.client, 0, $DamageType::OutOfBounds); else %player.alertThread = %game.schedule(1000, "MissionAreaDamage", %player); } else { %game.onClientKilled(%player.client, 0, $DamageType::OutOfBounds); } } function BountyGame::updateScoreHud(%game, %client, %tag) { // clear the header: messageClient( %client, 'SetScoreHudHeader', "", "" ); // send the subheader: messageClient( %client, 'SetScoreHudSubheader', "", '\tPLAYER\tSCORE\tTARGETS LEFT' ); for ( %index = 0; %index < $TeamRank[0, count]; %index++ ) { //get the client info %cl = $TeamRank[0, %index]; %clScore = %cl.score $= "" ? 0 : %cl.score; //find out how many targets this client has left %clTargets = 0; for (%cIndex = 0; %cIndex < ClientGroup.getCount(); %cIndex++) { %opponent = ClientGroup.getObject(%cIndex); if (!%opponent.isNotInGame && %opponent.team > 0 && %opponent != %cl && !%cl.eliminated[%opponent]) %clTargets++; } //find out if we've killed this target %clKilled = ""; if ( %client.eliminated[%cl] ) %clKilled = "ELIMINATED"; %clStyle = %cl == %client ? "" : ""; //if the client is not an observer, send the message if (%client.team != 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, '%5\t%1%2%3\t%4', %cl.name, %clScore, %clTargets, %clKilled, %clStyle ); } //else for observers, create an anchor around the player name so they can be observed else { messageClient( %client, 'SetLineHud', "", %tag, %index, '%5\t%1%2%3\t%4', %cl.name, %clScore, %clTargets, %clKilled, %clStyle, %cl ); } } // Tack on the list of observers: %observerCount = 0; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team == 0) %observerCount++; } if (%observerCount > 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, ""); %index++; messageClient(%client, 'SetLineHud', "", %tag, %index, '\tOBSERVERS (%1)TIME', %observerCount); %index++; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); //if this is an observer if (%cl.team == 0) { %obsTime = getSimTime() - %cl.observerStartTime; %obsTimeStr = %game.formatTime(%obsTime, false); messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%1%2', %cl.name, %obsTimeStr ); %index++; } } } //clear the rest of Hud so we don't get old lines hanging around... messageClient(%client, 'ClearHud', "", %tag, %index); } function BountyGame::applyConcussion(%game, %player) { } PK !(5-##scripts/CTFGame.cs// 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 = 5; %game.SCORE_PER_DESTROY_BOMBER = 8; %game.SCORE_PER_DESTROY_TRANSPORT = 5; %game.SCORE_PER_DESTROY_WILDCAT = 5; %game.SCORE_PER_DESTROY_TANK = 8; %game.SCORE_PER_DESTROY_MPB = 12; %game.SCORE_PER_PASSENGER = 2; %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); %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) { //vehicle name %data = %vehicle.getDataBlock(); //%vehicleType = getTaggedString(%data.targetNameTag) SPC getTaggedString(%data.targetTypeTag); %vehicleType = getTaggedString(%data.targetTypeTag); if(%vehicleType !$= "MPB") %vehicleType = strlwr(%vehicleType); %enemyTeam = ( %destroyer.team == 1 ) ? 2 : 1; %scorer = 0; %multiplier = 1; %passengers = 0; for(%i = 0; %i < %data.numMountPoints; %i++) if(%vehicle.getMountNodeObject(%i)) %passengers++; //what destroyed this vehicle if(%destroyer.client) { //it was a player, or his mine, satchel, whatever... %destroyer = %destroyer.client; %scorer = %destroyer; // determine if the object used was a mine if(%vehicle.lastDamageType == $DamageType::Mine) %multiplier = 2; } else if(%destroyer.getClassName() $= "Turret") { if(%destroyer.getControllingClient()) { //manned turret %destroyer = %destroyer.getControllingClient(); %scorer = %destroyer; } else { %destroyerName = "A turret"; %multiplier = 0; } } else if(%destroyer.getDataBlock().catagory $= "Vehicles") { // Vehicle vs vehicle kill! if(%name $= "BomberFlyer" || %name $= "AssaultVehicle") %gunnerNode = 1; else %gunnerNode = 0; if(%destroyer.getMountNodeObject(%gunnerNode)) { %destroyer = %destroyer.getMountNodeObject(%gunnerNode).client; %scorer = %destroyer; } %multiplier = 3; } else // Is there anything else we care about? return; if(%destroyerName $= "") %destroyerName = %destroyer.name; if(%vehicle.team == %destroyer.team) // team kill { %pref = (%vehicleType $= "Assault Tank") ? "an" : "a"; messageAll( 'msgVehicleTeamDestroy', '\c0%1 TEAMKILLED %3 %2!', %destroyerName, %vehicleType, %pref); } else // legit kill { messageTeamExcept(%destroyer, 'msgVehicleDestroy', '\c0%1 destroyed an enemy %2.', %destroyerName, %vehicleType); messageTeam(%enemyTeam, 'msgVehicleDestroy', '\c0%1 destroyed your team\'s %2.', %destroyerName, %vehicleType); //messageClient(%destroyer, 'msgVehicleDestroy', '\c0You destroyed an enemy %1.', %vehicleType); if(%scorer) { %value = %game.awardScoreVehicleDestroyed(%scorer, %vehicleType, %multiplier, %passengers); %game.shareScore(%value); } } } function CTFGame::awardScoreVehicleDestroyed(%game, %client, %vehicleType, %mult, %passengers) { if(isDemo()) return 0; if(%vehicleType $= "Grav Cycle") %base = %game.SCORE_PER_DESTROY_WILDCAT; else if(%vehicleType $= "Assault Tank") %base = %game.SCORE_PER_DESTROY_TANK; else if(%vehicleType $= "MPB") %base = %game.SCORE_PER_DESTROY_MPB; else if(%vehicleType $= "Turbograv") %base = %game.SCORE_PER_DESTROY_SHRIKE; else if(%vehicleType $= "Bomber") %base = %game.SCORE_PER_DESTROY_BOMBER; else if(%vehicleType $= "Heavy Transport") %base = %game.SCORE_PER_DESTROY_TRANSPORT; %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); } PK !(I\scripts/CenterPrint.cs// CenterPrint Methods //------------------------------------------------------------------------------------------------------- $centerPrintActive = 0; $bottomPrintActive = 0; $CenterPrintSizes[1] = 20; $CenterPrintSizes[2] = 36; $CenterPrintSizes[3] = 56; function centerPrintAll( %message, %time, %lines ) { if( %lines $= "" || ((%lines > 3) || (%lines < 1)) ) %lines = 1; %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if( !%cl.isAIControlled() ) commandToClient( %cl, 'centerPrint', %message, %time, %lines ); } } function bottomPrintAll( %message, %time, %lines ) { if( %lines $= "" || ((%lines > 3) || (%lines < 1)) ) %lines = 1; %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if( !%cl.isAIControlled() ) commandToClient( %cl, 'bottomPrint', %message, %time, %lines ); } } //------------------------------------------------------------------------------------------------------- function centerPrint( %client, %message, %time, %lines ) { if( %lines $= "" || ((%lines > 3) || (%lines < 1)) ) %lines = 1; commandToClient( %client, 'CenterPrint', %message, %time, %lines ); } function bottomPrint( %client, %message, %time, %lines ) { if( %lines $= "" || ((%lines > 3) || (%lines < 1)) ) %lines = 1; commandToClient( %client, 'BottomPrint', %message, %time, %lines ); } //------------------------------------------------------------------------------------------------------- function clearCenterPrint( %client ) { commandToClient( %client, 'ClearCenterPrint'); } function clearBottomPrint( %client ) { commandToClient( %client, 'ClearBottomPrint'); } //------------------------------------------------------------------------------------------------------- function clearCenterPrintAll() { %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if( !%cl.isAIControlled() ) commandToClient( %cl, 'ClearCenterPrint'); } } function clearBottomPrintAll() { %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if( !%cl.isAIControlled() ) commandToClient( %cl, 'ClearBottomPrint'); } } //------------------------------------------------------------------------------------------------------- function clientCmdCenterPrint( %message, %time, %lines ) // time is specified in seconds { // if centerprint already visible, reset text and time. if($centerPrintActive) { CenterPrintText.setText( "" @ %message ); if( centerPrintDlg.removePrint !$= "") { cancel(centerPrintDlg.removePrint); } if(%time > 0) centerPrintDlg.removePrint = schedule( ( %time * 1000 ), 0, "clientCmdClearCenterPrint" ); // were done. return; } CenterPrintDlg.visible = 1; $centerPrintActive = 1; CenterPrintText.setText( "" @ %message ); CenterPrintDlg.extent = firstWord(CenterPrintDlg.extent) @ " " @ $CenterPrintSizes[%lines]; if(%time > 0) centerPrintDlg.removePrint = schedule( ( %time * 1000 ), 0, "clientCmdClearCenterPrint" ); } function clientCmdBottomPrint( %message, %time, %lines ) // time is specified in seconds { // if bottomprint already visible, reset text and time. if($bottomPrintActive) { if( bottomPrintDlg.removePrint !$= "") { cancel(bottomPrintDlg.removePrint); } bottomPrintText.setText( "" @ %message ); bottomPrintDlg.extent = firstWord(bottomPrintDlg.extent) @ " " @ $CenterPrintSizes[%lines]; if(%time > 0) bottomPrintDlg.removePrint = schedule( ( %time * 1000 ), 0, "clientCmdClearbottomPrint" ); // were done. return; } bottomPrintDlg.setVisible(true); $bottomPrintActive = 1; bottomPrintText.setText( "" @ %message ); bottomPrintDlg.extent = firstWord(bottomPrintDlg.extent) @ " " @ $CenterPrintSizes[%lines]; if(%time > 0) { bottomPrintDlg.removePrint = schedule( ( %time * 1000 ), 0, "clientCmdClearbottomPrint" ); } } function BottomPrintText::onResize(%this, %width, %height) { %this.position = "0 0"; } function CenterPrintText::onResize(%this, %width, %height) { %this.position = "0 0"; } //------------------------------------------------------------------------------------------------------- function clientCmdClearCenterPrint() { $centerPrintActive = 0; CenterPrintDlg.visible = 0; CenterPrintDlg.removePrint = ""; } function clientCmdClearBottomPrint() { $bottomPrintActive = 0; BottomPrintDlg.visible = 0; BottomPrintDlg.removePrint = ""; } PK+74.2:Viscripts/ChatGui.cs\{wǒ9'ߡ6"d G_uh- MkaY!|Uu$sCqb]=lm?~Eboꦯ%^oߞG/CT8!_e΂KN^:?xн0Q&2 IJ揚TDSQ2`z Ězgb{o// nUHooJ2Lgp1ܺ TiNޯ>)vv)EGcgG2NT$Bw8̏7cxSzppC1Q.?~dD B <u/Nyp~>R`y|?^͚+xyS1}ea?*V}XYv48¯{7_;cBYLwnB'Y D,ЍΡw $io.b}@)Ѝgo LLTMDDʹp1Gj&fKvGebD΋p{.t$Gwxz7 f=Sq@$5J~|rÇ]uLUSRo 9^&~@i!O;Mp 7iEj,mD'܊G$7 BmG YpC9tgiN0^ fCDLƁ'3Bj9%8>#QC[゠QX4 6\hc9cNͩ)-ÄEb9@Z N%%^\%c) GH<*ECϷ S.K eM̋) 9)1|,mVԹIJb reʦMK5w:թEF[I%^Z%S㰍oV*ڰ˦D햃c+)tyϻAP}@wb}bv7Pf{8ň]$N_I,ľ*!;SFjWYc>u 3xV3RUuC.'l\)$R  *>p|bRزKPLBdy4*Խ@)[DmԮ .ش"P37jkkc#O)贜{~)@]M8(=lV1ܲIh5"1Fl ln49뱗"'^(kaɤҍوAJ*iv樞h% EAscaY)I4_F:Ee@(X8!j 33_?#;<>BGy.]FK8$ .B|4o &TDr稁g.lBLk~dg|",iA)JJ 2z6 p4y b܁7erQEN8V.iu 1;$GKyxdrVl# %J&~@Ɛ -zT@+m[y}XW1#) zljW7)a2TL'cn0VyǴjFG;_ mFjazfiTkC1آK(B95i˦0DqK )9#CMwhih3g(4'lӿB'@jdZ`6e,mGj!,׽ڂXV3fOcF%',$UW ,RPll5iFr6h+C,O$$x{?8;T@Q"E3"V65%F6d,TZ/K+' ׺s񄕇NTocUE'dH2R3}4'\DbIK؝t9C@ tc,ۢi+PNysI!޵S|f:'8*R` _fYQԬk*t&Ɍ}u*,s3ɤs%?~>:f&S9+29EVj06;mВ g~U.RmeВE$0Ȍikw$&A\Mr"'JaQꭗ׺m9C*Ҫyr adN3N >SiE892a*yܡ<"ʃr{[[C$nZ_"|8HZ b<"K^ؠG=Dc^:A8 lNeSݵ 4Qu܄Mas)2rjo ey-bћ=k\?cI-s\@9LY8?q`:3"VPCRc|0Iq)l;e uI$`\71DkSeA=K1f*glnbϠ&udE\ ;/BajĀ*EcSr+6_]q Ol3>-u%=^I%y2!욱G{.cݑȄ-Mv<љ$n2tbhZJjbAbHe+¨fVx tnIx Ju8@2O ^i͂Rp, Π_fG)HuLIcpLsg2 E54Vxq2P0R"3 zy!j%1j_ŰhYh5cnH Ԝyfٮ-Ԩ#@<=jpG6s,p3TA<{zxeٓ3B]㮺;;Ϟ`VgQ!omҏsDcXntuj+l?<0zК3B 9NVjͭ2uIʧ#b3&(>tV@lZM'&ZVr{.g:/cs` jܻ3!^> 5T)J'd[>h۟M2Y"uS/3\NңWE΅F4jiz#K5]P3EW*QouꁭLA}HJbʹGp~Ѩz!>\'tԥ {R:{2w۾$x4^>oom]"ut*Ln%`"NZ"r_&o}St2: 2P*^xOd _kNr )/LG0kn͕]B Mۺ&34s-g ޘYN5R{Hu-{skֱkXcm\]+֛_2P/@QVR;n7C>CJ,{HoVC:\IAM6,iΝn)MTn" leV*"b2䴪x(3HˈWj-G87Ӽ $tʱgSI׮U8^I8gԧ<kyAt2kc.UB|OS2swwanB׀a=Ms6s7ܴ&?+ZSWǁjKZ@Z{7T}KznmPF>3Tz;͕p2^:'ł5gT\\>M[7.dKFQV!!$eLvE^5Ӓ#rlԡF}u57/UVI0<]èkJ畆=׻-JؘoIgjVOVW`77)mͷA`=ҚC%ZԽX֖O9UllB([dR[&Zk/0iVMDZIV)$cr.$B^#8Y [_*Z'`me|~wN+ fn6 yWCXAS/6kk1vW#FНC5慓X0P6`}Ӽuzͫ>6>sng{qqd$c˱=5B'o9ҡ.suDP`ytVcFG"`oۛ~;{ۅ۴Lq0]PL)/^fRZD'=$tuv=u5ں|3f7FtkD)Vn| #Y(V8c rpyA`j$cNoWW_o3#"yžW.R zenl i}j( Fk{̪@3Дja.=b&i!^)SIJ/tK)KqqAdFl-!W!'֣4*QA%h}31i+,lў;諫,Ne,9zd}R|#G9{1.X)dUCr'2Ѐ@0gC9}Jtׯ*]){߼؆FK;OQqqs#w WP;Pu {]&MMlnlZ\΄M]S8ؤ \=95GSiN*Zr5R޸xW[寛l+N,˦ SKҲ*=}2䟼 zN[dciKNJbLztɍ;Xk+P%]Kdu@8n Z\`:»Ug+ |Cw<.|0BkFfgMx$Z&g\4 Oxf$"VxCE=DPRfs&ӞrMC9Gwb[Zk\[# .K/ N[mnBN #˝7`τF8! ?4`hkku~m$ٯ ǕP?1Q5P#TNMR8%@0w")]Y+@ٺRP`3,n_A&ۂyz bw}+FFvi:/Oxze?@lUI^8E(=%!Ffvj1Qv^6A{$5ENu3KR]$5!QqLiOV0(4 ?d;n6&2`Wh/قAM(tkG`|$*>`'f[ 1xr׎xVO"'k DwE>Y#382y)hiLr\cSyãZo+qa*mς>>g˺Dqá`y -7"Tbx,nӾYLh΃}NheU.W> }i') 4/vQw,rZĠ<rHɅBYC Ψ؜EMFp'VGۀ' }K]0`(wķgُ8ZS?AQ5m7h&H6SGyKr 4@j|AyzC?Bd>u=^@_eg})_sNwĂpF/z)hVLg[w 䊼d/0pLdmA1Z Ԥ:boelʽ53(GL\WR",gz|QNvq*Kiz=n5DS,VkEq]Aץu?kt + zY\UkQc"YR7_`uZ.L{_Wy#-s,x/ޘe~"Y&]@ցg%٩ ~9_(IFX[H|#n" hIŇ,r 66p%;r|o t#SGf%#Hi 4m8VhO(hhdXNcj pb5!jDebj˞ݘT74g4' @ O_V_(z>ڈ7joLQ!MMJEi9|ӦCɌ^$=*/&G'JO=hyCJ*C&-^,~qpJYO< )_ 'pd}.JZ! Rۇ6T||4J{|U=c_ cUd5WˋmNvw{?CA;?1GH:VTj)0<ɋC'۽|)Ӿ"> &p!||`w\65}hG(NG:>vtHOu\v|F^71iRcf*x1k8)ŲšC\5]I$L }UߧGU ^IGF/Y-" g"7:'$&C Q Vt\euz!CccY "=b89:GFt@lQ=H?BI6Hm=*XХxz!k%y$3nE6T:GCŅ k`nHU;ͤ3%h );Bjg{p Ͱ BMl/yQgNљ%YEt<DZmOUdGYR#+dwߧDm] -U-+d`gsVTrB`V{aw,|{oY+9$E!v\`0N̤&c,0v{7Mh7727 7A6&QY%W iꀾ,r^L۪ !xi͆bԲopUI'a6Q,/^K~rr5Q6lFh `TЋ(BbhEZ//WjicXI +Os8g@}TZ=WD#K.kA,)C"u?";ݠKb j0CH.@Q/%Dd$QAJXMgF+i2Amĕa!rJ\HC` -uMUѷODj)V[lcEgUQ&^̯ʼnC^:GO_{B=#v0StN/?~ vDɺJRW!R~hEBJ8WTo]9hnΙD%sxOsM;/Q/6bp2nEo J$ru*bǃ-ɿ`$Sf%zXf=ԅB=KTbmr#arJqi,8=Z=ѴEGNݼ:'}9,*1׮/CT)']v"_ohl)=ݽjnöX.`Q:RdžKl|܈ SiT4|#şۋ%zb[[?z6=m&Q:[7E4 DLnNLe 6öcuů*V{"PY]6{1xrsu%]9 kfYy|8ë WƬ}~@20s~I`)w\Ϭ!Z'r2.Ns&ZހȮU/Φ B? 9бUsx )n/saմ%+d! lWej8 >U*ʀBM lNq);123tg!(VT RuE68wI `EGYMz>k7kprqCk866&[_))}eO.i/9x <)&g(لߒħPYV&*0lA K[30M {wHսQz>w+ ktrJD-UTpזZPml,Eu5EV7bH/=8iSeR gl*yP0 Ze-b>ygq ǭPAs Ѿm}+FիҺRmGxE0Qi1qvNeLT瘣R5Q'GUGhHw k3,3?ȃO7H}մDuM>;5-ƽv'4Շ |'T2T&^L~: ޠ\tO̖5ݘX…s%c†x5~T RkZ|qMp`VZZ<y("r@T~$kč5SZt5/slPJ>jsl+Ȓ~#`Mq1 Wg l4*>~g|es5]$2 "ySe' 7U+.\gI 97:DNq0sgK?$@m%>ޔ{lN @nRَKR(]),taL +Չf|EfVo1G<l*DX.,({ ܳX$A L $%! <9ёOL|ჳk`L80 فe7QU!il nrGi1`W'8$vWLmoˏ=hv$-r v njGȎO^.'){=|/9:ݤ;ZQt0[aEqHFj$UmARGVivu J hOv; ~Yqƹ3>EJO9S{\NIs9zQ` ջ>n~ BC6Av1OX6O92M3E 9"{* ֮qdk8r#E:-6zIdUr]WUVS2'uOgj1gZ^r2K69E$QO,/jۮRBc:'r8UUJ[kbI4]fk|^ܸv,s]N{o{Mt"knnRtz e^~QUv<=]q WXa^`N%$Xz6.:n]XO_n_{ y#`${1W{ ~ƾln|0H=('OqT{FW}n/>?s )O;"k> ϝNTqIBALi D%W^~!Fm@H'y_`Bi`D-] $ !Z&^&t"0 ƈ%ykf;m,2 pUj[][6n@ "JfʇZO~JEW&cl */^wX}w0e-¼;w‹PJy`œ{qUG`Ql3 MP/j;I덳^:N111O@#<.]N@3g= UQݡbzAaݪQ at~6 = (NId%x];Jww/Lg5;UsgE:+xV{PeV M@gW~5~Vk/'"m"/~ QA+oQZ+B.Ho)YUUl]l4SlŒWBTqR#ytXZH ۶YE<%KGkm"6XioIppgB4DS)T_'n140]1)AqLUAt؃L8%Fj﯁Z`Xtش,wU&FNN ެ~#ƞe9TԈ,4 臟C!ІԿ)@WQ vp3,|}f{(=S Lء63,w)]57Y;RKf|DHHw+dmQ;. ^ ̛_oB M\ٝ@f2/EY"*|^N%o^49i-^H@&5ڤDCKL {=}#+` 4NYP ;qOi!O`j KLhuuCr`6#jKayOE]_v(MG+3ծIUit 4;-h*HShTg);SW3?C]Qxm XT6ٓ>9 Y$ aJ)BXjUPgi`|d2NQNH#R0$~Ppű˞2OxEC:|9HsNYD+ Tq /M6,^ʤ}-g-LNN` {$I;T]n+:ʓ՞J:3]pGF85'îo.tOohuq2PQz3Os( W"sPsռ@ǢdhA' ^鸿)1 I4qVyhQVL4[z4eo;|2$I7pEoxzUַWgTbrޯzPgt;z%k;HAag&0\s!0D5 gEk+'QȮD ژ&p(o⸴8 }ZFUFpp;bh'a1T0_x1E%+kdnl4ɸDaXvj琋龞 .(].11ĝ9uFA$(V]-"L2dӑo!)MB^ѭVyf_X|xRq י\|sfn>͊7+o;+otNVqlc_gldpO *$rKrs(Ȳ[j}xBe:.8LKfM qձe~lN"o9'cpn.Tof٩,5}cCUhPnCJ< WRq^(*,A8XBNV '+0hk9gݣ/䌏4_b}d{7f n'ȣ{螦kO ɳ4eSp6Ki-_.LՇkw@"vzkdoR*Z>}-,EpaP]%?ѕuJ~D+{&3$9s8LY' !EGA{!@B{*AK4ly^XIJK+'TmyhiJWsA{u˅6@./<:照PӶs~rO S1Xpa26%Ûȥ;OzWYhJ=?P0#­E2]ypw+/)*n2-V0Pgzb?gcsJBcͦɤfCk6T{~caQQBS+mw` ضXOǸ9@JB.) b#Z8sap|Κɤ$[bme\<8QP tཇHw1E~rjI.?K')y+ڸ 4!T8{_ Ԯ%n#Sy׭]I{jy19zfHre+Ʌ]vS"yjIdG NRE%htʹG6¢"%Ta콒#2PYe/U@e@qj T6aᨪ:0U.hVW v$j%8Gy/v-(MB'-yRܛIa-h\O3M<-ϽHY㸿\8?X^_}rʹ.1-g_JgP@fEz6sMB&p݈hPZEXY;R^l&)%]?Fx3P@>:\jρ`S߂^P?lX)[N3C?fQnZh!;<9GڢZd0?Q2&+KpU.(#'О0cŪ֔%&/p-,8+2̚Q=O^GZltBCSȶ5T*i1M2ehn+ '?Kj. kX* -)0͟׿fw}\&\(F;؄ }Wup-`9{*lX7:*t&ܿ7&W6-k;Vc< ?fxiQ.:s*ϙfWsGƃsX4;cWVb&^H.`Kl"#͆OfCfkkmɃfVOQU= 1_??ey>ƹy/;ފVe3TX8p/|1T`|PVlpVsz(ղ֧RDjuS:HdryM-_|MQ`Ub(u\֕7N=BA.-~ȳ[=79MNf"BM8JH9r +Аզ1ވQa)q!/wOvWn=,?_J|e?vly& va` ArtڮD!L ڻ;ovc;0ȵ= p8] jqu]0 Hu'yeu{75/blket ץHA"N"g@uHj^ ?PQZ^/>@YfhgtkO]Dw}7--JEzz1ӡo2&3|gu]<8#^{vO΍ gǏ]U㇏<;!W'ӑ,C)8ƹt1JwJd@8:N\D~g(hBG8ݍH&L0Vr2!h{2"] 9<fot"J6Tsͬ#anl/Q#*{W䷠[.zqB$~_,D0"~gqMyx鰀 ª Y7=`K)Y^pwy]3%6''5n- +h^c+=vIX6Dky,|_d !,q3=cj1ѣb{ofRd gSE>,Z:,^: <|d%z_cA! QֲpmT\ Wcld)ǭKq?6F۲1m}+@f P2gqZ9Ā&X.8ٓxw9ʻ)A!4$eű*$>qBqbᤸHɖOp"7rQ7̍J7սDe5|E*Z:YaHe(LMYΉqANdJP Y nW CIRuc@w{?S ^B.|T$\~Q&B= 0ˏʬd16QTcAel>E7K/~5AlxIy5WW}f!_ @Is~!_IUJfOa=_ ]vfBdYx=Z*DIOUw㨒$d܏'F-t W5Nb,['D.V5pZp?:4<8LHGNu*Wi2Gʯ cOVvp ы!*.IjI9uDe܂ϡy*xPmSV]\^\GuvGwrɔ*ISԼ0tDS1d^c)d^e9`2gMǬ/6aޏ7Iu_]1Sl;͌@+o {@SOnr`Bb}߳pٺnaCby^k֕u=)dpD9.|NAg]A}vDb"$bn mePU9iӬKe7TxDS:~ hߛ/bq6d LeƁN >L>Fd|)%[`$4>L]@%e$"",aA%#PSR  0k<1T yVkDHs3r'ʸl"rZjtVA'mJ C0>o,P;cQLn ex$FfUX%b+ZH@ɮTѤXYSg"IXث0o ۜHJ44yA9 7ÞeOLv-=vEtxsr؈z6 ?oPt4ap |Xq)!Yko/D[YXsS!1 ?u;vL}Kev&Sscȡ)MCO]LRr'"+A2[~}[KoZ#]BXFcXNm#ܖN0mتjE2Vo`/M |SZܻY^2H\Y>CQG<U+P"c|Yc n.z[%̖}w`NpK 0 u(Zi#,ULxH'5d8 C[%1x'o7нߪLk m82ns.?_ڥycsD CyzĖמH,"Fs0B,ɗ3ƅ}k Hv6tb[g)BNi"dF=Y!cOl "PO&PfMEgE܌VDiq^\{ 0F[o4~;5rto){ s(]Jd)SASj$'q8;\/.xc=l M%>Lw<}\TI,ThuAKSѮuD1+UB%JJc(իw#6_{L/-.^i<< Kޠ=]w lPeln8^jx8Nnew)^4( KeϧЇ{t>QXv9`po p[ɉJǏ1)l -x=ɶ4џKh=!]ۼneg(rn4y kP;9JEBȉq_urA4;vB3l\ l0w!|WEXݠCS7ٚ@ ]Rp•5[h9a_!)%)5`3|3Cakăt;?oω*0pE'9^.OP|QNV)8E]ccxU+ 8;R/jիz˹tUva6<.fKE^7|6BobD,ƼO$#=kՂL@D,78Ig]NQcƢqWƻTs+DFSi6Oo 0*Wh/k5}Xou1p,yтW֌\ @ W[J5|5W,$ݹRdG/m0X\Q:|Y/8,ìFmݫО濅&v:m[jٜ%)Q(! *0gKb gRWMym8=DW͆~cýZ™.I?[Y3Bǝ~OZvsnge4eFK,9*N&Cd?Uh5H[ Wp;%ZvSK.&Phv>49 7Bݳa6 c.wA*Mz}NK Lއ+z81GQr\PK !(ξ0[5[5scripts/ChooseFilterDlg.cs//------------------------------------------------------------------------------ // // ChooseFilterDlg.cs // //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function ChooseFilterDlg::onWake( %this ) { CF_FilterList.clear(); CF_FilterList.addRow( 0, "All servers" ); CF_FilterList.addRow( 1, "Servers with buddies" ); CF_FilterList.addRow( 2, "Favorites only" ); for ( %i = 0; $pref::ServerBrowser::Filter[%i] !$= ""; %i++ ) CF_FilterList.addRow( %i + 3, $pref::ServerBrowser::Filter[%i] ); if ( $pref::ServerBrowser::activeFilter >= %i + 3 ) $pref::ServerBrowser::activeFilter = 0; CF_FilterList.setSelectedById( $pref::ServerBrowser::activeFilter ); CF_GoBtn.makeFirstResponder( 1 ); } //------------------------------------------------------------------------------ function ChooseFilterDlg::onSleep( %this ) { // export out all the filters... %count = CF_FilterList.rowCount(); for ( %row = 3; %row < %count; %row++ ) $pref::ServerBrowser::Filter[%row - 3] = CF_FilterList.getRowText( %row ); } //------------------------------------------------------------------------------ function ChooseFilterDlg::newFilter( %this ) { // get an updated list of game types: queryMasterGameTypes(); %this.editFilterIndex = CF_FilterList.rowCount(); FilterEditName.setValue( "New Filter" ); FilterEditGameType.setText( "Any" ); FilterEditMissionType.setText( "Any" ); FilterEditMinPlayers.setValue( 0 ); FilterEditMaxPlayers.setValue( 255 ); FilterEditMaxBots.setValue( 16 ); FilterEditMinCPU.setValue( 0 ); FilterEditUsePingTgl.setValue( false ); FilterEditMaxPing.setValue( 50 ); FilterEditMaxPing.setVisible( false ); FilterEditTDOnTgl.setValue( false ); FilterEditTDOffTgl.setValue( false ); FilterEditWindowsTgl.setValue( false ); FilterEditLinuxTgl.setValue( false ); FilterEditDedicatedTgl.setValue( false ); FilterEditNoPwdTgl.setValue( false ); FilterEditCurVersionTgl.setValue( false ); for ( %i = 0; isObject( "FilterEditLocMask" @ %i ); %i++ ) ( "FilterEditLocMask" @ %i ).setValue( true ); Canvas.pushDialog( FilterEditDlg ); } //------------------------------------------------------------------------------ function ChooseFilterDlg::editFilter( %this ) { %rowId = CF_FilterList.getSelectedId(); if ( %rowId < 3 ) // can't edit default filters return; // get an updated list of game types: queryMasterGameTypes(); %rowText = CF_FilterList.getRowTextById( %rowId ); %filterName = getField( %rowText, 0 ); %gameType = getField( %rowText, 1 ); if ( %gameType $= "" ) %gameType = "Any"; %misType = getField( %rowText, 2 ); if ( %misType $= "" ) %misType = "Any"; %minPlayers = getField( %rowText, 3 ); if ( %minPlayers $= "" ) %minPlayers = 0; %maxPlayers = getField( %rowText, 4 ); if ( %maxPlayers $= "" ) %maxPlayers = 255; %regionCode = getField( %rowText, 5 ); if ( %regionCode $= "" ) %regionCode = 4294967295; %maxPing = getField( %rowText, 6 ); %maxBots = getField( %rowText, 7 ); if ( %maxBots $= "" ) %maxBots = 16; %minCPU = getField( %rowText, 8 ); if ( %minCPU $= "" ) %minCPU = 0; %flags = getField( %rowText, 9 ); FilterEditName.setValue( %filterName ); FilterEditMinPlayers.setValue( %minPlayers ); FilterEditMaxPlayers.setValue( %maxPlayers ); FilterEditGameType.setText( %gameType ); FilterEditMissionType.setText( %misType ); %index = 0; while ( isObject( "FilterEditLocMask" @ %index ) ) { ( "FilterEditLocMask" @ %index ).setValue( %regionCode & 1 ); %index++; %regionCode >>= 1; } if ( %maxPing == 0 ) { FilterEditUsePingTgl.setValue( false ); FilterEditMaxPing.setValue( 50 ); FilterEditMaxPing.setVisible( false ); } else { FilterEditUsePingTgl.setValue( true ); FilterEditMaxPing.setValue( %maxPing ); FilterEditMaxPing.setVisible( true ); } FilterEditMaxBots.setValue( %maxBots ); FilterEditMinCPU.setValue( %minCPU ); if ( %flags & 8 ) { FilterEditWindowsTgl.setValue( true ); FilterEditLinuxTgl.setValue( false ); } else { FilterEditWindowsTgl.setValue( false ); FilterEditLinuxTgl.setValue( %flags & 4 ); } if ( %flags & 16 ) { FilterEditTDOnTgl.setValue( true ); FilterEditTDOffTgl.setValue( false ); } else { FilterEditTDOnTgl.setValue( false ); FilterEditTDOffTgl.setValue( %flags & 32 ); } FilterEditDedicatedTgl.setValue( %flags & 1 ); FilterEditNoPwdTgl.setValue( %flags & 2 ); FilterEditCurVersionTgl.setValue( %flags & 128 ); %this.editFilterIndex = %rowId; Canvas.pushDialog( FilterEditDlg ); } //------------------------------------------------------------------------------ function ChooseFilterDlg::saveFilter( %this ) { %filterName = FilterEditName.getValue(); %gameType = FilterEditGameType.getText(); %misType = FilterEditMissionType.getText(); %minPlayers = FilterEditMinPlayers.getValue(); %maxPlayers = FilterEditMaxPlayers.getValue(); %regionCode = 0; for ( %i = 0; isObject( "FilterEditLocMask" @ %i ); %i++ ) { if ( ( "FilterEditLocMask" @ %i ).getValue() ) %regionCode |= ( 1 << %i ); } %maxPing = FilterEditUsePingTgl.getValue() ? FilterEditMaxPing.getValue() : 0; %maxBots = FilterEditMaxBots.getValue(); %minCPU = FilterEditMinCPU.getValue(); %flags = FilterEditDedicatedTgl.getValue() | ( FilterEditNoPwdTgl.getValue() << 1 ) | ( FilterEditLinuxTgl.getValue() << 2 ) | ( FilterEditWindowsTgl.getValue() << 3 ) | ( FilterEditTDOnTgl.getValue() << 4 ) | ( FilterEditTDOffTgl.getValue() << 5 ) | ( FilterEditCurVersionTgl.getValue() << 7 ); %row = %filterName TAB %gameType TAB %misType TAB %minPlayers TAB %maxPlayers TAB %regionCode TAB %maxPing TAB %maxBots TAB %minCPU TAB %flags; CF_FilterList.setRowById( %this.editFilterIndex, %row ); CF_FilterList.setSelectedById( %this.editFilterIndex ); %this.editFilterIndex = ""; Canvas.popDialog( FilterEditDlg ); } //------------------------------------------------------------------------------ function ChooseFilterDlg::deleteFilter( %this ) { %rowId = CF_FilterList.getSelectedId(); if ( %rowId < 3 ) // can't delete default filters return; %row = CF_FilterList.getRowNumById( %rowId ); %lastFilter = CF_FilterList.rowCount() - 4; while ( ( %nextRow = CF_FilterList.getRowTextById( %rowId + 1 ) ) !$= "" ) { CF_FilterList.setRowById( %rowId, %nextRow ); %rowId++; } CF_FilterList.removeRowById( %rowId ); // Get rid of the last filter (now extra): $pref::ServerBrowser::Filter[%lastFilter] = ""; // Select next (or failing that, previous) filter: if ( CF_FilterList.getRowTextById( %row ) $= "" ) %selId = CF_FilterList.getRowId( %row - 1 ); else %selId = CF_FilterList.getRowId( %row ); CF_FilterList.setSelectedById( %selId ); } //------------------------------------------------------------------------------ function ChooseFilterDlg::go( %this ) { Canvas.popDialog( ChooseFilterDlg ); GMJ_Browser.runQuery(); } //------------------------------------------------------------------------------ function CF_FilterList::onSelect( %this, %id, %text ) { // Let the user know they can't edit or delete the default filters: if ( %id < 3 ) { CF_EditFilterBtn.setActive( false ); CF_DeleteFilterBtn.setActive( false ); } else { CF_EditFilterBtn.setActive( true ); CF_DeleteFilterBtn.setActive( true ); } $pref::ServerBrowser::activeFilter = %id; } //------------------------------------------------------------------------------ function FilterEditDlg::setMinPlayers( %this ) { %newMin = FilterEditMinPlayers.getValue(); if ( %newMin < 0 ) { %newMin = 0; FilterEditMinPlayers.setValue( %newMin ); } else if ( %newMin > 254 ) { %newMin = 254; FilterEditMinPlayers.setValue( %newMin ); } %newMax = FilterEditMaxPlayers.getValue(); if ( %newMax <= %newMin ) { %newMax = %newMin + 1; FilterEditMaxPlayers.setValue( %newMax ); } } //------------------------------------------------------------------------------ function FilterEditDlg::setMaxPlayers( %this ) { %newMax = FilterEditMaxPlayers.getValue(); if ( %newMax < 1 ) { %newMax = 1; FilterEditMaxPlayers.setValue( %newMax ); } else if ( %newMax > 255 ) { %newMax = 255; FilterEditMaxPlayers.setValue( %newMax ); } %newMin = FilterEditMinPlayers.getValue(); if ( %newMin >= %newMax ) { %newMin = %newMax - 1; FilterEditMinPlayers.setValue( %newMin ); } } //------------------------------------------------------------------------------ function FilterEditDlg::setMaxBots( %this ) { %newMax = FilterEditMaxBots.getValue(); if ( %newMax < 0 ) { %newMax = 0; FilterEditMaxBots.setValue( %newMax ); } else if ( %newMax > 16 ) { %newMax = 16; FilterEditMaxBots.setValue( %newMax ); } } //------------------------------------------------------------------------------ function FilterEditUsePingTgl::onAction( %this ) { FilterEditMaxPing.setVisible( %this.getValue() ); } //------------------------------------------------------------------------------ function FilterEditDlg::setMaxPing( %this ) { %newMax = FilterEditMaxPing.getValue(); if ( %newMax < 10 ) { %newMax = 10; FilterEditMaxPing.setValue( %newMax ); } } //------------------------------------------------------------------------------ function FilterEditDlg::setMinCPU( %this ) { %newMin = FilterEditMinCPU.getValue(); if ( %newMin < 0 ) { %newMin = 0; FilterEditMinCPU.setValue( %newMin ); } } //------------------------------------------------------------------------------ function clearGameTypes() { %text = FilterEditGameType.getText(); FilterEditGameType.clear(); FilterEditGameType.add( "Any", 0 ); FilterEditGameType.add( "base", 1 ); FilterEditGameType.add( "variant", 2 ); FilterEditGameType.setText( %text ); } //------------------------------------------------------------------------------ function addGameType( %type ) { if ( FilterEditGameType.findText( %type ) == -1 ) { %id = FilterEditGameType.size(); FilterEditGameType.add( %type, %id ); } } //------------------------------------------------------------------------------ function clearMissionTypes() { %text = FilterEditMissionType.getText(); FilterEditMissionType.clear(); FilterEditMissionType.add( "Any", 0 ); FilterEditMissionType.setText( %text ); // Add all the mission types found on this machine: for ( %i = 0; %i < $HostTypeCount; %i++ ) FilterEditMissionType.add( $HostTypeDisplayName[%i], %i + 1 ); } //------------------------------------------------------------------------------ function addMissionType(%type) { if ( %type !$= "" && FilterEditMissionType.findText( %type ) == -1 ) { %id = FilterEditMissionType.size(); FilterEditMissionType.add( %type, %id ); } } //------------------------------------------------------------------------------ function sortGameAndMissionTypeLists() { FilterEditGameType.sort( true, 3 ); %idx = FilterEditGameType.findText( FilterEditGameType.getText() ); if ( %idx > -1 ) FilterEditGameType.setSelected( %idx ); FilterEditMissionType.sort( true, 1 ); %idx = FilterEditMissionType.findText( FilterEditMissionType.getText() ); if ( %idx > -1 ) FilterEditMissionType.setSelected( %idx ); } //------------------------------------------------------------------------------ function FilterEditTDOnTgl::onAction( %this ) { if ( %this.getValue() && FilterEditTDOffTgl.getValue() ) FilterEditTDOffTgl.setValue( false ); } //------------------------------------------------------------------------------ function FilterEditTDOffTgl::onAction( %this ) { if ( %this.getValue() && FilterEditTDOnTgl.getValue() ) FilterEditTDOnTgl.setValue( false ); } //------------------------------------------------------------------------------ function FilterEditWindowsTgl::onAction( %this ) { if ( %this.getValue() && FilterEditLinuxTgl.getValue() ) FilterEditLinuxTgl.setValue( false ); } //------------------------------------------------------------------------------ function FilterEditLinuxTgl::onAction( %this ) { if ( %this.getValue() && FilterEditWindowsTgl.getValue() ) FilterEditWindowsTgl.setValue( false ); } //------------------------------------------------------------------------------ // Make sure we still have at least one region selected: function FilterEditDlg::checkRegionMasks( %this, %lastIndex ) { %index = 0; while ( isObject( "FilterEditLocMask" @ %index ) ) { if ( ( "FilterEditLocMask" @ %index ).getValue() ) return; %index++; } // None are selected, so reselect the last control: ( "FilterEditLocMask" @ %lastIndex ).setValue( true ); } PK !(|L77scripts/CnHGame.cs// DisplayName = Capture and Hold //--- GAME RULES BEGIN --- //Teams try to capture marked objectives //Capturing player gets a point 12 seconds after a capture //Hold objectives in order to score //A team scores 2 points per second it holds an objective //Turrets and inventory stations convert when their switch is taken //--- GAME RULES END --- //exec the AI scripts exec("scripts/aiCnH.cs"); package CnHGame { function FlipFlop::playerTouch(%data, %flipflop, %player) { if(%flipflop.team != %player.client.team) { Parent::playerTouch(%data, %flipflop, %player); Game.startTimerPlayerFFCap(%player.client, %flipflop); } } function Flipflop::objectiveInit(%data, %flipflop) { %flipflop.tCapThread = ""; %flipflop.tHoldThread = ""; %flipflop.pCapThread = ""; Parent::objectiveInit(%data, %flipflop); } }; //--------- CnH SCORING INIT ------------------ function CnHGame::initGameVars(%game) { %game.SCORE_PER_SUICIDE = -1; %game.SCORE_PER_TEAMKILL = -1; %game.SCORE_PER_DEATH = -1; %game.SCORE_PER_KILL = 1; %game.SCORE_PER_PLYR_FLIPFLOP_CAP = 1; %game.SCORE_PER_TEAM_FLIPFLOP_CAP = 1; %game.SCORE_PER_TEAM_FLIPFLOP_HOLD = 1; %game.SCORE_PER_TURRET_KILL = 1; %game.SCORE_PER_FLIPFLOP_DEFEND = 1; %game.SCORE_LIMIT_PER_TOWER = 1200; //default of 1200 points per tower required to win @ 1 pt per %game.TIME_REQ_TEAM_HOLD_BONUS milliseconds %game.TIME_REQ_PLYR_CAP_BONUS = 12 * 1000; //player must hold a switch 12 seconds to get a point for it. %game.TIME_REQ_TEAM_CAP_BONUS = 12 * 1000; //time after touching it takes for team to get a point %game.TIME_REQ_TEAM_HOLD_BONUS = 0.5 * 1000; //recurring time it takes team to earn a point when flipflop held %game.RADIUS_FLIPFLOP_DEFENSE = 20; //meters } function CnHGame::setUpTeams(%game) { DefaultGame::setUpTeams(%game); // reset the visibility of team 0 (team is still defaulted as friendly) setSensorGroupAlwaysVisMask(0, 0); } //-- tracking --- // .deaths .kills .suicides .teamKills .turretKills // .flipFlopDefends .flipFlopsCapped function CnHGame::startMatch(%game) { for(%i = 0; %i <= %game.numTeams; %i++) $TeamScore[%i] = 0; DefaultGame::startMatch(%game); } function CnHGame::checkScoreLimit(%game, %team) { %scoreLimit = %game.getScoreLimit(); if($TeamScore[%team] >= %scoreLimit) %game.scoreLimitReached(); } function CnHGame::getScoreLimit(%game) { %scoreLimit = MissionGroup.CnH_scoreLimit; if(%scoreLimit $= "") %scoreLimit = %game.getNumFlipFlops() * %game.SCORE_LIMIT_PER_TOWER; return %scoreLimit; } function CnHGame::scoreLimitReached(%game) { logEcho("game over (scorelimit)"); %game.gameOver(); cycleMissions(); } function CnHGame::timeLimitReached(%game) { logEcho("game over (timelimit)"); %game.gameOver(); cycleMissions(); } function CnHGame::gameOver(%game) { //call the default DefaultGame::gameOver(%game); // stop all bonus timers %game.stopScoreTimers(); //send the winner message %winner = ""; if ($teamScore[1] > $teamScore[2]) %winner = $teamName[1]; else if ($teamScore[2] > $teamScore[1]) %winner = $teamName[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 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 ( %team = 1; %team <= %game.numTeams; %team++ ) { $TeamScore[%team] = 0; messageAll('MsgCnHTeamCap', "", -1, -1, -1, %team, $TeamScore[%team], %game.getScoreLimit()); } } function CnHGame::stopScoreTimers(%game) { // find all switches and cancel any timers associated with them %ffGroup = nameToId("MissionCleanup/FlipFlops"); if(%ffGroup <= 0) return; for(%i = 0; %i < %ffGroup.getCount(); %i++) { %curFF = %ffGroup.getObject(%i); cancel(%curFF.tHoldThread); cancel(%curFF.pCapThread); cancel(%curFF.tCapThread); } } function CnHGame::clientMissionDropReady(%game, %client) { messageClient(%client, 'MsgClientReady',"", %game.class); %scoreLimit = %game.getScoreLimit(); for(%i = 1; %i <= %game.numTeams; %i++) { %teamHeld = %game.countFlipsHeld(%i); messageClient(%client, 'MsgCnHAddTeam', "", %i, $TeamName[%i], $TeamScore[%i], %scoreLimit, %teamHeld); } //%game.populateTeamRankArray(%client); //messageClient(%client, 'MsgYourRankIs', "", -1); messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); DefaultGame::clientMissionDropReady(%game, %client); } function CnHGame::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 CnHGame::getNumFlipFlops() { %ffGroup = nameToID("MissionCleanup/FlipFlops"); return %ffGroup.getCount(); } function CnHGame::countFlipsHeld(%game, %team) { %teamHeld = 0; // count how many flipflops each team holds %ffSet = nameToID("MissionCleanup/FlipFlops"); if(%ffSet > 0) { %numFF = %ffSet.getCount(); for(%j = 0; %j < %numFF; %j++) { %curFF = %ffSet.getObject(%j); if(%curFF.team == %team) %teamHeld++; } } return %teamHeld; } function CnHGame::countFlips(%game) { return true; } function CnHGame::equip(%game, %player) { for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); //%player.setArmor("Light"); %player.setInventory(Blaster,1); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 20); %player.setInventory(TargetingLaser, 1); %player.setInventory(Grenade,6); %player.setInventory(Beacon, 3); %player.setInventory(RepairKit,1); %player.weaponCount = 3; %player.use("Blaster"); } //--------------- Scoring functions ----------------- function CnHGame::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); %cl.offenseScore = %killPoints; %cl.offenseScore += %cl.suicides * %game.SCORE_PER_SUICIDE; //-1 %cl.offenseScore += %cl.teamKills * %game.SCORE_PER_TEAMKILL; // -1 %cl.offenseScore += %cl.flipFlopsCapped * %game.SCORE_PER_PLYR_FLIPFLOP_CAP; %cl.defenseScore = %cl.turretKills * %game.SCORE_PER_TURRET_KILL; // 1 %cl.defenseScore += %cl.flipFlopDefends * %game.SCORE_PER_FLIPFLOP_DEFEND; %cl.score = mFloor(%cl.offenseScore + %cl.defenseScore); //track switches held (not touched), switches defended, kills, deaths, suicides, tks %game.recalcTeamRanks(%cl); } function CnHGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { 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 { %game.awardScoreKill(%clKiller); %game.awardScoreDeath(%clVictim); //see if we were defending a flip flop %flipflop = %game.testPlayerFFDefend(%clVictim, %clKiller); if (isObject(%flipflop)) %game.awardScorePlayerFFDefend(%clKiller, %flipflop); } 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 CnHGame::testPlayerFFDefend(%game, %victimID, %killerID) { if (!isObject(%victimId) || !isObject(%killerId) || %killerId.team <= 0) return -1; //loop through the flipflops looking for one within range that belongs to the killer... %ffGroup = nameToID("MissionCleanup/FlipFlops"); for (%i = 0; %i < %ffGroup.getCount(); %i++) { %ffObj = %ffGroup.getObject(%i); if (VectorDist(%ffObj.position, %victimID.plyrPointOfDeath) < %game.RADIUS_FLIPFLOP_DEFENSE) { if (%ffObj.team == %killerID.team) return %ffObj; } } //none were found return -1; } function CnHGame::awardScorePlayerFFDefend(%game, %cl, %flipflop) { %cl.flipFlopDefends++; if (%game.SCORE_PER_FLIPFLOP_DEFEND != 0) { messageClient(%cl, 'msgFFDef', '\c0You received a %1 point bonus for defending %2.', %game.SCORE_PER_FLIPFLOP_DEFEND, %game.cleanWord(%flipflop.name)); // messageTeamExcept(%cl, 'msgFFDef', '\c0Teammate %1 received a %2 point bonus for defending %3', %cl.name, %game.SCORE_PER_FLIPFLOP_DEFEND, %game.cleanWord(%flipflop.name)); } %game.recalcScore(%cl); } function CnHGame::awardScorePlayerFFCap(%game, %cl, %this) { if(!($missionRunning)) return; %cl.flipFlopsCapped++; if (%game.SCORE_PER_PLYR_FLIPFLOP_CAP != 0) { messageClient(%cl, 'msgFFDef', '\c0You received a %1 point bonus for holding the %2.', %game.SCORE_PER_PLYR_FLIPFLOP_CAP, %game.cleanWord(%this.name)); // messageTeamExcept(%cl, 'msgFFDef', '\c0Teammate %1 received a %2 point bonus for holding the %3', %cl.name, %game.SCORE_PER_PLYR_FLIPFLOP_CAP, %game.cleanWord(%this.name)); } %game.recalcScore(%cl); } function CnHGame::awardScoreTeamFFCap(%game, %team, %this) { cancel(%this.tCapThread); if(!($missionRunning)) return; $TeamScore[%team] +=%game.SCORE_PER_TEAM_FLIPFLOP_CAP; %sLimit = %game.getScoreLimit(); if (%game.SCORE_PER_TEAM_FLIPFLOP_CAP) messageAll('MsgCnHTeamCap', "", -1, -1, -1, %team, $teamScore[%team], %sLimit); if (%game.SCORE_PER_TEAM_FLIPFLOP_HOLD != 0) %this.tHoldThread = %game.schedule(%game.TIME_REQ_TEAM_HOLD_BONUS, "awardScoreTeamFFHold", %team, %this); %game.checkScoreLimit(%team); } function CnHGame::awardScoreTeamFFHold(%game, %team, %this) { cancel(%this.tHoldThread); if(!($missionRunning)) return; $TeamScore[%team] +=%game.SCORE_PER_TEAM_FLIPFLOP_HOLD; %sLimit = %game.getScoreLimit(); if (%game.SCORE_PER_TEAM_FLIPFLOP_HOLD) messageAll('MsgCnHTeamCap', "", $TeamName[%team], %game.SCORE_PER_TEAM_FLIPFLOP_HOLD, %game.cleanWord(%this.name), %team, $teamScore[%team], %sLimit); // if either team's score is divisible by 100, send a console log message if(($TeamScore[%team] / 100) == (mFloor($TeamScore[%team] / 100))) for(%i = 1; %i <= %game.numTeams; %i++) logEcho("team "@%i@" score "@$TeamScore[%i]); %game.checkScoreLimit(%team); %this.tHoldThread = %game.schedule(%game.TIME_REQ_TEAM_HOLD_BONUS, "awardScoreTeamFFHold", %team, %this); } function CnHGame::testValidRepair(%game, %obj) { return ((%obj.lastDamagedByTeam != %obj.team) && (%obj.repairedBy.team == %obj.team)); } function CnHGame::genOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; messageTeam(%repairman.team, 'msgGenRepaired', '\c0%1 repaired the %2 Generator!', %repairman.name, %obj.nameTag); } } function CnHGame::stationOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; messageTeam(%repairman.team, 'msgStationRepaired', '\c0%1 repaired the %2 Inventory Station!', %repairman.name, %obj.nameTag); } } function CnHGame::sensorOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; messageTeam(%repairman.team, 'msgSensorRepaired', '\c0%1 repaired the %2 Pulse Sensor!', %repairman.name, %obj.nameTag); } } function CnHGame::turretOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; messageTeam(%repairman.team, 'msgTurretRepaired', '\c0%1 repaired the %2 Turret!', %repairman.name, %obj.nameTag); } } function CnHGame::vStationOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; messageTeam(%repairman.team, 'msgTurretRepaired', '\c0%1 repaired the %2 Vehicle Station!', %repairman.name, %obj.nameTag); } } function CnHGame::startTimerPlayerFFCap(%game, %cl, %this) { cancel(%this.pCapThread); //stop the last owner from collecting a cap bonus %this.pCapThread = %game.schedule(%game.TIME_REQ_PLYR_CAP_BONUS, "awardScorePlayerFFCap", %cl, %this); cancel(%this.tCapThread); //stop the old owners from collecting any cap bonus cancel(%this.tHoldThread); //stop the old owners from collecting any hold bonus %this.tCapThread = %game.schedule(%game.TIME_REQ_TEAM_CAP_BONUS, "awardScoreTeamFFCap", %cl.team, %this); } function CnHGame::startTimerTeamFFCap(%game, %team, %this, %time) { %this.tCapThread = %game.schedule(%time, "awardScoreTeamFFCap", %team, %this); } //------------------------------------------------------------------------ function CnHGame::resetScore(%game, %client) { %client.offenseScore = 0; %client.kills = 0; %client.deaths = 0; %client.suicides = 0; %client.teamKills = 0; %client.flipFlopsCapped = 0; %client.defenseScore = 0; %client.turretKills = 0; %client.flipFlopDefends = 0; %client.score = 0; for ( %team = 1; %team <= %game.numTeams; %team++ ) if($TeamScore[%team] != 0) $TeamScore[%team] = 0; } function CnHGame::applyConcussion(%game, %player) { } PK !((|/|/scripts/DMGame.cs// -------------------------------------------------------- // Deathmatch mission type // -------------------------------------------------------- // DisplayName = Deathmatch //--- GAME RULES BEGIN --- //There aren't many rules... //Kill //Don't get killed //Points are scored for each kill you make and subtracted each time you die //--- GAME RULES END --- $InvBanList[DM, "TurretOutdoorDeployable"] = 1; $InvBanList[DM, "TurretIndoorDeployable"] = 1; $InvBanList[DM, "ElfBarrelPack"] = 1; $InvBanList[DM, "MortarBarrelPack"] = 1; $InvBanList[DM, "PlasmaBarrelPack"] = 1; $InvBanList[DM, "AABarrelPack"] = 1; $InvBanList[DM, "MissileBarrelPack"] = 1; $InvBanList[DM, "Mine"] = 1; function DMGame::setUpTeams(%game) { %group = nameToID("MissionGroup/Teams"); if(%group == -1) return; // create a team0 if it does not exist %team = nameToID("MissionGroup/Teams/team0"); if(%team == -1) { %team = new SimGroup("team0"); %group.add(%team); } // 'team0' is not counted as a team here %game.numTeams = 0; while(%team != -1) { // create drop set and add all spawnsphere objects into it %dropSet = new SimSet("TeamDrops" @ %game.numTeams); MissionCleanup.add(%dropSet); %spawns = nameToID("MissionGroup/Teams/team" @ %game.numTeams @ "/SpawnSpheres"); if(%spawns != -1) { %count = %spawns.getCount(); for(%i = 0; %i < %count; %i++) %dropSet.add(%spawns.getObject(%i)); } // set the 'team' field for all the objects in this team %team.setTeam(0); clearVehicleCount(%team+1); // get next group %team = nameToID("MissionGroup/Teams/team" @ %game.numTeams + 1); if (%team != -1) %game.numTeams++; } // set the number of sensor groups (including team0) that are processed setSensorGroupCount(%game.numTeams + 1); %game.numTeams = 1; // allow teams 1->31 to listen to each other (team 0 can only listen to self) for(%i = 1; %i < 32; %i++) setSensorGroupListenMask(%i, 0xfffffffe); } function DMGame::initGameVars(%game) { %game.SCORE_PER_KILL = 1; %game.SCORE_PER_DEATH = -1; %game.SCORE_PER_SUICIDE = -1; } exec("scripts/aiDeathMatch.cs"); function DMGame::allowsProtectedStatics(%game) { return true; } function DMGame::equip(%game, %player) { for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); //%player.setArmor("Light"); %player.setInventory(RepairKit, 1); %player.setInventory("Disc", 1); %player.setInventory("DiscAmmo", 15); %player.setInventory("TargetingLaser", 1); %player.weaponCount = 1; // do we want to give players a disc launcher instead? GJL: Yes we do! %player.use("Disc"); } function DMGame::pickPlayerSpawn(%game, %client, %respawn) { // all spawns come from team 1 return %game.pickTeamSpawn(1); } function DMGame::clientJoinTeam( %game, %client, %team, %respawn ) { %game.assignClientTeam( %client ); // Spawn the player: %game.spawnPlayer( %client, %respawn ); } function DMGame::assignClientTeam(%game, %client) { for(%i = 1; %i < 32; %i++) $DMTeamArray[%i] = false; %maxSensorGroup = 0; %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if(%cl != %client) { $DMTeamArray[%cl.team] = true; if (%cl.team > %maxSensorGroup) %maxSensorGroup = %cl.team; } } //now loop through the team array, looking for an empty team for(%i = 1; %i < 32; %i++) { if (! $DMTeamArray[%i]) { %client.team = %i; if (%client.team > %maxSensorGroup) %maxSensorGroup = %client.team; break; } } // set player's skin pref here setTargetSkin(%client.target, %client.skin); // Let everybody know you are no longer an observer: messageAll( 'MsgClientJoinTeam', '\c1%1 has joined the fray.', %client.name, "", %client, 1 ); updateCanListenState( %client ); //now set the max number of sensor groups... setSensorGroupCount(%maxSensorGroup + 1); } function DMGame::clientMissionDropReady(%game, %client) { messageClient(%client, 'MsgClientReady',"", %game.class); messageClient(%client, 'MsgYourScoreIs', "", 0); messageClient(%client, 'MsgDMPlayerDies', "", 0); messageClient(%client, 'MsgDMKill', "", 0); %game.resetScore(%client); messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); DefaultGame::clientMissionDropReady(%game, %client); } function DMGame::AIHasJoined(%game, %client) { //let everyone know the player has joined the game //messageAllExcept(%client, -1, 'MsgClientJoinTeam', '%1 has joined the fray.', %client.name, "", %client, 1 ); } function DMGame::checkScoreLimit(%game, %client) { //there's no score limit in DM } function DMGame::createPlayer(%game, %client, %spawnLoc, %respawn) { DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn); %client.setSensorGroup(%client.team); } function DMGame::resetScore(%game, %client) { %client.deaths = 0; %client.kills = 0; %client.score = 0; %client.efficiency = 0.0; %client.suicides = 0; } function DMGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc) { cancel(%clVictim.player.alertThread); DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc); } function DMGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { if (%game.testKill(%clVictim, %clKiller)) //verify victim was an enemy { %game.awardScoreKill(%clKiller); messageClient(%clKiller, 'MsgDMKill', "", %clKiller.kills); %game.awardScoreDeath(%clVictim); } else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide %game.awardScoreSuicide(%clVictim); messageClient(%clVictim, 'MsgDMPlayerDies', "", %clVictim.deaths + %clVictim.suicides); } function DMGame::recalcScore(%game, %client) { %killValue = %client.kills * %game.SCORE_PER_KILL; %deathValue = %client.deaths * %game.SCORE_PER_DEATH; %suicideValue = %client.suicides * %game.SCORE_PER_SUICIDE; if (%killValue - %deathValue == 0) %client.efficiency = %suicideValue; else %client.efficiency = ((%killValue * %killValue) / (%killValue - %deathValue)) + %suicideValue; %client.score = mFloatLength(%client.efficiency, 1); messageClient(%client, 'MsgYourScoreIs', "", %client.score); %game.recalcTeamRanks(%client); %game.checkScoreLimit(%client); } function DMGame::timeLimitReached(%game) { logEcho("game over (timelimit)"); %game.gameOver(); cycleMissions(); } function DMGame::scoreLimitReached(%game) { logEcho("game over (scorelimit)"); %game.gameOver(); cycleMissions(); } function DMGame::gameOver(%game) { //call the default DefaultGame::gameOver(%game); messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); cancel(%game.timeThread); messageAll('MsgClearObjHud', ""); for(%i = 0; %i < ClientGroup.getCount(); %i ++) { %client = ClientGroup.getObject(%i); %game.resetScore(%client); } } function DMGame::enterMissionArea(%game, %playerData, %player) { %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"); cancel(%player.alertThread); } function DMGame::leaveMissionArea(%game, %playerData, %player) { if(%player.getState() $= "Dead") return; %player.client.outOfBounds = true; messageClient(%player.client, 'LeaveMissionArea', '\c1You have left the mission area. Return or take damage.~wfx/misc/warning_beep.wav'); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") left mission area"); %player.alertThread = %game.schedule(1000, "DMAlertPlayer", 3, %player); } function DMGame::DMAlertPlayer(%game, %count, %player) { // MES - I commented below line out because it prints a blank line to chat window //messageClient(%player.client, 'MsgDMLeftMisAreaWarn', '~wfx/misc/red_alert.wav'); if(%count > 1) %player.alertThread = %game.schedule(1000, "DMAlertPlayer", %count - 1, %player); else %player.alertThread = %game.schedule(1000, "MissionAreaDamage", %player); } function DMGame::MissionAreaDamage(%game, %player) { if(%player.getState() !$= "Dead") { %player.setDamageFlash(0.1); %prevHurt = %player.getDamageLevel(); %player.setDamageLevel(%prevHurt + 0.05); %player.alertThread = %game.schedule(1000, "MissionAreaDamage", %player); } else %game.onClientKilled(%player.client, 0, $DamageType::OutOfBounds); } function DMGame::updateScoreHud(%game, %client, %tag) { // Clear the header: messageClient( %client, 'SetScoreHudHeader', "", "" ); // Send the subheader: messageClient(%client, 'SetScoreHudSubheader', "", '\tPLAYER\tRATING\tKILLS\tDEATHS'); for (%index = 0; %index < $TeamRank[0, count]; %index++) { //get the client info %cl = $TeamRank[0, %index]; //get the score %clScore = mFloatLength( %cl.efficiency, 1 ); %clKills = mFloatLength( %cl.kills, 0 ); %clDeaths = mFloatLength( %cl.deaths + %cl.suicides, 0 ); %clStyle = %cl == %client ? "" : ""; //if the client is not an observer, send the message if (%client.team != 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, '%5\t%1%2%3%4', %cl.name, %clScore, %clKills, %clDeaths, %clStyle ); } //else for observers, create an anchor around the player name so they can be observed else { messageClient( %client, 'SetLineHud', "", %tag, %index, '%5\t%1%2%3%4', %cl.name, %clScore, %clKills, %clDeaths, %clStyle, %cl ); } } // Tack on the list of observers: %observerCount = 0; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team == 0) %observerCount++; } if (%observerCount > 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, ""); %index++; messageClient(%client, 'SetLineHud', "", %tag, %index, '\tOBSERVERS (%1)TIME', %observerCount); %index++; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); //if this is an observer if (%cl.team == 0) { %obsTime = getSimTime() - %cl.observerStartTime; %obsTimeStr = %game.formatTime(%obsTime, false); messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%1%2', %cl.name, %obsTimeStr ); %index++; } } } //clear the rest of Hud so we don't get old lines hanging around... messageClient( %client, 'ClearHud', "", %tag, %index ); } function DMGame::applyConcussion(%game, %player) { } PK !(>s%ZZscripts/DebriefGui.cs//------------------------------------------------------------------------------ // // DebriefGui.cs // //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function DebriefGui::onWake( %this ) { moveMap.pop(); if ( isObject( passengerKeys ) ) passengerKeys.pop(); if ( isObject( observerBlockMap ) ) observerBlockMap.pop(); if ( isObject( observerMap ) ) observerMap.pop(); //flyingCameraMove.pop(); if ( isObject( debriefMap ) ) { debriefMap.pop(); debriefMap.delete(); } new ActionMap( debriefMap ); %bind = moveMap.getBinding( toggleMessageHud ); debriefMap.bind( getField( %bind, 0 ), getField( %bind, 1 ), toggleDebriefChat ); debriefMap.copyBind( moveMap, activateChatMenuHud ); debriefMap.bindCmd( keyboard, escape, "", "debriefContinue();" ); debriefMap.push(); DB_ChatVector.attach( HudMessageVector ); DB_ChatScroll.scrollToBottom(); DB_LoadingProgress.setValue( 0 ); LoadingProgress.setValue( 0 ); DB_LoadingProgressTxt.setValue( "LOADING MISSION" ); LoadingProgressTxt.setValue( "LOADING MISSION" ); } //------------------------------------------------------------------------------ function DebriefGui::onSleep( %this ) { debriefMap.pop(); debriefMap.delete(); } //------------------------------------------------------------------------------ function DebriefResultText::onResize( %this, %width, %height ) { %fieldHeight = getWord( DB_ResultPane.getExtent(), 1 ); %x = getWord( DB_ResultScroll.getPosition(), 0 ); %w = getWord( DB_ResultScroll.getExtent(), 0 ); %h = %fieldHeight - %height - 4; DB_ResultScroll.resize( %x, %height + 2, %w, %h ); } //------------------------------------------------------------------------------ function toggleDebriefChat() { Canvas.pushDialog( DB_ChatDlg ); } //------------------------------------------------------------------------------ function DB_ChatDlg::onWake( %this ) { DB_ChatEntry.setValue( "" ); } //------------------------------------------------------------------------------ function DB_ChatEntry::onEscape( %this ) { Canvas.popDialog( DB_ChatDlg ); } //------------------------------------------------------------------------------ function DB_ChatEntry::sendChat( %this ) { %text = %this.getValue(); if ( %text !$= "" ) commandToServer( 'MessageSent', %text ); Canvas.popDialog( DB_ChatDlg ); } //------------------------------------------------------------------------------ function debriefDisconnect() { MessageBoxYesNo( "DISCONNECT", "Are you sure you want to leave this game?", "Disconnect();" ); } //------------------------------------------------------------------------------ function debriefContinue() { checkGotLoadInfo(); } //------------------------------------------------------------------------------ addMessageCallback( 'MsgGameOver', handleGameOverMessage ); addMessageCallback( 'MsgClearDebrief', handleClearDebriefMessage ); addMessageCallback( 'MsgDebriefResult', handleDebriefResultMessage ); addMessageCallback( 'MsgDebriefAddLine', handleDebriefLineMessage ); //------------------------------------------------------------------------------ function handleGameOverMessage( %msgType, %msgString ) { weaponsHud.clearAll(); inventoryHud.clearAll(); // Fill the Debriefer up with stuff... Canvas.setContent( DebriefGui ); } function handleClearDebriefMessage( %msgType, %msgString ) { DebriefResultText.setText( "" ); DebriefText.setText( "" ); } //------------------------------------------------------------------------------ function handleDebriefResultMessage( %msgType, %msgString, %string ) { %text = DebriefResultText.getText(); if ( %text $= "" ) %newText = detag( %string ); else %newText = %text NL detag( %string ); DebriefResultText.setText( %newText ); } //------------------------------------------------------------------------------ function handleDebriefLineMessage( %msgType, %msgString, %string ) { %text = DebriefText.getText(); if ( %text $= "" ) %newText = detag( %string ); else %newText = %text NL detag( %string ); DebriefText.setText( %newText ); } PK !(7Hscripts/DemoEndGui.cs$DemoCycleDelay = 6000; function DemoEndGui::onWake(%this) { %this.index = 1; new ActionMap( DemoEndMap ); DemoEndMap.bindCmd( mouse, button0, "DemoEndGui.forceBitmapCycle();", "" ); DemoEndMap.bindCmd( keyboard, space, "DemoEndGui.forceBitmapCycle();", "" ); DemoEndMap.push(); %this.cycleTimer = %this.schedule($DemoCycleDelay, cycleBitmaps); } function DemoEndGui::cycleBitmaps(%this) { if (%this.index == 3) quit(); else { %this.index++; %this.setBitmap("gui/bg_DemoEnd" @ %this.index); %this.cycleTimer = %this.schedule( $DemoCycleDelay, cycleBitmaps ); } } function DemoEndGui::forceBitmapCycle( %this ) { cancel( %this.cycleTimer ); %this.cycleBitmaps(); } PK r _-eEscripts/DnDGame.cs// DisplayName = Defend and Destroy //--- GAME RULES BEGIN --- //Destroy objectives and hold switches. //Teams score 1 point for each switch held, and each Large Turret, Sensor, Generator, and Vehicle Station destroyed. //The map ends when one team destroys all the enemy objectives and holds all switches, or the timelimit expires. //--- GAME RULES END --- //-------------------------------------------------------------------------------- // <> Defend and Destroy <> // // Version: 1.1.25026 // Date: October 23, 2002 // By: ZOD // http://www.planettribes.com/syrinx/ // // SCORING: // // Teams get 1 point each time they destroy and enemy objective or hold a // flip flop switch. // // Objectives consist of vehicle stations, large and medium pulse sensors, // solar panels, generators and base turrets. //-------------------------------------------------------------------------------- //exec the AI scripts exec("scripts/aiDnD.cs"); $DnDVer = "1.1.25026"; if($Host::MarkDnDObjectives $= "") $Host::MarkDnDObjectives = 1; function DnDGame::initGameVars(%game) { %game.SCORE_PER_SUICIDE = 0; // z0dd - ZOD, 8/19/02. No penalty for suicide! Was -10 %game.SCORE_PER_TEAMKILL = -5; %game.SCORE_PER_DEATH = 0; %game.SCORE_PER_KILL = 5; %game.SCORE_PER_HEADSHOT = 1; %game.SCORE_PER_TURRET_KILL = 5; %game.SCORE_PER_TURRET_KILL_AUTO = 1; %game.SCORE_PER_OBJECT_DEFEND = 5; // Score for defending an objective %game.SCORE_PER_DESTROY_GEN = 10; %game.SCORE_PER_DESTROY_SOLAR = 8; %game.SCORE_PER_DESTROY_SENSOR = 4; %game.SCORE_PER_DESTROY_TURRET = 6; %game.SCORE_PER_DESTROY_ISTATION = 4; %game.SCORE_PER_DESTROY_ASTATION = 4; %game.SCORE_PER_DESTROY_VSTATION = 8; %game.SCORE_PER_DESTROY_TSTATION = 4; %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_TK_DESTROY = -10; // Penalty for TKing equiptment, needs to be harsh. %game.SCORE_PER_PLYR_FLIPFLOP_CAP = 8; %game.SCORE_PER_DESTROY_SHRIKE = 5; %game.SCORE_PER_DESTROY_BOMBER = 8; %game.SCORE_PER_DESTROY_TRANSPORT = 5; %game.SCORE_PER_DESTROY_WILDCAT = 5; %game.SCORE_PER_DESTROY_TANK = 8; %game.SCORE_PER_DESTROY_MPB = 12; %game.SCORE_PER_PASSENGER = 2; %game.SCORE_PER_REPAIR_GEN = 8; %game.SCORE_PER_REPAIR_SOLAR = 6; %game.SCORE_PER_REPAIR_SENSOR = 2; %game.SCORE_PER_REPAIR_TURRET = 4; %game.SCORE_PER_REPAIR_ASTATION = 2; %game.SCORE_PER_REPAIR_ISTATION = 2; %game.SCORE_PER_REPAIR_VSTATION = 4; %game.SCORE_PER_REPAIR_TSTATION = 4; %game.SCORE_PER_REPAIR_SENTRY = 2; %game.SCORE_PER_REPAIR_DEP_SENSOR = 1; %game.SCORE_PER_REPAIR_DEP_TUR = 3; %game.SCORE_PER_REPAIR_DEP_INV = 2; %game.RADIUS_OBJECT_DEFENSE = 20; %game.TIME_REQ_PLYR_CAP_BONUS = 12 * 1000; // player must hold a switch 12 seconds to get a point for it. %game.TIME_REQ_TEAM_CAP_BONUS = 12 * 1000; // time after touching it takes for team to get a point } package DnDGame { // z0dd - ZOD. From Classic MOD, placed here for base and mod compatibility. function teamDestroyMessage(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %team = %client.team; %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %recipient = ClientGroup.getObject(%i); if((%recipient.team == %team) && (%recipient != %client)) { commandToClient(%recipient, 'TeamDestroyMessage', %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6); } } } function ShapeBaseData::onDestroyed(%data, %obj, %prevstate) { %scorer = %obj.lastDamagedBy; if(!isObject(%scorer)) return; if((%scorer.getType() & $TypeMasks::GameBaseObjectType) && %scorer.getDataBlock().catagory $= "Vehicles") { %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 %scorer = %scorer.owner; // unmanned turret } if(!%damagingTeam) %damagingTeam = %scorer.team; if(%damagingTeam != %obj.team) { if(!%obj.soiledByEnemyRepair) { Game.awardScoreStaticShapeDestroy(%scorer, %obj); } } else { if(!%obj.getDataBlock().deployedObject) Game.awardScoreTkDestroy(%scorer, %obj); } if(!%obj.objectiveCompleted && %obj.scoreValue) { messageAllExcept(%scorer, %damagingTeam, 'MsgDnDObjDisabled', '\c2%1 destroyed your %2 objective!', %scorer.name, Game.cleanWord(%obj.getDataBlock().targetTypeTag)); %obj.objectiveCompleted = true; if(isObject(%obj.wayPointMarker)) %obj.wayPointMarker.schedule(100, "delete"); $teamScore[%damagingTeam]++; Game.checkScoreLimit(%damagingTeam); } } 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) { %target.soiledByEnemyRepair = true; } } function StaticShapeData::objectiveInit(%data, %obj) { if(!%data.deployedObject && %obj.team > 0) { %class = %data.className; if(%class $= "Generator" || %class $= "Sensor" || %class $= "TurretBase") { %obj.objectiveCompleted = false; %obj.scoreValue = true; $numObjectives[%obj.team]++; if($Host::MarkDnDObjectives) Game.setupObjectiveMarker(%obj); } } } function StationVehicle::onAdd(%this, %obj) { // We use onAdd because objectiveInit is never called on v-stations. Parent::onAdd(%this, %obj); if(%obj.team > 0) { %obj.objectiveCompleted = false; %obj.scoreValue = true; $numObjectives[%obj.team]++; if($Host::MarkDnDObjectives) Game.setupObjectiveMarker(%obj); } } function FlipFlop::objectiveInit(%data, %flipflop) { Parent::objectiveInit(%data, %flipflop); %flipflop.tCapThread = ""; %flipflop.pCapThread = ""; %flipflop.scoreValue = true; for(%i = 1; %i <= Game.numTeams; %i++) { $numObjectives[%i]++; } %flipFlop.prevTeam = ""; } function FlipFlop::playerTouch(%data, %flipflop, %player) { if(%flipflop.team != %player.client.team) { Parent::playerTouch(%data, %flipflop, %player); Game.startTimerPlayerFFCap(%player.client, %flipflop); } } }; function DnDGame::setupObjectiveMarker(%game, %obj) { %name = (getTaggedString(%obj.getDataBlock().targetNameTag) SPC getTaggedString(%obj.getDataBlock().targetTypeTag)); %obj.wayPointMarker = new WayPoint() { position = %obj.getPosition(); name = %name; dataBlock = "WayPointMarker"; team = %obj.team; }; MissionCleanup.add(%obj.wayPointMarker); } function serverCmdsetDnDMarkers(%client, %value) { // USAGE: commandToServer('setDnDMarkers', 1); %val = deTag(%value); %adj = %val == 1 ? 1 : 0; %snd = '~wfx/misc/warning_beep.wav'; %detail = (%adj ? "enabled" : "disabled"); %name = %client.name; if(%client.isAdmin) { switch$ ( %adj ) { case 0: %msg = '\c3%5: \c2Objective markers: \c3%4\c2, cycling mission.%1'; $Host::MarkDnDObjectives = %adj; export( "$Host::*", "prefs/ServerPrefs.cs", false ); if( isObject( Game ) ) Game.gameOver(); loadMission($CurrentMission, $CurrentMissionType, false); case 1: %msg = '\c3%5: \c2Objective markers: \c3%4\c2, cycling mission.%1'; $Host::MarkDnDObjectives = %adj; export( "$Host::*", "prefs/ServerPrefs.cs", false ); if( isObject( Game ) ) Game.gameOver(); loadMission($CurrentMission, $CurrentMissionType, false); default: messageClient(%client, 'MsgAdmin', '\c2Incorrect value, 0 disables markers, 1 enables markers.'); } messageAll( 'MsgAdmin', %msg, %snd, %val, %adj, %detail, %name, $CurrentMission ); } else messageClient(%client, 'MsgAdmin', '\c2Only Admins can use this command.'); } ///////////////////////////////////////////////////////////////////////////////////////// // Team Functions /////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// function DnDGame::setUpTeams(%game) { DefaultGame::setUpTeams(%game); // reset the visibility of team 0 (team is still defaulted as friendly) setSensorGroupAlwaysVisMask(0, 0); } function DnDGame::clientMissionDropReady(%game, %client) { messageClient(%client, 'MsgClientReady', "", %game.class); for(%i = 1; %i <= %game.numTeams; %i++) { messageClient(%client, 'MsgDnDAddTeam', "", %i, %game.getTeamName(%i), $teamScore[%i], %game.getScoreLimit(%i), -1, -1); } %game.populateTeamRankArray(%client); messageClient(%client, 'MsgYourRankIs', "", -1); messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); DefaultGame::clientMissionDropReady(%game, %client); } function DnDGame::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 DnDGame::getTeamSkin(%game, %team) { if($Host::tournamentMode) return $teamSkin[%team]; if(!$Host::useCustomSkins) { %terrain = MissionGroup.musicTrack; 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'; } if(%skin $= "") %skin = $teamSkin[%team]; } else %skin = $teamSkin[%team]; return %skin; } function DnDGame::getTeamName(%game, %team) { if($Host::tournamentMode) return $TeamName[%team]; if(!$Host::useCustomSkins) { %terrain = MissionGroup.musicTrack; 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 $= "") %name = $teamName[%team]; } else %name = $TeamName[%team]; return %name; } ///////////////////////////////////////////////////////////////////////////////////////// // Flip Flop Functions ////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// function DnDGame::startTimerPlayerFFCap(%game, %cl, %this) { cancel(%this.pCapThread); //stop the last owner from collecting a cap bonus %this.pCapThread = %game.schedule(%game.TIME_REQ_PLYR_CAP_BONUS, "awardScorePlayerFFCap", %cl, %this); cancel(%this.tCapThread); //stop the old owners from collecting any cap bonus %this.tCapThread = %game.schedule(%game.TIME_REQ_TEAM_CAP_BONUS, "awardScoreTeamFFCap", %this.team, %this); } function DnDGame::stopScoreTimers(%game) { // find all switches and cancel any timers associated with them %ffGroup = nameToId("MissionCleanup/FlipFlops"); if(%ffGroup <= 0) return; for(%i = 0; %i < %ffGroup.getCount(); %i++) { %curFF = %ffGroup.getObject(%i); cancel(%curFF.pCapThread); cancel(%curFF.tCapThread); } } function DnDGame::countFlips(%game) { return false; } function DnDGame::awardScorePlayerFFCap(%game, %cl, %this) { if(!($missionRunning)) return; %cl.flipFlopsCapped++; messageClient(%cl, 'msgFFDef', '\c0You received a %1 point bonus for holding the %2.', %game.SCORE_PER_PLYR_FLIPFLOP_CAP, %game.cleanWord(%this.name)); messageTeamExcept(%cl, 'msgFFDef', '\c0Teammate %1 received a %2 point bonus for holding the %3', %cl.name, %game.SCORE_PER_PLYR_FLIPFLOP_CAP, %game.cleanWord(%this.name)); %game.recalcScore(%cl); } function DnDGame::awardScoreTeamFFCap(%game, %team, %this) { if(!($missionRunning)) return; cancel(%this.tCapThread); $teamScore[%team]++; if(%this.prevTeam) $teamScore[%this.prevTeam]--; %this.prevTeam = %team; %game.checkScoreLimit(%team); } ///////////////////////////////////////////////////////////////////////////////////////// // Scoring Functions //////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// function DnDGame::checkScoreLimit(%game, %team) { // Since checkScore limit is called for every score, announce the team. if ($missionRunning) { if (%game.getTeamName(%team) $= 'Inferno') messageAll("", '~wvoice/announcer/ann.infscores.wav'); else if (%game.getTeamName(%team) $= 'Storm') messageAll("", '~wvoice/announcer/ann.stoscores.wav'); else if (%game.getTeamName(%team) $= 'Phoenix') messageAll("", '~wvoice/announcer/ann.pxscore.wav'); else if (%game.getTeamName(%team) $= 'Blood Eagle') messageAll("", '~wvoice/announcer/ann.bescore.wav'); else if (%game.getTeamName(%team) $= 'Diamond Sword') messageAll("", '~wvoice/announcer/ann.dsscore.wav'); else if (%game.getTeamName(%team) $= 'Starwolf') messageAll("", '~wvoice/announcer/ann.swscore.wav'); } // Update everyones objective hud. for(%i = 1; %i <= %game.numTeams; %i++) messageAll('MsgDnDTeamScores', "", %i, %game.getTeamName(%i), $teamScore[%i], %game.getScoreLimit(%i), -1, -1, -1); %scoreLimit = %game.getScoreLimit(%team); if($teamScore[%team] >= %scoreLimit) %game.scoreLimitReached(); } function DnDGame::getScoreLimit(%game, %team) { // If we ever have more then two teams this must be changed. %otherTeam = %team == 1 ? 2 : 1; return $numObjectives[%otherTeam]; } function DnDGame::timeLimitReached(%game) { logEcho("game over (timelimit)"); %game.gameOver(); cycleMissions(); } function DnDGame::scoreLimitReached(%game) { logEcho("game over (scorelimit)"); %game.gameOver(); cycleMissions(); } function DnDGame::gameOver(%game) { // call the default DefaultGame::gameOver(%game); // stop all bonus timers %game.stopScoreTimers(); //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 ( %team = 1; %team <= %game.numTeams; %team++ ) { $TeamScore[%team] = 0; $numObjectives[%team] = 0; } } function DnDGame::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); } function DnDGame::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); %cl.offenseScore = %killPoints + %cl.suicides * %game.SCORE_PER_SUICIDE + %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + %cl.teamKills * %game.SCORE_PER_TEAMKILL + %cl.tkDestroys * %game.SCORE_PER_TK_DESTROY + %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.AStationDestroys * %game.SCORE_PER_DESTROY_ASTATION + %cl.vstationDestroys * %game.SCORE_PER_DESTROY_VSTATION + %cl.TStationDestroys * %game.SCORE_PER_DESTROY_TSTATION + %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.flipFlopsCapped * %game.SCORE_PER_PLYR_FLIPFLOP_CAP + %cl.vehicleScore + %cl.vehicleBonus; %cl.defenseScore = %cl.genDefends * %game.SCORE_PER_OBJECT_DEFEND + %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.AStationRepairs * %game.SCORE_PER_REPAIR_ASTATION + %cl.VStationRepairs * %game.SCORE_PER_REPAIR_VSTATION + %cl.TStationRepairs * %game.SCORE_PER_REPAIR_TSTATION + %cl.solarRepairs * %game.SCORE_PER_REPAIR_SOLAR + %cl.sentryRepairs * %game.SCORE_PER_REPAIR_SENTRY + %cl.depStationRepairs * %game.SCORE_PER_REPAIR_DEP_SENSOR + %cl.depInvRepairs * %game.SCORE_PER_REPAIR_DEP_INV + %cl.depTurretRepairs * %game.SCORE_PER_REPAIR_DEP_TUR; %cl.score = mFloor(%cl.offenseScore + %cl.defenseScore); %game.recalcTeamRanks(%cl); } function DnDGame::resetScore(%game, %client) { %client.kills = 0; %client.deaths = 0; %client.suicides = 0; %client.teamKills = 0; %client.tkDestroys = 0; %client.genDestroys = 0; %client.sensorDestroys = 0; %client.turretDestroys = 0; %client.IStationDestroys = 0; %client.AStationDestroys = 0; %client.vstationDestroys = 0; %client.TStationDestroys = 0; %client.solarDestroys = 0; %client.sentryDestroys = 0; %client.depSensorDestroys = 0; %client.depTurretDestroys = 0; %client.depStationDestroys = 0; %client.vehicleScore = 0; %client.vehicleBonus = 0; %client.flipFlopsCapped = 0; %client.offenseScore = 0; %client.objDefends = 0; %client.turretKills = 0; %client.mannedTurretKills = 0; %client.genRepairs = 0; %client.sensorRepairs = 0; %client.turretRepairs = 0; %client.stationRepairs = 0; %client.AStationRepairs = 0; %client.VStationRepairs = 0; %client.TStationRepairs = 0; %client.solarRepairs = 0; %client.sentryRepairs = 0; %client.sentryRepairs = 0; %client.depStationRepairs = 0; %client.depInvRepairs = 0; %client.defenseScore = 0; %client.score = 0; %client.outOfBounds = ""; } function DnDGame::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.testObjectDefend(%clVictim, %clKiller)) %game.awardScoreObjectDefend(%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 DnDGame::vehicleDestroyed(%game, %vehicle, %destroyer) { //vehicle name %data = %vehicle.getDataBlock(); //%vehicleType = getTaggedString(%data.targetNameTag) SPC getTaggedString(%data.targetTypeTag); %vehicleType = getTaggedString(%data.targetTypeTag); if(%vehicleType !$= "MPB") %vehicleType = strlwr(%vehicleType); %enemyTeam = ( %destroyer.team == 1 ) ? 2 : 1; %scorer = 0; %multiplier = 1; %passengers = 0; for(%i = 0; %i < %data.numMountPoints; %i++) if(%vehicle.getMountNodeObject(%i)) %passengers++; //what destroyed this vehicle if(%destroyer.client) { //it was a player, or his mine, satchel, whatever... %destroyer = %destroyer.client; %scorer = %destroyer; // determine if the object used was a mine if(%vehicle.lastDamageType == $DamageType::Mine) %multiplier = 2; } else if(%destroyer.getClassName() $= "Turret") { if(%destroyer.getControllingClient()) { //manned turret %destroyer = %destroyer.getControllingClient(); %scorer = %destroyer; } else { %destroyerName = "A turret"; %multiplier = 0; } } else if(%destroyer.getDataBlock().catagory $= "Vehicles") { // Vehicle vs vehicle kill! if(%name $= "BomberFlyer" || %name $= "AssaultVehicle") %gunnerNode = 1; else %gunnerNode = 0; if(%destroyer.getMountNodeObject(%gunnerNode)) { %destroyer = %destroyer.getMountNodeObject(%gunnerNode).client; %scorer = %destroyer; } %multiplier = 3; } else // Is there anything else we care about? return; if(%destroyerName $= "") %destroyerName = %destroyer.name; if(%vehicle.team == %destroyer.team) // team kill { %pref = (%vehicleType $= "Assault Tank") ? "an" : "a"; messageAll( 'msgVehicleTeamDestroy', '\c0%1 TEAMKILLED %3 %2!', %destroyerName, %vehicleType, %pref); } else // legit kill { //messageTeamExcept(%destroyer, 'msgVehicleDestroy', '\c0%1 destroyed an enemy %2.', %destroyerName, %vehicleType); teamDestroyMessage(%destroyer, 'msgVehDestroyed', '\c5%1 destroyed an enemy %2!', %destroyerName, %vehicleType); // z0dd - ZOD, 8/20/02. Send teammates a destroy message messageTeam(%enemyTeam, 'msgVehicleDestroy', '\c0%1 destroyed your team\'s %2.', %destroyerName, %vehicleType); //messageClient(%destroyer, 'msgVehicleDestroy', '\c0You destroyed an enemy %1.', %vehicleType); if(%scorer) { %value = %game.awardScoreVehicleDestroyed(%scorer, %vehicleType, %multiplier, %passengers); %game.shareScore(%value); } } } function DnDGame::awardScoreVehicleDestroyed(%game, %client, %vehicleType, %mult, %passengers) { if(%vehicleType $= "Grav Cycle") %base = %game.SCORE_PER_DESTROY_WILDCAT; else if(%vehicleType $= "Assault Tank") %base = %game.SCORE_PER_DESTROY_TANK; else if(%vehicleType $= "MPB") %base = %game.SCORE_PER_DESTROY_MPB; else if(%vehicleType $= "Turbograv") %base = %game.SCORE_PER_DESTROY_SHRIKE; else if(%vehicleType $= "Bomber") %base = %game.SCORE_PER_DESTROY_BOMBER; else if(%vehicleType $= "Heavy Transport") %base = %game.SCORE_PER_DESTROY_TRANSPORT; %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 DnDGame::shareScore(%game, %client, %amount) { //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 DnDGame::testObjectDefend(%game, %victimID, %killerID) { InitContainerRadiusSearch(%victimID.plyrPointOfDeath, %game.RADIUS_OBJECT_DEFENSE, $TypeMasks::StaticShapeObjectType); %objID = containerSearchNext(); while(%objID != 0) { if((%objID.scoreValue && !%objID.objectiveCompleted) && (%objID.team == %killerID.team)) return true; //found the(a) killer's objective near the victim's point of death else %objID = containerSearchNext(); } return false; // didn't find a qualifying objective within required radius of victims point of death } function DnDGame::awardScoreObjectDefend(%game, %killerID) { %killerID.objDefends++; messageClient(%killerID, 'msgObjDef', '\c0You received a %1 point bonus for defending an objective.', %game.SCORE_PER_OBJECT_DEFEND); messageTeamExcept(%killerID, 'msgObjDef', '\c0Teammate %1 received a %2 point bonus for defending an objective.', %killerID.name, %game.SCORE_PER_OBJECT_DEFEND); %game.recalcScore(%killerID); return %game.SCORE_PER_OBJECT_DEFEND; } ///////////////////////////////////////////////////////////////////////////////////////// // Destroy Scoring Functions //////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// function DnDGame::awardScoreTkDestroy(%game, %cl, %obj) { %cl.tkDestroys++; teamDestroyMessage(%cl, 'msgTkDes', '\c5Teammate %1 destroyed your team\'s %3 objective!', %cl.name, %game.cleanWord(%obj.getDataBlock().targetTypeTag)); messageClient(%cl, 'msgTkDes', '\c0You have been penalized %1 points for destroying your teams equiptment.', %game.SCORE_PER_TK_DESTROY); %game.recalcScore(%cl); %game.shareScore(%cl, %game.SCORE_PER_TK_DESTROY); } function DnDGame::awardScoreStaticShapeDestroy(%game, %cl, %obj) { %dataName = %obj.getDataBlock().getName(); switch$ ( %dataName ) { case "GeneratorLarge": %cl.genDestroys++; %value = %game.SCORE_PER_DESTROY_GEN; %msgType = 'msgGenDes'; %tMsg = '\c5%1 destroyed a %2 Generator!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy generator.'; case "SolarPanel": %cl.solarDestroys++; %value = %game.SCORE_PER_DESTROY_SOLAR; %msgType = 'msgSolarDes'; %tMsg = '\c5%1 destroyed a %2 Solar Panel!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy solar panel.'; case "SensorLargePulse": %cl.sensorDestroys++; %value = %game.SCORE_PER_DESTROY_SENSOR; %msgType = 'msgSensorDes'; %tMsg = '\c5%1 destroyed a %2 Sensor!'; %clMsg = '\c0You received a %1 point bonus for destroying a large enemy pulse sensor.'; case "SensorMediumPulse": %cl.sensorDestroys++; %value = %game.SCORE_PER_DESTROY_SENSOR; %msgType = 'msgSensorDes'; %tMsg = '\c5%1 destroyed a %2 Sensor!'; %clMsg = '\c0You received a %1 point bonus for destroying a medium enemy pulse sensor.'; case "TurretBaseLarge": %cl.turretDestroys++; %value = %game.SCORE_PER_DESTROY_TURRET; %msgType = 'msgTurretDes'; %tMsg = '\c5%1 destroyed a %2 Turret!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy base turret.'; case "StationInventory": %cl.IStationDestroys++; %value = %game.SCORE_PER_DESTROY_GEN; %msgType = 'msgInvDes'; %tMsg = '\c5%1 destroyed a %2 Inventory Station!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy inventory station.'; case "StationAmmo": %cl.aStationDestroys++; %value = %game.SCORE_PER_DESTROY_ASTATION; %msgType = 'msgAmmoDes'; %tMsg = '\c5%1 destroyed a % 2 Ammo Station!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy ammo station.'; case "StationVehicle": %cl.VStationDestroys++; %value = %game.SCORE_PER_DESTROY_VSTATION; %msgType = 'msgVSDes'; %tMsg = '\c5%1 destroyed a Vehicle Station!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy vehicle station.'; case "SentryTurret": %cl.sentryDestroys++; %value = %game.SCORE_PER_DESTROY_SENTRY; %msgType = 'msgSentryDes'; %tMsg = '\c5%1 destroyed a %2 Sentry Turret!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy sentry turret.'; case "DeployedMotionSensor": %cl.depSensorDestroys++; %value = %game.SCORE_PER_DESTROY_DEP_SENSOR; %msgType = 'msgDepSensorDes'; %tMsg = '\c5%1 destroyed a Deployable Motion Sensor!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy deployable motion sensor.'; case "DeployedPulseSensor": %cl.depSensorDestroys++; %value = %game.SCORE_PER_DESTROY_DEP_SENSOR; %msgType = 'msgDepSensorDes'; %tMsg = '\c5%1 destroyed a Deployable Pulse Sensor!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy deployable pulse sensor.'; case "TurretDeployedWallIndoor": %cl.depTurretDestroys++; %value = %game.SCORE_PER_DESTROY_DEP_TUR; %msgType = 'msgDepTurDes'; %tMsg = '\c5%1 destroyed a Deployable Spider Clamp Turret!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy deployable spider clamp turret.'; case "TurretDeployedFloorIndoor": %cl.depTurretDestroys++; %value = %game.SCORE_PER_DESTROY_DEP_TUR; %msgType = 'msgDepTurDes'; %tMsg = '\c5%1 destroyed a Deployable Spider Clamp Turret!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy deployable spider clamp turret.'; case "TurretDeployedCeilingIndoor": %cl.depTurretDestroys++; %value = %game.SCORE_PER_DESTROY_DEP_TUR; %msgType = 'msgDepTurDes'; %tMsg = '\c5%1 destroyed a Deployable Spider Clamp Turret!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy deployable spider clamp turret.'; case "TurretDeployedOutdoor": %cl.depTurretDestroys++; %value = %game.SCORE_PER_DESTROY_DEP_TUR; %msgType = 'msgDepTurDes'; %tMsg = '\c5%1 destroyed a Deployable Landspike Turret!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy deployable landspike turret.'; case "DeployedStationInventory": %cl.depStationDestroys++; %value = %game.SCORE_PER_DESTROY_DEP_INV; %msgType = 'msgDepInvDes'; %tMsg = '\c5%1 destroyed a Deployable Inventory!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy deployable inventory station.'; case "MPBTeleporter": %cl.TStationDestroys++; %value = %game.SCORE_PER_DESTROY_TSTATION; %msgType = 'msgMPBTeleDes'; %tMsg = '\c5%1 destroyed a MPB Teleport Station!'; %clMsg = '\c0You received a %1 point bonus for destroying an enemy MPB teleport station.'; default: return; } teamDestroyMessage(%cl, 'msgDestroyed', %tMsg, %cl.name, %obj.nameTag); // z0dd - ZOD, 8/20/02. Send teammates a destroy message messageClient(%cl, %msgType, %clMsg, %value, %dataName); %game.recalcScore(%cl); %game.shareScore(%scorer, %value); } function DnDGame::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 DnDGame::testKill(%game, %victimID, %killerID) { return ((%killerID != 0) && (%victimID.team != %killerID.team)); } function DnDGame::awardScoreKill(%game, %killerID) { %killerID.kills++; %game.recalcScore(%killerID); return %game.SCORE_PER_KILL; } ///////////////////////////////////////////////////////////////////////////////////////// // Repair Scoring Functions ///////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// function DnDGame::testValidRepair(%game, %obj) { if(!%obj.wasDisabled) return false; else if(%obj.lastDamagedByTeam == %obj.team) return false; else if(%obj.team != %obj.repairedBy.team) return false; else { if(%obj.soiledByEnemyRepair) %obj.soiledByEnemyRepair = false; return true; } } function DnDGame::objectRepaired(%game, %obj, %objName) { %game.staticShapeOnRepaired(%obj, %objName); %obj.wasDisabled = false; } function DnDGame::staticShapeOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; %dataName = %obj.getDataBlock().getName(); switch$ (%dataName) { case "GeneratorLarge": %repairman.genRepairs++; %score = %game.SCORE_PER_REPAIR_GEN; %tMsgType = 'msgGenRepaired'; %msgType = 'msgGenRep'; %tMsg = '\c0%1 repaired the %2 Generator!'; %clMsg = '\c0You received a %1 point bonus for repairing a generator.'; case "SolarPanel": %repairman.solarRepairs++; %score = %game.SCORE_PER_REPAIR_SOLAR; %tMsgType = 'msgsolarRepaired'; %msgType = 'msgsolarRep'; %tMsg = '\c0%1 repaired the %2 Solar Panel!'; %clMsg = '\c0You received a %1 point bonus for repairing a solar panel.'; case "SensorLargePulse": %repairman.sensorRepairs++; %score = %game.SCORE_PER_REPAIR_SENSOR; %tMsgType = 'msgSensorRepaired'; %msgType = 'msgSensorRep'; %tMsg = '\c0%1 repaired the %2 Large Pulse Sensor!'; %clMsg = '\c0You received a %1 point bonus for repairing a large pulse sensor.'; case "SensorMediumPulse": %repairman.sensorRepairs++; %score = %game.SCORE_PER_REPAIR_SENSOR; %tMsgType = 'msgSensorRepaired'; %msgType = 'msgSensorRep'; %tMsg = '\c0%1 repaired the %2 Medium Pulse Sensor!'; %clMsg = '\c0You received a %1 point bonus for repairing a medium pulse sensor.'; case "DeployedMotionSensor": %repairman.depSensorRepairs++; %tMsgType = 'msgDepSensorRepaired'; %msgType = 'msgDepSensorRep'; %score = %game.SCORE_PER_REPAIR_DEP_SENSOR; %tMsg = '\c0%1 repaired a Deployed Motion Sensor!'; %clMsg = '\c0You received a %1 point bonus for repairing a deployed motion sensor.'; case "DeployedPulseSensor": %repairman.depSensorRepairs++; %score = %game.SCORE_PER_REPAIR_DEP_SENSOR; %tMsgType = 'msgDepSensorRepaired'; %msgType = 'msgDepSensorRep'; %tMsg = '\c0%1 repaired a Deployed Pulse Sensor!'; %clMsg = '\c0You received a %1 point bonus for repairing a deployed pulse sensor.'; case "StationInventory": %repairman.stationRepairs++; %score = %game.SCORE_PER_REPAIR_ISTATION; %tMsgType = 'msgStationRepaired'; %msgType = 'msgIStationRep'; %tMsg = '\c0%1 repaired the %2 Inventory Station!'; %clMsg = '\c0You received a %1 point bonus for repairing a inventory station.'; case "StationAmmo": %repairman.stationRepairs++; %score = %game.SCORE_PER_REPAIR_ASTATION; %tMsgType = 'msgStationRepaired'; %msgType = 'msgAStationRep'; %tMsg = '\c0%1 repaired the %2 Ammo Station!'; %clMsg = '\c0You received a %1 point bonus for repairing a ammo station.'; case "StationVehicle": %repairman.VStationRepairs++; %score = %game.SCORE_PER_REPAIR_VSTATION; %tMsgType = 'msgvstationRepaired'; %msgType = 'msgVStationRep'; %tMsg = '\c0%1 repaired the Vehicle Station!'; %clMsg = '\c0You received a %1 point bonus for repairing a vehicle station.'; case "TurretBaseLarge": %repairman.TurretRepairs++; %score = %game.SCORE_PER_REPAIR_TURRET; %tMsgType = 'msgTurretRepaired'; %msgType = 'msgTurretRep'; %tMsg = '\c0%1 repaired the %2 Turret!'; %clMsg = '\c0You received a %1 point bonus for repairing a base turret.'; case "SentryTurret": %repairman.sentryRepairs++; %score = %game.SCORE_PER_REPAIR_SENTRY; %tMsgType = 'msgsentryTurretRepaired'; %msgType = 'msgSentryRep'; %tMsg = '\c0%1 repaired the %2 Sentry Turret!'; %clMsg = '\c0You received a %1 point bonus for repairing a sentry turret.'; case "TurretDeployedWallIndoor": %repairman.depTurretRepairs++; %score = %game.SCORE_PER_REPAIR_DEP_TUR; %tMsgType = 'msgDepTurretRepaired'; %msgType = 'msgDepTurretRep'; %tMsg = '\c0%1 repaired a Spider Clamp Turret!'; %clMsg = '\c0You received a %1 point bonus for repairing a deployable spider clamp turret.'; case "TurretDeployedFloorIndoor": %repairman.depTurretRepairs++; %score = %game.SCORE_PER_REPAIR_DEP_TUR; %tMsgType = 'msgDepTurretRepaired'; %msgType = 'msgDepTurretRep'; %tMsg = '\c0%1 repaired a Spider Clamp Turret!'; %clMsg = '\c0You received a %1 point bonus for repairing a deployable spider clamp turret.'; case "TurretDeployedCeilingIndoor": %repairman.depTurretRepairs++; %score = %game.SCORE_PER_REPAIR_DEP_TUR; %tMsgType = 'msgDepTurretRepaired'; %msgType = 'msgDepTurretRep'; %tMsg = '\c0%1 repaired a Spider Clamp Turret!'; %clMsg = '\c0You received a %1 point bonus for repairing a deployable spider clamp turret.'; case "TurretDeployedOutdoor": %repairman.depTurretRepairs++; %score = %game.SCORE_PER_REPAIR_DEP_TUR; %tMsgType = 'msgDepTurretRepaired'; %msgType = 'msgDepTurretRep'; %tMsg = '\c0%1 repaired a Landspike Turret!'; %clMsg = '\c0You received a %1 point bonus for repairing a deployable landspike turret.'; case "DeployedStationInventory": %repairman.depInvRepairs++; %score = %game.SCORE_PER_REPAIR_DEP_INV; %tMsgType = 'msgDepInvRepaired'; %msgType = 'msgDepInvRep'; %tMsg = '\c0%1 repaired a Deployable Inventory!'; %clMsg = '\c0You received a %1 point bonus for repairing a deployed inventory station.'; case "MPBTeleporter": %repairman.TStationRepairs++; %score = %game.SCORE_PER_REPAIR_TSTATION; %tMsgType = 'msgMPBTeleRepaired'; %msgType = 'msgMPBTeleRep'; %tMsg = '\c0%1 repaired the MPB Teleporter Station!'; %clMsg = '\c0You received a %1 point bonus for repairing a mpb teleporter station.'; default: return; } teamRepairMessage(%repairman, %tMsgType, %tMsg, %repairman.name, %obj.nameTag); messageClient(%repairman, %msgType, %clMsg, %score, %dataName); %game.recalcScore(%repairman); } } ///////////////////////////////////////////////////////////////////////////////////////// // Misc Functions ////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////// function DnDGame::enterMissionArea(%game, %playerData, %player) { %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"); cancel(%player.alertThread); } function DnDGame::leaveMissionArea(%game, %playerData, %player) { if(%player.getState() $= "Dead") return; %player.client.outOfBounds = true; messageClient(%player.client, 'LeaveMissionArea', '\c1You have left the mission area. Return or take damage.~wfx/misc/warning_beep.wav'); logEcho(%player.client.nameBase @ " (pl " @ %player @ "/cl " @ %player.client @ ") left mission area"); %player.alertThread = %game.schedule(1000, "DMAlertPlayer", 3, %player); } function DnDGame::DMAlertPlayer(%game, %count, %player) { // MES - I commented below line out because it prints a blank line to chat window //messageClient(%player.client, 'MsgDMLeftMisAreaWarn', '~wfx/misc/red_alert.wav'); if(%count > 1) %player.alertThread = %game.schedule(1000, "DMAlertPlayer", %count - 1, %player); else %player.alertThread = %game.schedule(1000, "MissionAreaDamage", %player); } function DnDGame::MissionAreaDamage(%game, %player) { if(%player.getState() !$= "Dead") { %player.setDamageFlash(0.1); %prevHurt = %player.getDamageLevel(); %player.setDamageLevel(%prevHurt + 0.05); %player.alertThread = %game.schedule(1000, "MissionAreaDamage", %player); } else { if(%player.alertThread !$= "") { cancel(%player.alertThread); %player.alertThread = ""; } if(%player.client.team != 0) { %game.onClientKilled(%player.client, 0, $DamageType::OutOfBounds); } } } function DnDGame::applyConcussion(%game, %player) { %player.throwPack(); %player.throwWeapon(); } PK !(L;@@scripts/EditChatMenuGui.cs//------------------------------------------------------------------------------ // // EditChatMenuGui.cs // //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function EditChatMenuGui::onWake( %this ) { fillChatMenuTree(); } //------------------------------------------------------------------------------ function EditChatMenuGui::onSleep( %this ) { chatMenuGuiTree.clear(); } //------------------------------------------------------------------------------ function fillChatMenuTree() { %guiRoot = chatMenuGuiTree.getFirstRootItem(); %newGuiId = chatMenuGuiTree.insertItem( %guiRoot, "CHAT MENU ROOT", 0 ); traverseChatMenu( %newGuiId, $RootChatMenu ); chatMenuGuiTree.expandItem( %newGuiId ); chatMenuGuiTree.selectItem( %newGuiId ); chatMenuGuiTree.dirty = false; } //------------------------------------------------------------------------------ function traverseChatMenu( %guiID, %menu ) { for ( %i = 0; %i < %menu.optionCount; %i++ ) { %text = %menu.option[%i]; if ( %menu.isMenu[%i] ) { //echo( "** add menu item \"" @ %menu.option[%i] @ "\" **" ); %newGuiID = chatMenuGuiTree.insertItem( %guiID, %text, 0 ); traverseChatMenu( %newGuiID, %menu.command[%i] ); } else { //echo( "** add command item \"" @ %menu.option[%i] @ "\" (" @ %menu.command[%i] @ ") **" ); %temp = %menu.command[%i]; %cmdId = getSubStr( %temp, 1, strlen( temp ) - 1 ); %commandName = $ChatTable[%cmdId].name; %text = %text @ " - ( " @ %commandName @ " )"; chatMenuGuiTree.insertItem( %guiID, %text, %cmdId ); } } } //------------------------------------------------------------------------------ function newChatMenu() { chatMenuGuiTree.clear(); %guiRoot = chatMenuGuiTree.getFirstRootItem(); chatMenuGuiTree.insertItem( %guiRoot, "CHAT MENU ROOT", 0 ); chatMenuGuiTree.dirty = true; } //------------------------------------------------------------------------------ function saveChatMenu() { //getSaveFilename( "prefs/chatMenu/*.cs", doSaveChatMenu ); doSaveChatMenu( "customVoiceBinds.cs" ); } //------------------------------------------------------------------------------ function resetChatMenu() { doLoadChatMenu( "scripts/voiceBinds.cs" ); } //------------------------------------------------------------------------------ //function loadChatMenu() //{ // getLoadFilename( "prefs/chatMenu/*.cs", doLoadChatMenu ); //} //------------------------------------------------------------------------------ function doSaveChatMenu( %filename ) { %filename = fileBase( %filename ); if ( %filename $= "" ) return; new fileObject( "saveFile" ); saveFile.openForWrite( "prefs/" @ %filename @ ".cs" ); // Write a little header... saveFile.writeLine( "//------------------------------------------------------------------------------" ); saveFile.writeLine( "//" ); saveFile.writeLine( "// Tribes 2 voice chat menu." ); saveFile.writeLine( "//" ); saveFile.writeLine( "//------------------------------------------------------------------------------" ); saveFile.writeLine( " " ); // Fire off the tree-traversing write function: %rootItem = chatMenuGuiTree.getFirstRootItem(); writeTreeNode( saveFile, chatMenuGuiTree.getChild( %rootItem ) ); saveFile.close(); saveFile.delete(); chatMenuGuiTree.dirty = false; MessageBoxOK( "SAVED", "Save successful." ); } //------------------------------------------------------------------------------ function writeTreeNode( %file, %item ) { %temp = chatMenuGuiTree.getItemText( %item ); %key = getSubStr( firstWord( %temp ), 0, 1 ); %text = restWords( %temp ); %command = chatMenuGuiTree.getItemValue( %item ); if ( strcmp( %command, "0" ) == 0 ) { %file.writeLine( "startChatMenu( \"" @ %key @ " " @ %text @ "\" );" ); %child = chatMenuGuiTree.getChild( %item ); if ( %child ) writeTreeNode( %file, %child ); %file.writeLine( "endChatMenu(); // " @ %text ); } else { // Clip the command text off of the string: %cmdName = $ChatTable[%command].name; %text = getSubStr( %text, 0, strlen( %text ) - strlen( %cmdName ) - 7 ); %file.writeLine( "addChat( \"" @ %key @ " " @ %text @ "\", '" @ %cmdName @ "' );" ); } %sibling = chatMenuGuiTree.getNextSibling( %item ); if ( %sibling != 0 ) writeTreeNode( %file, %sibling ); } //------------------------------------------------------------------------------ function doLoadChatMenu( %filename ) { // Clear existing chat menu: chatMenuGuiTree.clear(); // Load the file... activateChatMenu( %filename ); fillChatMenuTree(); } //------------------------------------------------------------------------------ function chatMenuGuiTree::onRightMouseDown( %this, %item, %pos ) { // launch the action menu... chatMenuGuiTree.selectItem( %item ); ChatMenuItemActionPopup.awaken( %item, %pos ); } //------------------------------------------------------------------------------ function editSelectedChatMenuItem() { %item = chatMenuGuiTree.getSelectedItem(); if ( %item != chatMenuGuiTree.getFirstRootItem() ) { %temp = chatMenuGuiTree.getItemText( %item ); if ( strlen( %temp ) > 0 ) { %key = getSubStr( firstWord( %temp ), 0, 1 ); %text = restWords( %temp ); %command = chatMenuGuiTree.getItemValue( %item ); if ( %command $= "0" ) editChatMenu( %key, %text, "doEditChatMenu" ); else { %temp = strlen( $ChatTable[%command].name ) + 7; %text = getSubStr( %text, 0, strlen( %text ) - %temp ); editChatCommand( %key, %text, %command, "doEditChatCommand" ); } } } } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function ChatMenuItemActionPopup::awaken( %this, %item, %pos ) { %this.position = %pos; %this.clear(); %treeRoot = chatMenuGuiTree.getFirstRootItem(); %isMenu = ( strcmp( chatMenuGuiTree.getItemValue( %item ), "0" ) == 0 ); if ( %item != %treeRoot ) %this.addEntry( "Edit", 0 ); if ( %isMenu ) { %this.addEntry( "Add menu", 1 ); %this.addEntry( "Add command", 2 ); } if ( chatMenuGuiTree.getPrevSibling( %item ) ) %this.addEntry( "Move up", 3 ); if ( chatMenuGuiTree.getNextSibling( %item ) ) %this.addEntry( "Move down", 4 ); if ( %item != %treeRoot ) %this.addEntry( "Delete", 5 ); if ( %this.numEntries == 0 ) return; Canvas.pushDialog( ChatMenuItemActionDlg ); %this.forceOnAction(); } //------------------------------------------------------------------------------ function ChatMenuItemActionPopup::addEntry( %this, %text, %id ) { %this.numEntries++; %this.add( %text, %id ); } //------------------------------------------------------------------------------ function ChatMenuItemActionPopup::reset( %this ) { %this.numEntries = 0; %this.forceClose(); Canvas.popDialog( ChatMenuItemActionDlg ); } //------------------------------------------------------------------------------ function ChatMenuItemActionPopup::onSelect( %this, %id, %text ) { %item = chatMenuGuiTree.getSelectedItem(); switch ( %id ) { case 0: // Edit %temp = chatMenuGuiTree.getItemText( %item ); %key = getSubStr( firstWord( %temp ), 0, 1 ); %text = restWords( %temp ); %command = chatMenuGuiTree.getItemValue( %item ); if ( strcmp( %command, "0" ) == 0 ) editChatMenu( %key, %text, "doEditChatMenu" ); else { // Strip the command name from the text: %temp = strlen( $ChatTable[%command].name ) + 7; %text = getSubStr( %text, 0, strlen( %text ) - %temp ); editChatCommand( %key, %text, %command, "doEditChatCommand" ); } case 1: // Add menu editChatMenu( "", "", "doNewChatMenu" ); case 2: // Add command editChatCommand( "", "", "", "doNewChatCommand" ); case 3: // Move up chatMenuGuiTree.moveItemUp( %item ); chatMenuGuiTree.dirty = true; case 4: // Move down %nextItem = chatMenuGuiTree.getNextSibling( %item ); chatMenuGuiTree.moveItemUp( %nextItem ); chatMenuGuiTree.dirty = true; case 5: // Delete chatMenuGuiTree.removeItem( %item ); chatMenuGuiTree.dirty = true; } %this.reset(); } //------------------------------------------------------------------------------ function ChatMenuItemActionPopup::onCancel( %this ) { %this.reset(); } //------------------------------------------------------------------------------ function editChatMenu( %key, %text, %callback ) { $ECI::key = %key; $ECI::text = %text; $ECI::OKCommand = %callback @ "($ECI::key, $ECI::text);"; Canvas.pushDialog( EditChatMenuDlg ); } //------------------------------------------------------------------------------ function editChatCommand( %key, %text, %command, %callback ) { $ECI::key = %key; $ECI::text = %text; $ECI::command = %command; $ECI::OKCommand = %callback @ "($ECI::key, $ECI::text, $ECI::command);"; Canvas.pushDialog( EditChatCommandDlg ); } //------------------------------------------------------------------------------ function doEditChatMenu( %key, %text ) { if ( strlen( %key ) && strlen( %text ) ) { Canvas.popDialog( EditChatMenuDlg ); %item = chatMenuGuiTree.getSelectedItem(); %newText = %key @ ": " @ %text; chatMenuGuiTree.editItem( %item, %newText, "0" ); checkSiblings( %item ); chatMenuGuiTree.dirty = true; } //else // WARN } //------------------------------------------------------------------------------ function doEditChatCommand( %key, %text, %command ) { if ( strlen( %key ) && strlen( %text ) && isObject( $ChatTable[%command] ) ) { Canvas.popDialog( EditChatCommandDlg ); %item = chatMenuGuiTree.getSelectedItem(); %newText = %key @ ": " @ %text @ " - ( " @ $ChatTable[%command].name @ " )"; chatMenuGuiTree.editItem( %item, %newText, %command ); checkSiblings( %item ); chatMenuGuiTree.dirty = true; } //else // WARN } //------------------------------------------------------------------------------ function doNewChatMenu( %key, %text ) { if ( strlen( %key ) && strlen( %text ) ) { Canvas.popDialog( EditChatMenuDlg ); %item = chatMenuGuiTree.getSelectedItem(); %newText = %key @ ": " @ %text; %newItem = chatMenuGuiTree.insertItem( %item, %newText, "0" ); chatMenuGuiTree.expandItem( %item ); chatMenuGuiTree.selectItem( %newItem ); checkSiblings( %newItem ); chatMenuGuiTree.dirty = true; } //else // WARN } //------------------------------------------------------------------------------ function doNewChatCommand( %key, %text, %command ) { if ( strlen( %key ) && strlen( %text ) && isObject( $ChatTable[%command] ) ) { Canvas.popDialog( EditChatCommandDlg ); %item = chatMenuGuiTree.getSelectedItem(); %newText = %key @ ": " @ %text @ " - ( " @ $ChatTable[%command].name @ " )"; %newItem = chatMenuGuiTree.insertItem( %item, %newText, %command ); chatMenuGuiTree.expandItem( %item ); chatMenuGuiTree.selectItem( %newItem ); checkSiblings( %newItem ); chatMenuGuiTree.dirty = true; } //else // WARN } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function EditChatMenuDlg::onWake( %this ) { } //------------------------------------------------------------------------------ function EditChatCommandDlg::onWake( %this ) { // Fill the command popup list: EditChatCommandList.clear(); for ( %i = $MinChatItemId; %i <= $MaxChatItemId; %i++ ) { if ( isObject( $ChatTable[%i] ) ) EditChatCommandList.add( $ChatTable[%i].name, %i ); } EditChatCommandList.sort( true ); // Select the current command: if ( isObject( $ChatTable[$ECI::command] ) ) { EditChatCommandList.setSelected( $ECI::command ); EditChatCommandMessage.setText( $ChatTable[$ECI::command].text ); ChatCommandTestBtn.setVisible( true ); } else { EditChatCommandList.setText( "Select command" ); EditChatCommandMessage.setText( " " ); ChatCommandTestBtn.setVisible( false ); } } //------------------------------------------------------------------------------ function EditChatCommandList::onSelect( %this, %index, %value ) { $ECI::command = %index; EditChatCommandMessage.setText( $ChatTable[%index].text ); ChatCommandTestBtn.setVisible( true ); } //------------------------------------------------------------------------------ function checkSiblings( %item ) { %allClear = true; %sibling = chatMenuGuiTree.getPrevSibling( %item ); while ( %sibling != 0 ) { %siblingKey = getSubStr( firstWord( chatMenuGuiTree.getItemText( %sibling ) ), 0, 1 ); if ( %siblingKey $= $ECI::key ) { %allClear = false; break; } %sibling = chatMenuGuiTree.getPrevSibling( %sibling ); } if ( %allClear ) { %sibling = chatMenuGuiTree.getNextSibling( %item ); while ( %sibling != 0 ) { %siblingKey = getSubStr( firstWord( chatMenuGuiTree.getItemText( %sibling ) ), 0, 1 ); if ( %siblingKey $= $ECI::key ) { %allClear = false; break; } %sibling = chatMenuGuiTree.getNextSibling( %sibling ); } } if ( !%allClear ) { if ( chatMenuGuiTree.getItemValue( %item ) $= "0" ) %text1 = restWords( chatMenuGuiTree.getItemText( %item ) ); else { %temp = chatMenuGuiTree.getItemText( %item ); %text1 = getWords( %temp, 1, getWordCount( %temp ) - 5 ); } if ( chatMenuGuiTree.getItemValue( %sibling ) $= "0" ) %text2 = restWords( chatMenuGuiTree.getItemText( %sibling ) ); else { %temp = chatMenuGuiTree.getItemText( %sibling ); %text2 = getWords( %temp, 1, getWordCount( %temp ) - 5 ); } MessageBoxOK( "WARNING", "Menu siblings \"" @ %text1 @ "\" and \"" @ %text2 @ "\" are both bound to the \'" @ %siblingKey @ "\' key!" ); } return %allClear; } //------------------------------------------------------------------------------ function testChatCommand( %command ) { // Play the sound: if ( $pref::Player::Count > 0 ) %voiceSet = getField( $pref::Player[$pref::Player::Current], 3 ); else %voiceSet = "Male1"; ChatCommandTestBtn.setActive( false ); %wav = "voice/" @ %voiceSet @ "/" @ $ChatTable[%command].audioFile @ ".wav"; %handle = alxCreateSource( AudioChat, %wav ); alxPlay( %handle ); %delay = alxGetWaveLen( %wav ); schedule( %delay, 0, "restoreCommandTestBtn" ); } //------------------------------------------------------------------------------ function restoreCommandTestBtn() { ChatCommandTestBtn.setActive( true ); } //------------------------------------------------------------------------------ function leaveChatMenuEditor() { if ( chatMenuGuiTree.dirty ) MessageBoxYesNo( "CHANGES", "Do you want to save your changes?", "saveChatMenu(); reallyLeaveChatMenuEditor();", "reallyLeaveChatMenuEditor();" ); else reallyLeaveChatMenuEditor(); } //------------------------------------------------------------------------------ function reallyLeaveChatMenuEditor() { activateChatMenu( "prefs/customVoiceBinds.cs" ); Canvas.popDialog( EditChatMenuGui ); Canvas.pushDialog( OptionsDlg ); } PK !(H<<scripts/EditorGui.cs//----------------------------------------------------------------------------- // Torque Game Engine // // Copyright (c) 2001 GarageGames.Com //----------------------------------------------------------------------------- function EditorGui::getPrefs() { EWorldEditor.dropType = getPrefSetting($Pref::WorldEditor::dropType, "atCamera"); // same defaults as WorldEditor ctor EWorldEditor.planarMovement = getPrefSetting($pref::WorldEditor::planarMovement, true); EWorldEditor.undoLimit = getPrefSetting($pref::WorldEditor::undoLimit, 40); EWorldEditor.dropType = getPrefSetting($pref::WorldEditor::dropType, "screenCenter"); EWorldEditor.projectDistance = getPrefSetting($pref::WorldEditor::projectDistance, 2000); EWorldEditor.boundingBoxCollision = getPrefSetting($pref::WorldEditor::boundingBoxCollision, true); EWorldEditor.renderPlane = getPrefSetting($pref::WorldEditor::renderPlane, true); EWorldEditor.renderPlaneHashes = getPrefSetting($pref::WorldEditor::renderPlaneHashes, true); EWorldEditor.gridColor = getPrefSetting($pref::WorldEditor::gridColor, "255 255 255 20"); EWorldEditor.planeDim = getPrefSetting($pref::WorldEditor::planeDim, 500); EWorldEditor.gridSize = getPrefSetting($pref::WorldEditor::gridSize, "10 10 10"); EWorldEditor.renderPopupBackground = getPrefSetting($pref::WorldEditor::renderPopupBackground, true); EWorldEditor.popupBackgroundColor = getPrefSetting($pref::WorldEditor::popupBackgroundColor, "100 100 100"); EWorldEditor.popupTextColor = getPrefSetting($pref::WorldEditor::popupTextColor, "255 255 0"); EWorldEditor.selectHandle = getPrefSetting($pref::WorldEditor::selectHandle, "gui/Editor_SelectHandle.png"); EWorldEditor.defaultHandle = getPrefSetting($pref::WorldEditor::defaultHandle, "gui/Editor_DefaultHandle.png"); EWorldEditor.lockedHandle = getPrefSetting($pref::WorldEditor::lockedHandle, "gui/Editor_LockedHandle.png"); EWorldEditor.objectTextColor = getPrefSetting($pref::WorldEditor::objectTextColor, "255 255 255"); EWorldEditor.objectsUseBoxCenter = getPrefSetting($pref::WorldEditor::objectsUseBoxCenter, true); EWorldEditor.axisGizmoMaxScreenLen = getPrefSetting($pref::WorldEditor::axisGizmoMaxScreenLen, 200); EWorldEditor.axisGizmoActive = getPrefSetting($pref::WorldEditor::axisGizmoActive, true); EWorldEditor.mouseMoveScale = getPrefSetting($pref::WorldEditor::mouseMoveScale, 0.2); EWorldEditor.mouseRotateScale = getPrefSetting($pref::WorldEditor::mouseRotateScale, 0.01); EWorldEditor.mouseScaleScale = getPrefSetting($pref::WorldEditor::mouseScaleScale, 0.01); EWorldEditor.minScaleFactor = getPrefSetting($pref::WorldEditor::minScaleFactor, 0.1); EWorldEditor.maxScaleFactor = getPrefSetting($pref::WorldEditor::maxScaleFactor, 4000); EWorldEditor.objSelectColor = getPrefSetting($pref::WorldEditor::objSelectColor, "255 0 0"); EWorldEditor.objMouseOverSelectColor = getPrefSetting($pref::WorldEditor::objMouseOverSelectColor, "0 0 255"); EWorldEditor.objMouseOverColor = getPrefSetting($pref::WorldEditor::objMouseOverColor, "0 255 0"); EWorldEditor.showMousePopupInfo = getPrefSetting($pref::WorldEditor::showMousePopupInfo, true); EWorldEditor.dragRectColor = getPrefSetting($pref::WorldEditor::dragRectColor, "255 255 0"); EWorldEditor.renderObjText = getPrefSetting($pref::WorldEditor::renderObjText, true); EWorldEditor.renderObjHandle = getPrefSetting($pref::WorldEditor::renderObjHandle, true); EWorldEditor.faceSelectColor = getPrefSetting($pref::WorldEditor::faceSelectColor, "0 0 100 100"); EWorldEditor.renderSelectionBox = getPrefSetting($pref::WorldEditor::renderSelectionBox, true); EWorldEditor.selectionBoxColor = getPrefSetting($pref::WorldEditor::selectionBoxColor, "255 255 0"); EWorldEditor.snapToGrid = getPrefSetting($pref::WorldEditor::snapToGrid, false); EWorldEditor.snapRotations = getPrefSetting($pref::WorldEditor::snapRotations, false); EWorldEditor.rotationSnap = getPrefSetting($pref::WorldEditor::rotationSnap, "15"); ETerrainEditor.softSelecting = 1; ETerrainEditor.currentAction = "raiseHeight"; ETerrainEditor.currentMode = "select"; } function EditorGui::setPrefs() { $Pref::WorldEditor::dropType = EWorldEditor.dropType; $pref::WorldEditor::planarMovement = EWorldEditor.planarMovement; $pref::WorldEditor::undoLimit = EWorldEditor.undoLimit; $pref::WorldEditor::dropType = EWorldEditor.dropType; $pref::WorldEditor::projectDistance = EWorldEditor.projectDistance; $pref::WorldEditor::boundingBoxCollision = EWorldEditor.boundingBoxCollision; $pref::WorldEditor::renderPlane = EWorldEditor.renderPlane; $pref::WorldEditor::renderPlaneHashes = EWorldEditor.renderPlaneHashes; $pref::WorldEditor::gridColor = EWorldEditor.GridColor; $pref::WorldEditor::planeDim = EWorldEditor.planeDim; $pref::WorldEditor::gridSize = EWorldEditor.GridSize; $pref::WorldEditor::renderPopupBackground = EWorldEditor.renderPopupBackground; $pref::WorldEditor::popupBackgroundColor = EWorldEditor.PopupBackgroundColor; $pref::WorldEditor::popupTextColor = EWorldEditor.PopupTextColor; $pref::WorldEditor::selectHandle = EWorldEditor.selectHandle; $pref::WorldEditor::defaultHandle = EWorldEditor.defaultHandle; $pref::WorldEditor::lockedHandle = EWorldEditor.lockedHandle; $pref::WorldEditor::objectTextColor = EWorldEditor.ObjectTextColor; $pref::WorldEditor::objectsUseBoxCenter = EWorldEditor.objectsUseBoxCenter; $pref::WorldEditor::axisGizmoMaxScreenLen = EWorldEditor.axisGizmoMaxScreenLen; $pref::WorldEditor::axisGizmoActive = EWorldEditor.axisGizmoActive; $pref::WorldEditor::mouseMoveScale = EWorldEditor.mouseMoveScale; $pref::WorldEditor::mouseRotateScale = EWorldEditor.mouseRotateScale; $pref::WorldEditor::mouseScaleScale = EWorldEditor.mouseScaleScale; $pref::WorldEditor::minScaleFactor = EWorldEditor.minScaleFactor; $pref::WorldEditor::maxScaleFactor = EWorldEditor.maxScaleFactor; $pref::WorldEditor::objSelectColor = EWorldEditor.objSelectColor; $pref::WorldEditor::objMouseOverSelectColor = EWorldEditor.objMouseOverSelectColor; $pref::WorldEditor::objMouseOverColor = EWorldEditor.objMouseOverColor; $pref::WorldEditor::showMousePopupInfo = EWorldEditor.showMousePopupInfo; $pref::WorldEditor::dragRectColor = EWorldEditor.dragRectColor; $pref::WorldEditor::renderObjText = EWorldEditor.renderObjText; $pref::WorldEditor::renderObjHandle = EWorldEditor.renderObjHandle; $pref::WorldEditor::raceSelectColor = EWorldEditor.faceSelectColor; $pref::WorldEditor::renderSelectionBox = EWorldEditor.renderSelectionBox; $pref::WorldEditor::selectionBoxColor = EWorldEditor.selectionBoxColor; $pref::WorldEditor::snapToGrid = EWorldEditor.snapToGrid; $pref::WorldEditor::snapRotations = EWorldEditor.snapRotations; $pref::WorldEditor::rotationSnap = EWorldEditor.rotationSnap; } function EditorGui::onSleep(%this) { %this.setPrefs(); } function EditorGui::init(%this) { DropTypeMenu.setEnumContent(WorldEditor, dropType); %this.getPrefs(); DropTypeMenu.setText(EWorldEditor.dropType); if(!isObject("terraformer")) new Terraformer("terraformer"); $SelectedOperation = -1; $NextOperationId = 1; $HeightfieldDirtyRow = -1; EditorMenuBar.clearMenus(); EditorMenuBar.addMenu("File", 0); EditorMenuBar.addMenuItem("File", "New Mission...", 1); EditorMenuBar.addMenuItem("File", "Open Mission...", 2, "Ctrl O"); EditorMenuBar.addMenuItem("File", "Save Mission...", 3, "Ctrl S"); EditorMenuBar.addMenuItem("File", "Save Mission As...", 4); EditorMenuBar.addMenuItem("File", "-", 0); EditorMenuBar.addMenuItem("File", "Export World Editor Selection...", 0); EditorMenuBar.addMenuItem("File", "Import World Editor Selection...", 0); EditorMenuBar.addMenuItem("File", "-", 0); EditorMenuBar.addMenuItem("File", "Import Terraform Data...", 6); EditorMenuBar.addMenuItem("File", "Import Texture Data...", 5); EditorMenuBar.addMenuItem("File", "-", 0); EditorMenuBar.addMenuItem("File", "Export Terraform Bitmap...", 5); EditorMenuBar.addMenu("Edit", 1); EditorMenuBar.addMenuItem("Edit", "Undo", 1, "Ctrl Z"); EditorMenuBar.setMenuItemBitmap("Edit", "Undo", 1); EditorMenuBar.addMenuItem("Edit", "Redo", 2, "Ctrl R"); EditorMenuBar.setMenuItemBitmap("Edit", "Redo", 2); EditorMenuBar.addMenuItem("Edit", "-", 0); EditorMenuBar.addMenuItem("Edit", "Cut", 3, "Ctrl X"); EditorMenuBar.setMenuItemBitmap("Edit", "Cut", 3); EditorMenuBar.addMenuItem("Edit", "Copy", 4, "Ctrl C"); EditorMenuBar.setMenuItemBitmap("Edit", "Copy", 4); EditorMenuBar.addMenuItem("Edit", "Paste", 5, "Ctrl V"); EditorMenuBar.setMenuItemBitmap("Edit", "Paste", 5); EditorMenuBar.addMenuItem("Edit", "-", 0); EditorMenuBar.addMenuItem("Edit", "Select All", 6, "Ctrl A"); EditorMenuBar.addMenuItem("Edit", "Select None", 7, "Ctrl N"); EditorMenuBar.addMenuItem("Edit", "-", 0); EditorMenuBar.addMenuItem("Edit", "Relight Scene", 14, "Alt L"); EditorMenuBar.addMenuItem("Edit", "-", 0); EditorMenuBar.addMenuItem("Edit", "World Editor Settings...", 12); EditorMenuBar.addMenuItem("Edit", "Terrain Editor Settings...", 13); EditorMenuBar.addMenu("Camera", 7); EditorMenuBar.addMenuItem("Camera", "Drop Camera at Player", 1, "Alt Q"); EditorMenuBar.addMenuItem("Camera", "Drop Player at Camera", 2, "Alt W"); EditorMenuBar.addMenuItem("Camera", "Toggle Camera", 10, "Alt C"); EditorMenuBar.addMenuItem("Camera", "-", 0); EditorMenuBar.addMenuItem("Camera", "Slowest", 3, "Shift 1", 1); EditorMenuBar.addMenuItem("Camera", "Very Slow", 4, "Shift 2", 1); EditorMenuBar.addMenuItem("Camera", "Slow", 5, "Shift 3", 1); EditorMenuBar.addMenuItem("Camera", "Medium Pace", 6, "Shift 4", 1); EditorMenuBar.addMenuItem("Camera", "Fast", 7, "Shift 5", 1); EditorMenuBar.addMenuItem("Camera", "Very Fast", 8, "Shift 6", 1); EditorMenuBar.addMenuItem("Camera", "Fastest", 9, "Shift 7", 1); EditorMenuBar.addMenu("World", 6); EditorMenuBar.addMenuItem("World", "Lock Selection", 10, "Ctrl L"); EditorMenuBar.addMenuItem("World", "Unlock Selection", 11, "Ctrl Shift L"); EditorMenuBar.addMenuItem("World", "-", 0); EditorMenuBar.addMenuItem("World", "Hide Selection", 12, "Ctrl H"); EditorMenuBar.addMenuItem("World", "Show Selection", 13, "Ctrl Shift H"); EditorMenuBar.addMenuItem("World", "-", 0); EditorMenuBar.addMenuItem("World", "Delete Selection", 17, "Delete"); EditorMenuBar.addMenuItem("World", "Camera To Selection", 14); EditorMenuBar.addMenuItem("World", "Reset Transforms", 15); EditorMenuBar.addMenuItem("World", "Drop Selection", 16, "Ctrl D"); EditorMenuBar.addMenuItem("World", "Add Selection to Instant Group", 17); EditorMenuBar.addMenuItem("World", "-", 0); EditorMenuBar.addMenuItem("World", "Drop at Origin", 0, "", 1); EditorMenuBar.addMenuItem("World", "Drop at Camera", 1, "", 1); EditorMenuBar.addMenuItem("World", "Drop at Camera w/Rot", 2, "", 1); EditorMenuBar.addMenuItem("World", "Drop below Camera", 3, "", 1); EditorMenuBar.addMenuItem("World", "Drop at Screen Center", 4, "", 1); EditorMenuBar.addMenuItem("World", "Drop at Centroid", 5, "", 1); EditorMenuBar.addMenuItem("World", "Drop to Ground", 6, "", 1); EditorMenuBar.addMenu("Action", 3); EditorMenuBar.addMenuItem("Action", "Select", 1, "", 1); EditorMenuBar.addMenuItem("Action", "Adjust Selection", 2, "", 1); EditorMenuBar.addMenuItem("Action", "-", 0); EditorMenuBar.addMenuItem("Action", "Add Dirt", 6, "", 1); EditorMenuBar.addMenuItem("Action", "Excavate", 6, "", 1); EditorMenuBar.addMenuItem("Action", "Adjust Height", 6, "", 1); EditorMenuBar.addMenuItem("Action", "Flatten", 4, "", 1); EditorMenuBar.addMenuItem("Action", "Smooth", 5, "", 1); EditorMenuBar.addMenuItem("Action", "Set Height", 7, "", 1); EditorMenuBar.addMenuItem("Action", "-", 0); EditorMenuBar.addMenuItem("Action", "Set Empty", 8, "", 1); EditorMenuBar.addMenuItem("Action", "Clear Empty", 8, "", 1); EditorMenuBar.addMenuItem("Action", "-", 0); EditorMenuBar.addMenuItem("Action", "Paint Material", 9, "", 1); EditorMenuBar.addMenu("Brush", 4); EditorMenuBar.addMenuItem("Brush", "Box Brush", 91, "", 1); EditorMenuBar.addMenuItem("Brush", "Circle Brush", 92, "", 1); EditorMenuBar.addMenuItem("Brush", "-", 0); EditorMenuBar.addMenuItem("Brush", "Soft Brush", 93, "", 2); EditorMenuBar.addMenuItem("Brush", "Hard Brush", 94, "", 2); EditorMenuBar.addMenuItem("Brush", "-", 0); EditorMenuBar.addMenuItem("Brush", "Size 1 x 1", 1, "Alt 1", 3); EditorMenuBar.addMenuItem("Brush", "Size 3 x 3", 3, "Alt 2", 3); EditorMenuBar.addMenuItem("Brush", "Size 5 x 5", 5, "Alt 3", 3); EditorMenuBar.addMenuItem("Brush", "Size 9 x 9", 9, "Alt 4", 3); EditorMenuBar.addMenuItem("Brush", "Size 15 x 15", 15, "Alt 5", 3); EditorMenuBar.addMenuItem("Brush", "Size 25 x 25", 25, "Alt 6", 3); EditorMenuBar.addMenu("AI", 8); EditorMenuBar.addMenuItem("AI", "Render Indoor Graphs", 3); EditorMenuBar.addMenuItem("AI", "Render Outdoor Graph", 4); EditorMenuBar.addMenuItem("AI", "Render Jet Edges", 4); EditorMenuBar.addMenuItem("AI", "-", 0); EditorMenuBar.addMenuItem("AI", "Edit AI for Team 1", 4); EditorMenuBar.addMenuItem("AI", "Edit AI for Team 2", 7); EditorMenuBar.addMenuItem("AI", "-", 0); EditorMenuBar.addMenuItem("AI", "Build Objectives", 5); EditorMenuBar.addMenuItem("AI", "Build Bot Nav Graph...", 5); EditorMenuBar.addMenuItem("AI", "Build Spawn Graph...", 5); EditorMenuBar.addMenuItem("AI", "Build LOS Crossrefs...", 5); EditorMenuBar.addMenuItem("AI", "-", 0); EditorMenuBar.addMenuItem("AI", "Add Defend Location Objective", 5); EditorMenuBar.addMenuItem("AI", "Add Repair Equipment Objective", 5); EditorMenuBar.addMenuItem("AI", "Add Deploy Outdoor Turret Objective", 5); EditorMenuBar.addMenuItem("AI", "Add Deploy Indoor Turret Objective", 5); EditorMenuBar.addMenuItem("AI", "Add Attack Target Objective", 5); EditorMenuBar.addMenuItem("AI", "Add Touch FlipFlop Objective", 5); EditorMenuBar.addMenuItem("AI", "Add Mortar Target Objective", 5); EditorMenuBar.addMenuItem("AI", "Add Deploy Inventory Objective", 5); EditorMenuBar.addMenuItem("AI", "Add New Objective Set", 6); EditorMenuBar.addMenu("Window", 2); EditorMenuBar.addMenuItem("Window", "World Editor", 2, "F2", 1); EditorMenuBar.addMenuItem("Window", "World Editor Inspector", 3, "F3", 1); EditorMenuBar.addMenuItem("Window", "World Editor Creator", 4, "F4", 1); EditorMenuBar.addMenuItem("Window", "Mission Area Editor", 5, "F5", 1); EditorMenuBar.addMenuItem("Window", "AI Editor", 10); EditorMenuBar.addMenuItem("Window", "-", 0); EditorMenuBar.addMenuItem("Window", "Terrain Editor", 6, "F6", 1); EditorMenuBar.addMenuItem("Window", "Terrain Terraform Editor", 7, "F7", 1); EditorMenuBar.addMenuItem("Window", "Terrain Texture Editor", 8, "F8", 1); EditorMenuBar.addMenuItem("Window", "Terrain Texture Painter", 9, "", 1); EditorMenuBar.setMenuItemChecked("AI", "Render Indoor Graphs", $pref::NavGraph::drawIndoor); EditorMenuBar.setMenuItemChecked("AI", "Render Outdoor Graph", $pref::NavGraph::drawOutdoor); EditorMenuBar.setMenuItemChecked("AI", "Render Jet Edges", $pref::NavGraph::drawJetEdges); $AIEditor::inspectTeam = 1; EditorMenuBar.setMenuItemChecked("AI", "Edit AI for Team 1", $AIEditor::inspectTeam == 1); EditorMenuBar.setMenuItemChecked("AI", "Edit AI for Team 2", $AIEditor::inspectTeam == 2); ETerrainEditor.getPrefs(); EditorMenuBar.onActionMenuItemSelect(0, "Paint"); EditorMenuBar.onActionMenuItemSelect(0, "Adjust Height"); EditorMenuBar.onBrushMenuItemSelect(0, "Circle Brush"); EditorMenuBar.onBrushMenuItemSelect(0, "Soft Brush"); EditorMenuBar.onBrushMenuItemSelect(9, "Size 9 x 9"); EditorMenuBar.onCameraMenuItemSelect(6, "Medium Pace"); EditorMenuBar.onWorldMenuItemSelect(0, "Drop at Screen Center"); EWorldEditor.init(); ETerrainEditor.init(); ETerrainEditor.attachTerrain(); TerraformerInit(); TextureInit(); // Creator.init(); Inspector.init(); AreaEditor.init(); EditorTree.init(); ObjectBuilderGui.init(); EWorldEditor.isDirty = false; ETerrainEditor.isDirty = false; ETerrainEditor.isMissionDirty = false; EWorldEditor.isGraphDirty = false; EditorGui.saveAs = false; if(isObject(MissionGroup) && isObject(MissionCleanup)) { MissionGroup.add(MissionCleanup); MissionCleanup.setPersistent(false); } } function EditorNewMission() { if(ETerrainEditor.isMissionDirty || ETerrainEditor.isDirty || EWorldEditor.isDirty || EWorldEditor.isGraphDirty) { MessageBoxYesNo("Mission Modified", "Would you like to save changes to the current mission \"" @ $Server::MissionFile @ "\" before creating a new mission?", "EditorDoNewMission(true);", "EditorDoNewMission(false);"); } else EditorDoNewMission(false); } function EditorSaveMissionMenu() { if(EditorGui.saveAs) EditorSaveMissionAs(); else EditorSaveMission(); } function EditorSaveMission() { // just save the mission without renaming it // first check for dirty and read-only files: %missionFile = "missions/" @ $CurrentMission @ ".mis"; %terrainFile = "terrains/" @ Terrain.terrainFile; if((EWorldEditor.isDirty || ETerrainEditor.isMissionDirty) && !isWriteableFileName(%missionFile)) { MessageBoxOK("Error", "Mission file \""@ %missionFile @ "\" is read-only."); return false; } if(ETerrainEditor.isDirty && !isWriteableFileName(%terrainFile)) { MessageBoxOK("Error", "Terrain file \""@ %terrainFile @ "\" is read-only."); return false; } // now write the terrain and mission files out: if(EWorldEditor.isDirty || ETerrainEditor.isMissionDirty) MissionGroup.save(%missionFile); if(ETerrainEditor.isDirty) Terrain.save(Terrain.terrainFile); if(EWorldEditor.isGraphDirty && isObject(NavGraph)) NavGraph.saveGraph(); EWorldEditor.isDirty = false; EWorldEditor.isGraphDirty = false; ETerrainEditor.isDirty = false; ETerrainEditor.isMissionDirty = false; EditorGui.saveAs = false; return true; } function EditorDoSaveAs(%missionName) { ETerrainEditor.isDirty = true; EWorldEditor.isDirty = true; EWorldEditor.isGraphDirty = true; %saveMissionFile = $CurrentMission; %saveTerrName = Terrain.terrainFile; $CurrentMission = fileBase(%missionName); Terrain.terrainFile = fileBase(%missionName) @ ".ter"; if(!EditorSaveMission()) { $CurrentMission = %saveMissionFile; Terrain.terrainFile = %saveTerrName; } } function EditorSaveMissionAs() { getSaveFilename("*.mis", "EditorDoSaveAs", $Server::MissionFile); } function EditorDoLoadMission(%file) { // gotta strip off the missions path %file = fileBase(%file); loadMission( %file, $CurrentMissionType, true ) ; // and re-init the EditorGui EditorGui.init(); EditorGui.loadingMission = true; Canvas.setContent(LoadingGui); } function EditorSaveBeforeLoad() { if(EditorSaveMission()) getLoadFilename("*.mis", "EditorDoLoadMission"); } function EditorDoNewMission(%saveFirst) { if(%saveFirst) EditorSaveMission(); %file = findFirstFile("*/newMission.mis"); if(%file $= "") { MessageBoxOk("Error", "Missing mission template \"newMission.mis\"."); return; } EditorDoLoadMission(%file); EditorGui.saveAs = true; EWorldEditor.isDirty = true; ETerrainEditor.isDirty = true; } function EditorOpenMission() { if(ETerrainEditor.isMissionDirty || ETerrainEditor.isDirty || EWorldEditor.isDirty || EWorldEditor.isGraphDirty) { MessageBoxYesNo("Mission Modified", "Would you like to save changes to the current mission \"" @ $Server::MissionFile @ "\" before opening a new mission?", "EditorSaveBeforeLoad();", "getLoadFilename(\"*.mis\", \"EditorDoLoadMission\");"); } else getLoadFilename("*.mis", "EditorDoLoadMission"); } function EditorMenuBar::onMenuSelect(%this, %menuId, %menu) { if(%menu $= "File") { %editingHeightfield = ETerrainEditor.isVisible() && EHeightField.isVisible(); EditorMenuBar.setMenuItemEnable("File", "Export Terraform Bitmap...", %editingHeightfield); EditorMenuBar.setMenuItemEnable("File", "Save Mission...", EWorldEditor.isGraphDirty || ETerrainEditor.isDirty || ETerrainEditor.isMissionDirty || EWorldEditor.isDirty); EditorMenuBar.setMenuItemEnable("File", "Export World Editor Selection...", EWorldEditor.isVisible() && EWorldEditor.getSelectionSize()); EditorMenuBar.setMenuItemEnable("File", "Import World Editor Selection...", EWorldEditor.isVisible()); } else if(%menu $= "Edit") { // enable/disable undo, redo, cut, copy, paste depending on editor settings if(EWorldEditor.isVisible()) { // do actions based on world editor... EditorMenuBar.setMenuItemEnable("Edit", "Select All", true); EditorMenuBar.setMenuItemEnable("Edit", "Paste", EWorldEditor.canPasteSelection()); %canCutCopy = EWorldEditor.getSelectionSize() > 0; EditorMenuBar.setMenuItemEnable("Edit", "Cut", %canCutCopy); EditorMenuBar.setMenuItemEnable("Edit", "Copy", %canCutCopy); } else if(ETerrainEditor.isVisible()) { EditorMenuBar.setMenuItemEnable("Edit", "Cut", false); EditorMenuBar.setMenuItemEnable("Edit", "Copy", false); EditorMenuBar.setMenuItemEnable("Edit", "Paste", false); EditorMenuBar.setMenuItemEnable("Edit", "Select All", false); } } else if(%menu $= "World") { %selSize = EWorldEditor.getSelectionSize(); %lockCount = EWorldEditor.getSelectionLockCount(); %hideCount = EWorldEditor.getSelectionHiddenCount(); EditorMenuBar.setMenuItemEnable("World", "Lock Selection", %lockCount < %selSize); EditorMenuBar.setMenuItemEnable("World", "Unlock Selection", %lockCount > 0); EditorMenuBar.setMenuItemEnable("World", "Hide Selection", %hideCount < %selSize); EditorMenuBar.setMenuItemEnable("World", "Show Selection", %hideCount > 0); EditorMenuBar.setMenuItemEnable("World", "Add Selection to Instant Group", %selSize > 0); EditorMenuBar.setMenuItemEnable("World", "Camera To Selection", %selSize > 0); EditorMenuBar.setMenuItemEnable("World", "Reset Transforms", %selSize > 0 && %lockCount == 0); EditorMenuBar.setMenuItemEnable("World", "Drop Selection", %selSize > 0 && %lockCount == 0); EditorMenuBar.setMenuItemEnable("World", "Delete Selection", (!EditorTree.isSelectionEmpty() || %selSize > 0) && %lockCount == 0); } } function EditorMenuBar::onMenuItemSelect(%this, %menuId, %menu, %itemId, %item) { switch$(%menu) { case "File": %this.onFileMenuItemSelect(%itemId, %item); case "Edit": %this.onEditMenuItemSelect(%itemId, %item); case "World": %this.onWorldMenuItemSelect(%itemId, %item); case "Window": %this.onWindowMenuItemSelect(%itemId, %item); case "Action": %this.onActionMenuItemSelect(%itemId, %item); case "Brush": %this.onBrushMenuItemSelect(%itemId, %item); case "Camera": %this.onCameraMenuItemSelect(%itemId, %item); case "AI": %this.onAIMenuItemSelect(%itemId, %item); } } function EditorMenuBar::onFileMenuItemSelect(%this, %itemId, %item) { switch$(%item) { case "New Mission...": EditorNewMission(); case "Open Mission...": EditorOpenMission(); case "Save Mission...": EditorSaveMissionMenu(); case "Save Mission As...": EditorSaveMissionAs(); case "Export World Editor Selection...": EWorldEditor.export(); case "Import World Editor Selection...": EWorldEditor.import(); case "Import Texture Data...": Texture::import(); case "Import Terraform Data...": Heightfield::import(); case "Export Terraform Bitmap...": Heightfield::saveBitmap(""); case "Quit": } } function EditorMenuBar::onCameraMenuItemSelect(%this, %itemId, %item) { switch$(%item) { case "Drop Camera at Player": commandToServer('dropCameraAtPlayer'); case "Drop Player at Camera": commandToServer('DropPlayerAtCamera'); case "Toggle Camera": commandToServer('ToggleCamera'); default: // all the rest are camera speeds: // item ids go from 3 (slowest) to 9 (fastest) %this.setMenuItemChecked("Camera", %itemId, true); // camera movement speed goes from 5 to 200: $Camera::movementSpeed = ((%itemId - 3) / 6.0) * 195 + 5; } } function EditorMenuBar::onActionMenuItemSelect(%this, %itemId, %item) { EditorMenuBar.setMenuItemChecked("Action", %item, true); switch$(%item) { case "Select": ETerrainEditor.currentMode = "select"; ETerrainEditor.selectionHidden = false; ETerrainEditor.renderVertexSelection = true; ETerrainEditor.setAction("select"); case "Adjust Selection": ETerrainEditor.currentMode = "adjust"; ETerrainEditor.selectionHidden = false; ETerrainEditor.setAction("adjustHeight"); ETerrainEditor.currentAction = brushAdjustHeight; ETerrainEditor.renderVertexSelection = true; default: ETerrainEditor.currentMode = "paint"; ETerrainEditor.selectionHidden = true; ETerrainEditor.setAction(ETerrainEditor.currentAction); switch$(%item) { case "Add Dirt": ETerrainEditor.currentAction = raiseHeight; ETerrainEditor.renderVertexSelection = true; case "Paint Material": ETerrainEditor.currentAction = paintMaterial; ETerrainEditor.renderVertexSelection = true; case "Excavate": ETerrainEditor.currentAction = lowerHeight; ETerrainEditor.renderVertexSelection = true; case "Set Height": ETerrainEditor.currentAction = setHeight; ETerrainEditor.renderVertexSelection = true; case "Adjust Height": ETerrainEditor.currentAction = brushAdjustHeight; ETerrainEditor.renderVertexSelection = true; case "Flatten": ETerrainEditor.currentAction = flattenHeight; ETerrainEditor.renderVertexSelection = true; case "Smooth": ETerrainEditor.currentAction = smoothHeight; ETerrainEditor.renderVertexSelection = true; case "Set Empty": ETerrainEditor.currentAction = setEmpty; ETerrainEditor.renderVertexSelection = false; case "Clear Empty": ETerrainEditor.currentAction = clearEmpty; ETerrainEditor.renderVertexSelection = false; } if(ETerrainEditor.currentMode $= "select") ETerrainEditor.processAction(ETerrainEditor.currentAction); else if(ETerrainEditor.currentMode $= "paint") ETerrainEditor.setAction(ETerrainEditor.currentAction); } } function EditorMenuBar::onBrushMenuItemSelect(%this, %itemId, %item) { EditorMenuBar.setMenuItemChecked("Brush", %item, true); switch$(%item) { case "Box Brush": ETerrainEditor.setBrushType(box); case "Circle Brush": ETerrainEditor.setBrushType(ellipse); case "Soft Brush": ETerrainEditor.enableSoftBrushes = true; case "Hard Brush": ETerrainEditor.enableSoftBrushes = false; default: // the rest are brush sizes: ETerrainEditor.brushSize = %itemId; ETerrainEditor.setBrushSize(%itemId, %itemId); } } function EditorMenuBar::onWorldMenuItemSelect(%this, %itemId, %item) { // edit commands for world editor... switch$(%item) { case "Lock Selection": EWorldEditor.lockSelection(true); case "Unlock Selection": EWorldEditor.lockSelection(false); case "Hide Selection": EWorldEditor.hideSelection(true); case "Show Selection": EWorldEditor.hideSelection(false); case "Camera To Selection": EWorldEditor.dropCameraToSelection(); case "Reset Transforms": EWorldEditor.resetTransforms(); case "Drop Selection": EWorldEditor.dropSelection(); case "Delete Selection": EWorldEditor.deleteSelection(); EditorTree.deleteSelection(); if(!isObject($InstantGroup)) $InstantGroup = "MissionGroup"; case "Add Selection to Instant Group": EWorldEditor.addSelectionToAddGroup(); default: EditorMenuBar.setMenuItemChecked("World", %item, true); switch$(%item) { case "Drop at Origin": EWorldEditor.dropType = "atOrigin"; case "Drop at Camera": EWorldEditor.dropType = "atCamera"; case "Drop at Camera w/Rot": EWorldEditor.dropType = "atCameraRot"; case "Drop below Camera": EWorldEditor.dropType = "belowCamera"; case "Drop at Screen Center": EWorldEditor.dropType = "screenCenter"; case "Drop to Ground": EWorldEditor.dropType = "toGround"; case "Drop at Centroid": EWorldEditor.dropType = "atCentroid"; } } } function EditorMenuBar::onEditMenuItemSelect(%this, %itemId, %item) { if(%item $= "World Editor Settings...") Canvas.pushDialog(WorldEditorSettingsDlg); else if(%item $= "Terrain Editor Settings...") Canvas.pushDialog(TerrainEditorValuesSettingsGui, 99); else if(%item $= "Relight Scene") lightScene("", forceAlways); else if(EWorldEditor.isVisible()) { // edit commands for world editor... switch$(%item) { case "Undo": EWorldEditor.undo(); case "Redo": EWorldEditor.redo(); case "Copy": EWorldEditor.copySelection(); case "Cut": EWorldEditor.copySelection(); EWorldEditor.deleteSelection(); case "Paste": EWorldEditor.pasteSelection(); case "Select All": case "Select None": } } else if(ETerrainEditor.isVisible()) { // do some terrain stuffin' switch$(%item) { case "Undo": ETerrainEditor.undo(); case "Redo": ETerrainEditor.redo(); case "Select None": ETerrainEditor.clearSelection(); } } } function WorldEditor::export(%this) { getSaveFilename("editor/*.mac", %this @ ".doExport", "selection.mac"); } function WorldEditor::doExport(%this, %file) { missionGroup.save("editor/" @ %file, true); } function WorldEditor::import(%this) { getLoadFilename("editor/*.mac", %this @ ".doImport"); } function WorldEditor::doImport(%this, %file) { %tempInstant = $InstantGroup; %grp = new SimGroup(); $InstantGroup = %grp; MissionGroup.add(%grp); exec(%file); EWorldEditor.clearSelection(); while(%grp.getCount()) { EWorldEditor.selectObject(%grp.getObject(0)); %tempInstant.add(%grp.getObject(0)); } EWorldEditor.dropSelection(); EditorTree.fillSelectionFromWorldEditor(%this); $InstantGroup = %tempInstant; %grp.delete(); } function EditorMenuBar::onWindowMenuItemSelect(%this, %itemId, %item) { EditorGui.setEditor(%item); } function EditorGui::setAIEditTeam(%this, %team) { $AIEditor::inspectTeam = %team; EditorMenuBar.setMenuItemChecked("AI", "Edit AI for Team 1", $AIEditor::inspectTeam == 1); EditorMenuBar.setMenuItemChecked("AI", "Edit AI for Team 2", $AIEditor::inspectTeam == 2); EditorTree.open("MissionGroup/Teams/team" @ %team @ "/AIObjectives"); $InstantGroup = nameToId("MissionGroup/Teams/team" @ %team @ "/AIObjectives"); } function EditorGui::makeUnbridgedGraph() { GraphCurrentOperation.setValue("Generating interior nodes..."); Canvas.repaint(); navGraph::generateInterior(); EditorGui.dataProgress(); GraphCurrentOperation.setValue("Remaking graph..."); Canvas.repaint(); EditorGui.remakeTheGraph(); EditorGui.dataProgress(); EWorldEditor.isGraphDirty = true; } function EditorGui::AIworking(%this, %working) { if(%working) { Canvas.pushDialog(AIEWorkingDlg); GraphBuildProgress.setValue(0.0); } else Canvas.popDialog(AIEWorkingDlg); Canvas.repaint(); } function EditorGui::dataProgress(%this) { $NavGraph::operationsDone++; %percent = $NavGraph::operationsDone / $NavGraph::operations; GraphBuildProgress.setValue(%percent); Canvas.repaint(); } //------------------------------------------------------------------------------ function EditorGui::remakeTheGraph(%this) { GraphCurrentOperation.setValue("making graph..."); Canvas.repaint(); navGraph.makeGraph(); EditorGui.dataProgress(); } function EditorGui::createLOSXref(%this) { EditorGui.AIworking(true); GraphCurrentOperation.setValue("Making LOS CrossRef Table..."); GraphBuildProgress.setValue(0); if(2.player) navGraph.prepLOS(2.player.getTransform()); else navGraph.prepLOS("0 0 0"); while(navGraph.makeLOS()) { GraphBuildProgress.setValue($graphProcessPercent); Canvas.repaint(); } GraphBuildProgress.setValue(100); Canvas.repaint(); EWorldEditor.isGraphDirty = true; EditorGui.AIworking(false); } function EditorGui::makeJettableGraph(%this, %NAVorSPAWN) { %this.AIworking(true); $NavGraph::operations = 7; $NavGraph::operationsDone = 0; navGraph.setGenMode(%NAVorSPAWN); navGraph::exteriorInspect(); %this.dataProgress(); %this.makeUnbridgedGraph(); GraphCurrentOperation.setValue("Beginning slow bridge finding pass"); Canvas.repaint(); navGraph.assemble(); navGraph.cullIslands(); %this.remakeTheGraph(); navGraph.pushBridges(); navGraph.makeTables(); %this.dataProgress(); EWorldEditor.isGraphDirty = true; %this.AIworking(false); } function EditorMenuBar::onAIMenuItemSelect(%this, %itemId, %item) { switch$(%item) { case "Build Objectives": AICreateObjectives(); case "Build Bot Nav Graph...": EditorGui.makeJettableGraph(Nav); case "Build Spawn Graph...": EditorGui.makeJettableGraph(Spawn); case "Build LOS Crossrefs...": EditorGui.createLOSXref(); case "Render Indoor Graphs": $pref::NavGraph::drawIndoor = !$pref::NavGraph::drawIndoor; EditorMenuBar.setMenuItemChecked("AI", "Render Indoor Graphs", $pref::NavGraph::drawIndoor); case "Render Outdoor Graph": $pref::NavGraph::drawOutdoor = !$pref::NavGraph::drawOutdoor; EditorMenuBar.setMenuItemChecked("AI", "Render Outdoor Graph", $pref::NavGraph::drawOutdoor); case "Render Jet Edges": $pref::NavGraph::drawJetEdges = !$pref::NavGraph::drawJetEdges; EditorMenuBar.setMenuItemChecked("AI", "Render Jet Edges", $pref::NavGraph::drawJetEdges); case "Edit AI for Team 1": EditorGui.setAIEditTeam(1); case "Edit AI for Team 2": EditorGui.setAIEditTeam(2); case "Add New Objective Set": %set = new SimGroup("ObjectiveSet"); $InstantGroup.add(%set); default: EditorGui.addNewObjective(getWord(%item, 1) SPC getWord(%item, 2)); } } function EditorGui::addNewObjective(%this, %type) { if($AIEditor::inspectTeam == 1) %team = 1; else if($AIEditor::inspectTeam == 2) %team = 2; else %team = 1; if(nameToId($InstantGroup) < 1) return; switch$(%type) { case "Defend Location": %objective = new AIObjective(AIODefendLocation) { dataBlock = "AIObjectiveMarker"; }; case "Repair Equipment": %objective = new AIObjective(AIORepairObject) { dataBlock = "AIObjectiveMarker"; }; case "Deploy Outdoor": %Objective = new AIObjective(AIODeployEquipment) { dataBlock = "AIObjectiveMarker"; weightLevel1 = 4100; weightLevel2 = 0; description = "Deploy outdoor Turret"; offense = false; defense = true; targetObjectId = -1; targetObject = -1; targetClientId = -1; equipment = "TurretOutdoorDeployable"; buyEquipmentSet = "MediumOutdoorTurretSet"; }; case "Deploy Indoor": %Objective = new AIObjective(AIODeployEquipment) { dataBlock = "AIObjectiveMarker"; weightLevel1 = 4100; weightLevel2 = 0; description = "Deploy indoor Turret"; offense = false; defense = true; targetObjectId = -1; targetObject = -1; targetClientId = -1; equipment = "TurretIndoorDeployable"; buyEquipmentSet = "MediumIndoorTurretSet"; }; case "Attack Target": %objective = new AIObjective(AIOAttackObject) { dataBlock = "AIObjectiveMarker"; }; case "Touch FlipFlop": %objective = new AIObjective(AIOTouchObject) { dataBlock = "AIObjectiveMarker"; }; case "Mortar Target": %objective = new AIObjective(AIOMortarObject) { dataBlock = "AIObjectiveMarker"; }; case "Deploy Inventory": %Objective = new AIObjective(AIODeployEquipment) { dataBlock = "AIObjectiveMarker"; weightLevel1 = 4100; weightLevel2 = 0; description = "Deploy Inventory Station"; offense = false; defense = true; targetObjectId = -1; targetObject = -1; targetClientId = -1; equipment = "InventoryDeployable"; buyEquipmentSet = "MediumInventorySet"; }; case "New Group": %set = new SimGroup("ObjectiveSet"); %tGroup.add(%set); return; default: error("no defined type."); return; } $InstantGroup.add(%objective); EWorldEditor.clearSelection(); EWorldEditor.selectObject(%objective); EWorldEditor.dropSelection(); %objective.location = %objective.getWorldBoxCenter(); Inspector.inspect(%objective); InspectorNameEdit.setValue(%objective.getName()); } function EditorGui::setWorldEditorVisible(%this) { EWorldEditor.setVisible(true); ETerrainEditor.setVisible(false); EditorMenuBar.setMenuVisible("World", true); EditorMenuBar.setMenuVisible("Action", false); EditorMenuBar.setMenuVisible("Brush", false); EditorMenuBar.setMenuVisible("AI", false); EWorldEditor.schedule(0, makeFirstResponder, true); } function EditorGui::setTerrainEditorVisible(%this) { EWorldEditor.setVisible(false); ETerrainEditor.setVisible(true); ETerrainEditor.attachTerrain(); EHeightField.setVisible(false); ETexture.setVisible(false); EditorMenuBar.setMenuVisible("World", false); EditorMenuBar.setMenuVisible("Action", true); EditorMenuBar.setMenuVisible("Brush", true); EditorMenuBar.setMenuVisible("AI", false); ETerrainEditor.schedule(0, makeFirstResponder, true); EPainter.setVisible(false); } function EditorGui::setEditor(%this, %editor) { EditorMenuBar.setMenuItemBitmap("Window", %this.currentEditor, -1); EditorMenuBar.setMenuItemBitmap("Window", %editor, 0); if(%this.currentEditor $= "AI Editor" && %this.lastInstantGroup !$= "") { %grp = nameToID(%this.lastInstantGroup); if(%grp != -1) $InstantGroup = %grp; } %this.currentEditor = %editor; $AIEdit = false; EWorldEditor.renderNav = false; // add objclasses which we do not want to collide with EWorldEditor.clearIgnoreList(); EWorldEditor.ignoreObjClass(TerrainBlock, Sky, AIObjective); EWorldEditor.toggleIgnoreList = false; EditorTree.open("MissionGroup"); switch$(%editor) { case "World Editor": EWFrame.setVisible(false); EWMissionArea.setVisible(false); %this.setWorldEditorVisible(); case "World Editor Inspector": EWFrame.setVisible(true); EWMissionArea.setVisible(false); EWCreatorPane.setVisible(false); EWInspectorPane.setVisible(true); %this.setWorldEditorVisible(); case "World Editor Creator": EWFrame.setVisible(true); EWMissionArea.setVisible(false); EWCreatorPane.setVisible(true); EWInspectorPane.setVisible(false); %this.setWorldEditorVisible(); case "Mission Area Editor": EWFrame.setVisible(false); EWMissionArea.setVisible(true); %this.setWorldEditorVisible(); case "AI Editor": if(%this.currentEditor !$= "AI Editor") %this.lastInstantGroup = $InstantGroup; EWFrame.setVisible(true); EWMissionArea.setVisible(false); EWCreatorPane.setVisible(false); EWInspectorPane.setVisible(true); %this.setWorldEditorVisible(true); EditorMenuBar.setMenuVisible("AI", true); EWorldEditor.clearIgnoreList(); EWorldEditor.ignoreObjClass(AIObjective); EWorldEditor.toggleIgnoreList = true; EWorldEditor.renderNav = true; EditorGui.setAIEditTeam($AIEditor::inspectTeam); case "Terrain Editor": %this.setTerrainEditorVisible(); case "Terrain Terraform Editor": %this.setTerrainEditorVisible(); EHeightField.setVisible(true); case "Terrain Texture Editor": %this.setTerrainEditorVisible(); ETexture.setVisible(true); case "Terrain Texture Painter": %this.setTerrainEditorVisible(); EPainter.setVisible(true); EPainter.setup(); } } function EditorGui::getHelpPage(%this) { switch$(%this.currentEditor) { case "World Editor" or "World Editor Inspector" or "World Editor Creator": return "3. World Editor"; case "Mission Area Editor": return "4. Mission Area Editor"; case "Terrain Editor": return "5. Terrain Editor"; case "Terrain Terraform Editor": return "6. Terrain Terraform Editor"; case "Terrain Texture Editor": return "7. Terrain Texture Editor"; case "Terrain Texture Painter": return "8. Terrain Texture Painter"; default: return "2. Mission Editor Overview"; } } function ETerrainEditor::setPaintMaterial(%this, %matIndex) { ETerrainEditor.paintMaterial = EPainter.mat[%matIndex]; } function ETerrainEditor::changeMaterial(%this, %matIndex) { EPainter.matIndex = %matIndex; getLoadFilename("textures/terrain/*.png\ttextures/terrain/*.jpg", EPainterChangeMat, true); } function EPainterChangeMat(%file) { // make sure the material isn't already in the terrain. %file = fileBase(%file); for(%i = 0; %i < 6; %i++) if(EPainter.mat[%i] $= %file) return; EPainter.mat[EPainter.matIndex] = %file; %mats = ""; for(%i = 0; %i < 6; %i++) %mats = %mats @ EPainter.mat[%i] @ "\n"; ETerrainEditor.setTerrainMaterials(%mats); EPainter.setup(); ("ETerrainMaterialPaint" @ EPainter.matIndex).performClick(); } function EPainter::setup(%this) { EditorMenuBar.onActionMenuItemSelect(0, "Paint Material"); %mats = ETerrainEditor.getTerrainMaterials(); %valid = true; for(%i = 0; %i < 6; %i++) { %mat = getRecord(%mats, %i); %this.mat[%i] = %mat; ("ETerrainMaterialText" @ %i).setText(%mat); ("ETerrainMaterialBitmap" @ %i).setBitmap("terrain/" @ %mat); ("ETerrainMaterialChange" @ %i).setActive(true); ("ETerrainMaterialPaint" @ %i).setActive(%mat !$= ""); if(%mat $= "") { ("ETerrainMaterialChange" @ %i).setValue("Add..."); if(%valid) %valid = false; else ("ETerrainMaterialChange" @ %i).setActive(false); } else ("ETerrainMaterialChange" @ %i).setValue("Change..."); } ETerrainMaterialPaint0.performClick(); } function EditorGui::onWake(%this) { MoveMap.push(); EditorMap.push(); %this.setEditor(%this.currentEditor); } function EditorGui::onSleep(%this) { EditorMap.pop(); MoveMap.pop(); } function AreaEditor::onUpdate(%this, %area) { AreaEditingText.setValue( "X: " @ getWord(%area,0) @ " Y: " @ getWord(%area,1) @ " W: " @ getWord(%area,2) @ " H: " @ getWord(%area,3)); } function AreaEditor::onWorldOffset(%this, %offset) { } function EditorTree::init(%this) { %this.open(MissionGroup); // context menu new GuiControl(ETContextPopupDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; new GuiPopUpMenuCtrl(ETContextPopup) { profile = "GuiScrollProfile"; position = "0 0"; extent = "0 0"; minExtent = "0 0"; maxPopupHeight = "200"; command = "canvas.popDialog(ETContextPopupDlg);"; }; }; ETContextPopup.setVisible(false); } function EditorTree::onInspect(%this, %obj) { Inspector.inspect(%obj); InspectorNameEdit.setValue(%obj.getName()); } function EditorTree::onSelect(%this, %obj) { if($AIEdit) aiEdit.selectObject(%obj); else EWorldEditor.selectObject(%obj); } function EditorTree::onUnselect(%this, %obj) { if($AIEdit) aiEdit.unselectObject(%obj); else EWorldEditor.unselectObject(%obj); } function ETContextPopup::onSelect(%this, %index, %value) { switch(%index) { case 0: EditorTree.contextObj.delete(); } } //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function DropTypeMenu::onSelect(%this, %id, %text) { EWorldEditor.dropType = %text; } function WorldEditor::init(%this) { %this.getPrefs(); // editing modes %this.numEditModes = 3; %this.editMode[0] = "move"; %this.editMode[1] = "rotate"; %this.editMode[2] = "scale"; %this.setMode(%this.currentMode); // context menu new GuiControl(WEContextPopupDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; new GuiPopUpMenuCtrl(WEContextPopup) { profile = "GuiScrollProfile"; position = "0 0"; extent = "0 0"; minExtent = "0 0"; maxPopupHeight = "200"; command = "canvas.popDialog(WEContextPopupDlg);"; }; }; WEContextPopup.setVisible(false); } //------------------------------------------------------------------------------ function WorldEditor::onDblClick(%this, %obj) { // Commented out because making someone double click to do this is stupid // and has the possibility of moving hte object //Inspector.inspect(%obj); //InspectorNameEdit.setValue(%obj.getName()); } function WorldEditor::onSelectionChanged(%this) { EditorTree.fillSelectionFromWorldEditor(%this); } function WorldEditor::onClick( %this, %obj ) { Inspector.inspect( %obj ); InspectorNameEdit.setValue( %obj.getName() ); } //------------------------------------------------------------------------------ function WorldEditor::onGuiUpdate(%this, %text) { } function WorldEditor::getSelectionLockCount(%this) { %ret = 0; for(%i = 0; %i < %this.getSelectionSize(); %i++) { %obj = %this.getSelectedObject(%i); if(%obj.locked $= "true") %ret++; } return %ret; } function WorldEditor::getSelectionHiddenCount(%this) { %ret = 0; for(%i = 0; %i < %this.getSelectionSize(); %i++) { %obj = %this.getSelectedObject(%i); if(%obj.hidden $= "true") %ret++; } return %ret; } function WorldEditor::dropCameraToSelection(%this) { if(%this.getSelectionSize() == 0) return; %pos = %this.getSelectionCentroid(); %cam = LocalClientConnection.camera.getTransform(); // set the pnt %cam = setWord(%cam, 0, getWord(%pos, 0)); %cam = setWord(%cam, 1, getWord(%pos, 1)); %cam = setWord(%cam, 2, getWord(%pos, 2)); LocalClientConnection.camera.setTransform(%cam); } // * pastes the selection at the same place (used to move obj from a group to another) function WorldEditor::moveSelectionInPlace(%this) { %saveDropType = %this.dropType; %this.dropType = "atCentroid"; %this.copySelection(); %this.deleteSelection(); %this.pasteSelection(); %this.dropType = %saveDropType; } function WorldEditor::addSelectionToAddGroup(%this) { for(%i = 0; %i < %this.getSelectionSize(); %i++) { %obj = %this.getSelectedObject(%i); $InstantGroup.add(%obj); } } // resets the scale and rotation on the selection set function WorldEditor::resetTransforms(%this) { %this.addUndoState(); for(%i = 0; %i < %this.getSelectionSize(); %i++) { %obj = %this.getSelectedObject(%i); %transform = %obj.getTransform(); %transform = setWord(%transform, 3, "0"); %transform = setWord(%transform, 4, "0"); %transform = setWord(%transform, 5, "1"); %transform = setWord(%transform, 6, "0"); // %obj.setTransform(%transform); %obj.setScale("1 1 1"); } } function WorldEditorToolbarDlg::init(%this) { WorldEditorInspectorCheckBox.setValue(WorldEditorToolFrameSet.isMember("EditorToolInspectorGui")); WorldEditorMissionAreaCheckBox.setValue(WorldEditorToolFrameSet.isMember("EditorToolMissionAreaGui")); WorldEditorTreeCheckBox.setValue(WorldEditorToolFrameSet.isMember("EditorToolTreeViewGui")); WorldEditorCreatorCheckBox.setValue(WorldEditorToolFrameSet.isMember("EditorToolCreatorGui")); } function Creator::init(%this) { %this.clear(); // %this.currentSel = -1; // %this.currentRoot = -1; // %this.currentObj = -1; $InstantGroup = "MissionGroup"; // *** INTERIORS %base = %this.addGroup(0, "Interiors"); %misc = %this.addGroup(%base, "Misc."); // %shapeGroup[0] = "Blood Eagle - Lush"; %shapeGroup[1] = "Diamond Sword - Volcanic"; %shapeGroup[2] = "Star Wolf - Ice"; %shapeGroup[3] = "Children of the Phoenix - Desert"; %shapeGroup[4] = "Bioderm - Badlands"; %groupShort[0] = "b"; %groupShort[1] = "d"; %groupShort[2] = "s"; %groupShort[3] = "p"; %groupShort[4] = "x"; // %shapeType[0] = "Towers"; %shapeType[1] = "Bunkers"; %shapeType[2] = "Base"; %shapeType[3] = "Platform"; %shapeType[4] = "Bridge"; %shapeType[5] = "Wall"; %shapeType[6] = "Unique"; %shapeType[7] = "Power"; %shapeType[8] = "Misc."; %shapeType[9] = "Vehicle"; %shapeType[10] = "Rocks"; %typeShort[0] = "towr"; %typeShort[1] = "bunk"; %typeShort[2] = "base"; %typeShort[3] = "plat"; %typeShort[4] = "brdg"; %typeShort[5] = "wall"; %typeShort[6] = "uniq"; %typeShort[7] = "powr"; %typeShort[8] = "misc"; %typeShort[9] = "vbay"; %typeShort[10] = "rock"; // create the groups %grpCount = 0; for(%i = 0; %shapeGroup[%i] !$= ""; %i++) { %parent = Creator.addGroup(%base, %shapeGroup[%i]); for(%j = 0; %shapeType[%j] !$= ""; %j++) { %group[%grpCount] = %this.addGroup(%parent, %shapeType[%j]); %grpCount++; } } // walk all the interiors and add them to the correct group %file = findFirstFile("interiors/*.dif"); while(%file !$= "") { %file = fileBase(%file); %grpCount = 0; %added = false; for(%i = 0; !%added && %shapeGroup[%i] !$= ""; %i++) { for(%j = 0; %shapeType[%j] !$= ""; %j++) { if(%this.fileNameMatch(%groupShort[%i], %typeShort[%j], %file)) { %this.addItem(%group[%grpCount], %file, "createInterior(" @ "\"" @ %file @ ".dif\"" @ ");"); %added = true; } %grpCount++; } } // throw it in the 'misc' directory if(!%added) %this.addItem(%misc, %file, "createInterior(" @ "\"" @ %file @ ".dif\"" @ ");"); %file = findNextFile("interiors/*.dif"); } // *** SHAPES - add in all the shapes now... %base = %this.addGroup(0, "Shapes"); %dataGroup = "DataBlockGroup"; for(%i = 0; %i < %dataGroup.getCount(); %i++) { %obj = %dataGroup.getObject(%i); if(%obj.catagory !$= "" || %obj.catagory != 0) { %grp = %this.addGroup(%base, %obj.catagory); %this.addItem(%grp, %obj.getName(), %obj.getClassName() @ "::create(" @ %obj.getName() @ ");"); } } // Statics %staticBase = %this.addGroup(0, "Static Objects"); for (%i = 0; %i < $NumStaticTSObjects; %i++) { echo("This: " SPC $StaticTSObjects[%i]); echo(getWord($StaticTSObjects[%i], 2)); %grp = %this.addGroup(%staticBase, getWord($StaticTSObjects[%i], 0)); echo("TSStatic::create(" @ getWord($StaticTSObjects[%i], 2) @");"); %this.addItem(%grp, getWord($StaticTSObjects[%i], 1), "TSStatic::create(\"" @ getWord($StaticTSObjects[%i], 2) @"\");"); } // *** OBJECTS - do the objects now... %objGroup[0] = "Environment"; %objGroup[1] = "Mission"; %objGroup[2] = "System"; %objGroup[3] = "AI"; %Environment_Item[0] = "Sky"; %Environment_Item[1] = "Sun"; %Environment_Item[2] = "Lightning"; %Environment_Item[3] = "Water"; %Environment_Item[4] = "Terrain"; %Environment_Item[5] = "AudioEmitter"; %Environment_Item[6] = "Precipitation"; %Environment_Item[7] = "ParticleEmitter"; %Mission_Item[0] = "MissionArea"; %Mission_Item[1] = "GameType"; %Mission_Item[2] = "Marker"; %Mission_Item[3] = "Forcefield"; %Mission_Item[4] = "Trigger"; %Mission_Item[5] = "PhysicalZone"; %Mission_Item[6] = "Camera"; %System_Item[0] = "SimGroup"; %AI_Item[0] = "Objective"; //%AI_Item[1] = "NavigationGraph"; // objects group %base = %this.addGroup(0, "Objects"); // create 'em for(%i = 0; %objGroup[%i] !$= ""; %i++) { %grp = %this.addGroup(%base, %objGroup[%i]); %groupTag = "%" @ %objGroup[%i] @ "_Item"; %done = false; for(%j = 0; !%done; %j++) { eval("%itemTag = " @ %groupTag @ %j @ ";"); if(%itemTag $= "") %done = true; else %this.addItem(%grp, %itemTag, "ObjectBuilderGui.build" @ %itemTag @ "();"); } } } function createInterior(%name) { %obj = new InteriorInstance() { position = "0 0 0"; rotation = "0 0 0"; interiorFile = %name; }; return(%obj); } function Creator::onAction(%this) { // %this.currentSel = -1; // %this.currentRoot = -1; // %this.currentObj = -1; %sel = %this.getSelected(); if(%sel == -1 || %this.isGroup(%sel) || !$MissionRunning) return; // the value is the callback function.. if(%this.getValue(%sel) $= "") return; %this.currentSel = %sel; %this.currentRoot = %this.getRootGroup(%sel); %this.create(%sel); } function Creator::create(%this, %sel) { // create the obj and add to the instant group %obj = eval(%this.getValue(%sel)); if(%obj == -1 || %obj == 0) return; // %this.currentObj = %obj; $InstantGroup.add(%obj); // drop it from the editor - only SceneObjects can be selected... EWorldEditor.clearSelection(); EWorldEditor.selectObject(%obj); EWorldEditor.dropSelection(); } function TSStatic::create(%shapeName) { %obj = new TSStatic() { shapeName = %shapeName; }; return(%obj); } function TSStatic::damage(%this) { // prevent console error spam } //function Creator::getRootGroup(%sel) //{ // if(%sel == -1 || %sel == 0) // return(-1); // // %parent = %this.getParent(%sel); // while(%parent != 0 || %parent != -1) // { // %sel = %parent; // %parent = %this.getParent(%sel); // } // // return(%sel); //} // //function Creator::getLastItem(%rootGroup) //{ // %traverse = %rootGroup + 1; // while(%this.getRootGroup(%traverse) == %rootGroup) // %traverse++; // return(%traverse - 1); //} // //function Creator::createNext(%this) //{ // if(%this.currentSel == -1 || %this.currentRoot == -1 || %this.currentObj == -1) // return; // // %sel = %this.currentSel; // %this.currentSel++; // // while(%this.currentSel != %sel) // { // if(%this.getRootGroup(%this.currentSel) != %this.currentRoot) // %this.currentSel = %this.currentRoot + 1; // // if(%this.isGroup(%this.currentSel)) // %this.currentSel++; // else // %sel = %this.currentSel; // } // // // // %this.currentObj.delete(); // %this.create(%sel); //} // //function Creator::createPrevious(%this) //{ // if(%this.currentSel == -1 || %this.currentGroup == -1 || %this.currentObj == -1) // return; // // %sel = %this.currentSel; // %this.currentSel--; // // while(%this.currentSel != %sel) // { // if(%this.getRootGroup(%this.currentSel) != %this.currentRoot) // %this.currentSel = getLastItem(%this.currentRoot); // // if(%this.isGroup(%this.currentSel)) // %this.currentSel--; // else // %sel = %this.currentSel; // } // // // // %this.currentObj.delete(); // %this.create(%sel); //} function TerraformerGui::init(%this) { TerraformerHeightfieldGui.init(); TerraformerTextureGui.init(); } function TerraformerGui::onWake(%this) { // Only the canvas level gui's get wakes, so udpate manually. TerraformerTextureGui.update(); } function TerraformerGui::onSleep(%this) { %this.setPrefs(); } $nextTextureId = 1; $nextTextureRegister = 1000; $selectedMaterial = -1; $selectedTextureOperation = -1; $TerraformerTextureDir = "common/editor/textureScripts"; //-------------------------------------- function TextureInit() { // Assumes the terrain object is called terrain Texture_operation_menu.clear(); Texture_operation_menu.setText("Placement Operations"); Texture_operation_menu.add("Place by Fractal", 1); Texture_operation_menu.add("Place by Height", 2); Texture_operation_menu.add("Place by Slope", 3); Texture_operation_menu.add("Place by Water Level", 4); $HeightfieldSrcRegister = Heightfield_operation.rowCount()-1; // sync up the preview windows TexturePreview.setValue(HeightfieldPreview.getValue()); %script = terrain.getTextureScript(); if(%script !$= "") Texture::loadFromScript(%script); if (Texture_material.rowCount() == 0) { Texture_operation.clear(); $nextTextureRegister = 1000; } else { // it's difficult to tell if the heightfield was modified so // just in case flag all dependent operations as dirty. %rowCount = Texture_material.rowCount(); for (%row = 0; %row < %rowCount; %row++) { %data = Texture_material.getRowText(%row); %entry= getRecord(%data,0); %reg = getField(%entry,1); $dirtyTexture[ %reg ] = true; %opCount = getRecordCount(%data); for (%op = 2; %op < %opCount; %op++) { %entry= getRecord(%data,%op); %label= getField(%entry,0); if (%label !$= "Place by Fractal" && %label !$= "Fractal Distortion") { %reg = getField(%entry,2); $dirtyTexture[ %reg ] = true; } } } Texture::previewMaterial(); } } function TerraformerTextureGui::refresh(%this) { } //-------------------------------------- function Texture_material_menu::onSelect(%this, %id, %text) { %this.setText("Materials"); // FORMAT // material name // register // operation // name // tab name // register // distortion register // {field,value}, ... // operation // ... Texture::saveMaterial(); Texture::hideTab(); %id = Texture::addMaterial(%text @ "\t" @ $nextTextureRegister++); if (%id != -1) { Texture_material.setSelectedById(%id); Texture::addOperation("Fractal Distortion\ttab_DistortMask\t" @ $nextTextureRegister++ @ "\t0\tdmask_interval\t20\tdmask_rough\t0\tdmask_seed\t" @ terraFormer.generateSeed() @ "\tdmask_filter\t0.00000 0.00000 0.13750 0.487500 0.86250 1.00000 1.00000"); } } function Texture::addMaterialTexture() { %root = filePath(terrain.terrainFile); getLoadFilename("textures/terrain/*.png\ttextures/terrain/*.jpg", addLoadedMaterial); } function addLoadedMaterial(%file) { Texture::saveMaterial(); Texture::hideTab(); %text = fileBase(%file); %id = Texture::addMaterial(%text @ "\t" @ $nextTextureRegister++); if (%id != -1) { Texture_material.setSelectedById(%id); Texture::addOperation("Fractal Distortion\ttab_DistortMask\t" @ $nextTextureRegister++ @ "\t0\tdmask_interval\t20\tdmask_rough\t0\tdmask_seed\t" @ terraFormer.generateSeed() @ "\tdmask_filter\t0.00000 0.00000 0.13750 0.487500 0.86250 1.00000 1.00000"); } Texture::save(); } //-------------------------------------- function Texture_material::onSelect(%this, %id, %text) { Texture::saveMaterial(); if (%id != $selectedMaterial) { $selectedTextureOperation = -1; Texture_operation.clear(); Texture::hideTab(); Texture::restoreMaterial(%id); } %matName = getField(%text, 0); ETerrainEditor.paintMaterial = %matName; Texture::previewMaterial(%id); $selectedMaterial = %id; $selectedTextureOperation = -1; Texture_operation.clearSelection(); } //-------------------------------------- function Texture_operation_menu::onSelect(%this, %id, %text) { %this.setText("Placement Operations"); %id = -1; if ($selectedMaterial == -1) return; %dreg = getField(Texture_operation.getRowText(0),2); switch$ (%text) { case "Place by Fractal": %id = Texture::addOperation("Place by Fractal\ttab_FractalMask\t" @ $nextTextureRegister++ @ "\t" @ %dreg @ "\tfbmmask_interval\t16\tfbmmask_rough\t0.000\tfbmmask_seed\t" @ terraFormer.generateSeed() @ "\tfbmmask_filter\t0.000000 0.166667 0.333333 0.500000 0.666667 0.833333 1.000000\tfBmDistort\ttrue"); case "Place by Height": %id = Texture::addOperation("Place by Height\ttab_HeightMask\t" @ $nextTextureRegister++ @ "\t" @ %dreg @ "\ttextureHeightFilter\t0 0.2 0.4 0.6 0.8 1.0\theightDistort\ttrue"); case "Place by Slope": %id = Texture::addOperation("Place by Slope\ttab_SlopeMask\t" @ $nextTextureRegister++ @ "\t" @ %dreg @ "\ttextureSlopeFilter\t0 0.2 0.4 0.6 0.8 1.0\tslopeDistort\ttrue"); case "Place by Water Level": %id = Texture::addOperation("Place by Water Level\ttab_WaterMask\t" @ $nextTextureRegister++ @ "\t" @ %dreg @ "\twaterDistort\ttrue"); } // select it Texture::hideTab(); if (%id != -1) Texture_operation.setSelectedById(%id); } //-------------------------------------- function Texture_operation::onSelect(%this, %id, %text) { Texture::saveOperation(); if (%id !$= $selectedTextureOperation) { Texture::hideTab(); Texture::restoreOperation(%id); Texture::showTab(%id); } Texture::previewOperation(%id); $selectedTextureOperation = %id; } //-------------------------------------- function Texture::deleteMaterial(%id) { if (%id $= "") %id = $selectedMaterial; if (%id == -1) return; %row = Texture_material.getRowNumById(%id); Texture_material.removeRow(%row); // find the next row to select %rowCount = Texture_material.rowCount()-1; if (%row > %rowCount) %row = %rowCount; if (%id == $selectedMaterial) $selectedMaterial = -1; Texture_operation.clear(); %id = Texture_material.getRowId(%row); Texture_material.setSelectedById(%id); Texture::save(); } //-------------------------------------- function Texture::deleteOperation(%id) { if (%id $= "") %id = $selectedTextureOperation; if (%id == -1) return; %row = Texture_operation.getRowNumById(%id); // don't delete the first entry if (%row == 0) return; Texture_operation.removeRow(%row); // find the next row to select %rowCount = Texture_operation.rowCount()-1; if (%row > %rowCount) %row = %rowCount; if (%id == $selectedTextureOperation) $selectedTextureOperation = -1; %id = Texture_operation.getRowId(%row); Texture_operation.setSelectedById(%id); Texture::save(); } //-------------------------------------- function Texture::applyMaterials() { Texture::saveMaterial(); %count = Texture_material.rowCount(); if (%count > 0) { %data = getRecord(Texture_material.getRowText(0),0); %mat_list = getField( %data, 0); %reg_list = getField( %data, 1); Texture::evalMaterial(Texture_material.getRowId(0)); for (%i=1; %i<%count; %i++) { Texture::evalMaterial(Texture_material.getRowId(%i)); %data = getRecord(Texture_material.getRowText(%i),0); %mat_list = %mat_list @ " " @ getField( %data, 0); %reg_list = %reg_list @ " " @ getField( %data, 1); } terraformer.setMaterials(%reg_list, %mat_list); } } //-------------------------------------- function Texture::previewMaterial(%id) { if (%id $= "") %id = $selectedMaterial; if (%id == -1) return; %data = Texture_material.getRowTextById(%id); %row = Texture_material.getRowNumById(%id); %reg = getField(getRecord(%data,0),1); Texture::evalMaterial(%id); terraformer.preview(TexturePreview, %reg); } //-------------------------------------- function Texture::evalMaterial(%id) { if (%id $= "") %id = $selectedMaterial; if (%id == -1) return; %data = Texture_material.getRowTextbyId(%id); %reg = getField(getRecord(%data,0), 1); // make sure all operation on this material are up to date // and accumulate register data for each %opCount = getRecordCount(%data); if (%opCount >= 2) // record0=material record1=fractal { %entry = getRecord(%data, 1); Texture::evalOperationData(%entry, 1); for (%op=2; %op<%opCount; %op++) { %entry = getRecord(%data, %op); %reg_list = %reg_list @ getField(%entry, 2) @ " "; Texture::evalOperationData(%entry, %op); } // merge the masks in to the dst reg terraformer.mergeMasks(%reg_list, %reg); } Texture::save(); } //-------------------------------------- function Texture::evalOperation(%id) { if (%id $= "") %id = $selectedTextureOperation; if (%id == -1) return; %data = Texture_operation.getRowTextById(%id); %row = Texture_operation.getRowNumById(%id); if (%row != 0) Texture::evalOperation( Texture_operation.getRowId(0) ); Texture::evalOperationData(%data, %row); Texture::save(); } //-------------------------------------- function Texture::evalOperationData(%data, %row) { %label = getField(%data, 0); %reg = getField(%data, 2); %dreg = getField(%data, 3); %id = Texture_material.getRowId(%row); if ( $dirtyTexture[%reg] == false ) { return; } switch$ (%label) { case "Fractal Distortion": terraformer.maskFBm( %reg, getField(%data,5), getField(%data,7), getField(%data,9), getField(%data,11), false, 0 ); case "Place by Fractal": terraformer.maskFBm( %reg, getField(%data,5), getField(%data,7), getField(%data,9), getField(%data,11), getField(%data,13), %dreg ); case "Place by Height": terraformer.maskHeight( $HeightfieldSrcRegister, %reg, getField(%data,5), getField(%data,7), %dreg ); case "Place by Slope": terraformer.maskSlope( $HeightfieldSrcRegister, %reg, getField(%data,5), getField(%data,7), %dreg ); case "Place by Water Level": terraformer.maskWater( $HeightfieldSrcRegister, %reg, getField(%data,5), %dreg ); } $dirtyTexture[%reg] = false; } //-------------------------------------- function Texture::previewOperation(%id) { if (%id $= "") %id = $selectedTextureOperation; if (%id == -1) return; %row = Texture_operation.getRowNumById(%id); %data = Texture_operation.getRowText(%row); %reg = getField(%data,2); Texture::evalOperation(%id); terraformer.preview(TexturePreview, %reg); } //-------------------------------------- function Texture::restoreMaterial(%id) { if (%id == -1) return; %data = Texture_material.getRowTextById(%id); Texture_operation.clear(); %recordCount = getRecordCount(%data); for (%record=1; %record<%recordCount; %record++) { %entry = getRecord(%data, %record); Texture_operation.addRow($nextTextureId++, %entry); } } //-------------------------------------- function Texture::saveMaterial() { %id = $selectedMaterial; if (%id == -1) return; Texture::SaveOperation(); %data = Texture_Material.getRowTextById(%id); %newData = getRecord(%data,0); %rowCount = Texture_Operation.rowCount(); for (%row=0; %row<%rowCount; %row++) %newdata = %newdata @ "\n" @ Texture_Operation.getRowText(%row); Texture_Material.setRowById(%id, %newdata); Texture::save(); } //-------------------------------------- function Texture::restoreOperation(%id) { if (%id == -1) return; %data = Texture_operation.getRowTextById(%id); %fieldCount = getFieldCount(%data); for (%field=4; %field<%fieldCount; %field += 2) { %obj = getField(%data, %field); %obj.setValue( getField(%data, %field+1) ); } Texture::save(); } //-------------------------------------- function Texture::saveOperation() { %id = $selectedTextureOperation; if (%id == -1) return; %data = Texture_operation.getRowTextById(%id); %newData = getField(%data,0) @ "\t" @ getField(%data,1) @ "\t" @ getField(%data,2) @ "\t" @ getField(%data,3); // go through each object and update its value %fieldCount = getFieldCount(%data); for (%field=4; %field<%fieldCount; %field += 2) { %obj = getField(%data, %field); %newdata = %newdata @ "\t" @ %obj @ "\t" @ %obj.getValue(); } %dirty = (%data !$= %newdata); %reg = getField(%data, 2); $dirtyTexture[%reg] = %dirty; Texture_operation.setRowById(%id, %newdata); // mark the material register as dirty too if (%dirty == true) { %data = Texture_Material.getRowTextById($selectedMaterial); %reg = getField(getRecord(%data,0), 1); $dirtyTexture[ %reg ] = true; } // if row is zero the fractal mask was modified // mark everything else in the list as dirty %row = Texture_material.getRowNumById(%id); if (%row == 0) { %rowCount = Texture_operation.rowCount(); for (%r=1; %r<%rowCount; %r++) { %data = Texture_operation.getRowText(%r); $dirtyTexture[ getField(%data,2) ] = true; } } Texture::save(); } //-------------------------------------- function Texture::addMaterial(%entry) { %id = $nextTextureId++; Texture_material.addRow(%id, %entry); %reg = getField(%entry, 1); $dirtyTexture[%reg] = true; Texture::save(); return %id; } //-------------------------------------- function Texture::addOperation(%entry) { // Assumes: operation is being added to selected material %id = $nextTextureId++; Texture_operation.addRow(%id, %entry); %reg = getField(%entry, 2); $dirtyTexture[%reg] = true; Texture::save(); return %id; } //-------------------------------------- function Texture::save() { %script = ""; // loop through each operation and save it to disk %rowCount = Texture_material.rowCount(); for(%row = 0; %row < %rowCount; %row++) { if(%row != 0) %script = %script @ "\n"; %data = expandEscape(Texture_material.getRowText(%row)); %script = %script @ %data; } terrain.setTextureScript(%script); ETerrainEditor.isDirty = true; } //-------------------------------------- function Texture::import() { getLoadFilename("*.ter", "Texture::doLoadTexture"); } function Texture::loadFromScript(%script) { Texture_material.clear(); Texture_operation.clear(); $selectedMaterial = -1; $selectedTextureOperation = -1; %i = 0; for(%rec = getRecord(%script, %i); %rec !$= ""; %rec = getRecord(%script, %i++)) Texture::addMaterial(collapseEscape(%rec)); // initialize dirty register array // patch up register usage // ...and deterime what the next register should be. $nextTextureRegister = 1000; %rowCount = Texture_material.rowCount(); for (%row = 0; %row < %rowCount; %row++) { $dirtyTexture[ $nextTextureRegister ] = true; %data = Texture_material.getRowText(%row); %rec = getRecord(%data, 0); %rec = setField(%rec, 1, $nextTextureRegister); %data = setRecord(%data, 0, %rec); $nextTextureRegister++; %opCount = getRecordCount(%data); for (%op = 1; %op < %opCount; %op++) { if (%op == 1) %frac_reg = $nextTextureRegister; $dirtyTexture[ $nextTextureRegister ] = true; %rec = getRecord(%data,%op); %rec = setField(%rec, 2, $nextTextureRegister); %rec = setField(%rec, 3, %frac_reg); %data = setRecord(%data, %op, %rec); $nextTextureRegister++; } %id = Texture_material.getRowId(%row); Texture_material.setRowById(%id, %data); } $selectedMaterial = -1; Texture_material.setSelectedById(Texture_material.getRowId(0)); } //-------------------------------------- function Texture::doLoadTexture(%name) { // ok, we're getting a terrain file... %newTerr = new TerrainBlock() // unnamed - since we'll be deleting it shortly: { position = "0 0 0"; terrainFile = strip("terrains/", %name); squareSize = 8; visibleDistance = 100; }; if(isObject(%newTerr)) { %script = %newTerr.getTextureScript(); if(%script !$= "") Texture::loadFromScript(%script); %newTerr.delete(); } } //-------------------------------------- function Texture::hideTab() { tab_DistortMask.setVisible(false); tab_FractalMask.setVisible(false); tab_HeightMask.setVisible(false); tab_SlopeMask.setVisible(false); tab_waterMask.setVisible(false); } //-------------------------------------- function Texture::showTab(%id) { Texture::hideTab(); %data = Texture_operation.getRowTextById(%id); %tab = getField(%data,1); %tab.setVisible(true); } function tab_Blend::reset(%this) { blend_option.clear(); blend_option.add("Add", 0); blend_option.add("Subtract", 1); blend_option.add("Max", 2); blend_option.add("Min", 3); blend_option.add("Multiply", 4); } function tab_fBm::reset(%this) { fBm_detail.clear(); fBm_detail.add("Very Low", 0); fBm_detail.add("Low", 1); fBm_detail.add("Normal", 2); fBm_detail.add("High", 3); fBm_detail.add("Very High", 4); } function tab_RMF::reset(%this) { rmf_detail.clear(); rmf_detail.add("Very Low", 0); rmf_detail.add("Low", 1); rmf_detail.add("Normal", 2); rmf_detail.add("High", 3); rmf_detail.add("Very High", 4); } function tab_terrainFile::reset(%this) { // update tab controls.. terrainFile_textList.clear(); %filespec = "terrains/*.ter"; for(%file = findFirstFile(%filespec); %file !$= ""; %file = findNextFile(%filespec)) terrainFile_textList.addRow(%i++, fileBase(%file) @ fileExt(%file)); } function tab_canyon::reset() { } function tab_smooth::reset() { } function tab_smoothWater::reset() { } function tab_smoothRidge::reset() { } function tab_filter::reset() { } function tab_turbulence::reset() { } function tab_thermal::reset() { } function tab_hydraulic::reset() { } function tab_general::reset() { } function tab_bitmap::reset() { } function tab_sinus::reset() { } //-------------------------------------- function Heightfield::resetTabs() { tab_terrainFile.reset(); tab_fbm.reset(); tab_rmf.reset(); tab_canyon.reset(); tab_smooth.reset(); tab_smoothWater.reset(); tab_smoothRidge.reset(); tab_filter.reset(); tab_turbulence.reset(); tab_thermal.reset(); tab_hydraulic.reset(); tab_general.reset(); tab_bitmap.reset(); tab_blend.reset(); tab_sinus.reset(); } //-------------------------------------- function TerraformerInit() { Heightfield_options.clear(); Heightfield_options.setText("Operation"); Heightfield_options.add("fBm Fractal",0); Heightfield_options.add("Rigid MultiFractal",1); Heightfield_options.add("Canyon Fractal",2); Heightfield_options.add("Sinus",3); Heightfield_options.add("Bitmap",4); Heightfield_options.add("Turbulence",5); Heightfield_options.add("Smoothing",6); Heightfield_options.add("Smooth Water",7); Heightfield_options.add("Smooth Ridges/Valleys", 8); Heightfield_options.add("Filter",9); Heightfield_options.add("Thermal Erosion",10); Heightfield_options.add("Hydraulic Erosion",11); Heightfield_options.add("Blend",12); Heightfield_options.add("Terrain File",13); Heightfield::resetTabs(); %script = Terrain.getHeightfieldScript(); if(%script !$= "") Heightfield::loadFromScript(%script); if (Heightfield_operation.rowCount() == 0) { Heightfield_operation.clear(); %id1 = Heightfield::add("General\tTab_general\tgeneral_min_height\t50\tgeneral_scale\t300\tgeneral_water\t0.000\tgeneral_centerx\t0\tgeneral_centery\t0"); Heightfield_operation.setSelectedById(%id1); } Heightfield::resetTabs(); Heightfield::preview(); } //-------------------------------------- function Heightfield_options::onSelect(%this, %_id, %text) { Heightfield_options.setText("Operation"); %id = -1; %rowCount = Heightfield_operation.rowCount(); // FORMAT // item name // tab name // control name // control value switch$(%text) { case "Terrain File": %id = HeightField::add("Terrain File\ttab_terrainFile\tterrainFile_terrFileText\tterrains/terr1.ter\tterrainFile_textList\tterr1.ter"); case "fBm Fractal": %id = Heightfield::add("fBm Fractal\ttab_fBm\tfbm_interval\t9\tfbm_rough\t0.000\tfBm_detail\tNormal\tfBm_seed\t" @ terraformer.generateSeed()); case "Rigid MultiFractal": %id = Heightfield::add("Rigid MultiFractal\ttab_RMF\trmf_interval\t4\trmf_rough\t0.000\trmf_detail\tNormal\trmf_seed\t" @ terraformer.generateSeed()); case "Canyon Fractal": %id = Heightfield::add("Canyon Fractal\ttab_Canyon\tcanyon_freq\t5\tcanyon_factor\t0.500\tcanyon_seed\t" @ terraformer.generateSeed()); case "Sinus": %id = Heightfield::add("Sinus\ttab_Sinus\tsinus_filter\t1 0.83333 0.6666 0.5 0.33333 0.16666 0\tsinus_seed\t" @ terraformer.generateSeed()); case "Bitmap": %id = Heightfield::add("Bitmap\ttab_Bitmap\tbitmap_name\t"); Heightfield::setBitmap(); } if (Heightfield_operation.rowCount() >= 1) { switch$(%text) { case "Smoothing": %id = Heightfield::add("Smoothing\ttab_Smooth\tsmooth_factor\t0.500\tsmooth_iter\t0"); case "Smooth Water": %id = Heightfield::add("Smooth Water\ttab_SmoothWater\twatersmooth_factor\t0.500\twatersmooth_iter\t0"); case "Smooth Ridges/Valleys": %id = Heightfield::add("Smooth Ridges/Valleys\ttab_SmoothRidge\tridgesmooth_factor\t0.8500\tridgesmooth_iter\t1"); case "Filter": %id = Heightfield::add("Filter\ttab_Filter\tfilter\t0 0.16666667 0.3333333 0.5 0.6666667 0.8333333 1"); case "Turbulence": %id = Heightfield::add("Turbulence\ttab_Turbulence\tturbulence_factor\t0.250\tturbulence_radius\t10"); case "Thermal Erosion": %id = Heightfield::add("Thermal Erosion\ttab_Thermal\tthermal_slope\t30\tthermal_cons\t80.0\tthermal_iter\t0"); case "Hydraulic Erosion": %id = Heightfield::add("Hydraulic Erosion\ttab_Hydraulic\thydraulic_iter\t0\thydraulic_filter\t0 0.16666667 0.3333333 0.5 0.6666667 0.8333333 1"); } } if (Heightfield_operation.rowCount() >= 2) { if("Blend" $= %text) %id = Heightfield::add("Blend\ttab_Blend\tblend_factor\t0.500\tblend_srcB\t" @ %rowCount-2 @"\tblend_option\tadd"); } // select it if (%id != -1) Heightfield_operation.setSelectedById(%id); } //-------------------------------------- function Heightfield::eval(%id) { if (%id == -1) return; %data = restWords(Heightfield_operation.getRowTextById(%id)); %label = getField(%data,0); %row = Heightfield_operation.getRowNumById(%id); echo("Heightfield::eval:" @ %row @ " " @ %label ); switch$(%label) { case "General": if (Terrain.squareSize>0) %size = Terrain.squareSize; else %size = 8; terraformer.setTerrainInfo( 256, %size, getField(%data,3), getField(%data,5), getField(%data,7) ); terraformer.setShift( getField(%data,9), getField(%data,11) ); terraformer.terrainData(%row); case "Terrain File": terraformer.terrainFile(%row, getField(%data,3)); case "fBm Fractal": terraformer.fBm( %row, getField(%data,3), getField(%data,5), getField(%data,7), getField(%data,9) ); case "Sinus": terraformer.sinus( %row, getField(%data,3), getField(%data,5) ); case "Rigid MultiFractal": terraformer.rigidMultiFractal( %row, getField(%data,3), getField(%data,5), getField(%data,7), getField(%data,9) ); case "Canyon Fractal": terraformer.canyon( %row, getField(%data,3), getField(%data,5), getField(%data,7) ); case "Smoothing": terraformer.smooth( %row-1, %row, getField(%data,3), getField(%data,5) ); case "Smooth Water": terraformer.smoothWater( %row-1, %row, getField(%data,3), getField(%data,5) ); case "Smooth Ridges/Valleys": terraformer.smoothRidges( %row-1, %row, getField(%data,3), getField(%data,5) ); case "Filter": terraformer.filter( %row-1, %row, getField(%data,3) ); case "Turbulence": terraformer.turbulence( %row-1, %row, getField(%data,3), getField(%data,5) ); case "Thermal Erosion": terraformer.erodeThermal( %row-1, %row, getField(%data,3), getField(%data,5),getField(%data,7) ); case "Hydraulic Erosion": terraformer.erodeHydraulic( %row-1, %row, getField(%data,3), getField(%data,5) ); case "Bitmap": terraformer.loadGreyscale(%row, getField(%data,3)); case "Blend": %rowCount = Heightfield_operation.rowCount(); if(%rowCount > 2) { %a = Heightfield_operation.getRowNumById(%id)-1; %b = getField(%data, 5); echo("Blend: " @ %data); echo("Blend: " @ getField(%data,3) @ " " @ getField(%data,7)); if(%a < %rowCount || %a > 0 || %b < %rowCount || %b > 0 ) terraformer.blend(%a, %b, %row, getField(%data,3), getField(%data,7) ); else echo("Heightfield Editor: Blend parameters out of range."); } } } //-------------------------------------- function Heightfield::add(%entry) { Heightfield::saveTab(); Heightfield::hideTab(); %id = $NextOperationId++; if ($selectedOperation != -1) { %row = Heightfield_operation.getRowNumById($selectedOperation) + 1; %entry = %row @ " " @ %entry; Heightfield_operation.addRow(%id, %entry, %row); // insert // adjust row numbers for(%i = %row+1; %i < Heightfield_operation.rowCount(); %i++) { %id = Heightfield_operation.getRowId(%i); %text = Heightfield_operation.getRowTextById(%id); %text = setWord(%text, 0, %i); Heightfield_operation.setRowById(%id, %text); } } else { %entry = Heightfield_operation.rowCount() @ " " @ %entry; Heightfield_operation.addRow(%id, %entry); // add to end } %row = Heightfield_operation.getRowNumById(%id); if (%row <= $HeightfieldDirtyRow) $HeightfieldDirtyRow = %row; Heightfield::save(); return %id; } //-------------------------------------- function Heightfield::onDelete(%id) { if (%id $= "") %id = $selectedOperation; %row = Heightfield_operation.getRowNumById(%id); // don't delete the first entry if (%row == 0) return; Heightfield_operation.removeRow(%row); // adjust row numbers for(%i = %row; %i < Heightfield_operation.rowCount(); %i++) { %id2 = Heightfield_operation.getRowId(%i); %text = Heightfield_operation.getRowTextById(%id2); %text = setWord(%text, 0, %i); Heightfield_operation.setRowById(%id2, %text); } // adjust the Dirty Row position if ($HeightfieldDirtyRow >= %row) $HeightfieldDirtyRow = %row; // find the next row to select %rowCount = Heightfield_operation.rowCount()-1; if (%row > %rowCount) %row = %rowCount; if (%id == $selectedOperation) $selectedOperation = -1; %id = Heightfield_operation.getRowId(%row); Heightfield_operation.setSelectedById(%id); Heightfield::save(); } //-------------------------------------- function Heightfield_operation::onSelect(%this, %id, %text) { Heightfield::saveTab(); Heightfield::hideTab(); $selectedOperation = %id; Heightfield::restoreTab($selectedOperation); Heightfield::showTab($selectedOperation); Heightfield::preview($selectedOperation); } //-------------------------------------- function Heightfield::restoreTab(%id) { if (%id == -1) return; Heightfield::hideTab(); %data = restWords(Heightfield_operation.getRowTextById(%id)); %fieldCount = getFieldCount(%data); for (%field=2; %field<%fieldCount; %field += 2) { %obj = getField(%data, %field); %obj.setValue( getField(%data, %field+1) ); } Heightfield::save(); } //-------------------------------------- function Heightfield::saveTab() { if ($selectedOperation == -1) return; %data = Heightfield_operation.getRowTextById($selectedOperation); %rowNum = getWord(%data, 0); %data = restWords(%data); %newdata = getField(%data,0) @ "\t" @ getField(%data,1); %fieldCount = getFieldCount(%data); for (%field=2; %field < %fieldCount; %field += 2) { %obj = getField(%data, %field); %newdata = %newdata @ "\t" @ %obj @ "\t" @ %obj.getValue(); } // keep track of the top-most dirty operation // so we know who to evaluate later if (%data !$= %newdata) { %row = Heightfield_operation.getRowNumById($selectedOperation); if (%row <= $HeightfieldDirtyRow && %row > 0) $HeightfieldDirtyRow = %row; } Heightfield_operation.setRowById($selectedOperation, %rowNum @ " " @ %newdata); Heightfield::save(); } //-------------------------------------- function Heightfield::preview(%id) { %rowCount = Heightfield_operation.rowCount(); if (%id $= "") %id = Heightfield_operation.getRowId(%rowCount-1); %row = Heightfield_operation.getRowNumById(%id); Heightfield::refresh(%row); terraformer.previewScaled(HeightfieldPreview, %row); } //-------------------------------------- function Heightfield::refresh(%last) { if (%last $= "") %last = Heightfield_operation.rowCount()-1; // always update the general info Heightfield::eval(Heightfield_operation.getRowId(0)); for( 0; $HeightfieldDirtyRow<=%last; $HeightfieldDirtyRow++) { %id = Heightfield_operation.getRowId($HeightfieldDirtyRow); Heightfield::eval(%id); } Heightfield::save(); } //-------------------------------------- function Heightfield::apply(%id) { %rowCount = Heightfield_operation.rowCount(); if (%rowCount < 1) return; if (%id $= "") %id = Heightfield_operation.getRowId(%rowCount-1); %row = Heightfield_operation.getRowNumById(%id); HeightfieldPreview.setRoot(); Heightfield::refresh(%row); terraformer.setTerrain(%row); terraformer.setCameraPosition(0,0,0); ETerrainEditor.isDirty = true; } //-------------------------------------- $TerraformerSaveRegister = 0; function Heightfield::saveBitmap(%name) { if(%name $= "") getSaveFilename("terrains/heightfield/*png", "Heightfield::doSaveBitmap"); else Heightfield::doSaveBitmap(%name); } function Heightfield::doSaveBitmap(%name) { %name = fileBase(%name) @ fileExt(%name); terraformer.saveGreyscale($TerraformerSaveRegister, "terrains/heightfield/" @ %name); } //-------------------------------------- function Heightfield::save() { %script = ""; %rowCount = Heightfield_operation.rowCount(); for(%row = 0; %row < %rowCount; %row++) { if(%row != 0) %script = %script @ "\n"; %data = restWords(Heightfield_operation.getRowText(%row)); %script = %script @ expandEscape(%data); } echo("Heightfield Script:" @ %script); terrain.setHeightfieldScript(%script); ETerrainEditor.isDirty = true; } //-------------------------------------- function Heightfield::import() { getLoadFilename("*.ter", "Heightfield::doLoadHeightfield"); } //-------------------------------------- function Heightfield::loadFromScript(%script) { echo(%script); Heightfield_operation.clear(); $selectedOperation = -1; $HeightfieldDirtyRow = -1; // zero out all shifting HeightfieldPreview.reset(); for(%rec = getRecord(%script, %i); %rec !$= ""; %rec = getRecord(%script, %i++)) Heightfield::add(collapseEscape(%rec)); if (Heightfield_operation.rowCount() == 0) { // if there was a problem executing the script restore // the operations list to a known state Heightfield_operation.clear(); Heightfield::add("General\tTab_general\tgeneral_min_height\t50\tgeneral_scale\t300\tgeneral_water\t0.000\tgeneral_centerx\t0\tgeneral_centery\t0"); } %data = restWords(Heightfield_operation.getRowText(0)); %x = getField(%data,7); %y = getField(%data,9); HeightfieldPreview.setOrigin(%x, %y); Heightfield_operation.setSelectedById(Heightfield_operation.getRowId(0)); terraformer.setCameraPosition(%x,%y); } //-------------------------------------- //-------------------------------------- function strip(%stripStr, %strToStrip) { %len = strlen(%stripStr); if(strcmp(getSubStr(%strToStrip, 0, %len), %stripStr) == 0) return getSubStr(%strToStrip, %len, 100000); return %strToStrip; } function Heightfield::doLoadHeightfield(%name) { // ok, we're getting a terrain file... %newTerr = new TerrainBlock() // unnamed - since we'll be deleting it shortly: { position = "0 0 0"; terrainFile = strip("terrains/", %name); squareSize = 8; visibleDistance = 100; }; if(isObject(%newTerr)) { %script = %newTerr.getHeightfieldScript(); if(%script !$= "") Heightfield::loadFromScript(%script); %newTerr.delete(); } } //-------------------------------------- function Heightfield::setBitmap() { getLoadFilename("terrains/heightfield/*.png", "Heightfield::doSetBitmap"); } //-------------------------------------- function Heightfield::doSetBitmap(%name) { bitmap_name.setValue(%name); Heightfield::saveTab(); Heightfield::preview($selectedOperation); } //-------------------------------------- function Heightfield::hideTab() { tab_terrainFile.setVisible(false); tab_fbm.setvisible(false); tab_rmf.setvisible(false); tab_canyon.setvisible(false); tab_smooth.setvisible(false); tab_smoothWater.setvisible(false); tab_smoothRidge.setvisible(false); tab_filter.setvisible(false); tab_turbulence.setvisible(false); tab_thermal.setvisible(false); tab_hydraulic.setvisible(false); tab_general.setvisible(false); tab_bitmap.setvisible(false); tab_blend.setvisible(false); tab_sinus.setvisible(false); } //-------------------------------------- function Heightfield::showTab(%id) { Heightfield::hideTab(); %data = restWords(Heightfield_operation.getRowTextById(%id)); %tab = getField(%data,1); echo("Tab data: " @ %data @ " tab: " @ %tab); %tab.setVisible(true); } //-------------------------------------- function Heightfield::center() { %camera = terraformer.getCameraPosition(); %x = getWord(%camera, 0); %y = getWord(%camera, 1); HeightfieldPreview.setOrigin(%x, %y); %origin = HeightfieldPreview.getOrigin(); %x = getWord(%origin, 0); %y = getWord(%origin, 1); %root = HeightfieldPreview.getRoot(); %x += getWord(%root, 0); %y += getWord(%root, 1); general_centerx.setValue(%x); general_centery.setValue(%y); Heightfield::saveTab(); } function ExportHeightfield::onAction() { error("Time to export the heightfield..."); if (Heightfield_operation.getSelectedId() != -1) { $TerraformerSaveRegister = getWord(Heightfield_operation.getValue(), 0); Heightfield::saveBitmap(""); } } //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ function TerrainEditor::onGuiUpdate(%this, %text) { %mouseBrushInfo = " (Mouse Brush) #: " @ getWord(%text, 0) @ " avg: " @ getWord(%text, 1); %selectionInfo = " (Selection) #: " @ getWord(%text, 2) @ " avg: " @ getWord(%text, 3); TEMouseBrushInfo.setValue(%mouseBrushInfo); TEMouseBrushInfo1.setValue(%mouseBrushInfo); TESelectionInfo.setValue(%selectionInfo); TESelectionInfo1.setValue(%selectionInfo); } function TerrainEditor::offsetBrush(%this, %x, %y) { %curPos = %this.getBrushPos(); %this.setBrushPos(getWord(%curPos, 0) + %x, getWord(%curPos, 1) + %y); } function TerrainEditor::swapInLoneMaterial(%this, %name) { // swapped? if(%this.baseMaterialsSwapped $= "true") { %this.baseMaterialsSwapped = "false"; tEditor.popBaseMaterialInfo(); } else { %this.baseMaterialsSwapped = "true"; %this.pushBaseMaterialInfo(); %this.setLoneBaseMaterial(%name); } // flushTextureCache(); } //------------------------------------------------------------------------------ // Functions //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function TELoadTerrainButton::onAction(%this) { getLoadFilename("terrains/*.ter", %this @ ".gotFileName"); } function TELoadTerrainButton::gotFileName(%this, %name) { // %pos = "0 0 0"; %squareSize = "8"; %visibleDistance = "1200"; // delete current if(isObject(terrain)) { %pos = terrain.position; %squareSize = terrain.squareSize; %visibleDistance = terrain.visibleDistance; terrain.delete(); } // create new new TerrainBlock(terrain) { position = %pos; terrainFile = %name; squareSize = %squareSize; visibleDistance = %visibleDistance; }; ETerrainEditor.attachTerrain(); } function TerrainEditorSettingsGui::onWake(%this) { TESoftSelectFilter.setValue(ETerrainEditor.softSelectFilter); } function TerrainEditorSettingsGui::onSleep(%this) { ETerrainEditor.softSelectFilter = TESoftSelectFilter.getValue(); } function TESettingsApplyButton::onAction(%this) { ETerrainEditor.softSelectFilter = TESoftSelectFilter.getValue(); ETerrainEditor.resetSelWeights(true); ETerrainEditor.processAction("softSelect"); } function getPrefSetting(%pref, %default) { // if(%pref $= "") return(%default); else return(%pref); } //------------------------------------------------------------------------------ function Editor::open(%this) { // get the defaults %this.getPrefs(); %this.prevContent = Canvas.getContent(); Canvas.setContent(EditorGui); } function Editor::close(%this) { if(%this.prevContent == -1 || %this.prevContent $= "") %this.prevContent = "PlayGui"; Canvas.setContent(%this.prevContent); closeMessageHud(); } //------------------------------------------------------------------------------ PK !(M"/./.scripts/EditorProfiles.cs//----------------------------------------------------------------------------- // Torque Game Engine // // Copyright (c) 2001 GarageGames.Com // Portions Copyright (c) 2001 by Sierra Online, Inc. //----------------------------------------------------------------------------- //-------------------------------------------------------------------------- $Gui::fontCacheDirectory = expandFilename("./cache"); $Gui::clipboardFile = expandFilename("./cache/clipboard.gui"); // GuiDefaultProfile is a special case, all other profiles are initialized // to the contents of this profile first then the profile specific // overrides are assigned. if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile) { tab = false; canKeyFocus = false; hasBitmapArray = false; mouseOverSelected = false; // fill color opaque = false; fillColor = ($platform $= "macos") ? "211 211 211" : "192 192 192"; fillColorHL = ($platform $= "macos") ? "244 244 244" : "220 220 220"; fillColorNA = ($platform $= "macos") ? "244 244 244" : "220 220 220"; // border color border = false; borderColor = "0 0 0"; borderColorHL = "128 128 128"; borderColorNA = "64 64 64"; // font fontType = "Arial"; fontSize = 14; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fontColorNA = "0 0 0"; fontColorSEL= "200 200 200"; // bitmap information bitmap = "gui/darkWindow"; bitmapBase = ""; textOffset = "0 0"; // used by guiTextControl modal = true; justify = "left"; autoSizeWidth = false; autoSizeHeight = false; returnTab = false; numbersOnly = false; cursorColor = "0 0 0 255"; // sounds soundButtonDown = ""; soundButtonOver = ""; }; if(!isObject(GuiInputCtrlProfile)) new GuiControlProfile( GuiInputCtrlProfile ) { tab = true; canKeyFocus = true; }; if(!isObject(GuiDialogProfile)) new GuiControlProfile(GuiDialogProfile); if(!isObject(GuiSolidDefaultProfile)) new GuiControlProfile (GuiSolidDefaultProfile) { opaque = true; border = true; }; if(!isObject(GuiWindowProfile)) new GuiControlProfile (GuiWindowProfile) { opaque = true; border = 2; fillColor = ($platform $= "macos") ? "211 211 211" : "192 192 192"; fillColorHL = ($platform $= "macos") ? "190 255 255" : "64 150 150"; fillColorNA = ($platform $= "macos") ? "255 255 255" : "150 150 150"; fontColor = ($platform $= "macos") ? "0 0 0" : "255 255 255"; fontColorHL = ($platform $= "macos") ? "200 200 200" : "0 0 0"; text = "GuiWindowCtrl test"; bitmap = "gui/darkWindow"; textOffset = ($platform $= "macos") ? "5 5" : "6 6"; hasBitmapArray = true; justify = ($platform $= "macos") ? "center" : "left"; }; if(!isObject(EditorToolButtonProfile)) new GuiControlProfile (EditorToolButtonProfile) { opaque = true; border = 2; }; if(!isObject(GuiContentProfile)) new GuiControlProfile (GuiContentProfile) { opaque = true; fillColor = "255 255 255"; }; if(!isObject(GuiModelessDialogProfile)) new GuiControlProfile("GuiModelessDialogProfile") { modal = false; }; if(!isObject(GuiButtonProfile)) new GuiControlProfile (GuiButtonProfile) { opaque = true; border = true; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fixedExtent = true; justify = "center"; canKeyFocus = false; }; if(!isObject(GuiBorderButtonProfile)) new GuiControlProfile (GuiBorderButtonProfile) { fontColorHL = "0 0 0"; }; if(!isObject(GuiMenuBarProfile)) new GuiControlProfile (GuiMenuBarProfile) { fontType = "Arial"; fontSize = 14; opaque = true; fillColor = "192 192 192"; fillColorHL = "220 220 220"; fillColorNA = "220 220 220"; fillColorHL = "0 0 96"; border = 4; fontColor = "0 0 0"; fontColorHL = "255 255 255"; fontColorNA = "128 128 128"; fixedExtent = true; justify = "center"; canKeyFocus = false; mouseOverSelected = true; //bitmap = ($platform $= "macos") ? "./osxMenu" : "./torqueMenu"; //hasBitmapArray = true; }; if(!isObject(GuiButtonSmProfile)) new GuiControlProfile (GuiButtonSmProfile) { fontSize = 14; }; if(!isObject(GuiRadioProfile)) new GuiControlProfile (GuiRadioProfile) { fontSize = 14; fillColor = "232 232 232"; fontColorHL = "32 100 100"; fixedExtent = true; bitmap = "gui/darkWindow"; hasBitmapArray = true; }; if(!isObject(GuiScrollProfile)) new GuiControlProfile (GuiScrollProfile) { opaque = true; fillColor = "255 255 255"; border = 3; borderThickness = 2; borderColor = "0 0 0"; bitmap = "gui/darkScroll"; hasBitmapArray = true; }; if(!isObject(GuiSliderProfile)) new GuiControlProfile (GuiSliderProfile); if(!isObject(PainterTextProfile)) new GuiControlProfile (PainterTextProfile) { fontType = "Univers Condensed"; fontSize = 16; fontColor = "0 0 0"; fontColorLink = "255 96 96"; fontColorLinkHL = "0 0 255"; autoSizeWidth = true; autoSizeHeight = true; }; if(!isObject(GuiTextProfile)) new GuiControlProfile (GuiTextProfile) { fontColor = "0 0 0"; fontColorLink = "255 96 96"; fontColorLinkHL = "0 0 255"; autoSizeWidth = true; autoSizeHeight = true; }; if(!isObject(EditorTextProfile)) new GuiControlProfile (EditorTextProfile) { fontType = "Arial Bold"; fontColor = "0 0 0"; autoSizeWidth = true; autoSizeHeight = true; }; if(!isObject(EditorTextProfileWhite)) new GuiControlProfile (EditorTextProfileWhite) { fontType = "Arial Bold"; fontColor = "255 255 255"; autoSizeWidth = true; autoSizeHeight = true; }; if(!isObject(GuiMediumTextProfile)) new GuiControlProfile (GuiMediumTextProfile) { fontType = "Arial Bold"; fontColor = "0 0 0"; autoSizeWidth = true; autoSizeHeight = true; fontSize = 24; }; if(!isObject(GuiBigTextProfile)) new GuiControlProfile (GuiBigTextProfile) { fontType = "Arial Bold"; fontColor = "0 0 0"; autoSizeWidth = true; autoSizeHeight = true; fontSize = 36; }; if(!isObject(GuiCenterTextProfile)) new GuiControlProfile (GuiCenterTextProfile) { fontType = "Arial Bold"; fontColor = "0 0 0"; autoSizeWidth = true; autoSizeHeight = true; justify = "center"; }; if(!isObject(MissionEditorProfile)) new GuiControlProfile (MissionEditorProfile) { canKeyFocus = true; }; if(!isObject(EditorScrollProfile)) new GuiControlProfile (EditorScrollProfile) { opaque = true; fillColor = "192 192 192 192"; border = 3; borderThickness = 2; borderColor = "0 0 0"; bitmap = "gui/darkScroll"; hasBitmapArray = true; }; if(!isObject(GuiTextEditProfile)) new GuiControlProfile (GuiTextEditProfile) { opaque = true; fillColor = "255 255 255"; fillColorHL = "128 128 128"; border = 3; borderThickness = 2; borderColor = "0 0 0"; fontColor = "0 0 0"; fontColorHL = "255 255 255"; fontColorNA = "128 128 128"; textOffset = "0 2"; autoSizeWidth = false; autoSizeHeight = true; tab = true; canKeyFocus = true; }; if(!isObject(GuiControlListPopupProfile)) new GuiControlProfile (GuiControlListPopupProfile) { opaque = true; fillColor = "255 255 255"; fillColorHL = "128 128 128"; border = true; borderColor = "0 0 0"; fontColor = "0 0 0"; fontColorHL = "255 255 255"; fontColorNA = "128 128 128"; textOffset = "0 2"; autoSizeWidth = false; autoSizeHeight = true; tab = true; canKeyFocus = true; bitmap = "gui/darkScroll"; hasBitmapArray = true; }; if(!isObject(GuiTextArrayProfile)) new GuiControlProfile (GuiTextArrayProfile) { fontType = "Arial Bold"; fontColor = "0 0 0"; autoSizeWidth = true; autoSizeHeight = true; fontColorHL = "32 100 100"; fillColorHL = "200 200 200"; }; if(!isObject(GuiTextListProfile)) new GuiControlProfile (GuiTextListProfile) { fontType = "Arial Bold"; fontColor = "0 0 0"; autoSizeWidth = true; autoSizeHeight = true; } ; if(!isObject(GuiTreeViewProfile)) new GuiControlProfile (GuiTreeViewProfile) { fontSize = 13; // dhc - trying a better fit... fontColor = "0 0 0"; fontColorHL = "64 150 150"; }; if(!isObject(GuiCheckBoxProfile)) new GuiControlProfile (GuiCheckBoxProfile) { opaque = false; fillColor = "232 232 232"; border = false; borderColor = "0 0 0"; fontSize = 14; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fixedExtent = true; justify = "left"; bitmap = "gui/darkScroll"; hasBitmapArray = true; }; if(!isObject(GuiPopUpMenuProfile)) new GuiControlProfile (GuiPopUpMenuProfile) { opaque = true; mouseOverSelected = true; border = 4; borderThickness = 2; borderColor = "0 0 0"; fontSize = 14; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fontColorSEL = "32 100 100"; fixedExtent = true; justify = "center"; bitmap = "gui/darkScroll"; hasBitmapArray = true; }; if(!isObject(GuiEditorClassProfile)) new GuiControlProfile (GuiEditorClassProfile) { opaque = true; fillColor = "232 232 232"; border = true; borderColor = "0 0 0"; borderColorHL = "127 127 127"; fontColor = "0 0 0"; fontColorHL = "32 100 100"; fixedExtent = true; justify = "center"; bitmap = "gui/darkScroll"; hasBitmapArray = true; }; if(!isObject(LoadTextProfile)) new GuiControlProfile ("LoadTextProfile") { fontColor = "66 219 234"; autoSizeWidth = true; autoSizeHeight = true; }; if(!isObject(GuiMLTextProfile)) new GuiControlProfile ("GuiMLTextProfile") { fontColorLink = "255 96 96"; fontColorLinkHL = "0 0 255"; }; if(!isObject(GuiMLTextEditProfile)) new GuiControlProfile (GuiMLTextEditProfile) { fontColorLink = "255 96 96"; fontColorLinkHL = "0 0 255"; fillColor = "255 255 255"; fillColorHL = "128 128 128"; fontColor = "0 0 0"; fontColorHL = "255 255 255"; fontColorNA = "128 128 128"; autoSizeWidth = true; autoSizeHeight = true; tab = true; canKeyFocus = true; }; //-------------------------------------------------------------------------- // Console Window if(!isObject(GuiConsoleProfile)) new GuiControlProfile ("GuiConsoleProfile") { fontType = ($platform $= "macos") ? "Courier New" : "Lucida Console"; fontSize = 12; fontColor = "0 0 0"; fontColorHL = "130 130 130"; fontColorNA = "255 0 0"; fontColors[6] = "50 50 50"; fontColors[7] = "50 50 0"; fontColors[8] = "0 0 50"; fontColors[9] = "0 50 0"; }; if(!isObject(GuiProgressProfile)) new GuiControlProfile ("GuiProgressProfile") { opaque = false; fillColor = "44 152 162 100"; border = true; borderColor = "78 88 120"; }; if(!isObject(GuiProgressTextProfile)) new GuiControlProfile ("GuiProgressTextProfile") { fontColor = "0 0 0"; justify = "center"; }; //-------------------------------------------------------------------------- // Gui Inspector if(!isObject(GuiInspectorTextEditProfile)) new GuiControlProfile ("GuiInspectorTextEditProfile") { opaque = true; fillColor = "255 255 255"; fillColorHL = "128 128 128"; border = true; borderColor = "0 0 0"; fontColor = "0 0 0"; fontColorHL = "255 255 255"; autoSizeWidth = false; autoSizeHeight = true; tab = false; canKeyFocus = true; }; //-------------------------------------- Cursors // if(!isObject(DefaultCursor)) new GuiCursor(DefaultCursor) { hotSpot = "1 1"; bitmapName = "gui/CUR_3darrow"; }; PK !(sscripts/GameGui.cs//------------------------------------------------------------------------------ // // GameGui.cs // //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function LaunchGame( %pane ) { if ( %pane !$= "" ) GameGui.pane = %pane; LaunchTabView.viewTab( "GAME", GameGui, 0 ); } //------------------------------------------------------------------------------ function GameGui::onWake( %this ) { Canvas.pushDialog( LaunchToolbarDlg ); if ( isDemo() || $PlayingOnline ) GM_Frame.setTitle( "GAME" ); else GM_Frame.setTitle( "LAN GAME" ); // This is essentially an "isInitialized" flag... if ( GM_TabView.tabCount() == 0 ) { if ( isDemo() ) { GM_TabView.addTab( 1, "JOIN" ); GM_TabView.addTab( 2, "HOST" ); %this.pane = "Join"; } else { GM_TabView.addTab( 1, "JOIN" ); GM_TabView.addTab( 2, "HOST" ); GM_TabView.addTab( 3, "WARRIOR SETUP", 1 ); queryMasterGameTypes(); } } switch$ ( %this.pane ) { case "Join": GM_TabView.setSelected( 1 ); case "Host": GM_TabView.setSelected( 2 ); default: // "Warrior" GM_TabView.setSelected( 3 ); } } //------------------------------------------------------------------------------ function GameGui::onSleep( %this ) { %ctrl = "GM_" @ %this.pane @ "Pane"; if ( isObject( %ctrl ) ) %ctrl.onDeactivate(); // if( isObject( $dummySeq ) ) // { // $dummySeq.delete(); // } Canvas.popDialog(LaunchToolbarDlg); } //------------------------------------------------------------------------------ function GameGui::setKey( %this, %key ) { // To avoid console error } //------------------------------------------------------------------------------ function GameGui::onClose( %this, %key ) { // To avoid console error } //------------------------------------------------------------------------------ function GM_TabView::onAdd( %this ) { %this.addSet( 1, "gui/shll_horztabbuttonB", "5 5 5", "50 50 0", "5 5 5" ); } //------------------------------------------------------------------------------ function GM_TabView::onSelect( %this, %id, %text ) { GM_JoinPane.setVisible( %id == 1 ); GM_HostPane.setVisible( %id == 2 ); GM_WarriorPane.setVisible( %id == 3 ); GM_TabFrame.setAltColor( %this.getTabSet( %id ) != 0 ); %ctrl = "GM_" @ GameGui.pane @ "Pane"; if ( isObject( %ctrl ) ) %ctrl.onDeactivate(); switch ( %id ) { case 1: // Join GM_JoinPane.onActivate(); case 2: // Host GM_HostPane.onActivate(); case 3: // Warrior Setup GM_WarriorPane.onActivate(); } } //------------------------------------------------------------------------------ // Join Game pane: //------------------------------------------------------------------------------ function GM_JoinPane::onActivate( %this ) { GameGui.pane = "Join"; if ( %this.onceOnly $= "" ) { GM_VersionText.setText( "Version" SPC getT2VersionNumber() ); GMJ_StopBtn.setActive( false ); %this.onceOnly = 1; if ( isDemo() ) GMJ_Browser.lastQuery = "Demo"; else GMJ_Browser.lastQuery = $PlayingOnline ? "Master" : "LanServers"; GMJ_Browser.runQuery(); } if ( isObject( BrowserMap ) ) { BrowserMap.pop(); BrowserMap.delete(); } new ActionMap( BrowserMap ); if ( !isDemo() ) BrowserMap.bindCmd( keyboard, insert, "GMJ_Browser.insertIPAddress();", "" ); BrowserMap.bindCmd( keyboard, "ctrl f", "Canvas.pushDialog( FindServerDlg );", "" ); BrowserMap.bindCmd( keyboard, F3, "GMJ_Browser.findNextServer();", "" ); BrowserMap.push(); GM_VersionText.setVisible( !isDemo() ); if ( $pref::ServerBrowser::InfoWindowOpen ) Canvas.pushDialog( ServerInfoDlg ); } //------------------------------------------------------------------------------ function GM_JoinPane::onDeactivate( %this ) { if ( isObject( BrowserMap ) ) { BrowserMap.pop(); BrowserMap.delete(); } GM_VersionText.setVisible( false ); $pref::ServerBrowser::InfoWindowOpen = GMJ_Browser.infoWindowOpen; if ( GMJ_Browser.infoWindowOpen ) Canvas.popDialog( ServerInfoDlg ); } //------------------------------------------------------------------------------ $BrowserColumnCount = 0; $BrowserColumnName[0] = "Server Name"; $BrowserColumnRange[0] = "25 300"; $BrowserColumnCount++; $BrowserColumnName[1] = "Status"; $BrowserColumnRange[1] = "25 75"; $BrowserColumnCount++; $BrowserColumnName[2] = "Favorite"; $BrowserColumnRange[2] = "25 75"; $BrowserColumnCount++; $BrowserColumnName[3] = "Ping"; $BrowserColumnRange[3] = "25 120"; $BrowserColumnCount++; $BrowserColumnName[4] = "Game Type"; $BrowserColumnRange[4] = "25 200"; $BrowserColumnCount++; $BrowserColumnName[5] = "Mission Name"; $BrowserColumnRange[5] = "25 300"; $BrowserColumnCount++; if ( !isDemo() ) { $BrowserColumnName[6] = "Rules Set"; $BrowserColumnRange[6] = "25 300"; $BrowserColumnCount++; } $BrowserColumnName[7] = "# Players (Bots)"; $BrowserColumnRange[7] = "25 150"; $BrowserColumnCount++; $BrowserColumnName[8] = "CPU"; $BrowserColumnRange[8] = "25 120"; $BrowserColumnCount++; $BrowserColumnName[9] = "IP Address"; $BrowserColumnRange[9] = "25 200"; $BrowserColumnCount++; if ( !isDemo() ) { $BrowserColumnName[10] = "Version"; $BrowserColumnRange[10] = "25 200"; $BrowserColumnCount++; } $BrowserColumnName[11] = "Visibility"; $BrowserColumnRange[11] = "25 120"; $BrowserColumnCount++; //------------------------------------------------------------------------------ function GMJ_Browser::onAdd( %this ) { // Add the Server Browser columns based on the prefs: for ( %i = 0; %i < $BrowserColumnCount; %i++ ) { %key = firstWord( $pref::ServerBrowser::Column[%i] ); if ( $BrowserColumnName[%key] !$= "" && $BrowserColumnRange[%key] !$= "" ) { %width = getWord( $pref::ServerBrowser::Column[%i], 1 ); %this.addColumn( %key, $BrowserColumnName[%key], %width, firstWord( $BrowserColumnRange[%key] ), getWord( $BrowserColumnRange[%key], 1 ) ); } } %this.setSortColumn( $pref::ServerBrowser::SortColumnKey ); %this.setSortIncreasing( $pref::ServerBrowser::SortInc ); } //------------------------------------------------------------------------------ function updateServerBrowser() { GMJ_Browser.sort(); if ( GMJ_Browser.infoWindowOpen ) ServerInfoDlg.update(); } //------------------------------------------------------------------------------ function updateServerBrowserStatus( %text, %percentage ) { GMJ_StatusText.setValue( %text ); if ( %percentage >= 0 && %percentage <= 1 ) { GMJ_ProgressBar.setValue( %percentage ); if ( %percentage == 0 ) // Query is over. GMJ_StopBtn.setActive( false ); } } //------------------------------------------------------------------------------ function GMJ_Browser::runQuery( %this ) { GMJ_ProgressBar.setValue( 0 ); $JoinGameAddress = ""; GMJ_JoinBtn.setActive( false ); GMJ_RefreshServerBtn.setActive( false ); %this.clearList(); // Clear the Server Info dialog: SI_InfoWindow.setText( "No server selected." ); SI_ContentWindow.setText( "" ); if ( %this.lastQuery $= "LanServers" ) { GMJ_StatusText.setValue( "Querying LAN servers..." ); GMJ_FilterBtn.setActive( false ); GMJ_FilterBtn.setVisible( false ); GMJ_FilterText.setText( "LAN Servers" ); queryLanServers( $JoinGamePort ); GMJ_StopBtn.setActive( true ); } else if ( %this.lastQuery $= "Demo" ) { GMJ_StatusText.setValue( "Querying the master server..." ); GMJ_FilterBtn.setActive( false ); GMJ_FilterBtn.setVisible( false ); GMJ_FilterText.setText( "Demo Servers" ); queryMasterServer( $JoinGamePort ); GMJ_StopBtn.setActive( true ); } else { GMJ_FilterBtn.setActive( true ); GMJ_FilterBtn.setVisible( true ); if ( $pref::ServerBrowser::activeFilter == 0 ) { GMJ_StatusText.setValue( "Querying the master server..." ); GMJ_FilterText.setText( "All servers" ); queryMasterServer( $JoinGamePort ); GMJ_StopBtn.setActive( true ); } else if ( $pref::ServerBrowser::activeFilter == 1 ) { // Buddy list query: GMJ_StatusText.setValue( "Fetching buddy list..." ); GMJ_FilterText.setText( "Buddies" ); %this.key = LaunchGui.key++; DatabaseQueryArray( 5, 0, "", %this, %this.key ); } else if ( $pref::ServerBrowser::activeFilter == 2 ) { // Favorites only: GMJ_FilterText.setText( "Favorites" ); if ( $pref::ServerBrowser::FavoriteCount <= 0 || $pref::ServerBrowser::Favorite[0] $= "" ) { GMJ_StatusText.setValue( "No favorites found." ); MessageBoxOK( "INVALID FILTER", "You haven't marked any servers as favorites. Click the Favorites column to mark a server as a favorite." ); } else { GMJ_StatusText.setValue( "Querying favorites..." ); queryFavoriteServers(); GMJ_StopBtn.setActive( true ); } } else { GMJ_StatusText.setValue( "Querying the master server..." ); %filterIndex = $pref::ServerBrowser::activeFilter - 3; if ( $pref::ServerBrowser::Filter[%filterIndex] !$= "" ) { %filter = $pref::ServerBrowser::Filter[%filterIndex]; GMJ_FilterText.setText( getField( %filter, 0 ) ); %rulesSet = getField( %filter, 1 ); if ( %rulesSet $= "" ) %rulesSet = "any"; %missionType = getField( %filter, 2 ); if ( %missionType $= "" ) %missionType = "any"; %maxPlayers = getField( %filter, 4 ); if ( %maxPlayers $= "" ) %maxPlayers = 255; %maxBots = getField( %filter, 7 ); if ( %maxBots $= "" ) %maxBots = 16; %regionMask = getField( %filter, 5 ); if ( %regionMask $= "" ) %regionMask = 4294967295; queryMasterServer( $JoinGamePort, 0, // Flags %rulesSet, // Rules Set %missionType, // Mission Type getField( %filter, 3 ), // Min Players %maxPlayers, // Max Players %maxBots, // Max Bots %regionMask, // Region Mask getField( %filter, 6 ), // Max Ping getField( %filter, 8 ), // Min CPU Speed getField( %filter, 9 ) ); // Filter flags GMJ_StopBtn.setActive( true ); } else { // Filter is invalid, so fall back to the default: $pref::ServerBrowser::activeFilter = 0; GMJ_FilterText.setText( "All servers" ); queryMasterServer( $JoinGamePort ); GMJ_StopBtn.setActive( true ); } } } } //------------------------------------------------------------------------------ function GMJ_Browser::onDatabaseQueryResult( %this, %status, %resultString, %key ) { if ( %this.key != %key ) return; if ( getField( %resultString, 0 ) <= 0 ) { GMJ_StatusText.setValue( "No buddies found." ); MessageBoxOK( "INVALID FILTER", "You have no buddies in your buddy list!" ); } else // Prepare for the incoming buddy list: %this.buddyList = ""; } //------------------------------------------------------------------------------ function GMJ_Browser::onDatabaseRow( %this, %row, %isLastRow, %key ) { if ( %this.key != %key ) return; %buddyName = getField( %row, 0 ); %buddyGuid = getField( %row, 3 ); echo( "Got buddy: \c9\"" @ %buddyName @ "\": " @ %buddyGuid ); %this.buddyList = %this.buddyList $= "" ? %buddyGuid : %this.buddyList TAB %buddyGuid; if ( %isLastRow ) { GMJ_StatusText.setValue( "Querying the master server..." ); queryMasterServer( $JoinGamePort, // Port 0, // Flags "Any", // Rules Set "Any", // Mission Type 0, // Min Players 255, // Max Players 16, // Max Bots 0xFFFFFFFF, // Region Mask 0, // Max Ping 0, // Min CPU Speed 0, // Filter flags %this.buddyList ); GMJ_StopBtn.setActive( true ); %this.buddyList = ""; } } //------------------------------------------------------------------------------ function GMJ_Browser::onSelect( %this, %address ) { GMJ_JoinBtn.setActive( true ); if ( !isServerQueryActive() ) GMJ_RefreshServerBtn.setActive( true ); $JoinGamePassword = ""; $JoinGameAddress = %address; if ( %this.infoWindowOpen ) ServerInfoDlg.update(); } //------------------------------------------------------------------------------ function GMJ_Browser::refreshSelectedServer( %this ) { querySingleServer( $JoinGameAddress ); if ( %this.infoWindowOpen ) ServerInfoDlg.update(); } //------------------------------------------------------------------------------ function GMJ_Browser::onSetSortKey( %this, %sortKey, %isIncreasing ) { $pref::ServerBrowser::SortColumnKey = %sortKey; $pref::ServerBrowser::SortInc = %isIncreasing; } //------------------------------------------------------------------------------ function GMJ_Browser::onColumnResize( %this, %column, %newSize, %key ) { $pref::ServerBrowser::Column[%column] = %key SPC %newSize; } //------------------------------------------------------------------------------ function GMJ_Browser::onColumnRepositioned( %this, %oldColumn, %newColumn ) { // Puke em all... %count = %this.getNumColumns(); for ( %col = 0; %col < %count; %col++ ) $pref::ServerBrowser::Column[%col] = %this.getColumnKey( %col ) SPC %this.getColumnWidth( %col ); } //------------------------------------------------------------------------------ function GMJ_Browser::addFavorite( %this, %name, %address ) { //error( "** addFavorite( \"" @ %name @ "\", " @ %address @ " ) **" ); $pref::ServerBrowser::Favorite[$pref::ServerBrowser::FavoriteCount] = %name TAB %address; $pref::ServerBrowser::FavoriteCount++; } //------------------------------------------------------------------------------ function GMJ_Browser::removeFavorite( %this, %address ) { //error( "** removeFavorite( " @ %address @ " ) **" ); %foundIt = false; for ( %i = 0; %i < $pref::ServerBrowser::FavoriteCount; %i++ ) { if ( !%foundIt ) { if ( getField( $pref::ServerBrowser::Favorite[%i], 1 ) $= %address ) %foundIt = true; } if ( %foundIt ) $pref::ServerBrowser::Favorite[%i] = $pref::ServerBrowser::Favorite[%i + 1]; } if ( %foundIt ) $pref::ServerBrowser::FavoriteCount--; } //------------------------------------------------------------------------------ function GMJ_Browser::insertIPAddress( %this ) { if ( isServerQueryActive() ) { BrowserMap.pop(); MessageBoxOK( "ERROR", "Can't insert addresses while a query is running!", "BrowserMap.push();" ); alxPlay( InputDeniedSound, 0, 0, 0 ); return; } IPEntry.setText( "IP:" ); Canvas.pushDialog( EnterIPDlg ); } //------------------------------------------------------------------------------ function EnterIPDlg::onDone( %this ) { Canvas.popDialog( EnterIPDlg ); %address = IPEntry.getValue(); if ( getSubStr( %address, 0, 3 ) !$= "IP:" ) %address = "IP:" @ %address; if ( strpos( %address, ":", 3 ) == -1 ) %address = %address @ ":28000"; echo( "Starting ping to server " @ %address @ "..." ); pushServerAddress( %address ); GMJ_Browser.selectRowByAddress( %address, true ); } //------------------------------------------------------------------------------ function FindServerDlg::onWake( %this ) { FS_SearchPattern.validate(); FS_SearchPattern.selectAll(); } //------------------------------------------------------------------------------ function FindServerDlg::onGo( %this ) { %pattern = FS_SearchPattern.getValue(); if ( %pattern !$= "" ) { Canvas.popDialog( FindServerDlg ); if ( !GMJ_Browser.findServer( %pattern ) ) MessageBoxOK( "NOT FOUND", "No servers with \"" @ %pattern @ "\" in their name were found." ); } else alxPlay( InputDeniedSound, 0, 0, 0 ); } //------------------------------------------------------------------------------ function FS_SearchPattern::validate( %this ) { FS_GoBtn.setActive( %this.getValue() !$= "" ); } //------------------------------------------------------------------------------ function ServerInfoDlg::onAdd( %this ) { %this.headerStyle = ""; } //------------------------------------------------------------------------------ function ServerInfoDlg::onWake( %this ) { GMJ_Browser.infoWindowOpen = true; // Get the position and size from the prefs: %res = getResolution(); %resW = firstWord( %res ); %resH = getWord( %res, 1 ); %w = firstWord( $pref::ServerBrowser::InfoWindowExtent ); if ( %w > %resW ) %w = %resW; %h = getWord( $pref::ServerBrowser::InfoWindowExtent, 1 ); if ( %h > %resH ) %h = %resH; %x = firstWord( $pref::ServerBrowser::InfoWindowPos ); if ( %x > %resW - %w ) %x = %resW - %w; %y = getWord( $pref::ServerBrowser::InfoWindowPos, 1 ); if ( %y > %resH - %h ) %y = %resH - %h; SI_Window.resize( %x, %y, %w, %h ); GMJ_InfoBtn.setActive( false ); SI_RefreshBtn.setActive( false ); %this.update(); } //------------------------------------------------------------------------------ function ServerInfoDlg::update( %this ) { %status = GMJ_Browser.getServerStatus(); if ( %status $= "invalid" ) { SI_InfoWindow.setText( "No server selected." ); return; } %info = GMJ_Browser.getServerInfoString(); %infoText = "" @ %this.headerStyle @ "NAME:" TAB getRecord( %info, 0 ) NL "" @ %this.headerStyle @ "ADDRESS:" TAB getRecord( %info, 1 ) @ ""; %refreshable = false; if ( %status $= "responded" ) { %temp = getRecord( %info, 2 ); if ( %temp !$= "" ) %infoText = %infoText NL "" @ %this.headerStyle @ "RULES SET:" TAB %temp @ ""; %temp = getRecord( %info, 3 ); if ( %temp $= "" ) %temp = "None"; %infoText = %infoText NL "" @ %this.headerStyle @ "FLAGS:" TAB %temp @ ""; %temp = getRecord( %info, 4 ); if ( %temp !$= "" ) %infoText = %infoText NL "" @ %this.headerStyle @ "GAME TYPE:" TAB %temp @ ""; %temp = getRecord( %info, 5 ); if ( %temp !$= "" ) %infoText = %infoText NL "" @ %this.headerStyle @ "MAP NAME:" TAB %temp @ ""; %temp = getRecords( %info, 6, 10 ); if ( %temp !$= "" ) %infoText = %infoText NL "" @ %this.headerStyle @ "SERVER INFO:" TAB %temp @ ""; // Fill in the content window: %content = GMJ_Browser.getServerContentString(); SI_ContentWindow.fill( %content ); %refreshable = !isServerQueryActive(); } else { switch$ ( %status ) { case "new": %temp = "Not queried yet."; SI_ContentWindow.setText( "Not available." ); case "querying": %temp = "Querying..."; SI_ContentWindow.setText( "Not available." ); case "updating": %temp = "Updating..."; case "timedOut": %temp = "Timed out."; SI_ContentWindow.setText( "Not available." ); %refreshable = !isServerQueryActive(); } %infoText = %infoText NL "" @ %this.headerStyle @ "STATUS: " TAB %temp; } SI_InfoWindow.setText( %infoText ); SI_InfoScroll.scrollToTop(); SI_ContentScroll.scrollToTop(); SI_RefreshBtn.setActive( %refreshable ); } //------------------------------------------------------------------------------ function SI_ContentWindow::fill( %this, %content ) { if ( getRecordCount( %content ) == 1 ) { %this.setText( "" ); return; } %record = 0; %teamCount = getRecord( %content, %record ); %record++; if ( %teamCount > 1 ) { %string = "" @ ServerInfoDlg.headerStyle @ "TEAMSSCORE"; for ( %i = 0; %i < %teamCount; %i++ ) { %teamEntry = getRecord( %content, %record ); %string = %string NL "" SPC getField( %teamEntry, 0 ) @ "" SPC getField( %teamEntry, 1 ); %record++; } %playerCount = getRecord( %content, %record ); %record++; %string = %string NL "\n" @ ServerInfoDlg.headerStyle @ "PLAYERSTEAMSCORE"; for ( %i = 0; %i < %playerCount; %i++ ) { %playerEntry = getRecord( %content, %record ); %string = %string NL "" SPC getField( %playerEntry, 0 ) @ "" SPC getField( %playerEntry, 1 ) @ "" SPC getField( %playerEntry, 2 ) @ ""; %record++; } } else { %record++; %playerCount = getRecord( %content, %record ); %record++; %string = "" @ ServerInfoDlg.headerStyle @ "PLAYERSSCORE"; for ( %i = 0; %i < %playerCount; %i++ ) { %playerEntry = getRecord( %content, %record ); %string = %string NL "" SPC getField( %playerEntry, 0 ) @ "" SPC getField( %playerEntry, 2 ); %record++; } } %this.setText( %string ); } //------------------------------------------------------------------------------ function ServerInfoDlg::onSleep( %this ) { GMJ_Browser.infoWindowOpen = false; // Save off the Server Info Window prefs: $pref::ServerBrowser::InfoWindowPos = SI_Window.getPosition(); $pref::ServerBrowser::InfoWindowExtent = SI_Window.getExtent(); $pref::ServerBrowser::InfoWindowBarPos = getWord( SI_InfoScroll.getExtent(), 1 ); GMJ_InfoBtn.setActive( true ); } //------------------------------------------------------------------------------ function PasswordDlg::onWake( %this ) { $JoinGamePassword = ""; } //------------------------------------------------------------------------------ function PasswordDlg::accept( %this ) { Canvas.popDialog( PasswordDlg ); JoinSelectedGame(); } //------------------------------------------------------------------------------ function JoinSelectedGame() { $ServerInfo = GMJ_Browser.getServerInfoString(); JoinGame($JoinGameAddress); } //------------------------------------------------------------------------------ function JoinGame(%address) { MessagePopup( "JOINING SERVER", "CONNECTING" ); cancelServerQuery(); echo("Joining Server " @ %address); %playerPref = $pref::Player[$pref::Player::Current]; %playerName = getField( %playerPref, 0 ); %playerRaceGender = getField( %playerPref, 1 ); %playerSkin = getField( %playerPref, 2 ); %playerVoice = getField( %playerPref, 3 ); %playerVoicePitch = getField( %playerPref, 4 ); LoadingGui.gotLoadInfo = ""; connect( %address, $JoinGamePassword, %playerName, %playerRaceGender, %playerSkin, %playerVoice, %playerVoicePitch ); } //------------------------------------------------------------------------------ // Host Game pane: //------------------------------------------------------------------------------ function GM_HostPane::onActivate( %this ) { GameGui.pane = "Host"; $HostGameType = $PlayingOnline ? "Online" : "LAN"; buildMissionTypePopup( GMH_MissionType ); if ( !isDemo() ) { GMH_BotMinSlider.setValue( $Host::MinBotDifficulty ); GMH_BotMaxSlider.setValue( $Host::MaxBotDifficulty ); GMH_BotsEnabledTgl.setValue( $Host::BotsEnabled ); GMH_BotsEnabledTgl.onAction(); //clamp and set the bot count slider setBotCountSlider(); } // Select the saved-off prefs: if ( $Host::MissionType !$= "" ) { // Find the last selected type: for ( %type = 0; %type < $HostTypeCount; %type++ ) { if ( $HostTypeName[%type] $= $Host::MissionType ) break; } if ( %type != $HostTypeCount ) { GMH_MissionType.setSelected( %type ); GMH_MissionType.onSelect( %type, "" ); if ( $Host::Map !$= "" ) { // Find the last selected mission: for ( %index = 0; %index < $HostMissionCount[%type]; %index++ ) { if ( $HostMissionFile[$HostMission[%type, %index]] $= $Host::Map ) break; } if ( %index != $HostMissionCount[%type] ) GMH_MissionList.setSelectedById( $HostMission[%type, %index] ); } } } else { GMH_MissionType.setSelected( 0 ); GMH_MissionType.onSelect( 0, "" ); } GMH_StartGameBtn.makeFirstResponder( 1 ); } //------------------------------------------------------------------------------ function GM_HostPane::onDeactivate( %this ) { } //------------------------------------------------------------------------------ function buildMissionTypePopup( %popup ) { %popup.clear(); for( %type = 0; %type < $HostTypeCount; %type++ ) %popup.add( $HostTypeDisplayName[%type], %type ); %popup.sort( true ); } //------------------------------------------------------------------------------ function getMissionTypeDisplayNames() { %file = new FileObject(); for ( %type = 0; %type < $HostTypeCount; %type++ ) { $HostTypeDisplayName[%type] = $HostTypeName[%type]; if ( %file.openForRead( "scripts/" @ $HostTypeName[%type] @ "Game.cs" ) ) { while ( !%file.isEOF() ) { %line = %file.readLine(); if ( getSubStr( %line, 0, 17 ) $= "// DisplayName = " ) { $HostTypeDisplayName[%type] = getSubStr( %line, 17, 1000 ); break; } } } } %file.delete(); } //------------------------------------------------------------------------------ function buildMissionList() { %search = "missions/*.mis"; %ct = 0; $HostTypeCount = 0; $HostMissionCount = 0; %fobject = new FileObject(); for( %file = findFirstFile( %search ); %file !$= ""; %file = findNextFile( %search ) ) { %name = fileBase( %file ); // get the name %idx = $HostMissionCount; $HostMissionCount++; $HostMissionFile[%idx] = %name; $HostMissionName[%idx] = %name; if ( !%fobject.openForRead( %file ) ) continue; %typeList = "None"; while ( !%fobject.isEOF() ) { %line = %fobject.readLine(); if ( getSubStr( %line, 0, 17 ) $= "// DisplayName = " ) { // Override the mission name: $HostMissionName[%idx] = getSubStr( %line, 17, 1000 ); } else if ( getSubStr( %line, 0, 18 ) $= "// MissionTypes = " ) { %typeList = getSubStr( %line, 18, 1000 ); break; } } %fobject.close(); // Don't include single player missions: if ( strstr( %typeList, "SinglePlayer" ) != -1 ) continue; // Test to see if the mission is bot-enabled: %navFile = "terrains/" @ %name @ ".nav"; $BotEnabled[%idx] = isFile( %navFile ); for( %word = 0; ( %misType = getWord( %typeList, %word ) ) !$= ""; %word++ ) { for ( %i = 0; %i < $HostTypeCount; %i++ ) if ( $HostTypeName[%i] $= %misType ) break; if ( %i == $HostTypeCount ) { $HostTypeCount++; $HostTypeName[%i] = %misType; $HostMissionCount[%i] = 0; } // add the mission to the type %ct = $HostMissionCount[%i]; $HostMission[%i, $HostMissionCount[%i]] = %idx; $HostMissionCount[%i]++; } } getMissionTypeDisplayNames(); %fobject.delete(); } // One time only function call: buildMissionList(); //------------------------------------------------------------------------------ function validateMissionAndType(%misName, %misType) { for ( %mis = 0; %mis < $HostMissionCount; %mis++ ) if( $HostMissionFile[%mis] $= %misName ) break; if ( %mis == $HostMissionCount ) return false; for ( %type = 0; %type < $HostTypeCount; %type++ ) if ( $HostTypeName[%type] $= %misType ) break; if(%type == $hostTypeCount) return false; $Host::Map = $HostMissionFile[%mis]; $Host::MissionType = $HostTypeName[%type]; return true; } //------------------------------------------------------------------------------ // This function returns the index of the next mission in the mission list. //------------------------------------------------------------------------------ function getNextMission( %misName, %misType ) { // First find the index of the mission in the master list: for ( %mis = 0; %mis < $HostMissionCount; %mis++ ) if( $HostMissionFile[%mis] $= %misName ) break; if ( %mis == $HostMissionCount ) return ""; // Now find the index of the mission type: for ( %type = 0; %type < $HostTypeCount; %type++ ) if ( $HostTypeName[%type] $= %misType ) break; if ( %type == $hostTypeCount ) return ""; // Now find the mission's index in the mission-type specific sub-list: for ( %i = 0; %i < $HostMissionCount[%type]; %i++ ) if ( $HostMission[%type, %i] == %mis ) break; // Go BACKWARDS, because the missions are in reverse alphabetical order: if ( %i == 0 ) %i = $HostMissionCount[%type] - 1; else %i--; // If there are bots in the game, don't switch to any maps without // a NAV file: if ( $HostGameBotCount > 0 ) { for ( %j = 0; %j < $HostMissionCount[%type] - 1; %j++ ) { if ( $BotEnabled[$HostMission[%type, %i]] ) break; if ( %i == 0 ) %i = $HostMissionCount[%type] - 1; else %i--; } } return $HostMission[%type, %i]; } //------------------------------------------------------------------------------ function GMH_MissionType::onSelect( %this, %id, %text ) { // Fill the mission list: GMH_MissionList.clear(); %lastAdded = 0; for ( %i = 0; %i < $HostMissionCount[%id];%i++ ) { %misId = $HostMission[%id,%i]; GMH_MissionList.addRow( %misId, $HostMissionName[%misId] ); %lastAdded = %misId; } GMH_MissionList.sort( 0 ); // Select the last mission added: GMH_MissionList.setSelectedById( %lastAdded ); $Host::MissionType = $HostTypeName[%id]; if ( !isDemo() ) { // Disable all non bot-enabled maps if bots are enabled: if ( GMH_BotsEnabledTgl.getValue() ) GMH_BotsEnabledTgl.onAction(); } } //------------------------------------------------------------------------------ function GMH_MissionList::onSelect( %this, %id, %text ) { if ( !isDemo() && GMH_BotsEnabledTgl.getValue() ) GMH_StartGameBtn.setActive( $BotEnabled[%id] ); } //------------------------------------------------------------------------------ function tryToStartHostedGame() { if ( !isDemo() && GMH_BotsEnabledTgl.getValue() ) { %selId = GMH_MissionList.getSelectedId(); if ( !$BotEnabled[%selId] ) return; } StartHostedGame(); } //------------------------------------------------------------------------------ function StartHostedGame() { %selId = GMH_MissionList.getSelectedId(); %misFile = $HostMissionFile[%selId]; if ( !isDemo() && $Host::BotsEnabled ) { validateMaxPlayers(); $HostGameBotCount = $Host::BotCount; } else $HostGameBotCount = 0; $ServerName = $Host::GameName; $Host::Map = %misFile; echo( "exporting server prefs..." ); export( "$Host::*", "prefs/ServerPrefs.cs", false ); if ( $Host::Dedicated ) { MessageBoxYesNo( "WARNING", "You are about to launch a dedicated server and quit Tribes 2. Do you want to continue?", "tryToLaunchDedicatedServer(" @ $Host::PureServer @ ");" ); return; } //IRCClient::onJoinGame("", ""); MessagePopup( "STARTING SERVER", "Initializing..." ); Canvas.repaint(); cancelServerQuery(); setNetPort( $Host::Port ); CreateServer( $Host::Map, $Host::MissionType ); %playerPref = $pref::Player[$pref::Player::Current]; %playerName = getField( %playerPref, 0 ); %playerRaceGender = getField( %playerPref, 1 ); %playerSkin = getField( %playerPref, 2 ); %playerVoice = getField( %playerPref, 3 ); %playerVoicePitch = getField( %playerPref, 4 ); localConnect( %playerName, %playerRaceGender, %playerSkin, %playerVoice, %playerVoicePitch ); if(!$RecordDemo) { // demos are incompatible with local simulated net params ServerConnection.setSimulatedNetParams($pref::Net::simPacketLoss, $pref::net::simPing * 0.5); LocalClientConnection.setSimulatedNetParams($pref::Net::simPacketLoss, $pref::net::simPing * 0.5); } } //------------------------------------------------------------------------------ function tryToLaunchDedicatedServer( %pure ) { if ( isDemo() ) %numBots = 0; else %numBots = $Host::BotsEnabled ? $Host::BotCount : 0; if ( launchDedicatedServer( $Host::MissionType, $Host::Map, %numBots, %pure ) ) quit(); else { error( "Failed to launch the dedicated server." ); schedule( 0, 0, MessageBoxOK, "FAILED", "Tribes 2 failed to launch the dedicated server." ); } } //------------------------------------------------------------------------------ function GMH_BotsEnabledTgl::onAction( %this ) { %count = GMH_MissionList.rowCount(); if ( %this.getValue() ) { for ( %i = 0; %i < %count; %i++ ) { %id = GMH_MissionList.getRowId( %i ); GMH_MissionList.setRowActive( %id, $BotEnabled[%id] ); } GMH_EnableBotsGroup.setVisible(true); %misId = GMH_MissionList.getSelectedId(); GMH_StartGameBtn.setActive( $BotEnabled[%misId] ); } else { for ( %i = 0; %i < %count; %i++ ) { %id = GMH_MissionList.getRowId( %i ); GMH_MissionList.setRowActive( %id, true ); } GMH_EnableBotsGroup.setVisible( false ); GMH_StartGameBtn.setActive( true ); } } //------------------------------------------------------------------------------ function updateMinBotDifficulty() { %min = GMH_BotMinSlider.getValue(); $Host::MinBotDifficulty = %min; if ( GMH_BotMaxSlider.getValue() < %min ) GMH_BotMaxSlider.setValue( %min ); } //------------------------------------------------------------------------------ function updateMaxBotDifficulty() { %max = GMH_BotMaxSlider.getValue(); $Host::MaxBotDifficulty = %max; if ( GMH_BotMinSlider.getValue() > %max ) GMH_BotMinSlider.setValue( %max ); } //------------------------------------------------------------------------------ function GMH_BotsEnabledTgl::onAction( %this ) { %count = GMH_MissionList.rowCount(); if ( %this.getValue() ) { for ( %i = 0; %i < %count; %i++ ) { %id = GMH_MissionList.getRowId( %i ); GMH_MissionList.setRowActive( %id, $BotEnabled[%id] ); } GMH_EnableBotsGroup.setVisible(true); %misId = GMH_MissionList.getSelectedId(); GMH_StartGameBtn.setActive( $BotEnabled[%misId] ); } else { for ( %i = 0; %i < %count; %i++ ) { %id = GMH_MissionList.getRowId( %i ); GMH_MissionList.setRowActive( %id, true ); } GMH_EnableBotsGroup.setVisible(false); GMH_StartGameBtn.setActive( true ); } } //------------------------------------------------------------------------------ function validateMaxPlayers() { %maxPlayers = GMH_MaxPlayersTE.getValue(); if (%maxPlayers < 1) %maxPlayers = 1; if (%maxPlayers > 64) %maxPlayers = 64; //reset the value back into the TE GMH_MaxPlayersTE.setValue(%maxPlayers); if ( !isDemo() ) { //and make sure the bot sliders reflect the changes.. setBotCountSlider(); } } function setBotCountSlider() { %maxBots = 15; if (%maxBots > $Host::MaxPlayers - 2) %maxBots = $Host::MaxPlayers - 2; if ($Host::BotCount > %maxBots + 1) $Host::BotCount = %maxBots + 1; if (%maxBots <= 1) %sliderValue = 0.0; else %sliderValue = ($Host::BotCount - 0.95) / %maxBots; GMH_MinCombatantSlider.setValue(%sliderValue); } function setMinCombatants() { %maxBots = 16; if (%maxBots > $Host::MaxPlayers - 1) %maxBots = $Host::MaxPlayers - 1; if (%maxBots <= 0) $Host::BotCount = 0; else $Host::BotCount = mFloor( GMH_MinCombatantSlider.getValue() * (%maxBots - 1)) + 1; GMH_BotCountText.setValue( "(" @ $Host::BotCount @ ")" ); } //------------------------------------------------------------------------------ function AdvancedHostDlg::onWake( %this ) { // Set all of the controls to the current pref states: AH_HostPort.setText( $Host::Port ); if ( $Host::HiVisibility ) AH_HiVisibilityRdo.setValue( true ); else AH_HiFPSRdo.setValue( true ); AH_DedicatedTgl.setValue( $Host::Dedicated ); AH_DedicatedTgl.onAction(); AH_TeamDamageTgl.setValue( $Host::TeamDamageOn ); AH_TournamentTgl.setValue( $Host::TournamentMode ); AH_AdminVoteTgl.setValue( $Host::allowAdminPlayerVotes ); AH_AllowSmurfTgl.setValue( !$Host::NoSmurfs ); AH_TimeLimit.setText( $Host::TimeLimit ); AH_AdminPassword.setText( $Host::AdminPassword ); AH_ServerInfo.setText( $Host::Info ); AH_VotePassSlider.setValue( $Host::VotePassPercent ); AH_VoteTimeSlider.setValue( $Host::VoteTime ); AH_RespawnSlider.setValue( $Host::PlayerRespawnTimeout ); AH_WarmupSlider.setValue( $Host::WarmupTime ); } //------------------------------------------------------------------------------ function AdvancedHostDlg::accept( %this ) { // Apply all of the changes: $Host::Port = AH_HostPort.getValue(); $Host::HiVisibility = AH_HiVisibilityRdo.getValue(); $Host::Dedicated = AH_DedicatedTgl.getValue(); if ( $Host::Dedicated ) $Host::PureServer = AH_PureServerTgl.getValue(); $Host::TeamDamageOn = AH_TeamDamageTgl.getValue(); $Host::TournamentMode = AH_TournamentTgl.getValue(); $Host::allowAdminPlayerVotes = AH_AdminVoteTgl.getValue(); $Host::NoSmurfs = !AH_AllowSmurfTgl.getValue(); $Host::TimeLimit = AH_TimeLimit.getValue(); $Host::AdminPassword = AH_AdminPassword.getValue(); $Host::Info = AH_ServerInfo.getText(); $Host::VotePassPercent = mFloor( AH_VotePassSlider.getValue() ); $Host::VoteTime = mFloor( AH_VoteTimeSlider.getValue() ); $Host::PlayerRespawnTimeout = mFloor( AH_RespawnSlider.getValue() ); $Host::WarmupTime = mFloor( AH_WarmupSlider.getValue() ); // Save off the new prefs: export( "$Host::*", "prefs/ServerPrefs.cs", false ); Canvas.popDialog( AdvancedHostDlg ); } //------------------------------------------------------------------------------ function AH_DedicatedTgl::onAction( %this ) { if ( %this.getValue() ) { AH_PureServerTgl.setValue( $Host::PureServer ); AH_PureServerTgl.setActive( true ); } else { AH_PureServerTgl.setValue( false ); AH_PureServerTgl.setActive( false ); } } //------------------------------------------------------------------------------ function AH_VotePassText::update( %this ) { %this.setText( mFloor( AH_VotePassSlider.getValue() ) @ "%" ); } //------------------------------------------------------------------------------ function AH_VoteTimeText::update( %this ) { %this.setText( mFloor( AH_VoteTimeSlider.getValue() ) SPC "seconds" ); } //------------------------------------------------------------------------------ function AH_RespawnText::update( %this ) { %this.setText( mFloor( AH_RespawnSlider.getValue() ) SPC "seconds" ); } //------------------------------------------------------------------------------ function AH_WarmupText::update( %this ) { %this.setText( mFloor( AH_WarmupSlider.getValue() ) SPC "seconds" ); } //------------------------------------------------------------------------------ // Warrior Setup pane: //------------------------------------------------------------------------------ function GM_WarriorPane::onActivate( %this ) { GameGui.pane = "Warrior"; if ( $pref::Player::Count == 0 ) %this.createNewAlias(); else { // Fill the warrior list: GMW_WarriorPopup.clear(); GMW_LightRdo.setValue( true ); // First add the warrior corresponding to the player nickname: %this.warriorIndex = -1; if ( $PlayingOnline ) { %warrior = getField( WONGetAuthInfo(), 0 ); for ( %i = 0; %i < $pref::Player::Count; %i++ ) { %name = getField( $pref::Player[%i], 0 ); if ( %name $= %warrior ) { %this.warriorIndex = %i; GMW_WarriorPopup.add( %name, %i, 1 ); break; } } } // Add the rest of the aliases: for ( %count = 0; %count < $pref::Player::Count; %count++ ) { if ( $pref::Player[%count] !$= "" && %count != %this.warriorIndex ) { %name = stripTrailingSpaces( strToPlayerName( getField( $pref::Player[%count], 0 ) ) ); GMW_WarriorPopup.add( %name, %count ); } } // Fill the static menus: GMW_RaceGenderPopup.fillList(); GMW_SkinPrefPopup.fillList(); // Select the current player: GMW_WarriorPopup.setSelected( $pref::Player::Current ); GMW_WarriorPopup.onSelect( $pref::Player::Current, "" ); if ( $pref::Player::Count > 1 && $pref::Player::Current != %this.warriorIndex ) GMW_DeleteWarriorBtn.setActive( true ); else GMW_DeleteWarriorBtn.setActive( false ); GMW_PlayerPageBtn.setVisible( $PlayingOnline ); } } //------------------------------------------------------------------------------ function GM_WarriorPane::onDeactivate( %this ) { } //------------------------------------------------------------------------------ function GM_WarriorPane::createNewAlias( %this ) { NW_NameEdit.setValue( "" ); NW_DoneBtn.setActive( false ); NW_CancelBtn.setVisible( $pref::Player::Count > 0 ); Canvas.pushDialog( NewWarriorDlg ); } //------------------------------------------------------------------------------ function GM_WarriorPane::deleteWarrior( %this ) { MessageBoxYesNo( "CONFIRM", "Are you sure you want to delete this alias?", "doDeleteWarrior();", "" ); } //------------------------------------------------------------------------------ function doDeleteWarrior() { // Make sure we aren't trying to delete the default warrior (should never get this): if ( $pref::Player::Current == GM_WarriorPane.warriorIndex ) return; for ( %i = $pref::Player::Current; %i < $pref::Player::Count - 1; %i++ ) $pref::Player[%i] = $pref::Player[%i + 1]; $pref::Player[%i] = ""; if ( GM_WarriorPane.warriorIndex > $pref::Player::Current ) GM_WarriorPane.warriorIndex--; $pref::Player::Count--; if ( GM_WarriorPane.warriorIndex != -1 ) $pref::Player::Current = GM_WarriorPane.warriorIndex; else $pref::Player::Current = 0; // Update the interface: GM_WarriorPane::onActivate(); } //------------------------------------------------------------------------------ function GM_WarriorPane::gotoPlayerPage( %this ) { %warrior = getField( WONGetAuthInfo(), 0 ); LaunchBrowser( %warrior, "Warrior" ); } //------------------------------------------------------------------------------ function GMW_PlayerModel::update( %this ) { // Get the shape names: if ( GMW_HeavyRdo.getValue() ) %armor = "heavy"; else if ( GMW_MediumRdo.getValue() ) %armor = "medium"; else %armor = "light"; switch ( GMW_RaceGenderPopup.getSelected() ) { case 1: if ( %armor $= "heavy" ) %shape = %armor @ "_male"; else %shape = %armor @ "_female"; case 2: %shape = "bioderm_" @ %armor; default: %shape = %armor @ "_male"; } %skin = getField( $pref::Player[$pref::Player::Current], 2 ); // if( isObject( $dummySeq ) ) // { // $dummySeq.delete(); // } // // $dummySeq = new TSShapeConstructor() // { // baseShape = %shape @ ".dts"; // sequence0 = %shape @ "_forward.dsq dummyRun"; // }; %this.setModel( %shape, %skin ); } //------------------------------------------------------------------------------ function GMW_WarriorPopup::onAdd( %this ) { %this.addScheme( 1, "255 255 0", "255 255 128", "128 128 0" ); } //------------------------------------------------------------------------------ function GMW_WarriorPopup::onSelect( %this, %id, %text ) { // Set this as the currently selected player: $pref::Player::Current = %id; // Select the race/gender: %raceGender = getField( $pref::Player[%id], 1 ); %selId = GMW_RaceGenderPopup.findText( %raceGender ); if ( %selId == -1 ) %selId = 0; GMW_RaceGenderPopup.setSelected( %selId ); GMW_VoicePopup.fillList( %selId ); // Select the skin: %skin = getField( $pref::Player[%id], 2 ); %baseSkin = isDynamixSkin( %skin ); GMW_SkinPrefPopup.setSelected( !%baseSkin ); GMW_SkinPopup.fillList( %selId ); %selId = -1; for ( %i = 0; %i < GMW_SkinPopup.size(); %i++ ) { if ( GMW_SkinPopup.realSkin[%i] !$= "" ) { if ( %skin $= GMW_SkinPopup.realSkin[%i] ) { %selId = %i; break; } } else if ( %skin $= GMW_SkinPopup.getTextById( %i ) ) { %selId = %i; break; } } if ( %selId == -1 ) %selId = 0; GMW_SkinPopup.setSelected( %selId ); GMW_SkinPopup.onSelect( %selId, GMW_SkinPopup.getTextById( %selId ) ); // Select the voice: %voice = getField( $pref::Player[%id], 3 ); %voiceId = getSubStr( %voice, strlen( %voice ) -1, 1000 ) - 1; GMW_VoicePopup.setSelected( %voiceId ); GMW_VoicePopup.voiceIndex = 0; GMW_DeleteWarriorBtn.setActive( $pref::Player::Count > 1 && %id != GM_WarriorPane.warriorIndex ); } //------------------------------------------------------------------------------ function GMW_RaceGenderPopup::fillList( %this ) { if ( %this.size() ) return; %this.add( "Human Male", 0 ); %this.add( "Human Female", 1 ); %this.add( "Bioderm", 2 ); } //------------------------------------------------------------------------------ function GMW_RaceGenderPopup::onSelect( %this, %id, %text ) { // Update the player pref: $pref::Player[$pref::Player::Current] = setField( $pref::Player[$pref::Player::Current], 1, %this.getText() ); // Fill the skin list: %prevSkin = GMW_SkinPopup.getText(); GMW_SkinPopup.fillList( %id ); %selId = GMW_SkinPopup.findText( %prevSkin ); if ( %selId == -1 ) %selId = 0; GMW_SkinPopup.setSelected( %selId ); GMW_SkinPopup.onSelect( %selId, GMW_SkinPopup.getTextById( %selId ) ); // Fill the voice list: %prevVoice = GMW_VoicePopup.getText(); GMW_VoicePopup.fillList( %id ); %selId = GMW_VoicePopup.findText( %prevVoice ); if ( %selId == -1 ) %selId = 0; GMW_VoicePopup.setSelected( %selId ); GMW_VoicePopup.onSelect( %selId, "" ); } //------------------------------------------------------------------------------ function GMW_SkinPrefPopup::fillList( %this ) { if ( %this.size() ) return; %this.add( "Dynamix Skins", 0 ); %this.add( "Custom Skins", 1 ); } //------------------------------------------------------------------------------ function GMW_SkinPrefPopup::onSelect( %this, %id, %text ) { %curSkin = GMW_SkinPopup.getText(); GMW_SkinPopup.fillList( GMW_RaceGenderPopup.getSelected() ); %selId = GMW_SkinPopup.findText( %curSkin ); if ( %selId == -1 ) %selId = 0; if ( GMW_SkinPopup.size() ) { GMW_SkinPopup.setSelected( %selId ); GMW_SkinPopup.onSelect( %selId, GMW_SkinPopup.getTextById( %selId ) ); } } //------------------------------------------------------------------------------ $SkinCount = 0; $Skin[$SkinCount, name] = "Blood Eagle"; $Skin[$SkinCount, code] = "beagle"; $SkinCount++; $Skin[$SkinCount, name] = "Diamond Sword"; $Skin[$SkinCount, code] = "dsword"; $SkinCount++; $Skin[$SkinCount, name] = "Starwolf"; $Skin[$SkinCount, code] = "swolf"; $SkinCount++; $Skin[$SkinCount, name] = "Phoenix"; $Skin[$SkinCount, code] = "cotp"; $SkinCount++; $Skin[$SkinCount, name] = "Storm"; $Skin[$SkinCount, code] = "base"; $SkinCount++; $Skin[$SkinCount, name] = "Inferno"; $Skin[$SkinCount, code] = "baseb"; $SkinCount++; $Skin[$SkinCount, name] = "Horde"; $Skin[$SkinCount, code] = "horde"; $SkinCount++; //------------------------------------------------------------------------------ function isDynamixSkin( %skin ) { for ( %i = 0; %i < $SkinCount; %i++ ) { if ( %skin $= $Skin[%i, code] ) return( true ); } return( false ); } //------------------------------------------------------------------------------ function GMW_SkinPopup::fillList( %this, %raceGender ) { for ( %i = 0; %i < %this.size(); %i++ ) %this.realSkin[%i] = ""; %this.clear(); %path = "textures/skins/"; switch ( %raceGender ) { case 0: // Human Male %pattern = ".lmale.png"; case 1: // Human Female %pattern = ".lfemale.png"; case 2: // Bioderm %pattern = ".lbioderm.png"; } %customSkins = GMW_SkinPrefPopup.getSelected(); %count = 0; for ( %file = findFirstFile( %path @ "*" @ %pattern ); %file !$= ""; %file = findNextFile( %path @ "*" @ %pattern ) ) { %skin = getSubStr( %file, strlen( %path ), strlen( %file ) - strlen( %path ) - strlen( %pattern ) ); // strip off the path and postfix // Make sure this is not a bot skin: if ( %skin !$= "basebot" && %skin !$= "basebbot" ) { // See if this skin has an alias: %baseSkin = false; for ( %i = 0; %i < $SkinCount; %i++ ) { if ( %skin $= $Skin[%i, code] ) { %baseSkin = true; %skin = $Skin[%i, name]; break; } } if ( %customSkins != %baseSkin ) { if ( %baseSkin ) %this.realSkin[%count] = $Skin[%i, code]; %this.add( %skin, %count ); %count++; } } } %this.sort( true ); } //------------------------------------------------------------------------------ function GMW_SkinPopup::onSelect( %this, %id, %text ) { // Update the player pref: if ( %this.realSkin[%id] !$= "" ) $pref::Player[$pref::Player::Current] = setField( $pref::Player[$pref::Player::Current], 2, %this.realSkin[%id] ); else $pref::Player[$pref::Player::Current] = setField( $pref::Player[$pref::Player::Current], 2, %text ); // Update the player model: GMW_PlayerModel.update(); } //------------------------------------------------------------------------------ // TRANSLATE these voice set display names: $MaleVoiceCount = 0; $MaleVoiceName[$MaleVoiceCount] = "Hero"; $MaleVoiceCount++; $MaleVoiceName[$MaleVoiceCount] = "Iceman"; $MaleVoiceCount++; $MaleVoiceName[$MaleVoiceCount] = "Rogue"; $MaleVoiceCount++; $MaleVoiceName[$MaleVoiceCount] = "Hardcase"; $MaleVoiceCount++; $MaleVoiceName[$MaleVoiceCount] = "Psycho"; $MaleVoiceCount++; $FemaleVoiceCount = 0; $FemaleVoiceName[$FemaleVoiceCount] = "Heroine"; $FemaleVoiceCount++; $FemaleVoiceName[$FemaleVoiceCount] = "Professional"; $FemaleVoiceCount++; $FemaleVoiceName[$FemaleVoiceCount] = "Cadet"; $FemaleVoiceCount++; $FemaleVoiceName[$FemaleVoiceCount] = "Veteran"; $FemaleVoiceCount++; $FemaleVoiceName[$FemaleVoiceCount] = "Amazon"; $FemaleVoiceCount++; $DermVoiceCount = 0; $DermVoiceName[$DermVoiceCount] = "Warrior"; $DermVoiceCount++; $DermVoiceName[$DermVoiceCount] = "Monster"; $DermVoiceCount++; $DermVoiceName[$DermVoiceCount] = "Predator"; $DermVoiceCount++; //------------------------------------------------------------------------------ function GMW_VoicePopup::fillList( %this, %raceGender ) { %this.clear(); switch ( %raceGender ) { case 0: // Human Male for ( %i = 0; %i < $MaleVoiceCount; %i++ ) %this.add( $MaleVoiceName[%i], %i ); case 1: // Human Female for ( %i = 0; %i < $FemaleVoiceCount; %i++ ) %this.add( $FemaleVoiceName[%i], %i ); case 2: // Bioderm for ( %i = 0; %i < $DermVoiceCount; %i++ ) %this.add( $DermVoiceName[%i], %i ); } } //------------------------------------------------------------------------------ function GMW_VoicePopup::onSelect( %this, %id, %text ) { // Update the player pref: switch ( GMW_RaceGenderPopup.getSelected() ) { case 0: %base = "Male"; case 1: %base = "Fem"; case 2: %base = "Derm"; } $pref::Player[$pref::Player::Current] = setField( $pref::Player[$pref::Player::Current], 3, %base @ ( %id + 1 ) ); %this.voiceIndex = 0; } //------------------------------------------------------------------------------ function GMW_VoicePitchSlider::setPitch(%this) { } function GMW_VoicePopup::test( %this ) { switch ( %this.voiceIndex ) { case 0: %file = "gbl.hi"; case 1: %file = "gbl.brag"; case 2: %file = "gbl.woohoo"; case 3: %file = "gbl.rock"; case 4: %file = "gbl.obnoxious"; case 5: %file = "gbl.shazbot"; } switch ( GMW_RaceGenderPopup.getSelected() ) { case 0: %base = "Male"; case 1: %base = "Fem"; case 2: %base = "Derm"; } GMW_VoiceTestBtn.setActive( false ); %voiceId = %this.getSelected() + 1; %wav = "voice/" @ %base @ %voiceId @ "/" @ %file @ ".wav"; %handle = alxCreateSource( AudioGui, %wav ); //pitch the voice //%pitchSliderVal = GMW_VoicePitchSlider.getValue(); //%pitch = getValidVoicePitch(%voiceId, %pitchSliderVal); //if (%pitch != 1.0) // alxSourcef(%handle, "AL_PITCH", %pitch); alxPlay( %handle ); %delay = alxGetWaveLen( %wav ); schedule( %delay, 0, "restoreVoiceTestButton" ); if ( %this.voiceIndex == 5 ) %this.voiceIndex = 0; else %this.voiceIndex++; } //------------------------------------------------------------------------------ function restoreVoiceTestButton() { GMW_VoiceTestBtn.setActive( true ); } //------------------------------------------------------------------------------ function NewWarriorDlg::createPlayer( %this ) { %name = stripTrailingSpaces( NW_NameEdit.getValue() ); $pref::Player[$pref::Player::Count] = %name @ "\tHuman Male\tbeagle\tMale1"; $pref::Player::Current = $pref::Player::Count; $pref::Player::Count++; Canvas.popDialog( NewWarriorDlg ); GM_WarriorPane.onActivate(); // Refresh the warrior gui } //------------------------------------------------------------------------------ function NW_NameEdit::checkValidPlayerName( %this ) { %name = %this.getValue(); %test = strToPlayerName( %name ); if ( %name !$= %test ) %this.setValue( %test ); NW_DoneBtn.setActive( strlen( stripTrailingSpaces( %test ) ) > 2 ); } //------------------------------------------------------------------------------ function NW_NameEdit::processEnter( %this ) { %this.checkValidPlayerName(); if ( NW_DoneBtn.isActive() ) NewWarriorDlg.createPlayer(); } PK !(Qzyo//scripts/HuntersGame.cs//--------------------------------------// // HuntersGame.cs // //--------------------------------------// //--- GAME RULES BEGIN --- //Kill other players to make them drop flags //Return flags to the Nexus for points //The more flags brought to Nexus at one time, the more each flag scores //GREED mode: you must return 8 or more flags at once to score //HOARD mode: no returns between 5 and 2 min. left in game //Flag Colors: Red = 1pt, Blue = 2pts, Yellow = 4pts, Green = 8pts //--- GAME RULES END --- package HuntersGame { function Nexus::objectiveInit(%data, %object) { Game.Nexus = %object; Game.Nexus.playThread(0, "ambient"); Game.Nexus.setThreadDir(0, true); //The flash animation plays forwards, then back automatically, so we have to alternate the thread direcction... Game.Nexus.flashThreadDir = true; } function NexusBase::objectiveInit(%data, %object) { Game.NexusBase = %object; Game.NexusBase.playthread(0, "ambient"); Game.NexusBase.setThreadDir(0, true); } function NexusCap::objectiveInit(%data, %object) { Game.NexusCap = %object; Game.NexusCap.playthread(0, "ambient"); Game.NexusCap.setThreadDir(0, true); } }; $InvBanList[Hunters, "TurretOutdoorDeployable"] = 1; $InvBanList[Hunters, "TurretIndoorDeployable"] = 1; $InvBanList[Hunters, "ElfBarrelPack"] = 1; $InvBanList[Hunters, "MortarBarrelPack"] = 1; $InvBanList[Hunters, "PlasmaBarrelPack"] = 1; $InvBanList[Hunters, "AABarrelPack"] = 1; $InvBanList[Hunters, "MissileBarrelPack"] = 1; $InvBanList[Hunters, "Mine"] = 1; datablock EffectProfile(HuntersFlagPickupEffect) { effectname = "misc/hunters_flag_snatch"; minDistance = 2.5; maxDistance = 5.0; }; datablock AudioProfile(HuntersFlagPickupSound) { filename = "fx/misc/hunters_flag_snatch.wav"; description = AudioClose3d; effect = HuntersFlagPickupEffect; preload = true; }; //exec the AI script exec("scripts/aiHunters.cs"); //exec the records script if (isFile("prefs/HuntersRecords.cs")) exec("prefs/HuntersRecords.cs"); //----------------------------------------------------------------------------- //Game initialization functions function HuntersGame::setUpTeams(%game) { // Force the numTeams variable to one: DefaultGame::setUpTeams(%game); %game.numTeams = 1; // allow teams 1->31 to listen to each other (team 0 can only listen to self) for(%i = 1; %i < 32; %i++) setSensorGroupListenMask(%i, 0xfffffffe); } function HuntersGame::initGameVars(%game) { %game.SCORE_PER_SUICIDE = -1; %game.SCORE_PER_DEATH = 0; %game.SCORE_PER_KILL = 1; %game.teamMode = false; if (!isDemo()) %game.greedMode = $Host::HuntersGreedMode; else %game.greedMode = false; %game.greedMinFlags = 8; //min number of flags you must have before you can cap if (!isDemo()) %game.hoardMode = $Host::HuntersHoardMode; else %game.hoardMode = false; %game.HoardStartTime = 5; //time left in the game at which hoard mode will start %game.HoardDuration = 3; //duration of the hoard period %game.HoardEndTime = %game.HoardStartTime - %game.HoardDuration; %game.yardSaleMin = 10; //make sure there is enough time in the match to actually have a hoard mode... if ($host::timeLimit < %game.hoardStartTime + 1) %game.hoardMode = false; %game.maxSensorGroup = 0; %game.highestFlagReturnCount = 10; //initialize to 10 - don't bother recording less than that... %game.highestFlagReturnName = ""; %game.greedFlagCount = 10; //initialize to 10 - don't bother recording greed less than that... %game.greedFlagName = ""; //this is how many humans have to be playing in order to set a record %game.numHumansForRecord = 4; //this is how many milliseconds before a warning is issued for camping near the Nexus %game.nexusCampingTime = 10000; %game.flagHoarder = ""; %game.flagHoarderMin = 15; //vars for how long before the flag is deleted, and the fade transition time... %game.flagLifeTimeMS = 120000; %game.fadeTimeMS = 2000; %game.flagMsgDelayMS = 3000; %game.oobThrowFlagsDelayMS = 3000; // targets for each of the flag types (except for base which is properly skinned already) HuntersFlag1.target = -1; // red HuntersFlag2.target = allocTarget("", 'Blue', "", "", 0, "", ""); HuntersFlag4.target = allocTarget("", 'Yellow', "", "", 0, "", ""); HuntersFlag8.target = allocTarget("", 'Green', "", "", 0, "", ""); } function HuntersGame::allowsProtectedStatics(%game) { return true; } function HuntersGame::missionLoadDone(%game) { //default version sets up teams - must be called first... DefaultGame::missionLoadDone(%game); //initialize the score and flag count for all the players %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %client = ClientGroup.getObject(%i); %game.resetScore(%client); %client.flagCount = 1; %client.trackWaypoint = ""; %client.playerTrackLine = -1; } $TopClient = -1; $TopClientScore = 0; //create the Flag group $FlagGroup = nameToID("MissionCleanup/FlagGroup"); if ($FlagGroup <= 0) { $FlagGroup = new SimGroup("FlagGroup"); MissionCleanup.add($FlagGroup); } //create the "yard sale waypoint set" if(nameToId("HuntersYardSaleSet") <= 0) { $HuntersYardSaleSet = new SimSet("HuntersYardSaleSet"); MissionCleanup.add($HuntersYardSaleSet); } } function HuntersGame::startMatch(%game) { //call the default DefaultGame::startMatch(%game); //schedule the hoard countdowns %game.setupHoardCountdown(); } function HuntersGame::setupHoardCountdown(%game) { //delete all previous scheduled calls... cancel(%game.hoardStart30); cancel(%game.hoardStart10); cancel(%game.hoardStart5); cancel(%game.hoardStart4); cancel(%game.hoardStart3); cancel(%game.hoardStart2); cancel(%game.hoardStart1); cancel(%game.hoardStart0); cancel(%game.hoardEnd30); cancel(%game.hoardEnd10); cancel(%game.hoardEnd5); cancel(%game.hoardEnd4); cancel(%game.hoardEnd3); cancel(%game.hoardEnd2); cancel(%game.hoardEnd1); cancel(%game.hoardEnd0); //schedule hoard mode start notify calls %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); %hoardStartTimeMS = %game.HoardStartTime * 60 * 1000; if (%curTimeLeftMS >= %hoardStartTimeMS + 30000) %game.hoardStart30 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 30000), "notifyHoardStart", 30); if (%curTimeLeftMS >= %hoardStartTimeMS + 10000) %game.hoardStart10 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 10000), "notifyHoardStart", 10); if (%curTimeLeftMS >= %hoardStartTimeMS + 5000) %game.hoardStart5 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 5000), "notifyHoardStart", 5); if (%curTimeLeftMS >= %hoardStartTimeMS + 4000) %game.hoardStart4 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 4000), "notifyHoardStart", 4); if (%curTimeLeftMS >= %hoardStartTimeMS + 3000) %game.hoardStart3 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 3000), "notifyHoardStart", 3); if (%curTimeLeftMS >= %hoardStartTimeMS + 2000) %game.hoardStart2 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 2000), "notifyHoardStart", 2); if (%curTimeLeftMS >= %hoardStartTimeMS + 1000) %game.hoardStart1 = %game.schedule(%curTimeLeftMS - (%hoardStartTimeMS + 1000), "notifyHoardStart", 1); if (%curTimeLeftMS >= %hoardStartTimeMS) %game.hoardStart0 = %game.schedule(%curTimeLeftMS - %hoardStartTimeMS, "notifyHoardStart", 0); //schedule hoard mode end notify calls %hoardEndTimeMS = %game.HoardEndTime * 60 * 1000; if (%curTimeLeftMS >= %hoardEndTimeMS + 30000) %game.hoardEnd30 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 30000), "notifyHoardEnd", 30); if (%curTimeLeftMS >= %hoardEndTimeMS + 10000) %game.hoardEnd10 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 10000), "notifyHoardEnd", 10); if (%curTimeLeftMS >= %hoardEndTimeMS + 5000) %game.hoardEnd5 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 5000), "notifyHoardEnd", 5); if (%curTimeLeftMS >= %hoardEndTimeMS + 4000) %game.hoardEnd4 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 4000), "notifyHoardEnd", 4); if (%curTimeLeftMS >= %hoardEndTimeMS + 3000) %game.hoardEnd3 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 3000), "notifyHoardEnd", 3); if (%curTimeLeftMS >= %hoardEndTimeMS + 2000) %game.hoardEnd2 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 2000), "notifyHoardEnd", 2); if (%curTimeLeftMS >= %hoardEndTimeMS + 1000) %game.hoardEnd1 = %game.schedule(%curTimeLeftMS - (%hoardEndTimeMS + 1000), "notifyHoardEnd", 1); if (%curTimeLeftMS >= %hoardEndTimeMS) %game.hoardEnd0 = %game.schedule(%curTimeLeftMS - %hoardEndTimeMS, "notifyHoardEnd", 0); } function HuntersGame::notifyHoardStart(%game, %seconds) { if (%game.HoardMode) { if (%seconds > 1) messageAll('MsgHuntersHoardNotifyStart', '\c2%1 seconds left until the HOARD period begins.~wfx/misc/hunters_%1.wav', %seconds); else if (%seconds == 1) messageAll('MsgHuntersHoardNotifyStart', '\c21 second left until the HOARD period begins.~wfx/misc/hunters_1.wav'); else { messageAll('MsgHuntHoardNotifyStarted', '\c2The HOARD period has begun.~wfx/misc/hunters_horde.wav'); logEcho("hoard mode start"); %game.setNexusDisabled(); cancel(%game.greedNexusFlash); } } } function HuntersGame::notifyHoardEnd(%game, %seconds) { if (%game.HoardMode) { if (%seconds > 1) messageAll('MsgHuntersHoardNotifyEnd', '\c2%1 seconds left until the HOARD period ends.~wfx/misc/hunters_%1.wav', %seconds); else if (%seconds == 1) messageAll('MsgHuntersHoardNotifyEnd', '\c21 second left until the HOARD period ends.~wfx/misc/hunters_1.wav'); else { messageAll('MsgHuntersHoardNotifyEnded', '\c2The HOARD period has ended!~wfx/misc/hunters_greed.wav'); logEcho("hoard mode end"); %game.setNexusEnabled(); cancel(%game.greedNexusFlash); } } } function HuntersGame::clientJoinTeam( %game, %client, %team, %respawn ) { %game.assignClientTeam( %client ); // Spawn the player: %game.spawnPlayer( %client, %respawn ); } //----------------------------------------------------------------------------- //Player spawn/death functions function HuntersGame::assignClientTeam(%game, %client) { %client.team = 0; //initialize the team array for (%i = 1; %i < 32; %i++) $HuntersTeamArray[%i] = false; %game.maxSensorGroup = 0; %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team != 0) $HuntersTeamArray[%cl.team] = true; //need to set the number of sensor groups to the max... if (%cl.team > %game.maxSensorGroup) %game.maxSensorGroup = %cl.team; } //now loop through the team array, looking for an empty team for (%i = 1; %i < 32; %i++) { if (! $HuntersTeamArray[%i]) { %client.team = %i; if (%client.team > %game.maxSensorGroup) %game.maxSensorGroup = %client.team; break; } } // set player's skin pref here setTargetSkin(%client.target, %client.skin); // Let everybody know you are no longer an observer: messageAll( 'MsgClientJoinTeam', '\c1%1 has joined the hunt.', %client.name, "", %client, 1 ); updateCanListenState( %client ); //now set the max number of sensor groups... setSensorGroupCount(%game.maxSensorGroup + 1); } function HuntersGame::createPlayer(%game, %client, %spawnLoc, %respawn) { //first call the default DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn); //now set the sensor group %client.setSensorGroup(%client.team); } function HuntersGame::pickPlayerSpawn(%game, %client, %respawn) { return %game.pickTeamSpawn(1); } function HuntersGame::playerSpawned(%game, %player, %armor) { //intialize %client = %player.client; %client.flagCount = 1; %client.isDead = false; //make sure they're not still taking camping damage... cancel(%client.campingThread); //continue with the default DefaultGame::playerSpawned(%game, %player, %armor); } function HuntersGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc) { //set the flag %clVictim.isDead = true; //set the greed variable if required if (!%game.teamMode && $missionRunning) { if (%clVictim.flagCount - 1 > %game.greedFlagCount) { %game.greedFlagCount = %clVictim.flagCount - 1; %game.greedFlagName = getTaggedString(%clVictim.name); } } //first, drop all the flags HuntersGame::dropFlag(%game, %clVictim.player); //now call the default game stuff DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc); messageClient(%clVictim, 'MsgHuntYouHaveFlags', "", 0); } function HuntersGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { if (%game.testKill(%clVictim, %clKiller)) //verify victim was an enemy { %game.awardScoreKill(%clKiller); %game.awardScoreDeath(%clVictim); } else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide %game.awardScoreSuicide(%clVictim); } function Huntersgame::awardScoreKill(%game, %client) { //call the default DefaultGame::awardScoreKill(%game, %client); //check if we have a new leader if (!%game.teamMode && (%client.score > $TopClientScore)) { $TopClientScore = %client.score; //this message is annoying! //if (%client != $TopClient) // messageAll('MsgHuntNewTopScore', '\c0%1 has taken the lead with a score of %2!~wfx/misc/flag_capture.wav', %client.name, %client.score); $TopClient = %client; } } function Huntersgame::awardScoreSuicide(%game, %client) { //call the default DefaultGame::awardScoreSuicide(%game, %client); //check if we have a new leader if (!%game.teamMode && %client == $TopClient && (%client.score < $TopClientScore)) { //first lower the topClientScore var $TopClientScore = %client.score; //see if there's a new leader... %highestScore = %client.score; %highestScoreClient = -1; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.score > %highestScore) { %highestScore = %cl.score; %highestScoreClient = %cl; } } //did we find someone? if (%highestScoreClient > 0) { $TopClientScore = %highestScoreClient.score; $TopClient = %highestScoreClient; //this message is annoying... //messageAll('MsgHuntNewTopScore', '\c0%1 is now in the lead with a score of %2!~wfx/misc/flag_capture.wav', %highestScoreClient.name, %highestScoreClient.score); } } } function HuntersGame::equip(%game, %player) { for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); //%player.setArmor("Light"); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Chaingun,1); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 20); %player.setInventory(EnergyPack,1); %player.setInventory(TargetingLaser, 1); %player.weaponCount = 3; %player.use("Disc"); } //----------------------------------------------------------------------------- //flag functions function HuntersGame::playerDroppedFlag(%game, %player) { // this stuff has all been moved to HuntersGame::dropFlag // we really don't want something to happen for *every* flag a player drops anyway } function HuntersStartFlagTimeOut(%flag) { // start the fade out... %flag.startFade(Game.fadeTimeMS, 0, true); schedule(Game.fadeTimeMS, %flag, "HuntersEndFlagTimeOut", %flag); } function HuntersEndFlagTimeOut(%flag) { %flag.delete(); } function HuntersYardSaleTimeOut(%waypoint) { %waypoint.delete(); } function HuntersGame::updateFlagHoarder(%game, %eventClient) { %hoarder = -1; %maxFlags = -1; %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %client = ClientGroup.getObject(%i); if (%client.flagCount > %game.flagHoarderMin && %client.flagCount > %maxFlags) { %maxflags = %client.flagCount; %hoarder = %client; } } //if we found our hoarder, set the waypoint, otherwise, delete it if (%hoarder > 0) { //only update if the event (capping, picking up flag, etc...) was the actual hoarder if (!isObject(%game.flagHoarder) || %game.flagHoarder == %eventClient) { if (!isObject(%game.hoarderWaypoint)) { //create a waypoint at player's location... %game.hoarderWaypoint = new WayPoint() { position = %hoarder.player.position; rotation = "1 0 0 0"; scale = "1 1 1"; name = "Flag Hoarder Was Here"; dataBlock = "WayPointMarker"; lockCount = "0"; homingCount = "0"; team = 0; }; //add the waypoint to the cleanup group MissionCleanup.add(%game.hoarderWaypoint); } //set the position %game.flagHoarder = %hoarder; %game.hoarderWaypoint.setTransform(%hoarder.player.getWorldBoxCenter() SPC "0 0 1 0"); } } else if (isObject(%game.hoarderWaypoint)) { %game.flaghoarder = ""; %game.hoarderWaypoint.delete(); } } function HuntersGame::sendFlagCountMessage(%game, %client) { //send the messages if (%client.flagCount - 1 == 1) { messageAllExcept(%client, -1, 'MsgHuntPlayerHasFlags', '\c2%1 now has 1 flag.', %client.name, 1); messageClient(%client, 'MsgHuntYouHaveFlags', '\c2You now have 1 flag.', %client.flagCount - 1); } else if (%client.flagCount - 1 > 1) { messageAllExcept(%client, -1, 'MsgHuntPlayerHasFlags', '\c2%1 now has %2 flags.', %client.name, %client.flagCount - 1); messageClient(%client, 'MsgHuntYouHaveFlags', '\c2You now have %1 flags.', %client.flagCount - 1); } } function HuntersGame::playerTouchFlag(%game, %player, %flag) { //make sure the player is still alive %client = %player.client; if (%player.getState() !$= "Dead") { //increase the count bye the flag value %flagValue = %flag.value; %client.flagCount += %flagValue; //delete the flag %flag.delete(); //if the client has 5 or more flags, mount an image if (%client.flagCount >= 5) %player.mountImage(HuntersFlagImage, $FlagSlot); //schedule an update message cancel(%client.flagMsgPending); %client.flagMsgPending = %game.schedule(%game.flagMsgDelayMS, "sendFlagCountMessage", %client); messageClient(%client, 'MsgHuntYouHaveFlags', "", %client.flagCount - 1); //update the log... logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") has "@%client.flagCount-1@" flags"); //play the sound pickup in 3D %player.playAudio(0, HuntersFlagPickupSound); //see if the client could set the record if (!%game.teamMode && !%client.couldSetRecord) { %numFlags = %client.flagCount - 1; if (%numFlags > 10 && %numFlags > $Host::HuntersRecords::Count[$currentMission]) { //see if we have at least 4 non-AI players %humanCount = 0; %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (!%cl.isAIControlled()) %humanCount++; if (%humanCount >= %game.numHumansForRecord) break; } if (%humanCount >= %game.numHumansForRecord) { %client.couldSetRecord = true; //send a message right away... if (isEventPending(%client.flagMsgPending)) { cancel(%client.flagMsgPending); %game.sendFlagCountMessage(%client); } //send a message to everyone messageAllExcept(%client, -1, 'MsgHuntPlayerCouldSetRecord', '\c2%1 has enough flags to set the record for this mission!~wfx/misc/flag_return.wav'); messageClient(%client, 'MsgHuntYouCouldSetRecord', '\c2You have enough flags to set the record for this mission!~wfx/misc/flag_return.wav'); } } } //new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags %game.updateFlagHoarder(%client); } } function HuntersGame::checkTimeLimit(%game) { DefaultGame::checkTimeLimit(%game); //make sure the hoard counter is also up to date %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); messageAll('MsgHuntHoardStatus', "", %game.HoardMode, $Host::TimeLimit, %curTimeLeftMS, %game.HoardStartTime, %game.HoardDuration); } function HuntersGame::timeLimitReached(%game) { logEcho("game over (timelimit)"); %game.gameOver(); cycleMissions(); } function HuntersGame::scoreLimitReached(%game) { //no such thing as a score limit in Hunters... } function HuntersGame::gameOver(%game) { //call the default DefaultGame::gameOver(%game); 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); cancel(%client.oobSched); } } function HuntersGame::checkScoreLimit(%game, %client) { //no such thing as a score limit in Hunters... } //----------------------------------------------------------------------------- //Nexus functions function HuntersGame::setNexusDisabled(%game) { //set the animations Game.Nexus.playThread(1, "transition"); Game.NexusCap.playthread(1, "transition"); Game.NexusBase.playthread(1, "transition"); Game.Nexus.setThreadDir(1, true); Game.NexusCap.setThreadDir(1, true); Game.NexusBase.setThreadDir(1, true); } function HuntersGame::setNexusEnabled(%game) { //set the animations Game.Nexus.playThread(1, "transition"); Game.NexusCap.playthread(1, "transition"); Game.NexusBase.playthread(1, "transition"); Game.Nexus.setThreadDir(1, false); Game.NexusCap.setThreadDir(1, false); Game.NexusBase.setThreadDir(1, false); } function HuntersGame::flashNexus(%game) { //set the animations Game.Nexus.playThread(1, "flash"); Game.NexusCap.playthread(1, "flash"); Game.NexusBase.playthread(1, "flash"); Game.Nexus.setThreadDir(1, Game.Nexus.flashThreadDir); Game.NexusCap.setThreadDir(1, Game.Nexus.flashThreadDir); Game.NexusBase.setThreadDir(1, Game.Nexus.flashThreadDir); Game.Nexus.flashThreadDir = !Game.Nexus.flashThreadDir; } function HuntersGame::NexusSparkEmitter(%game, %client, %cap, %numToScore) { if (isObject(%client.nexusEmitter)) %client.nexusEmitter.delete(); %client.nexusEmitter = new ParticleEmissionDummy() { //position = getWord(%client.player.position, 0) SPC getWord(%client.player.position, 1) SPC getWord(%client.player.position, 2) + 3; position = (%cap ? Game.nexus.getWorldBoxCenter() : %client.player.getWorldBoxCenter()); rotation = "1 0 0 0"; scale = "1 1 1"; dataBlock = defaultEmissionDummy; emitter = (%cap ? NexusParticleCapEmitter : NexusParticleDeniedEmitter); velocity = "1"; }; MissionCleanup.add(%client.nexusEmitter); //the effect should only last a few seconds if (%cap) { %timeMS = (%numToScore < 10 ? 200 : %numToScore * 20); %client.nexusEmitter.schedule(%timeMS, "delete"); } else %client.nexusEmitter.schedule(200, "delete"); } function HuntersGame::hoardModeActive(%game, %wouldBeActive) { if (%wouldBeActive $= "") %wouldBeActive = false; //see if hoard mode is on and active if (%game.HoardMode || %wouldBeActive) { %missionEndTime = ($Host::TimeLimit * 60 * 1000) + $missionStartTime; %timeLeftMS = %missionEndTime - getSimTime(); %hoardStartTime = %game.HoardStartTime * 60 * 1000; %hoardEndTime = %hoardStartTime - (%game.HoardDuration * 60 * 1000); if (%timeLeftMS <= %hoardStartTime && %timeLeftMS > %hoardEndTime) return true; } return false; } function Nexus::onCollision(%data, %obj, %colObj) { //make sure it was a player that entered the trigger if((%colObj.getDataBlock().className $= Armor) && (%colObj.getState() !$= "Dead")) { %player = %colObj; %client = %player.client; // if player has been to the nexus within last 5 seconds, don't keep spamming messages if((getSimTime() - %player.lastNexusTime) < 5000) return; %player.lastNexusTime = getSimTime(); if(Game.hoardModeActive()) { messageClient(%client, 'MsgHuntHoardNoCap', '\c2Hoard mode is in effect! You cannot return any flags right now.~wfx/powered/nexus_deny.wav'); //apply a "bounce" impulse to the player %velocity = %player.getVelocity(); if (VectorDist("0 0 0", %velocity) < 2) %velocityNorm = "0 20 0"; else %velocityNorm = VectorScale(VectorNormalize(%velocity), 20); %vector = VectorScale(%velocityNorm, -200); %player.applyImpulse(%player.position, %vector); Game.NexusSparkEmitter(%client, false); return; } // you can't cap your own flag %numToScore = %client.flagCount - 1; if (Game.greedMode && (%numToScore < Game.GreedMinFlags) && (%numToScore >= 1)) { messageClient(%client, 'MsgHuntNeedGreed', '\c2Greed mode is ON! You must have %1 flags before you can return them.~wfx/powered/nexus_deny.wav', Game.GreedMinFlags); //transition the Nexus to the "off" animation and back again Game.flashNexus(); //apply a "bounce" impuse to the player %velocity = %player.getVelocity(); if (VectorDist("0 0 0", %velocity) < 2) %velocityNorm = "0 20 0"; else %velocityNorm = VectorScale(VectorNormalize(%velocity), 20); %vector = VectorScale(%velocityNorm, -200); %player.applyImpulse(%player.position, %vector); Game.NexusSparkEmitter(%client, false); return; } //send the flags message right away... if (isEventPending(%client.flagMsgPending)) { cancel(%client.flagMsgPending); %game.sendFlagCountMessage(%client); } //unless the nexus is very near the mission boundary, there should be no oobSched to cancel, but... cancel(%client.oobSched); //score the flags %totalScore = (%numToScore * (%numToScore + 1)) / 2; if (Game.teamMode) { $teamScore[%client.team] += %totalScore; logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") score "@%numToScore@" flags worth "@%totalScore@" pts for team "@%client.team); messageAll('MsgTeamScoreIs', "", %client.team, $teamScore[%client.team]); Game.recalcTeamRanks(%client.team); } else { %client.flagPoints += %totalScore; logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") score "@%numToScore@" flags worth "@%totalScore@" pts"); Game.recalcScore(%client); //see if we should set the highest for the mission here if (%numToScore > Game.highestFlagReturnCount) { Game.highestFlagReturnCount = %numToScore; Game.highestFlagReturnName = getTaggedString(%client.name); } } //reset the flags %client.flagCount = 1; %client.couldSetRecord = false; %player.unMountImage($FlagSlot); messageClient(%client, 'MsgHuntYouHaveFlags', "", 0); //see if it's the top score if (!Game.teamMode && (%client.score > $TopClientScore)) %topScore = true; else %topScore = false; //send the messages if (%numToScore <= 0) { messageClient(%client, 'MsgHuntYouNeedHelp', '\c2Pick up flags and bring them here to score points.~wfx/misc/nexus_idle.wav'); } else if (%numToScore == 1) { if(Game.teamMode) messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned 1 flag (1 point) for %2.~wfx/misc/nexus_cap.wav', %client.name, $TeamName[%client.team], 1); else { messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned 1 flag for 1 point.~wfx/misc/nexus_cap.wav', %client.name, 1); //new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags Game.updateFlagHoarder(%client); } //add the nexus effect Game.NexusSparkEmitter(%client, true, %numToScore); messageClient(%client, 'MsgHuntYouScored', '\c2You returned 1 flag for 1 point.~wfx/misc/nexus_cap.wav', 1); } else if (%numToScore < 5) { if(Game.teamMode) messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned %2 flags (%3 points) for %4.~wfx/misc/nexus_cap.wav', %client.name, %numToScore, %totalScore, $TeamName[%client.team]); else { messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned %2 flags for %3 points.~wfx/misc/nexus_cap.wav', %client.name, %numToScore, %totalScore); //new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags Game.updateFlagHoarder(%client); } //add the nexus effect Game.NexusSparkEmitter(%client, true, %numToScore); messageClient(%client, 'MsgHuntYouScored', '\c2You returned %1 flags for %2 points.~wfx/misc/nexus_cap.wav', %numToScore, %totalScore); } else { if(Game.teamMode) messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned %2 flags (%3 points) for %4.~wfx/misc/nexus_cap.wav', %client.name, %numToScore, %totalScore, $TeamName[%client.team]); else { messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned %2 flags for %3 points.~wfx/misc/nexus_cap.wav', %client.name, %numToScore, %totalScore); //new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags Game.updateFlagHoarder(%client); } //add the nexus effect Game.NexusSparkEmitter(%client, true, %numToScore); messageClient(%client, 'MsgHuntYouScored', '\c2You returned %1 flags for %2 points.~wfx/misc/nexus_cap.wav', %numToScore, %totalScore); } //see if it's the top score if (%topScore) { $TopClientScore = %client.score; if (%client == $TopClient) { if (%numToScore >= 5) messageAll('MsgHuntTopScore', '\c0%1 is leading with a score of %2!~wfx/misc/flag_capture.wav', %client.name, %client.score); else messageAll('MsgHuntTopScore', '\c0%1 is leading with a score of %2!', %client.name, %client.score); } else messageAll('MsgHuntNewTopScore', '\c0%1 has taken the lead with a score of %2!~wfx/misc/flag_capture.wav', %client.name, %client.score); $TopClient = %client; } //see if it's a record if (%numToScore > 10 && %numToScore > $Host::HuntersRecords::Count[$currentMission]) { //see if we have at least 4 non-AI players %humanCount = 0; %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (!%cl.isAIControlled()) %humanCount++; if (%humanCount >= Game.numHumansForRecord) break; } if (%humanCount >= Game.numHumansForRecord) { $Host::HuntersRecords::Count[$currentMission] = %numToScore; $Host::HuntersRecords::Name[$currentMission] = getTaggedString(%client.name); //send a message to everyone messageAllExcept(%client, -1, 'MsgHuntPlayerSetRecord', '\c2%1 set the record for this mission with a return of %2 flags!~wfx/misc/flag_return.wav', %client.name, %numToScore); messageClient(%client, 'MsgHuntYouSetRecord', '\c2You set the record for this mission with a return of %1 flags!~wfx/misc/flag_return.wav', %numToScore); //update the records file... export( "$Host::HuntersRecords::*", "prefs/HuntersRecords.cs", false ); //once the record has been set, reset everyone's tag for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%count); %cl.couldSetRecord = false; } } } if(Game.teamMode) Game.checkScoreLimit(%team); else Game.checkScoreLimit(%client); } } function HuntersGame::clientMissionDropReady(%game, %client) { //%client.rank = ClientGroup.getCount(); messageClient(%client, 'MsgClientReady',"", %game.class); //messageClient(%client, 'MsgHuntGreedStatus', "", %game.greedMode, %game.GreedMinFlags); //%curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); //messageClient(%client, 'MsgHuntHoardStatus', "", %game.HoardMode, $Host::TimeLimit, %curTimeLeftMS, %game.HoardStartTime, %game.HoardDuration); messageClient(%client, 'MsgHuntYouHaveFlags', "", 0); messageClient(%client, 'MsgYourScoreIs', "", 0); // MES function below does not exist //%game.populateRankArray(%client); //messageClient(%client, 'MsgYourRankIs', "", -1); messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); DefaultGame::clientMissionDropReady(%game, %client); } function HuntersGame::AIHasJoined(%game, %client) { //let everyone know the player has joined the game //messageAllExcept(%client, -1, 'MsgClientJoin', '%1 joined the game.', %client.name, "", %client, 1); } function HuntersGame::resetScore(%game, %client) { %client.score = 0; %client.suicides = 0; %client.kills = 0; %client.teamKills = 0; %client.deaths = 0; %client.flagPoints = 0; } function HuntersGame::recalcScore(%game, %cl) { if (%cl <= 0) return; %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); %cl.score = %killPoints; %cl.score += %cl.flagPoints; %cl.score += %cl.suicides * %game.SCORE_PER_SUICIDE; //%cl.score = mFloatLength(%cl.score, 1); %cl.score = mFloor(%cl.score); //must send the message to update the HUD messageClient(%cl, 'MsgYourScoreIs', "", %cl.score); %game.recalcTeamRanks(%cl); } function HuntersGame::sendGameVoteMenu( %game, %client, %key ) { // Don't send any options if a vote is already running: if ( %game.scheduleVote $= "" ) { // First send the common options: DefaultGame::sendGameVoteMenu( %game, %client, %key ); if (!isDemo()) { if(!%client.isAdmin) { // Now send the Hunters-specific options: if ( %game.greedMode ) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteGreedMode', 'disable greed mode', 'Vote Disable GREED Mode' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteGreedMode', 'enable greed mode', 'Vote Enable GREED Mode' ); if ( %game.HoardMode ) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteHoardMode', 'disable hoard mode', 'Vote Disable HOARD Mode' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteHoardMode', 'enable hoard mode', 'Vote Enable HOARD Mode' ); } else { if ( %game.greedMode ) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteGreedMode', 'disable greed mode', 'Disable GREED Mode' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteGreedMode', 'enable greed mode', 'Enable GREED Mode' ); if ( %game.HoardMode ) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteHoardMode', 'disable hoard mode', 'Disable HOARD Mode' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteHoardMode', 'enable hoard mode', 'Enable HOARD Mode' ); } } } } function HuntersGame::voteGreedMode( %game, %admin, %player ) { %cause = ""; %setto = ""; if ( %admin ) { if ( %game.greedMode ) { messageAll( 'AdminDisableGreedMode', '\c2The Admin has disabled GREED mode.~wfx/misc/hunters_greed.wav' ); %game.greedMode = false; %setto = "disabled"; } else { messageAll( 'AdminEnableGreedMode', '\c2The Admin has enabled GREED mode.~wfx/misc/hunters_greed.wav' ); %game.greedMode = true; %setto = "enabled"; } %cause = "(admin)"; } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if ( %totalVotes > 0 && ( %game.totalVotesFor / %totalVotes ) > 0.7 ) { if ( %game.greedMode ) { messageAll( 'MsgVotePassed', '\c2GREED mode was disabled by vote.~wfx/misc/hunters_greed.wav' ); %game.greedMode = false; %setto = "disabled"; } else { messageAll( 'MsgVotePassed', '\c2GREED mode was enabled by vote.~wfx/misc/hunters_greed.wav' ); %game.greedMode = true; %setto = "enabled"; } %cause = "(vote)"; // alxPlay(VotePassSound, 0, 0, 0); } else { if ( %game.greedMode ) messageAll( 'MsgVoteFailed', '\c2Disable GREED mode vote did not pass, %1 to %2.', %game.totalVotesFor, %game.totalVotesAgainst ); else messageAll( 'MsgVoteFailed', '\c2Enable GREED mode vote did not pass, %1 to %2.', %game.totalVotesFor, %game.totalVotesAgainst ); // alxPlay(VoteNotPassSound, 0, 0, 0); } } //send the global message messageAll('MsgHuntGreedStatus', "", %game.greedMode, %game.GreedMinFlags); if(%setto !$= "") logEcho("greed mode "@%setto SPC %cause); //store the result if (%game.teamMode) $Host::TeamHuntersGreedMode = %game.greedMode; else $Host::HuntersGreedMode = %game.greedMode; } function HuntersGame::voteHoardMode( %game, %admin, %player ) { %cause = ""; %setto = ""; if ( %admin ) { if ( %game.HoardMode ) { messageAll( 'AdminDisableHoardMode', '\c2The Admin has disabled HOARD mode.' ); %game.HoardMode = false; %setto = "disabled"; } else { messageAll( 'AdminEnableHoardMode', '\c2The Admin has enabled HOARD mode.' ); %game.HoardMode = true; %setto = "enabled"; } %cause = "(admin)"; } else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if ( %totalVotes > 0 && ( %game.totalVotesFor / %totalVotes ) > 0.7 ) { if ( %game.HoardMode ) { messageAll( 'MsgVotePassed', '\c2HOARD mode was disabled by vote.' ); %game.HoardMode = false; %setto = "disabled"; } else { messageAll( 'MsgVotePassed', '\c2HOARD mode was enabled by vote.' ); %game.HoardMode = true; %setto = "enabled"; } %cause = "(vote)"; // alxPlay(VotePassSound, 0, 0, 0); } else { if ( %game.HoardMode ) messageAll( 'MsgVoteFailed', '\c2Disable HOARD mode vote did not pass, %1 to %2.', %game.totalVotesFor, %game.totalVotesAgainst ); else messageAll( 'MsgVoteFailed', '\c2Enable HOARD mode vote did not pass, %1 to %2.', %game.totalVotesFor, %game.totalVotesAgainst ); // alxPlay(VoteNotPassSound, 0, 0, 0); } } //send the global message %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); messageAll('MsgHuntHoardStatus', "", %game.HoardMode, $Host::TimeLimit, %curTimeLeftMS, %game.HoardStartTime, %game.HoardDuration); if(%setto !$= "") logEcho("hoard mode "@%setto SPC %cause); //store the result if (%game.teamMode) $Host::TeamHuntersHoardMode = %game.HoardMode; else $Host::HuntersHoardMode = %game.HoardMode; } function HuntersGame::voteChangeTimeLimit( %game, %admin, %newLimit ) { %oldTimeLimit = $Host::TimeLimit; DefaultGame::voteChangeTimeLimit(%game, %admin, %newLimit); //if the time limit changed, this will affect hoard mode: if ($Host::TimeLimit != %oldTimeLimit) { %game.setupHoardCountdown(); } } function createDroppedFlag(%data, %value, %player, %game) { %client = %player.client; %playerPos = %player.getWorldBoxCenter(); // create a flag and throw it %droppedflag = new Item() { position = %playerPos; rotation = "0 0 1 " @ (getRandom() * 360); scale = "1 1 1"; dataBlock = %data; collideable = "0"; static = "0"; rotate = "0"; team = "0"; }; $FlagGroup.add(%droppedflag); %droppedFlag.value = %value; // set the flags target (for proper skin) %droppedFlag.setTarget(%data.target); //throw the flag randomly away from the body if (%client.isDead) { %vec = (-1.0 + getRandom() * 2.0) SPC (-1.0 + getRandom() * 2.0) SPC getRandom(); %vec = VectorScale(%vec, 1000 + (getRandom() * 500)); // Add player's velocity %vec = vectorAdd(%vec, %player.getVelocity()); } //else if the player is Out of bounds, throw them in the direction of the nexus else if (%client.outOfBounds) { %towardsNexusVec = VectorSub(%game.nexus.position, %player.position); %towardsNexusVec = getWord(%towardsNexusVec, 0) SPC getWord(%towardsNexusVec, 1) SPC "0"; %towardsNexusVec = VectorNormalize(%towardsNexusVec); //add a little noise %vec = getWord(%towardsNexusVec, 0) + (-0.3 + getRandom() * 0.6) SPC getWord(%towardsNexusVec, 1) + (-0.3 + getRandom() * 0.6) SPC getWord(%towardsNexusVec, 2); %vec = VectorScale(%vec, 1000 + (getRandom() * 500)); } //else throw them more or less in the direction the player was facing... else { %playerFacingVec = MatrixMulVector("0 0 0 " @ getWords(%client.player.getTransform(), 3, 6), "0 1 0"); %playerFacingVec = VectorNormalize(%playerFacingVec); //add a little noise %vec = getWord(%playerFacingVec, 0) + (-0.3 + getRandom() * 0.6) SPC getWord(%playerFacingVec, 1) + (-0.3 + getRandom() * 0.6) SPC getWord(%playerFacingVec, 2); %vec = VectorScale(%vec, 1000 + (getRandom() * 500)); // Add player's velocity %vec = vectorAdd(%vec, %player.getVelocity()); } %droppedflag.applyImpulse(%playerPos, %vec); %droppedflag.setCollisionTimeout(%player); schedule(%game.flagLifeTimeMS, %droppedflag, "HuntersStartFlagTimeOut", %droppedflag); } function HuntersGame::throwFlags(%game, %player) { %client = %player.client; //find out how many flags to drop if (%client.isDead) %numFlags = %client.flagCount; else %numFlags = %client.flagCount - 1; if (%numFlags <= 0) return; //send the flags message right away... if (isEventPending(%client.flagMsgPending)) { cancel(%client.flagMsgPending); %game.sendFlagCountMessage(%client); } %numFlagsToDrop = %numFlags; //reset the count (which doesn't matter if player is dead) %client.flagCount = 1; %client.couldSetRecord = false; //drop the flags %flagIncrement = 1; %db[1] = HuntersFlag1; %db[2] = HuntersFlag2; %db[4] = HuntersFlag4; %db[8] = HuntersFlag8; %i = 0; while (%i < %numFlagsToDrop) { for (%j = 0; %j < 5; %j++) { %numFlagsLeft = %numFlagsToDrop - %i; if (%numFlagsLeft >= %flagIncrement) { createDroppedFlag(%db[%flagIncrement], %flagIncrement, %player, %game); %i += %flagIncrement; } else { // cleanup if (%numFlagsLeft >= 8) { createDroppedFlag(%db[8], 8, %player, %game); %i += 8; %numFlagsLeft -= 8; } if (%numFlagsLeft >= 4) { createDroppedFlag(%db[4], 4, %player, %game); %i += 4; %numFlagsLeft -= 4; } if (%numFlagsLeft >= 2) { createDroppedFlag(%db[2], 2, %player, %game); %i += 2; %numFlagsLeft -= 2; } if (%numFlagsLeft >= 1) { createDroppedFlag(%db[1], 1, %player, %game); %i += 1; %numFlagsLeft -= 1; } if (%i != %numFlagsToDrop || %numFlagsLeft != 0) { error("Error, missing a flag!"); } break; } } if (%flagIncrement < 8) %flagIncrement = %flagIncrement * 2; } //yard sale! if (%numFlags >= %game.yardSaleMin) { messageAll('MsgHuntYardSale', '\c2YARD SALE!!!~wfx/misc/yardsale.wav'); //create a waypoint at player's location... %yardWaypoint = new WayPoint() { position = %player.position; rotation = "1 0 0 0"; scale = "1 1 1"; name = "YARD SALE!"; dataBlock = "WayPointMarker"; lockCount = "0"; homingCount = "0"; team = "0"; }; //add the waypoint to the cleanup group MissionCleanup.add(%yardWaypoint); $HuntersYardSaleSet.add(%yardWaypoint); schedule(30000, %yardWaypoint, "HuntersYardSaleTimeOut", %yardWaypoint); } //remove any mounted flag from the player %player.unMountImage($FlagSlot); //update the client's hud messageClient(%client, 'MsgHuntYouHaveFlags', "", 0); //new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags %game.updateFlagHoarder(%client); } function HuntersGame::dropFlag(%game, %player) { //first throw the flags %game.throwFlags(%player); //send the messages if (%numFlags == 1) { messageAllExcept(%client, -1, 'MsgHuntPlayerDroppedFlags', '\c0%1 dropped 1 flag.', %client.name, 1); messageClient(%client, 'MsgHuntYouDroppedFlags', '\c0You dropped 1 flag.', 1); } else if (%numFlags > 1) { messageAllExcept(%client, -1, 'MsgHuntPlayerDroppedFlags', '\c0%1 dropped %2 flags.', %client.name, %numFlags); messageClient(%client, 'MsgHuntYouDroppedFlags', '\c0You dropped %1 flags.', %numFlags); } logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") dropped "@%numFlags@" flags"); } function HuntersGame::enterMissionArea(%game, %playerData, %player) { if(%player.getState() $= "Dead") return; %client = %player.client; %client.outOfBounds = false; cancel(%client.oobSched); messageClient(%player.client, 'MsgEnterMissionArea', '\c1You are back in the mission area.'); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") entered mission area"); cancel(%player.alertThread); } function HuntersGame::leaveMissionArea(%game, %playerData, %player) { if(%player.getState() $= "Dead") return; // strip flags and throw them back into the mission area %client = %player.client; %client.outOfBounds = true; if (%player.client.flagCount > 1) messageClient(%player.client, 'MsgLeaveMissionArea', '\c1You have left the mission area and will lose your flags!~wfx/misc/warning_beep.wav'); else messageClient(%player.client, 'MsgLeaveMissionArea', '\c1You have left the mission area.~wfx/misc/warning_beep.wav'); %client.oobSched = %game.schedule(%game.oobThrowFlagsDelayMS, "outOfBoundsThrowFlags", %client); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") left mission area"); } function HuntersGame::outOfBoundsThrowFlags(%game, %client) { %player = %client.player; if (!%client.outOfBounds) return; if (%client.flagCount > 1) { %game.throwFlags(%player); messageClient(%player.client, 'MsgLeaveMissionArea', '\c1You are out of the mission area and have lost your flags!~wfx/misc/flag_taken.wav'); } //set the next schedule check %client.oobSched = %game.schedule(%game.oobThrowFlagsDelayMS, "outOfBoundsThrowFlags", %client); } function HuntersGame::onEnterTrigger(%game, %triggerName, %data, %obj, %colobj) { //schedule a warning in 10 seconds %client = %colobj.client; %client.campingThread = %game.schedule(game.nexusCampingTime, "CampingDamage", %client, true); } function HuntersGame::onLeaveTrigger(%game, %triggerName, %data, %obj, %colobj) { %client = %colobj.client; cancel(%client.campingThread); } function HuntersGame::CampingDamage(%game, %client, %firstWarning) { //make sure we're still alive... %player = %client.player; if (!isObject(%player) || %player.getState() $= "Dead") return; //if the match hasn't yet started, don't warn or apply damage yet... if (!$MatchStarted) { %client.campingThread = %game.schedule(game.nexusCampingTime / 2, "CampingDamage", %client, true); } else if (%firstWarning) { messageClient(%client, 'MsgHuntersNoCampZone', '\c2No camping near the Nexus.', 1); %client.campingThread = %game.schedule(game.nexusCampingTime / 2, "CampingDamage", %client, false); } else { %player.setDamageFlash(0.1); %player.damage(0, %player.position, 0.05, $DamageType::NexusCamping); %client.campingThread = %game.schedule(1000, "CampingDamage", %client, false); } } function HuntersGame::updateScoreHud(%game, %client, %tag) { //tricky stuff here... use two columns if we have more than 15 clients... %numClients = $TeamRank[0, count]; if (%numClients > $ScoreHudMaxVisible) %numColumns = 2; // Clear the header: messageClient( %client, 'SetScoreHudHeader', "", "" ); // Send header: if ( %numColumns == 2 ) messageClient( %client, 'SetScoreHudSubheader', "", '\tPLAYER\tSCORE\tFLAGS\tPLAYER\tSCORE\tFLAGS' ); else messageClient( %client, 'SetScoreHudSubheader', "", '\tPLAYER\tSCORE\tFLAGS' ); //find out who has the most flags %maxFlagsClient = -1; %maxFlags = -1; for (%i = 0; %i < %numClients; %i++) { %cl = $TeamRank[0, %i]; if (%cl.flagCount > %maxFlags) { %maxFlags = %cl.flagCount - 1; %maxFlagsClient = %cl; } } //if no one has any flags, don't hilite anyone... if (%maxFlags <= 0) %maxFlagsClient = -1; %countMax = %numClients; if ( %countMax > ( 2 * $ScoreHudMaxVisible ) ) { if ( %countMax & 1 ) %countMax++; %countMax = %countMax / 2; } else if ( %countMax > $ScoreHudMaxVisible ) %countMax = $ScoreHudMaxVisible; for (%index = 0; %index < %countMax; %index++) { //get the client info %col1Client = $TeamRank[0, %index]; %col1ClientScore = %col1Client.score $= "" ? 0 : %col1Client.score; %col1ClientFlags = %col1Client.flagCount - 1; if (%col1ClientFlags <= 0) %col1ClientFlags = ""; %col1Style = ""; if ( %col1Client == %maxFlagsClient ) %col1Style = ""; else if ( %col1Client == %client ) %col1Style = ""; //see if we have two columns if (%numColumns == 2) { %col2Client = ""; %col2ClientScore = ""; %col2ClientFlags = ""; %col2Style = ""; //get the column 2 client info %col2Index = %index + %countMax; if (%col2Index < %numClients) { %col2Client = $TeamRank[0, %col2Index]; %col2ClientScore = %col2Client.score $= "" ? 0 : %col2Client.score; %col2ClientFlags = %col2Client.flagCount - 1; if (%col2ClientFlags <= 0) %col2ClientFlags = ""; if ( %col2Client == %maxFlagsClient ) %col2Style = ""; else if ( %col2Client == %client ) %col2Style = ""; } } //if the client is not an observer, send the message if (%client.team != 0) { if ( %numColumns == 2 ) messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3%8%4%5%6', %col1Client.name, %col1ClientScore, %col1ClientFlags, %col2Client.name, %col2ClientScore, %col2ClientFlags, %col1Style, %col2Style ); else messageClient( %client, 'SetLineHud', "", %tag, %index, '%4\t%1%2%3', %col1Client.name, %col1ClientScore, %col1ClientFlags, %col1Style ); } //else for observers, create an anchor around the player name so they can be observed else { if ( %numColumns == 2 ) { //this is lame, but we can only have up to %9 args if ( %col2Client == %maxFlagsClient ) { messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3%4%5%6', %col1Client.name, %col1ClientScore, %col1ClientFlags, %col2Client.name, %col2ClientScore, %col2ClientFlags, %col1Style, %col1Client, %col2Client); } else if ( %col2Client == %client ) { messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3%4%5%6', %col1Client.name, %col1ClientScore, %col1ClientFlags, %col2Client.name, %col2ClientScore, %col2ClientFlags, %col1Style, %col1Client, %col2Client); } else { messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3%4%5%6', %col1Client.name, %col1ClientScore, %col1ClientFlags, %col2Client.name, %col2ClientScore, %col2ClientFlags, %col1Style, %col1Client, %col2Client); } } else messageClient( %client, 'SetLineHud', "", %tag, %index, '%4\t%1%2%3', %col1Client.name, %col1ClientScore, %col1ClientFlags, %col1Style, %col1Client ); } } // Tack on the list of observers: %observerCount = 0; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team == 0) %observerCount++; } if (%observerCount > 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, ""); %index++; messageClient(%client, 'SetLineHud', "", %tag, %index, '\tOBSERVERS (%1)TIME', %observerCount); %index++; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); //if this is an observer if (%cl.team == 0) { %obsTime = getSimTime() - %cl.observerStartTime; %obsTimeStr = %game.formatTime(%obsTime, false); messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%1%2', %cl.name, %obsTimeStr ); %index++; } } } //clear the rest of Hud so we don't get old lines hanging around... messageClient( %client, 'ClearHud', "", %tag, %index ); } function HuntersGame::sendDebriefing( %game, %client ) { // Mission result: if ( $TeamRank[0, 0].score > 0 ) messageClient( %client, 'MsgDebriefResult', "", '%1 wins with a score of %2!', $TeamRank[0, 0].name, $TeamRank[0, 0].score ); else messageClient( %client, 'MsgDebriefResult', "", 'Nobody wins!' ); if ( %game.highestFlagReturnName !$= "" ) messageClient( %client, 'MsgDebriefResult', "", '%1 had the highest return count with %2 flags!', %game.highestFlagReturnName, %game.highestFlagReturnCount ); if ( $Host::HuntersRecords::Count[$currentMission] !$= "" && $Host::HuntersRecords::Name[$currentMission] !$= "" ) messageClient( %client, 'MsgDebriefResult', "", '%1 holds the record with a return count of %2 flags!', $Host::HuntersRecords::Name[$currentMission], $Host::HuntersRecords::Count[$currentMission] ); if ( %game.greedFlagName !$= "" ) messageClient( %client, 'MsgDebriefResult', "", '%1 gets the honorary greed award for dropping %2 flags!', %game.greedFlagName, %game.greedFlagCount ); // Player scores: messageClient( %client, 'MsgDebriefAddLine', "", 'PLAYERSCOREKILLS' ); %count = $TeamRank[0, count]; for ( %i = 0; %i < %count; %i++ ) { %cl = $TeamRank[0, %i]; if ( %cl.score $= "" ) %score = 0; else %score = %cl.score; if ( %cl.kills $= "" ) %kills = 0; else %kills = %cl.kills; messageClient( %client, 'MsgDebriefAddLine', "", ' %1 %2 %3', %cl.name, %score, %kills ); } // Show observers: %count = ClientGroup.getCount(); %header = false; for ( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject( %i ); if ( %cl.team <= 0 ) { if ( !%header ) { messageClient( %client, 'MsgDebriefAddLine', "", '\nOBSERVERSSCORE' ); %header = true; } %score = %cl.score $= "" ? 0 : %cl.score; messageClient( %client, 'MsgDebriefAddLine', "", ' %1 %2', %cl.name, %score ); } } } function HuntersGame::applyConcussion(%game, %player) { //%game.dropFlag( %player ); } PK !(.**scripts/LaunchLanGui.cs//-------------------------------------------------------- function QueryServers( %searchCriteria ) { GMJ_Browser.lastQuery = %searchCriteria; LaunchGame( "JOIN" ); } //-------------------------------------------------------- function QueryOnlineServers() { QueryServers("Master"); } //-------------------------------------------------------- // Launch gui functions //-------------------------------------------------------- function PlayOffline() { $FirstLaunch = true; setNetPort(0); $PlayingOnline = false; Canvas.setContent(LaunchGui); } //-------------------------------------------------------- function OnlineLogIn() { $FirstLaunch = true; setNetPort(0); $PlayingOnline = true; FilterEditGameType.clear(); FilterEditMissionType.clear(); queryMasterGameTypes(); // Start the Email checking... EmailGui.checkSchedule = schedule( 5000, 0, CheckEmail, true ); // Load the player database... %guid = getField( WONGetAuthInfo(), 3 ); if ( %guid > 0 ) loadPlayerDatabase( "prefs/pyrdb" @ %guid ); Canvas.setContent(LaunchGui); } //-------------------------------------------------------- function LaunchToolbarMenu::onSelect(%this, %id, %text) { switch(%id) { case 0: LaunchGame(); case 1: // Start Training Mission LaunchTraining(); case 2: LaunchNews(); case 3: LaunchForums(); case 4: LaunchEmail(); case 5: // Join Chat Room Canvas.pushDialog(JoinChatDlg); case 6: LaunchBrowser(); case 7: // Options Canvas.pushDialog(OptionsDlg); case 8: // Play Recording Canvas.pushDialog(RecordingsDlg); case 9: // Quit if(isObject($IRCClient.tcp)) IRCClient::quit(); LaunchTabView.closeAllTabs(); if (!isDemo()) quit(); else Canvas.setContent(DemoEndGui); //case 10: // Log Off // LaunchTabView.closeAllTabs(); // PlayOffline(); //case 11: // Log On // LaunchTabView.closeAllTabs(); // OnlineLogIn(); case 12: LaunchCredits(); } } //-------------------------------------------------------- function LaunchToolbarDlg::onWake(%this) { // Play the shell hum: if ( $HudHandle[shellScreen] $= "" ) $HudHandle[shellScreen] = alxPlay( ShellScreenHumSound, 0, 0, 0 ); LaunchToolbarMenu.clear(); if ( isDemo() ) { LaunchToolbarMenu.add( 1, "TRAINING" ); LaunchToolbarMenu.add( 0, "GAME" ); LaunchToolbarMenu.add( 2, "NEWS" ); } else if ( $PlayingOnline ) { LaunchToolbarMenu.add( 0, "GAME" ); LaunchToolbarMenu.add( 4, "EMAIL" ); LaunchToolbarMenu.add( 5, "CHAT" ); LaunchToolbarMenu.add( 6, "BROWSER" ); } else { LaunchToolbarMenu.add( 1, "TRAINING" ); LaunchToolbarMenu.add( 0, "LAN GAME" ); } LaunchToolbarMenu.addSeparator(); LaunchToolbarMenu.add( 7, "SETTINGS" ); if ( !isDemo() ) LaunchToolbarMenu.add( 8, "RECORDINGS" ); LaunchToolbarMenu.add( 12, "CREDITS" ); LaunchToolbarMenu.addSeparator(); LaunchToolbarMenu.add( 9, "QUIT" ); %on = false; for ( %tab = 0; %tab < LaunchTabView.tabCount(); %tab++ ) { if ( LaunchTabView.isTabActive( %tab ) ) { %on = true; break; } } LaunchToolbarCloseButton.setVisible( %on ); } //---------------------------------------------------------------------------- // Launch Tab Group functions: //---------------------------------------------------------------------------- function OpenLaunchTabs( %gotoWarriorSetup ) { if ( LaunchTabView.tabCount() > 0 || !$FirstLaunch ) return; $FirstLaunch = ""; // Set up all of the launch bar tabs: if ( isDemo() ) { LaunchTabView.addLaunchTab( "TRAINING", TrainingGui ); LaunchTabView.addLaunchTab( "GAME", GameGui ); LaunchTabView.addLaunchTab( "NEWS", NewsGui ); LaunchTabView.addLaunchTab( "FORUMS", "", true ); LaunchTabView.addLaunchTab( "EMAIL", "", true ); LaunchTabView.addLaunchTab( "CHAT", "", true ); LaunchTabView.addLaunchTab( "BROWSER", "", true ); %launchGui = NewsGui; } else if ( $PlayingOnline ) { LaunchTabView.addLaunchTab( "GAME", GameGui ); LaunchTabView.addLaunchTab( "EMAIL", EmailGui ); LaunchTabView.addLaunchTab( "CHAT", ChatGui ); LaunchTabView.addLaunchTab( "BROWSER", TribeandWarriorBrowserGui); switch$ ( $pref::Shell::LaunchGui ) { case "News": %launchGui = NewsGui; case "Forums": %launchGui = ForumsGui; case "Email": %launchGui = EmailGui; case "Chat": %launchGui = ChatGui; case "Browser": %launchGui = TribeandWarriorBrowserGui; default: %launchGui = GameGui; } } else { LaunchTabView.addLaunchTab( "TRAINING", TrainingGui ); LaunchTabView.addLaunchTab( "LAN GAME", GameGui ); %launchGui = TrainingGui; } if ( %gotoWarriorSetup ) LaunchGame( "WARRIOR" ); else LaunchTabView.viewTab( "", %launchGui, 0 ); if ( $IssueVoodooWarning && !$pref::SawVoodooWarning ) { $pref::SawVoodooWarning = 1; schedule( 0, 0, MessageBoxOK, "WARNING", "A Voodoo card has been detected. If you experience any graphical oddities, you should try the WickedGl drivers available at www.wicked3d.com" ); } } //-------------------------------------------------------- function LaunchTabView::addLaunchTab( %this, %text, %gui, %makeInactive ) { %tabCount = %this.tabCount(); %this.gui[%tabCount] = %gui; %this.key[%tabCount] = 0; %this.addTab( %tabCount, %text ); if ( %makeInactive ) %this.setTabActive( %tabCount, false ); } //-------------------------------------------------------- function LaunchTabView::onSelect( %this, %id, %text ) { // Ignore the ID - it can't be trusted. %tab = %this.getSelectedTab(); if ( isObject( %this.gui[%tab] ) ) { Canvas.setContent( %this.gui[%tab] ); %this.gui[%tab].setKey( %this.key[%tab] ); %this.lastTab = %tab; } } //-------------------------------------------------------- function LaunchTabView::viewLastTab( %this ) { if ( %this.tabCount() == 0 || %this.lastTab $= "" ) return; %this.setSelectedByIndex( %this.lastTab ); } //-------------------------------------------------------- function LaunchTabView::viewTab( %this, %text, %gui, %key ) { %tabCount = %this.tabCount(); for ( %tab = 0; %tab < %tabCount; %tab++ ) if ( %this.gui[%tab] $= %gui && %this.key[%tab] $= %key ) break; if ( %tab == %tabCount ) { // Add a new tab: %this.gui[%tab] = %gui; %this.key[%tab] = %key; // WARNING! This id may not be unique and therefore should // not be relied on! Use index instead! %this.addTab( %tab, %text ); } if ( %this.getSelectedTab() != %tab ) %this.setSelectedByIndex( %tab ); } //-------------------------------------------------------- function LaunchTabView::closeCurrentTab( %this ) { %tab = %this.getSelectedTab(); %this.closeTab( %this.gui[%tab], %this.key[%tab] ); } //-------------------------------------------------------- function LaunchTabView::closeTab( %this, %gui, %key ) { %tabCount = %this.tabCount(); %activeCount = 0; for ( %i = 0; %i < %tabCount; %i++ ) { if ( %this.gui[%i] $= %gui && %this.key[%i] $= %key ) %tab = %i; else if ( %this.isTabActive( %i ) ) %activeCount++; } if ( %tab == %tabCount ) return; for( %i = %tab; %i < %tabCount; %i++ ) { %this.gui[%i] = %this.gui[%i+1]; %this.key[%i] = %this.key[%i+1]; } %this.removeTabByIndex( %tab ); %gui.onClose( %key ); if ( %activeCount == 0 ) { %this.lastTab = ""; Canvas.setContent( LaunchGui ); } } //-------------------------------------------------------- function LaunchTabView::closeAllTabs( %this ) { %tabCount = %this.tabCount(); for ( %i = 0; %i < %tabCount; %i++ ) { if ( isObject( %this.gui[%i] ) ) %this.gui[%i].onClose( %this.key[%i] ); %this.gui[%i] = ""; %this.key[%i] = ""; } %this.clear(); } //---------------------------------------------------------------------------- // LaunchGui functions: //---------------------------------------------------------------------------- function LaunchGui::onAdd(%this) { %this.getWarrior = true; } //---------------------------------------------------------------------------- function LaunchGui::onWake(%this) { $enableDirectInput = "0"; deactivateDirectInput(); Canvas.pushDialog(LaunchToolbarDlg); if ( !$FirstLaunch ) LaunchTabView.viewLastTab(); if ( !isDemo() ) checkNamesAndAliases(); else OpenLaunchTabs(); } //---------------------------------------------------------------------------- function LaunchGui::onSleep(%this) { //alxStop($HudHandle['shellScreen']); Canvas.popDialog( LaunchToolbarDlg ); } //---------------------------------------------------------------------------- function checkNamesAndAliases() { %gotoWarriorSetup = false; if ( $PlayingOnline ) { // When first launching, make sure we have a valid warrior: if ( LaunchGui.getWarrior ) { %cert = WONGetAuthInfo(); if ( %cert !$= "" ) { LaunchGui.getWarrior = ""; if ( %cert $= "" ) %warrior = $CreateAccountWarriorName; else %warrior = getField( %cert, 0 ); %warriorIdx = -1; for ( %i = 0; %i < $pref::Player::count; %i++ ) { if ( %warrior $= getField( $pref::Player[%i], 0 ) ) { %warriorIdx = %i; break; } } if ( %warriorIdx == -1 ) { // Create new warrior: $pref::Player[$pref::Player::Count] = %warrior @ "\tHuman Male\tbeagle\tMale1"; $pref::Player::Current = $pref::Player::Count; $pref::Player::Count++; %gotoWarriorSetup = true; } } else MessageBoxOK( "WARNING", "Failed to get account information. You may need to quit the game and log in again." ); } } else if ( $pref::Player::Count == 0 ) { %gotoWarriorSetup = true; } OpenLaunchTabs( %gotoWarriorSetup ); } PK !(wLLscripts/LobbyGui.cs//------------------------------------------------------------------------------ // // 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.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(); } PK !(W|=Y=Yscripts/OptionsDlg.cs//------------------------------------------------------------------------------ // // 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++; 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 ); } PK !(f2scripts/PantherXL.cs//-------------------------------------------------------------------------- // // PantherXL.cs // // These are the default control bindings for the Mad Catz Panther XL Pro // //-------------------------------------------------------------------------- moveMap.bind( joystick, xaxis, D, "-0.1 0.1", joystickMoveX ); moveMap.bind( joystick, yaxis, D, "-0.1 0.1", joystickMoveY ); moveMap.bind( joystick, rxaxis, I, joystickPitch ); moveMap.bind( joystick, ryaxis, joystickYaw ); moveMap.bind( joystick, button0, mouseFire ); moveMap.bind( joystick, button1, mouseJet ); moveMap.bindCmd( joystick, button2, "setFov(30);", "setFov($pref::player::defaultFOV);" ); moveMap.bind( joystick, button3, jump ); moveMap.bindCmd( joystick, upov, "use(Plasma);", "" ); moveMap.bindCmd( joystick, rpov, "use(Chaingun);", "" ); moveMap.bindCmd( joystick, dpov, "use(Disc);", "" ); moveMap.bindCmd( joystick, lpov, "use(GrenadeLauncher);", "" ); moveMap.bindCmd( joystick, button4, "use(SniperRifle);", "" ); // Second POV buttons... moveMap.bindCmd( joystick, button5, "use(ELFGun);", "" ); moveMap.bindCmd( joystick, button6, "use(Mortar);", "" ); moveMap.bindCmd( joystick, button7, "use(MissileLauncher);", "" ); moveMap.bindCmd( joystick, button8, "use(RepairKit);", "" ); moveMap.bind( joystick, button9, toggleFirstPerson ); moveMap.bindCmd( joystick, button10, "prevWeapon();", "" ); moveMap.bindCmd( joystick, button11, "use(Backpack);", "" ); moveMap.bindCmd( joystick, button12, "nextWeapon();", "" ); PK !(q" scripts/PathEdit.cs// // PathEdit.cs // function PathEdit::initInteriorEditor() { echo("interior editor startup..."); aiEdit.setPathMode(); new ActionMap(PathEditMap); PathEditMap.bindCmd(keyboard, g, "PathEdit::grabNode();", ""); PathEditMap.bindCmd(keyboard, f, "PathEdit::dropNode();", ""); PathEditMap.bindCmd(keyboard, u, "PathEdit::undoNodeGrab();", ""); PathEditMap.bindCmd(keyboard, t, "PathEdit::createEdge();", ""); PathEditMap.bindCmd(keyboard, r, "PathEdit::connectEdge();", ""); PathEditMap.bindCmd(keyboard, "alt r", "PathEdit::grabEdge();", ""); PathEditMap.bindCmd(keyboard, "alt t", "PathEdit::deleteEdge();", ""); PathEditMap.bindCmd(keyboard, "alt g", "PathEdit::deleteNode();", ""); PathEditMap.bindCmd(keyboard, "alt d", "PathEdit::beginEnd();", ""); PathEditMap.bindCmd(keyboard, "j", "PathEdit::setJet();", ""); PathEditMap.bindCmd(keyboard, "alt j", "PathEdit::setNotJet();", ""); PathEditMap.bindCmd(keyboard, "alt s", "PathEdit::saveGraph();", ""); PathEditMap.bindCmd(keyboard, "h", "PathEdit::createNode();", ""); PathEditMap.push(); } //------------------------------------------------------------------------------ function PathEdit::closeInteriorEdit() { aiEdit.setUninitMode(); PathEditMap.pop(); } //------------------------------------------------------------------------------ function PathEdit::grabNode() { aiEdit.grabNode(); } //------------------------------------------------- function PathEdit::createNode() { aiEdit.createNode(); } //------------------------------------------------- function PathEdit::grabEdge() { aiEdit.grabEdge(); } //------------------------------------------------- function PathEdit::dropNode() { aiEdit.placeNode(); } //------------------------------------------------- function PathEdit::undoNodeGrab() { aiEdit.putBackNode(); } //------------------------------------------------- function PathEdit::deleteNode() { aiEdit.deleteNode(); } //------------------------------------------------- function PathEdit::deleteEdge() { aiEdit.deleteEdge(); } //------------------------------------------------- function PathEdit::createEdge() { aiEdit.createEdge(); } //------------------------------------------------- function PathEdit::connectEdge() { aiEdit.connectEdge(); } //------------------------------------------------- function PathEdit::setJet() { aiEdit.setJetting(true); } //------------------------------------------------- function PathEdit::setNotJet() { aiEdit.setJetting(false); } //------------------------------------------------- PK !(pgththscripts/RabbitGame.cs//------------------------------------------------------------------- // Team Rabbit script // ------------------------------------------------------------------- //--- GAME RULES BEGIN --- //Grab the flag //Run like crazy //EVERYONE tries to kill the person with the flag (the Rabbit) //The longer the Rabbit keeps the flag, the more points he scores //--- GAME RULES END --- package RabbitGame { function Flag::objectiveInit(%data, %flag) { $flagStatus = ""; %flag.carrier = ""; %flag.originalPosition = %flag.getTransform(); %flag.isHome = true; // create a waypoint to the flag's starting place %flagWaypoint = new WayPoint() { position = %flag.position; rotation = "1 0 0 0"; name = "Flag Home"; dataBlock = "WayPointMarker"; team = $NonRabbitTeam; }; $AIRabbitFlag = %flag; MissionCleanup.add(%flagWaypoint); } }; //exec the AI scripts exec("scripts/aiRabbit.cs"); $InvBanList[Rabbit, "TurretOutdoorDeployable"] = 1; $InvBanList[Rabbit, "TurretIndoorDeployable"] = 1; $InvBanList[Rabbit, "ElfBarrelPack"] = 1; $InvBanList[Rabbit, "MortarBarrelPack"] = 1; $InvBanList[Rabbit, "PlasmaBarrelPack"] = 1; $InvBanList[Rabbit, "AABarrelPack"] = 1; $InvBanList[Rabbit, "MissileBarrelPack"] = 1; $InvBanList[Rabbit, "MissileLauncher"] = 1; $InvBanList[Rabbit, "Mortar"] = 1; $InvBanList[Rabbit, "Mine"] = 1; function RabbitGame::setUpTeams(%game) { // Force the numTeams variable to one: DefaultGame::setUpTeams(%game); %game.numTeams = 1; setSensorGroupCount(3); //team damage should always be off for Rabbit $teamDamage = 0; //make all the sensor groups visible at all times if (!Game.teamMode) { setSensorGroupAlwaysVisMask($NonRabbitTeam, 0xffffffff); setSensorGroupAlwaysVisMask($RabbitTeam, 0xffffffff); // non-rabbits can listen to the rabbit: all others can only listen to self setSensorGroupListenMask($NonRabbitTeam, (1 << $RabbitTeam) | (1 << $NonRabbitTeam)); } } function RabbitGame::initGameVars(%game) { %game.playerBonusValue = 1; %game.playerBonusTime = 3 * 1000; //3 seconds %game.teamBonusValue = 1; %game.teamBonusTime = 15 * 1000; //15 seconds %game.flagReturnTime = 45 * 1000; //45 seconds %game.waypointFrequency = 24000; %game.waypointDuration = 6000; } $RabbitTeam = 2; $NonRabbitTeam = 1; // ----- These functions supercede those in DefaultGame.cs function RabbitGame::allowsProtectedStatics(%game) { return true; } function RabbitGame::clientMissionDropReady(%game, %client) { messageClient(%client, 'MsgClientReady', "", %game.class); messageClient(%client, 'MsgYourScoreIs', "", 0); //messageClient(%client, 'MsgYourRankIs', "", -1); messageClient(%client, 'MsgRabbitFlagStatus', "", $flagStatus); messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); DefaultGame::clientMissionDropReady(%game,%client); } function RabbitGame::AIHasJoined(%game, %client) { //let everyone know the player has joined the game //messageAllExcept(%client, -1, 'MsgClientJoinTeam', '%1 has joined the hunt.', %client.name, "", %client, $NonRabbitTeam); } function RabbitGame::clientJoinTeam( %game, %client, %team, %respawn ) { %game.assignClientTeam( %client ); // Spawn the player: %game.spawnPlayer( %client, %respawn ); } function RabbitGame::assignClientTeam(%game, %client) { // all players start on team 1 %client.team = $NonRabbitTeam; // set player's skin pref here setTargetSkin(%client.target, %client.skin); // Let everybody know you are no longer an observer: messageAll( 'MsgClientJoinTeam', '\c1%1 has joined the hunt.', %client.name, "", %client, %client.team ); updateCanListenState( %client ); } function RabbitGame::playerSpawned(%game, %player) { //call the default stuff first... DefaultGame::playerSpawned(%game, %player); //find the rabbit %clRabbit = -1; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (isObject(%cl.player) && isObject(%cl.player.holdingFlag)) { %clRabbit = %cl; break; } } //now set a waypoint just for that client... cancel(%player.client.waypointSchedule); if (isObject(%clRabbit) && !%player.client.isAIControlled()) %player.client.waypointSchedule = %game.showRabbitWaypointClient(%clRabbit, %player.client); } function RabbitGame::pickPlayerSpawn(%game, %client, %respawn) { // all spawns come from team 1 return %game.pickTeamSpawn($NonRabbitTeam); } function RabbitGame::createPlayer(%game, %client, %spawnLoc, %respawn) { %client.team = $NonRabbitTeam; DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn); } function RabbitGame::recalcScore(%game, %client) { //score is grabs + kills + (totalTime / 15 seconds); %timeHoldingFlagMS = %client.flagTimeMS; if (isObject(%client.player.holdingFlag)) %timeHoldingFlagMS += getSimTime() - %client.startTime; %client.score = %client.flagGrabs + %client.kills + mFloor(%timeHoldingFlagMS / 15000); messageClient(%client, 'MsgYourScoreIs', "", %client.score); %game.recalcTeamRanks(%client); %game.checkScoreLimit(%client); } function RabbitGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %sourceObject) { //if the victim is the rabbit, and the attacker is not the rabbit, set the damage time... if (isObject(%clAttacker) && %clAttacker != %clVictim) { if (%clVictim.team == $RabbitTeam) %game.rabbitDamageTime = getSimTime(); } //call the default DefaultGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %sourceObject); } function RabbitGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc) { //see if the killer was the rabbit and the victim was someone else... if (isObject(%clKiller) && (%clKiller != %clVictim) && (%clKiller.team == $RabbitTeam)) { %clKiller.kills++; %game.recalcScore(%clKiller); } DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc); } function RabbitGame::playerDroppedFlag(%game, %player) { //set the flag status %flag = %player.holdingFlag; %player.holdingFlag = ""; %flag.carrier = ""; $flagStatus = ""; %player.unmountImage($FlagSlot); %flag.hide(false); //hide the rabbit waypoint cancel(%game.waypointSchedule); %game.hideRabbitWaypoint(%player.client); //set the client status %player.client.flagTimeMS += getSimTime() - %player.client.startTime; %player.client.team = $NonRabbitTeam; %player.client.setSensorGroup($NonRabbitTeam); setTargetSensorGroup(%player.getTarget(), $NonRabbitTeam); messageAllExcept(%player.client, -1, 'MsgRabbitFlagDropped', '\c2%1 dropped the flag!~wfx/misc/flag_drop.wav', %player.client.name); // if the player left the mission area, he's already been notified if(!%player.outArea) messageClient(%player.client, 'MsgRabbitFlagDropped', '\c2You dropped the flag!~wfx/misc/flag_drop.wav'); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") dropped flag"); %flag.returnThread = %game.schedule(%game.flagReturnTime, "returnFlag", %flag); } function RabbitGame::playerTouchFlag(%game, %player, %flag) { if ((%flag.carrier $= "") && (%player.getState() !$= "Dead")) { %player.client.startTime = getSimTime(); %player.holdingFlag = %flag; %flag.carrier = %player; %player.mountImage(FlagImage, $FlagSlot, true); //, $teamSkin[$RabbitTeam]); cancel(%flag.returnThread); %flag.hide(true); %flag.isHome = false; $flagStatus = %client.name; messageAll('MsgRabbitFlagTaken', '\c2%1 has taken the flag!~wfx/misc/flag_snatch.wav', %player.client.name); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") took flag"); %player.client.team = $RabbitTeam; %player.client.setSensorGroup($RabbitTeam); setTargetSensorGroup(%player.getTarget(), $RabbitTeam); //increase the score %player.client.flagGrabs++; %game.recalcScore(%player.client); %game.schedule(5000, "RabbitFlagCheck", %player); //show the rabbit waypoint %game.rabbitDamageTime = 0; cancel(%game.waypointSchedule); %game.showRabbitWaypoint(%player.client); } } function RabbitGame::rabbitFlagCheck(%game, %player) { // this function calculates the score for the rabbit. It must be done periodically // since the rabbit's score is based on how long the flag has been in possession. if((%player.holdingFlag != 0) && (%player.getState() !$= "Dead")) { %game.recalcScore(%player.client); //reschedule this flagcheck for 5 seconds %game.schedule(5000, "RabbitFlagCheck", %player); } } function RabbitGame::returnFlag(%game, %flag) { messageAll('MsgRabbitFlagReturned', '\c2The flag was returned to its starting point.~wfx/misc/flag_return.wav'); logEcho("flag return (timeout)"); %game.resetFlag(%flag); } function RabbitGame::resetFlag(%game, %flag) { %flag.setVelocity("0 0 0"); %flag.setTransform(%flag.originalPosition); %flag.isHome = true; %flag.carrier = ""; $flagStatus = ""; %flag.hide(false); } // ----- These functions are native to Rabbit function RabbitGame::timeLimitReached(%game) { logEcho("game over (timelimit)"); %game.gameOver(); cycleMissions(); } function RabbitGame::scoreLimitReached(%game) { logEcho("game over (scorelimit)"); %game.gameOver(); cycleMissions(); } function RabbitGame::checkScoreLimit(%game, %client) { %scoreLimit = MissionGroup.Rabbit_scoreLimit; // default of 1200 if scoreLimit not defined (that's 1200 seconds worth - 20 minutes) if(%scoreLimit $= "") %scoreLimit = 1200; if(%client.score >= %scoreLimit) %game.scoreLimitReached(); } function RabbitGame::gameOver(%game) { //call the default DefaultGame::gameOver(%game); //send the message messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); cancel(%game.rabbitWaypointThread); messageAll('MsgClearObjHud', ""); for(%i = 0; %i < ClientGroup.getCount(); %i++) { %client = ClientGroup.getObject(%i); %game.resetScore(%client); cancel(%client.waypointSchedule); } cancel(%game.waypointSchedule); } function RabbitGame::resetScore(%game, %client) { %client.score = 0; %client.kills = 0; %client.deaths = 0; %client.suicides = 0; %client.flagGrabs = 0; %client.flagTimeMS = 0; } function RabbitGame::enterMissionArea(%game, %playerData, %player) { %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"); cancel(%player.alertThread); } function RabbitGame::leaveMissionArea(%game, %playerData, %player) { if(%player.getState() $= "Dead") return; %player.client.outOfBounds = true; if (%player.client.team == $RabbitTeam) messageClient(%player.client, 'LeaveMissionArea', '\c1You have left the mission area. Return or take damage.~wfx/misc/warning_beep.wav'); else messageClient(%player.client, 'LeaveMissionArea', '\c1You have left the mission area.~wfx/misc/warning_beep.wav'); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") left mission area"); %player.alertThread = %game.schedule(1000, "AlertPlayer", 3, %player); } function RabbitGame::AlertPlayer(%game, %count, %player) { if (%player.client.team == $RabbitTeam) { if(%count > 1) %player.alertThread = %game.schedule(1000, "AlertPlayer", %count - 1, %player); else %player.alertThread = %game.schedule(1000, "MissionAreaDamage", %player); } //keep the thread going for non rabbits, but give the new rabbit time to return to the mission area... else %player.alertThread = %game.schedule(1000, "AlertPlayer", 3, %player); } function RabbitGame::MissionAreaDamage(%game, %player) { if(%player.getState() !$= "Dead") { %player.setDamageFlash(0.1); %damageRate = 0.05; %pack = %player.getMountedImage($BackpackSlot); if(%pack.getName() $= "RepairPackImage") if(%player.getMountedImage($WeaponSlot).getName() $= "RepairGunImage") %damageRate = 0.15; %prevHurt = %player.getDamageLevel(); %player.setDamageLevel(%prevHurt + %damageRate); // a little redundancy to see if the lastest damage killed the player if(%player.getState() $= "Dead") %game.onClientKilled(%player.client, 0, $DamageType::OutOfBounds); else %player.alertThread = %game.schedule(1000, "MissionAreaDamage", %player); } else { %game.onClientKilled(%player.client, 0, $DamageType::OutOfBounds); } } function RabbitGame::dropFlag(%game, %player) { //you can no longer throw the flag in Rabbit... } function RabbitGame::updateScoreHud(%game, %client, %tag) { //tricky stuff here... use two columns if we have more than 15 clients... %numClients = $TeamRank[0, count]; if ( %numClients > $ScoreHudMaxVisible ) %numColumns = 2; // Clear the header: messageClient( %client, 'SetScoreHudHeader', "", "" ); // Send subheader: if (%numColumns == 2) messageClient(%client, 'SetScoreHudSubheader', "", '\tPLAYER\tSCORE\tTIME\tPLAYER\tSCORE\tTIME'); else messageClient(%client, 'SetScoreHudSubheader', "", '\tPLAYER\tSCORE\tTIME'); //recalc the score for whoever is holding the flag if (isObject($AIRabbitFlag.carrier)) %game.recalcScore($AIRabbitFlag.carrier.client); %countMax = %numClients; if ( %countMax > ( 2 * $ScoreHudMaxVisible ) ) { if ( %countMax & 1 ) %countMax++; %countMax = %countMax / 2; } else if ( %countMax > $ScoreHudMaxVisible ) %countMax = $ScoreHudMaxVisible; for (%index = 0; %index < %countMax; %index++) { //get the client info %col1Client = $TeamRank[0, %index]; %col1ClientScore = %col1Client.score $= "" ? 0 : %col1Client.score; %col1Style = ""; if (isObject(%col1Client.player.holdingFlag)) { %col1ClientTimeMS = %col1Client.flagTimeMS + getSimTime() - %col1Client.startTime; %col1Style = ""; } else { %col1ClientTimeMS = %col1Client.flagTimeMS; if ( %col1Client == %client ) %col1Style = ""; } if (%col1ClientTimeMS <= 0) %col1ClientTime = ""; else { %minutes = mFloor(%col1ClientTimeMS / (60 * 1000)); if (%minutes <= 0) %minutes = "0"; %seconds = mFloor(%col1ClientTimeMS / 1000) % 60; if (%seconds < 10) %seconds = "0" @ %seconds; %col1ClientTime = %minutes @ ":" @ %seconds; } //see if we have two columns if (%numColumns == 2) { %col2Client = ""; %col2ClientScore = ""; %col2ClientTime = ""; %col2Style = ""; //get the column 2 client info %col2Index = %index + %countMax; if (%col2Index < %numClients) { %col2Client = $TeamRank[0, %col2Index]; %col2ClientScore = %col2Client.score $= "" ? 0 : %col2Client.score; if (isObject(%col2Client.player.holdingFlag)) { %col2ClientTimeMS = %col2Client.flagTimeMS + getSimTime() - %col2Client.startTime; %col2Style = ""; } else { %col2ClientTimeMS = %col2Client.flagTimeMS; if ( %col2Client == %client ) %col2Style = ""; } if (%col2ClientTimeMS <= 0) %col2ClientTime = ""; else { %minutes = mFloor(%col2ClientTimeMS / (60 * 1000)); if (%minutes <= 0) %minutes = "0"; %seconds = mFloor(%col2ClientTimeMS / 1000) % 60; if (%seconds < 10) %seconds = "0" @ %seconds; %col2ClientTime = %minutes @ ":" @ %seconds; } } } //if the client is not an observer, send the message if (%client.team != 0) { if ( %numColumns == 2 ) messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3%8%4%5%6', %col1Client.name, %col1ClientScore, %col1ClientTime, %col2Client.name, %col2ClientScore, %col2ClientTime, %col1Style, %col2Style ); else messageClient( %client, 'SetLineHud', "", %tag, %index, '%4\t%1%2%3', %col1Client.name, %col1ClientScore, %col1ClientTime, %col1Style ); } //else for observers, create an anchor around the player name so they can be observed else { if ( %numColumns == 2 ) { //this is really crappy, but I need to save 1 tag - can only pass in up to %9, %10 doesn't work... if (%col2Style $= "") { messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3%4%5%6', %col1Client.name, %col1ClientScore, %col1ClientTime, %col2Client.name, %col2ClientScore, %col2ClientTime, %col1Style, %col1Client, %col2Client ); } else if (%col2Style $= "") { messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3%4%5%6', %col1Client.name, %col1ClientScore, %col1ClientTime, %col2Client.name, %col2ClientScore, %col2ClientTime, %col1Style, %col1Client, %col2Client ); } else { messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3%4%5%6', %col1Client.name, %col1ClientScore, %col1ClientTime, %col2Client.name, %col2ClientScore, %col2ClientTime, %col1Style, %col1Client, %col2Client ); } } else messageClient( %client, 'SetLineHud', "", %tag, %index, '%4\t%1%2%3', %col1Client.name, %col1ClientScore, %col1ClientTime, %col1Style, %col1Client ); } } // Tack on the list of observers: %observerCount = 0; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team == 0) %observerCount++; } if (%observerCount > 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, ""); %index++; messageClient(%client, 'SetLineHud', "", %tag, %index, '\tOBSERVERS (%1)TIME', %observerCount); %index++; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); //if this is an observer if (%cl.team == 0) { %obsTime = getSimTime() - %cl.observerStartTime; %obsTimeStr = %game.formatTime(%obsTime, false); messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%1%2', %cl.name, %obsTimeStr ); %index++; } } } //clear the rest of Hud so we don't get old lines hanging around... messageClient( %client, 'ClearHud', "", %tag, %index ); } function RabbitGame::showRabbitWaypointClient(%game, %clRabbit, %client) { //make sure we have a rabbit if (!isObject(%clRabbit) || !isObject(%clRabbit.player) || !isObject(%clRabbit.player.holdingFlag)) return; //no waypoints for bots if (%client.isAIControlled()) return; //scope the client, then set the always vis mask... %clRabbit.player.scopeToClient(%client); %visMask = getSensorGroupAlwaysVisMask(%clRabbit.getSensorGroup()); %visMask |= (1 << %client.getSensorGroup()); setSensorGroupAlwaysVisMask(%clRabbit.getSensorGroup(), %visMask); //now issue a command to kill the target %client.setTargetId(%clRabbit.target); commandToClient(%client, 'TaskInfo', %client, -1, false, "Kill the Rabbit!"); %client.sendTargetTo(%client, true); //send the "waypoint is here sound" messageClient(%client, 'MsgRabbitWaypoint', '~wfx/misc/target_waypoint.wav'); //and hide the waypoint %client.waypointSchedule = %game.schedule(%game.waypointDuration, "hideRabbitWaypointClient", %clRabbit, %client); } function RabbitGame::hideRabbitWaypointClient(%game, %clRabbit, %client) { //no waypoints for bots if (%client.isAIControlled()) return; //unset the always vis mask... %visMask = getSensorGroupAlwaysVisMask(%clRabbit.getSensorGroup()); %visMask &= ~(1 << %client.getSensorGroup()); setSensorGroupAlwaysVisMask(%clRabbit.getSensorGroup(), %visMask); //kill the actually task... removeClientTargetType(%client, "AssignedTask"); } function RabbitGame::showRabbitWaypoint(%game, %clRabbit) { //make sure we have a rabbit if (!isObject(%clRabbit) || !isObject(%clRabbit.player) || !isObject(%clRabbit.player.holdingFlag)) return; //only show the rabbit waypoint if the rabbit hasn't been damaged within the frequency period if (getSimTime() - %game.rabbitDamageTime < %game.waypointFrequency) { %game.waypointSchedule = %game.schedule(%game.waypointFrequency, "showRabbitWaypoint", %clRabbit); return; } //loop through all the clients and flash a waypoint at the rabbits position for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.isAIControlled() || %cl == %clRabbit) continue; //scope the client, then set the always vis mask... %clRabbit.player.scopeToClient(%cl); %visMask = getSensorGroupAlwaysVisMask(%clRabbit.getSensorGroup()); %visMask |= (1 << %cl.getSensorGroup()); setSensorGroupAlwaysVisMask(%clRabbit.getSensorGroup(), %visMask); //now issue a command to kill the target %cl.setTargetId(%clRabbit.target); commandToClient(%cl, 'TaskInfo', %cl, -1, false, "Kill the Rabbit!"); %cl.sendTargetTo(%cl, true); //send the "waypoint is here sound" messageClient(%cl, 'MsgRabbitWaypoint', '~wfx/misc/target_waypoint.wav'); } //schedule the time to hide the waypoint %game.waypointSchedule = %game.schedule(%game.waypointDuration, "hideRabbitWaypoint", %clRabbit); } function RabbitGame::hideRabbitWaypoint(%game, %clRabbit) { //make sure we have a valid client if (!isObject(%clRabbit)) return; //loop through all the clients and hide the waypoint for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.isAIControlled()) continue; //unset the always vis mask... %visMask = getSensorGroupAlwaysVisMask(%clRabbit.getSensorGroup()); %visMask &= ~(1 << %cl.getSensorGroup()); setSensorGroupAlwaysVisMask(%clRabbit.getSensorGroup(), %visMask); //kill the actually task... removeClientTargetType(%cl, "AssignedTask"); } //make sure we have a rabbit before scheduling the next showRabbitWaypoint... if (isObject(%clRabbit.player) && isObject(%clRabbit.player.holdingFlag)) %game.waypointSchedule = %game.schedule(%game.waypointFrequency, "showRabbitWaypoint", %clRabbit); } function RabbitGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { 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 { %game.awardScoreKill(%clKiller); %game.awardScoreDeath(%clVictim); } 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 RabbitGame::applyConcussion(%game, %player) { // MES -- this won't do anything, the function RabbitGame::dropFlag is empty %game.dropFlag( %player ); } PK !(UMscripts/SiegeGame.cs//--- GAME RULES BEGIN --- //One team defends base, other team tries to conquer it as quickly as possible //Game has two rounds: Round 1 ends when base is conquered or time runs out //Round 2: Teams switch sides, play again -- to win, attackers MUST beat the time set by the attackers in Round 1 //Touching base switch conquers base //--- GAME RULES END --- //Siege type script for TRIBES 2 // //The two teams each take a turn at defense and offense. // //If initial defending team's objective is captured, then roles switch //and new offense team gets same amount of time to attempt to capture the //objective. // //If time runs out before initial defending team's objective is captured, //then roles switch and new offense team has to try to capture the //objective before time runs out. // //The winner is either the team who captures the objective in least amount of time. // // In the mission file, Team 1 will be offense team, and team 2 will be the defense team. // When the game actually starts, either team could start on offense, and the objects must // have their team designation set accordingly. // // This mission type doesn't have a scoreLimit because, well, it really doesn't // need one or lend itself to one. // ai support exec("scripts/aiSiege.cs"); package SiegeGame { function FlipFlop::objectiveInit(%data, %flipflop) { Game.regObjective(%flipflop); setTargetSkin(%flipflop.getTarget(), $teamSkin[0]); } function SiegeGame::regObjective(%game, %object) { %objSet = nameToID("MissionCleanup/Objectives"); if(!isObject(%objSet)) { %objSet = new SimSet("Objectives"); MissionCleanup.add(%objSet); } %objSet.add(%object); } function FlipFlop::playerTouch(%data, %flipflop, %player) { if(%player.team != Game.offenseTeam) return; %defTeam = Game.offenseTeam == 1 ? 2 : 1; Game.capPlayer[Game.offenseTeam] = stripChars( getTaggedString( %player.client.name ), "\cp\co\c6\c7\c8\c9" ); // Let the observers know: messageTeam( 0, 'MsgSiegeTouchFlipFlop', '\c2%1 captured the %2 base!~wfx/misc/flipflop_taken.wav', %player.client.name, $TeamName[%defTeam] ); // Let the teammates know: messageTeam( %player.team, 'MsgSiegeTouchFlipFlop', '\c2%1 captured the %2 base!~wfx/misc/flipflop_taken.wav', %player.client.name, $TeamName[%defTeam] ); // Let the other team know: %losers = %player.team == 1 ? 2 : 1; messageTeam( %losers, 'MsgSiegeTouchFlipFlop', '\c2%1 captured the %2 base!~wfx/misc/flipflop_lost.wav', %player.client.name, $TeamName[%defTeam]); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") captured team "@%defTeam@" base"); Game.allObjectivesCompleted(); } //-------------------------------------------------------------------------------- function StaticShapeData::onDisabled(%data, %obj, %prevState) { Parent::onDisabled(%data, %obj, %prevState); if(%obj.waypoint) game.switchWaypoint(%obj.waypoint); } //-------------------------------------------------------------------------------- function StaticShapeData::onEnabled(%data, %obj, %prevState) { if(%obj.waypoint) game.switchWaypoint(%obj.waypoint); if(%obj.isPowered()) %data.onGainPowerEnabled(%obj); Parent::onEnabled(%data, %obj, %prevState); } }; //--------- Siege SCORING INIT ------------------ function SiegeGame::initGameVars(%game) { %game.SCORE_PER_SUICIDE = 0; %game.SCORE_PER_TEAMKILL = 0; %game.SCORE_PER_DEATH = 0; %game.SCORE_PER_KILL = 0; %game.SCORE_PER_TURRET_KILL = 0; } function SiegeGame::claimFlipflopResources(%game, %flipflop, %team) { // equipment shouldn't switch teams when flipflop is touched } function SiegeGame::missionLoadDone(%game) { if( $Host::timeLimit == 0 ) $Host::timeLimit = 999; //default version sets up teams - must be called first... DefaultGame::missionLoadDone(%game); //clear the scores $teamScore[1] = 0; $teamScore[2] = 0; //decide which team is starting first if (getRandom() > 0.5) { %game.offenseTeam = 1; %defenseTeam = 2; } else { %game.offenseTeam = 2; %defenseTeam = 1; } //send the message messageAll('MsgSiegeStart', '\c2Team %1 is starting on offense', $teamName[%game.offenseTeam]); //if the first offense team is team2, switch the object team designation if (%game.offenseTeam == 2) { %group = nameToID("MissionGroup/Teams"); %group.swapTeams(); // search for vehicle pads also %mcg = nameToID("MissionCleanup"); %mcg.swapVehiclePads(); } //also ensure the objectives are all on the defending team %objSet = nameToId("MissionCleanup/Objectives"); for(%j = 0; %j < %objSet.getCount(); %j++) { %obj = %objSet.getObject(%j); %obj.team = %defenseTeam; setTargetSensorGroup(%obj.getTarget(), %defenseTeam); } //indicate we're starting the game from the beginning... %game.firstHalf = true; %game.timeLimitMS = $Host::TimeLimit * 60 * 1000; %game.secondHalfCountDown = false; %game.capPlayer[1] = ""; %game.capPlayer[2] = ""; // save off turret bases' original barrels %game.checkTurretBases(); // add objective waypoints %game.findObjectiveWaypoints(); MissionGroup.setupPositionMarkers(true); } function SiegeGame::checkTurretBases(%game) { %mGroup = nameToID("MissionGroup/Teams"); %mGroup.findTurretBase(); } function SimGroup::findTurretBase(%this) { for (%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).findTurretBase(); } function InteriorInstance::findTurretBase(%this) { // sorry, we're not looking for interiors } function AIObjective::findTurretBase(%this) { // prevent console error spam } function TSStatic::findTurretBase(%this) { // prevent console error spam } function GameBase::findTurretBase(%this) { // apparently, the initialBarrel attribute gets overwritten whenever the // barrel gets replaced. :( So we have to save it again under "originalBarrel". if(%this.getDatablock().getName() $= "TurretBaseLarge") %this.originalBarrel = %this.initialBarrel; } function TSStatic::findTurretBase(%this) { // prevent console error spam } function SiegeGame::selectSpawnSphere(%game, %team) { //for siege, the team1 drops are offense, team2 drops are defense %sphereTeam = %game.offenseTeam == %team ? 1 : 2; return DefaultGame::selectSpawnSphere(%game, %sphereTeam); } function SiegeGame::startMatch(%game) { DefaultGame::startMatch( %game ); %game.startTimeMS = getSimTime(); // schedule first timeLimit check for 20 seconds %game.timeSync = %game.schedule( 20000, "checkTimeLimit"); %game.timeThread = %game.schedule( %game.timeLimitMS, "timeLimitReached"); //updateClientTimes(%game.timeLimitMS); messageAll('MsgSystemClock', "", $Host::TimeLimit, %game.timeLimitMS); // %count = ClientGroup.getCount(); // for ( %i = 0; %i < %count; %i++ ) // { // %cl = ClientGroup.getObject( %i ); // if ( %cl.team == %game.offenseTeam ) // centerPrint( %cl, "\nTouch the enemy control switch to capture their base!", 5, 3 ); // else // centerPrint( %cl, "\nPrevent the enemy from touching your control switch!", 5, 3 ); // } //make sure the AI is started AISystemEnabled(true); } function SiegeGame::allObjectivesCompleted(%game) { Cancel( %game.timeSync ); Cancel( %game.timeThread ); cancelEndCountdown(); //store the elapsed time in the teamScore array... $teamScore[%game.offenseTeam] = getSimTime() - %game.startTimeMS; messageAll('MsgSiegeCaptured', '\c2Team %1 captured the base in %2!', $teamName[%game.offenseTeam], %game.formatTime($teamScore[%game.offenseTeam], true)); //set the new timelimit %game.timeLimitMS = $teamScore[%game.offenseTeam]; if (%game.firstHalf) { // it's halftime, let everyone know messageAll( 'MsgSiegeHalftime' ); } else { // game is over messageAll('MsgSiegeMisDone', '\c2Mission complete.'); } logEcho("objective completed in "@%game.timeLimitMS); //setup the second half... // MES -- per MarkF, scheduling for 0 seconds will prevent player deletion-related crashes %game.schedule(0, halftime, 'objectives'); } function SiegeGame::timeLimitReached(%game) { cancel( %game.timeThread ); cancel( %game.timeSync ); // if time has run out, the offense team gets no score (note, %game.timeLimitMS doesn't change) $teamScore[%game.offenseTeam] = 0; messageAll('MsgSiegeFailed', '\c2Team %1 failed to capture the base.', $teamName[%game.offenseTeam]); if (%game.firstHalf) { // it's halftime, let everyone know messageAll( 'MsgSiegeHalftime' ); } else { // game is over messageAll('MsgSiegeMisDone', '\c2Mission complete.'); } logEcho("time limit reached"); %game.halftime('time'); } function SiegeGame::checkTimeLimit(%game) { //if we're counting down to the beginning of the second half, check back in if (%game.secondHalfCountDown) { %game.timeSync = %game.schedule(1000, "checkTimeLimit"); return; } %timeElapsedMS = getSimTime() - %game.startTimeMS; %curTimeLeftMS = %game.timeLimitMS - %timeElapsedMS; if (%curTimeLeftMS <= 0) { // time's up, put down your pencils %game.timeLimitReached(); } else { if(%curTimeLeftMS >= 20000) %game.timeSync = %game.schedule( 20000, "checkTimeLimit" ); else %game.timeSync = %game.schedule( %curTimeLeftMS + 1, "checkTimeLimit" ); //now synchronize everyone's clock messageAll('MsgSystemClock', "", $Host::TimeLimit, %curTimeLeftMS); } } function SiegeGame::startSecondHalf(%game) { $MatchStarted = true; %game.secondHalfCountDown = false; MessageAll('MsgMissionStart', "\c2Match started"); // set the start time. //the new %game.timeLimitMS would have been set by timeLimitReached() or allObjectivesCompleted() %game.startTimeMS = getSimTime(); %game.timeThread = %game.schedule(%game.timeLimitMS, "timeLimitReached"); if (%game.timeLimitMS > 20000) %game.timeSync = %game.schedule(20000, "checkTimeLimit"); else %game.timeSync = %game.schedule(%game.timeLimitMS, "checkTimeLimit"); logEcho("start second half"); EndCountdown(%game.timeLimitMS); // set all clients control to their player %count = ClientGroup.getCount(); for( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject(%i); if (!isObject(%cl.player)) commandToClient(%cl, 'setHudMode', 'Observer'); else { %cl.observerMode = ""; %cl.setControlObject( %cl.player ); commandToClient(%cl, 'setHudMode', 'Standard'); // if ( %client.team == %game.offenseTeam ) // centerPrint( %cl, "\nTouch the enemy control switch to capture their base!", 5, 3 ); // else // centerPrint( %cl, "\nPrevent the enemy from touching your control switch!", 5, 3 ); } } //now synchronize everyone's clock updateClientTimes(%game.timeLimitMS); //start the bots up again... AISystemEnabled(true); } function SiegeGame::halftime(%game, %reason) { //stop the game and the bots $MatchStarted = false; AISystemEnabled(false); if (%game.firstHalf) { //switch the game variables %game.firstHalf = false; %oldOffenseTeam = %game.offenseTeam; if (%game.offenseTeam == 1) %game.offenseTeam = 2; else %game.offenseTeam = 1; //send the message messageAll('MsgSiegeRolesSwitched', '\c2Team %1 is now on offense.', $teamName[%game.offenseTeam], %game.offenseTeam); //reset stations and vehicles that players were using %game.resetPlayers(); // zero out the counts for deployable items (found in defaultGame.cs) %game.clearDeployableMaxes(); // clean up the MissionCleanup group - note, this includes deleting all the player objects %clean = nameToID("MissionCleanup"); %clean.housekeeping(); // Non static objects placed in original position resetNonStaticObjPositions(); // switch the teams for objects belonging to the teams %group = nameToID("MissionGroup/Teams"); %group.swapTeams(); // search for vehicle pads also %mcg = nameToID("MissionCleanup"); %mcg.swapVehiclePads(); //restore the objects %game.restoreObjects(); %count = ClientGroup.getCount(); for(%cl = 0; %cl < %count; %cl++) { %client = ClientGroup.getObject(%cl); if( !%client.isAIControlled() ) { // Put everybody in observer mode: %client.camera.getDataBlock().setMode( %client.camera, "observerStaticNoNext" ); %client.setControlObject( %client.camera ); // Send the halftime result info: if ( %client.team == %oldOffenseTeam ) { if ( $teamScore[%oldOffenseTeam] > 0 ) messageClient( %client, 'MsgSiegeResult', "", '%1 captured the %2 base in %3!', %game.capPlayer[%oldOffenseTeam], $teamName[%game.offenseTeam], %game.formatTime( $teamScore[%oldOffenseTeam], true ) ); else messageClient( %client, 'MsgSiegeResult', "", 'Your team failed to capture the %1 base.', $teamName[%game.offenseTeam] ); } else if ( $teamScore[%oldOffenseTeam] > 0 ) messageClient( %client, 'MsgSiegeResult', "", '%1 captured your base in %3!', %game.capPlayer[%oldOffenseTeam], %game.formatTime( $teamScore[%oldOffenseTeam], true ) ); else messageClient( %client, 'MsgSiegeResult', "", 'Your team successfully held off team %1!', $teamName[%oldOffenseTeam] ); // List out the team rosters: messageClient( %client, 'MsgSiegeAddLine', "", '%1%2', $TeamName[1], $TeamName[2] ); %max = $TeamRank[1, count] > $TeamRank[2, count] ? $TeamRank[1, count] : $TeamRank[2, count]; for ( %line = 0; %line < %max; %line++ ) { %plyr1 = $TeamRank[1, %line] $= "" ? "" : $TeamRank[1, %line].name; %plyr2 = $TeamRank[2, %line] $= "" ? "" : $TeamRank[2, %line].name; messageClient( %client, 'MsgSiegeAddLine', "", ' %1 %2', %plyr1, %plyr2 ); } // Show observers: %header = false; for ( %i = 0; %i < %count; %i++ ) { %obs = ClientGroup.getObject( %i ); if ( %obs.team <= 0 ) { if ( !%header ) { messageClient( %client, 'MsgSiegeAddLine', "", '\nOBSERVERS' ); %header = true; } messageClient( %client, 'MsgSiegeAddLine', "", ' %1', %obs.name ); } } commandToClient( %client, 'SetHalftimeClock', $Host::Siege::Halftime / 60000 ); // Get the HUDs right: commandToClient( %client, 'setHudMode', 'SiegeHalftime' ); commandToClient( %client, 'ControlObjectReset' ); clientResetTargets(%client, true); %client.notReady = true; } } %game.schedule( $Host::Siege::Halftime, halftimeOver ); } else { // let's wrap it all up %game.gameOver(); cycleMissions(); } } function SiegeGame::halftimeOver( %game ) { // drop all players into mission %game.dropPlayers(); //setup the AI for the second half %game.aiHalfTime(); // start the mission again (release players) %game.halfTimeCountDown( $Host::warmupTime ); //redo the objective waypoints %game.findObjectiveWaypoints(); } function SiegeGame::dropPlayers( %game ) { %count = ClientGroup.getCount(); for(%cl = 0; %cl < %count; %cl++) { %client = ClientGroup.getObject(%cl); if( !%client.isAIControlled() ) { // keep observers in observer mode if(%client.team == 0) %client.camera.getDataBlock().setMode(%client.camera, "justJoined"); else { %game.spawnPlayer( %client, false ); %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); %client.setControlObject( %client.camera ); %client.notReady = false; } } } } function SiegeGame::resetPlayers(%game) { // go through the client group and reset anything the players were using // is most of this stuff really necessary? %count = ClientGroup.getCount(); for(%cl = 0; %cl < %count; %cl++) { %client = ClientGroup.getObject(%cl); %player = %client.player; // clear the pack icon messageClient(%client, 'msgPackIconOff', ""); // if player was firing, stop firing if(%player.getImageTrigger($WeaponSlot)) %player.setImageTrigger($WeaponSlot, false); // if player had pack activated, deactivate it if(%player.getImageTrigger($BackpackSlot)) %player.setImageTrigger($BackpackSlot, false); // if player was in a vehicle, get rid of vehicle hud commandToClient(%client, 'setHudMode', 'Standard', "", 0); // clear player's weapons and inventory huds %client.SetWeaponsHudClearAll(); %client.SetInventoryHudClearAll(); // if player was at a station, deactivate it if(%player.station) { %player.station.triggeredBy = ""; %player.station.getDataBlock().stationTriggered(%player.station, 0); if(%player.armorSwitchSchedule) cancel(%player.armorSwitchSchedule); } // if piloting a vehicle, reset it (assuming it doesn't get deleted) if(%player.lastVehicle.lastPilot) %player.lastVehicle.lastPilot = ""; } } function SimGroup::housekeeping(%this) { // delete selectively in the MissionCleanup group %count = %this.getCount(); // have to do this backwards or only half the objects will be deleted for(%i = (%count - 1); %i > -1; %i--) { %detritus = %this.getObject(%i); if(%detritus.getClassName() $= "SimSet") { // I don't think there are any simsets we want to delete } else if(%detritus.getName() $= "PZones") { // simgroup of physical zones for force fields // don't delete them } //else if (%detritus.getClassName() $= "ScriptObject") //{ // // this will be the game type object. // // DEFINITELY don't want to delete this. //} else if(%detritus.getName() $= PosMarker) { //Needed to reset non static objects... } else if((%detritus.getName() $= "TeamDrops1") || (%detritus.getName() $= "TeamDrops2")) { // this will actually be a SimSet named TeamDropsN (1 or 2) // don't want to delete the spawn sphere groups, so do nothing } else if (%detritus.getName() $= "PlayerListGroup") { // we don't want to delete PlayerListGroup (SimGroup) } else if (%detritus.getDatablock().getName() $= "stationTrigger") { //we don't want to delete triggers for stations } else if (%detritus.getDatablock().getName() $= "StationVehicle") { // vehicle stations automatically get placed in MissionCleanup in a // position near the vehicle pad. Don't delete it. } else if (%detritus.getClassName() $= "Camera") { // Cameras should NOT be deleted } else { // this group of stuff to be deleted should include: // mines, deployed objects, projectiles, explosions, corpses, // players, and the like. %detritus.delete(); } } } function SiegeGame::groupSwapTeams(%game, %this) { for(%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).swapTeams(); } function SiegeGame::objectSwapTeams(%game, %this) { %defTeam = %game.offenseTeam == 1 ? 2 : 1; if(%this.getDatablock().getName() $= "Flipflop") { if(getTargetSensorGroup(%this.getTarget()) != %defTeam) { setTargetSensorGroup(%this.getTarget(), %defTeam); %this.team = %defTeam; } } else { if(%this.getTarget() != -1) { if(getTargetSensorGroup(%this.getTarget()) == %game.offenseTeam) { setTargetSensorGroup(%this.getTarget(), %defTeam); %this.team = %defTeam; } else if(getTargetSensorGroup(%this.getTarget()) == %defTeam) { setTargetSensorGroup(%this.getTarget(), %game.offenseTeam); %this.team = %game.offenseTeam; } } if(%this.getClassName() $= "Waypoint") { if(%this.team == %defTeam) %this.team = %game.offenseTeam; else if(%this.team == %game.offenseTeam) %this.team = %defTeam; } } } function SiegeGame::groupSwapVehiclePads(%game, %this) { for(%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).swapVehiclePads(); } function SiegeGame::objectSwapVehiclePads(%game, %this) { %defTeam = %game.offenseTeam == 1 ? 2 : 1; if(%this.getDatablock().getName() $= "StationVehicle") { if(%this.getTarget() != -1) { // swap the teams of both the vehicle pad and the vehicle station if(getTargetSensorGroup(%this.getTarget()) == %game.offenseTeam) { setTargetSensorGroup(%this.getTarget(), %defTeam); %this.team = %defTeam; setTargetSensorGroup(%this.pad.getTarget(), %defTeam); %this.pad.team = %defTeam; } else if(getTargetSensorGroup(%this.getTarget()) == %defTeam) { setTargetSensorGroup(%this.getTarget(), %game.offenseTeam); %this.team = %game.offenseTeam; setTargetSensorGroup(%this.pad.getTarget(), %game.offenseTeam); %this.pad.team = %game.offenseTeam; } } } } function SiegeGame::restoreObjects(%game) { // restore all the "permanent" mission objects to undamaged state %group = nameToID("MissionGroup/Teams"); // SimGroup::objectRestore is defined in DefaultGame.cs -- it simply calls // %game.groupObjectRestore %group.objectRestore(); } function SiegeGame::groupObjectRestore(%game, %this) { for(%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).objectRestore(); } function SiegeGame::shapeObjectRestore(%game, %object) { //if(%object.getDatablock().getName() $= FlipFlop) //{ // messageAll('MsgSiegeObjRestore', "", %object.number, true); //} //else if(%object.getDamageLevel()) if(%object.getDamageLevel()) { %object.setDamageLevel(0.0); %object.setDamageState(Enabled); } if(%object.getDatablock().getName() $= "TurretBaseLarge") { // check to see if the turret base still has the same type of barrel it had // at the beginning of the mission if(%object.getMountedImage(0)) if(%object.getMountedImage(0).getName() !$= %object.originalBarrel) { // pop the "new" barrel %object.unmountImage(0); // mount the original barrel %object.mountImage(%object.originalBarrel, 0, false); } } } function InteriorInstance::objectRestore(%this) { // avoid console error spam } function Trigger::objectRestore(%this) { // avoid console error spam } function TSStatic::objectRestore(%this) { // avoid console error spam } function ForceFieldBare::objectRestore(%this) { // avoid console error spam } // ------------------------------------------------------------------------ // Waypoint managing function siegeGame::findObjectiveWaypoints(%game, %group) { if(!%group) %group = nameToId("MissionGroup/Teams"); for (%i = 0; %i < %group.getCount(); %i++) { %obj = %group.getObject(%i); if(%obj.getClassName() $= SimGroup) { %game.findObjectiveWaypoints(%obj); } else if(%obj.needsObjectiveWaypoint) { %game.initializeWaypointAtObjective(%obj); } } } function siegeGame::initializeWaypointAtObjective(%game, %object) { // out with the old...jic if ( %object.waypoint ) { if ( isObject( %object.waypoint ) ) %object.waypoint.delete(); else %object.waypoint = ""; } if(%object.team == %game.offenseTeam) %team = %game.offenseTeam; else %team = (%game.offenseTeam == 1 ? 2 : 1); // to make the waypoint look a little prettier we are using the z from // position and the x and y from worldBoxCenter %posX = getWord(%object.getWorldBoxCenter(), 0); %posY = getWord(%object.getWorldBoxCenter(), 1); %posZ = getWord(%object.position, 2); %append = getTaggedString(%object.getDataBlock().targetTypeTag); %object.waypoint = new WayPoint() { position = %posX SPC %posY SPC %posZ; rotation = "1 0 0 0"; scale = "1 1 1"; dataBlock = "WayPointMarker"; team = %team; name = getTaggedString(%object.nameTag) SPC %append; }; MissionCleanup.add(%object.waypoint); } function siegeGame::switchWaypoint(%game, %waypoint) { %team = %waypoint.team; %newTeam = (%team == 1 ? 2 : 1); %waypoint.team = %newTeam; } function SiegeGame::gameOver(%game) { //call the default DefaultGame::gameOver(%game); cancel(%game.timeThread); messageAll('MsgClearObjHud', ""); } function SiegeGame::sendDebriefing( %game, %client ) { //if neither team captured %winnerName = ""; if ( $teamScore[1] == 0 && $teamScore[2] == 0 ) %winner = -1; //else see if team1 won else if ( $teamScore[1] > 0 && ( $teamScore[2] == 0 || $teamScore[1] < $teamScore[2] ) ) { %winner = 1; %winnerName = $teamName[1]; } //else see if team2 won else if ($teamScore[2] > 0 && ($teamScore[1] == 0 || $teamScore[2] < $teamScore[1])) { %winner = 2; %winnerName = $teamName[2]; } //else see if it was a tie (right down to the millisecond - doubtful) else if ($teamScore[1] == $teamScore[2]) %winner = 0; //send the winner message if (%winnerName $= 'Storm') messageClient( %client, 'MsgGameOver', "Match has ended.~wvoice/announcer/ann.stowins.wav" ); else if (%winnerName $= 'Inferno') messageClient( %client, 'MsgGameOver', "Match has ended.~wvoice/announcer/ann.infwins.wav" ); else messageClient( %client, 'MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" ); // Mission result: if (%winner > 0) { if (%winner == 1) { if ($teamScore[2] == 0) messageClient(%client, 'MsgDebriefResult', "", 'Team %1 wins!', $TeamName[1]); else { %timeDiffMS = $teamScore[2] - $teamScore[1]; messageClient(%client, 'MsgDebriefResult', "", 'Team %1 won by capturing the base %2 faster!', $TeamName[1], %game.formatTime(%timeDiffMS, true)); } } else { if ($teamScore[1] == 0) messageClient(%client, 'MsgDebriefResult', "", 'Team %1 wins!', $TeamName[2]); else { %timeDiffMS = $teamScore[1] - $teamScore[2]; messageClient(%client, 'MsgDebriefResult', "", 'Team %1 won by capturing the base %2 faster!', $TeamName[2], %game.formatTime(%timeDiffMS, true)); } } } else messageClient( %client, 'MsgDebriefResult', "", 'The mission ended in a tie.' ); // Game summary: messageClient( %client, 'MsgDebriefAddLine', "", 'SUMMARY:' ); %team1 = %game.offenseTeam == 1 ? 2 : 1; %team2 = %game.offenseTeam; if ( $teamScore[%team1] > 0 ) { %timeStr = %game.formatTime($teamScore[%team1], true); messageClient( %client, 'MsgDebriefAddLine', "", '%1 captured the %2 base for Team %3 in %4.', %game.capPlayer[%team1], $TeamName[%team2], $TeamName[%team1], %timeStr); } else messageClient( %client, 'MsgDebriefAddLine', "", 'Team %1 failed to capture the base.', $TeamName[%team1]); if ( $teamScore[%team2] > 0 ) { %timeStr = %game.formatTime($teamScore[%team2], true); messageClient( %client, 'MsgDebriefAddLine', "", '%1 captured the %2 base for Team %3 in %4.', %game.capPlayer[%team2], $TeamName[%team1], $TeamName[%team2], %timeStr); } else messageClient( %client, 'MsgDebriefAddLine', "", 'Team %1 failed to capture the base.', $TeamName[%team2]); // List out the team rosters: messageClient( %client, 'MsgDebriefAddLine', "", '\n%1%2', $TeamName[1], $TeamName[2] ); %max = $TeamRank[1, count] > $TeamRank[2, count] ? $TeamRank[1, count] : $TeamRank[2, count]; for ( %line = 0; %line < %max; %line++ ) { %plyr1 = $TeamRank[1, %line] $= "" ? "" : $TeamRank[1, %line].name; %plyr2 = $TeamRank[2, %line] $= "" ? "" : $TeamRank[2, %line].name; messageClient( %client, 'MsgDebriefAddLine', "", ' %1 %2', %plyr1, %plyr2 ); } // Show observers: %count = ClientGroup.getCount(); %header = false; for ( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject( %i ); if ( %cl.team <= 0 ) { if ( !%header ) { messageClient( %client, 'MsgDebriefAddLine', "", '\nOBSERVERS' ); %header = true; } messageClient( %client, 'MsgDebriefAddLine', "", ' %1', %cl.name ); } } } function SiegeGame::clientMissionDropReady(%game, %client) { messageClient(%client, 'MsgClientReady', "", %game.class); for(%i = 1; %i <= %game.numTeams; %i++) { %isOffense = (%i == %game.offenseTeam); messageClient(%client, 'MsgSiegeAddTeam', "", %i, $teamName[%i], %isOffense); } messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); DefaultGame::clientMissionDropReady(%game, %client); } function SiegeGame::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 SiegeGame::resetScore(%game, %client) { %client.score = 0; %client.kills = 0; %client.deaths = 0; %client.suicides = 0; %client.objScore = 0; %client.teamKills = 0; %client.turretKills = 0; %client.offenseScore = 0; %client.defenseScore = 0; } //--------------- Scoring functions ----------------- function SiegeGame::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); %cl.offenseScore = %killPoints; %cl.offenseScore += %cl.teamKills * %game.SCORE_PER_TEAMKILL; // -1 %cl.offenseScore += %cl.objScore; %cl.defenseScore = %cl.turretKills * %game.SCORE_PER_TURRET_KILL; // 1 %cl.score = %cl.offenseScore + %cl.defenseScore; %cl.score = mFloor(%cl.score); %game.recalcTeamRanks(%cl); } function SiegeGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { 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 { %game.awardScoreKill(%clKiller); %game.awardScoreDeath(%clVictim); } 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 SiegeGame::testValidRepair(%game, %obj) { return ((%obj.lastDamagedByTeam != %obj.team) && (%obj.repairedBy.team == %obj.team)); } function SiegeGame::genOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; messageTeam(%repairman.team, 'msgGenRepaired', '\c0%1 repaired the %2 generator!', %repairman.name, %obj.nameTag); } } function SiegeGame::stationOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; messageTeam(%repairman.team, 'msgStationRepaired', '\c0%1 repaired the %2 inventory station!', %repairman.name, %obj.nameTag); } } function SiegeGame::sensorOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; messageTeam(%repairman.team, 'msgSensorRepaired', '\c0%1 repaired the %2 pulse sensor!', %repairman.name, %obj.nameTag); } } function SiegeGame::turretOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; messageTeam(%repairman.team, 'msgTurretRepaired', '\c0%1 repaired the %2 turret!', %repairman.name, %obj.nameTag); } } function SiegeGame::vStationOnRepaired(%game, %obj, %objName) { if (%game.testValidRepair(%obj)) { %repairman = %obj.repairedBy; messageTeam(%repairman.team, 'msgTurretRepaired', '\c0%1 repaired the %2 vehicle station!', %repairman.name, %obj.nameTag); } } function SiegeGame::halfTimeCountDown(%game, %time) { %game.secondHalfCountDown = true; $MatchStarted = false; %timeMS = %time * 1000; %game.schedule(%timeMS, "startSecondHalf"); notifyMatchStart(%timeMS); if(%timeMS > 30000) schedule(%timeMS - 30000, 0, "notifyMatchStart", 30000); if(%timeMS > 20000) schedule(%timeMS - 20000, 0, "notifyMatchStart", 20000); if(%timeMS > 10000) schedule(%timeMS - 10000, 0, "notifyMatchStart", 10000); if(%timeMS > 5000) schedule(%timeMS - 5000, 0, "notifyMatchStart", 5000); if(%timeMS > 4000) schedule(%timeMS - 4000, 0, "notifyMatchStart", 4000); if(%timeMS > 3000) schedule(%timeMS - 3000, 0, "notifyMatchStart", 3000); if(%timeMS > 2000) schedule(%timeMS - 2000, 0, "notifyMatchStart", 2000); if(%timeMS > 1000) schedule(%timeMS - 1000, 0, "notifyMatchStart", 1000); } function SiegeGame::applyConcussion(%game, %player) { } function SiegeGame::updateScoreHud(%game, %client, %tag) { %timeElapsedMS = getSimTime() - %game.startTimeMS; %curTimeLeftMS = %game.timeLimitMS - %timeElapsedMS; if (!$MatchStarted) %curTimeLeftStr = %game.formatTime(%game.timelimitMS, false); else %curTimeLeftStr = %game.formatTime(%curTimeLeftMS, false); // Send header: if (%game.firstHalf) messageClient( %client, 'SetScoreHudHeader', "", 'Team %1 has %2 to capture the base.', $teamName[%game.offenseTeam], %curTimeLeftStr ); else messageClient( %client, 'SetScoreHudHeader', "", 'Team %1 must capture the base within %2 to win.', $teamName[%game.offenseTeam], %curTimeLeftStr ); // Send subheader: messageClient( %client, 'SetScoreHudSubheader', "", '\t%1 (%2)\t%3 (%4)', $TeamName[1], $TeamRank[1, count], $TeamName[2], $TeamRank[2, count] ); %index = 0; while (true) { if (%index >= $TeamRank[1, count] && %index >= $TeamRank[2, count]) break; //get the team1 client info %team1Client = ""; %team1ClientScore = ""; %col1Style = ""; if (%index < $TeamRank[1, count]) { %team1Client = $TeamRank[1, %index]; %team1ClientScore = %team1Client.score $= "" ? 0 : %team1Client.score; if ( %team1Client == %client ) %col1Style = ""; } //get the team2 client info %team2Client = ""; %team2ClientScore = ""; %col2Style = ""; if (%index < $TeamRank[2, count]) { %team2Client = $TeamRank[2, %index]; %team2ClientScore = %team2Client.score $= "" ? 0 : %team2Client.score; if ( %team2Client == %client ) %col2Style = ""; } //if the client is not an observer, send the message if (%client.team != 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%3%1\t%4%2', %team1Client.name, %team2Client.name, %col1Style, %col2Style ); } //else for observers, create an anchor around the player name so they can be observed else { messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%3%1\t%4%2', %team1Client.name, %team2Client.name, %col1Style, %col2Style, %team1Client, %team2Client ); } %index++; } // Tack on the list of observers: %observerCount = 0; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team == 0) %observerCount++; } if (%observerCount > 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, ""); %index++; messageClient(%client, 'SetLineHud', "", %tag, %index, '\tOBSERVERS (%1)TIME', %observerCount); %index++; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); //if this is an observer if (%cl.team == 0) { %obsTime = getSimTime() - %cl.observerStartTime; %obsTimeStr = %game.formatTime(%obsTime, false); messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%1%2', %cl.name, %obsTimeStr ); %index++; } } } //clear the rest of Hud so we don't get old lines hanging around... messageClient( %client, 'ClearHud', "", %tag, %index ); }PK !({6 3) $pref::trainingDifficulty = 1; if($pref::trainingDifficulty == 1) $teamDamage = false; else $teamDamage = true; // game settings $MPRestoreteamSkin[1] = $teamSkin[1]; $MPRestoreteamName[1] = $teamName[1]; $MPRestoreholoName[1] = $holoName[1]; $MPRestoreswitchSkin[1] = $switchSkin[1]; $MPRestoreteamSkin[2] = $teamSkin[2]; $MPRestoreteamName[2] = $teamName[2]; $MPRestoreholoName[2] = $holoName[2]; $MPRestoreswitchSkin[2] = $switchSkin[2]; $playerTeam = 1; $teamSkin[$playerTeam] = 'swolf'; $teamName[$playerTeam] = 'StarWolf'; $holoName[$playerTeam] = "StarWolf"; $switchSkin[$playerTeam] = 'swolf'; $playerLivesAtEasy = 3; $EnemyTeam = 2; $teamSkin[$EnemyTeam] = 'Horde'; $teamName[$EnemyTeam] = 'Bioderm Horde'; // $holoName[$enemyTeam] = "Bioderm"; // $switchSkin[$enemyTeam] = 'Bioderm'; if($enemyName $= "") $EnemyName = "Enemy"; $trainingDefenseTauntList = "bas.enemy slf.att.attack slf.def.defend wrn.enemy tgt.acquired gbl.brag slf.def.base vqk.help"; $trainingOffenseTauntList = "slf.att.attack gbl.brag vqk.help att.distract att.attack ene.disarray glb.awesome need.cover"; } function resetSinglePlayerGlobals() { //error("================ single player global vars reset!"); // server settings //$Host::BotCount = $MPRestoreBotCount; $Host::BotMatchBotCount = $MPRestoreBotMatchBotCount; $Host::BotsEnabled = $MPRestoreBotsEnabled; $Host::MaxBotDifficulty = $MPRestoreMaxBotDifficulty; $Host::MaxPlayers = $MPRestoreMaxPlayers; $Host::MinBotDifficulty = $MPRestoreMinBotDifficulty; $Host::TimeLimit = $MPRestoreTimeLimit; $Host::TournamentMode = $MPRestoreTournamentMode; $Host::warmupTime = $MPRestorewarmupTime; $teamDamage = $MPRestoreTeamDamage; // game settings $teamSkin[1] = $MPRestoreteamSkin[1]; $teamName[1] = $MPRestoreteamName[1]; $holoName[1] = $MPRestoreholoName[1]; $switchSkin[1] = $MPRestoreswitchSkin[1]; $teamSkin[2] = $MPRestoreteamSkin[2]; $teamName[2] = $MPRestoreteamName[2]; $holoName[2] = $MPRestoreholoName[2]; $switchSkin[2] = $MPRestoreswitchSkin[2]; } // Actors //======================================================================================= function addEnemies() { %num = $numberOfEnemies[$pref::TrainingDifficulty]; error("Adding " @ %num @" enemies!"); %group = nameToId("MissionGroup/Teams/Team2/DropPoints"); for(%i = 0; %i < %num; %i++){ %name = getUniqueEnemyName(); %voice = "Derm"@getRandom(1,3); %voicePitch = 1 - ((getRandom(20) - 10)/100); //%client = AIConnect($EnemyName@%i, $EnemyTeam, $missionBotSkill[$pref::TrainingDifficulty], true); %client = AIConnect(%name, $EnemyTeam, $missionBotSkill[$pref::TrainingDifficulty], true, %voice, %voicePitch); $Enemy[%i] = %client; %client.race = "Bioderm"; setTargetSkin(%client.target, $teamSkin[$enemyTeam]); //setTargetVoice(%client.target, addTaggedString(%client.voice)); //error("Setting race of "@$Enemy[%i]@" to "@$Enemy[%i].race); if(%group.getObject(%i).Equipment || %group.getObject(%i).specialObjectives) { %client.equipment = %group.getObject(%i).Equipment; //error("Client: "@%client@ " has equipment "@%client.equipment); %client.SpecialObjectives = %group.getObject(%i).SpecialObjectives; //error("Client: "@%client@ " has specialEd "@%client.SpecialObjectives); game.equip(%client.player); } // this seems redundant after equip %client.player.setArmor(%client.armor); } } // there are times (missions 2 and 4) where bots are not added with // addEnemies(). there are x waves of bots with y number in each wave // i do it a couple of times so im going to localize it here rather than // do it twice or cut and paste it function spawnWave(%wave) { for(%i=1; %i<=$numberInWave[$pref::TrainingDifficulty]; %i++) { %name = getUniqueEnemyName(); %voice = "Derm"@getRandom(1,3); %voicePitch = 1 - ((getRandom(20) - 10)/100); %thisAi = aiConnect(%name, $enemyTeam, $missionBotSkill[$pref::TrainingDifficulty], false, %voice, %voicePitch); //%thisAi = aiConnect("Wave"@%wave@"num"@%i, $enemyTeam, $missionBotSkill[$pref::TrainingDifficulty], false); // here we differentiate the different drop points for wave spawned bots (these spawned bots are "!offense") //error("added enemy "@%thisAi); %thisAi.race = "Bioderm"; %thisAi.voice = "Derm"@getRandom(3); setTargetSkin(%thisAI.target, $teamSkin[$enemyTeam]); setTargetVoice(%thisAI.target, addTaggedString(%thisAI.voice)); %equipment = pickEquipment(); game.equip(%thisAi.player, %equipment); //%client.player.setArmor(%thisAi.armor); //create a little group game.NumberInWave[%wave]++; %thisAI.MemberOfWave = %wave; //anything mission specific that has to be done with this client missionSpawnedAI(%thisAi); } game.spawnWaveTimer = spawnWaveTimer(%wave, false); } function addPlayersTeam(%num) { //echo($player.team@"<---------players team on addPlayerTeam"); getTeammateGlobals(); for(%i=0; %i< %num; %i++){ $Teammate[%i] = %client = AIConnect($TeammateWarnom[%i], $playerTeam, $teammateSkill[%i], true, $teammateVoice[%i]); %client.sex = $teammateGender[%i]; %client.equipment = $teammateEquipment[%i]; setTargetSkin(%client.target, $teamSkin[$playerTeam]); game.equip(%client.player); %client.player.setArmor(%client.armor); if (! %client.defaultTasksAdded) { %client.defaultTasksAdded = true; %client.addTask(AIEngageTask); %client.addTask(AIPickupItemTask); %client.addTask(AIUseInventoryTask); %client.addTask(AIEngageTurretTask); %client.addtask(AIDetectMineTask); } } //add Player=============================================================== $player.lives = $playerLivesAtEasy - $pref::TrainingDifficulty; game.spawnPlayer($player, false); setTargetSkin($player.target, $teamSkin[$playerTeam]); } function getUniqueEnemyName() { if(!$enemyNameCount) return; %used = false; %name = pickUniqueEnemyName(); %used = enemyNameIsUsed(%name); while(%used) { if(%emergency++ > 1000) { //error("Too many times in the name while loop...using DEFAULT"); return $enemyName; } %name = pickUniqueEnemyName(); %used = enemyNameIsUsed(%name); } return %name; } function pickUniqueEnemyName() { %random = getRandom(1, $enemyNameCount); %name = $EnemyNameList[%random]; //error("returning" SPC %name SPC "from pick"); return %name; } function enemyNameIsUsed(%name) { %number = game.usedNameCount; for(%i = 0; %i <= %number; %i++) { if(game.usedName[%i] $= %name) return true; } // the name is unused game.usedName[game.usedNameCount++] = %name; return false; } function spawnWaveTimer(%wave, %reset) { //error("SpawnTimer ACTIVATED"); if(%reset) { cancel(game.spawnWaveTimer); %timeForAction = 60000 * 2; //2 min } else %timeForAction = 60000 * 4; //4 min game.spawnWaveTimer = schedule(%timeForAction, game, destroyWave, %wave); } function DestroyWave(%wave) { // this group has enemies in it that are dawdling and // need to be killed to keep the game progressing %num = clientGroup.getCount(); for(%i = 0; %i < %num; %i++) { %client = clientGroup.getObject(%i); if(%client.player && %client.MemberOfWave == %wave) { %client.player.applyDamage(%client.player.getDataBlock().maxDamage); enemyWaveMemberKilled(%client); } } } function SinglePlayerGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement) { if(game.missionOver) return; %clVictim.dead = true; if(%clvictim.team == $enemyTeam && getRandom(1,1000) == 69) doText(Any_jingo02); missionClientKilled(%clVictim, %clKiller); if(%clVictim.MemberOfWave) enemyWaveMemberKilled(%clVictim ); Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement); cancel(%clVictim.respawnTimer); if(%clVictim == $player) { // dead players are not out of bounds cancel($player.OOB); $player.deaths++; %num = $player.lives; if( %num >= 1) { if(%num == 1) %textNum = "one life"; else %textNum = %num SPC "lives"; messageBoxOk("Restart", "You have" SPC %textNum SPC "remaining.", "spawnSinglePlayer();"); } else schedule(3000, $player.player, singlePlayerDead); } } function enemyWaveMemberKilled(%client) { %wave = %client.MemberOfWave; %remaining = game.numberInWave[%wave]--; //error("Debug: Script reports that client " @ %client @ " was a member of wave " @ %wave @ " that now has " @ %remaining @ " members remaining."); if(%remaining == 0) { missionWaveDestroyed(%wave); if (%wave+1 <= $numberOfWaves[$pref::TrainingDifficulty]) spawnWave(%wave+1); //else error("Debug: " @ %wave @ " was the last wave."); } } function SinglePlayerGame::assignClientTeam(%game, %client) { // The players team is set in singlePlayer::clientMissionDropReady // and the bots are added to a team with aiConnect // so this is unnecessary } function singlePlayerGame::AIHasJoined() { // Big deal...my missions are crawling with AI // lets get rid of this mundane console spam } function SinglePlayerGame::updateKillScores() { // Do nothing other than get rid of the console warning... } function singlePlayerGame::biodermAssume(%game, %client) { //error(%client SPC "might talk."); // dont do anything if we have just done this if(%client.spgSpeaking) return; %probability = 2; %time = 30; // secs // we are going to POSSIBLY talk. flag it for %time secs %client.spgSpeaking = true; schedule(%time * 1000, %client, resetSpeakingFlag, %client); if(getRandom(%probability) == 1) trainingBiodermSpeaks(%client); } function resetSpeakingFlag(%client) { //error(%client SPC "can now speak again."); %client.spgSpeaking = false; } function trainingBiodermSpeaks(%client) { if(%client.offense) // offense = defense? %tauntlist = $trainingDefenseTauntList; //yes this seem wrong but its not else %tauntlist = $trainingOffenseTauntList; %num = getWordCount(%tauntList); %random = getRandom(%num - 1); %use = getWord(%tauntList, %random); //echo("Derm taunting:" SPC %use); playTargetAudio( %client.target, addTaggedString(%use), AudioClose3d, false ); } function singlePlayerDead() { missionFailed($player.miscMsg[trainingDeathLoss]); AIMissionEnd(); $objectiveQ[$enemyTeam].clear(); cancel($player.distanceCheckSchedule); } function SinglePlayerGame::missionLoadDone(%game) { DefaultGame::missionLoadDone(%game); setSinglePlayerGlobals(); $matchStarted = true; //this has to happen sometime because game.startMatch never gets called %game.clearDeployableMaxes(); } function SinglePlayerGame::notifyMatchStart(%game, %time) { //do nothing } function SinglePlayerGame::clientMissionDropReady(%game, %client) { DefaultGame::clientMissionDropReady(%game, %client); //echo(%client @ " is single player Ready!!!"); messageClient(%client, 'MsgClientReady', "", %game.class); $Player = %client; $player.race = "Human"; $player.team = $playerTeam; $player.setTeam($playerTeam); setTargetSkin($teammate[%i].target, $teamSkin[$playerTeam]); $player.clearBackpackIcon(); createText($player); HUDMessageVector.clear(); messageClient(%client, 'MsgMissionDropInfo', "", $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); // We don't start in observer mode, so disable: commandToClient(%client, 'setHudMode', 'Standard'); //custom training keymap %game.createCustomKeyMap(); addEnemies(); //echo($player.team@"<---------players team on mission drop ready"); addPlayersTeam($numberOfTeammates); //everybody's in, enable the AI system AISystemEnabled(true); $player.setControlObject( $player.player ); $player.camera = new Camera() { dataBlock = Observer; }; startCurrentMission(%game); } function SinglePlayerGame::AIInit(%game) { //error("initializing Bot Q's for SinglePlayerGame..."); for (%i = 0; %i <= %game.numTeams; %i++) { if (!isObject($ObjectiveQ[%i])) { $ObjectiveQ[%i] = new AIObjectiveQ(); MissionCleanup.add($ObjectiveQ[%i]); } //error("team " @ %i @ " objectives load..."); $ObjectiveQ[%i].clear(); AIInitObjectives(%i, %game); } AIInit(); // Bots never throw grenades on Easy skills if($pref::TrainingDifficulty == 1) $AIDisableGrenades = true; } // unlike the MP game, sometimes we start with switches (flipFlops) // already on one team or the other and they are unskinned function setFlipFlopSkins(%group) { if(!%group) %group = nameToID("Teams"); for(%i = 0; %i < %group.getCount(); %i++) { %this = %group.getObject(%i); if(%this.getClassName() $= "SimGroup") setFlipFlopSkins(%this); else if(%this.getDataBlock().getName() $= "FlipFlop") setTargetSkin(%this.getTarget(), $teamSkin[%this.team]); } } function singlePlayerGame::gameOver(%game) { moveMap.push(); ServerConnection.setBlackOut(false, 0); $timeScale = 1; game.missionOver = true; // clear the inventory and weapons hud // BH: This doesn't actually DO anything... //error("clearing Inv HUD for client " @ $player); //$player.SetInventoryHudClearAll(); // im gonna try dropping all the clients %count = clientGroup.getCount(); echo("count=" SPC %count); for(%i = 0; %i < %count; %i++) { %client = clientGroup.getObject(%i); game.client[%i] = %client; freeClientTarget(%client); } for(%i = 0; %i < %count; %i++) { %client = game.client[%i]; echo("client=" SPC %client); if(%client.isAIControlled()) %client.drop(); } //disable the AI system AISystemEnabled(false); $AIDisableChatResponse = ""; game.deactivatePackages(); if(isObject( $player.currentWaypoint )) $player.currentWaypoint.delete(); if($player.OOB) cancel($player.OOB); // clear the objective HUD messageClient($player, 'MsgClearObjHud', ""); resetSinglePlayerGlobals(); $currentMissionType = ""; DefaultGame::GameOver(%game); } function singlePlayerGame::deactivatePackages(%game) { error("singlePlayerGame packages deactivated"); //Deactivate packages...gotta catch'm all //deactivatepackage(SinglePlayer); deactivatepackage(Training1); deactivatepackage(Training2); deactivatepackage(Training3); deactivatepackage(Training4); deactivatepackage(Training5); deactivatepackage(Training6); deactivatePackage(singlePlayerMissionAreaEnforce); } //------------------------------------------------------------------------------------ // Voice line, text, function and audio parsing //================================================================================= // this is how we handle ALL the voice distribition and playing // its NOT pretty function doText(%name, %extraTime, %priority) { if($player.text[%name, priority] || %priority) addToQueueNext(%name); else addToQueueEnd(%name); $player.text[%name, extraTime] = %extraTime; processText(false); } function processText(%cont) { //we may need to fudge everysound to get it timed right %universalSoundFudgingConstant = 400; if(isEventPending($currentlyPlaying) && !%cont) return; %name = $player.Textque0; if(%name $= "") return; //echo("processing: "@%name); if($player.Text[%name, eval] !$= "") { if (!isPureServer()) eval($player.text[%name, eval]); else processTextEval($player.text[%name, eval]); } if($player.Text[%name, text] !$= "") { // the old way: messageClient($player, 0, '\c2%1: %2',$trainerName, $player.Text[%name, line]); messageClient($player, 0, "\c5"@$player.Text[%name, text]); serverPlay2d(MessageRecieveSound); } if($player.Text[%name, wav] !$= "") { //messageClient($player, 0, "~w"@$player.Text[%name, wav]); %audio = alxCreateSource( AudioChat, $player.Text[%name, wav] ); alxPlay( %audio ); } removeFromQueue(); %wavLen = alxGetWaveLen($player.text[%name, wav]); //if(%wavLen < 400) // %wavLen = 400; // you cant go back in time, vge %time = %wavLen + $player.text[%name, extraTime] + %universalSoundFudgingConstant; //echo("total delay time of"@%time); $currentlyPlaying = schedule(%time, $player.player, processText, true); //if (!isPureServer()) // schedule(%time, 0, eval, "$currentlyPlaying = false;"); //else // schedule(%time, 0, SPUnsetCurrentlyPlaying); } function SPUnsetCurrentlyPlaying() { $currentlyPlaying = ""; error(getSimTime() SPC "DEBUG setting currentlyPlaying null"); } function processTextEval(%evalStmt) { switch$ (%evalStmt) { case "singlePlayerPlayGuiCheck();": singlePlayerPlayGuiCheck(); case "schedule(3000, 0, disconnect);": schedule(3000, 0, disconnect); case "lockArmorHack();autoToggleHelpHud(true);": lockArmorHack();autoToggleHelpHud(true); case "flashMessage();": flashMessage(); case "flashObjective();": flashObjective(); case "flashCompass();": flashCompass(); case "flashHealth();": flashHealth(); case "flashEnergy();": flashEnergy(); case "flashInventory();": flashInventory(); case "flashSensor();": flashSensor(); case "autoToggleHelpHud(false);": autoToggleHelpHud(false); case "setWaypointAt(\"-287.5 393.1 76.2\", \"Health Patches\");movemap.push();$player.player.setMoveState(false);": setWaypointAt("-287.5 393.1 76.2", "Health Patches");movemap.push();$player.player.setMoveState(false); case "$player.hurryUp = schedule(40000, 0, hurryPlayerUp); endOpeningSpiel(); updateTrainingObjectiveHud(obj8);": $player.hurryUp = schedule(40000, 0, hurryPlayerUp); endOpeningSpiel(); updateTrainingObjectiveHud(obj8); case "updateTrainingObjectiveHud(obj7);": updateTrainingObjectiveHud(obj7); case "flashWeapon(0);": flashWeapon(0); case "flashWeapon(2);": flashWeapon(2); case "flashWeapon(3); ": flashWeapon(3); case "flashWeaponsHud();": flashWeaponsHud(); case "use(Blaster);": use(Blaster); case "queEnemySet(0); activatePackage(singlePlayerMissionAreaEnforce);": queEnemySet(0); activatePackage(singlePlayerMissionAreaEnforce); case "setWaypointat(nameToId(Tower).position, \"BE Tower\"); updateTrainingObjectiveHud(obj4);": setWaypointat(nameToId(Tower).position, "BE Tower"); updateTrainingObjectiveHud(obj4); case "flashPack();": flashPack(); case "updateTrainingObjectiveHud(obj3);": updateTrainingObjectiveHud(obj3); case "setWaypointAt(\"-8.82616 -131.779 119.756\", \"Control Switch\");": setWaypointAt("-8.82616 -131.779 119.756", "Control Switch"); case "setWaypointAt(nameToId(InitialPulseSensor).position, \"Sensor\");": setWaypointAt(nameToId(InitialPulseSensor).position, "Sensor"); case "setWaypointAt(\"-8.82616 -131.779 119.756\", \"Tower\");": setWaypointAt("-8.82616 -131.779 119.756", "Tower"); case "setWaypointAt(\"380.262 -298.625 98.9719\", \"Tower\");": setWaypointAt("380.262 -298.625 98.9719", "Tower"); case "firstPersonQuickPan();": firstPersonQuickPan(); case "ThreeAEval();": ThreeAEval(); case "game.ExpectiongSupportButton = true;": game.ExpectiongSupportButton = true; case "game.expectingRepairOrder = true;": game.expectingRepairOrder = true; case "$random = getRandom(20,40);schedule($random, 0, doText, T4_TipDefense06);": $random = getRandom(20,40);schedule($random, 0, doText, T4_TipDefense06); case "training5addSafeDistance();": training5addSafeDistance(); } } function removeFromQueue() { %i = 1; while($player.textque[%i] !$= "") { $player.textque[%i-1] = $player.textque[%i]; %i++; } $player.textque[%i-1] = ""; } function addToQueueEnd(%name) { %q = 0; while($player.Textque[%q] !$= ""){ %q++; } $player.Textque[%q] = %name; } function addToQueueNext(%name) { %q = 0; while($player.Textque[%q] !$= ""){ %q++; } for(%i=%q; %i>0; %i--) $player.textque[%i] = $player.textque[%i-1]; $player.textque0 = %name; } function echoQueue() { echo("Textque -------------------------------"); %i = 0; while($player.Textque[%i] !$= "") { echo(%i@": "@$player.Textque[%i]); %i++; } } function clearQueue() { for(%i=0;%i<100; %i++) $player.textQue[%i] = ""; } //handy waypoint setting tool //========================================================================= function setWaypointAt(%location, %name, %team) { %team = (!%team ? $playerTeam : %team); // if(!%name) // %name = ""; if ( isObject( $player.currentWaypoint ) ) $player.currentWaypoint.delete(); $player.currentWaypoint = new WayPoint(TurretTower) { position = %location; rotation = "1 0 0 0"; scale = "1 1 1"; dataBlock = "WayPointMarker"; team = %team; name = %name; }; MissionCleanup.add($player.currentWaypoint); } //this is just a little consolidation of functions //its a little gregarious but allows text to live in spdialg.cs //intent is to make hud updating easier and localization easier too ;) function updateTrainingObjectiveHud( %objectiveNum ) { //sound objectiveHud.setVisible(false); if (!isPureServer()) schedule(400, game, eval, "objectiveHud.setVisible(true);"); else schedule(400, game, setObjHudVisible); serverPlay2d(TrainingHudUpdateSound); //clear old text messageClient($player, 'MsgSPCurrentObjective1', "", ' '); messageClient($player, 'MsgSPCurrentObjective2', "", ' '); // find the lines from the spdialog file that are now attached to the sp client %who = $player; %mission = $currentMission; for(%x = 1; %x <= 2; %x++) %newObjectiveLine[%x] = $player.objHud[%mission, %objectiveNum, %x]; //add new text messageClient($player, 'MsgSPCurrentObjective1', "", %newObjectiveLine1); if(%newObjectiveLine2 !$= "") messageClient($player, 'MsgSPCurrentObjective2', "", %newObjectiveLine2); } function setObjHudVisible() { objectiveHud.setVisible(true); } // Misc/Overwrites //======================================================================================= function isSafe(%object, %radius) { %team = %object.team; %position = %object.player.getTransform(); //check for enemy players %num = clientGroup.getCount(); for(%client = 0; %client <= %num; %client++) { if(%team != %client.team && %client.player) { %enemyPos = %client.player.getTransform(); //okay, just in case we dont have a player for that client //AND are close to "0 0 0" vge if(!%enemyPos) %dist = 100000; else %dist = vectorDist(%position, %enemyPos); //error("Debug: Client "@%client@" is "@%dist@" away"); if ( %dist < %radius){ //error("Unsafe because of client "@%client@" at a distance of "@%dist@"!!!!"); return false; } } } //error("Safe for a radius of "@%radius@"!"); return true; } function singlePlayerGame::onAIRespawn(%game, %client) { // add the default tasks if (! %client.defaultTasksAdded) { %client.defaultTasksAdded = true; %client.addTask(AIEngageTask); %client.addTask(AIPickupItemTask); %client.addTask(AIUseInventoryTask); %client.addTask(AIEngageTurretTask); %client.addtask(AIDetectMineTask); if(%client.team == $playerTeam || $pref::trainingDifficulty == 3) %client.addTask(AITauntCorpseTask); } } function singlePlayerGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement) { // dont respawn AI (this is overwritten in some of the mission packages) } function singleplayerGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement) { //the DefaultGame will set some vars DefaultGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement); //now see if both were on the same team if(%clAttacker && %clAttacker != %clVictim && %clVictim.team == %clAttacker.team) { %game.friendlyFireMessage(%clVictim, %clAttacker); } } function singleplayerGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType, %implement) { if(%clVictim.team != %clAttacker.team && %clVictim.MemberOfWave) { spawnWaveTimer(%clVictim.MemberOfWave, true); } if (%clAttacker && %clAttacker != %clVictim && %clAttacker.team == %clVictim.team) { schedule(250, %clVictim, "AIPlayAnimSound", %clVictim, %clAttacker.player.getWorldBoxCenter(), "wrn.watchit", -1, -1, 0); //clear the "lastDamageClient" tag so we don't turn on teammates... unless it's uberbob! %clVictim.lastDamageClient = -1; } } // find number of players on a team // why isnt this in a std lib function getPlayersOnTeam(%team) { %num = clientGroup.getCount(); for(%i=0; %i<%num; %i++){ %client = clientGroup.getObject(%i); if(%client.team == %team && %client.player) %count++; } return %count; } //mission completion/falure stuff============================================ function missionComplete(%text) { $player.endMission = schedule(15000, game, forceFinish); messageBoxOk("Victory", %text, "forceFinish();"); //AI stop clearQueue(); AIMissionEnd(); $objectiveQ[$enemyTeam].clear(); } function forceFinish() { $timeScale = 1; //kill the thread if we pressed a button to get here... cancel($player.endMission); //make sure we end the game neatly Game.gameOver(); //immediately disconnect - bringing us back to the main menu... Disconnect(); } function missionFailed(%text) { $player.endMission = schedule(30000, game, forceFinish); MessageBoxYesNo("Failure", %text, "reloadMission();", "forceFinish();"); //AI stop cancel($Player.T1OpeningSpielSchedule); cancel($Player.distanceCheckSchedule); clearQueue(); AIMissionEnd(); $objectiveQ[$enemyTeam].clear(); } function reloadMission() { cancel($player.endMission); Game.gameOver(); Canvas.setContent( LoadingGui ); loadMission($currentMission, singlePlayer); debriefContinue(); } // silly...we fed it a movemap binding it retuns the capitalized key in (almost) english function findTrainingControlButtons( %name ) { %controlName = moveMap.getBinding(%name); if (%controlName $= "") return "[no key binding]"; %prettyName = strupr(getMapDisplayName(getWord(%controlName, 0), getWord(%controlName, 1))); %next = 2; while( getWord( %controlName, %next ) !$= "" ) { %extra = "-"@strupr(getWord( %controlName, 2 )); %prettyName = %prettyName @ %extra; %next++; } return %prettyName; } // just a kinda cool little effect function firstPersonQuickPan() { if($firstperson) { toggleFirstPerson($player); schedule(4000, $player.player, toggleFirstPerson, $player); } } // Player spawning/respawning==================================================== //since we are going through pickTeamSpawn rather than pickPlayerSpawn // and for a couple other reasons, we are going to need to manually determine // if this is a respawn or not. function spawnSinglePlayer() { $player.lives--; game.spawnPlayer($player, true); $player.setControlObject($player.player); //messageClient($player, 0, "Respawns Remaining: "@$player.lives); } function singleplayerGame::observerOnTrigger() { //we dont want the player respawning (yet) return false; } function SinglePlayerGame::spawnPlayer( %game, %client, %respawn ) { //error("Spawn Player: %client = " @%client@" %respawn = "@%respawn); %spawnPoint = %game.pickPlayerSpawn( %client, %respawn ); %game.createPlayer( %client, %spawnPoint, %respawn ); } function singlePlayerGame::playerSpawned(%game, %player) { defaultGame::playerSpawned(%game, %player); } function singleplayerGame::pickPlayerSpawn(%game, %client, %respawn) { // the bots, for some reason, always pass in %respawn as true // well that's horse pucky, since the bots never respawn in SPG // so I do this stupid thing if(%client.isAIcontrolled()) %respawn = false; if(!%client.offense) // this is a wave spawned attack bot %respawn = true; %game.pickTeamSpawn( %client, %respawn); } function singleplayerGame::pickTeamSpawn(%game, %client, %respawn) { %team = %client.team; if(%respawn) { %group = nameToID("MissionGroup/Teams/team"@%team@"/DropPoints/Respawns"); if(! isObject(%group)) { //error("Client" SPC %client SPC "is attempting a respawn with no drop point"); return "0 0 300"; } else %spawnLoc = %group.getObject(game.respawnPoint); //error("REspawn loc is: " @ %spawnLoc); } else { %group = nameToID("MissionGroup/Teams/team" @ %team @ "/DropPoints"); %spawnLoc = %group.getObject(game.spawnLoc[%team]); //error("spawn loc is: "@game.spawnLoc[%team]); game.spawnLoc[%team]++; } return %spawnLoc.getTransform(); } function SinglePlayerGame::createCustomKeymap(%game) { // new ActionMap(TrainingMap); // TrainingMap.bindCmd( keyboard, "escape", "escapeFromGame();", "" ); } //======================================================================================= // Escape dialog functions: //======================================================================================= function SinglePlayerEscapeDlg::onWake( %this ) { $timeScale = 0; if( OptionsDlg.isAwake()) { Canvas.popDialog( OptionsDlg ); } } function SinglePlayerEscapeDlg::onSleep( %this ) { // spMap.pop(); // spMap.delete(); } function SinglePlayerEscapeDlg::leaveGame( %this ) { Canvas.popDialog( SinglePlayerEscapeDlg ); MessageBoxYesNo( "LEAVE GAME", $player.miscMsg[LeaveGame], "forceFinish();", "$timeScale = 1;" ); } function SinglePlayerEscapeDlg::gotoSettings( %this ) { Canvas.popDialog( SinglePlayerEscapeDlg ); Canvas.pushDialog( OptionsDlg ); } function SinglePlayerEscapeDlg::returnToGame( %this ) { //error( "** CALLING SinglePlayerEscapeDlg::returnToGame **" ); $timeScale = 1; Canvas.popDialog( SinglePlayerEscapeDlg ); movemap.push(); //trainingmap.push(); } function singlePlayerGame::OptionsDlgSleep(%game) { $enableDirectInput = 1; activateDirectInput(); Canvas.pushDialog( SinglePlayerEscapeDlg ); // the player may have changed his keys // we need to reload the big spdialog string table that // holds all the text related to the players keymappings createText($player); } // mission Area package package singlePlayerMissionAreaEnforce { // -begin mission area package------------------------------------------------- // OOB function SinglePlayerGame::leaveMissionArea(%game, %playerData, %player) { parent::leaveMissionArea(%game, %playerData, %player); if(%player == $player.player) { $player.leftMissionArea++; %timeAllowed = 30; $player.OOB = schedule(%timeAllowed *1000, 0, wussOut, %player); clearQueue(); doText(Any_offcourse); MessageClient($player, 0, $player.miscMsg[OOB]); %player.playerLeftMissionArea = true; } } function SinglePlayerGame::enterMissionArea(%game, %playerData, %player) { parent::enterMissionArea(%game, %playerData, %player); if(%player == $player.player && %player.playerLeftMissionArea) { //echo("player back in bounds"); cancel($player.OOB); clearQueue(); doText(Any_alright); MessageClient($player, 0, $player.miscMsg[InBounds]); } } function wussOut(%player) { clearQueue(); doText(Any_abort); missionFailed($player.miscMsg[OOBLoss]); } // -end mission area package------------------------------------------------- }; // Custom Particle effects for training5 datablock ParticleData(BeforeT5particle) { dragCoefficient = 0; gravityCoefficient = -0.017094; inheritedVelFactor = 0.0176125; constantAcceleration = -0.8; lifetimeMS = 1248; lifetimeVarianceMS = 0; useInvAlpha = 1; spinRandomMin = -200; spinRandomMax = 200; textureName = "particleTest"; colors[0] = "1.000000 0.677165 0.000000 1.000000"; colors[1] = "0.708661 0.507812 0.000000 1.000000"; colors[2] = "0.000000 0.000000 0.000000 0.000000"; colors[3] = "1.000000 1.000000 1.000000 1.000000"; sizes[0] = 0.991882; sizes[1] = 2.99091; sizes[2] = 4.98993; sizes[3] = 1; times[0] = 0; times[1] = 0.2; times[2] = 1; times[3] = 2; }; datablock ParticleData(AfterT5particle) { dragCoefficient = 0; gravityCoefficient = -0.017094; inheritedVelFactor = 0.0176125; constantAcceleration = -1.1129; lifetimeMS = 2258; lifetimeVarianceMS = 604; useInvAlpha = 1; spinRandomMin = -200; spinRandomMax = 200; textureName = "special/Smoke/smoke_001"; colors[0] = "1.000000 0.677165 0.000000 1.000000"; colors[1] = "0.181102 0.181102 0.181102 1.000000"; colors[2] = "0.000000 0.000000 0.000000 0.000000"; colors[3] = "1.000000 1.000000 1.000000 1.000000"; sizes[0] = 0.991882; sizes[1] = 2.99091; sizes[2] = 4.98993; sizes[3] = 1; times[0] = 0; times[1] = 0.2; times[2] = 1; times[3] = 2; }; datablock ParticleEmitterData(BeforeT5) { ejectionPeriodMS = 16; periodVarianceMS = 10; ejectionVelocity = 7.45968; velocityVariance = 0.25; ejectionOffset = 0; thetaMin = 0; thetaMax = 180; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = 0; orientParticles= 0; orientToNormal = 0; orientOnVelocity = 1; particles = "BeforeT5particle"; }; datablock ParticleEmitterData(AfterT5) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 10.25; velocityVariance = 0.25; ejectionOffset = 0; thetaMin = 0; thetaMax = 180; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = 0; orientParticles= 0; orientToNormal = 0; orientOnVelocity = 1; particles = "AfterT5particle"; }; PK !(5ׯOOscripts/TeamHuntersGame.cs//--------------------------------------// // TeamHuntersGame.cs // //--------------------------------------// // DisplayName = Team Hunters //--- GAME RULES BEGIN --- //Collect flags and bring them to Nexus //You may pass flags to a Capper //Capper can collect many flags and try for massive score //However, any player may score at Nexus //All scores of team members count toward team score //--- GAME RULES END --- package TeamHuntersGame { function Nexus::objectiveInit(%data, %object) { Game.Nexus = %object; Game.Nexus.playThread(0, "ambient"); Game.Nexus.setThreadDir(0, true); //The flash animation plays forwards, then back automatically, so we have to alternate the thread direcction... Game.Nexus.flashThreadDir = true; } function NexusBase::objectiveInit(%data, %object) { Game.NexusBase = %object; Game.NexusBase.playthread(0, "ambient"); Game.NexusBase.setThreadDir(0, true); } function NexusCap::objectiveInit(%data, %object) { Game.NexusCap = %object; Game.NexusCap.playthread(0, "ambient"); Game.NexusCap.setThreadDir(0, true); } }; //exec the AI scripts exec("scripts/aiTeamHunters.cs"); $InvBanList[TeamHunters, "TurretOutdoorDeployable"] = 1; $InvBanList[TeamHunters, "TurretIndoorDeployable"] = 1; $InvBanList[TeamHunters, "ElfBarrelPack"] = 1; $InvBanList[TeamHunters, "MortarBarrelPack"] = 1; $InvBanList[TeamHunters, "PlasmaBarrelPack"] = 1; $InvBanList[TeamHunters, "AABarrelPack"] = 1; $InvBanList[TeamHunters, "MissileBarrelPack"] = 1; $InvBanList[TeamHunters, "Mine"] = 1; //----------------------------------------------------------------------------- //Game initialization functions function TeamHuntersGame::missionLoadDone(%game) { //default version sets up teams - must be called first... DefaultGame::missionLoadDone(%game); $numRanked = 0; //initialize the score and flag count for all the players %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %client = ClientGroup.getObject(%i); %game.resetScore(%client); %client.flagCount = 1; } $TopClient = ""; $TopClientScore = 0; for(%j = 1; %j < (%game.numTeams + 1); %j++) $teamScore[%j] = 0; //create the Flag group $FlagGroup = nameToID("MissionCleanup/FlagGroup"); if ($FlagGroup <= 0) { $FlagGroup = new SimGroup("FlagGroup"); MissionCleanup.add($FlagGroup); } if(nameToId("HuntersYardSaleSet") <= 0) { $HuntersYardSaleSet = new SimSet("HuntersYardSaleSet"); MissionCleanup.add($HuntersYardSaleSet); } // make a game object for the Nexus (functions defined in HuntersGame.cs) MissionGroup.findNexus(); } function TeamHuntersGame::initGameVars(%game) { %game.SCORE_PER_SUICIDE = -1; %game.SCORE_PER_TEAMKILL = -1; %game.SCORE_PER_DEATH = -1; %game.SCORE_PER_KILL = 1; %game.SCORE_PER_TURRET_KILL = 1; %game.TeamMode = true; %game.GreedMode = $Host::TeamHuntersGreedMode; %game.GreedMinFlags = 8; //min number of flags you must have before you can cap %game.HoardMode = $Host::TeamHuntersHoardMode; %game.HoardStartTime = 5; //time left in the game at which hoard mode will start %game.HoardDuration = 3; //duration of the hoard period %game.HoardEndTime = %game.HoardStartTime - %game.HoardDuration; %game.yardSaleMin = 10; //make sure there is enough time in the match to actually have a hoard mode... if ($host::timeLimit < %game.hoardStartTime + 1) %game.hoardMode = false; //this is how many milliseconds before a warning is issued for camping near the Nexus %game.nexusCampingTime = 10000; //vars for how long before the flag is deleted, and the fade transition time... %game.flagLifeTimeMS = 120000; %game.fadeTimeMS = 2000; %game.flagMsgDelayMS = 3000; %game.oobThrowFlagsDelayMS = 3000; // targets for each of the flag types (except for base which is properly skinned already) HuntersFlag1.target = -1; // red HuntersFlag2.target = allocTarget("", 'Blue', "", "", 0, "", ""); HuntersFlag4.target = allocTarget("", 'Yellow', "", "", 0, "", ""); HuntersFlag8.target = allocTarget("", 'Green', "", "", 0, "", ""); } function TeamHuntersGame::allowsProtectedStatics(%game) { // prevent appropriate equipment from being damaged - invulnerable return true; } function TeamHuntersGame::setNexusDisabled(%game) { HuntersGame::setNexusDisabled(%game); } function TeamHuntersGame::setNexusEnabled(%game) { HuntersGame::setNexusEnabled(%game); } function TeamHuntersGame::flashNexus(%game) { HuntersGame::flashNexus(%game); } function TeamHuntersGame::NexusSparkEmitter(%game, %client, %cap, %numToScore) { HuntersGame::NexusSparkEmitter(%game, %client, %cap, %numToScore); } function TeamHuntersGame::resetScore(%game, %client) { %client.score = 0; %client.suicides = 0; %client.kills = 0; %client.teamKills = 0; %client.deaths = 0; } function TeamHuntersGame::recalcScore(%game, %cl) { if (%cl <= 0) return; %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); %cl.score = %killPoints; %cl.score += %cl.suicides * %game.SCORE_PER_SUICIDE; %cl.score = mFloor(%cl.score); //must send the message to update the HUD messageClient(%cl, 'MsgYourScoreIs', "", %cl.score); %game.recalcTeamRanks(%cl); } function TeamHuntersGame::startMatch(%game) { HuntersGame::startMatch(%game); } function TeamHuntersGame::setupHoardCountdown(%game) { HuntersGame::setupHoardCountdown(%game); } function TeamHuntersGame::notifyHoardStart(%game, %seconds) { HuntersGame::notifyHoardStart(%game, %seconds); } function TeamHuntersGame::notifyHoardEnd(%game, %seconds) { HuntersGame::notifyHoardEnd(%game, %seconds); } function TeamHuntersGame::updateHoardStatusHUD(%game) { HuntersGame::updateHoardStatusHUD(%game); } //----------------------------------------------------------------------------- //Player spawn/death functions function TeamHuntersGame::assignClientTeam(%game, %client) { DefaultGame::assignClientTeam(%game, %client); } function TeamHuntersGame::createPlayer(%game, %client, %spawnLoc) { HuntersGame::createPlayer(%game, %client, %spawnLoc); } function TeamHuntersGame::pickPlayerSpawn(%game, %client, %respawn) { return %game.pickTeamSpawn(%client.team); } function TeamHuntersGame::playerSpawned(%game, %player, %armor) { HuntersGame::playerSpawned(%game, %player, %armor); //reset the enemy damaged time %player.client.lastEnemyDamagedTime = 0; } function TeamHuntersGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %sourceObject) { //first call the default version DefaultGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %sourceObject); //now see if the attacker was an enemy if (isObject(%clAttacker) && %clAttacker.team != %clVictim.team) %clVictim.lastEnemyDamagedTime = getSimTime(); } function TeamHuntersGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement) { //set the flag %clVictim.isDead = true; //to prevent suiciders from dropping flags for their teammates - see if the player //has taken enemy damage within the last 20 seconds if ((%game.testSuicide(%clVictim, %clKiller, %damageType) || (isObject(%clKiller) && %clKiller.team == %clVictim.team)) && (getSimTime() - %clVictim.lastEnemyDamagedTime > 20000)) { %clVictim.flagCount--; } //first, drop all the flags HuntersGame::dropFlag(%game, %clVictim.player); //now call the default game stuff DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement); messageClient(%clVictim, 'MsgHuntYouHaveFlags', "", 0); } function TeamHuntersGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { if (%game.testKill(%clVictim, %clKiller)) //verify victim was an enemy { %game.awardScoreKill(%clKiller); %game.awardScoreDeath(%clVictim); } else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide %game.awardScoreSuicide(%clVictim); } function TeamHuntersGame::equip(%game, %player) { HuntersGame::equip(%game, %player); } function TeamHuntersGame::checkTimeLimit(%game) { HuntersGame::checkTimeLimit(%game); } function TeamHuntersGame::timeLimitReached(%game) { HuntersGame::timeLimitReached(%game); } function TeamHuntersGame::checkScoreLimit(%game, %team) { //no such thing as a score limit in Hunters } function TeamHuntersGame::scoreLimitReached(%game) { //no such thing as a score limit in Hunters } function TeamHuntersGame::clientMissionDropReady(%game, %client) { //%client.rank = ClientGroup.getCount(); messageClient(%client, 'MsgClientReady',"", %game.class); //messageClient(%client, 'MsgHuntModesSet', "", %game.GreedMode, %game.HoardMode); messageClient(%client, 'MsgHuntYouHaveFlags', "", 0); //%game.populateTeamRankArray(%client); //messageClient(%client, 'MsgHuntTeamRankIs', "", -1); for(%i = 1; %i <= %game.numTeams; %i++) messageClient(%client, 'MsgHuntAddTeam', "", %i, $TeamName[%i], $TeamScore[%i]); //messageClient(%client, 'MsgHuntGreedStatus', "", %game.GreedMode, %game.GreedMinFlags); //%curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); //messageClient(%client, 'MsgHuntHoardStatus', "", %game.HoardMode, $Host::TimeLimit, %curTimeLeftMS, %game.HoardStartTime, %game.HoardDuration); messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); DefaultGame::clientMissionDropReady(%game, %client); } function TeamHuntersGame::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 TeamHuntersGame::gameOver(%game) { //call the default DefaultGame::gameOver(%game); //send the winner message %winner = ""; if ($teamScore[1] > $teamScore[2]) %winner = $teamName[1]; else if ($teamScore[2] > $teamScore[1]) %winner = $teamName[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 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); cancel(%client.oobSched); } } function TeamHuntersGame::sendFlagCountMessage(%game, %client) { HuntersGame::sendFlagCountMessage(%game, %client); } function TeamHuntersGame::playerTouchFlag(%game, %player, %flag) { HuntersGame::playerTouchFlag(%game, %player, %flag); } function TeamHuntersGame::updateFlagHoarder(%game) { //in Team Hunters, no waypoint for the flag hoarder... } function TeamHuntersGame::hoardModeActive(%game, %wouldBeActive) { HuntersGame::hoardModeActive(%game, %wouldBeActive); } function TeamHuntersGame::playerDroppedFlag(%game, %player) { HuntersGame::playerDroppedFlag(%game, %player); } //----------------------------------------------------------------------------- //VOTING functions function TeamHuntersGame::sendGameVoteMenu( %game, %client, %key ) { // Don't send any options if a vote is already running: if ( %game.scheduleVote $= "" ) { // First send the common options: DefaultGame::sendGameVoteMenu( %game, %client, %key ); // Now send the Hunters-specific options: if ( %game.GreedMode ) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteGreedMode', 'disable greed mode', 'Disable GREED Mode' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteGreedMode', 'enable greed mode', 'Enable GREED Mode' ); if ( %game.HoardMode ) messageClient( %client, 'MsgVoteItem', "", %key, 'VoteHoardMode', 'disable hoard mode', 'Disable HOARD Mode' ); else messageClient( %client, 'MsgVoteItem', "", %key, 'VoteHoardMode', 'enable hoard mode', 'Enable HOARD Mode' ); } } function TeamHuntersGame::voteGreedMode( %game, %admin, %player ) { HuntersGame::voteGreedMode( %game, %admin, %player ); } function TeamHuntersGame::voteHoardMode( %game, %admin, %player ) { HuntersGame::voteHoardMode( %game, %admin, %player ); } function TeamHuntersGame::throwFlags(%game, %player) { HuntersGame::throwFlags(%game, %player); } function TeamHuntersGame::outOfBoundsThrowFlags(%game, %client) { HuntersGame::outOfBoundsThrowFlags(%game, %client); } function TeamHuntersGame::dropFlag(%game, %player) { HuntersGame::dropFlag(%game, %player); } function TeamHuntersGame::enterMissionArea(%game, %playerData, %player) { HuntersGame::enterMissionArea(%game, %playerData, %player); } function TeamHuntersGame::leaveMissionArea(%game, %playerData, %player) { HuntersGame::leaveMissionArea(%game, %playerData, %player); } function TeamHuntersGame::onEnterTrigger(%game, %triggerName, %data, %obj, %colobj) { HuntersGame::onEnterTrigger(%game, %triggerName, %data, %obj, %colobj); } function TeamHuntersGame::onLeaveTrigger(%game, %triggerName, %data, %obj, %colobj) { HuntersGame::onLeaveTrigger(%game, %triggerName, %data, %obj, %colobj); } function TeamHuntersGame::CampingDamage(%game, %client, %firstWarning) { HuntersGame::CampingDamage(%game, %client, %firstWarning); } function TeamHuntersGame::updateScoreHud(%game, %client, %tag) { messageClient( %client, 'ClearHud', "", %tag, 0 ); // Send header: messageClient( %client, 'SetScoreHudHeader', "", '\t%1%2\t%3%4', $teamName[1], $teamScore[1], $teamName[2], $teamScore[2] ); // Send subheader: messageClient( %client, 'SetScoreHudSubheader', "", '\tPLAYER (%1)SCOREFLAGS\tPLAYER (%2)SCOREFLAGS', $TeamRank[1, count], $TeamRank[2, count] ); //find out who on each team has the most flags %team1ClientMostFlags = -1; %team1ClientMostFlagsCount = -1; for (%i = 0; %i < $TeamRank[1, count]; %i++) { %cl = $TeamRank[1, %i]; if (%cl.flagCount > %team1ClientMostFlagsCount) { %team1ClientMostFlagsCount = %cl.flagCount; %team1ClientMostFlags = %cl; } } if (%team1ClientMostFlagsCount <= 1) %team1ClientMostFlags = -1; %team2ClientMostFlags = -1; %team2ClientMostFlagsCount = -1; for (%i = 0; %i < $TeamRank[2, count]; %i++) { %cl = $TeamRank[2, %i]; if (%cl.flagCount > %team2ClientMostFlagsCount) { %team2ClientMostFlagsCount = %cl.flagCount; %team2ClientMostFlags = %cl; } } if (%team2ClientMostFlagsCount <= 1) %team2ClientMostFlags = -1; %index = 0; while (true) { if (%index >= $TeamRank[1, count] && %index >= $TeamRank[2, count]) break; //get the team1 client info %team1Client = ""; %team1ClientScore = ""; %team1ClientFlags = ""; %col1Style = ""; if (%index < $TeamRank[1, count]) { %team1Client = $TeamRank[1, %index]; %team1ClientScore = %team1Client.score $= "" ? 0 : %team1Client.score; %team1ClientFlags = %team1Client.flagCount - 1; if (%team1ClientFlags <= 0) %team1ClientFlags = ""; if ( %team1Client == %team1ClientMostFlags ) %col1Style = ""; else if ( %team1Client == %client ) %col1Style = ""; } //get the team2 client info %team2Client = ""; %team2ClientScore = ""; %team2ClientFlags = ""; %col2Style = ""; if (%index < $TeamRank[2, count]) { %team2Client = $TeamRank[2, %index]; %team2ClientScore = %team2Client.score $= "" ? 0 : %team2Client.score; %team2ClientFlags = %team2Client.flagCount - 1; if (%team2ClientFlags <= 0) %team2ClientFlags = ""; if ( %team2Client == %team2ClientMostFlags ) %col2Style = ""; else if ( %team2Client == %client ) %col2Style = ""; } //if the client is not an observer, send the message if (%client.team != 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3\t%8%4%5%6', %team1Client.name, %team1ClientScore, %team1ClientFlags, %team2Client.name, %team2ClientScore, %team2ClientFlags, %col1Style, %col2Style ); } //else for observers, create an anchor around the player name so they can be observed else { //this is lame, but we can only have up to %9 args if (%team2Client == %team2ClientMostFlags) { messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3\t%4%5%6', %team1Client.name, %team1ClientScore, %team1ClientFlags, %team2Client.name, %team2ClientScore, %team2ClientFlags, %col1Style, %team1Client, %team2Client ); } else if (%team2Client == %client) { messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3\t%4%5%6', %team1Client.name, %team1ClientScore, %team1ClientFlags, %team2Client.name, %team2ClientScore, %team2ClientFlags, %col1Style, %team1Client, %team2Client ); } else { messageClient( %client, 'SetLineHud', "", %tag, %index, '%7\t%1%2%3\t%4%5%6', %team1Client.name, %team1ClientScore, %team1ClientFlags, %team2Client.name, %team2ClientScore, %team2ClientFlags, %col1Style, %team1Client, %team2Client ); } } %index++; } // Tack on the list of observers: %observerCount = 0; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team == 0) %observerCount++; } if (%observerCount > 0) { messageClient( %client, 'SetLineHud', "", %tag, %index, ""); %index++; messageClient(%client, 'SetLineHud', "", %tag, %index, '\tOBSERVERS (%1)TIME', %observerCount); %index++; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); //if this is an observer if (%cl.team == 0) { %obsTime = getSimTime() - %cl.observerStartTime; %obsTimeStr = %game.formatTime(%obsTime, false); messageClient( %client, 'SetLineHud', "", %tag, %index, '\t%1%2', %cl.name, %obsTimeStr ); %index++; } } } //clear the rest of Hud so we don't get old lines hanging around... messageClient( %client, 'ClearHud', "", %tag, %index ); } PK !(ްscripts/Training1.cs// don't want this executing when building graphs if($OFFLINE_NAV_BUILD) return; // Script for mission 1 //=================================================================================== //error("Training 1 script"); // package and callbacks activatePackage(Training1); addMessageCallback('MsgWeaponMount', playerMountWeapon); datablock EffectProfile(HudFlashEffect) { effectname = "gui/buttonOver"; minDistance = 10; }; // additional mission Audio datablock AudioProfile(HudFlashSound) { filename = "gui/buttonover.wav"; description = AudioDefault3d; preload = true; effect = HudFlashEffect; }; // additional mission Audio datablock AudioProfile(HeartbeatSound) { filename = "fx/misc/heartbeat.wav"; description = Audio2D; preload = true; looping = false; }; // variables $numberOfEnemies[1] = 7; $numberOfEnemies[2] = 10; $numberOfEnemies[3] = 14; $numberOfTeammates = 2; $missionBotSkill[1] = 0.0; $missionBotSkill[2] = 0.4; $missionBotSkill[3] = 0.7; //------------------------------------------------------------------------------ function getTeammateGlobals() { $TeammateWarnom0 = "WildSide"; $teammateskill0 = 0.5; $teammateVoice0 = Male3; $teammateEquipment0 = 0; $teammateGender0 = Male; $TeammateWarnom1 = "Proteus"; $teammateSkill1 = 0.5; $teammateVoice1 = Male4; $teammateEquipment1 = 0; $teammateGender1 = Male; } $victimSet[1] = "0 7 10 11"; $victimSet[2] = "1 8 12"; $victimSet[3] = "2 9 13"; package Training1 { //BEGIN TRAINING1 PACKAGE ======================================================================= //------------------------------------------------------------------------------ function SinglePlayerGame::initGameVars(%game) { echo("initializing training1 game vars"); %game.pilotName = "McWatt"; %game.bombardierName = "Yossarian"; %game.tower = nameToId("Tower"); %game.tower.threshold1 = 330; %game.tower.threshold2 = 80; } //scriptlet //we have to jump through a lot of hoops to get those dead bodies in training1 function deadArmor::onAdd(%this, %obj) { %skin = (%obj.trainingSkin == 1 ? 'swolf' : 'beagle'); //echo("skin = " SPC %skin); createTarget(%obj, 'Dead Body', %skin, "", 'deadArmor', 0); } function deadArmor::onRemove(%this, %obj) { //echo("singleplayerGame -- deadArmor::onRemove"); freeTarget(%obj.getTarget()); } function MP3Audio::play(%this) { //too bad...no mp3 in training } function countTurretsAllowed(%type) { return $TeamDeployableMax[%type]; } function toggleScoreScreen(%val) { if ( %val ) //error("No Score Screen in training......."); messageClient($player, 0, $player.miscMsg[noScoreScreen]); } function toggleCommanderMap(%val) { if ( %val ) messageClient($player, 0, $player.miscMsg[noCC]); } function toggleTaskListDlg( %val ) { if ( %val ) messageClient( $player, 0, $player.miscMsg[noTaskListDlg] ); } function toggleInventoryHud( %val ) { if ( %val ) messageClient( $player, 0, $player.miscMsg[noInventoryHUD] ); } function toggleNetDisplayHud( %val ) { // Hello, McFly? This is training! There's no net in training! } function voiceCapture( %val ) { // Uh, who do you think you are talking to? } function giveall() { error("When the going gets tough...wussies like you start cheating!"); messageClient($player, 0, "Cheating eh? What\'s next? Camping?"); } function kobayashi_maru() { $testCheats = true; commandToServer('giveAll'); } // get the ball rolling //------------------------------------------------------------------------------ function startCurrentMission() { playGui.add(outerChatHud); //fade up from black ServerConnection.setBlackOut(true, 0); //can't change settings during the intro... SinglePlayerEscSettingsBtn.setActive(0); updateTrainingObjectiveHud(obj1); setTeammatesCMapInvisible(true); $teammate0.player.invincible = true; $teammate1.player.invincible = true; resetWildcat(); } //------------------------------------------------------------------------------ function SinglePlayerGame::equip(%game, %player) { //ya start with nothing...NOTHING! %player.clearInventory(); for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); %set = %player.client.equipment; //error("equping Player "@%player@" with set"@%set); switch (%set) { case 0: echo("using default equipment"); %player.setArmor("Light"); %player.setInventory(RepairKit,1); %player.setInventory(Blaster,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.weaponCount = 3; %player.use(Disc); case 1: echo("using case 1 equipment"); %player.setArmor("Light"); %player.setInventory(RepairKit,1); %player.setInventory(Blaster,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.setInventory(EnergyPack, 1); %player.weaponCount = 3; case 2: %player.setArmor(Heavy); //%player.setInventory(CloakingPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,6); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 25); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 20); %player.setInventory(ElfGun, 1); %player.setInventory(MissileLauncher,1); %player.setInventory(MissileLauncherAmmo, 10); %player.setInventory(TargetingLaser, 1); %player.weaponCount = 4; %player.use(Disc); } } // Objectives //================================================================================= //------------------------------------------------------------------------------ function openingSpiel() { //schedule(11000, 0, updateTrainingObjectiveHud, obj2); doText(T1_01); doText(T1_01a); doText(T1_01b); doText(T1_01c); doText(T1_02); doText(T1_02a); doText(T1_03); doText(T1_download01); doText(T1_03a); doText(T1_03b, 1000); doText(T1_03c, 1000); doText(T1_17, 700); doText(T1_04, 3000); doText(T1_05, 3000); doText(T1_06); doText(T1_tipEnergy); doText(T1_08, 2500); doText(T1_09, 4000); doText(T1_10, 1000); doText(T1_11); doText(T1_10a); doText(T1_10b); } //------------------------------------------------------------------------------ function hurryPlayerUp() { doText(Any_abortwarn); $player.hurryUp = schedule(45000, $player.player, DoText, Any_abort); } // vehicle: vehicle controls, destination //------------------------------------------------------------------------------ function clientCmdVehicleMount() { parent::clientCmdVehicleMount(); game.respawnPoint = 3; //order chasers to attack (chasers are enemies 3 - 6) if(!game.mountVehicle){ game.mountVehicle = true; //doText(T1_28); doText(T1_29); doText(T1_29a); doText(Any_Waypoint03); // and waypoint to MPB setWaypointAt(nameToId(MPB).position, "Extraction Team"); updateTrainingObjectiveHud(obj5); // for now for( %x = 3; %x <= 6; %x++ ) if($enemy[%x].player) $enemy[%x].stepEngage($player); } } //------------------------------------------------------------------------------ function SniperRifle::onCollision(%data,%obj, %col) { //echo("Sniper Rifle Collision"); if(!game.msgSniperNoPickup && $player.player.weaponCount >= 3) { game.msgSniperNoPickup = true; clearQueue(); doText(T1_24); //doText(T1_24a); } else if(!game.msgSniperPickUp && $player.player.weaponcount < 3) { game.msgSniperPickUp = true; game.msgSniperNoPickup = true; clearQueue(); doText(T1_TipSniper02); } ItemData::onCollision(%data,%obj,%col); } //------------------------------------------------------------------------------ function RepairPatch::onCollision(%data,%obj,%col) { parent::onCollision(%data,%obj,%col); if(game.repair++ != 3) return; if(%col == $player.player && !game.gotRepairKit) { game.gotRepairKit = true; if(!game.blowOff){ moveMap.push(); //jic doText(T1_12a); spiel2(); } } } //------------------------------------------------------------------------------ function EnergyPack::onCollision(%data,%obj,%col) { parent::onCollision(%data,%obj,%col); if (!game.EnergyPackPickup) { game.EnergyPackPickup = true; clearQueue(); doText(T1_tipPack01); doText(T1_tipPack02); } } //------------------------------------------------------------------------------ function playerMountWeapon(%tag, %text, %image, %player, %slot) { if( game.firstTime++ < 2) return; // initial weapon mount doesnt count //echo("the problem is the image name: "@%image.getName()); if(%image.getName() $= "BlasterImage" && !game.msgBlast) { game.msgBlast = true; //doText(T1_TipBlaster01); } if(%image.getName() $= "ChaingunImage" && !game.msgChain) { game.msgchain = true; //doText(T1_TipChaingun); } if(%image.getName() $= "DiscImage" && !game.msgDisc) { game.msgDisc = true; //doText(T1_TipSpinfusor); } if(%image.getName() $= "SniperRifleImage" && !game.msgSnipe) { game.msgSnipe = true; doText(T1_TipSniper03); doText(T1_TipSniper04); } } //------------------------------------------------------------------------------ function WeaponImage::onMount(%this,%obj,%slot) { messageClient(%obj.client, 'MsgWeaponMount', "", %this, %obj, %slot); parent::onMount(%this,%obj,%slot); } //------------------------------------------------------------------------------ function spawnSinglePlayer() { resetWildCat(); parent::spawnSinglePlayer(); } //------------------------------------------------------------------------------ function resetWildCat() { if(isObject($player.vehicle)) $player.vehicle.delete(); $player.vehicle = new HoverVehicle(hoverBike) { position = nameToId(hoverBikeDP).position; rotation = "0.200891 0.091345 0.975346 17.3161"; scale = "1 1 1"; dataBlock = "scoutVehicle"; }; } //------------------------------------------------------------------------------ function spiel2() { game.respawnPoint = 1; //moveMap.bindCmd( keyboard, "backspace", "", "skipWeaponsCheck();" ); clearQueue(); cancel($player.hurryUp); $player.currentWaypoint.delete(); //? doText(T1_12b); doText(T1_TipIFF); doText(T1_13); doText(T1_14); doText(T1_TipBlaster01); doText(T1_15); doText(T1_TipChaingun); doText(T1_16); doText(T1_TipSpinfusor); //doText(T1_17); //doText(T1_TipBlaster02); //doText(T1_TipJets02); //doText(T1_18a); doText(T1_22); doText(T1_22a); doText(T1_18, 5000); doText(ANY_tipNow01); doText(T1_tipjets01); } function singlePlayerGame::onAIRespawn(%game, %client) { // DONT add the default tasks //error("default tasks not added"); } //------------------------------------------------------------------------------ function missionClientKilled(%victim, %killer) { // this is just a bit messy as I added the training difficulty stuff late %skill = $pref::trainingDifficulty; if(%victim == $player) { //error("Player victim re engagement"); for(%i = 0; %i < clientGroup.getCount(); %i++) { %client = clientGroup.getObject(%i); if(%client.isAIControlled()) if(%client.getStepName() $= "AIStepEngage") { %client.shouldEngageOnPlayerRespawn = true; //error(%client.name SPC " should Engage On Player Respawn."); } } } if(%victim.team != $player.team && %skill < 3) schedule(3000, $player.player, adviseHealthKit); %setDestroyed = checkForSequenceSkillCompletion(%victim); switch(%setDestroyed) { case 1: doText(ANY_Kudo04, 3000); doText(T1_21); //doText(T1_22); //doText(ANY_tipscavenge02, 1000); doText(ANY_tipscavenge01); case 2: doText(ANY_Kudo01, 3000); game.EngagingEnemy1 = false; doText(T1_26); $enemy2.stepEngage($player); $enemy2.clientDetected($player); if(%skill > 1) { $enemy9.stepEngage($player); $enemy9.clientDetected($player); } if(%skill > 2) { $enemy13.stepEngage($player); $enemy13.clientDetected($player); } if(%skill == 0) { //the first test of this went so well we're doing it again %target = $enemy2.player.getTarget(); %mask = getTargetAlwaysVisMask(%target); setTargetAlwaysVisMask(%target, %mask |(1<<1)); } case 3 : doText(T1_27a); doText(T1_27b, 1000); doText(T1_28, 5000); doText(Any_TipSkiing); schedule(9000, game, setWaypointAt, nameToId($player.vehicle).getTransform(), "Vehicle" ); updateTrainingObjectiveHud(obj6); setTeammatesCMapInvisible(false); } } //------------------------------------------------------------------------------ function adviseHealthKit() { if(game.trainingIntro) return; if($player.player.getdamageLevel() > 0.3 && $player.player.getInventory(RepairKit) && game.useHeath++ < 4) { doText(Any_HealthKit); } } function checkForSequenceSkillCompletion(%victim) { %set = findVictimSet(%victim); //how is everbody esle in the set doing for(%i = 0; %i < getWordCount($victimSet[%set]); %i++){ %enemy = getWord($victimSet[%set], %i); if($enemy[%enemy] && $enemy[%enemy].player && $enemy[%enemy] != %victim) { //error("There is $Enemy"@%enemy@" still in set "@ %set); return 0; } } return %set; } function findVictimSet(%victim) { for(%i = 1; %i <= 3; %i++) { for(%word = 0; %word < getWordCount($victimSet[%i]); %word++) { %num = getWord($victimSet[%i], %word); if($enemy[%num] == %victim) { //error("Victim is member of victim set "@%i); return %i; } } } return 0; } // hokay...we have gone away from the default ai so we have to keep our forced-task // AI system intact. If the player is killed the AI will forget about him. // Lets iterate throught the client group and find out who should re-engage the player // %client.shouldEngageOnPlayerRespawn is set in missionClientKilled function singlePlayerGame::playerSpawned(%game, %player) { parent::playerSpawned(%game, %player); if(%player.client == $player) { for(%i = 0; %i < clientGroup.getCount(); %i++) { %client = clientGroup.getObject(%i); if(%client.isAIControlled()) if(%client.shouldEngageOnPlayerRespawn) { //error(%client.name SPC " is re-engaging."); %client.stepEngage($player); } } } } //------------------------------------------------------------------------------ function singlePlayerGame::gameOver(%game) { //enable the voice chat menu again... if (isObject(training1BlockMap)) { training1BlockMap.pop(); training1BlockMap.delete(); } //moveMap.bindCmd( keyboard, "backspace", "", game.returnBinding ); //allow the observer cam to move again... $Camera::movementSpeed = 40; $AIDisableChatResponse = ""; cancel($Training1Blackout); cancel($Training1HitGround); LightMaleHumanArmor.minImpactSpeed = 45; $player.player.mountVehicle = true; if(HelpTextGui.isVisible()) helpTextGui.setVisible(false); //re-enable the use of the settings button... SinglePlayerEscSettingsBtn.setActive(1); Parent::gameOver(); } function autoToggleHelpHud(%state) { if(HelpTextGui.isVisible() != %state) toggleHelpText(); } //------------------------------------------------------------------------------ function skipIntroCinematic() { messageClient($player, 0, "Skipping intro..."); clearQueue(); trainingIntroFlightEnd(); } function skipFlashingHud() { messageClient($player, 0, "Skipping HUD tutorial..."); clearQueue(); moveMap.push(); spiel2(); } function skipWeaponsCheck() { messageClient($player, 0, "Skipping weapons tutorial...."); clearQueue(); doText(Any_blowOff3); setWaypointAt(nameToId(Tower).position, "Tower"); updateTrainingObjectiveHud(obj4); queEnemySet(0); //moveMap.bindCmd( keyboard, "backspace", "", game.returnBinding ); } //------------------------------------------------------------------------------ function objectiveDistanceChecks() { %playerPosition = $player.player.getTransform(); if(!%playerPosition) { $player.distanceCheckSchedule = schedule(5000, game, objectiveDistanceChecks); return; } %base1distance = vectorDist( %playerPosition, game.tower.position ); //error("debug distance: tower- "@%base1distance); if(%base1distance < game.tower.threshold1 && !game.base1t1 ) { game.base1t1 = true; if(!$enemy0.dead) { $enemy0.stepEngage($player); %skill = $pref::trainingDifficulty; if(%skill > 1) $enemy7.stepEngage($player); if(%skill > 2) { $enemy10.stepEngage($player); $enemy11.stepEngage($player); } clearQueue(); doText(Any_Blowoff1); } else { doText(ANY_tipNow02); doText(T1_tipSkiing01); doText(T1_tipSkiing02); doText(T1_tipSkiing03); } } if(%base1distance < game.tower.threshold2) { if(!game.base1t2) { game.respawnPoint = 2; doText(T1_23); doText(T1_23a); doText(T1_23b); schedule(45000, game, queEnemySet, 1); } game.base1t2++; } //MPB %mpbDist = vectorDist( %playerPosition, nameToId(MPB).position ); //echo("debug distance: mpb- "@%mpbdist); if(%mpbDist < 70 && !game.completed) { game.completed = true; clearQueue(); doText(T1_30, true); $player.vehicle.setFrozenState(true); missionComplete($player.miscMsg[training1win]); } $player.distanceCheckSchedule = schedule(1000, game, objectiveDistanceChecks); } //------------------------------------------------------------------------------ function queEnemySet(%set) { switch(%set) { case 0: %skill = $pref::trainingDifficulty; if($enemy0.player) { $enemy0.stepEngage($player); } if(%skill > 1 && $enemy7.player) $enemy7.stepEngage($player); if(%skill > 2 && $enemy10.player) { $enemy10.stepEngage($player); } if(%skill > 2 && $enemy11.player) { $enemy11.stepEngage($player); } case 1: doText(T1_25); doText(T1_25a); doText(T1_tipTactics); $enemy1.stepEngage($player); $enemy1.clientDetected($player); %skill = $pref::trainingDifficulty; //messageClient($player, 0, "Debug:"SPC $enemy1 SPC "has just been issued an engage order for" SPC $player); if(%skill > 1) $enemy8.stepEngage($player); $enemy8.clientDetected($player); if(%skill > 2) { $enemy12.stepEngage($player); $enemy12.clientDetected($player); } game.engagingEnemy1 = true; updateTrainingObjectiveHud(obj3); //we are going to try some tricky 0000 to make this enemy always visible to sensors %target = $enemy1.player.getTarget(); %mask = getTargetAlwaysVisMask(%target); setTargetAlwaysVisMask(%target, %mask |(1<<1)); } } // Training specific functions //----------------------------------------------------------------------------- function lockArmorHack() { updateTrainingObjectiveHud(obj2); movemap.pop(); //$player.player.setMoveState(true); //$player.player.schedule(1000,"setMoveState", false); } // yes all thes flashSomethings() couldve been done as one function like I did in training4 //------------------------------------------------------------------------------ function flashEnergy() { %time = 1000; %num = 6; for(%i=0; %i<%num; %i++) { if (!isPureServer()) { schedule(%time*%i, $player.player, "eval", "energyHud.setVisible(false);" ); schedule(%time*%i + %time/2, $player.player, "eval", "energyHud.setVisible(true);" ); } else { schedule(%time*%i, $player.player, toggleEnergyHudVis, false); schedule(%time*%i + %time/2, $player.player, toggleEnergyHudVis, true); } $player.schedule(%time*%i, "play2d", HudFlashSound); } } function toggleEnergyHudVis(%value) { energyHud.setVisible(%value); } //------------------------------------------------------------------------------ function flashHealth() { %time = 900; %num = 5; for(%i=0; %i<%num; %i++) { if (!isPureServer()) { schedule( %time*%i, $player.player, "eval", "damageHud.setVisible(false);"); schedule(%time*%i + %time/2, $player.player, "eval", "damageHud.setVisible(true);"); } else { schedule( %time*%i, $player.player, toggleDamageHudVis, false); schedule(%time*%i + %time/2, $player.player, toggleDamageHudVis, true); } $player.schedule(%time*%i, "play2d", HudFlashSound); } } function toggleDamageHudVis(%value) { damageHud.setVisible(%value); } //------------------------------------------------------------------------------ function flashWeapon(%slot) { schedule(300, $player.player, use, $WeaponNames[%slot]); %time = 1000; %num = 6; for(%i=0; %i<%num; %i++) { if (!isPureServer()) { schedule(%time*%i, $player.player, "eval", "weaponsHud.setActiveWeapon(-1);"); schedule(%time*%i + %time/2, $player.player, "eval", "weaponsHud.setActiveWeapon("@%slot@");"); } else { schedule(%time*%i, $player.player, toggleWeaponSlot, -1); schedule(%time*%i + %time/2, $player.player, toggleWeaponSlot, %slot); } $player.schedule(%time*%i, "play2d", HudFlashSound); } } function toggleWeaponSlot(%slot) { weaponsHud.setActiveWeapon(%slot); } //------------------------------------------------------------------------------ function flashWeaponsHud() { %time = 1000; %num = 6; for(%i=0; %i<%num; %i++) { if (!isPureServer()) { schedule( %time*%i, $player.player, "eval", "weaponsHud.setVisible(false);"); schedule(%time*%i + %time/2, $player.player, "eval", "weaponsHud.setVisible(true);"); } else { schedule( %time*%i, $player.player, toggleWeaponHudVis, false); schedule(%time*%i + %time/2, $player.player, toggleWeaponHudVis, true); } $player.schedule(%time*%i, "play2d", HudFlashSound); } } function toggleWeaponHudVis(%value) { weaponsHud.setVisible(%value); } //------------------------------------------------------------------------------ function flashCompass() { %time = 900; %num = 5; for(%i=0; %i<%num; %i++) { if (!isPureServer()) { schedule(%time*%i, $player.player, "eval", "HudCompassBack.setVisible(false);"); schedule(%time*%i, $player.player, "eval", "compass.setVisible(false);"); schedule(%time*%i + %time/2, $player.player, "eval", "HudCompassBack.setVisible(true);"); schedule(%time*%i + %time/2, $player.player, "eval", "compass.setVisible(true);"); } else { schedule(%time*%i, $player.player, toggleCompassVis, false); schedule(%time*%i + %time/2, $player.player, toggleCompassVis, true); } $player.schedule(%time*%i, "play2d", HudFlashSound); } } function toggleCompassVis(%value) { HudCompassBack.setVisible(%value); compass.setVisible(%value); } //------------------------------------------------------------------------------ function flashInventory() { %time = 1000; %num = 6; for(%i=0; %i<%num; %i++) { if (!isPureServer()) { schedule(%time*%i, $player.player, "eval", "inventoryHud.setVisible(false);"); schedule(%time*%i + %time/2, $player.player, "eval", "inventoryHud.setVisible(true);"); } else { schedule(%time*%i, $player.player, toggleInvVis, false); schedule(%time*%i + %time/2, $player.player, toggleInvVis, true); } $player.schedule(%time*%i, "play2d", HudFlashSound); } } function toggleInvVis(%value) { inventoryHud.setVisible(%value); } //------------------------------------------------------------------------------ function flashPack() { %time = 1000; %num = 6; for(%i=0; %i<%num; %i++) { if (!isPureServer()) { schedule(%time*%i, $player.player, "eval", "backPackFrame.setVisible(false);"); schedule(%time*%i + %time/2, $player.player, "eval", "backPackFrame.setVisible(true);"); } else { schedule(%time*%i, $player.player, togglePackVis, false); schedule(%time*%i + %time/2, $player.player, togglePackVis, true); } $player.schedule(%time*%i, "play2d", HudFlashSound); } } function togglePackVis(%value) { backPackFrame.setVisible(%value); } //------------------------------------------------------------------------------ function flashSensor() { %time = 1000; %num = 6; for(%i=0; %i<%num; %i++) { if (!isPureServer()) { schedule(%time*%i, $player.player, "eval", "sensorHudBack.setVisible(false);"); schedule(%time*%i + %time/2, $player.player, "eval", "sensorHudBack.setVisible(true);"); } else { schedule(%time*%i, $player.player, toggleSensorVis, false); schedule(%time*%i + %time/2, $player.player, toggleSensorVis, true); } $player.schedule(%time*%i, "play2d", HudFlashSound); } } function toggleSensorVis(%value) { sensorHudBack.setVisible(%value); } //------------------------------------------------------------------------------ function flashMessage() { %time = 1000; %num = 6; for(%i=0; %i<%num; %i++) { if (!isPureServer()) { schedule(%time*%i, $player.player, "eval", "outerChatHud.setVisible(false);"); schedule(%time*%i + %time/2, $player.player, "eval", "outerChatHud.setVisible(true);"); } else { schedule(%time*%i, $player.player, toggleMessageVis, false); schedule(%time*%i + %time/2, $player.player, toggleMessageVis, true); } $player.schedule(%time*%i, "play2d", HudFlashSound); } } function toggleMessageVis(%value) { outerChatHud.setVisible(%value); } //------------------------------------------------------------------------------ function flashObjective() { %time = 1000; %num = 6; for(%i=0; %i<%num; %i++) { if (!isPureServer()) { schedule(%time*%i, $player.player, "eval", "objectiveHud.setVisible(false);"); schedule(%time*%i + %time/2, $player.player, "eval", "objectiveHud.setVisible(true);"); } else { schedule(%time*%i, $player.player, toggleObjectiveHudVis, false); schedule(%time*%i + %time/2, $player.player, toggleObjectiveHudVis, true); } $player.schedule(%time*%i, "play2d", HudFlashSound); } } function toggleObjectiveHudVis(%value) { objectiveHud.setVisible(%value); } //------------------------------------------------------------------------------ // function playCinematicSound(%sound) // { // switch$(%sound) // { // case "MissileLock": // %file = "fx/weapons/missile_launcher_lock.wav"; // %looping = true; // // case "Heartbeat": // %file = "fx/misc/heartbeat.wav"; // %looping = false; // } // // %audiosound = new AudioEmitter() { // filename = %flie; // position = $player.player; // volume = "1"; // isLooping = %looping; // is3D = false; // type = "EffectAudioType"; // }; // $player.currentSound = %audiosound; // } // // function playCinematicMissileLockSound() // { // %audiosound = new AudioEmitter() { // filename = "fx/weapons/missile_launcher_lock.wav"; // position = $player.player; // volume = "1"; // isLooping = "1"; // is3D = false; // type = "EffectAudioType"; // }; // $player.missileSound = %audiosound; // } //------------------------------------------------------------------------------ function setTeammatesCMapInvisible(%on) { %arg = (%on ? 0xffffffff : 0); setTargetNeverVisMask(nameToId(MPB).getTarget(), %arg); setTargetNeverVisMask($teammate0.player.getTarget(), %arg); setTargetNeverVisMask($teammate1.player.getTarget(), %arg); } // Im gonna do a pseudo-cinematic here so bear with me //------------------------------------------------------------------------------ function beginTraining1Intro() { //error("beginning training intro.....wait for it.......now!"); //messageClient($player, 0, $player.miscMsg[skip]); //moveMap.bindCmd( keyboard, "backspace", "", "skipIntroCinematic();" ); //block the voice chat if (isObject(training1BlockMap)) training1BlockMap.delete(); new ActionMap(training1BlockMap); training1BlockMap.blockBind(moveMap, toggleMessageHud); training1BlockMap.blockBind(moveMap, TeamMessageHud); training1BlockMap.blockBind(moveMap, activateChatMenuHud); training1BlockMap.push(); //set the intro started bools $Camera::movementSpeed = 0; $AIDisableChatResponse = true; game.playedIntro = true; game.trainingIntro = true; //create the bomber %introFlyerObject = nameToId(introFlyerDP); $player.flyer = new FlyingVehicle(Flyer) { position = %introFlyerObject.position; rotation = %introFlyerObject.rotation; scale = "1 1 1"; dataBlock = "BomberFlyer"; }; // create, spawn, set the skin, and equip the pilot //------------------------------------------------------------ %pilot = aiConnect(game.pilotName,$playerTeam, 0, 0, "Male1", 1.0); $player.flyer.pilot = %pilot; setTargetSkin(%pilot.target, $teamSkin[$playerTeam]); %pilot.player.setArmor(light); //mount the pilot %pilot.pilotVehicle = false; //%pilot.stepMove($player.flyer.position, 0.25, 4); $player.flyer.mountObject(%pilot.player, 0); %pilot.setControlObject($player.flyer); %pilot.setPilotPitchRange(-0.2, 0.05, 0.05); // create and mount the bomber //------------------------------------------------------------ %bombardier = aiConnect(game.bombardierName, $playerTeam, 0, 0, "Male2", 1.0); $player.flyer.bombardier = %bombardier; setTargetSkin(%bombardier.target, $teamSkin[$playerTeam]); %bombardier.player.setArmor(Medium); //not that you can tell //mount the bombardier //%bombardier.stepMove($player.flyer.position, 0.25, 4); $player.flyer.mountObject(%bombardier.player, 1); // and put the player in the tailgunners seat //------------------------------------------------------------ //it would be nice if the player was facing the same direction as the bomber to start $player.player.use(Blaster); $player.flyer.mountObject($player.player, 2); $player.player.setTransform($player.player.position SPC %introFlyerObject.rotation); // and set the camera to third person if($firstperson) toggleFirstPerson($player); $player.player.invincible = true; getTrainingPacifistMap(); trainingPacifistMap.push(); // add enemyMissile Laucher Dude %MLDude = aiConnect("Oksana Baiul", $enemyTeam); $missileLauncherDude = %MLDude; %MLDude.player.scopeToClient($player); %MLDude.player.setTransform(nameToID(MissileGuySpot).getTransform()); %MLDude.race = "Bioderm"; %MLDude.voice = "Derm2"; setTargetSkin(%MLDude.target, $teamSkin[$enemyTeam]); %MLDude.equipment = 2; game.equip(%MLDude.player); %MLDude.player.setArmor(%MLDude.armor); // then start the flyers move sequence %pilot.addTask(AITraining1Pilot); //fade up from black $Training1Blackout = ServerConnection.schedule(3000, setBlackOut, false, 4000); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function trainingIntroFlightEnd() { //enable the voice chat menu again... if (isObject(training1BlockMap)) { training1BlockMap.pop(); training1BlockMap.delete(); } //put the player back in his body, give him control back, //a little dramatic flash, start the rest of the mission $Camera::movementSpeed = 40; $AIDisableChatResponse = ""; game.trainingIntro = false; $player.player.invincible = false; $player.player.setDamageLevel(0.3); serverConnection.setBlackout(false, 5000); $player.player.setActionThread(cel1); $player.player.schedule(2000, use, Disc); trainingPacifistMap.pop(); commandToClient($player, 'toggleDashHud'); if(isObject($player.flyer)) cleanUpFlyer(); if(!$firstPerson) toggleFirstPerson($player); $player.player.setMoveState( false ); $player.player.setVelocity("0 0 0"); $player.player.setTransform(nameToId(DP).getTransform()); moveMap.push(); //$player.player.setDamageLevel(0.3); $player.T1OpeningSpielSchedule = schedule(10000, game, openingspiel); objectiveDistanceChecks(); //moveMap.bindCmd( keyboard, "backspace", "", "skipFlashingHud();" ); //re-enable the use of the settings button... SinglePlayerEscSettingsBtn.setActive(1); } //------------------------------------------------------------------------------ function ClientCmdSetHudMode(%mode, %type, %node) { parent::ClientCmdSetHudMode(%mode, %type, %node); getTrainingPacifistMap(); if(game.trainingIntro) trainingPacifistMap.push(); } //------------------------------------------------------------------------------ function PlayGui::onWake(%this) { parent::onWake(%this); //error("Waking training play gui"); // okay we know the victim...erm...player is looking // and we hope they have a body so lets do this if(!game.playedIntro) { game.PlayGuiAwake = true; checkForTraining1Intro(); } } function checkForTraining1Intro() { if(game.playGuiAwake && $player.player && $currentMission $= "Training1") beginTraining1Intro(); else { schedule(50, game, checkForTraining1Intro); } } //------------------------------------------------------------------------------ function Armor::AIonMount(%this, %obj, %vehicle, %node) { } function Armor::AIonUnMount(%this, %obj, %vehicle, %node) { } function AITraining1Pilot::assume(%task, %client) { %task.setWeightFreq(30); %task.setMonitorFreq(10); // //next, start the pilot on his way to mounting the vehicle // %client.pilotVehicle = true; // %client.stepMove($player.flyer.position, 0.25, $AIModeMountVehicle); } function AITraining1Pilot::weight(%task, %client) { %task.setWeight(10000); } function AITraining1Pilot::monitor(%task, %client) { //messageall(0, " AITraining1Pilot::monitor "@%task.locationIndex); %group = nameToId(FlightPath); if(!%task.locationIndex) %task.locationIndex = 0; //HACK ALERT!!! //since the path for this mission is completely straight, always head for the end of the path //%location = %group.getObject(%task.locationIndex); %location = %group.getObject(%group.getCount() - 1); //see if we've mounted yet if(%client.vehicleMounted) { %client.setPilotDestination(%location.position); //else see if we're close enough to the current destination to choose the next %pos = %client.vehicleMounted.position; %pos2D = getWord(%pos, 0) SPC getWord(%pos, 1) SPC "0"; %dest = %group.getObject(%task.locationIndex).position; %dest2D = getWord(%dest, 0) SPC getWord(%dest, 1) SPC "0"; if (VectorDist(%dest2D, %pos2D) < 20) { if(%group.getCount() > %task.locationIndex + 1) { %task.locationIndex++; cinematicEvent(%task.locationIndex); } //else messageAll(0, "Ride Over"); } } else %client.stepMove($player.flyer.position, 0.25, $AIModeExpress); } function cinematicEvent(%num) { //messageAll(0, "Doing Cinematic Event: "@%num); switch(%num) { case 1: doText(any_Warning02); case 2: if(!$firstPerson) toggleFirstPerson($player); movemap.schedule(6000, "pop"); case 3: moveMap.pop(); //error(nameToId(MissileCamera)); $player.camera.setTransform(nameToId(MissileCamera).getTransform()); commandToClient($player, 'toggleDashHud', false); cancel($player.altCheck); cancel($player.speedCheck); HideHudHack(false); toggleCamera(true); $MissileLauncherDude.player.use(MissileLauncher); case 4: ShoulderMissile.lifeTimeMs = 10000; $MissileLauncherAimTime = 600; MissileDudeAimAtTarget($missileLauncherDude, 0); schedule($MissileLauncherAimTime, 0, "MissileDudeFireMissile", $missileLauncherDude); case 7: if(game.gotMissile) turnPlayerToObject(game.gotMissile); else turnPlayerToObject($missileLauncherDude.player); toggleCamera(true); moveMap.push(); TrainingPacifistMap.push(); hideHudHack(true); // playCinematicSound("MissileLock"); schedule(5700, 0, forcedCinematicPlayerDismount); schedule( 6100, game, cleanUpFlyer); //schedule( 8000, game, trainingIntroFlightEnd); } } function forcedCinematicPlayerDismount() { $player.player.mountVehicle = false; $player.player.unmount(); %velocity = $player.player.getVelocity(); %velX = getWord(%velocity, 0); %velY = getWord(%velocity, 1); $player.player.setVelocity(%velX SPC %velY SPC "20"); $player.player.setMoveState( true ); $player.player.schedule(300, setDamageFlash, 0.3); playTargetAudio( $player.target, 'avo.deathCry_01', AudioClose3d, false ); $player.player.setActionThread(Death1, true); //$player.flyer.pilot.player.setActionThread(Death10, true); //$player.flyer.bombardier.player.setActionThread(Death11, true); if($firstPerson) toggleFirstPerson($player); LightMaleHumanArmor.minImpactSpeed = 10000; trainingPlayerHitGround(); Game.playGrunt = true; //game.expectingImpact = true; } function MissileDudeAimAtTarget(%client, %percent) { %group = nameToId(FlightPath); %endPos = %group.getObject(4).position; //calculate the start position %startTransform = nameToId(MissileGuySpot).getTransform(); %startDirection = MatrixMulVector("0 0 0 " @ getWords(%startTransform, 3, 6), "0 1 0"); %startDirection = VectorNormalize(%startDirection); %startPos = VectorAdd(getWords(%startTransform, 0, 2), VectorScale(%startDirection, 100)); //now calculate the aim position %vec = VectorSub(%endPos, %startPos); %length = VectorDist(%endPos, %startPos); %vec = VectorNormalize(%vec); %aimPos = VectorAdd(%startPos, VectorScale(%vec, %percent * %length)); //now aim the client there %client.aimAt(%aimPos, 2000); //schedule the next aim if (%percent <= 0.9) schedule($MissileLauncherAimTime / 10, 0, MissileDudeAimAtTarget, %client, %percent + 0.1); } function MissileDudeFireMissile(%Client) { %client.stop(); %client.clearStep(); %client.setEngageTarget(-1); %client.setTargetObject($player.flyer, 300, "Missile"); if (isDemo()) %wav = "fx/misc/derm2.woohoo.WAV"; else %wav = "voice/derm2/gbl.woohoo.WAV"; %audio = alxCreateSource( AudioChat, %wav ); alxPlay( %audio ); schedule(4000, 0, cinematicEvent, 7); } function turnPlayerToObject(%obj) { error("turningPlayerToObject: "@%obj); %vec = VectorSub($player.player.position, %obj.position); %angle = mATan( getWord(%vec, 0), getWord(%vec, 1) ); %angle = %angle + 3.141529; %newTransform = $player.player.position SPC "0 0 1" SPC %angle; $player.player.setTransform(%newTransform); } function cleanUpFlyer() { $player.flyer.applyDamage($player.Flyer.getDataBlock().maxDamage); $player.currentSound.delete(); $player.flyer.pilot.schedule(400, drop); $player.flyer.bombardier.schedule(1400, drop); $missileLauncherDude.drop(); } function training1Preloads() { navGraph.preload("skins/base.lbioderm", true); navGraph.preload("skins/Horde.lbioderm", false); navGraph.preload("skins/sensor_pulse_large", true); navGraph.preload("skins/base.hmale", true); navGraph.preload("skins/beagle.hmale", false); navGraph.preload("skins/base.mmale", true); navGraph.preload("skins/beagle.mmale", false); navGraph.preload("skins/base.lmale", false); navGraph.preload("skins/swolf.mmale", false); navGraph.preload("skins/beagle.lmale", false); } function MissileLauncherImage::onFire(%data,%obj,%slot) { %p = Parent::onFire(%data, %obj, %slot); if(!game.gotMissile) game.gotMissile = %p; } function SinglePlayerGame::missionLoadDone(%game) { Parent::missionLoadDone(%game); training1Preloads(); } function getTrainingPacifistMap() { new ActionMap(TrainingPacifistMap); // keys to rebind: // jump, fire, suicide, jet TrainingPacifistMap.blockBind( moveMap, jump ); TrainingPacifistMap.blockBind( moveMap, mouseFire ); TrainingPacifistMap.blockBind( moveMap, suicide ); TrainingPacifistMap.blockBind( moveMap, mouseJet ); //TrainingPacifistMap.push(); } // function Armor::onImpact(%data, %playerObject, %collidedObject, %vec, %vecLen) // { // error("ArmorOnImpact Called"); // echo(%playerObject); // if(%playerObject == $player.player && game.expectingImpact) { // game.expectingImpact = false; // messageClient($player, 'MsgTrainingHitGround', ""); // } // } function trainingPlayerHitGround() { //see if we're about to hit the ground //%mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType; %mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType; %rayStart = $Player.player.getWorldBoxCenter(); %rayEnd = getWord(%rayStart, 0) SPC getWord(%rayStart, 1) SPC getWord(%rayStart, 2) - 20; %foundObject = ContainerRayCast(%rayStart, %rayEnd, %mask, 0); if (!%foundObject) { $Training1HitGround = schedule(1, $player.player, trainingPlayerHitGround); return; } //play the grunt... if (Game.playGrunt) { Game.playGrunt = false; playTargetAudio($player.target, 'avo.grunt', AudioClose3d, false); } //make sure we hit within 8 to do the rest if (VectorDist(getWords(%foundObject, 1, 3), %rayStart) > 8) { $Training1HitGround = schedule(1, $player.player, trainingPlayerHitGround); return; } $player.player.mountVehicle = true; $player.player.setDamageFlash(0.5); serverConnection.setBlackout(true, 600); %heartBeatLengthMS = alxGetWaveLen("fx/misc/heartbeat.wav"); schedule(1000, Game, alxPlay, HeartBeatSound, 0, 0, 0); schedule(%heartBeatLengthMS, Game, trainingIntroFlightEnd); } function SinglePlayerGame::displayDeathMessages(%game, %clVictim, %clKiller, %damageType, %implement) { if(game.trainingIntro) return; else Parent::displayDeathMessages(%game, %clVictim, %clKiller, %damageType, %implement); } function serverCmdBuildClientTask(%client, %task, %team) { // player shouldnt be able to use the voice commands to do anything } function SinglePlayerEscapeDlg::returnToGame( %this ) { parent::returnToGame( %this ); if(game.trainingIntro) trainingPacifistMap.push(); } //END TRAINING1 PACKAGE======================================================================= }; PK !(9fscripts/Training2.cs// don't want this executing when building graphs if($OFFLINE_NAV_BUILD) return; // script for training mission 2 //------------------------------------------------------------- //init //------------------------------------------------------------- error("Running Mission 2 Script"); activatePackage(Training2); activatePackage(singlePlayerMissionAreaEnforce); $numberOfEnemies[1] = 6; $numberOfEnemies[2] = 8; $numberOfEnemies[3] = 11; //globals for base defense part $numberOfWaves[1] = 3; $numberOfWaves[2] = 4; $numberOfWaves[3] = 5; $numberInWave[1] = 2; $numberInWave[2] = 3; $numberInWave[3] = 5; $numberOfTeammates = 1; $missionBotSkill[1] = 0.0; $missionBotSkill[2] = 0.5; $missionBotSkill[3] = 0.9; $victimSet[1] = "0 1 6 8"; $victimSet[2] = "2 3 9"; $victimSet[3] = "4 5 7 10"; // Team $TeammateWarnom0 = "Dogkiller"; // mount plasma, missile launcher, targeting laser------------------- addMessageCallback('MsgWeaponMount', playerMountWeapon); // touch with pack on addMessageCallback('MsgItemCollisionHavePack', playerTouchItemHavePack); //repair initial pickup addMessageCallback('MsgPackPickup', playerPickUp); //repair self addMessageCallback('MsgRepairPackPlayerSelfRepair', playerRepairSelf); //repair nothing addMessageCallback('MsgRepairPackNoTarget', noRepair); //repair unpowered addMessageCallback('MsgRepairPackRepairingObj', ObjRepair); //enter inv station addMessageCallback('msgEnterInvStation', StationInvEnter); // shield pack //addMessageCallback('MsgShieldPackOn', playerTurnsOnShield); package training2 { //--Training2 package begin ----------------------------------------------------------------- function SinglePlayerGame::initGameVars(%game) { // for many of the objectives we are going to periodically // check the players distance vs some object // you could do this much prettier but its going to be very specific // so a cut and paste eyesore will be fine echo("initializing training2 game vars"); %game.sensor = nameToID("MissionGroup/Teams/team2/base1/initialPulseSensor"); %game.base1 = nameToID("MissionGroup/Teams/team2/base1/base"); %game.base1.threshold1 = 240; %game.base1.threshold2 = 190; %game.base2 = nameToID("MissionGroup/Teams/team2/base2/base"); %game.base2.threshold1 = 300; %game.base2.threshold2 = 250; %game.base3 = nameToID("MissionGroup/Teams/team2/base3/base"); %game.base3.threshold1 = 330; %game.base3.threshold2 = 130; } function toggleScoreScreen(%val) { if ( %val ) //error("No Score Screen in training......."); messageClient($player, 0, $player.miscMsg[noScoreScreen]); } function toggleCommanderMap(%val) { if ( %val ) messageClient($player, 0, $player.miscMsg[noCC]); } function toggleTaskListDlg( %val ) { if ( %val ) messageClient( $player, 0, $player.miscMsg[noTaskListDlg] ); } function toggleNetDisplayHud( %val ) { // Hello, McFly? This is training! There's no net in training! } function voiceCapture( %val ) { // Uh, who do you think you are talking to? } function MP3Audio::play(%this) { //too bad...no mp3 in training } function countTurretsAllowed(%type) { return $TeamDeployableMax[%type]; } function FlipFlop::objectiveInit(%data, %flipflop) { } function giveall() { error("When the going gets tough...wussies like you start cheating!"); messageClient($player, 0, "Cheating eh? What\'s next? Camping?"); } function kobayashi_maru() { $testCheats = true; commandToServer('giveAll'); } function ClientCmdSetHudMode(%mode, %type, %node) { parent::ClientCmdSetHudMode(%mode, %type, %node); movemap.push(); // hopefully this works //TrainingMap.push(); } function AIEngageTask::assume(%task, %client) { Parent::assume(%task, %client); if(%client.team != $playerTeam) game.biodermAssume(%client); } // get the ball rolling function startCurrentMission(%game) { createText( $player); setFlipFlopSkins(); schedule(2000, %game, openingSpiel); //$player.timeLimit = schedule(45000, $player.player, playerHurryUp1); schedule(2000, %game, objectiveDistanceChecks); giveEscortTask($teammate0, $player); $AIDisableChat = true; buildTraining2Team2ObjectiveQs(); updateTrainingObjectiveHud(obj1); createTrainingSpecificBanList(); } function SinglePlayerGame::gameOver(%game) { $InvBanList[SinglePlayer, "TurretOutdoorDeployable"] = ""; $InvBanList[SinglePlayer, "TurretIndoorDeployable"] = ""; $InvBanList[SinglePlayer, "ElfBarrelPack"] = ""; $InvBanList[SinglePlayer, "MortarBarrelPack"] = ""; $InvBanList[SinglePlayer, "PlasmaBarrelPack"] = ""; $InvBanList[SinglePlayer, "AABarrelPack"] = ""; $InvBanList[SinglePlayer, "MissileBarrelPack"] = ""; $InvBanList[SinglePlayer, "InventoryDeployable"] = ""; parent::GameOver(%game); } function giveEscortTask(%bot, %player) { %newObjective = new AIObjective(AIOEscortPlayer) { dataBlock = "AIObjectiveMarker"; weightLevel1 = 10000; description = "Escort Player"; targetClientId = $player; offense = true; }; //echo(%newObjective); MissionCleanup.add(%newObjective); $ObjectiveQ[$playerTeam].add(%newObjective); $teammate0.DogKillerEscort = %newObjective; schedule(6000, %game, dogKillerSpeaks, 'ChatTaskCover'); } function dogKillerSpeaks(%line) { if(isObject($teammate0.player)) serverCmdCannedChat($teammate0, %line, true); } function findDogKillerNextRespawn() { %num = game.respawnPoint; %group = nameToId("Team1/DropPoints/Respawns"); %object = %group.getObject(%num); return %object; } function getTeammateGlobals() { $TeammateWarnom0 = "Dogkiller"; $teammateskill0 = 0.7; if ( isDemo() ) $teammateVoice0 = Male1; else $teammateVoice0 = Male5; $teammateEquipment0 = 2; $teammateGender0 = Male; } function SinglePlayerGame::AIChooseGameObjective(%game, %client) { if(! %client.player) return; if (%client.team == $playerTeam) AIChooseObjective(%client); else AIChooseObjective(%client, $T2ObjectiveQ[%client.SpecialObjectives]); } function SinglePlayerGame::equip(%game, %player) { //ya start with nothing...NOTHING! %player.clearInventory(); for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); %set = %player.client.equipment; //error("equping Player "@%player@" with set"@%set); switch (%set) { case 0: %player.setArmor("Medium"); %player.setInventory(ShieldPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,6); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 25); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 20); %player.setInventory(ElfGun, 1); %player.setInventory(MissileLauncher,1); %player.setInventory(MissileLauncherAmmo, 10); %player.setInventory(TargetingLaser, 1); %player.weaponCount = 4; %player.use("Disc"); case 1: %player.setArmor("Light"); %player.setInventory(EnergyPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,6); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 25); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 20); %player.setInventory(ElfGun, 1); %player.weaponCount = 3; %player.use("Disc"); case 2: %player.setArmor("Medium"); %player.setInventory(AmmoPack, 1); %player.setInventory(RepairKit,2); %player.setInventory(Grenade,6); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 50); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 40); %player.setInventory(ElfGun, 1); %player.setInventory(MissileLauncher,1); %player.setInventory(MissileLauncherAmmo, 10); %player.setInventory(TargetingLaser, 1); %player.weaponCount = 4; %player.use("Disc"); case 3: //echo("Heavy Inside Attacker"); %player.setArmor("Heavy"); %player.setInventory(ShieldPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,8); %player.setInventory(Mine,3); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 50); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(Mortar, 1); %player.setInventory(MortarAmmo, 10); %player.setInventory(ShockLance,1); %player.setInventory(Chaingun,1); %player.setInventory(ChaingunAmmo,200); %player.setInventory(TargetingLaser, 1); %player.use("Mortar"); %player.weaponCount = 5; } } // Mission Part 2: Tower Defense-------------------------------------------- //=========================================================================== function missionSpawnedAI(%client) { %client.specialObjectives = 2; %wave = %client.memberOfWave; if(!game.trainingspawnedWaveLine[%wave]) { game.trainingspawnedWaveLine[%wave] = true; switch(%wave) { case 1: %turret = nameToId("MissionGroup/Teams/Team2/Base3/TurtleTurret"); if(%turret.isDisabled || %turret.isDestroyed) doText(T2_tipDefense02); else doText(T2_tipDefense03); case 2: doText(T2_12); case 3: doText(T2_defense06); checkForAllDead(); } } } function pickEquipment() { return 1; } function playerMountWeapon(%tag, %text, %image, %player, %slot) { if( game.firstTime++ < 2 || $pref::trainingDifficulty == 3) return; // initial weapon mount doesnt count //this also turns off after a time so it doesnt show up in real combat if( game.base1t1) return; //echo("the problem is the image name: "@%image.getName()); if(%image.getName() $= "PlasmaImage" && !game.msgPlas) { game.msgPlas = true; doText(T2_TipPlasma); //echo("Plasma mount"); } if(%image.getName() $= "MissileLauncherImage" && !game.msgMisl) { game.msgMisl = true; doText(T2_TipMissile); //echo("Missile mount"); } if(%image.getName() $= "ELFGunImage" && !game.msgElf) { game.msgElf = true; doText(T2_TipElf); //echo("Elf mount"); } if(%image.getName() $= "TargetingLaserImage" && !game.msgLaze) { game.msgLaze = true; doText(T2_Tiptlaser); } } function Pack::onCollision(%data, %obj, %col) { //error("ItemData::onCollision("@%data@", "@%obj@", "@%col@")"); if($player.player.getMountedImage($backPackSlot)){ messageClient($player, 'MsgItemCollisionHavePack', "", %data, %obj, %col); } parent::onCollision(%data,%obj,%col); } function FlipFlop::playerTouch(%data, %flipFlop, %player) { if(!Parent::playerTouch(%data, %flipflop, %player)) return; if(!game.msgFlop && %flipFlop == nameToId("Base1/CommandSwitch")) { game.msgFlop = true; doText(T2_05b); doText(T2_05c); checkObjectives(); updateTrainingObjectiveHud(obj4); game.respawnPoint = 1; } schedule(1000, game, checkObjectives); } function shapeBase::throwpack(%this, %data) { if(!game.selfDestructSpeak && %this == $player.player) { game.selfDestructSpeak = true; doText(T3_tipEquipment01); } parent::throwPack(%this, %data); } function WeaponImage::onMount(%this,%obj,%slot) { messageClient(%obj.client, 'MsgWeaponMount', "", %this, %obj, %slot); parent::onMount(%this,%obj,%slot); } // I need to find out exactly what gets called on sensor destruction function SensorLargePulse::onDestroyed(%dataBlock, %destroyedObj, %prevState) { if(%destroyedObj.getName() $= "InitialPulseSensor" && !game.initialSensorMsg) { game.initialSensorMsg = true; doText(T2_02); updateTrainingObjectiveHud(obj1); } Parent::onDestroyed(%data, %destroyObj, %prevState); } function Generator::onDestroyed(%data, %destroyedObj, %prevState) { if(%destroyedObj == nameToId("MissionGroup/Teams/Team2/Base1/Generator") && !game.msgGenDestroyed) { game.msgGenDestroyed = true; doText(T2_TipGens01); } Parent::onDestroyed(%data, %destroyObj, %prevState); } function TurretBaseLarge::onDestroyed(%dataBlock, %destroyedObj, %prevState) { //error("Lg*Turret Disabled"); if(!game.turretsDestroyed) { doText(Any_Kudo03); game.turretsDestroyed = true; updateTrainingObjectiveHud(obj1); checkObjectives(); } Parent::onDestroyed(%data, %destroyObj, %prevState); } function stationTrigger::onEnterTrigger(%data, %obj, %colObj) { if(%colObj == $player.player) messageClient(%colObj.client, 'msgEnterInvStation', ""); parent::onEnterTrigger(%data, %obj, %colObj); } function createTrainingSpecificBanList() { $InvBanList[SinglePlayer, "TurretOutdoorDeployable"] = 1; $InvBanList[SinglePlayer, "TurretIndoorDeployable"] = 1; $InvBanList[SinglePlayer, "ElfBarrelPack"] = 1; $InvBanList[SinglePlayer, "MortarBarrelPack"] = 1; $InvBanList[SinglePlayer, "PlasmaBarrelPack"] = 1; $InvBanList[SinglePlayer, "AABarrelPack"] = 1; $InvBanList[SinglePlayer, "MissileBarrelPack"] = 1; $InvBanList[SinglePlayer, "InventoryDeployable"] = 1; } //im putting all the callbacks into the package... just in case //---------------------------------------------------------------- function playerTouchItemHavePack(%this, %text, %data, %collided, %collider) { //error("playerTouchItemHavePack("@%this@", "@%text@", "@%data@", "@%collided@", "@%collider@")"); if(%collider == $player.player && !game.msghavePack && !game.tower3Secure) { game.msghavePack = true; doText(T2_TipDropit); } } function RepairPack::onPickUp(%this, %obj, %player) { //error("RepairPack::onPickUp("@%this@", "@%obj@", "@%player@")"); if( !game.msgRepairPackPickUp && %player == $player.player) { game.msgRepairPackPickUp = true; //doText(T2_repairPack, 1500); doText(T2_tipRepair01); dotext(T2_TipRepair03); } } // function playerRepairSelf(%tag, %text) // { // if(!game.msgSelf){ // game.msgSelf = true; // dotext(T2_TipRepair03); // } // } function noRepair(%tag, %text) { if(!game.msgRep){ game.msgRep = true; doText(T2_TipRepair02); } } function ObjRepair(%tag, %string, %objName, %objID) { if(%objID.getDatablock().classname !$= "generator" && %objID.isPowered() && game.tower3Secure && !game.tipD2) { game.tipD2 = true; //doText(T2_tipDefense02); } } // function StationInvEnter(%a1, %a2) // { // //error("Inv Enter.........."); // if(!game.msgEnterInv){ // game.msgEnterInv = true; // doText(T2_tipInventory); // //doText(T2_tipDefense01); // } // } // function playerTurnsOnShield() // { // if(!game.msgShield) { // game.msgShield++; // doText(T2_TipShieldpack); // } // } function openingSpiel() { doText(T2_01, 6000); doText(T2_TipShieldpack); } function SinglePlayerGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement) { if(%damageType == $DamageType::sentryTurret && !game.sentryTurretKill && %clVictim.team != $playerTeam) { game.sentryTurretKill = true; doText(T2_tipDefense05); } if(%clVictim == $player && game.respawnPoint != 3) { %point = findDogKillerNextRespawn(); %DKdefend = new AIObjective(AIODefendLocation) { datablock = "AIObjectiveMarker"; position = %point.position; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Defend the players next respawn"; location = %point.position; weightLevel1 = 7000; targetClientId = "-1"; targetObjectId = %point; }; MissionCleanup.add(%DKdefend); $ObjectiveQ[$playerTeam].add(%DKdefend); game.dogKillersPlayerDefend = %DKdefend; } Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement); } function spawnSinglePlayer() { if(isObject(game.dogKillersPlayerDefend)) { AIClearObjective($teammate0.dogKillersPlayerDefend); $teammate0.dogKillersPlayerDefend.weightLevel1 = 0; game.dogKillersPlayerDefend.delete(); } parent::spawnSinglePlayer(); } function missionClientKilled(%clVictim, %killer) { if(%killer == $player && %clVictim.team == $enemyTeam) schedule(3000, $player.player, adviseHealthKit); if(%killer == $teammate0 && %clVictim.team == $enemyTeam) %random = getRandom(50); if(%random == 1) { schedule(500, game, dogKillerSpeaks, 'ChatBrag'); } else if(%random == 2) { schedule(500, game, dogKillerSpeaks, 'ChatAwesome'); } %set = checkForSequenceSkillCompletion(%clvictim); game.victimSetKilled[%set] = true; if(%set == 1 && nameToId("base1/CommandSwitch").team != $playerTeam) if(%killer == $player) schedule(800, $player.player, doText, Any_Jingo03); //no mercy, remember Ymir schedule(3000, game, checkObjectives); } function adviseHealthKit() { if($player.player.getdamageLevel() > 0.3 && $player.player.getInventory(RepairKit) && !game.useHeath) { game.useHealth = true; doText(Any_HealthKit); } } function checkForSequenceSkillCompletion(%victim) { %set = findVictimSet(%victim); //how is everbody esle in the set doing for(%i = 0; %i < getWordCount($victimSet[%set]); %i++){ %enemy = getWord($victimSet[%set], %i); if($enemy[%enemy] && $enemy[%enemy].player && $enemy[%enemy] != %victim) { error("There is $Enemy"@%enemy@" still in set "@ %set); return 0; } } return %set; } function findVictimSet(%victim) { for(%i = 1; %i <= 3; %i++) { for(%word = 0; %word < getWordCount($victimSet[%i]); %word++) { %num = getWord($victimSet[%i], %word); if($enemy[%num] == %victim) { error("Victim is member of victim set "@%i); return %i; } } } } function checkObjectives() { if( !isSafe($player, 100) ) { error("player is not safe"); schedule(10000, game, checkObjectives); return; //objectives cannot be met if enemies are near } else if(nameToId("base1/CommandSwitch").team == $playerTeam && !game.train07) { game.initialSensorMsg = true; //so you cant double back to get the sensorDestoyed msg game.train07 = true; schedule(5000, $player, doText, T2_07); } else if(game.turretsDestroyed && !game.train10 && game.victimSetKilled2) { game.train10 = true; tower2clean(); } else if(nameToId("base3/EasternFortification").team == $playerTeam && game.victimSetKilled3 && !game.tower3Secure) { game.tower3Secure = true; //Dogkiller can now pick up team objectives AIClearObjective($teammate0.DogKillerEscort); $teammate0.DogKillerEscort.weightLevel1 = 0; schedule(6000, game, dogKillerSpeaks, 'ChatSelfDefendBase'); doText(T2_10); doText(T2_10a); doText(T2_11, 2000); // first get the gens up if( ! nameToId("base3/EasternFortification").isPowered() ) { //echo("switch is not powered"); doText(t2_TipDefense02, 1000); } // now the inventory stuff doText(T2_inventory01); doText(T2_tipInventory01); doText(T2_tipInventory03); %timeToFirstWave = (2.1 - $pref::trainingDifficulty) * 10000; schedule(%timeToFirstWave, game, spawnWave, 1); //beginTowerDefense convertPassedEnemies(); updateTrainingObjectiveHud(obj2); game.respawnPoint = 3; } } function missionWaveDestroyed() { // there have been cases where this didnt seem to get called // lets try again convertPassedEnemies(); } function tower2clean() { doText(ANY_Waypoint02); %newWaypoint = "797.596 -652.19 162.924"; schedule(2000, game, setWaypointAt, %newWaypoint, "Control Switch"); updateTrainingObjectiveHud(obj3); game.respawnPoint = 2; } function convertPassedEnemies() { %num = clientGroup.getCount(); for(%i = 0; %i < %num; %i++) { %client = clientGroup.getObject(%i); if(%client.player) { if(%client.specialObjectives != 2) { %client.specialObjectives = 2; // and to make sure the bot doesnt THINK what its // currently doing is more important aiUnassignClient(%client); } } } } function singlePlayerGame::pickTeamSpawn(%game, %client, %respawn) { if(game.tower3Secure && %client.team == $enemyTeam) Training2LaterPickTeamSpawn(%game, %client); else parent::pickTeamSpawn(%game, %client, %respawn); } function Training2LaterPickTeamSpawn(%game, %client) { %dp = game.pickRandomDropPoint(%client); InitContainerRadiusSearch(%dp.position, 2, $TypeMasks::PlayerObjectType); if( containerSearchNext() ) { //error("Too close object, picking again?"); if(game.DPRetries++ > 100) return "0 0 300"; else return game.pickTeamSpawn(%client); } else { game.DPRetries = 0; return %dp.getTransform(); } } function singlePlayerGame::pickRandomDropPoint(%game, %client) { //error("picking random point for "@%client); %group = nameToID("MissionGroup/Teams/team2/DropPoints/Respawns"); %num = %group.getCount(); %random = getRandom(1,%num); %dp = %group.getObject( %random ); return %dp; } function checkForAllDead() { //none of this matters if you're dead if(!$player.player) { //error("You have no player!"); schedule(5000, game, checkForAllDead); return; } %num = clientGroup.getCount(); for(%i = 0; %i < %num; %i++) { %client = ClientGroup.getObject(%i); if(%client.player && %client.team == $enemyTeam) { //error("Client " @ %client @ " is still alive."); schedule(5000, game, checkForAllDead); return; } } //messageAll(0, "Debug: I dont think there are any enemies alive"); doText(T2_13); schedule(2000, game, missionComplete, $player.miscMsg[training2win]); } function objectiveDistanceChecks() { %playerPosition = $player.player.getTransform(); if(!%playerPosition) { schedule(5000, game, objectiveDistanceChecks); return; } %sensorDist = vectorDist(%playerPosition, game.sensor.position); if(%sensorDist < 250 && !game.sensorText) { game.sensorText = true; cancel($player.timeLimit); doText(T2_01a, 3000); doText(T2_01b); doText(T2_tipScanned); schedule(4000, game, updateTrainingObjectiveHud, obj5); } %base1distance = vectorDist( %playerPosition, game.base1.position ); //error("debug distance: base1- "@%base1distance); if(%base1distance < game.base1.threshold1 && !game.base1t1 ) { game.base1t1 = true; doText(T2_03); cancel($player.timeLimit); } if(%base1distance < game.base1.threshold2 && !game.base1t2 ) { game.base1t2 = true; doText(T2_04); doText(T2_04a); doText(T2_05); updateTrainingObjectiveHud(obj3); } %base2distance = vectorDist( %playerPosition, game.base2.position ); //error("debug distance: base2- "@%base2distance); if(%base2distance < game.base2.threshold1 && !game.base2t1 && !game.turretsDestroyed) { game.base2t1 = true; doText(T2_08); updateTrainingObjectiveHud(obj6); } //error(game.turretsDestroyed); if(%base2distance < game.base2.threshold2 && !game.base2t2 && !game.turretsDestroyed) { game.base2t2 = true; doText(T2_TipTurret02); if( getPlayersOnTeam($playerTeam) < 2) doText(T2_Cya01); } %base3distance = vectorDist( %playerPosition, game.base3.position ); //error("debug distance: base3- "@%base3distance); if(%base3distance < game.base3.threshold1 && !game.base3t1) { game.base3t1 = true; doText(T2_09a); } if(%base3distance < game.base3.threshold2 && !game.base3t2) { game.base3t2 = true; doText(T2_09b); if($player.player.getMountedImage($backpackSlot) $= "ShieldPackImage") doText(T2_ShieldPack02); } schedule(4000, game, objectiveDistanceChecks); } function buildTraining2Team2ObjectiveQs() { $T2ObjectiveQ[0] = new AIObjectiveQ(); MissionCleanup.add($T2ObjectiveQ[0]); $T2ObjectiveQ[1] = new AIObjectiveQ(); MissionCleanup.add($T2ObjectiveQ[1]); $T2ObjectiveQ[2] = new AIObjectiveQ(); MissionCleanup.add($T2ObjectiveQ[2]); //////////////////objectiveQ 0-------------------------------------------------------------- %newObjective = new AIObjective(AIORepairObject) { datablock = "AIObjectiveMarker"; position = "-163.766 126.029 103.831"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Repair the initial SensorLargePulse"; targetObject = "InitialPulseSensor"; targetClientId = "-1"; targetObjectId = nameToId("InitialPulseSensor"); location = "-163.766 126.029 103.831"; weightLevel1 = "4000"; weightLevel2 = "0"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; equipment = "Light RepairPack"; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[0].add(%newObjective); %newObjective = new AIObjective(AIORepairObject) { datablock = "AIObjectiveMarker"; position = "-33.7195 -131.864 133.096"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Repair the base1 Gen"; targetObject = "generator"; targetClientId = "-1"; targetObjectId = nameToId("base1/generator"); location = "-33.7195 -131.864 133.096"; weightLevel1 = "3200"; weightLevel2 = "1600"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; equipment = "RepairPack"; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[0].add(%newObjective); %newObjective = new AIObjective(AIODefendLocation) { datablock = "AIObjectiveMarker"; position = "-33.7195 -131.864 133.096"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Defend the base1 gen"; targetObject = "generator"; targetClientId = "-1"; targetObjectId = nameToId("base1/generator"); location = "-12 -131.864 133.096"; weightLevel1 = "3100"; weightLevel2 = "1500"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; desiredEquipment = ""; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[0].add(%newObjective); %newObjective = new AIObjective(AIODefendLocation) { datablock = "AIObjectiveMarker"; position = "-8.82616 -131.779 121.39"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Defend the base 1 flipflop"; targetObject = "CommandSwitch"; targetClientId = "-1"; targetObjectId = nameToId("CommandSwitch"); location = "-8.82616 -131.779 121.39"; weightLevel1 = "3900"; weightLevel2 = "2000"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; desiredEquipment = ""; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[0].add(%newObjective); %newObjective = new AIObjective(AIOTouchObject) { datablock = "AIObjectiveMarker"; position = "-8.82616 -131.779 121.39"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Capture the base1 FlFlop"; mode = "TouchFlipFlop"; targetObject = "CommandSwitch"; targetClientId = "-1"; targetObjectId = nameToID("CommandSwitch"); location = "-8.82616 -131.779 121.39"; weightLevel1 = "3850"; weightLevel2 = "0"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "1"; defense = "0"; equipment = "light"; desiredEquipment = ""; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); if($pref::trainingDifficulty != 1) $T2ObjectiveQ[0].add(%newObjective); %newObjective = new AIObjective(AIORepairObject) { datablock = "AIObjectiveMarker"; position = "-11.5761 -131.662 172.204"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Repair the Sensor Pulsation"; targetObject = "Team2SensorMediumPulse1"; targetClientId = "-1"; targetObjectId = nameToId("Team2SensorMediumPulse1"); location = "-11.5761 -131.662 172.204"; weightLevel1 = "3100"; weightLevel2 = "1000"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; equipment = "RepairPack"; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[0].add(%newObjective); ///////////////objectiveQ 1--------------------------------------------------------------- %newObjective = new AIObjective(AIODefendLocation) { datablock = "AIObjectiveMarker"; position = "380.576 -301.298 101.843"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Defend the Base2 Gen"; targetObject = "generator"; targetClientId = "-1"; targetObjectId = nameToId("base2/generator"); location = "380.576 -301.298 101.843"; weightLevel1 = "3100"; weightLevel2 = "1500"; weightLevel3 = "1000"; weightLevel4 = "0"; offense = "0"; defense = "1"; desiredEquipment = ""; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[1].add(%newObjective); ///////////////objectiveQ 2--------------------------------------------------------------- %newObjective = new AIObjective(AIORepairObject) { datablock = "AIObjectiveMarker"; position = "787.866 -647.605 164.343"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Repair gen3"; targetObject = "Generator3"; targetClientId = "-1"; targetObjectId = nameToId("Generator3"); location = "787.866 -647.605 164.343"; weightLevel1 = "4000"; weightLevel2 = ""; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; equipment = "RepairPack"; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIODefendLocation) { datablock = "AIObjectiveMarker"; position = "787.866 -647.605 164.343"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Defend gen3"; targetObject = "Generator3"; targetClientId = "-1"; targetObjectId = nameToId("Generator3"); location = "787.866 -647.605 164.343"; weightLevel1 = "3400"; weightLevel2 = "0"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; desiredEquipment = ""; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIOAttackObject) { datablock = "AIObjectiveMarker"; position = "785.96 -659.402 138.593"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Attack the Station Alpha"; targetObject = "Inventory_Alpha"; targetClientId = "-1"; targetObjectId = nameToId("Inventory_Alpha"); location = "785.96 -659.402 138.593"; weightLevel1 = "2900"; weightLevel2 = "1400"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "1"; defense = "0"; desiredEquipment = ""; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIOAttackObject) { datablock = "AIObjectiveMarker"; position = "793.435 -647.88 138.499"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Attack the Station Beta"; targetObject = "Inventory_Beta"; targetClientId = "-1"; targetObjectId = nameToId("Inventory_Beta"); location = "793.435 -647.88 138.499"; weightLevel1 = "2900"; weightLevel2 = "1400"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "1"; defense = "0"; desiredEquipment = ""; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIORepairObject) { datablock = "AIObjectiveMarker"; position = "792.748 -656.036 143.914"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Repair the SentryTurret"; targetObject = "TurtleTurret"; targetClientId = "-1"; targetObjectId = nameToId("TurtleTurret"); location = "792.748 -656.036 143.914"; weightLevel1 = "3100"; weightLevel2 = "0"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; equipment = "RepairPack"; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIOTouchObject) { datablock = "AIObjectiveMarker"; position = "797.596 -652.19 164.558"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Capture the Base3 FlipFlop"; mode = "TouchFlipFlop"; targetObject = "EasternFortification"; targetClientId = "-1"; targetObjectId = nameToId("EasternFortification"); location = "797.596 -652.19 164.558"; weightLevel1 = "3850"; weightLevel2 = "3400"; weightLevel3 = "3000"; weightLevel4 = "0"; offense = "1"; defense = "0"; desiredEquipment = "Light"; buyEquipmentSet = ""; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); if($pref::trainingDifficulty != 1) $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIOAttackObject) { datablock = "AIObjectiveMarker"; position = "787.866 -647.605 164.343"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Attack the generatorLarge"; targetObject = "Generator3"; targetClientId = "-1"; targetObjectId = nameToId("Generator3"); location = "787.866 -647.605 164.343"; weightLevel1 = "3100"; weightLevel2 = "1600"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "1"; defense = "0"; desiredEquipment = "ShieldPack"; buyEquipmentSet = "HeavyAmmoSet"; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIORepairObject) { datablock = "AIObjectiveMarker"; position = "785.96 -659.402 138.593"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Repair the StationInventory"; targetObject = "Inventory_Alpha"; targetClientId = "-1"; targetObjectId = nameToId("Inventory_Alpha"); location = "785.96 -659.402 138.593"; weightLevel1 = "3500"; weightLevel2 = "1400"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; equipment = "RepairPack"; buyEquipmentSet = "MediumRepairSet"; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIORepairObject) { datablock = "AIObjectiveMarker"; position = "793.435 -647.88 138.499"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Repair the StationInventory"; targetObject = "Inventory_Beta"; targetClientId = "-1"; targetObjectId = nameToId("Inventory_Beta"); location = "793.435 -647.88 138.499"; weightLevel1 = "3500"; weightLevel2 = "1400"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; equipment = "RepairPack"; buyEquipmentSet = "MediumRepairSet"; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIODefendLocation) { datablock = "AIObjectiveMarker"; position = "791.311 -655.22 156.159"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Defend the Base 3FlipFlop"; targetObject = "EasternFortification"; targetClientId = "-1"; targetObjectId = nameToId("EasternFortification"); //location = "797.596 -652.19 164.558"; location = "791.311 -655.22 156.159"; weightLevel1 = "3900"; weightLevel2 = "2900"; weightLevel3 = "300"; weightLevel4 = "100"; offense = "0"; defense = "1"; desiredEquipment = "ShieldPack Plasma PlasmaAmmo"; buyEquipmentSet = "HeavyShieldSet"; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIORepairObject) { datablock = "AIObjectiveMarker"; position = "556.144 -411.448 133.224"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Repair the SensorMediumPulse"; targetObject = "MidwaySensor"; targetClientId = "-1"; targetObjectId = nameToId("MidwaySensor"); location = "556.144 -411.448 133.224"; weightLevel1 = "4000"; weightLevel2 = "0"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; equipment = "RepairPack"; buyEquipmentSet = ""; issuedByHuman = "0"; issuedByClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); %newObjective = new AIObjective(AIODefendLocation) { datablock = "AIObjectiveMarker"; position = "785.96 -659.402 138.593"; rotation = "1 0 0 0"; scale = "1 1 1"; description = "Defend the Downstairs//Stations"; targetObject = "Inventory_Alpha"; targetClientId = "-1"; targetObjectId = nameToId("Inventory_Alpha"); location = "785.96 -659.402 138.593"; weightLevel1 = "3700"; weightLevel2 = "0"; weightLevel3 = "0"; weightLevel4 = "0"; offense = "0"; defense = "1"; desiredEquipment = "ShieldPack Plasma PlasmaAmmo"; buyEquipmentSet = "HeavyShieldSet"; issuedByHuman = "0"; issuingClientId = "-1"; forceClientId = "-1"; locked = "0"; }; MissionCleanup.add(%newObjective); $T2ObjectiveQ[2].add(%newObjective); } //--Training2 package END ----------------------------------------------------------------- }; PK !(?Z8Z8scripts/Training3.cs// don't want this executing when building graphs if($OFFLINE_NAV_BUILD) return; // script fror training mission 3 //------------------------------------------------------------- //init //------------------------------------------------------------- echo("Running Mission 3 Script"); activatePackage(Training3); $numberOfEnemies[1] = 5; $numberOfEnemies[2] = 7; $numberOfEnemies[3] = 7; $numberOfTeammates = 0; $missionBotSkill[1] = 0.0; $missionBotSkill[2] = 0.5; $missionBotSkill[3] = 0.9; $missionEnemyThreshold[1] = 0; $missionEnemyThreshold[2] = 3; $missionEnemyThreshold[3] = 7; //the Scout is very important $Shrike = nameToId("Ride"); // activate the wings on the flyer $Shrike.playThread($ActivateThread, "activate"); // for the distance checking addMessageCallback('MsgWeaponMount', playerMountWeapon); package training3 { //===============================================begin the training 3 package stuff==== function SinglePlayerGame::initGameVars(%game) { // for many of the objectives we are going to periodically // check the players distance vs some object // you could do this much prettier but its going to be very specific // so a cut and paste eyesore will be fine echo("initializing training3 game vars"); %game.base = nameToId("Shield"); %game.baseLocation = game.base.getTransform(); %game.base.threshold = 400; %game.end = nameToId("PlayerDropPoint"); %game.endLocation = game.end.getTransform(); } function MP3Audio::play(%this) { //too bad...no mp3 in training } // force always scope for testing function singlePlayerGame::onAIRespawn(%game, %client) { if(! isObject("MissionCleanup/TeamDrops2")) { //this is the snippet of script from default games that puts teamdrops // into the mission cleanup group...slightly modified to suit our needs %dropSet = new SimSet("TeamDrops2"); MissionCleanup.add(%dropSet); %spawns = nameToID("MissionGroup/Teams/team2/TeamDrops"); if(%spawns != -1) { %count = %spawns.getCount(); for(%i = 0; %i < %count; %i++) %dropSet.add(%spawns.getObject(%i)); } } // error("Forcing AI Scope!!!!!!!!!!!!!"); // %client.player.scopeToClient($player); parent:: onAIRespawn(%game, %client); } function getTeammateGlobals() { echo("You have no teammates in this mission"); } function toggleScoreScreen(%val) { if ( %val ) //error("No Score Screen in training......."); messageClient($player, 0, $player.miscMsg[noScoreScreen]); } function toggleCommanderMap(%val) { if ( %val ) messageClient($player, 0, $player.miscMsg[noCC]); } function toggleTaskListDlg( %val ) { if ( %val ) messageClient( $player, 0, $player.miscMsg[noTaskListDlg] ); } function toggleNetDisplayHud( %val ) { // Hello, McFly? This is training! There's no net in training! } function voiceCapture( %val ) { // Uh, who do you think you are talking to? } function giveall() { error("When the going gets tough...wussies like you start cheating!"); messageClient($player, 0, "Cheating eh? What\'s next? Camping?"); } function kobayashi_maru() { $testcheats = true; commandToServer('giveAll'); } function AIEngageTask::assume(%task, %client) { Parent::assume(%task, %client); if(%client.team != $playerTeam) game.biodermAssume(%client); } function countTurretsAllowed(%type) { return $TeamDeployableMax[%type]; } function FlipFlop::objectiveInit(%data, %flipflop) { } function ClientCmdSetHudMode(%mode, %type, %node) { parent::ClientCmdSetHudMode(%mode, %type, %node); //TrainingMap.push(); } // get the ball rolling function startCurrentMission(%game) { //just in case setFlipFlopSkins(); schedule(5000, %game, opening); schedule(30000, %game, objectiveDistanceChecks); updateTrainingObjectiveHud(obj1); if($pref::trainingDifficulty == 1) { nameToId(BackEnterSentry).hide(true); freeTarget(nameToId(BackEnterSentry).getTarget()); } } function opening() { if(game.vehicleMount) return; doText(T3_01); //doText(T3_02); doText(T3_cloaking); doText(T3_tipCloaking01); doText(T3_tipCloaking02); } function SinglePlayerGame::equip(%game, %player) { //ya start with nothing...NOTHING! %player.clearInventory(); for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); //echo("Light Assassin Config"); %player.setArmor("Light"); %player.setInventory(CloakingPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(FlashGrenade,5); %player.setInventory(Mine,3); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 20); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(TargetingLaser, 1); %player.setInventory(ShockLance,1); %player.weaponCount = 3; %player.use("Disc"); } // ============================================================================ function singlePlayerGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement) { %teamCount = getPlayersOnTeam(%clVictim.team); //echo("Team count:" SPC %teamCount); %maintNum = $missionEnemyThreshold[$pref::trainingDifficulty]; //echo("Maintain:" SPC %maintNum); %clVictim.useSpawnSphere = true; // this will respawn the AI if if( %teamCount < %maintNum ) DefaultGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement); } function singleplayerGame::pickTeamSpawn(%game, %client, %respawn) { if(%client.useSpawnSphere) DefaultGame::pickTeamSpawn(%game, %client.team); else parent::pickTeamSpawn(%game, %client, %respawn); } function clientCmdVehicleMount() { if(game.vehicleMount++ == 1) { doText(Any_Waypoint01, 2000); //doText(Any_Waypoint03, 4000); doText(T3_tipPiloting01); doText(T3_02); doText(T3_05); schedule(4000, game, setWaypointAt, game.baseLocation, "Icefell Ridge Base"); updateTrainingObjectiveHud(obj2); game.pilotingTips = schedule(60000, game, PilotingTips); } if(game.phase == 4) { setWaypointAt(game.endLocation, "Extraction Point"); updateTrainingObjectiveHud(obj3); doText(T3_11); doText(T3_12); game.phase = 5; if(!nameToId(AATurretGen).isDisabled()) doText(t3_12a); } } function RepairPack::onCollision(%this,%obj,%col) { if($player.player.getInventory(CloakingPack) && $player.player.getDamageLevel() > 0.2 && !game.msgtipEquip && %col == $player.player) { game.msgTipEquip = true; doText(T3_tipEquipment02); } parent::onCollision(%this,%obj,%col); } // 86 the vehicle removal on dying function vehicleAbandonTimeOut(%vehicle) { // dont mess it up } function playerMountWeapon(%tag, %text, %image, %player, %slot) { if( game.firstTime++ < 2) return; // initial weapon mount doesnt count if(%image.getName() $= "ShockLanceImage" && !game.msgShock) { game.msgShock = true; //doText(T3_TipShockLance); } } function FlipFlop::playerTouch(%data, %flipFlop, %player ) { //echo("singlePlayer::playerTouchFlipFlop"); %client = %player.client; %flipTeam = %flipflop.team; if(%flipTeam == %client.team) return false; nameToId(Shield).delete(); //just the sound messageAll( 'MsgClaimFlipFlop', '~wfx/misc/flipflop_taken.wav', %client.name, Game.cleanWord( %flipflop.name ), $TeamName[%client.team] ); if(%player == $player.player) schedule( 1500, game, flipFlopFlipped); objectiveDistanceChecks(); //change the skin on the switch to claiming team's logo setTargetSkin(%flipflop.getTarget(), $teamSkin[%player.team]); setTargetSensorGroup(%flipflop.getTarget(), %player.team); // convert the resources associated with the flipflop Game.claimFlipflopResources(%flipflop, %client.team); Game.AIplayerCaptureFlipFlop(%player, %flipflop); return true; } function scoutFlyer::onRemove(%this, %obj) { error("scoutFlyer::onRemove("@ %obj@") called"); if ( ! isObject( ServerConnection ) ) return; if(%obj == $Shrike ) { // we dont want the player to die hitting the ground cancel(game.pilotingTips); $player.player.invincible = true; missionFailed($player.miscMsg[training3shrikeLoss]); } } function WeaponImage::onMount(%this,%obj,%slot) { messageClient(%obj.client, 'MsgWeaponMount', "", %this, %obj, %slot); Parent::onMount(%this,%obj,%slot); } function GeneratorLarge::onDestroyed(%dataBlock, %destroyedObj, %prevState) { if(%destroyedObj == nameToId("PrisonGen") && !game.msgGenDestroyed) { game.msgGenDestroyed = true; doText(Any_ObjComplete01); updateTrainingObjectiveHud(obj6); } else if(%destroyedObj == nameToId(AATurretGen)) $player.AAGenWaypoint.delete(); } // If the forcefield is shot we play this little wav file function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal) { //error("ProjectileData::onCollision("@%data@", "@%projectile@", "@%targetObject@", "@%modifier@", "@%position@", "@%normal@")"); parent::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal); if(game.msgGenDestroyed) return; else if(%targetObject.getDataBlock().getName() $= nameToId(Shield).dataBlock) { //error("someone shot the force field"); if(%projectile.sourceObject == $player.player){ //error("it was you f00"); if(!game.msgMustDestroyGen) { game.msgMustDestroyGen = true; doText(T3_07b); } } } } function addTraining3Waypoints() { //do the hud updating also $player.currentWaypoint.delete(); updateTrainingObjectiveHud(obj5); %Training3WaypointsGroup = new simGroup(Training3Waypoints); MissionCleanup.add(%Training3WaypointsGroup); %waypoint = new WayPoint() { position = nameToId(FF).position; rotation = "1 0 0 0"; scale = "1 1 1"; dataBlock = "WayPointMarker"; lockCount = "0"; homingCount = "0"; name = "Control Point"; team = "0"; locked = "true"; }; %Training3WaypointsGroup.add(%waypoint); %waypoint = new WayPoint() { position = nameToId(BaseGen).getWorldBoxCenter(); rotation = "1 0 0 0"; scale = "1 1 1"; dataBlock = "WayPointMarker"; lockCount = "0"; homingCount = "0"; name = "Main Base Power"; team = "0"; locked = "true"; }; %Training3WaypointsGroup.add(%waypoint); %waypoint = new WayPoint() { position = nameToId(sensorNetGen).getWorldBoxCenter(); rotation = "1 0 0 0"; scale = "1 1 1"; dataBlock = "WayPointMarker"; lockCount = "0"; homingCount = "0"; name = "Sensor Power"; team = "0"; locked = "true"; }; %Training3WaypointsGroup.add(%waypoint); %waypoint = new WayPoint() { position = nameToId(AATurretGen).getWorldBoxCenter(); rotation = "1 0 0 0"; scale = "1 1 1"; dataBlock = "WayPointMarker"; lockCount = "0"; homingCount = "0"; name = "AntiAircraft Turret Power"; team = "0"; locked = "true"; }; //%Training3WaypointsGroup.add(%waypoint); $player.AAGenWaypoint = %waypoint; %waypoint = new WayPoint() { position = nameToId(prisonGen).getWorldBoxCenter(); rotation = "1 0 0 0"; scale = "1 1 1"; dataBlock = "WayPointMarker"; lockCount = "0"; homingCount = "0"; name = "Forcefield Power"; team = "0"; locked = "true"; }; %Training3WaypointsGroup.add(%waypoint); } function RandomPilotingTips() { // this is unused as testers claimed it sounded 'disjointed and random' if(pilotingTips()) game.pilotingTips = schedule(20000, $player.player, RandomPilotingTips); } function pilotingTips() { %num = 2; if(game.Training3tips == %num) return false; %tip = getRandom(1, %num); if( game.training3TipUsed[%tip] ) return true; switch(%tip){ case 1: doText(T3_tipfreelook); case 2: doText(T3_tipPiloting04); // case 3: // doText(T3_tipPiloting02); // case 4: // doText(T3_tipUnderwater01); } game.training3Tips++; game.training3TipUsed[%tip] = true; return true; } //misc //------------------------------------------------------------- function objectiveDistanceChecks() { %playerPos = $player.player.getTransform(); if(!%playerPos) { schedule(2000, game, objectiveDistanceChecks); return; } %cont = true; %basedistance = vectorDist( %playerPos, game.baseLocation ); if(game.phase == 0 && %basedistance < game.base.threshold ) { doText(T3_06, 4000); doText(T3_tipCloaking03); doText(T3_07); game.phase = 1; %cont = false; cancel(game.pilotingTips); addTraining3Waypoints(); game.respawnPoint = 1; } if(game.phase == 5 && vectorDist(%playerPos, game.baseLocation) > 1000 ) { game.phase = 6; serverConnection.setBlackout(true, 3000); schedule(3000, game, finishMission); } if(%cont) schedule(2000, game, objectiveDistanceChecks); } function finishMission() { $shrike.setFrozenState(true); nameToId(AATurretGen).setDamageState(Disabled); //hack! cheating! doText(T3_13); //messageAll(0, "Nya, nya, nyanyanay...this missions oh-ohover!"); missionComplete($player.miscMsg[training3win]); %cont = false; } function flipFlopFlipped() { //error("flip flop flipped"); if(!game.flipFlopped) { game.flipFlopped = true; // if we need a message modify this. //messageTeam( %client.team, 'MsgClaimFlipFlop', '\c2%1 claimed %2 for %3.~wfx/misc/flipflop_taken.wav', %client.name, Game.cleanWord( %flipflop.name ), $TeamName[%client.team] ); doText(T3_09, 8000); doText(T3_10); game.phase = 4; if(!nameToId(AATurretGen).isDisabled()) doText(t3_09a); // new waypoint at the shrike setWaypointAt($shrike.getTransform(), "Shrike"); updateTrainingObjectiveHud(obj4); //get rid of the other waypoints nameToId(Training3Waypoints).delete(); } } // Mission area is pointless this time out function SinglePlayerGame::leaveMissionArea(%game, %player) { } function SinglePlayerGame::enterMissionArea(%game, %player) { } //===============================================END the training 3 package stuff==== }; PK !(,e,escripts/Training4.cs// don't want this executing when building graphs if($OFFLINE_NAV_BUILD) return; echo("Running Mission 4 Script"); activatePackage(Training4); activatePackage(singlePlayerMissionAreaEnforce); //special sound datablock AudioProfile(HudFlashSound) { filename = "gui/buttonover.wav"; description = AudioDefault3d; preload = true; }; $numberOfEnemies[1] = 0; $numberOfEnemies[2] = 0; $numberOfEnemies[3] = 0; // Mission Variables $numberOfWaves[1] = 3; $numberOfWaves[2] = 5; $numberOfWaves[3] = 7; $numberInWave[1] = 3; $numberInWave[2] = 5; $numberInWave[3] = 7; $delayBeforeFirstWave[1] = 300000; $delayBeforeFirstWave[2] = 200000; $delayBeforeFirstWave[3] = 20000; $missionBotSkill[1] = 0.0; $missionBotSkill[2] = 0.5; $missionBotSkill[3] = 0.8; $numberOfTeammates = 2; package training4 { //===============================================begin the training 4 package stuff==== function getTeammateGlobals() { $TeammateWarnom0 = "Firecrow"; $teammateskill0 = 0.5; $teammateVoice0 = Fem3; $teammateEquipment0 = 0; $teammateGender0 = Female; $TeammateWarnom1 = "Proteus"; $teammateSkill1 = 0.5; $teammateVoice1 = Male4; $teammateEquipment1 = 0; $teammateGender1 = Male; } function MP3Audio::play(%this) { //too bad...no mp3 in training } function ClientCmdSetHudMode(%mode, %type, %node) { parent::ClientCmdSetHudMode(%mode, %type, %node); //TrainingMap.push(); } // get the ball rolling function startCurrentMission(%game) { game.equip($player.player); if($pref::TrainingDifficulty == 3) updateTrainingObjectiveHud(obj10); else{ schedule(5000, game, repairSensorTower); updateTrainingObjectiveHud(obj1); } $player.beginSpawn = schedule($delayBeforeFirstWave[$pref::TrainingDifficulty], %game, spawnWave, 1); $AIDisableChat = true; game.missionTime = getSimTime(); activateskillSpecificTrainingSettings(); } function activateskillSpecificTrainingSettings() { %skill = $pref::TrainingDifficulty; // all nameToId("Team1SensorLargePulse1").setDamageLevel(1.5); nameToId("Team1SensorLargePulse2").setDamageLevel(1.5); //skill 2 & 3 : //no forcefield, no upstairs Inventory deploy, aaturret(in the mis file) if(%skill > 1) { %invDepObj = findObjByDescription("Deploy Upstairs Station", 1); removeDescribedObj(%invDepObj, 1); } // skill 3: no turret, no destroy turret or upstairs gen objectives if(%skill > 2) { nameToId(Team1TurretBaseLarge1).hide(true); freeTarget(nameToId(Team1TurretBaseLarge1).getTarget()); nameToId(GenForceField).delete(); } } function countTurretsAllowed(%type) { return $TeamDeployableMax[%type]; } function giveall() { error("When the going gets tough...wussies like you start cheating!"); messageClient($player, 0, "Cheating eh? What\'s next? Camping?"); } function kobayashi_maru() { $testcheats = true; commandToServer('giveAll'); } function pickEquipment() { return getRandom(10); } function AIEngageTask::assume(%task, %client) { Parent::assume(%task, %client); if(%client.team != $playerTeam) game.biodermAssume(%client); } function toggleScoreScreen(%val) { if ( %val ) messageClient($player, 0, $player.miscMsg[noScoreScreen]); } function toggleNetDisplayHud( %val ) { // Hello, McFly? This is training! There's no net in training! } function voiceCapture( %val ) { // Uh, who do you think you are talking to? } function singlePlayerGame::pickTeamSpawn(%game, %client) { if(%client.team == $player.team) return parent::pickTeamSpawn(%game, %client); %dp = game.pickRandomDropPoint(%client); InitContainerRadiusSearch(%dp.position, 2, $TypeMasks::PlayerObjectType); if( containerSearchNext() ) { //echo("Too close object, picking again?"); if(game.DPRetries++ > 100) return "0 0 300"; else return game.pickTeamSpawn(%client); } else { game.DPRetries = 0; return %dp.getTransform(); } } function singlePlayerGame::pickRandomDropPoint(%game, %client) { error("picking random point for "@%client); %group = nameToID("MissionGroup/Teams/team" @ %client.team @ "/DropPoints"); %num = %group.getCount(); %random = getRandom(1,%num); %dp = %group.getObject( %random ); return %dp; } function spawnSinglePlayer() { $player.lives--; %spawn = DefaultGame::pickTeamSpawn(game, $playerTeam); game.createPlayer($player, %spawn); $player.setControlObject($player.player); //messageClient($player, 0, "Respawns Remaining: "@$player.lives); game.equip($player.player, 0); } function Generator::onDisabled(%data, %obj, %prevState) { Parent::onDisabled(%data, %obj, %prevState); if(%obj == nameToId(BaseGen)) //its our primary gen { doText(T4_Warning02); game.MissionCounter = schedule(60000, 0, MissionFailedTimer); setWaypointAt(%obj.position, "Repair Generator"); clockHud.setTime(1); updateTrainingObjectiveHud(obj5); } else if($pref::trainingDifficulty < 2) { if (getRandom() < 0.5 ) doText(T4_ForceFields01); else doText(T4_FFGenDown01); } } function Generator::onEnabled(%data, %obj, %prevState) { Parent::onEnabled(%data, %obj, %prevState); //error("Gen up somewhere"); if(%obj == nameToId(BaseGen)) { cancel(game.MissionCounter); objectiveHud.trainingTimer.setVisible(false); updateTrainingObjectiveHud(obj10); $player.currentWaypoint.delete(); cancel($player.player.trainingTimerHide); doText(T4_GenUp); checkForWin(); //error("its the main gen"); //restore the clock %time = getSimTime() - game.missionTime; %dif = %time /60000; clockHud.setTime(%dif * -1); } } // mortar mount function playerMountWeapon(%tag, %text, %image, %player, %slot) { if( game.firstTime++ < 2) return; // initial weapon mount doesnt count if(%image.getName() $= "MortarImage" && !game.msgMortar) { game.msgMortar = true; doText(T4_TipMortar); } } // station use function StationInvEnter(%a1, %a2, %data, %obj, %colObj) { if(%colObj != $player.player) return; //clearQueue(); //if(!game.blowoff) //blowoff(); if(game.msgEnterInv++ == 1){ doText(T4_tipDefense05); } } function stationTrigger::onEnterTrigger(%data, %obj, %colObj) { Parent::onEnterTrigger(%data, %obj, %colObj); messageClient(%colObj.client, 'msgEnterInvStation', "", %data, %obj, %colObj); } function serverCmdBuildClientTask(%client, %task, %team) { parent::serverCmdBuildClientTask(%client, %task, %team); error("serverCmdBuildClientTask(" @%client@", "@%task@", "@%team@")"); if($pref::trainingDifficulty > 2) return; //hack: we have to get %objective from the parent function // this seems to work %objective = %client.currentAIObjective; error(%client.currentAIObjective SPC %objective.getName()); if ((%objective.getName() $= "AIORepairObject") && (%objective.targetObjectId.getDataBlock().getName() $= "SensorLargePulse")) { //error("repair order issued and forced"); // force the ai %objective.weightLevel1 = 10000; if(!game.issueRepairOrder && game.expectingRepairOrder) { game.issueRepairOrder = true; doText(Any_good, 2000); cameraSpiel(); } } } function CommanderMapGui::onWake(%this) { parent::onWake(%this); if(game.firstSpawn) return; //error("Waking the command map."); messageClient($player, 'commandMapWake', ""); } function CommanderTree::onCategoryOpen(%this, %category, %open) { //error("commander tree button pressed"); parent::onCategoryOpen(%this, %category, %open); if(%category $= "Support" && game.ExpectiongSupportButton) { game.ExpectiongSupportButton = false; doText(ANY_check01); doText(T4_03i, 1000); doText(T4_03j); } if(%category $= "Tactical" && game.ExpectiongTacticalButton) { game.ExpectiongTacticalButton = false; doText(ANY_check02); messageClient($player, 0, "Click on the control box after the turrets name to control the turret."); game.CheckingTurretControl = true; } } // control turret/camera //------------------------------------------------------------------------------ function serverCmdControlObject(%client, %targetId) { parent::serverCmdControlObject(%client, %targetId); if(game.firstSpawn) return; error("Training 4 serverCmdControlObject"); %obj = getTargetObject(%targetId); echo("what do we get back from the parent funtion ? "@%obj); %objType = %obj.getDataBlock().getName(); echo("it is a "@%objType); if(game.CheckingTurretControl) { if(%objType $= "TurretBaseLarge") { game.CheckingTurretControl = false; schedule(3000, game, turretSpielEnd); //error("Debug: You are controlling a turret f00!"); } } // if(game.CheckingCameraControl) { // if(%objType $= "TurretDeployedCamera") { // game.CheckingCameraControl = false; // schedule(3000, $player.player, cameraSpielEnd); // //error("Debug: You are controlling a camera, w00t!"); // } // } } function singlePlayerGame::sensorOnRepaired(%obj, %objName) { //error("singlePlayerGame::sensorOnRepaired called"); Parent::sensorOnRepaired(%obj, %objName); if(game.expectingTowerRepair && !game.playedOpening && !game.firstSpawn) openingSpiel(); } function cameraSpiel() { if(game.firstSpawn) return; doText(T4_tipCamera01); updateTrainingObjectiveHud(obj3); $player.player.setInventory(CameraGrenade , 8); // cheating just in case the player is a dufas game.CheckingCameraControl = true; } function CameraGrenadeThrown::onThrow(%this, %camGren) { Parent::onThrow(%this, %camGren); if(game.CheckingCameraControl && !game.firstSpawn) { messageClient($player, 0, "Go back to the command map to access camera view."); game.CheckingCameraControl = false; game.wakeExpectingCamera = true; updateTrainingObjectiveHud(obj2); doText(T4_tipCamera02); } } //like mission 1 and 2 there is a spiel at the begining function repairSensorTower() { if(game.firstSpawn) return; setWaypointAt(nameToId(Team1SensorLargePulse2).position, "Repair Sensor"); game.expectingTowerRepair = true; doText(T4_01); doText(T4_01b); } function openingSpiel() { if(game.firstSpawn) return; $player.currentWaypoint.delete(); updateTrainingObjectiveHud(obj7); game.playedOpening = true; //doText(T4_01c); doText(T4_02a); doText(T4_03); doText(T4_02); //doText(T4_02b); doText(T4_03a); } function ThreeAEval() { if(game.firstSpawn) return; game.wakeExpectingSquadOrder = true; updateTrainingObjectiveHud(obj2); } function missionSpawnedAI() { if(!game.firstSpawn) { game.firstspawn = true; doText(ANY_warning05); doText(ANY_warning03); // does a playgui check //updateTrainingObjectiveHud(obj5); } } function singlePlayerPlayGuiCheck() { if(CommanderMapGui.open) CommanderMapGui.close(); updateTrainingObjectiveHud(obj10); } function missionWaveDestroyed(%wave) { if(%wave == 1) { doText(T4_06); doText(T4_tipDefense02); } else if(%wave == 2) doText(T4_08); else if( %wave == $numberOfWaves[$pref::TrainingDifficulty] ) { //MessageAll(0, "The last wave is destroyed. This mission would end."); game.allEnemiesKilled = true; checkForWin(); } } function checkForWin() { if(game.allEnemiesKilled && nameToId(BaseGen).isEnabled()) { clearQueue(); doText(T4_10); doText(T4_11); schedule(4000, game, missionComplete, $player.miscMsg[training4win]); } } function cameraSpielEnd() { if(game.firstSpawn) return; doText(T4_tipCamera03); doText(T4_tipCamera04, 2000); doText(T4_controlTurret); game.CheckingTurretControl = true; game.wakeExpectingTurret = true; updateTrainingObjectiveHud(obj4); } function turretSpielEnd() { if(game.firstSpawn) return; doText(T4_tipObjects); doText(T4_CCend, 4000); doText(T4_TipGenerator01, 2000); doText(T4_TipGenerator01a); doText(T4_TipGenerator01b); doText(T4_TipGenerator02, 2000); doText(T4_tipDefense01); // doText(T4_tipDefense06); // doText(T4_tipDefense07); // doText(T4_tipDefense08); // doText(T4_tipDefense09); updateTrainingObjectiveHud(obj9); //game.blowOff = true; //feel free to use the inventory stations } // turret deployment advice and messages function singlePlayerFailDeploy(%tag, %message) { %text = detag(%message); %phrase = getWord(%text, 0) SPC getWord(%text, 1); //echo(%phrase); switch$(%phrase) { case "\c2Item must": if(!game.tipDep1) { game.tipDep1 = true; doText(T4_tipDeploy01); } case "\c2You cannot": if(!game.tipDep2) { game.tipDep2 = true; doText(T4_tipDeploy02); } case "\c2Interference from": if(!game.tipDepT) { game.tipDepT = true; doText(T4_tipDepTurret); } } } // not really a callback but this prolly goes here function cloakingUnitAdded() { if(game.addedCloak++ < 2) { doText(T4_TipDefense03); } } function RepairingObj(%tag, %text, %name, %obj) { if(%obj.getDataBlock().getName() $= "SensorLargePulse" && !game.repairingSensor) { game.repairingSensor = true; schedule(2000, $player.player, doText, T4_01c); } } // equipment ======================================================================= //=================================================================================== //there are a plethora of configs in this mission function SinglePlayerGame::equip(%game, %player, %set) { if(!isObject(%player)) return; //ya start with nothing...NOTHING! %player.clearInventory(); for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); //error("equping Player "@%player@" with set"@%set); switch (%set) { case 0: //echo("player Heavy"); %player.setArmor("Heavy"); %player.setInventory(RepairPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(CameraGrenade,8); %player.setInventory(Mine,3); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 200); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(Mortar, 1); %player.setInventory(MortarAmmo, 10); %player.setInventory(Blaster,1); %player.setInventory(GrenadeLauncher,1); %player.setInventory(GrenadeLauncherAmmo,15); %player.setInventory(TargetingLaser, 1); %player.use("Disc"); %player.weaponCount = 5; case 1: //echo("Light Skirmisher"); %player.setArmor("Light"); %player.setInventory(EnergyPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(ConcussionGrenade,5); %player.setInventory(Blaster,1); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(TargetingLaser, 1); %player.use("Chaingun"); %player.weaponCount = 3; case 2: //script hook in our equip stuff also cloakingUnitAdded(); //echo("Light Assassin Config"); %player.setArmor("Light"); %player.setInventory(CloakingPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(FlashGrenade,5); %player.setInventory(Mine,3); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 20); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(ShockLance,1); %player.setInventory(TargetingLaser, 1); %player.use("Disc"); %player.weaponCount = 3; case 3: //echo("Light Sniper"); %player.setArmor("Light"); %player.setInventory(EnergyPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(ConcussionGrenade,5); %player.setInventory(Chaingun,1); %player.setInventory(ChaingunAmmo,100); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(SniperRifle, 1); %player.setInventory(TargetingLaser, 1); %player.use("SniperRifle"); %player.weaponCount = 3; case 4: echo("Medium Base Rape"); %player.setArmor("Medium"); %player.setInventory(ShieldPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,6); %player.setInventory(Mine,3); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 40); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(ElfGun, 1); %player.setInventory(GrenadeLauncher,1); %player.setInventory(GrenadeLauncherAmmo, 10); %player.setInventory(TargetingLaser, 1); %player.use("GrenadeLauncher"); %player.weaponCount = 4; case 5: //echo("Medium Killing Machine"); %player.setArmor("Medium"); %player.setInventory(AmmoPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,6); %player.setInventory(Mine,3); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 40); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(GrenadeLauncherAmmo, 10); %player.setInventory(MissileLauncher,1); %player.setInventory(MissileLauncherAmmo, 10); %player.setInventory(TargetingLaser, 1); %player.use("Plasma"); %player.weaponCount = 4; case 6: //echo("Medium Wuss"); %player.setArmor("Medium"); %player.setInventory(EnergyPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(ConcussionGrenade,6); %player.setInventory(Blaster, 1); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(Elf, 1); %player.setInventory(Chaingun,1); %player.setInventory(ChaingunAmmo, 150); %player.setInventory(TargetingLaser, 1); %player.use("Disc"); %player.weaponCount = 4; case 7: //echo("Heavy Long Range"); %player.setArmor("Heavy"); %player.setInventory(EnergyPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,8); %player.setInventory(Mine,3); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 50); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(Mortar, 1); %player.setInventory(MortarAmmo, 10); %player.setInventory(MissileLauncher,1); %player.setInventory(MissileLauncherAmmo, 15); %player.setInventory(GrenadeLauncher,1); %player.setInventory(GrenadeLauncherAmmo,15); %player.setInventory(TargetingLaser, 1); %player.use("Mortar"); %player.weaponCount = 5; case 8: //echo("Default Config"); %player.setArmor("Light"); %player.setInventory(RepairKit,1); %player.setInventory(Blaster,1); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(TargetingLaser, 1); %player.use("Blaster"); %player.weaponCount = 3; case 9: //echo("Heavy Rate of Fire"); %player.setArmor("Heavy"); %player.setInventory(AmmoPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(Grenade,8); %player.setInventory(Mine,3); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 200); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(Mortar, 1); %player.setInventory(MortarAmmo, 10); %player.setInventory(Plasma,1); %player.setInventory(PlasmaAmmo, 50); %player.setInventory(GrenadeLauncher,1); %player.setInventory(GrenadeLauncherAmmo,15); %player.setInventory(TargetingLaser, 1); %player.use("Mortar"); %player.weaponCount = 5; case 10: //echo("Heavy Inside Attacker"); %player.setArmor("Heavy"); %player.setInventory(ShieldPack, 1); %player.setInventory(RepairKit,1); %player.setInventory(ConcussionGrenade,8); %player.setInventory(Mine,3); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 50); %player.setInventory(Disc,1); %player.setInventory(DiscAmmo, 15); %player.setInventory(Mortar, 1); %player.setInventory(MortarAmmo, 10); %player.setInventory(ShockLance,1); %player.setInventory(Chaingun,1); %player.setInventory(ChaingunAmmo,200); %player.setInventory(TargetingLaser, 1); %player.use("Mortar"); %player.weaponCount = 5; } } // silly littly functions function flashButton(%buttonName) { %time = 800; %num = 6; for(%i=0; %i<%num; %i++) { schedule( %time*%i, $player.player, "eval", %buttonName@".setVisible(false);"); schedule(%time*%i + %time/2, $player.player, "eval", %buttonName@".setVisible(true);"); schedule(%time*%i, $player.player, serverPlay2d, HudFlashSound); } } function showCommandPulldown(%button) { //this is what I hacked in to make pretty with the showing off of the command tree commanderTree.openCategory(%button, true); mentionPulldown(%button); commanderTree.schedule(3000, openCategory, %button, false); } function affectAllCommandPulldown(%open) { commanderTree.openCategory(Clients, %open); commanderTree.openCategory(Tactical, %open); commanderTree.openCategory(Support, %open); commanderTree.openCategory(Waypoints, %open); commanderTree.openCategory(Objectives, %open); } function mentionPulldown(%button) { switch$(%button) { case "Clients": doText(T4_03b); case "Tactical": doText(T4_03c); case "Support": doText(T4_03d); case "Waypoints": doText(T4_03e); case "Objectives": doText(T4_03f); doText(T4_03g); doText(t4_03h); } } function training4CommandMapWake() { error("training4CommandMapWake Called"); if(game.wakeExpectingSquadOrder && !game.firstSpawn) { game.wakeExpectingSquadOrder = false; // commander map waypoint %pos = nameToId(Base).position; %obj = createClientTarget(-1, %pos); %obj.createWaypoint("Nagakhun Base"); // cmap objective commanderTree.registerEntryType("Objectives", getTag('Base'), false, "commander/MiniIcons/com_flag_grey", "255 255 255"); createTarget(%id, 'Defend', "", "", 'Base', $player.getSensorGroup()); affectAllCommandPulldown(false); //here we go...drop down the thingies schedule( 2500, $player.player, showCommandPulldown, Clients); schedule( 6000, $player.player, showCommandPulldown, Tactical); schedule(10000, $player.player, showCommandPulldown, Support); schedule(14000, $player.player, showCommandPulldown, Waypoints); schedule(18000, $player.player, showCommandPulldown, Objectives); //schedule(24000, $player.player, affectAllCommandPulldown, true); } else if(game.wakeExpectingTurret && !game.firstSpawn) { messageClient($player, 0, "Click on \"Tactical Assets\" to view turrets."); //flashButton(CMDTacticalButton); game.ExpectiongTacticalButton = true; game.wakeExpectingTurret = false; } else if(game.wakeExpectingCamera && !game.firstSpawn) { messageClient($player, 0, "Click on the control box to the right of the camera\'s name to control the camera."); cameraSpielEnd(); game.wakeExpectingCamera = false; } } // Objectives ================================================================== //================================================================================ function missionFailedTimer() { missionFailed($player.miscMsg[training4GenLoss]); } function blowoff() { game.blowoff = true; clearQueue(); doText(Any_Blowoff02, 2000, 1); // okay, the player wants to play huh? // if we are still waiting for the enemies to spawn at this point // cancel that and spawn them now...well, soon if($player.beginSpawn){ cancel($player.beginSpawn); %time = getRandom(1, 20); //error("Blowing off the training: spawning enemies in "@ %time * 1000 @" seconds."); schedule(%time*1000, game, beginTraining4Enemies); } } function findObjbyDescription(%desc, %team) { %q = $objectiveQ[%team]; for(%i = 0; %i < %q.getCount(); %i++) { %objective = %q.getObject(%i); if(%objective.description $= %desc) return %objective; } } function removeDescribedObj( %obj ) { %invDepObj.weightLevel1 = 0; %invDepObj.weightLevel2 = 0; %invDepObj.weightLevel3 = 0; %invDepObj.weightLevel4 = 0; $ObjectiveQ[1].remove(%invDepObj); // clear it in case anyone has picked it up AIClearObjective(%invDepObj); } //===============================================END the training 4 package stuff==== }; // Dialog stuff =================================================================== //================================================================================= // Callbacks //================================================================== //================================================================================ //add callbacks addMessageCallback('MsgDeployFailed', singlePlayerFailDeploy); addMessageCallback('MsgWeaponMount', playerMountWeapon); addMessageCallback('msgEnterInvStation', StationInvEnter); addMessageCallback('MsgRepairPackRepairingObj', RepairingObj); addMessageCallback('commandMapWake', training4CommandMapWake); PK !(SCCscripts/Training5.cs// don't want this executing when building graphs if($OFFLINE_NAV_BUILD) return; echo("-----------------Running Training5"); activatePackage(Training5); //BaseExplosion sound datablock EffectProfile(Training5BaseExplosionEffect) { effectname = "explosions/explosion.xpl27"; minDistance = 20; maxDistance = 100; }; datablock AudioProfile(Training5BaseExplosionSound) { filename = "fx/explosions/explosion.xpl27.wav"; description = AudioDefault3d; effect = Training5BaseExplosionEffect; preload = true; }; //mission variables $numberOfTeammates = 0; $numberOfEnemies[1] = 6; $numberOfEnemies[2] = 6; $numberOfEnemies[3] = 8; $missionBotSkill[1] = 0.0; $missionBotSkill[2] = 0.5; $missionBotSkill[3] = 0.9; $missionEnemyThreshold[1] = 1; $missionEnemyThreshold[2] = 3; $missionEnemyThreshold[3] = 8; $bridgeTime[1] = 30; $bridgeTime[2] = 20; $bridgeTime[3] = 5; package Training5 { //Training5 package functions begin======================================================= function SinglePlayerGame::initGameVars(%game) { // for many of the objectives we are going to periodically // check the players distance vs some object // you could do this much prettier but its going to be very specific // so a cut and paste eyesore will be fine echo("initializing training5 game vars"); %game.targetObject1 = nameToId("ObjectiveGen1"); %game.targetObject2 = nameToId("ObjectiveGen2"); %game.tower = nameToId("MissionGroup/Teams/Team2/tower/tower"); %game.base = nameToId("DBase2"); %game.minimumSafeDistance = 500; %game.West = nameToId(WestBridgeGen); %game.East = nameToId(EastBridgeGen); %game.North = nameToId(NorthBridgeGen); %game.South = nameToId(SouthBridgeGen); } function MP3Audio::play(%this) { //too bad...no mp3 in training } function toggleScoreScreen(%val) { if ( %val ) //error("No Score Screen in training......."); messageClient($player, 0, $player.miscMsg[noScoreScreen]); } function toggleNetDisplayHud( %val ) { // Hello, McFly? This is training! There's no net in training! } function voiceCapture( %val ) { // Uh, who do you think you are talking to? } function ClientCmdSetHudMode(%mode, %type, %node) { parent::ClientCmdSetHudMode(%mode, %type, %node); //TrainingMap.push(); } // get the ball rolling function startCurrentMission(%game) { setFlipFlopSkins(); doText(Any_Waypoint01, 2000); if(getRandom(3) == 1) doText(Any_warning01); setWaypointAt(nameToId(TowerSwitch).position, "Periphery Tower Control"); objectiveDistanceChecks(); updateTrainingObjectiveHud(obj1); // adding a little something for the players followers to do //training5AddEscort($teammate0); // Tower FFs all start off by default // we cheat and disable their hidden generators nameToId(CatwalkFFGen).setDamageState(Disabled); game.West.setDamageState(Disabled); game.East.setDamageState(Disabled); game.North.setDamageState(Disabled); game.South.setDamageState(Disabled); // but we start the rotation %skill = $pref::trainingDifficulty; //%time = 1000 * (10 - %skill * skill ); %time = $bridgeTime[%skill] * 1000; rotateDrawbridgeFFs(%time); setUpDifficultySettings($pref::trainingDifficulty); } function setUpDifficultySettings(%skill) { if(%skill < 2) { nameToId(DownStairsSentry).hide(true); freeTarget(nameToId(DownStairsSentry).getTarget()); nameToId(UpstairsTurret).hide(true); freeTarget(nameToId(UpstairsTurret).getTarget()); } if(%skill == 3) nameToId(SatchelChargePack).hide(true); } function countTurretsAllowed(%type) { return $TeamDeployableMax[%type]; } function getTeammateGlobals() { echo("You have no teammates in this mission"); } function FlipFlop::objectiveInit(%data, %flipflop) { } function giveall() { error("When the going gets tough...wussies like you start cheating!"); messageClient($player, 0, "Cheating eh? What\'s next? Camping?"); } function kobayashi_maru() { $testCheats = true; commandToServer('giveAll'); } // Distance Check ============================================================= // Ive never done this before :P but im going to use a periodic self-scheduling // distance checking mechanism in this mission also function objectiveDistanceChecks() { %playerLocation = $player.player.position; if(!%playerLocation) { schedule(5000, game, objectiveDistanceChecks); return; } // %baseDist = vectorDist(%playerLocation, %game.base.position); // if(%baseDist < 600 && !%game.training5SwitchObjective && !%game.turretsWarn){ // %game.turretsWarn = true; // doText(Any_warning06); // } %baseDist = vectorDist(%playerLocation, game.base.position); if(%baseDist < 200 && game.respawnPoint == 1) { game.respawnPoint = 2; return; // kill the distCheck } %dist = vectorDist(%playerLocation, game.tower.position); //error("Tower Dist = "@%dist); if( %dist < 400 && !game.t5distcheck1) { game.t5distcheck1 = true; doText(T5_04); return; } if( %dist > 200 && game.training5SwitchObjective && !game.tipFirepower) { %packImage = $player.player.getMountedImage($backPackSlot).getName(); if(%packImage !$= "SatchelChargeImage" && %packImage !$= "InventoryDeployableImage") { game.tipFirepower = true; doText(T5_tipFirepower); } } schedule(5000, game, objectiveDistanceChecks); } //====================================================================================== // Objective Generators //====================================================================================== function GeneratorLarge::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) { if(%targetObject == game.targetObject1 || %targetObject == game.targetObject2) %message = training5ObjectiveGenDamaged(%targetObject, %damageType); else Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType); if(%message) training5messageDamageFailed(); } function training5ObjectiveGenDamaged(%targetObject, %damageType) { //error("training5ObjectiveGenDamaged("@%targetObject@", "@%damageType@")"); if(game.genDestroyed[%targetObject]) return false; if(%damageType != $DamageType::SatchelCharge) { return true; } game.objectiveDestroyed = true; %targetObject.applyDamage(%targetObject.getDataBlock().maxDamage); return false; } function training5messageDamageFailed() { if(!game.tooSoonMsg && !game.objectiveDestroyed) { game.tooSoonMsg = true; schedule(15000, game, eval, "game.tooSoonMsg = false;"); messageClient($player, 0, $player.miscMsg[genAttackNoSatchel]); training5easySatchelWaypoint(); } } function training5easySatchelWaypoint() { if($pref::trainingDifficulty == 1 && $player.player.getMountedImage($backPackSlot).getName() !$= "SatchelChargeImage" && !game.satchelWaypointSet) { %waypoint = new WayPoint() { position = nameToId(SatchelChargePack).position; rotation = "1 0 0 0"; scale = "1 1 1"; dataBlock = "WayPointMarker"; lockCount = "0"; homingCount = "0"; name = "Satchel Charge"; team = 1; locked = "true"; }; $player.satchelWaypoint = %waypoint; game.satchelWaypointSet = true; } } //====================================================================================== function AIEngageTask::assume(%task, %client) { Parent::assume(%task, %client); if(%client.team != $playerTeam) game.biodermAssume(%client); } // ============================================================================ function singlePlayerGame::onAIRespawn(%game, %client) { if(! isObject("MissionCleanup/TeamDrops2")) { //this is the snippet of script from default games that puts teamdrops // into the mission cleanup group...slightly modified to suit our needs %dropSet = new SimSet("TeamDrops2"); MissionCleanup.add(%dropSet); %spawns = nameToID("MissionGroup/Teams/team2/TeamDrops"); if(%spawns != -1) { %count = %spawns.getCount(); for(%i = 0; %i < %count; %i++) %dropSet.add(%spawns.getObject(%i)); } } parent:: onAIRespawn(%game, %client); } // ============================================================================ function singlePlayerGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement) { %teamCount = getPlayersOnTeam(%clVictim.team); //echo("Team count:" SPC %teamCount); %maintNum = $missionEnemyThreshold[$pref::trainingDifficulty]; //echo("Maintain:" SPC %maintNum); %clVictim.useSpawnSphere = true; // this will respawn the AI if if( %teamCount < %maintNum ) DefaultGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement); } function singleplayerGame::pickTeamSpawn(%game, %client, %respawn) { if(%client.useSpawnSphere) DefaultGame::pickTeamSpawn(%game, %client.team); else parent::pickTeamSpawn(%game, %client, %respawn); } function SinglePlayerGame::equip(%game, %player, %set) { if(!isObject(%player)) return; %player.clearInventory(); if(!%set) %set = %player.client.equipment; for(%i =0; %i<$InventoryHudCount; %i++) %player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1); %player.client.clearBackpackIcon(); %player.setArmor("Medium"); %player.setInventory(SatchelCharge, 1); %player.setInventory(RepairKit, 1); %player.setInventory(ConcussionGrenade, 8); %player.setInventory(Mine, 3); %player.setInventory(Plasma, 1); %player.setInventory(PlasmaAmmo, 40); %player.setInventory(Chaingun, 1); %player.setInventory(ChaingunAmmo, 200); %player.setInventory(Disc, 1); %player.setInventory(DiscAmmo, 15); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(GrenadeLauncherAmmo, 15); %player.setInventory(TargetingLaser, 1); %player.use("Disc"); %player.weaponCount = 4; } //the generator destroyed trigers the detonation sequence function Generator::onDestroyed(%data, %destroyedObj) { //error("GeneratorLarge::onDestroyed"); if(%destroyedObj == game.targetObject1 || %destroyedObj == game.targetObject2) if(!game.detonationSequenceStarted) { game.detonationSequenceStarted = true; error("The satchel waypoint is:" SPC $player.satchelWaypoint); $player.satchelWaypoint.delete(); detonationSequence(); updateTrainingObjectiveHud(obj4); game.respawnPoint = 3; $missionEnemyThreshold[1] = 0; $missionEnemyThreshold[2] = 0; $missionEnemyThreshold[3] = 0; } Parent::onDestroyed(%data, %destroyedObj); } function FlipFlop::objectiveInit(%data, %flipflop) { } function FlipFlop::playerTouch(%data, %flipFlop, %player) { //error("singlePlayer::playerTouchFlipFlop Training5"); //echo("has been touched before? " SPC game.training5SwitchObjective); Parent::playerTouch(%data, %flipFlop, %player); //This disables the base door FFs %state = (%flipFlop.team == $playerTeam ? "Disabled" : "Enabled"); game.targetObject2.setDamageState(%state); if(!game.training5SwitchObjective) { game.training5SwitchObjective = true; doText(T5_05, 10000); doText(T5_05b); doText(T5_05a); schedule(10000, game, setWaypointAt, game.targetObject2.getWorldBoxCenter(), "Reactor Regulator" ); schedule(10000, game, updateTrainingObjectiveHud , obj2); //start the distance check again objectiveDistanceChecks(); game.respawnPoint = 1; rotateDrawbridgeFFs(false); } } //EndingExplosionStuff========================================================================= function detonationSequence() { // first a little eye candy %oldEmitter = nameToId(LavaSmoke); %oldEmitter.delete(); %newEmitter = new ParticleEmissionDummy(LavaSmoke) { position = "-462.4 -366.791 5.12867"; rotation = "1 0 0 0"; scale = "1 1 1"; dataBlock = "defaultEmissionDummy"; emitter = "AfterT5"; velocity = "1"; }; %detonationTime = 1000 * 90; // 90 is a guess, at least 67 before you cut lines schedule(3000, game, doText, T5_06); //Get Out Hurry! schedule(%detonationTime, game, detonateBase ); //BOOM //moved to t5_08d,eval schedule(%detonationTime - 5000, game, doText, T5_08urgent); //5..4..3..2..1 schedule(%detonationTime - 9000, game, doText, T5_07); //ComeOn schedule(%detonationTime - 10000, game, doText, T5_06d); //10 schedule(%detonationTime - 30000, game, doText, T5_06c); // 30 secs schedule(%detonationTime - 64000, game, doText, T5_06a); //reaction building fast schedule(%detonationTime - 60000, game, doText, T5_06b); //1 min } function detonateBase() { %playerDist = vectorDist($player.player.position, game.base.position); //BOOM //schedule(0.33 * %playerDist, game, serverplay2d, Training5BaseExplosionSound); schedule(0.33 * %playerDist, game, damagePlayersInBlast, game.minimumSafeDistance); $player.player.setWhiteOut(8); //messageAll(0, "You were "@%playerDist@"meters away. Minimum safe distance is "@game.minimumSafeDistance); if( %playerDist < game.minimumSafeDistance || !$player.player) { schedule(5000, game, missionFailed, $player.miscMsg[training5loss] ); moveMap.pop(); } else { //messageAll(0, "You won!"); schedule(5000, game, doText, T5_09, 3000); schedule(13000, game, messageBoxOK, "Victory", $player.miscMsg[training5win], "Canvas.popDialog(MessageBoxOKDlg); schedule(1000, game, trainingComplete);"); moveMap.schedule(13000, "pop"); } } function trainingComplete() { %skill = $pref::trainingDifficulty; switch (%skill) { case 2: %msg = "trainingOverMed"; case 3: %msg = "trainingOverHard"; default: %msg = "trainingOverEasy"; } missionComplete( $player.miscMsg[%msg] ); } function damagePlayersInBlast(%minDist) { Canvas.popDialog(MessageBoxOKDlg); Canvas.popDialog(MessageBoxYesNoDlg); serverPlay2d(Training5BaseExplosionSound); %num = ClientGroup.getCount(); for(%i = 0; %i < %num; %i++) { %client = clientGroup.getObject(%i); if(%client.player) { %Dist = vectorDist(%client.player.position, game.base.position); if(%dist < %minDist) { if(%client != $player) %client.player.scriptKill($DamageType::Explosion); else { moveMap.pop(); if($firstperson) toggleFirstPerson($player); serverConnection.setBlackout(true, 3000); %client.player.setActionThread(Death11, true); %client.player.setDamageFlash(0.75); } } else $player.player.setWhiteOut(12); } } } // turninig off the Mission area on this one too folks function SinglePlayerGame::leaveMissionArea(%game, %player) { } function SinglePlayerGame::enterMissionArea(%game, %player) { } function rotateDrawbridgeFFs(%time) { if(%time == 0) { // catwalks on nameToId(CatwalkFFGen).setDamageState(Enabled); // stop rotation cancel(game.FFRotate); // set Enabled All bridges game.West.setDamageState(Enabled); game.East.setDamageState(Enabled); game.North.setDamageState(Enabled); game.South.setDamageState(Enabled); } else { // start these bad boys rotating if(game.activeBridgeSet == 1) { game.West.setDamageState(Enabled); game.East.setDamageState(Enabled); game.North.setDamageState(Disabled); game.South.setDamageState(Disabled); game.activeBridgeSet = 2; } else { game.West.setDamageState(Disabled); game.East.setDamageState(Disabled); game.North.setDamageState(Enabled); game.South.setDamageState(Enabled); game.activeBridgeSet = 1; } game.FFRotate = schedule(%time, game, rotateDrawbridgeFFs, %time); } } // helpful satchel charge instructions function armSatchelCharge(%satchel) { %deployer = %satchel.sourceObject; messageClient(%deployer.client, 0, "\c2Satchel Charge Armed! Press" SPC findTrainingControlButtons(useBackPack) SPC"to detonate."); if(!game.msgSatchelActivate) { game.msgSatchelActivate = true; doText(T5_tipSatchel01); } parent::armSatchelCharge(%satchel); } function Pack::onInventory(%data, %obj, %amount) { %oldSatchelCharge = (%obj.thrownChargeId ? true : false); Parent::onInventory(%data, %obj, %amount); %nowSatchelCharge = (%obj.thrownChargeId ? true : false); if(%oldSatchelCharge && !%nowSatchelCharge) messageClient(%obj.client, 0, "\c2You got a pack and nullified your satchel charge."); } function singlePlayerGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement) { %hadSatchelCharge = (%clvictim.player.thrownChargeId ? true : false); if(%hadSatchelCharge) schedule(1500, game, messageClient, %clVictim, 0, "Your satchel charge has been nullified."); Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement); } function missionClientKilled() { //no console spam } //Training5 package functions end======================================================= }; PK !( Fscripts/TrainingGui.cs//------------------------------------------------------------------------------ // // TrainingGui.cs // //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function LaunchTraining() { LaunchTabView.viewTab( "TRAINING", TrainingGui, 0 ); } //------------------------------------------------------------------------------ function TrainingGui::onWake( %this ) { Canvas.pushDialog( LaunchToolbarDlg ); %this.soundHandle = 0; %this.briefEventCount = 0; %this.briefWAV = ""; %ct = 1; %fobject = new FileObject(); %search = "missions/*.mis"; TrainingMissionList.clear(); for ( %file = findFirstFile( %search ); %file !$= ""; %file = findNextFile( %search ) ) { %name = fileBase(%file); // get the mission name if ( !%fobject.openForRead( %file ) ) continue; %typeList = "None"; while( !%fobject.isEOF() ) { %line = %fobject.readLine(); if ( getSubStr( %line, 0, 18 ) $= "// MissionTypes = " ) { %typeList = getSubStr( %line, 18, 1000 ); break; } } if ( strstr( %typeList, "SinglePlayer" ) != -1 ) { // Get the mission display name: %displayName = %name; while ( !%fobject.isEOF() ) { %line = %fobject.readLine(); if ( getSubStr( %line, 0, 16 ) $= "// PlanetName = " ) { %displayName = getSubStr( %line, 16, 1000 ); // Strip the date: %pos = strpos( %displayName, "," ); if ( %pos != -1 ) %displayName = getSubStr( %displayName, 0, %pos ); break; } } TrainingMissionList.addRow( %ct++, %displayName TAB %name ); } %fobject.close(); } TrainingMissionList.sort( 1 ); TrainingMissionList.setSelectedRow( 0 ); if ( $pref::TrainingDifficulty > 0 && $pref::TrainingDifficulty < 4 ) TrainingDifficultyMenu.setSelected( $pref::TrainingDifficulty ); else TrainingDifficultyMenu.setSelected( 1 ); } //------------------------------------------------------------------------------ function TrainingGui::onSleep( %this ) { %this.stopBriefing(); Canvas.popDialog(LaunchToolbarDlg); } //------------------------------------------------------------------------------ function TrainingGui::setKey( %this ) { } //------------------------------------------------------------------------------ function TrainingGui::onClose( %this ) { } //------------------------------------------------------------------------------ function TrainingDifficultyMenu::onAdd( %this ) { %this.add( "Easy", 1 ); %this.add( "Medium", 2 ); %this.add( "Hard", 3 ); } //------------------------------------------------------------------------------ function TrainingDifficultyMenu::onSelect( %this, %id, %text ) { $pref::TrainingDifficulty = %id; } //------------------------------------------------------------------------------ function TrainingMissionList::onSelect( %this, %id, %text ) { TrainingGui.stopBriefing(); %fileName = "missions/" @ getField( %text, 1 ) @ ".mis"; %file = new FileObject(); %state = 0; if ( %file.openForRead( %fileName ) ) { // Get the mission briefing text: while ( !%file.isEOF() ) { %line = %file.readLine(); if ( %state == 0 && %line $= "//--- MISSION BRIEFING BEGIN ---" ) %state = 1; else if ( %state > 0 && %line $= "//--- MISSION BRIEFING END ---" ) break; else if ( %state == 1 ) { %briefText = %briefText @ getSubStr( %line, 2, 1000 ); %state = 2; } else if ( %state == 2 ) %briefText = %briefText NL getSubStr( %line, 2, 1000 ); } // Get the mission briefing WAV file: while ( !%file.isEOF() ) { %line = %file.readLine(); if ( getSubStr( %line, 0, 17 ) $= "// BriefingWAV = " ) { %briefWAV = getSubStr( %line, 17, 1000 ); break; } } // Get the bitmap name: while ( !%file.isEOF() ) { %line = %file.readLine(); if ( getSubStr( %line, 0, 12 ) $= "// Bitmap = " ) { %briefPic = getSubStr( %line, 12, 1000 ); break; } } %file.close(); } else error( "Failed to open Single Player mission file " @ %fileName @ "!" ); if (!isDemo()) %bmp = "gui/" @ %briefPic @ ".png"; else %bmp = "gui/" @ %briefPic @ ".bm8"; if ( isFile( "textures/" @ %bmp ) ) { TrainingPic.setBitmap( %bmp ); TrainingPicFrame.setVisible( true ); } else { TrainingPic.setBitmap( "" ); TrainingPicFrame.setVisible( false ); } TrainingPlayBtn.setActive( %briefWAV !$= "" ); TrainingBriefingText.setValue( %briefText ); TrainingBriefingScroll.scrollToTop(); TrainingGui.WAVBase = firstWord( %briefWAV ); TrainingGui.WAVCount = restWords( %briefWAV ); %file.delete(); //if ( TrainingPlayTgl.getValue() ) // TrainingGui.startBriefing(); } //------------------------------------------------------------------------------ function TrainingPlayTgl::onAction( %this ) { if ( %this.getValue() ) { if ( TrainingMissionList.getSelectedId() != -1 ) TrainingGui.startBriefing(); } else TrainingGui.stopBriefing(); } //-------------------------------------------------------- function TrainingGui::toggleBriefing( %this ) { if ( %this.soundHandle $= "" ) %this.startBriefing(); else %this.stopBriefing(); } //-------------------------------------------------------- function TrainingGui::startBriefing( %this ) { %this.stopBriefing(); if ( %this.WAVBase !$= "" ) { %this.instance = %this.instance $= "" ? 0 : %this.instance; %this.playNextBriefWAV( %this.WAVBase, 0, %this.WAVCount, %this.instance ); } } //-------------------------------------------------------- function TrainingGui::playNextBriefWAV( %this, %wavBase, %id, %count, %instance ) { if ( %instance == %this.instance ) { if ( %id < %count ) { %wav = "voice/Training/Briefings/" @ %wavBase @ ".brief0" @ ( %id + 1 ) @ ".wav"; %this.soundHandle = alxCreateSource( AudioGui, %wav ); alxPlay( %this.soundHandle ); // Schedule the next WAV: %delay = alxGetWaveLen( %wav ) + 500; %this.schedule( %delay, playNextBriefWAV, %wavBase, %id + 1, %count, %instance ); } else { // We're all done! %this.soundHandle = ""; } } } //-------------------------------------------------------- function TrainingGui::stopBriefing( %this ) { if ( %this.soundHandle !$= "" ) { alxStop( %this.soundHandle ); %this.soundHandle = ""; %this.instance++; } } //-------------------------------------------------------- function TrainingGui::startTraining( %this ) { MessagePopup( "STARTING MISSION", "Initializing, please wait..." ); Canvas.repaint(); cancelServerQuery(); %file = getField( TrainingMissionList.getValue(), 1 ); $ServerName = "Single Player Training"; $HostGameType = "SinglePlayer"; CreateServer( %file, "SinglePlayer" ); localConnect( "Lone Wolf", "Human Male", "swolf", "Male1" ); } PK sH- 66scripts/admin.cs// These have been secured against all those wanna-be-hackers. $VoteMessage["VoteAdminPlayer"] = "Admin Player"; $VoteMessage["VoteKickPlayer"] = "Kick Player"; $VoteMessage["BanPlayer"] = "Ban Player"; $VoteMessage["VoteChangeMission"] = "change the mission to"; $VoteMessage["VoteTeamDamage", 0] = "enable team damage"; $VoteMessage["VoteTeamDamage", 1] = "disable team damage"; $VoteMessage["VoteTournamentMode"] = "change the server to"; $VoteMessage["VoteFFAMode"] = "change the server to"; $VoteMessage["VoteChangeTimeLimit"] = "change the time limit to"; $VoteMessage["VoteMatchStart"] = "start the match"; $VoteMessage["VoteGreedMode", 0] = "enable Hoard Mode"; $VoteMessage["VoteGreedMode", 1] = "disable Hoard Mode"; $VoteMessage["VoteHoardMode", 0] = "enable Greed Mode"; $VoteMessage["VoteHoardMode", 1] = "disable Greed Mode"; function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %playerVote) { //DEMO VERSION - only voteKickPlayer is allowed if ((isDemo()) && %typeName !$= "VoteKickPlayer") { messageClient(%client, '', "All voting options except to kick a player are disabled in the DEMO VERSION."); return; } // haha - who gets the last laugh... No admin for you! if( %typeName $= "VoteAdminPlayer" && !$Host::allowAdminPlayerVotes ) return; %typePass = true; // if not a valid vote, turn back. if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteTeamDamage" ) if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteHoardMode" ) if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteGreedMode" ) %typePass = false; if(( $VoteMessage[ %typeName, $TeamDamage ] $= "" && %typeName $= "VoteTeamDamage" )) %typePass = false; if( !%typePass ) return; // -> bye ;) // z0dd - ZOD, 10/03/02. This was busted, BanPlayer was never delt with. if( %typeName $= "BanPlayer" ) { if( !%client.isSuperAdmin || %arg1.isAdmin ) { return; // -> bye ;) } else { ban( %arg1, %client ); return; } } %isAdmin = ( %client.isAdmin || %client.isSuperAdmin ); // keep these under the server's control. I win. if( !%playerVote ) %actionMsg = $VoteMessage[ %typeName ]; else if( %typeName $= "VoteTeamDamage" || %typeName $= "VoteGreedMode" || %typeName $= "VoteHoardMode" ) %actionMsg = $VoteMessage[ %typeName, $TeamDamage ]; else %actionMsg = $VoteMessage[ %typeName ]; if( !%client.canVote && !%isAdmin ) return; if ( !%isAdmin || ( ( %arg1.isAdmin && ( %client != %arg1 ) ) ) ) { %teamSpecific = false; %gender = (%client.sex $= "Male" ? 'he' : 'she'); if ( Game.scheduleVote $= "" ) { %clientsVoting = 0; //send a message to everyone about the vote... if ( %playerVote ) { %teamSpecific = ( %typeName $= "VoteKickPlayer" ) && ( Game.numTeams > 1 ); %kickerIsObs = %client.team == 0; %kickeeIsObs = %arg1.team == 0; %sameTeam = %client.team == %arg1.team; if( %kickeeIsObs ) { %teamSpecific = false; %sameTeam = false; } if(( !%sameTeam && %teamSpecific) && %typeName !$= "VoteAdminPlayer") { messageClient(%client, '', "\c2Player votes must be team based."); return; } // kicking is team specific if( %typeName $= "VoteKickPlayer" ) { if(%arg1.isSuperAdmin) { messageClient(%client, '', '\c2You can not %1 %2, %3 is a Super Admin!', %actionMsg, %arg1.name, %gender); return; } Game.kickClient = %arg1; Game.kickClientName = %arg1.name; Game.kickGuid = %arg1.guid; Game.kickTeam = %arg1.team; if(%teamSpecific) { for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { %cl = ClientGroup.getObject( %idx ); if (%cl.team == %client.team && !%cl.isAIControlled()) { messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name); %clientsVoting++; } } } else { for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { %cl = ClientGroup.getObject( %idx ); if ( !%cl.isAIControlled() ) { messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name); %clientsVoting++; } } } } else { for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { %cl = ClientGroup.getObject( %idx ); if ( !%cl.isAIControlled() ) { messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name); %clientsVoting++; } } } } else if ( %typeName $= "VoteChangeMission" ) { for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { %cl = ClientGroup.getObject( %idx ); if ( !%cl.isAIControlled() ) { messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3 (%4).', %client.name, %actionMsg, %arg1, %arg2 ); %clientsVoting++; } } } else if (%arg1 !$= 0) { if (%arg2 !$= 0) { if(%typeName $= "VoteTournamentMode") { %admin = getAdmin(); if(%admin > 0) { for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { %cl = ClientGroup.getObject( %idx ); if ( !%cl.isAIControlled() ) { messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 Tournament Mode (%3).', %client.name, %actionMsg, %arg1); %clientsVoting++; } } } else { messageClient( %client, 'clientMsg', 'There must be a server admin to play in Tournament Mode.'); return; } } else { for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { %cl = ClientGroup.getObject( %idx ); if ( !%cl.isAIControlled() ) { messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3 %4.', %client.name, %actionMsg, %arg1, %arg2); %clientsVoting++; } } } } else { for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { %cl = ClientGroup.getObject( %idx ); if ( !%cl.isAIControlled() ) { messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1); %clientsVoting++; } } } } else { for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ ) { %cl = ClientGroup.getObject( %idx ); if ( !%cl.isAIControlled() ) { messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2.', %client.name, %actionMsg); %clientsVoting++; } } } // open the vote hud for all clients that will participate in this vote if(%teamSpecific) { for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) { %cl = ClientGroup.getObject( %clientIndex ); if(%cl.team == %client.team && !%cl.isAIControlled()) messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100)); } } else { for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) { %cl = ClientGroup.getObject( %clientIndex ); if ( !%cl.isAIControlled() ) messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100)); } } clearVotes(); Game.voteType = %typeName; Game.scheduleVote = schedule( ($Host::VoteTime * 1000), 0, "calcVotes", %typeName, %arg1, %arg2, %arg3, %arg4 ); %client.vote = true; messageAll('addYesVote', ""); if(!%client.team == 0) clearBottomPrint(%client); } else messageClient( %client, 'voteAlreadyRunning', '\c2A vote is already in progress.' ); } else { if ( Game.scheduleVote !$= "" && Game.voteType $= %typeName ) { messageAll('closeVoteHud', ""); cancel(Game.scheduleVote); Game.scheduleVote = ""; } // if this is a superAdmin, don't kick or ban if(%arg1 != %client) { if(!%arg1.isSuperAdmin) { // Set up kick/ban values: if ( %typeName $= "VoteBanPlayer" || %typeName $= "VoteKickPlayer" ) { Game.kickClient = %arg1; Game.kickClientName = %arg1.name; Game.kickGuid = %arg1.guid; Game.kickTeam = %arg1.team; } //Tinman - PURE servers can't call "eval" //Mark - True, but neither SHOULD a normal server // - thanks Ian Hardingham Game.evalVote(%typeName, true, %arg1, %arg2, %arg3, %arg4); } else messageClient(%client, '', '\c2You can not %1 %2, %3 is a Super Admin!', %actionMsg, %arg1.name, %gender); } } %client.canVote = false; %client.rescheduleVote = schedule( ($Host::voteSpread * 1000) + ($Host::voteTime * 1000) , 0, "resetVotePrivs", %client ); } function resetVotePrivs( %client ) { //messageClient( %client, '', 'You may now start a new vote.'); %client.canVote = true; %client.rescheduleVote = ""; } function serverCmdSetPlayerVote(%client, %vote) { // players can only vote once if( %client.vote $= "" ) { %client.vote = %vote; if(%client.vote == 1) messageAll('addYesVote', ""); else messageAll('addNoVote', ""); commandToClient(%client, 'voteSubmitted', %vote); } } function calcVotes(%typeName, %arg1, %arg2, %arg3, %arg4) { if(%typeName $= "voteMatchStart") if($MatchStarted || $countdownStarted) return; for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) { %cl = ClientGroup.getObject( %clientIndex ); messageClient(%cl, 'closeVoteHud', ""); if ( %cl.vote !$= "" ) { if ( %cl.vote ) { Game.votesFor[%cl.team]++; Game.totalVotesFor++; } else { Game.votesAgainst[%cl.team]++; Game.totalVotesAgainst++; } } else { Game.votesNone[%cl.team]++; Game.totalVotesNone++; } } //Tinman - PURE servers can't call "eval" //Mark - True, but neither SHOULD a normal server // - thanks Ian Hardingham Game.evalVote(%typeName, false, %arg1, %arg2, %arg3, %arg4); Game.scheduleVote = ""; Game.kickClient = ""; clearVotes(); } function clearVotes() { for(%clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++) { %client = ClientGroup.getObject(%clientIndex); %client.vote = ""; messageClient(%client, 'clearVoteHud', ""); } for(%team = 1; %team < 5; %team++) { Game.votesFor[%team] = 0; Game.votesAgainst[%team] = 0; Game.votesNone[%team] = 0; Game.totalVotesFor = 0; Game.totalVotesAgainst = 0; Game.totalVotesNone = 0; } } // Tournament mode Stuff----------------------------------- function setModeFFA( %mission, %missionType ) { if( $Host::TournamentMode ) { $Host::TournamentMode = false; if( isObject( Game ) ) Game.gameOver(); loadMission(%mission, %missionType, false); } } //------------------------------------------------------------------ function setModeTournament( %mission, %missionType ) { if( !$Host::TournamentMode ) { $Host::TournamentMode = true; if( isObject( Game ) ) Game.gameOver(); loadMission(%mission, %missionType, false); } } PK !(8p'+i+i scripts/ai.cs//-----------------------------------// // AI SCRIPT FUNCTIONS // //-----------------------------------// //first, exec the supporting scripts exec("scripts/aiDebug.cs"); exec("scripts/aiDefaultTasks.cs"); exec("scripts/aiObjectives.cs"); exec("scripts/aiInventory.cs"); exec("scripts/aiChat.cs"); exec("scripts/aiHumanTasks.cs"); exec("scripts/aiObjectiveBuilder.cs"); exec("scripts/aiBotProfiles.cs"); $AIModeStop = 0; $AIModeWalk = 1; $AIModeGainHeight = 2; $AIModeExpress = 3; $AIModeMountVehicle = 4; $AIClientLOSTimeout = 15000; //how long a client has to remain out of sight of the bot //before the bot "can't see" the client anymore... $AIClientMinLOSTime = 10000; //how long a bot will search for a client //-----------------------------------// //Objective weights - level 1 $AIWeightCapFlag[1] = 5000; //range 5100 to 5320 $AIWeightKillFlagCarrier[1] = 4800; //range 4800 to 5120 $AIWeightReturnFlag[1] = 5001; //range 5101 to 5321 $AIWeightDefendFlag[1] = 3900; //range 4000 to 4220 $AIWeightGrabFlag[1] = 3850; //range 3950 to 4170 $AIWeightDefendFlipFlop[1] = 3900; //range 4000 to 4220 $AIWeightCaptureFlipFlop[1] = 3850; //range 3850 to 4170 $AIWeightAttackGenerator[1] = 3100; //range 3200 to 3520 $AIWeightRepairGenerator[1] = 3200; //range 3300 to 3620 $AIWeightDefendGenerator[1] = 3100; //range 3200 to 3420 $AIWeightMortarTurret[1] = 3400; //range 3500 to 3600 $AIWeightLazeObject[1] = 3200; //range 3300 to 3400 $AIWeightRepairTurret[1] = 3100; //range 3200 to 3420 $AIWeightAttackInventory[1] = 2900; //range 2800 to 2920 $AIWeightRepairInventory[1] = 2900; //range 2800 to 2920 $AIWeightEscortOffense[1] = 2900; //range 2800 to 2920 $AIWeightEscortCapper[1] = 3250; //range 3350 to 3470 //used to allow a bot to finish tasks once started. $AIWeightContinueDeploying = 4250; $AIWeightContinueRepairing = 4250; //Objective weights from human $AIWeightHumanIssuedCommand = 4450; $AIWeightHumanIssuedEscort = 4425; //Objective weights - level 2 $AIWeightCapFlag[2] = 0; //only one person can ever cap a flag $AIWeightKillFlagCarrier[2] = 4800; //range 4800 to 5020 $AIWeightReturnFlag[2] = 4100; //range 4200 to 4320 $AIWeightDefendFlag[2] = 2000; //range 2100 to 2220 $AIWeightGrabFlag[2] = 2000; //range 2100 to 2220 $AIWeightDefendFlipFlop[2] = 2000; //range 2100 to 2220 $AIWeightDefendFlipFlop[3] = 1500; //range 1600 to 1720 $AIWeightDefendFlipFlop[4] = 1000; //range 1100 to 1220 $AIWeightAttackGenerator[2] = 1600; //range 1700 to 1920 $AIWeightRepairGenerator[2] = 1600; //range 1700 to 1920 $AIWeightDefendGenerator[2] = 1500; //range 1600 to 1720 $AIWeightAttackInventory[2] = 1400; //range 1500 to 1720 $AIWeightRepairInventory[2] = 1400; //range 1500 to 1720 $AIWeightMortarTurret[2] = 1000; //range 1100 to 1320 $AIWeightLazeObject[2] = 0; //no need to have more than one targetter $AIWeightRepairTurret[2] = 1000; //range 1100 to 1320 $AIWeightEscortOffense[2] = 2900; //range 3300 to 3420 $AIWeightEscortCapper[2] = 3000; //range 3100 to 3220 function AIInit() { AISlicerInit(); installNavThreats(); NavDetectForceFields(); // ShowFPS(); //enable the use of grenades $AIDisableGrenades = false; $AIDisableChat = false; //create the "objective delete set" if(nameToId("AIBombLocationSet") <= 0) { $AIBombLocationSet = new SimSet("AIBombLocationSet"); MissionCleanup.add($AIBombLocationSet); } //create the Inventory group if(nameToId("AIStationInventorySet") <= 0) { $AIInvStationSet = new SimSet("AIStationInventorySet"); MissionCleanup.add($AIInvStationSet); } //create the Item group if (nameToId("AIItemSet") <= 0) { $AIItemSet = new SimSet("AIItemSet"); MissionCleanup.add($AIItemSet); } //create the Item group if (nameToId("AIGrenadeSet") <= 0) { $AIGrenadeSet = new SimSet("AIGrenadeSet"); MissionCleanup.add($AIGrenadeSet); } //create the weapon group if (nameToId("AIWeaponSet") <= 0) { $AIWeaponSet = new SimSet("AIWeaponSet"); MissionCleanup.add($AIWeaponSet); } //create the deployed turret group if (nameToID("AIRemoteTurretSet") <= 0) { $AIRemoteTurretSet = new SimSet("AIRemoteTurretSet"); MissionCleanup.add($AIRemoteTurretSet); } //create the deployed turret group if (nameToID("AIDeployedMineSet") <= 0) { $AIDeployedMineSet = new SimSet("AIDeployedMineSet"); MissionCleanup.add($AIDeployedMineSet); } //create the deployed turret group if (nameToID("AIVehicleSet") <= 0) { $AIVehicleSet = new SimSet("AIVehicleSet"); MissionCleanup.add($AIVehicleSet); } %missionGroupFolder = nameToID("MissionGroup"); %missionGroupFolder.AIMissionInit(); } // this is called at mission load by the specific game type function AIInitObjectives(%team, %game) { %group = nameToID("MissionGroup/Teams/team" @ %team @ "/AIObjectives"); if(%group < 0) return; // opps, there is no Objectives set for this team. // add the grouped objectives to the teams Q %count = %group.getCount(); for (%i = 0; %i < %count; %i++) { %objective = %group.getObject(%i); if (%objective.getClassName() !$= "AIObjective") { %grpCount = %objective.getCount(); for (%j = 0; %j < %grpCount; %j++) { %grpObj = %objective.getObject(%j); if (%objective.gameType $= "" || %objective.gameType $= "all") %objType = ""; else %objType = %objective.gameType @ "Game"; if (%objType $= "" || %objType $= %game.class) { %grpObj.group = %objective; $ObjectiveQ[%team].add(%grpObj); } } } } // add the non-grouped objectives to the teams Q %count = %group.getCount(); for(%i = 0; %i < %count; %i++) { %objective = %group.getObject(%i); //if the objective is not an "AIObjective", assume it's a group and continue if (%objective.getClassName() !$= "AIObjective") continue; if (%objective.gameType $= "" || %objective.gameType $= "all") %objType = ""; else %objType = %objective.gameType @ "Game"; if (%objType $= "" || %objType $= %game.class) { %objective.group = ""; $ObjectiveQ[%team].add(%objective); } } // initialize the objectives %count = $ObjectiveQ[%team].getCount(); for(%i = 0; %i < %count; %i++) { %objective = $ObjectiveQ[%team].getObject(%i); //clear out any dynamic fields %objective.clientLevel1 = ""; %objective.clientLevel2 = ""; %objective.clientLevel3 = ""; %objective.isInvalid = false; %objective.repairObjective = ""; //set the location, if required if (%objective.position !$= "0 0 0") %objective.location = %objective.position; // find targeted object ID's if(%objective.targetObject !$= "") %objective.targetObjectId = NameToId(%objective.targetObject); else %objective.targetObjectId = -1; if(%objective.targetClientObject !$= "") %objective.targetClientId = NameToId(%objective.targetClient); else %objective.targetClientId = -1; if (%objective.position $= "0 0 0") { if (%objective.location $= "0 0 0") { if (%objective.targetObjectId > 0) %objective.position = %objective.targetObjectId.position; } else %objective.position = %objective.location; } } //finally, sort the objectiveQ $ObjectiveQ[%team].sortByWeight(); } //This function is designed to clear out the objective Q's, and clear the task lists from all the AIs function AIMissionEnd() { //disable the AI system AISystemEnabled(false); //loop through the client list, and clear the tasks of each bot %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %client = ClientGroup.getObject(%i); if (%client.isAIControlled()) { //cancel the respawn thread and the objective thread... cancel(%client.respawnThread); cancel(%client.objectiveThread); //reset the clients tasks, variables, etc... AIUnassignClient(%client); %client.stop(); %client.clearTasks(); %client.clearStep(); %client.lastDamageClient = -1; %client.lastDamageTurret = -1; %client.shouldEngage = -1; %client.setEngageTarget(-1); %client.setTargetObject(-1); %client.pilotVehicle = false; %client.defaultTasksAdded = false; //do the nav graph cleanup %client.missionCycleCleanup(); } } //clear the objective Q's for (%i = 0; %i <= Game.numTeams; %i++) { if (isObject($ObjectiveQ[%i])) { $ObjectiveQ[%i].clear(); $ObjectiveQ[%i].delete(); } $ObjectiveQ[%i] = ""; } //now delete all the sets used by the AI system... if (isObject($AIBombLocationSet)) $AIBombLocationSet.delete(); $AIBombLocationSet = ""; if (isObject($AIInvStationSet)) $AIInvStationSet.delete(); $AIInvStationSet = ""; if (isObject($AIItemSet)) $AIItemSet.delete(); $AIItemSet = ""; if (isObject($AIGrenadeSet)) $AIGrenadeSet.delete(); $AIGrenadeSet = ""; if (isObject($AIWeaponSet)) $AIWeaponSet.delete(); $AIWeaponSet = ""; if (isObject($AIRemoteTurretSet)) $AIRemoteTurretSet.delete(); $AIRemoteTurretSet = ""; if (isObject($AIDeployedMineSet)) $AIDeployedMineSet.delete(); $AIDeployedMineSet = ""; if (isObject($AIVehicleSet)) $AIVehicleSet.delete(); $AIVehicleSet = ""; } //FUNCTIONS ON EACH OBJECT EXECUTED AT MISSION LOAD TIME function SimGroup::AIMissionInit(%this) { for(%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).AIMissionInit(%this); } function GameBase::AIMissionInit(%this) { %this.getDataBlock().AIMissionInit(%this); } function StationInventory::AIMissionInit(%data, %object) { $AIInvStationSet.add(%object); } function Flag::AIMissionInit(%data, %object) { if (%object.team >= 0) $AITeamFlag[%object.team] = %object; } function SimObject::AIMissionInit(%this) { //this function is declared to prevent console error msg spam... } function ItemData::AIMissionInit(%data, %object) { $AIItemSet.add(%object); } function AIThrowObject(%object) { $AIItemSet.add(%object); } function AIGrenadeThrown(%object) { $AIGrenadeSet.add(%object); } function AIDeployObject(%client, %object) { //first, set the object id on the client %client.lastDeployedObject = %object; //now see if it was a turret... %type = %object.getDataBlock().getName(); if (%type $= "TurretDeployedFloorIndoor" || %type $= "TurretDeployedWallIndoor" || %type $= "TurretDeployedCeilingIndoor" || %type $= "TurretDeployedOutdoor") { $AIRemoteTurretSet.add(%object); } } function AIDeployMine(%object) { $AIDeployedMineSet.add(%object); } function AIVehicleMounted(%vehicle) { $AIVehicleSet.add(%vehicle); } function AICorpseAdded(%corpse) { if (isObject(%corpse)) { %corpse.isCorpse = true; $AIItemSet.add(%corpse); } } //OTHER UTILITY FUNCTIONS function AIConnection::onAIDrop(%client) { //make sure we're trying to drop an AI if (!isObject(%client) || !%client.isAIControlled()) return; //clear the ai from any objectives, etc... AIUnassignClient(%client); %client.clearTasks(); %client.clearStep(); %client.defaultTasksAdded = false; //kill the player, which should cause the Game object to perform whatever cleanup is required. if (isObject(%client.player)) %client.player.scriptKill(0); //do the nav graph cleanup %client.missionCycleCleanup(); } function AIConnection::endMission(%client) { //cancel the respawn thread, and spawn them manually cancel(%client.respawnThread); cancel(%client.objectiveThread); } function AIConnection::startMission(%client) { //assign the team if (%client.team <= 0) Game.assignClientTeam(%client); //set the client's sensor group... setTargetSensorGroup( %client.target, %client.team ); %client.setSensorGroup( %client.team ); //sends a message so everyone know the bot is in the game... Game.AIHasJoined(%client); %client.matchStartReady = true; //spawn the bot... onAIRespawn(%client); } function AIConnection::onAIConnect(%client, %name, %team, %skill, %offense, %voice, %voicePitch) { // Sex/Race defaults %client.sex = "Male"; %client.race = "Human"; %client.armor = "Light"; //setup the voice and voicePitch if (%voice $= "") %voice = "Bot1"; %client.voice = %voice; %client.voiceTag = addTaggedString(%voice); if (%voicePitch $= "" || %voicePitch < 0.5 || %voicePitch > 2.0) %voicePitch = 1.0; %client.voicePitch = %voicePitch; %client.name = addTaggedString( "\cp\c9" @ %name @ "\co" ); %client.nameBase = %name; echo(%client.name); echo("CADD: " @ %client @ " " @ %client.getAddress()); $HostGamePlayerCount++; //set the initial team - Game.assignClientTeam() should be called later on... %client.team = %team; if ( %client.team & 1 ) %client.skin = addTaggedString( "basebot" ); else %client.skin = addTaggedString( "basebbot" ); //setup the target for use with the sensor net, etc... %client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch); //i need to send a "silent" version of this for single player but still use the callback -jr` if($currentMissionType $= "SinglePlayer") messageAllExcept(%client, -1, 'MsgClientJoin', "", %name, %client, %client.target, true); else messageAllExcept(%client, -1, 'MsgClientJoin', '\c1%1 joined the game.', %name, %client, %client.target, true); //assign the skill %client.setSkillLevel(%skill); //assign the affinity %client.offense = %offense; //clear any flags %client.stop(); // this will clear the players move state %client.clearStep(); %client.lastDamageClient = -1; %client.lastDamageTurret = -1; %client.setEngageTarget(-1); %client.setTargetObject(-1); %client.objective = ""; //clear the defaulttasks flag %client.defaultTasksAdded = false; //if the mission is already running, spawn the bot if ($missionRunning) %client.startMission(); } // This routes through C++ code so profiler can register it. Also, the console function // ProfilePatch1() tracks time spent (at MS resolution), # calls, average time per call. // See console variables $patch1Total (MS so far in routine), $patch1Avg (average MS // per call), and $patch1Calls (# of calls). function patchForTimeTest(%client) { if( isObject( Game ) ) Game.AIChooseGameObjective(%client); } function AIReassessObjective(%client) { ProfilePatch1(patchForTimeTest, %client); // Game.AIChooseGameObjective(%client); %client.objectiveThread = schedule(5000, %client, "AIReassessObjective", %client); } function onAIRespawn(%client) { %markerObj = Game.pickPlayerSpawn(%client, true); Game.createPlayer(%client, %markerObj); //make sure the player object is the AI's control object - even during the mission warmup time //the function AISystemEnabled(true/false) will control whether they actually move... %client.setControlObject(%client.player); if (%client.objective) error("ERROR!!! " @ %client @ " is still assigned to objective: " @ %client.objective); //clear the objective and choose a new one AIUnassignClient(%client); %client.stop(); %client.clearStep(); %client.lastDamageClient = -1; %client.lastDamageTurret = -1; %client.shouldEngage = -1; %client.setEngageTarget(-1); %client.setTargetObject(-1); %client.pilotVehicle = false; //set the spawn time %client.spawnTime = getSimTime(); %client.respawnThread = ""; //timeslice the objective reassessment for the bots if (!isEventPending(%client.objectiveThread)) { %curTime = getSimTime(); %remainder = %curTime % 5000; %schedTime = $AITimeSliceReassess - %remainder; if (%schedTime <= 0) %schedTime += 5000; %client.objectiveThread = schedule(%schedTime, %client, "AIReassessObjective", %client); //set the next time slice "slot" $AITimeSliceReassess += 300; if ($AITimeSliceReassess > 5000) $AITimeSliceReassess -= 5000; } //call the game specific spawn function Game.onAIRespawn(%client); } function AIClientIsAlive(%client, %duration) { if(%client < 0 || %client.player <= 0) return false; if (isObject(%client.player)) { %state = %client.player.getState(); if (%state !$= "Dead" && %state !$= "" && (%duration $= "" || getSimTime() - %client.spawnTime >= %duration)) return true; else return false; } else return false; } //------------------------------ function AIFindClosestEnemy(%srcClient, %radius, %losTimeout) { //see if there's an enemy near our defense location... if (isObject(%srcClient.player)) %srcLocation = %srcClient.player.getWorldBoxCenter(); else %srcLocation = "0 0 0"; return AIFindClosestEnemyToLoc(%srcClient, %srcLocation, %radius, %losTimeout, false, true); } function AIFindClosestEnemyToLoc(%srcClient, %srcLocation, %radius, %losTimeout, %ignoreLOS, %distFromClient) { if (%ignoreLOS $= "") %ignoreLOS = false; if (%distFromClient $= "") %distFromClient = false; %count = ClientGroup.getCount(); %closestClient = -1; %closestDistance = 32767; for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); //make sure we find someone who's alive if (AIClientIsAlive(%cl) && %cl.team != %srcClient.team) { %clIsCloaked = !isTargetVisible(%cl.target, %srcClient.getSensorGroup()); //make sure the client can see the enemy %hasLOS = %srcClient.hasLOSToClient(%cl); %losTime = %srcClient.getClientLOSTime(%cl); if (%ignoreLOS || %hasLOS || (%losTime < %losTimeout && AIClientIsAlive(%cl, %losTime + 1000))) { %testPos = %cl.player.getWorldBoxCenter(); if (%distFromClient) %distance = %srcClient.getPathDistance(%testPos); else %distance = AIGetPathDistance(%srcLocation, %testPos); if (%distance > 0 && (%radius < 0 || %distance < %radius) && %distance < %closestDistance && (!%clIsCloaked || %distance < 8)) { %closestClient = %cl; %closestDistance = %distance; } } } } return %closestClient SPC %closestDistance; } function AIFindClosestEnemyPilot(%client, %radius, %losTimeout) { //loop through the vehicle set, looking for pilotted vehicles... %closestPilot = -1; %closestDist = %radius; %count = $AIVehicleSet.getCount(); for (%i = 0; %i < %count; %i++) { //first, make sure the vehicle is mounted by pilotted %vehicle = $AIVehicleSet.getObject(%i); %pilot = %vehicle.getMountNodeObject(0); if (%pilot <= 0 || !AIClientIsAlive(%pilot.client)) continue; //make sure the pilot is an enemy if (%pilot.client.team == %client.team) continue; //see if the pilot has been seen by the client %hasLOS = %client.hasLOSToClient(%pilot.client); %losTime = %client.getClientLOSTime(%pilot.client); if (%hasLOS || (%losTime < %losTimeout && AIClientIsAlive(%pilot.client, %losTime + 1000))) { //see if it's the closest %clientPos = %client.player.getWorldBoxCenter(); %pilotPos = %pilot.getWorldBoxCenter(); %dist = VectorDist(%clientPos, %pilotPos); if (%dist < %closestDist) { %closestPilot = %pilot.client; %closestDist = %dist; } } } return %closestPilot SPC %closestDist; } function AIFindAIClientInView(%srcClient, %team, %radius) { //make sure the player is alive if (! AIClientIsAlive(%srcClient)) return -1; //get various info about the player's eye %srcEyeTransform = %srcClient.player.getEyeTransform(); %srcEyePoint = firstWord(%srcEyeTransform) @ " " @ getWord(%srcEyeTransform, 1) @ " " @ getWord(%srcEyeTransform, 2); %srcEyeVector = VectorNormalize(%srcClient.player.getEyeVector()); //see if there's an enemy near our defense location... %count = ClientGroup.getCount(); %viewedClient = -1; %clientDot = -1; for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); //make sure we find an AI who's alive and not the srcClient if (%cl != %srcClient && AIClientIsAlive(%cl) && %cl.isAIControlled() && (%team < 0 || %cl.team == %team)) { //make sure the player is within range %clPos = %cl.player.getWorldBoxCenter(); %distance = VectorDist(%clPos, %srcEyePoint); if (%radius <= 0 || %distance <= %radius) { //create the vector from the srcClient to the client %clVector = VectorNormalize(VectorSub(%clPos, %srcEyePoint)); //see if the dot product is greater than our current, and greater than 0.6 %dot = VectorDot(%clVector, %srcEyeVector); if (%dot > 0.6 && %dot > %clientDot) { %viewedClient = %cl; %clientDot = %dot; } } } } return %viewedClient; } //----------------------------------------------------------------------------- //AI VEHICLE FUNCTIONS function Armor::AIonMount(%this, %obj, %vehicle, %node) { //set the client var... %client = %obj.client; %client.turretMounted = -1; //make sure the AI was *supposed* to mount the vehicle if (!%client.isMountingVehicle()) { AIDisembarkVehicle(%client); return; } //get the vehicle's pilot %pilot = %vehicle.getMountNodeObject(0); //make sure the bot is in node 0 if'f the bot is piloting the vehicle if ((%node == 0 && !%client.pilotVehicle) || (%node > 0 && %client.pilotVehicle)) { AIDisembarkVehicle(%client); return; } //make sure the bot didn't is on the same team as the pilot if (%pilot > 0 && isObject(%pilot) && %pilot.client.team != %client.team) { AIDisembarkVehicle(%client); return; } //if we're supposed to pilot the vehicle, set the control object if (%client.pilotVehicle) %client.setControlObject(%vehicle); //each vehicle may be built differently... if (%vehicle.getDataBlock().getName() $= "AssaultVehicle") { //node 1 is this vehicle's turret seat if (%node == 1) { %turret = %vehicle.getMountNodeObject(10); %skill = %client.getSkillLevel(); %turret.setSkill(%skill); %client.turretMounted = %turret; %turret.setAutoFire(true); } } else if (%vehicle.getDataBlock().getName() $= "BomberFlyer") { //node 1 is this vehicle's turret seat if (%node == 1) { %turret = %vehicle.getMountNodeObject(10); %skill = %client.getSkillLevel(); %turret.setSkill(%skill); %client.turretMounted = %turret; %client.setTurretMounted(%turret); %turret.setAutoFire(true); } } } function Armor::AIonUnMount(%this, %obj, %vehicle, %node) { //get the client var %client = %obj.client; //reset the control object if (%client.pilotVehicle) %client.setControlObject(%client.player); %client.pilotVehicle = false; //if the client had mounted a turret, turn the turret back off if (%client.turretMounted > 0) %client.turretMounted.setAutoFire(false); %client.turretMounted = -1; %client.setTurretMounted(-1); // reset the turret skill level if(%vehicle.getDataBlock().getName() $= "AssaultVehicle") if (%node == 1) %vehicle.getMountNodeObject(10).setSkill(1.0); if(%vehicle.getDataBlock().getName() $= "BomberFlyer") if(%node == 1) %vehicle.getMountNodeObject(10).setSkill(1.0); } function AIDisembarkVehicle(%client) { if (%client.player.isMounted()) { if (%client.pilotVehicle) %client.setControlObject(%client.player); %client.pressJump(); } } function AIProcessVehicle(%client) { //see if we're mounted on a turret, and if that turret has a target if (%client.turretMounted > 0) { %turretDB = %client.turretMounted.getDataBlock(); //see if we're in a bomber close to a bomb site... if (%turretDB.getName() $= "BomberTurret") { %clientPos = getWords(%client.player.position, 0, 1) @ " 0"; %found = false; %count = $AIBombLocationSet.getCount(); for (%i = 0; %i < %count; %i++) { %bombObj = $AIBombLocationSet.getObject(%i); %bombLocation = %bombObj.location; //make sure the objective was issued by someone in the vehicle if (%bombObj.issuedByClientId.vehicleMounted == %client.vehicleMounted) { //find out where the bomb is going to drop... first, how high up are we... %bombLocation2D = getWord(%bombLocation, 0) SPC getWord(%bombLocation, 1) SPC "0"; %height = getWord(%client.vehicleMounted.position, 2) - getWord(%bombLocation, 2); //find out how long it'll take the bomb to fall that far... //assume no initial velocity in the Z axis... %timeToFall = mSqrt((2.0 * %height) / 9.81); //how fast is the vehicle moving in the XY plane... %myLocation = %client.vehicleMounted.position; %myLocation2D = getWord(%myLocation, 0) SPC getWord(%myLocation, 1) SPC "0"; %vel = %client.vehicleMounted.getVelocity(); %vel2D = getWord(%vel, 0) SPC getWord(%vel, 1) SPC "0"; %bombImpact2D = VectorAdd(%myLocation2D, VectorScale(%vel2D, %timeToFall)); //see if the bomb inpact position is within 20m of the desired bomb site... %distToBombsite2D = VectorDist(%bombImpact2D, %bombLocation2D); if (%height > 20 && %distToBombsite2D < 25) { %found = true; break; } } } //see if we found a bomb site if (%found) { %client.turretMounted.selectedWeapon = 2; %turretDB.onTrigger(%client.turretMounted, 0, true); return; } } //we're not bombing, make sure we have the regular weapon selected %client.turretMounted.selectedWeapon = 1; if (isObject(%client.turretMounted.getTargetObject())) %turretDB.onTrigger(%client.turretMounted, 0, true); else %turretDB.onTrigger(%client.turretMounted, 0, false); } } function AIPilotVehicle(%client) { //this is not very well supported, but someone will find a use for this function... }PK !(GCCscripts/aiBotProfiles.csfunction aiConnectByIndex(%index, %team) { if (%index < 0 || $BotProfile[%index, name] $= "") return; if (%team $= "") %team = -1; //initialize the profile, if required if ($BotProfile[%index, skill] $= "") $BotProfile[%index, skill] = 0.5; return aiConnect($BotProfile[%index, name], %team, $BotProfile[%index, skill], $BotProfile[%index, offense], $BotProfile[%index, voice], $BotProfile[%index, voicePitch]); } function aiConnectByName(%name, %team) { if (%name $= "") return; if (%team $= "") %team = -1; %foundIndex = -1; %index = 0; while ($BotProfile[%index, name] !$= "") { if ($BotProfile[%index, name] $= %name) { %foundIndex = %index; break; } else %index++; } //see if we found our bot if (%foundIndex >= 0) return aiConnectByIndex(%foundIndex, %team); //else add a new bot profile else { $BotProfile[%index, name] = %name; return aiConnectByIndex(%index, %team); } } function aiBotAlreadyConnected(%name) { %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %client = ClientGroup.getObject(%i); if (%name $= getTaggedString(%client.name)) return true; } return false; } function aiConnectMultiple(%numToConnect, %minSkill, %maxSkill, %team) { //validate the args if (%numToConnect <= 0) return; if (%maxSkill < 0) %maxSkill = 0; if (%minSkill >= %maxSkill) %minSkill = %maxSkill - 0.01; if (%team $= "") %team = -1; //loop through the profiles, and set the flags and initialize %numBotsAlreadyConnected = 0; %index = 0; while ($BotProfile[%index, name] !$= "") { //initialize the profile if required if ($BotProfile[%index, skill] $= "") $BotProfile[%index, skill] = 0.5; //if the bot is already playing, it shouldn't be reselected if (aiBotAlreadyConnected($BotProfile[%index, name])) { $BotProfile[%index, canSelect] = false; %numBotsAlreadyConnected++; } else $BotProfile[%index, canSelect] = true; %index++; } //make sure we're not trying to add more bots than we have... if (%numToConnect > (%index - %numBotsAlreadyConnected)) %numToConnect = (%index - %numBotsAlreadyConnected); //build the array of possible candidates... %index = 0; %tableCount = 0; while ($BotProfile[%index, name] !$= "") { %botSkill = $BotProfile[%index, skill]; //see if the skill is within range if ($BotProfile[%index, canSelect] && %botSkill >= %minSkill && %botSkill <= %maxSkill) { $BotSelectTable[%tableCount] = %index; %tableCount++; $BotProfile[%index, canSelect] = false; } //check the next bot %index++; } //if we didn't find enough bots, we'll have to search the rest of the profiles... %searchMinSkill = %minSkill; while ((%tableCount < %numToConnect) && (%searchMinSkill > 0)) { %index = 0; while ($BotProfile[%index, name] !$= "") { %botSkill = $BotProfile[%index, skill]; //see if the skill is within range if ($BotProfile[%index, canSelect] && %botSkill >= (%searchMinSkill - 0.1) && %botSkill <= %searchMinSkill) { $BotSelectTable[%tableCount] = %index; %tableCount++; $BotProfile[%index, canSelect] = false; } //check the next bot %index++; } //now lower the search min Skill, and take another pass at a lower skill level %searchMinSkill = %searchMinSkill - 0.1; } //if we're still short of bots, search the higher skill levels %searchMaxSkill = %maxSkill; while ((%tableCount < %numToConnect) && (%searchMaxSkill < 1.0)) { %index = 0; while ($BotProfile[%index, name] !$= "") { %botSkill = $BotProfile[%index, skill]; //see if the skill is within range if ($BotProfile[%index, canSelect] && %botSkill >= %searchMaxSkill && %botSkill <= (%searchMaxSkill + 0.1)) { $BotSelectTable[%tableCount] = %index; %tableCount++; $BotProfile[%index, canSelect] = false; } //check the next bot %index++; } //now raise the search max Skill, and take another pass at a higher skill level %searchMaxSkill = %searchMaxSkill + 0.1; } //since the numToConnect was capped at the table size, we should have enough bots in the //table to fulfill the quota //loop through five times, picking random indices, and adding them until we've added enough %numBotsConnected = 0; for (%i = 0; %i < 5; %i++) { for (%j = 0; %j < %numToConnect; %j++) { %selectedIndex = mFloor(getRandom() * (%tableCount - 0.1)); if ($BotSelectTable[%selectedIndex] >= 0) { //connect the bot %botClient = aiConnectByIndex($BotSelectTable[%selectedIndex], %team); %numBotsConnected++; //adjust the skill level, if required %botSkill = %botClient.getSkillLevel(); if (%botSkill < %minSkill || %botSkill > %maxSkill) { %newSkill = %minSKill + (getRandom() * (%maxSkill - %minSkill)); %botClient.setSkillLevel(%newSkill); } //clear the table entry to avoid connecting duplicates $BotSelectTable[%selectedIndex] = -1; //see if we've connected enough if (%numBotsConnected == %numToConnect) return; } } } //at this point, we've looped though the table, and kept hitting duplicates, search the table sequentially for (%i = 0; %i < %tableCount; %i++) { if ($BotSelectTable[%i] >= 0) { //connect the bot %botClient = aiConnectByIndex($BotSelectTable[%i], %team); %numBotsConnected++; //adjust the skill level, if required %botSkill = %botClient.getSkillLevel(); if (%botSkill < %minSkill || %botSkill > %maxSkill) { %newSkill = %minSKill + (getRandom() * (%maxSkill - %minSkill)); %botClient.setSkillLevel(%newSkill); } //clear the table entry to avoid connecting duplicates $BotSelectTable[%i] = -1; //see if we've connected enough if (%numBotsConnected == %numToConnect) return; } } } $BotProfile[0, name] = "Kidney BOT"; $BotProfile[0, skill] = 0.99; $BotProfile[0, offense] = true; $BotProfile[0, voicePitch] = 0.875; $BotProfile[1, name] = "BOT Milk?"; $BotProfile[1, skill] = 0.99; $BotProfile[1, offense] = true; $BotProfile[1, voicePitch] = 0.89; $BotProfile[2, name] = "UberBOT"; $BotProfile[2, skill] = 0.99; $BotProfile[2, offense] = true; $BotProfile[2, voicePitch] = 0.95; $BotProfile[3, name] = "SymBOT"; $BotProfile[3, skill] = 0.99; $BotProfile[3, offense] = true; $BotProfile[3, voicePitch] = 1.1; $BotProfile[4, name] = "QIX BOT"; $BotProfile[4, skill] = 0.99; $BotProfile[4, offense] = false; $BotProfile[4, voicePitch] = 1.12; $BotProfile[5, name] = "Rated BOT"; $BotProfile[5, skill] = 0.99; $BotProfile[5, offense] = true; $BotProfile[5, voicePitch] = 0.92; $BotProfile[6, name] = "Dr.BOTward"; $BotProfile[6, skill] = 0.99; $BotProfile[6, offense] = true; $BotProfile[6, voicePitch] = 0.96; $BotProfile[7, name] = "Frank BOTzo"; $BotProfile[7, skill] = 0.99; $BotProfile[7, offense] = true; $BotProfile[7, voicePitch] = 0.88; $BotProfile[8, name] = "Missing BOT"; $BotProfile[8, skill] = 0.99; $BotProfile[8, offense] = true; $BotProfile[8, voicePitch] = 1.125; $BotProfile[9, name] = "Jett BOT"; $BotProfile[9, skill] = 0.99; $BotProfile[9, offense] = false; $BotProfile[9, voicePitch] = 1.12; $BotProfile[10, name] = "HexaBOTic"; $BotProfile[10, skill] = 0.99; $BotProfile[10, offense] = true; $BotProfile[10, voicePitch] = 0.895; $BotProfile[11, name] = "Sne/\\kBOT"; $BotProfile[11, skill] = 0.99; $BotProfile[11, offense] = true; $BotProfile[11, voicePitch] = 0.885; $BotProfile[12, name] = "DiamondBOT"; $BotProfile[12, skill] = 0.99; $BotProfile[12, offense] = true; $BotProfile[12, voicePitch] = 1.05; $BotProfile[13, name] = "Jimmy BOT"; $BotProfile[13, skill] = 0.99; $BotProfile[13, offense] = true; $BotProfile[13, voicePitch] = 1.09; $BotProfile[14, name] = "Skeet BOT"; $BotProfile[14, skill] = 0.99; $BotProfile[14, offense] = false; $BotProfile[14, voicePitch] = 1.0; $BotProfile[15, name] = "BigBOTDawg"; $BotProfile[15, skill] = 0.99; $BotProfile[15, offense] = true; $BotProfile[15, voicePitch] = 0.9; $BotProfile[16, name] = "BOTIN8R"; $BotProfile[16, skill] = 0.99; $BotProfile[16, offense] = true; $BotProfile[16, voicePitch] = 0.97; $BotProfile[17, name] = "OrphanKazBOT"; $BotProfile[17, skill] = 0.99; $BotProfile[17, offense] = true; $BotProfile[17, voicePitch] = 0.925; $BotProfile[18, name] = "Terrible BOT"; $BotProfile[18, skill] = 0.99; $BotProfile[18, offense] = true; $BotProfile[18, voicePitch] = 1.115; $BotProfile[19, name] = "Mongo BOT"; $BotProfile[19, skill] = 0.99; $BotProfile[19, offense] = false; $BotProfile[19, voicePitch] = 1.12; $BotProfile[20, name] = "East BOT"; $BotProfile[20, skill] = 0.99; $BotProfile[20, offense] = true; $BotProfile[20, voicePitch] = 1.125; $BotProfile[21, name] = "Snow LeoBOT"; $BotProfile[21, skill] = 0.99; $BotProfile[21, offense] = true; $BotProfile[21, voicePitch] = 1.05; $BotProfile[22, name] = "Twitch BOT"; $BotProfile[22, skill] = 0.99; $BotProfile[22, offense] = true; $BotProfile[22, voicePitch] = 0.893; $BotProfile[23, name] = "ShazBOT"; $BotProfile[23, skill] = 0.99; $BotProfile[23, offense] = true; $BotProfile[23, voicePitch] = 0.879; $BotProfile[24, name] = "Fishbait"; $BotProfile[24, skill] = 0.00; $BotProfile[24, offense] = true; $BotProfile[24, voicePitch] = 1.125; $BotProfile[25, name] = "Skulker"; $BotProfile[25, skill] = 0.00; $BotProfile[25, offense] = false; $BotProfile[25, voicePitch] = 1.1; $BotProfile[26, name] = "Dogstar"; $BotProfile[26, skill] = 0.00; $BotProfile[26, offense] = false; $BotProfile[26, voicePitch] = 1.02; $BotProfile[27, name] = "Bonehead"; $BotProfile[27, skill] = 0.00; $BotProfile[27, offense] = false; $BotProfile[27, voicePitch] = 0.975; $BotProfile[28, name] = "Torus"; $BotProfile[28, skill] = 0.00; $BotProfile[28, offense] = false; $BotProfile[28, voicePitch] = 0.9; $BotProfile[29, name] = "Glitter"; $BotProfile[29, skill] = 0.05; $BotProfile[29, offense] = true; $BotProfile[29, voicePitch] = 1.1; $BotProfile[30, name] = "Wirehead"; $BotProfile[30, skill] = 0.05; $BotProfile[30, offense] = false; $BotProfile[30, voicePitch] = 1.03; $BotProfile[31, name] = "Ironbreath"; $BotProfile[31, skill] = 0.10; $BotProfile[31, offense] = false; $BotProfile[31, voicePitch] = 1.02; $BotProfile[32, name] = "Hagstomper"; $BotProfile[32, skill] = 0.10; $BotProfile[32, offense] = false; $BotProfile[32, voicePitch] = 0.899; $BotProfile[33, name] = "Doormat"; $BotProfile[33, skill] = 0.15; $BotProfile[33, offense] = false; $BotProfile[33, voicePitch] = 0.97; $BotProfile[34, name] = "TickTock"; $BotProfile[34, skill] = 0.15; $BotProfile[34, offense] = true; $BotProfile[34, voicePitch] = 1.07; $BotProfile[35, name] = "ElectroJag"; $BotProfile[35, skill] = 0.20; $BotProfile[35, offense] = false; $BotProfile[35, voicePitch] = 0.915; $BotProfile[36, name] = "Jetsam"; $BotProfile[36, skill] = 0.20; $BotProfile[36, offense] = false; $BotProfile[36, voicePitch] = 1.09; $BotProfile[37, name] = "Newguns"; $BotProfile[37, skill] = 0.25; $BotProfile[37, offense] = false; $BotProfile[37, voicePitch] = 0.885; $BotProfile[38, name] = "WrongWay"; $BotProfile[38, skill] = 0.25; $BotProfile[38, offense] = false; $BotProfile[38, voicePitch] = 0.875; $BotProfile[39, name] = "Ragbinder"; $BotProfile[39, skill] = 0.30; $BotProfile[39, offense] = true; $BotProfile[39, voicePitch] = 1.1; $BotProfile[40, name] = "Retch"; $BotProfile[40, skill] = 0.30; $BotProfile[40, offense] = false; $BotProfile[40, voicePitch] = 1.12; $BotProfile[41, name] = "Hotfoot"; $BotProfile[41, skill] = 0.35; $BotProfile[41, offense] = false; $BotProfile[41, voicePitch] = 0.93; $BotProfile[42, name] = "Trail of Rust"; $BotProfile[42, skill] = 0.35; $BotProfile[42, offense] = false; $BotProfile[42, voicePitch] = 0.88; $BotProfile[43, name] = "Zigzag"; $BotProfile[43, skill] = 0.40; $BotProfile[43, offense] = false; $BotProfile[43, voicePitch] = 0.89; $BotProfile[44, name] = "Gray Sabot"; $BotProfile[44, skill] = 0.40; $BotProfile[44, offense] = true; $BotProfile[44, voicePitch] = 0.879; $BotProfile[45, name] = "Hellefleur"; $BotProfile[45, skill] = 0.45; $BotProfile[45, offense] = false; $BotProfile[45, voicePitch] = 1.11; $BotProfile[46, name] = "Slicer"; $BotProfile[46, skill] = 0.45; $BotProfile[46, offense] = false; $BotProfile[46, voicePitch] = 1.12; $BotProfile[47, name] = "Rampant"; $BotProfile[47, skill] = 0.45; $BotProfile[47, offense] = false; $BotProfile[47, voicePitch] = 0.935; $BotProfile[48, name] = "Troglodyte"; $BotProfile[48, skill] = 0.45; $BotProfile[48, offense] = true; $BotProfile[48, voicePitch] = 1.121; $BotProfile[49, name] = "Evenkill"; $BotProfile[49, skill] = 0.50; $BotProfile[49, offense] = false; $BotProfile[49, voicePitch] = 1.05; $BotProfile[50, name] = "Simrionic"; $BotProfile[50, skill] = 0.50; $BotProfile[50, offense] = false; $BotProfile[50, voicePitch] = 0.895; $BotProfile[51, name] = "Cathode Kiss"; $BotProfile[51, skill] = 0.50; $BotProfile[51, offense] = false; $BotProfile[51, voicePitch] = 0.97; $BotProfile[52, name] = "So Dark"; $BotProfile[52, skill] = 0.55; $BotProfile[52, offense] = true; $BotProfile[52, voicePitch] = 1.01; $BotProfile[53, name] = "Deathwind"; $BotProfile[53, skill] = 0.55; $BotProfile[53, offense] = false; $BotProfile[53, voicePitch] = 1.12; $BotProfile[54, name] = "Dharmic Sword"; $BotProfile[54, skill] = 0.55; $BotProfile[54, offense] = false; $BotProfile[54, voicePitch] = 1.0; $BotProfile[55, name] = "Demonshriek"; $BotProfile[55, skill] = 0.60; $BotProfile[55, offense] = false; $BotProfile[55, voicePitch] = 1.05; $BotProfile[56, name] = "Terrapin"; $BotProfile[56, skill] = 0.60; $BotProfile[56, offense] = true; $BotProfile[56, voicePitch] = 1.085; $BotProfile[57, name] = "No-Dachi"; $BotProfile[57, skill] = 0.60; $BotProfile[57, offense] = true; $BotProfile[57, voicePitch] = 0.905; $BotProfile[58, name] = "Irrelevant Smoke"; $BotProfile[58, skill] = 0.65; $BotProfile[58, offense] = false; $BotProfile[58, voicePitch] = 0.935; $BotProfile[59, name] = "Red Ghost"; $BotProfile[59, skill] = 0.65; $BotProfile[59, offense] = false; $BotProfile[59, voicePitch] = 1.21; $BotProfile[60, name] = "Perilous"; $BotProfile[60, skill] = 0.65; $BotProfile[60, offense] = true; $BotProfile[60, voicePitch] = 0.895; $BotProfile[61, name] = "The Golden"; $BotProfile[61, skill] = 0.70; $BotProfile[61, offense] = true; $BotProfile[61, voicePitch] = 0.88; $BotProfile[62, name] = "Vanguard"; $BotProfile[62, skill] = 0.70; $BotProfile[62, offense] = false; $BotProfile[62, voicePitch] = 1.1; $BotProfile[63, name] = "Heretik"; $BotProfile[63, skill] = 0.70; $BotProfile[63, offense] = true; $BotProfile[63, voicePitch] = 0.945; $BotProfile[64, name] = "Akhiles"; $BotProfile[64, skill] = 0.75; $BotProfile[64, offense] = true; $BotProfile[64, voicePitch] = 0.915; $BotProfile[65, name] = "Nova-9"; $BotProfile[65, skill] = 0.75; $BotProfile[65, offense] = false; $BotProfile[65, voicePitch] = 1.12; $BotProfile[66, name] = "Hotspur"; $BotProfile[66, skill] = 0.75; $BotProfile[66, offense] = true; $BotProfile[66, voicePitch] = 1.11; $BotProfile[67, name] = "DustWitch"; $BotProfile[67, skill] = 0.80; $BotProfile[67, offense] = true; $BotProfile[67, voicePitch] = 0.875; $BotProfile[68, name] = "Mojo Savage"; $BotProfile[68, skill] = 0.80; $BotProfile[68, offense] = true; $BotProfile[68, voicePitch] = 1.05; $BotProfile[69, name] = "Velomancer"; $BotProfile[69, skill] = 0.80; $BotProfile[69, offense] = false; $BotProfile[69, voicePitch] = 1.085; $BotProfile[70, name] = "Mohican"; $BotProfile[70, skill] = 0.85; $BotProfile[70, offense] = true; $BotProfile[70, voicePitch] = 1.045; $BotProfile[71, name] = "Widowmaker"; $BotProfile[71, skill] = 0.85; $BotProfile[71, offense] = true; $BotProfile[71, voicePitch] = 1.04; $BotProfile[72, name] = "Punch"; $BotProfile[72, skill] = 0.85; $BotProfile[72, offense] = true; $BotProfile[72, voicePitch] = 0.89; $BotProfile[73, name] = "Mameluke"; $BotProfile[73, skill] = 0.90; $BotProfile[73, offense] = false; $BotProfile[73, voicePitch] = 0.882; $BotProfile[74, name] = "King Snake"; $BotProfile[74, skill] = 0.90; $BotProfile[74, offense] = true; $BotProfile[74, voicePitch] = 1.05; $BotProfile[75, name] = "Sorrow"; $BotProfile[75, skill] = 0.90; $BotProfile[75, offense] = true; $BotProfile[75, voicePitch] = 1.09; $BotProfile[76, name] = "Devourer"; $BotProfile[76, skill] = 0.95; $BotProfile[76, offense] = true; $BotProfile[76, voicePitch] = 0.929; $BotProfile[77, name] = "Fated to Glory"; $BotProfile[77, skill] = 0.95; $BotProfile[77, offense] = true; $BotProfile[77, voicePitch] = 0.915; $BotProfile[78, name] = "Neon Blossom"; $BotProfile[78, skill] = 0.95; $BotProfile[78, offense] = false; $BotProfile[78, voicePitch] = 1.125; $BotProfile[79, name] = "Shiver"; $BotProfile[79, skill] = 0.95; $BotProfile[79, offense] = true; $BotProfile[79, voicePitch] = 0.875; PK !(N&N&scripts/aiBountyGame.cs// bounty game support function BountyGame::onAIRespawn(%game, %client) { //add the default task if (! %client.defaultTasksAdded) { %client.defaultTasksAdded = true; %client.addTask(AIPickupItemTask); %client.addTask(AIUseInventoryTask); %client.addTask(AITauntCorpseTask); %client.addTask(AIEngageTurretTask); %client.addTask(AIDetectMineTask); %client.addTask(AIBountyPatrolTask); %client.bountyTask = %client.addTask(AIBountyEngageTask); } //set the inv flag %client.spawnUseInv = true; } function BountyGame::AIInit(%game) { AIInit(); } function BountyGame::aiBountyAssignTarget(%game, %client, %target) { if (!isObject(%client.bountyTask)) %client.bountyTask = %client.addTask(AIBountyEngageTask); %task = %client.bountyTask; %task.baseWeight = $AIWeightKillFlagCarrier[1]; %task.buyEquipmentSet = "LightEnergySniper"; } function AIBountyEngageTask::assume(%task, %client) { %task.setWeightFreq(15); %task.setMonitorFreq(15); } function AIBountyEngageTask::retire(%task, %client) { %client.setEngageTarget(-1); } function AIBountyEngageTask::weight(%task, %client) { %player = %client.player; if (!isObject(%player)) return; %clientPos = %player.getWorldBoxCenter(); %client.shouldEngage = -1; //first, make sure we actually can fight if (AIEngageOutOfAmmo(%client)) { %task.setWeight(0); return; } //see if anyone has fired on us recently... %mustEngage = false; %losTimeout = $AIClientMinLOSTime + ($AIClientLOSTimeout * %client.getSkillLevel()); if (AIClientIsAlive(%client.lastDamageClient, %losTimeout) && getSimTime() - %client.lastDamageTime < %losTimeout) { //see if the attacker is either our target or, we are their target if (%client.lastDamageClient == %client.objectiveTarget || %client.lastDamageClient.objectiveTarget == %client) { %mustEngage = true; %currentTarget = %client.getEngageTarget(); //see if this is a new attacker if (AIClientIsAlive(%currentTarget) && %currentTarget != %client.lastDamageClient) { %targPos = %currentTarget.player.getWorldBoxCenter(); %curTargDist = %client.getPathDistance(%targPos); %newTargPos = %client.lastDamageClient.player.getWorldBoxCenter(); %newTargDist = %client.getPathDistance(%newTargPos); //see if the new targ is no more than 30 m further if (%newTargDist > 0 && %newTargDist < %curTargDist + 30) %client.shouldEngage = %client.lastDamageClient; else %client.shouldEngage = %currentTarget; } else %client.shouldEngage = %client.lastDamageClient; } //otherwise we should run react to an attacker who is not really supposed to be attacking us... else %client.setDangerLocation(%client.player.position, 20); } //no one has fired at us recently, see if we're near our objective target... else { //see if we still have sight of the current target %hasLOS = %client.hasLOSToClient(%client.objectiveTarget); %losTime = %client.getClientLOSTime(%client.objectiveTarget); if (%hasLOS || %losTime < %losTimeout) %client.shouldEngage = %client.objectiveTarget; else %client.shouldEngage = -1; } //now set the weight if (%client.shouldEngage > 0) { //if we've been fired upon... if (%mustEngage) %task.setWeight($AIWeightReturnFire); //see if we can allow the bot to use an inv station... else if (%client.spawnUseInv) { //see if there's an available inv station %result = AIFindClosestInventory(%client, false); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (isObject(%closestInv)) { if (isObject(%client.shouldEngage.player)) { %dist = %client.getPathDistance(%client.shouldEngage.player.position); if (%dist < 70 || %closestDist > 200) %task.setWeight($AIWeightReturnFire); else %task.setWeight($AIBountyWeightShouldEngage); } else %task.setWeight($AIBountyWeightShouldEngage); } else { %client.spawnUseInv = false; %task.setWeight($AIWeightReturnFire); } } else %task.setWeight($AIWeightReturnFire); } else %task.setWeight(0); } function AIBountyEngageTask::monitor(%task, %client) { if (AIClientIsAlive(%client.shouldEngage)) %client.stepEngage(%client.shouldEngage); } //----------------------------------------------------------------------------- //AIPatrolTask used to wander around the map (DM and Hunters mainly) looking for something to do... function AIBountyPatrolTask::init(%task, %client) { } function AIBountyPatrolTask::assume(%task, %client) { %task.setWeightFreq(13); %task.setMonitorFreq(13); %task.findLocation = true; %task.patrolLocation = "0 0 0"; %task.idleing = false; %task.idleEndTime = 0; } function AIBountyPatrolTask::retire(%task, %client) { } function AIBountyPatrolTask::weight(%task, %client) { %task.setWeight($AIWeightPatrolling); } function AIBountyPatrolTask::monitor(%task, %client) { //this call works in conjunction with AIEngageTask %client.setEngageTarget(%client.shouldEngage); //see if we're close enough to our patrol point if (%task.idleing) { if (getSimTime() > %task.idleEndTime) { %task.findLocation = true; %task.idleing = false; } } //see if we need to find a place to go... else if (%task.findLocation) { //first, see if we're in need of either health, or ammo //note: normally, I'd be tempted to put this kind of "looking for health" code //into the AIPickupItemTask, however, that task will be used in CTF, where you //don't want people on AIDefendLocation to leave their post to hunt for health, etc... //AIPickupItemTask only deals with items within a 30m radius around the bot. //AIPatrolTask will move the bot to the vicinity of an item, then AIPickUpItemTask //will finish the job... %foundItemLocation = false; %damage = %client.player.getDamagePercent(); if (%damage > 0.7) { //search for a health kit %closestHealth = AIFindSafeItem(%client, "Health"); if (%closestHealth > 0) { %task.patrolLocation = %closestHealth.getWorldBoxCenter(); %foundItemLocation = true; } } else if (AIEngageOutOfAmmo(%client)) { //search for a Ammo or a weapon... %closestItem = AIFindSafeItem(%client, "Ammo"); if (%closestItem > 0) { %task.patrolLocation = %closestItem.getWorldBoxCenter(); %foundItemLocation = true; } } //now see if we don't really have good equipment... if (!%foundItemLocation && AIEngageWeaponRating(%client) < 20) { //search for any useful item %closestItem = AIFindSafeItem(%client, "Any"); if (%closestItem > 0) { %task.patrolLocation = %closestItem.getWorldBoxCenter(); %foundItemLocation = true; } } //choose a randomish location only if we're not in need of health or ammo if (!%foundItemLocation) { //find a random item/inventory in the map, and pick a spawn point near it... %pickGraphNode = false; %chooseSet = 0; if ($AIInvStationSet.getCount() > 0) %chooseSet = $AIInvStationSet; else if ($AIWeaponSet.getCount() > 0) %chooseSet = $AIWeaponSet; else if ($AIItemSet.getCount() > 0) %chooseSet = $AIItemSet; if (!%chooseSet) %pickGraphNode = true; //here we pick whether we choose a random map point, or a point based on an item... if (getRandom() < 0.3) %pickGraphNode = true; //here we decide whether we should choose a player location... a bit of a cheat but //it's scaled by the bot skill level %pickPlayerLocation = false; %skill = %client.getSkillLevel(); if (%skill < 1.0) %skill = %skill / 2.0; if (getRandom() < (%skill * %skill) && AIClientIsAlive(%client.objectiveTarget)) { %task.patrolLocation = %client.objectiveTarget.player.getWorldBoxCenter(); %pickGraphNode = false; %pickPlayerLocation = true; } if (!%pickGraphNode && !%pickPlayerLocation) { %itemCount = %chooseSet.getCount(); %item = %chooseSet.getObject(getRandom() * (%itemCount - 0.1)); %nodeIndex = navGraph.randNode(%item.getWorldBoxCenter(), 10, true, true); if (%nodeIndex <= 0) %pickGraphNode = true; else %task.patrolLocation = navGraph.randNodeLoc(%nodeIndex); } //see if we failed above or have to pick just a random spot on the graph - use the spawn points... if (%pickGraphNode) { %task.patrolLocation = Game.pickPlayerSpawn(%client, true); if (%task.patrolLocation == -1) { %client.stepIdle(%client.player.getWorldBoxCenter()); return; } } } //now that we have a new location - move towards it %task.findLocation = false; %client.stepMove(%task.patrolLocation, 8.0); } //else we're on patrol - see if we're close to our destination else { %client.stepMove(%task.patrolLocation, 8.0); %distToDest = %client.getPathDistance(%task.patrolLocation); if (%distToDest > 0 && %distToDest < 10) { %task.idleing = true; %task.idleEndTime = 4000 + getSimTime() + (getRandom() * 6000); %client.stepIdle(%client.player.getWorldBoxCenter()); } } } function aiB() { exec("scripts/aiBountyGame"); }PK !(]( scripts/aiCTF.cs//----------------------------------------------- // AI functions for CTF function CTFGame::onAIRespawn(%game, %client) { //add the default task if (! %client.defaultTasksAdded) { %client.defaultTasksAdded = true; %client.addTask(AIEngageTask); %client.addTask(AIPickupItemTask); %client.addTask(AITauntCorpseTask); %client.addtask(AIEngageTurretTask); %client.addtask(AIDetectMineTask); } } function CTFGame::AIInit(%game) { // load external objectives files loadObjectives(); for (%i = 1; %i <= %game.numTeams; %i++) { if (!isObject($ObjectiveQ[%i])) { $ObjectiveQ[%i] = new AIObjectiveQ(); MissionCleanup.add($ObjectiveQ[%i]); } error("team " @ %i @ " objectives load..."); $ObjectiveQ[%i].clear(); AIInitObjectives(%i, %game); } //call the default AIInit() function AIInit(); } function CTFGame::AIplayerCaptureFlipFlop(%game, %player, %flipFlop) { } function CTFGame::AIplayerTouchEnemyFlag(%game, %player, %flag) { } function CTFGame::AIplayerTouchOwnFlag(%game, %player, %flag) { } function CTFGame::AIflagCap(%game, %player, %flag) { //signal the flag cap event AIRespondToEvent(%player.client, 'EnemyFlagCaptured', %player.client); // MES - changed above line - did not pass args in correct order } function CTFGame::AIplayerDroppedFlag(%game, %player, %flag) { } function CTFGame::AIflagReset(%game, %flag) { } function CTFGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clAttacker && %clAttacker != %clVictim && %clAttacker.team == %clVictim.team) { schedule(250, %clVictim, "AIPlayAnimSound", %clVictim, %clAttacker.player.getWorldBoxCenter(), "wrn.watchit", -1, -1, 0); //clear the "lastDamageClient" tag so we don't turn on teammates... unless it's uberbob! %clVictim.lastDamageClient = -1; } } function CTFGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clVictim.team != %clAttacker.team) DefaultGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement); } function CTFGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement) { DefaultGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement); } function CTFGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim && !%clVictim.isAIControlled()) { // The Bot is only a little sorry: if ( getRandom() > 0.9 ) AIMessageThread("ChatSorry", %clAttacker, %clVictim); } } PK !((__scripts/aiChat.cs//------------------------------ //AI Message functions function AIFindCommanderAI(%omitClient) { %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %client = ClientGroup.getObject(%i); if (%client != %omitClient && AIClientIsAlive(%client) && %client.isAIControlled()) return %client; } //didn't find anyone return -1; } $AIMsgThreadId = 0; $AIMsgThreadActive = false; $AIMsgThreadIndex = 0; $AIMsgThreadDelay = 0; $AIMsgThreadTable[0] = ""; function AIProcessMessageTable(%threadId) { //make sure we're still on the same thread if (%threadId != $AIMsgThreadId) return; //get the speaker, the message, and the delay %speaker = getWord($AIMsgThreadTable[$AIMsgThreadIndex], 0); %msg = getWord($AIMsgThreadTable[$AIMsgThreadIndex], 1); %delay = getWord($AIMsgThreadTable[$AIMsgThreadIndex], 2); //make sure the speaker is still alive if (%speaker $= "" || ! AIClientIsAlive(%speaker, $AIMsgThreadDelay)) AIEndMessageThread(%threadId); else { //play the msg, schedule the next msg, and increment the index %tag = addTaggedString( %msg ); serverCmdCannedChat(%speaker, %tag, true); removeTaggedString( %tag ); schedule(%delay, 0, "AIProcessMessageTable", %threadId); $AIMsgThreadDelay = %delay; $AIMsgThreadIndex++; } } function AIEndMessageThread(%threadId) { if (%threadId == $AIMsgThreadId) $AIMsgThreadActive = false; } function AIMessageThreadTemplate(%type, %msg, %clSpeaker, %clListener) { //abort if AI chat has been disabled if ($AIDisableChat) return; //initialize the params if (%clListener $= "") %clListener = 0; //abort if we're already in a thread if ($AIMsgThreadActive) return; //initialize the new thread vars $AIMsgThreadId++; $AIMsgThreadActive = true; $AIMsgThreadIndex = 0; $AIMsgThreadTable[1] = ""; switch$ (%type) { case "DefendBase": if (%clListener < 0) %clListener = AIFindCommanderAI(%clSpeaker); if (%clListener > 0) { //we have two people, create a semi-random conversation: %index = -1; //see if we issue a command first if (getRandom() < 0.30) { //which version of "defend our base"? %randNum = getRandom(); if (%randNum < 0.33) $AIMsgThreadTable[%index++] = %clListener @ " ChatCmdDefendBase " @ 1250; else if (%randNum < 0.66) $AIMsgThreadTable[%index++] = %clListener @ " ChatCmdDefendReinforce " @ 1500; else $AIMsgThreadTable[%index++] = %clListener @ " ChatCmdDefendEntrances " @ 1250; //do we acknowledge the command first? if (getRandom() < 0.5) { if (getRandom() < 0.5) $AIMsgThreadTable[%index++] = %clSpeaker @ " ChatCmdAcknowledged " @ 1500; else $AIMsgThreadTable[%index++] = %clSpeaker @ " ChatTeamYes " @ 1500; } } //the actual msg to be used $AIMsgThreadTable[%index++] = %clSpeaker @ " " @ %msg @ " " @ 1750; //do we say "thanks"? if (getRandom() < 0.3) { $AIMsgThreadTable[%index++] = %clListener @ " ChatTeamThanks " @ 1000; //do we say "you're welcom?" if (getRandom() < 0.5) $AIMsgThreadTable[%index++] = %clSpeaker @ " ChatWelcome " @ 1500; } //end the thread $AIMsgThreadTable[%index++] = ""; } else { //just stick with the original $AIMsgThreadTable[0] = %clSpeaker @ " " @ %msg @ " " @ 1750; } //now process the table AIProcessMessageTable($AIMsgThreadId); case "AttackBase": if (%clListener < 0) %clListener = AIFindCommanderAI(%clSpeaker); if (%clListener > 0) { //we have two people, create a semi-random conversation: %index = -1; //see if we issue a command first if (getRandom() < 0.30) { //which version of "attack the enemy base"? %randNum = getRandom(); if (%randNum < 0.33) $AIMsgThreadTable[%index++] = %clListener @ " ChatCmdAttack " @ 1250; else if (%randNum < 0.66) $AIMsgThreadTable[%index++] = %clListener @ " ChatCmdAttackBase " @ 1500; else $AIMsgThreadTable[%index++] = %clListener @ " ChatCmdAttackReinforce " @ 1250; //do we acknowledge the command first? if (getRandom() < 0.5) { if (getRandom() < 0.5) $AIMsgThreadTable[%index++] = %clSpeaker @ " ChatCmdAcknowledged " @ 1500; else $AIMsgThreadTable[%index++] = %clSpeaker @ " ChatTeamYes " @ 1500; } } //the actual msg to be used $AIMsgThreadTable[%index++] = %clSpeaker @ " " @ %msg @ " " @ 1750; //do we say "thanks"? if (getRandom() < 0.3) { $AIMsgThreadTable[%index++] = %clListener @ " ChatTeamThanks " @ 1000; //do we say "you're welcom?" if (getRandom() < 0.5) $AIMsgThreadTable[%index++] = %clSpeaker @ " ChatWelcome " @ 1500; } //end the thread $AIMsgThreadTable[%index++] = ""; } else { //just stick with the original $AIMsgThreadTable[0] = %clSpeaker @ " " @ %msg @ " " @ 1750; } //now process the table AIProcessMessageTable($AIMsgThreadId); case "RepairBase": if (%clListener < 0) %clListener = AIFindCommanderAI(%clSpeaker); if (%clListener > 0) { //we have two people, create a semi-random conversation: %index = -1; //see if we issue a command first if (getRandom() < 0.30) { //which version of "repair"? $AIMsgThreadTable[%index++] = %clListener @ " ChatRepairBase " @ 1250; //do we acknowledge the command first? if (getRandom() < 0.5) { if (getRandom() < 0.5) $AIMsgThreadTable[%index++] = %clSpeaker @ " ChatCmdAcknowledged " @ 1500; else $AIMsgThreadTable[%index++] = %clSpeaker @ " ChatTeamYes " @ 1500; } } //the actual msg to be used $AIMsgThreadTable[%index++] = %clSpeaker @ " " @ %msg @ " " @ 1750; //do we say "thanks"? if (getRandom() < 0.3) { $AIMsgThreadTable[%index++] = %clListener @ " ChatTeamThanks " @ 1000; //do we say "you're welcom?" if (getRandom() < 0.5) $AIMsgThreadTable[%index++] = %clSpeaker @ " ChatWelcome " @ 1500; } //end the thread $AIMsgThreadTable[%index++] = ""; } else { //just stick with the original $AIMsgThreadTable[0] = %clSpeaker @ " " @ %msg @ " " @ 1750; } //now process the table AIProcessMessageTable($AIMsgThreadId); } } function AIMessageThread(%msg, %clSpeaker, %clListener, %force, %index, %threadId) { //abort if AI chat has been disabled if ($AIDisableChat) return; //initialize the params if (%index $= "") %index = 0; if (%clListener $= "") %clListener = 0; if (%force $= "") %force = false; //if this is the initial call, see if we're already in a thread, and if we should force this one if (%index == 0 && $AIMsgThreadActive && !%force) { error("DEBUG msg thread already in progress - aborting: " @ %msg @ " from client: " @ %clSpeaker); return; } //if this is an ongoing thread, make sure it wasn't pre-empted if (%index > 0 && %threadId != $AIMsgThreadId) return; //if this is a new thread, set a new thread id if (%index == 0) { $AIMsgThreadId++; $AIMsgThreadActive = true; %threadId = $AIMsgThreadId; } switch$ (%msg) { //this is an example of how to use the chat system without using the table... case "ChatHi": serverCmdCannedChat(%clSpeaker, 'ChatHi', true); %responsePending = false; if (%index == 0) { if (%clListener < 0) %clListener = AIFindCommanderAI(%clSpeaker); if (%clListener > 0 && (getRandom() < 0.5)) { %responsePending = true; schedule(1000, 0, "AIMessageThread", %msg, %clListener, 0, false, 1, %threadId); } } if (! %responsePending) schedule(1000, 0, "AIEndMessageThread", $AIMsgThreadId); //this method of using the chat system sets up a table instead... //the equivalent is commented out below - same effect - table is much better. case "ChatSelfDefendGenerator": if (%index == 0) { //initialize the table $AIMsgThreadIndex = 0; $AIMsgThreadTable[1] = ""; %commander = AIFindCommanderAI(%clSpeaker); if (%commander > 0) { $AIMsgThreadTable[0] = %commander @ " ChatCmdDefendBase " @ 1000; $AIMsgThreadTable[1] = %clSpeaker @ " ChatCmdAcknowledged " @ 1250; $AIMsgThreadTable[2] = %clSpeaker @ " " @ %msg @ " " @ 1000; $AIMsgThreadTable[3] = ""; } else $AIMsgThreadTable[0] = %clSpeaker @ " " @ %msg @ " " @ 1000; //now process the table AIProcessMessageTable(%threadId); } // case "ChatSelfDefendGenerator": // %responsePending = false; // if (%index == 0) // { // //find the commander // %commander = AIFindCommanderAI(%clSpeaker); // if (%commander > 0) // { // %responsePending = true; // serverCmdCannedChat(%commander, "ChatCmdDefendBase", true); // schedule("AIMessageThread(" @ %msg @ ", " @ %clSpeaker @ ", 0, 1, " @ %type @ ", false, " @ %threadId @ ");", 1000); // } // else // serverCmdCannedChat(%commander, "ChatSelfDefendGenerator", true); // } // else if (%index == 1) // { // //make sure the client is still alive // if (AIClientIsAlive(%clSpeaker, 1000)) // { // %responsePending = true; // serverCmdCannedChat(%clSpeaker, "ChatCmdAcknowledged", true); // schedule("AIMessageThread(" @ %msg @ ", " @ %clSpeaker @ ", 0, 2, " @ %type @ ", false, " @ %threadId @ ");", 1000); // } // else // AIEndMessageThread($AIMsgThreadId); // } // else if (%index == 2) // { // //make sure the client is still alive // if (AIClientIsAlive(%clSpeaker, 1000)) // serverCmdCannedChat(%clSpeaker, "ChatSelfDefendGenerator", true); // else // AIEndMessageThread($AIMsgThreadId); // } // if (! %responsePending) // schedule("AIEndMessageThread(" @ $AIMsgThreadId @ ");", 1000); default: %tag = addTaggedString( %msg ); serverCmdCannedChat( %clSpeaker, %tag, true ); removeTaggedString( %tag ); // Don't keep incrementing the string ref count... schedule( 1500, 0, "AIEndMessageThread", $AIMsgThreadId ); } } function AIPlay3DSound(%client, %sound) { %player = %client.player; if (!isObject(%player)) return; playTargetAudio(%client.target, addTaggedString(%sound), AudioClosest3d, true); } function AIPlayAnimSound(%client, %location, %sound, %minCel, %maxCel, %index) { //make sure the client is still alive if (! AIClientIsAlive(%client, 500)) return; switch (%index) { case 0: //if we can set the client's aim, we can also try the animation if (%client.aimAt(%location, 2500)) schedule(250, %client, "AIPlayAnimSound", %client, %location, %sound, %minCel, %maxCel, 1); else schedule(750, %client, "AIPlay3DSound", %client, %sound); case 1: //play the animation and schedule the next phase %randRange = %maxCel - %minCel + 1; %celNum = %minCel + mFloor(getRandom() * (%randRange - 0.1)); if (%celNum > 0) %client.player.setActionThread("cel" @ %celNum); schedule(500, %client, "AIPlayAnimSound", %client, %location, %sound, %minCel, %maxCel, 2); case 2: //say 'hi' AIPlay3DSound(%client, %sound); } } $AIAnimSalute = 1; $AIAnimWave = 2; function AIRespondToEvent(%client, %eventTag, %targetClient) { //record the event time $EventTagTimeArray[%eventTag] = getSimTime(); //abort if AI chat has been disabled if ($AIDisableChatResponse) return; %clientPos = %client.player.getWorldBoxCenter(); switch$ (%eventTag) { case 'ChatHi' or 'ChatAnimWave': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { %setHumanControl = false; if (!%client.isAIControlled() && %client.controlAI != %targetClient) %setHumanControl = aiAttemptHumanControl(%client, %targetClient); if (%setHumanControl) schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.hi", $AIAnimSalute, $AIAnimSalute, 0); else schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.hi", $AIAnimWave, $AIAnimWave, 0); } case 'ChatBye' or 'ChatTeamDisembark' or 'ChatAnimBye': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.bye", $AIAnimWave, $AIAnimWave, 0); //see if we need to release the bot if (aiHumanHasControl(%client, %targetClient)) { %objective = %targetClient.objective; if (%objective.issuedByClientId == %client && %objective.targetClientId == %client && %objective.getName() $= "AIOEscortPlayer") { AIClearObjective(%objective); %objective.delete(); } aiReleaseHumanControl(%client, %targetClient); } } case 'ChatTeamYes' or 'ChatGlobalYes' or 'ChatCheer' or 'ChatAnimDance': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { //choose the animation range %minCel = 5; %maxCel = 8; if (getRandom() > 0.5) %sound = "gbl.thanks"; else %sound = "gbl.awesome"; schedule(500, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, %sound, %minCel, %maxCel, 0); } case 'ChatAnimSalute': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) schedule(500, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.thanks", $AIAnimSalute, $AIAnimSalute, 0); case 'ChatAwesome' or 'ChatGoodGame' or 'ChatGreatShot' or 'ChatNice' or 'ChatYouRock' or 'ChatAnimSpec3': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { //choose the animation range %minCel = 5; %maxCel = 8; if (getRandom() > 0.5) %sound = "gbl.thanks"; else %sound = "gbl.yes"; schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, %sound, %minCel, %maxCel, 0); } case 'ChatAww' or 'ChatObnoxious' or 'ChatSarcasm' or 'ChatAnimSpec1' or 'ChatAnimSpec2': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { if (%targetClient.controlByHuman == %client) schedule(1500, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.oops", $AIAnimSalute, $AIAnimSalute, 0); else schedule(1500, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.quiet", -1, -1, 0); } case 'ChatBrag' or 'ChatAnimGetSome': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { if (%targetClient.controlByHuman == %client) schedule(1500, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.yes", $AIAnimSalute, $AIAnimSalute, 0); else schedule(1500, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.no", -1, -1, 0); } case 'ChatAnimAnnoyed' or 'ChatMove': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { if (%targetClient.controlByHuman == %client) { schedule(750, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "vqk.sorry", $AIAnimSalute, $AIAnimSalute, 0); %targetClient.schedule(2750, "setDangerLocation", %clientPos , 20); } else schedule(750, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.no", -1, -1, 0); } case 'ChatQuiet': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { if (%targetClient.controlByHuman == %client) schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.yes", $AIAnimSalute, $AIAnimSalute, 0); else schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.no", -1, -1, 0); } case 'ChatWait' or 'ChatShazbot': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { if (%targetClient.controlByHuman == %client) schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.yes", $AIAnimSalute, $AIAnimSalute, 0); else schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.no", -1, -1, 0); } case 'ChatLearn' or 'ChatIsBaseSecure': schedule(750, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.dunno", -1, -1, 0); case 'ChatWelcome' or 'ChatSorry' or 'ChatAnyTime': schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.thanks", $AIAnimWave, $AIAnimWave, 0); case 'ChatDunno' or 'ChatDontKnow': schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.yes", -1, -1, 0); case 'ChatTeamNo' or 'ChatOops' or 'ChatGlobalNo': schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.shazbot", -1, -1, 0); case 'ChatTeamThanks' or 'ChatThanks': schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "vqk.anytime", $AIAnimWave, $AIAnimWave, 0); case 'ChatWarnShoot': schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "vqk.sorry", -1, -1, 0); case 'ChatCmdWhat': //see if the weight for the escort is higher than what he might otherwise be doing if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { //first, find the chat message %objective = %targetClient.objective; if (%objective > 0) { if (%objective.chat) %sound = getWord(%objective.chat, 0) @ "Sound"; else { %type = %objective.getName(); switch$ (%type) { case "AIOAttackLocation": %sound = "att.base"; case "AIOAttackObject": if (%objective.targetObjectId > 0) { %objType = %objective.targetObjectId.getDataBlock().getName(); switch$ (%objType) { case "GeneratorLarge": %sound = "slf.att.generator"; case "SensorLargePulse": %sound = "slf.att.sensors"; case "SensorMediumPulse": %sound = "slf.att.sensors"; case "TurretBaseLarge": %sound = "slf.att.turrets"; case "StationVehicle": %sound = "slf.att.vehicle"; default: %sound = "slf.att.base"; } } else %sound = "slf.att.base"; case "AIODefendLocation": if (%objective.targetObjectId > 0) { %objType = %objective.targetObjectId.getDataBlock().getName(); switch$ (%objType) { case "Flag": %sound = "slf.def.flag"; case "GeneratorLarge": %sound = "slf.def.generator"; case "SensorLargePulse": %sound = "slf.def.sensors"; case "SensorMediumPulse": %sound = "slf.def.sensors"; case "TurretBaseLarge": %sound = "slf.def.turrets"; case "StationVehicle": %sound = "slf.def.vehicle"; default: %sound = "slf.def.base"; } } else %sound = "slf.def.defend"; case "AIOAttackPlayer": %sound = "slf.att.attack"; case "AIOEscortPlayer": %sound = "slf.def.defend"; case "AIORepairObject": if (%objective.targetObjectId > 0) { %objType = %objective.targetObjectId.getDataBlock().getName(); switch$ (%objType) { case "GeneratorLarge": %sound = "slf.rep.generator"; case "SensorLargePulse": %sound = "slf.rep.sensors"; case "SensorMediumPulse": %sound = "slf.rep.sensors"; case "TurretBaseLarge": %sound = "slf.rep.turrets"; case "StationVehicle": %sound = "slf.rep.vehicle"; default: %sound = "slf.rep.equipment"; } } else %sound = "slf.rep.base"; case "AIOLazeObject": %sound = "slf.att.base"; case "AIOMortarObject": if (%objective.targetObjectId > 0) { %objType = %objective.targetObjectId.getDataBlock().getName(); switch$ (%objType) { case "GeneratorLarge": %sound = "slf.att.generator"; case "SensorLargePulse": %sound = "slf.att.sensors"; case "SensorMediumPulse": %sound = "slf.att.sensors"; case "TurretBaseLarge": %sound = "slf.att.turrets"; case "StationVehicle": %sound = "slf.att.vehicle"; default: %sound = "slf.att.base"; } } else %sound = "slf.att.base"; case "AIOTouchObject": if (%objective.mode $= "FlagGrab") %sound = "slf.att.flag"; else if (%objective.mode $= "FlagCapture") %sound = "flg.flag"; else %sound = "slf.att.base"; case "AIODeployEquipment": %sound = "slf.tsk.defense"; default: %sound = "gbl.dunno"; } } } else %sound = "gbl.dunno"; //now that we have a sound, play it with the salute animation schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, %sound, 1, 1, 0); } //these here are all "self" messages requiring a "thank you" case 'ChatRepairBase' or 'ChatSelfAttack' or 'ChatSelfAttackBase' or 'ChatSelfAttackFlag' or 'ChatSelfAttackGenerator' or 'ChatSelfAttackSensors' or 'ChatSelfAttackTurrets' or 'ChatSelfAttackVehicle': schedule(750, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.thanks", 1, 1, 0); case 'ChatSelfDefendBase' or 'ChatSelfDefend' or 'ChatSelfDefendFlag' or 'ChatSelfDefendGenerator' or 'ChatSelfDefendNexus' or 'ChatSelfDefendSensors' or 'ChatSelfDefendTurrets' or 'ChatSelfDefendVehicle': schedule(750, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.thanks", 1, 1, 0); case 'ChatSelfRepairBase' or 'ChatSelfRepairEquipment' or 'ChatSelfRepairGenerator' or 'ChatSelfRepair' or 'ChatSelfRepairSensors' or 'ChatSelfRepairTurrets' or 'ChatSelfRepairVehicle': schedule(750, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.thanks", 1, 1, 0); case 'ChatTaskCover' or 'ChatTaskSetupD' or 'ChatTaskOnIt' or 'ChatTaskSetupRemote' or 'ChatTaskSetupSensors' or 'ChatTaskSetupTurrets' or 'ChatTaskVehicle': schedule(750, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "gbl.thanks", 1, 1, 0); case 'EnemyFlagCaptured': //find all the clients within 100 m of the home flag, and get them all to cheer %flagPos = %client.player.getWorldBoxCenter(); %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); //make sure the client is alive, and on the same team if (%cl.isAIControlled() && %cl.team == %client.team && AIClientIsAlive(%cl)) { //see if they're within 100 m %distance = %cl.getPathDistance(%flagPos); if (%distance > 0 && %distance < 100) { //choose the animation range %minCel = 5; %maxCel = 8; %randTime = mFloor(getRandom() * 1500) + 1; //pick a random sound if (getRandom() > 0.25) %sound = "gbl.awesome"; else if (getRandom() > 0.5) %sound = "gbl.thanks"; else if (getRandom() > 0.75) %sound = "gbl.nice"; else %sound = "gbl.rock"; schedule(%randTime, %cl, "AIPlayAnimSound", %cl, %flagPos, %sound, %minCel, %maxCel, 0); } } } case 'ChatCmdHunterGiveFlags' or 'ChatCmdGiveMeFlag': if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { schedule(250, %targetClient, "AIPlayAnimSound", %targetClient, %clientPos, "cmd.acknowledge", $AIAnimSalute, $AIAnimSalute, 0); schedule(750, %targetClient.player, "serverCmdThrowFlag", %targetClient); } } } PK !(TZEscripts/aiCnH.cs//----------------------------------------------- // AI functions for Capture and Hold function aicnh() { exec("scripts/aiCnH.cs"); } function CnHGame::AIInit(%game) { for (%i = 1; %i <= %game.numTeams; %i++) { if (!isObject($ObjectiveQ[%i])) { $ObjectiveQ[%i] = new AIObjectiveQ(); MissionCleanup.add($ObjectiveQ[%i]); } error("team " @ %i @ " objectives load..."); $ObjectiveQ[%i].clear(); AIInitObjectives(%i, %game); } //call the default AIInit() function AIInit(); } function CnHGame::onAIRespawn(%game, %client) { //add the default tasks if (! %client.defaultTasksAdded) { %client.defaultTasksAdded = true; %client.addTask(AIEngageTask); %client.addTask(AIPickupItemTask); %client.addTask(AITauntCorpseTask); %client.addTask(AIPatrolTask); %client.addtask(AIEngageTurretTask); %client.addtask(AIDetectMineTask); } } function CnHGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clAttacker && %clAttacker != %clVictim && %clAttacker.team == %clVictim.team) { schedule(250, %clVictim, "AIPlayAnimSound", %clVictim, %clAttacker.player.getWorldBoxCenter(), "wrn.watchit", -1, -1, 0); //clear the "lastDamageClient" tag so we don't turn on teammates... unless it's uberbob! %clVictim.lastDamageClient = -1; } } function CnHGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clVictim.team != %clAttacker.team) DefaultGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement); } function CnHGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement) { DefaultGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement); } function CnHGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim && !%clVictim.isAIControlled()) { // The Bot is only a little sorry: if ( getRandom() > 0.9 ) AIMessageThread("ChatSorry", %clAttacker, %clVictim); } } function CnHGame::AIplayerCaptureFlipFlop(%game, %player, %flipFlop) { } PK !(HMMscripts/aiDeathMatch.csfunction DMGame::AIInit(%game) { //call the default AIInit() function AIInit(); } function DMGame::onAIRespawn(%game, %client) { //add the default task if (! %client.defaultTasksAdded) { %client.defaultTasksAdded = true; %client.addTask(AIEngageTask); %client.addTask(AIPickupItemTask); %client.addTask(AIUseInventoryTask); %client.addTask(AITauntCorpseTask); %client.addTask(AIEngageTurretTask); %client.addtask(AIDetectMineTask); %client.addTask(AIPatrolTask); } //set the inv flag %client.spawnUseInv = true; } PK !(7xxscripts/aiDebug.cs//------------------------------ //AI Debugging functions function aics() { aidebug(-1); exec("scripts/ai.cs"); } function ga(%pack) { $testcheats = 1; giveall(); switch$ (%pack) { case "repair": LocalClientConnection.player.setInventory(RepairPack, 1); case "charge": LocalClientConnection.player.setInventory(SatchelCharge, 1); case "energy": LocalClientConnection.player.setInventory(EnergyPack, 1); case "cloak": LocalClientConnection.player.setInventory(CloakingPack, 1); case "shield": LocalClientConnection.player.setInventory(ShieldPack, 1); case "jammer": LocalClientConnection.player.setInventory(SensorJammerPack, 1); } } function aiga(%client) { $TestCheats = 1; %player = %client.player; %player.setInventory(RepairKit,999); %player.setInventory(Mine,999); %player.setInventory(MineAir,999); %player.setInventory(MineLand,999); %player.setInventory(MineSticky,999); %player.setInventory(Grenade,999); %player.setInventory(FlashGrenade,999); %player.setInventory(FlareGrenade,999); %player.setInventory(ConcussionGrenade,999); %player.setInventory(CameraGrenade, 999); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(MissileLauncher, 1); %player.setInventory(Mortar, 1); %player.setInventory(MissileLauncherAmmo, 999); %player.setInventory(GrenadeLauncherAmmo, 999); %player.setInventory(MortarAmmo, 999); %player.setInventory(PlasmaAmmo,999); %player.setInventory(ChaingunAmmo, 999); %player.setInventory(DiscAmmo, 999); %player.setInventory(TargetingLaser, 1); %player.setInventory(ELFGun, 1); %player.setInventory(SniperRifle, 1); %player.setInventory(ShockLance, 1); } function aiCome(%from, %to) { if (%to $= "") %to = 2; %from.player.setTransform(%to.player.getTransform()); } function findBotWithInv(%item) { for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (isObject(%cl.player) && %cl.player.getInventory(%item)) echo(%cl @ ":" SPC getTaggedString(%cl.name) SPC "has item" SPC %item); } } function listInv(%client) { %player = %client.player; %count = %player.getInventory(RepairKit); if (%count > 0) echo("RepairKit: " @ %count); %count = %player.getInventory(Mine); if (%count > 0) echo("Mine: " @ %count); %count = %player.getInventory(MineAir); if (%count > 0) echo("MineAir: " @ %count); %count = %player.getInventory(MineLand); if (%count > 0) echo("MineLand: " @ %count); %count = %player.getInventory(MineSticky); if (%count > 0) echo("MineSticky: " @ %count); %count = %player.getInventory(Grenade); if (%count > 0) echo("Grenade: " @ %count); %count = %player.getInventory(FlashGrenade); if (%count > 0) echo("FlashGrenade: " @ %count); %count = %player.getInventory(FlareGrenade); if (%count > 0) echo("FlareGrenade: " @ %count); %count = %player.getInventory(ConcussionGrenade); if (%count > 0) echo("ConcussionGrenade: " @ %count); %count = %player.getInventory(CameraGrenade); if (%count > 0) echo("CameraGrenade: " @ %count); %count = %player.getInventory(Blaster); if (%count > 0) echo("Blaster: " @ %count); %count = %player.getInventory(Plasma); if (%count > 0) echo("Plasma: " @ %count); %count = %player.getInventory(Disc); if (%count > 0) echo("Disc: " @ %count); %count = %player.getInventory(Chaingun); if (%count > 0) echo("Chaingun: " @ %count); %count = %player.getInventory(GrenadeLauncher); if (%count > 0) echo("GrenadeLauncher: " @ %count); %count = %player.getInventory(MissileLauncher); if (%count > 0) echo("MissileLauncher: " @ %count); %count = %player.getInventory(Mortar); if (%count > 0) echo("Mortar: " @ %count); %count = %player.getInventory(MissileLauncherAmmo); if (%count > 0) echo("MissileLauncherAmmo: " @ %count); %count = %player.getInventory(GrenadeLauncherAmmo); if (%count > 0) echo("GrenadeLauncherAmmo: " @ %count); %count = %player.getInventory(MortarAmmo); if (%count > 0) echo("MortarAmmo: " @ %count); %count = %player.getInventory(PlasmaAmmo); if (%count > 0) echo("PlasmaAmmo: " @ %count); %count = %player.getInventory(ChaingunAmmo); if (%count > 0) echo("ChaingunAmmo: " @ %count); %count = %player.getInventory(DiscAmmo); if (%count > 0) echo("DiscAmmo: " @ %count); %count = %player.getInventory(TargetingLaser); if (%count > 0) echo("TargetingLaser: " @ %count); %count = %player.getInventory(ELFGun); if (%count > 0) echo("ELFGun: " @ %count); %count = %player.getInventory(SniperRifle); if (%count > 0) echo("SniperRifle: " @ %count); %count = %player.getInventory(ShockLance); if (%count > 0) echo("ShockLance: " @ %count); %count = %player.getInventory(RepairPack); if (%count > 0) echo("RepairPack: " @ %count); %count = %player.getInventory(EnergyPack); if (%count > 0) echo("EnergyPack: " @ %count); %count = %player.getInventory(ShieldPack); if (%count > 0) echo("ShieldPack: " @ %count); %count = %player.getInventory(CloakingPack); if (%count > 0) echo("CloakingPack: " @ %count); %count = %player.getInventory(SensorJammerPack); if (%count > 0) echo("SensorJammerPack: " @ %count); } function createAIDebugDlg() { if (!isObject("AIDebugViewProfile")) { new GuiControlProfile("AIDebugViewProfile") { fontType = "Arial Bold"; fontSize = 12; fontColor = "255 0 255"; autoSizeWidth = false; autoSizeHeight = false; modal = "false"; }; new GuiControl(aiDebugDlg) { profile = "GuiDefaultProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "True"; setFirstResponder = "True"; helpTag = "0"; bypassHideCursor = "1"; new DebugView(aiDebug) { profile = "AIDebugViewProfile"; horizSizing = "width"; vertSizing = "height"; position = "8 8"; extent = "624 464"; minExtent = "8 8"; visible = "True"; setFirstResponder = "False"; helpTag = "0"; }; }; } } function ToggleAIDebug(%make) { if (%make) { if ($AIDebugActive) { Canvas.popDialog(aiDebugDlg); $AIDebugActive = false; } else { createAIDebugDlg(); Canvas.pushDialog(aiDebugDlg, 70); $AIDebugActive = true; //make sure we're debuging the correct client if (LocalClientConnection.getControlObject() == LocalClientConnection.camera) { if (isObject(LocalClientConnection.observeClient)) aidebug(LocalClientConnection.observeClient); } } } } GlobalActionMap.bind(keyboard, "ctrl tilde", "ToggleAIDebug"); //function showFPS() //{ // if (isObject(aiDebug)) // aiDebug.setText(0, "FPS:" SPC $fps::real SPC " $patch1Avg" SPC $Patch1Avg); // schedule(1000, 0, "ShowFPS"); //} function aiDebug(%client) { if ($AIDebugTeam < 0 && $AIDebugClient < 0) { createAIDebugDlg(); Canvas.pushDialog(aiDebugDlg, 70); } $AIDebugClient = %client; $AIDebugTeam = -1; if (%client > 0) { createAIDebugDlg(); Canvas.pushDialog(aiDebugDlg, 70); aiDebug.clearText(); $AIDebugActive = true; } else { $AIDebugActive = false; Canvas.popDialog(aiDebugDlg); } } function aiDebugText(%client, %line, %text) { if (%client != $AIDebugClient) return; aiDebug.setText(%line, %text); } function aiDebugLine(%client, %startPt, %endPt, %color) { if (%client != $AIDebugClient) return; aiDebug.addLine(%startPt, %endPt, %color); } function aiDebugClearLines(%client) { if (%client != $AIDebugClient) return; aiDebug.clearLines(); } function aiGetTaskDesc(%client) { if (!%client.isAIControlled()) %returnStr = getTaggedString(%client.name) @ ": " @ "HUMAN"; else if (%client.objective > 0) { if (%client.objective.description !$= "") %returnStr = %client @ " " @ getTaggedString(%client.name) @ ": " @ %client.objective.description; else %returnStr = %client @ " " @ getTaggedString(%client.name) @ ": " @ %client.objective @ " NO DESC"; } else { %curTask = %client.getTaskName(); %curStep = %client.getStepName(); if (%curTask !$= "") %returnStr = %client @ " " @ getTaggedString(%client.name) @ ": " @ %curTask; else if (%curStep !$= "") %returnStr = %client @ " " @ getTaggedString(%client.name) @ ": " @ %curStep; else %returnStr = getTaggedString(%client.name) @ ": " @ "UNKNOWN"; } //add in some color info if (Game.numTeams != 2) %color = "E"; else if (%client.team == LocalClientConnection.team) %color = "F"; else %color = "E"; return %color @ ":" @ %returnStr; } $AIDebugTeam = -1; $AIDebugClient = -1; $AIDebugTasks = true; Canvas.popDialog(aiDebugDlg); $AIDebugActive = false; function aiEchoObjective(%objective, %lineNum, %group) { %clientAssigned = false; %indent = " "; if (%group > 0) { %indent = " "; if (%group.clientLevel[1] > 0 && %group.clientLevel[1].objective == %objective) { %assigned1 = getTaggedString(%group.clientLevel[1].name) @ ":" @ %group.clientLevel[1].objectiveWeight; %clientAssigned = true; } else %assigned1 = " "; if (%group.clientLevel[2] > 0 && %group.clientLevel[2].objective == %objective) { %assigned2 = getTaggedString(%group.clientLevel[2].name); %clientAssigned = true; } else %assigned2 = " "; } else { if (%objective.clientLevel[1] > 0) { %assigned1 = getTaggedString(%objective.clientLevel[1].name) @ ":" @ %objective.clientLevel[1].objectiveWeight; %clientAssigned = true; } else %assigned1 = " "; if (%objective.clientLevel[2] > 0) { %assigned2 = getTaggedString(%objective.clientLevel[2].name); %clientAssigned = true; } else %assigned2 = " "; } %text = %indent @ %objective @ " " @ %objective.weightLevel1 @ " " @ %assigned1 @ " " @ %assigned2 @ " " @ %objective.description; if (%clientAssigned) %color = "0 0 1"; else %color = "1 0 1"; aiDebug.setText(%lineNum, %text, %color); } function aiDebugQ(%team, %showTasks) { if ($AIDebugTeam < 0 && $AIDebugClient < 0) { createAIDebugDlg(); Canvas.pushDialog(aiDebugDlg, 70); $AIDebugActive = true; } $AIDebugTeam = %team; $AIDebugClient = -1; if ($AIDebugTeam < 0) { Canvas.popDialog(aiDebugDlg); $AIDebugActive = false; return; } if (%showTasks $= "") %showTasks = $AIDebugTasks; else $AIDebugTasks = %showTasks; aiDebug.clearText(); if (! %showTasks) return; //make sure we have a valid objectiveQ if (!isObject($ObjectiveQ[%team])) return; %timeStamp = getSimTime(); %lineNum = 1; %count = $ObjectiveQ[%team].getCount(); //clear the time stamps from all groups for (%i = 0; %i < %count; %i++) { %objective = $ObjectiveQ[%team].getObject(%i); if (%objective.group > 0) %objective.group.debugStamp = 0; } //now loop through and echo out all the objectives... for (%i = 0; %i < %count; %i++) { %objective = $ObjectiveQ[%team].getObject(%i); //if the objective is part of a group, echo out the entire group first if (%objective.group > 0) { %group = %objective.group; if (%group.debugStamp != %timeStamp) { %group.debugStamp = %timeStamp; %grpCount = %group.getCount(); //first print out the group label %text = %group @ " GROUP: " @ %group.getName(); aiDebug.setText(%lineNum, %text); %lineNum++; //now loop through and print out the grouped objectives in the order they appear in the main list for (%j = 0; %j < %count; %j++) { //print them in the order they appear in the main list %obj = $ObjectiveQ[%team].getObject(%j); if (%obj.group == %group) { aiEchoObjective(%obj, %lineNum, %group); %lineNum++; } } } } else { aiEchoObjective(%objective, %lineNum, 0); %lineNum++; } } } //------------------------------ function aioTest() { //clear out the objective Q's $ObjectiveQ[0].clear(); $ObjectiveQ[1].clear(); $ObjectiveQ[2].clear(); /////////////////////////////// // team 1 objectives // /////////////////////////////// // %newObjective = new AIObjective(AIORepairObject) { // position = "0 0 0"; // rotation = "1 0 0 0"; // scale = "1 1 1"; // description = "Repair the generator"; // targetObject = "Team0GeneratorLarge1"; // targetClientId = "-1"; // targetObjectId = nameToId("Team0GeneratorLarge1"); // location = "0 0 0"; // weightLevel1 = "3200"; // weightLevel2 = "1600"; // weightLevel3 = "0"; // weightLevel4 = "0"; // offense = "0"; // defense = "1"; // equipment = "RepairPack"; // buyEquipmentSet = "HeavyRepairSet"; // issuedByHuman = "0"; // issuingClientId = "-1"; // forceClientId = "-1"; // locked = "0"; // }; // $ObjectiveQ[0].add(%newObjective); // // %newObjective = new AIObjective(AIODefendLocation) { // position = "-178 -156 120"; // rotation = "1 0 0 0"; // scale = "1 1 1"; // description = "Defend our generator"; // targetObject = "Team0GeneratorLarge1"; // targetClientId = "-1"; // targetObjectId = "-1"; // location = "-178 -156 120"; // weightLevel1 = "3900"; // weightLevel2 = "2000"; // weightLevel3 = "0"; // weightLevel4 = "0"; // offense = "0"; // defense = "1"; // desiredEquipment = "ShieldPack Plasma PlasmaAmmo"; // buyEquipmentSet = "MediumShieldSet LightShieldSet HeavyShieldSet"; // chat = ""; // issuedByHuman = "0"; // issuingClientId = "-1"; // forceClientId = "-1"; // locked = "1"; // radius = "0"; // team = "0"; // }; // $ObjectiveQ[0].add(%newObjective); // %newObjective = new AIObjective(AIODefendLocation) { // position = "0 0 0"; // rotation = "1 0 0 0"; // scale = "1 1 1"; // description = "Defend the generator"; // targetObject = "Team0GeneratorLarge1"; // targetClientId = "-1"; // targetObjectId = nameToId("Team0GeneratorLarge1"); // location = "0 0 0"; // weightLevel1 = "3100"; // weightLevel2 = "1500"; // weightLevel3 = "0"; // weightLevel4 = "0"; // offense = "0"; // defense = "1"; // desiredEquipment = "ShieldPack Plasma PlasmaAmmo"; // buyEquipmentSet = "HeavyShieldSet"; // issuedByHuman = "0"; // issuingClientId = "-1"; // forceClientId = "-1"; // locked = "0"; // }; // $ObjectiveQ[0].add(%newObjective); // // %newObjective = new AIObjective(AIOAttackLocation) // { // weightLevel1 = 2000; // description = "Sniper"; // location = "50 218 95"; // offense = true; // defense = false; // equipment = "SniperRifle EnergyPack"; // buyEquipmentSet = "LightEnergySniper"; // }; // $ObjectiveQ[0].add(%newObjective); // // %newObjective = new AIObjective(AIOLazeObject) // { // weightLevel1 = 10000; // description = "Laze the enemy turret"; // targetObject = NameToId("Team1Turret"); // targetClient = %client; //note, used to store the task requester // offense = true; // equipment = "TargetingLaser"; // buyEquipmentSet = "LightEnergySniper"; // }; // $ObjectiveQ[0].add(%newObjective); // // %newObjective = new AIObjective(AIOMortarObject) // { // weightLevel1 = $AIWeightMortarTurret[1]; // weightLevel2 = $AIWeightMortarTurret[2]; // description = "Mortar the enemy turret"; // targetObject = "Team1TurretBaseLarge1"; // targetObjectId = nameToId("Team1TurretBaseLarge1"); // location = ""; // offense = true; // defense = false; // equipment = "Mortar MortarAmmo"; // buyEquipmentSet = "HeavyShieldSet"; // }; // $ObjectiveQ[0].add(%newObjective); // // %newObjective = new AIObjective(AIORepairObject) // { // weightLevel1 = $AIWeightRepairTurret[1]; // weightLevel2 = $AIWeightRepairTurret[2]; // description = "Repair the turret"; // targetObject = NameToId("Team0Turret"); // location = ""; // offense = false; // defense = true; // equipment = "RepairPack"; // }; // $ObjectiveQ[0].add(%newObjective); // // %newObjective = new AIObjective(AIOAttackObject) // { // weightLevel1 = $AIWeightAttackGenerator[1]; // weightLevel2 = $AIWeightAttackGenerator[2]; // description = "Attack the enemy generator"; // targetObject = NameToId("Team1Generator"); // location = ""; // offense = true; // defense = false; // equipment = "plasma plasmaAmmo"; // buyEquipmentSet = "HeavyShieldSet"; // }; // $ObjectiveQ[0].add(%newObjective); // // %newObjective = new AIObjective(AIORepairObject) // { // //weightLevel1 = $AIWeightRepairGenerator[1]; // weightLevel1 = 10000; // weightLevel2 = $AIWeightRepairGenerator[2]; // description = "Repair the generator"; // targetObject = NameToId("Team0Generator"); // location = ""; // offense = false; // defense = true; // equipment = "RepairPack"; // }; // $ObjectiveQ[0].add(%newObjective); // // %newObjective = new AIObjective(AIODefendLocation) // { // weightLevel1 = $AIWeightDefendGenerator[1]; // weightLevel2 = $AIWeightDefendGenerator[2]; // description = "Defend our generator"; // //targetObject = NameToId("Team0Generator"); // location = "-20 -292 46"; // offense = false; // defense = true; // }; // $ObjectiveQ[0].add(%newObjective); // %newObjective = new AIObjective(AIOEscortPlayer) // { // weightLevel1 = $AIWeightEscortOffense[1]; // weightLevel2 = $AIWeightEscortOffense[2]; // targetClientId = 2; // description = "Escort " @ getTaggedString(LocalClientConnection.name); // offense = true; // desiredEquipment = "EnergyPack"; // buyEquipmentSet = "LightEnergyELF"; // }; // $ObjectiveQ[1].add(%newObjective); /////////////////////////////// // team 2 objectives // /////////////////////////////// // %newObjective = new AIObjective(AIODefendLocation) { // position = "196 461 181"; // rotation = "1 0 0 0"; // scale = "1 1 1"; // description = "Missile defense"; // targetObject = ""; // targetClientId = "-1"; // targetObjectId = "-1"; // location = "196 461 181"; // weightLevel1 = "3900"; // weightLevel2 = "2000"; // weightLevel3 = "0"; // weightLevel4 = "0"; // offense = "0"; // defense = "1"; // equipment = "MissileLauncher"; // buyEquipmentSet = "MediumMissileSet HeavyMissileSet"; // chat = ""; // issuedByHuman = "0"; // issuingClientId = "-1"; // forceClientId = "-1"; // locked = "1"; // radius = "0"; // team = "0"; // }; // $ObjectiveQ[2].add(%newObjective); // // %newObjective = new AIObjective(AIOAttackLocation) // { // weightLevel1 = 12000; // description = "Sniper"; // location = "-164 381 134"; // offense = true; // defense = false; // equipment = "SniperRifle EnergyPack"; // buyEquipmentSet = "LightEnergySniper"; // }; // $ObjectiveQ[2].add(%newObjective); } function aiGo(%count) { %offense = true; for (%i = 0; %i < %count; %i++) { aiConnect(friendly @ %i, 1, 0.5, %offense); aiConnect(enemy @ %i, 2, 0.5, %offense); %offense = !%offense; } } function addBots(%count) { if(%count > 0) { %count++; while(%count--) aiConnect("dude " @ %count); } } function aiGoTest(%count, %team) { if (%team <= 0) %team = 1; %offense = false; for (%i = 0; %i < %count; %i++) { if (%offense) aiConnect(Offense @ %i, %team, 0.5, true); else aiConnect(Defense @ %i, %team, 0.5, false); %offense = !%offense; } } //------------------------------ function aiTest() { //find/create an enemy %count = ClientGroup.getCount(); if (%count <= 1) { %enemyCl = aiConnect(test, 1, 0.5, false); } else %enemyCl = ClientGroup.getObject(1); //create the objective if (! $testObjective) { $testObjective = new AIObjective(AIOAttackPlayer) { weightLevel1 = 10000; description = "Attack the human!"; targetClient = nameToId(LocalClientConnection); location = ""; offense = true; defense = true; }; MissionCleanup.add($testObjective); } //set the enemy inventory %enemyPl = %enemyCl.player; %enemyPl.setInventory(RepairKit,1); %enemyPl.setInventory(Grenade,5); //%enemyPl.setInventory(Blaster,1); //%enemyPl.setInventory(Plasma,1); %enemyPl.setInventory(Disc,1); %enemyPl.setInventory(Chaingun, 1); %enemyPl.setInventory(GrenadeLauncher, 1); //%enemyPl.setInventory(Mortar, 1); %enemyPl.setInventory(ChaingunAmmo, 100); %enemyPl.setInventory(DiscAmmo, 15); %enemyPl.setInventory(PlasmaAmmo,20); %enemyPl.setInventory(GrenadeLauncherAmmo, 10); %enemyPl.setInventory(MortarAmmo, 10); %enemyPl.setDamageLevel(0.0); //set the target inventory %targetCl = 2; %targetPl = %targetCl.player; %targetPl.setInventory(RepairKit,1); %targetPl.setInventory(Grenade,5); //%targetPl.setInventory(Blaster,1); //%targetPl.setInventory(Plasma,1); %targetPl.setInventory(Disc,1); %targetPl.setInventory(Chaingun, 1); %targetPl.setInventory(GrenadeLauncher, 1); //%targetPl.setInventory(Mortar, 1); %targetPl.setInventory(ChaingunAmmo, 100); %targetPl.setInventory(DiscAmmo, 15); %targetPl.setInventory(PlasmaAmmo,20); %targetPl.setInventory(GrenadeLauncherAmmo, 10); %targetPl.setInventory(MortarAmmo, 10); %targetPl.setDamageLevel(0.0); //now force the attack objective AIForceObjective(%enemyCl, $testObjective); %enemyCl.stepEngage(2); } function aibump() { %t1 = "-348 -470 142 0 0 1 0"; %t2 = "-347 -453 142 0 0 1 3.14"; %t3 = "-348 -462 142 0 0 1 0"; 2.player.setTransform(%t3); 3.player.setTransform(%t1); 4.player.setTransform(%t2); 3.stepMove(%t2, 0.1); 4.stepMove(%t1, 0.1); } function aibump2() { %t1 = "-345.082 -464.229 142 0 0 1 0"; %t2 = "-347 -453 142 0 0 1 3.14"; %t3 = "-347.22 -463.439 142 0 0 1 1.89"; 2.player.setTransform(%t3); 3.player.setTransform(%t1); 3.stepMove(%t2, 0.1); } function aiTestDeploys(%client, %objective) { //if we're just starting the test, unassign the client if (!isObject(%objective)) { error("DEBUG begin testing deploy objectives!"); $AITestDeployObjective = -1; aiUnassignClient(%client); } //if the client isn't still on the test objective, choose the next one if (%client.objective != $AITestDeployObjective) { //if there's a corresponding "repairObjective" for the deploy, then the deploy succeeded if (isobject($AITestDeployObjective)) { if (!isObject($AITestDeployObjective.repairObjective)) $AITestDeployObjective.isInvalid = true; } //loop through all the objectives, looking for next deploy ones... %foundCurrent = !isObject($AITestDeployObjective); %nextObjective = -1; %found = false; %count = $ObjectiveQ[%client.team].getCount(); for (%i = 0; %i < %count && !%found; %i++) { %obj = $ObjectiveQ[%client.team].getObject(%i); //see if the objective is a group... if (%obj.getClassName() !$= "AIObjective") { %grpCount = %obj.getCount(); for (%j = 0; %j < %grpCount && !%found; %j++) { %grpObj = %obj.getObject(%j); if (%grpObj.getName() $= "AIODeployEquipment") { if (%foundCurrent) { %nextObjective = %grpObj; %found = true; } else if (%grpObj == $AITestDeployObjective) %foundCurrent = true; } } } else if (%obj.getName() $= "AIODeployEquipment") { //see if this is the next one if (%foundCurrent) { %nextObjective = %obj; %found = true; } else if (%obj == $AITestDeployObjective) %foundCurrent = true; } } if (isObject(%nextObjective)) { //kill all the turrets for your team... while (isObject($AIRemoteTurretSet.getObject(0))) $AIRemoteTurretSet.getObject(0).delete(); //remove any associated repairobjective from this deploy if (isObject(%nextObjective.repairObjective)) { AIClearObjective(%nextObjective.repairObjective); %nextObjective.repairObjective.delete(); %nextObjective.repairObjective = ""; } //assign the bot to the objective... error("DEBUG testing objective:" SPC %nextObjective); $AITestDeployObjective = %nextObjective; AIUnassignClient(%client); AIForceObjective(%client, $AITestDeployObjective, 10000); } else { error("DEBUG testing of deploy objectives is complete:"); %count = $ObjectiveQ[%client.team].getCount(); for (%i = 0; %i < %count && !%found; %i++) { %obj = $ObjectiveQ[%client.team].getObject(%i); //see if the objective is a group... if (%obj.getClassName() !$= "AIObjective") { %grpCount = %obj.getCount(); for (%j = 0; %j < %grpCount && !%found; %j++) { %grpObj = %obj.getObject(%j); if (%grpObj.getName() $= "AIODeployEquipment") { if (%grpObj.isInvalid) error(%grpObj SPC "is invalid."); else error(%grpObj SPC "passed."); } } } else if (%obj.getName() $= "AIODeployEquipment") { if (%obj.isInvalid) error(%obj SPC "is invalid."); else error(%obj SPC "passed."); } } return; } } //schedule the next call to see if we're still deploying... schedule(2000, %client.player, "aiTestDeploys", %client, $AITestDeployObjective); } //----------------------------------------------------------------------------- //AI test pilot task $TestPilotHeadings[0] = "203 -59 120"; $TestPilotHeadings[1] = "52 10 120"; $TestPilotHeadings[2] = "-112 125 120"; $TestPilotHeadings[3] = "-195 219 120"; $TestPilotHeadings[4] = "-198 323 120"; $TestPilotHeadings[5] = "-38 423 120"; $TestPilotHeadings[6] = "84 445 120"; $TestPilotHeadings[7] = "290 382 120"; $TestPilotHeadings[8] = "385 259 120"; $TestPilotHeadings[9] = "255 6 120"; $TestPilotHeadings[10] = "219 -49 120"; $TestPilotHeadings[11] = "222 -168 120"; function AITestPilot::assume(%task, %client) { %task.setWeightFreq(30); %task.setMonitorFreq(10); //first, make sure the pilot is in light, and doesn't have an backpacks... %client.player.throwPack(); %client.player.setArmor(Light); //next, start the pilot on his way to mounting the vehicle %client.pilotVehicle = true; %client.stepMove(%task.vehicle.position, 0.25, $AIModeMountVehicle); %task.locationIndex = -1; } function AITestPilot::weight(%task, %client) { %task.setWeight(10000); } function AITestPilot::monitor(%task, %client) { //see if we've mounted yet if (%task.locationIndex == -1) { //mount the vehicle %client.pilotVehicle = true; %client.stepMove(%task.vehicle.position, 0.25, $AIModeMountVehicle); if (isObject(%client.vehicleMounted)) { %task.locationIndex++; %client.setPilotDestination($TestPilotHeadings[%task.locationIndex]); } } //else see if we're close enough to the current destination to choose the next else { %pos = %client.vehicleMounted.position; %pos2D = getWord(%pos, 0) SPC getWord(%pos, 1) SPC "0"; %dest = $TestPilotHeadings[%task.locationIndex]; %dest2D = getWord(%dest, 0) SPC getWord(%dest, 1) SPC "0"; if (VectorDist(%dest2D, %pos2D) < 20) { if ($TestPilotHeadings[%task.locationIndex + 1] !$= "") { %task.locationIndex++; %client.setPilotDestination($TestPilotHeadings[%task.locationIndex]); } else %client.setPilotAim($TestPilotHeadings[0]); } } } function testPilot(%client, %vehicle) { %client.clearTasks(); if (%vehicle $= "") %vehicle = LocalClientConnection.vehicleMounted; %client.pilotTask = %client.addTask(AITestPilot); %client.pilotTask.vehicle = %vehicle; } PK !(["Guuscripts/aiDefaultTasks.cs//All tasks for deathmatch, hunters, and tasks that coincide with the current objective task live here... //Weights for tasks that override the objective task: must be between 4300 and 4700 $AIWeightVehicleMountedEscort = 4700; $AIWeightReturnTurretFire = 4675; $AIWeightNeedItemBadly = 4650; $AIWeightReturnFire = 4600; $AIWeightDetectMine = 4500; $AIWeightTauntVictim = 4400; $AIWeightNeedItem = 4350; $AIWeightDestroyTurret = 4300; //Weights that allow the objective task to continue: must be 3000 or less $AIWeightFoundEnemy = 3000; $AIWeightFoundItem = 2500; $AIWeightFoundToughEnemy = 1000; $AIWeightPatrolling = 2000; //Hunters weights... $AIHuntersWeightMustCap = 4690; $AIHuntersWeightNeedHealth = 4625; $AIHuntersWeightShouldCap = 4425; $AIHuntersWeightMustEngage = 4450; $AIHuntersWeightShouldEngage = 4325; $AIHuntersWeightPickupFlag = 4425; //Rabbit weights... $AIRabbitWeightDefault = 4625; $AIRabbitWeightNeedInv = 4325; //Bounty weights... $AIBountyWeightShouldEngage = 4325; //----------------------------------------------------------------------------- //AIEngageTask is responsible for anything to do with engaging an enemy function AIEngageWhoWillWin(%client1, %client2) { //assume both clients are alive - gather some info if (%client1.isAIControlled()) %skill1 = %client1.getSkillLevel(); else %skill1 = 0.5; if (%client2.isAIControlled()) %skill2 = %client2.getSkillLevel(); else %skill2 = 0.5; %damage1 = %client1.player.getDamagePercent(); %damage2 = %client2.player.getDamagePercent(); //first compare health %tolerance1 = 0.5 + ((%skill1 - %skill2) * 0.3); %tolerance2 = 0.5 + ((%skill2 - %skill1) * 0.3); if (%damage1 - %damage2 > %tolerance1) return %client2; else if (%damage2 - %damage1 > %tolerance2) return %client1; //health not a problem, see how the equipment compares for the two... %weaponry1 = AIEngageWeaponRating(%client1); %weaponry2 = AIEngageWeaponRating(%client2); %effective = 20; if (%weaponry1 < %effective && %weaponry2 >= %effective) return %client2; else if (%weaponry1 >= %effective && %weaponry2 < %effective) return %client1; //no other criteria for now... return -1 to indicate a tie... return -1; } function AIEngageTask::init(%task, %client) { } function AIEngageTask::assume(%task, %client) { %task.setWeightFreq(9); %task.setMonitorFreq(9); %task.searching = false; if (isObject(%client.shouldEngage.player)) %task.searchLocation = %client.shouldEngage.player.getWorldBoxCenter(); } function AIEngageTask::retire(%task, %client) { } function AIEngageTask::weight(%task, %client) { %player = %client.player; if (!isObject(%player)) return; %clientPos = %player.getWorldBoxCenter(); %currentTarget = %client.shouldEngage; if (!AIClientIsAlive(%currentTarget)) %currentTarget = %client.getEngageTarget(); %client.shouldEngage = -1; %mustEngage = false; %tougherEnemy = false; //first, make sure we actually can engage if (AIEngageOutOfAmmo(%client)) { %client.shouldEngage = -1; %task.setWeight(0); return; } //see if anyone has fired on us recently... %losTimeout = $AIClientMinLOSTime + ($AIClientLOSTimeout * %client.getSkillLevel()); if (AIClientIsAlive(%client.lastDamageClient, %losTimeout) && getSimTime() - %client.lastDamageTime < %losTimeout) { //see if we should turn on the new attacker if (AIClientIsAlive(%currentTarget)) { %targPos = %currentTarget.player.getWorldBoxCenter(); %curTargDist = %client.getPathDistance(%targPos); %newTargPos = %client.lastDamageClient.player.getWorldBoxCenter(); %newTargDist = %client.getPathDistance(%newTargPos); //see if the new targ is no more than 30 m further if (%newTargDist > 0 && %newTargDist < %curTargDist + 30) { %client.shouldEngage = %client.lastDamageClient; %mustEngage = true; } } else { %client.shouldEngage = %client.lastDamageClient; %mustEngage = true; } } //no one has fired at us recently, see if we're near an enemy else { %result = AIFindClosestEnemy(%client, 100, %losTimeout); %closestEnemy = getWord(%result, 0); %closestdist = getWord(%result, 1); if (%closestEnemy > 0) { //see if we're right on top of them %targPos = %closestEnemy.player.getWorldBoxCenter(); %dist = %client.getPathDistance(%targPos); if (%dist > 0 && %dist < 20) { %client.shouldEngage = %closestEnemy; %mustEngage = true; } //else choose them only if we're not already attacking someone else if (%currentTarget <= 0) { %client.shouldEngage = %closestEnemy; %mustEngage = false; //Make sure the odds are not overwhelmingly in favor of the enemy... if (AIEngageWhoWillWin(%client, %closestEnemy) == %closestEnemy) %tougherEnemy = true; } } } //if we still haven't found a new target, keep fighting the old one if (%client.shouldEngage <= 0) { if (AIClientIsAlive(%currentTarget)) { //see if we still have sight of the current target %hasLOS = %client.hasLOSToClient(%currentTarget); %losTime = %client.getClientLOSTime(%currentTarget); if (%hasLOS || %losTime < %losTimeout) %client.shouldEngage = %currentTarget; else %client.shouldEngage = -1; } else %client.shouldEngage = -1; %mustEngage = false; } //finally, set the weight if (%client.shouldEngage > 0) { if (%mustEngage) %task.setWeight($AIWeightReturnFire); else if (%tougherEnemy) %task.setWeight($AIWeightFoundToughEnemy); else %task.setWeight($AIWeightFoundEnemy); } else %task.setWeight(0); } function AIEngageTask::monitor(%task, %client) { if (!AIClientIsAlive(%client.shouldEngage)) { %client.stop(); %client.clearStep(); %client.setEngageTarget(-1); return; } %hasLOS = %client.hasLOSToClient(%client.shouldEngage); %losTime = %client.getClientLOSTime(%client.shouldEngage); //%detectLocation = %client.getDetectLocation(%client.shouldEngage); %detectPeriod = %client.getDetectPeriod(); //if we can see the target, engage... if (%hasLOS || %losTime < %detectPeriod) { %client.stepEngage(%client.shouldEngage); %task.searching = false; %task.searchLocation = %client.shouldEngage.player.getWorldBoxCenter(); } //else if we haven't for approx 5 sec... move to the last known location else { //clear the engage target %client.setEngageTarget(-1); if (! %task.searching) { %dist = VectorDist(%client.player.getWorldBoxCenter(), %task.searchLocation); if (%dist < 4) { %client.stepIdle(%task.searchLocation); %task.searching = true; } else %client.stepMove(%task.searchLocation, 4.0); } } } //----------------------------------------------------------------------------- //AIPickupItemTask is responsible for anything to do with picking up an item function AIPickupItemTask::init(%task, %client) { } function AIPickupItemTask::assume(%task, %client) { %task.setWeightFreq(10); %task.setMonitorFreq(10); %task.pickUpItem = -1; } function AIPickupItemTask::retire(%task, %client) { } function AIPickupItemTask::weight(%task, %client) { //if we're already picking up an item, make sure it's still valid, then keep the weight the same... if (%task.pickupItem > 0) { if (isObject(%task.pickupItem) && !%task.pickupItem.isHidden() && AICouldUseItem(%client, %task.pickupItem)) return; else %task.pickupItem = -1; } //otherwise, search for objects //first, see if we can pick up health %player = %client.player; if (!isObject(%player)) return; %damage = %player.getDamagePercent(); %healthRad = %damage * 100; %closestHealth = -1; %closestHealthDist = %healthRad; %closestHealthLOS = false; %closestItem = -1; %closestItemDist = 32767; %closestItemLOS = false; //loop through the item list, looking for things to pick up %itemCount = $AIItemSet.getCount(); for (%i = 0; %i < %itemCount; %i++) { %item = $AIItemSet.getObject(%i); if (!%item.isHidden()) { %dist = %client.getPathDistance(%item.getWorldBoxCenter()); if (((%item.getDataBlock().getName() $= "RepairKit" || %item.getDataBlock().getName() $= "RepairPatch") || (%item.isCorpse && %item.getInventory("RepairKit") > 0)) && %player.getInventory("RepairKit") <= 0 && %damage > 0.3) { if (%dist > 0 && %dist < %closestHealthDist) { %closestHealth = %item; %closestHealthDist = %dist; //check for LOS %mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType; %closestHealthLOS = !containerRayCast(%client.player.getWorldBoxCenter(), %item.getWorldBoxCenter(), %mask, 0); } } else { //only pick up stuff within 35m if (%dist < 35) { if (AICouldUseItem(%client, %item)) { if (%dist < %closestItemDist) { %closestItem = %item; %closestItemDist = %dist; //check for LOS %mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType; %closestItemLOS = !containerRayCast(%client.player.getWorldBoxCenter(), %item.getWorldBoxCenter(), %mask, 0); } } } } } } //now set the weight if (%closestHealth > 0) { //only choose an item if it's at least 25 m closer than health... //and we're not engageing someone or not that badly in need %currentTarget = %client.getEngageTarget(); if (%closestItem > 0 && %closetItemDist < %closestHealthDist - 25 && (%damage < 0.6 || %currentTarget <= 0) && %closestItemLOS) { %task.pickupItem = %closestItem; if (AIEngageWeaponRating(%client) < 20) %task.setWeight($AIWeightNeedItemBadly); else if (%closestItemDist < 10 && %closestItemLOS) %task.setWeight($AIWeightNeedItem); else if (%closestItemLOS) %task.setWeight($AIWeightFoundItem); else %task.setWeight(0); } else { if (%damage > 0.8) { %task.pickupItem = %closestHealth; %task.setWeight($AIWeightNeedItemBadly); } else if (%closestHealthLOS) { %task.pickupItem = %closestHealth; %task.setWeight($AIWeightNeedItem); } else %task.setWeight(0); } } else if (%closestItem > 0) { %task.pickupItem = %closestItem; if (AIEngageWeaponRating(%client) < 20) %task.setWeight($AIWeightNeedItemBadly); else if (%closestItemDist < 10 && %closestItemLOS) %task.setWeight($AIWeightNeedItem); else if (%closestItemLOS) %task.setWeight($AIWeightFoundItem); else %task.setWeight(0); } else %task.setWeight(0); } function AIPickupItemTask::monitor(%task, %client) { //move to the pickup location if (isObject(%task.pickupItem)) %client.stepMove(%task.pickupItem.getWorldBoxCenter(), 0.25); //this call works in conjunction with AIEngageTask %client.setEngageTarget(%client.shouldEngage); } //----------------------------------------------------------------------------- //AIUseInventoryTask will cause them to use an inv station if they're low //on ammo. This task should be used only for DM and Hunters - most objectives //have their own logic for when to use an inv station... function AIUseInventoryTask::init(%task, %client) { } function AIUseInventoryTask::assume(%task, %client) { %task.setWeightFreq(15); %task.setMonitorFreq(5); //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); } function AIUseInventoryTask::retire(%task, %client) { //reset the state machine time stamp... %task.buyInvTime = getSimTime(); } function AIUseInventoryTask::weight(%task, %client) { //first, see if we can pick up health %player = %client.player; if (!isObject(%player)) return; %damage = %player.getDamagePercent(); %weaponry = AIEngageWeaponRating(%client); //if there's an inv station, and we haven't used an inv station since we //spawned, the bot should use an inv once regardless if (%client.spawnUseInv) { //see if we're already heading there if (%client.buyInvTime != %task.buyInvTime) { //see if there's an inventory we can use %result = AIFindClosestInventory(%client, false); %closestInv = getWord(%result, 0); if (isObject(%closestInv)) { %task.setWeight($AIWeightNeedItem); return; } else %client.spawnUseInv = false; } else { %task.setWeight($AIWeightNeedItem); return; } } //first, see if we need equipment or health if (%damage < 0.3 && %weaponry >= 40) { %task.setWeight(0); return; } //don't use inv stations if we're not that badly damaged, and we're in the middle of a fight if (%damage < 0.6 && %client.getEngageTarget() > 0 && !AIEngageOutOfAmmo(%client)) { %task.setWeight(0); return; } //if we're already buying, continue if (%task.buyInvTime == %client.buyInvTime) { //set the weight - if our damage is above 0.8 or our we're out of ammo if (%damage > 0.8 || AIEngageOutOfAmmo(%client)) %task.setWeight($AIWeightNeedItemBadly); else %task.setWeight($AIWeightNeedItem); return; } //we need to search for an inv station near us... %result = AIFindClosestInventory(%client, false); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); //only use inv stations if we're right near them... patrolTask will get us nearer if required if (%closestDist > 35) { %task.setWeight(0); return; } //set the weight... %task.closestInv = %closestInv; if (%damage > 0.8 || AIEngageOutOfAmmo(%client)) %task.setWeight($AIWeightNeedItemBadly); else if (%closestDist < 20 && (AIEngageWeaponRating(%client) <= 30 || %damage > 0.4)) %task.setWeight($AIWeightNeedItem); else if (%hasLOS) %task.setWeight($AIWeightFoundItem); else %task.setWeight(0); } function AIUseInventoryTask::monitor(%task, %client) { //make sure we still need equipment %player = %client.player; if (!isObject(%player)) return; %damage = %player.getDamagePercent(); %weaponry = AIEngageWeaponRating(%client); if (%damage < 0.3 && %weaponry >= 40 && !%client.spawnUseInv) { %task.buyInvTime = getSimTime(); return; } //pick a random set based on armor... %randNum = getRandom(); if (%randNum < 0.4) %buySet = "LightEnergyDefault MediumEnergySet HeavyEnergySet"; else if (%randNum < 0.6) %buySet = "LightShieldSet MediumShieldSet HeavyShieldSet"; else if (%randNum < 0.8) %buySet = "LightEnergyELF MediumRepairSet HeavyAmmoSet"; else %buySet = "LightEnergySniper MediumEnergySet HeavyEnergySet"; //process the inv buying state machine %result = AIBuyInventory(%client, "", %buySet, %task.buyInvTime); //if we succeeded, reset the spawn flag if (%result $= "Finished") %client.spawnUseInv = false; //if we succeeded or failed, reset the state machine... if (%result !$= "InProgress") %task.buyInvTime = getSimTime(); //this call works in conjunction with AIEngageTask %client.setEngageTarget(%client.shouldEngage); } //----------------------------------------------------------------------------- //AITauntCorpseTask is should happen only after an enemy is freshly killed function AITauntCorpseTask::init(%task, %client) { } function AITauntCorpseTask::assume(%task, %client) { %task.setWeightFreq(11); %task.setMonitorFreq(11); } function AITauntCorpseTask::retire(%task, %client) { } function AITauntCorpseTask::weight(%task, %client) { %task.corpse = %client.getVictimCorpse(); if (%task.corpse > 0 && getSimTime() - %client.getVictimTime() < 15000) { //see if we're already taunting, and if it's time to stop if ((%task.tauntTime > %client.getVictimTime()) && (getSimTime() - %task.tauntTime > 5000)) %task.corpse = -1; else { //if the corpse is within 50m, taunt %distToCorpse = %client.getPathDistance(%task.corpse.getWorldBoxCenter()); if (%dist < 0 || %distToCorpse > 50) %task.corpse = -1; } } else %task.corpse = -1; //set the weight if (%task.corpse > 0) { //don't taunt someone if there's an enemy right near by... %result = AIFindClosestEnemy(%client, 40, 15000); %closestEnemy = getWord(%result, 0); %closestdist = getWord(%result, 1); if (%closestEnemy > 0) %task.setWeight(0); else %task.setWeight($AIWeightTauntVictim); } else %task.setWeight(0); } $AITauntChat[0] = "gbl.aww"; $AITauntChat[1] = "gbl.brag"; $AITauntChat[2] = "gbl.obnoxious"; $AITauntChat[3] = "gbl.sarcasm"; $AITauntChat[4] = "gbl.when"; function AITauntCorpseTask::monitor(%task, %client) { //make sure we still have a corpse, and are not fighting anyone if (%client.getEngageTarget() <= 0 && %task.corpse > 0 && isObject(%task.corpse)) { %clientPos = %client.player.getWorldBoxCenter(); %corpsePos = %task.corpse.getWorldBoxCenter(); %distToCorpse = VectorDist(%clientPos, %corpsePos); if (%distToCorpse < 2.0) { //start the taunt! if (%task.tauntTime < %client.getVictimTime()) { %task.tauntTime = getSimTime(); %client.stop(); if (getRandom() > 0.2) { //pick the sound and taunt cels %sound = $AITauntChat[mFloor(getRandom() * 3.99)]; %minCel = 2; %maxCel = 8; schedule(250, %client, "AIPlayAnimSound", %client, %corpsePos, %sound, %minCel, %maxCel, 0); } //say 'bye' :) else schedule(250, %client, "AIPlayAnimSound", %client, %corpsePos, "gbl.bye", 2, 2, 0); } } else %client.stepMove(%task.corpse.getWorldBoxCenter(), 1.75); } } //----------------------------------------------------------------------------- //AIPatrolTask used to wander around the map (DM and Hunters mainly) looking for something to do... function AIPatrolTask::init(%task, %client) { } function AIPatrolTask::assume(%task, %client) { %task.setWeightFreq(13); %task.setMonitorFreq(13); %task.findLocation = true; %task.patrolLocation = "0 0 0"; %task.idleing = false; %task.idleEndTime = 0; } function AIPatrolTask::retire(%task, %client) { } function AIPatrolTask::weight(%task, %client) { %task.setWeight($AIWeightPatrolling); } function AIPatrolTask::monitor(%task, %client) { //this call works in conjunction with AIEngageTask %client.setEngageTarget(%client.shouldEngage); //see if we're close enough to our patrol point if (%task.idleing) { if (getSimTime() > %task.idleEndTime) { %task.findLocation = true; %task.idleing = false; } } //see if we need to find a place to go... else if (%task.findLocation) { //first, see if we're in need of either health, or ammo //note: normally, I'd be tempted to put this kind of "looking for health" code //into the AIPickupItemTask, however, that task will be used in CTF, where you //don't want people on AIDefendLocation to leave their post to hunt for health, etc... //AIPickupItemTask only deals with items within a 30m radius around the bot. //AIPatrolTask will move the bot to the vicinity of an item, then AIPickUpItemTask //will finish the job... %foundItemLocation = false; %damage = %client.player.getDamagePercent(); if (%damage > 0.7) { //search for a health kit %closestHealth = AIFindSafeItem(%client, "Health"); if (%closestHealth > 0) { %task.patrolLocation = %closestHealth.getWorldBoxCenter(); %foundItemLocation = true; } } else if (AIEngageOutOfAmmo(%client)) { //search for a Ammo or a weapon... %closestItem = AIFindSafeItem(%client, "Ammo"); if (%closestItem > 0) { %task.patrolLocation = %closestItem.getWorldBoxCenter(); %foundItemLocation = true; } } //now see if we don't really have good equipment... if (!%foundItemLocation && AIEngageWeaponRating(%client) < 20) { //search for any useful item %closestItem = AIFindSafeItem(%client, "Any"); if (%closestItem > 0) { %task.patrolLocation = %closestItem.getWorldBoxCenter(); %foundItemLocation = true; } } //choose a randomish location only if we're not in need of health or ammo if (!%foundItemLocation) { //find a random item/inventory in the map, and pick a spawn point near it... %pickGraphNode = false; %chooseSet = 0; if ($AIInvStationSet.getCount() > 0) %chooseSet = $AIInvStationSet; else if ($AIWeaponSet.getCount() > 0) %chooseSet = $AIWeaponSet; else if ($AIItemSet.getCount() > 0) %chooseSet = $AIItemSet; if (!%chooseSet) %pickGraphNode = true; //here we pick whether we choose a random map point, or a point based on an item... if (getRandom() < 0.3) %pickGraphNode = true; //here we decide whether we should choose a player location... a bit of a cheat but //it's scaled by the bot skill level %pickPlayerLocation = false; %skill = %client.getSkillLevel(); if (%skill < 1.0) %skill = %skill / 2.0; if (getRandom() < (%skill * %skill) && ClientGroup.getCount() > 1) { //find a random client %count = ClientGroup.getCount(); %index = (getRandom() * (%count - 0.1)); %cl = ClientGroup.getObject(%index); if (%cl != %client && AIClientIsAlive(%cl)) { %task.patrolLocation = %cl.player.getWorldBoxCenter(); %pickGraphNode = false; %pickPlayerLocation = true; } } if (!%pickGraphNode && !%pickPlayerLocation) { %itemCount = %chooseSet.getCount(); %item = %chooseSet.getObject(getRandom() * (%itemCount - 0.1)); %nodeIndex = navGraph.randNode(%item.getWorldBoxCenter(), 10, true, true); if (%nodeIndex <= 0) %pickGraphNode = true; else %task.patrolLocation = navGraph.randNodeLoc(%nodeIndex); } //see if we failed above or have to pick just a random spot on the graph - use the spawn points... if (%pickGraphNode) { %task.patrolLocation = Game.pickPlayerSpawn(%client, true); if (%task.patrolLocation == -1) { %client.stepIdle(%client.player.getWorldBoxCenter()); return; } } } //now that we have a new location - move towards it %task.findLocation = false; %client.stepMove(%task.patrolLocation, 8.0); } //else we're on patrol - see if we're close to our destination else { %client.stepMove(%task.patrolLocation, 8.0); %distToDest = %client.getPathDistance(%task.patrolLocation); if (%distToDest > 0 && %distToDest < 10) { %task.idleing = true; %task.idleEndTime = 4000 + getSimTime() + (getRandom() * 6000); %client.stepIdle(%client.player.getWorldBoxCenter()); } } } //----------------------------------------------------------------------------- //AIEngageTurretTask is responsible for returning turret fire... function AIEngageTurretTask::init(%task, %client) { } function AIEngageTurretTask::assume(%task, %client) { %task.setWeightFreq(4); %task.setMonitorFreq(4); } function AIEngageTurretTask::retire(%task, %client) { %client.engageTurret = -1; %client.setEngagetarget(-1); } function AIEngageTurretTask::weight(%task, %client) { //see if we're still fighting a turret %elapsedTime = getSimTime() - %task.startAttackTime; if (isObject(%task.engageTurret) && %task.engageTurret.getDataBlock().getClassName() $= "TurretData") { if (%task.engageTurret == %client.lastdamageTurret) { if (%task.engageTurret.isEnabled() && getSimTime() - %client.lastDamageTurretTime < 5000) %task.setWeight($AIWeightReturnTurretFire); else %task.setWeight($AIWeightDestroyTurret); } else if (AIClientIsAlive(%client, %elapsedTime)) { //if another turret is shooting us, disable this one first... if (isObject(%client.lastDamageTurret) && %client.lastDamageTurret.getDataBlock().getClassName() $= "TurretData") { if (%task.engageTurret.isEnabled()) %task.setWeight($AIWeightReturnTurretFire); else { //see if we need to switch to the new turret if (%client.lastDamageTurret.isEnabled() && %client.lastDamageTurretTime < 5000) { %task.engageTurret = %client.lastDamageTurret; %task.attackInitted = false; %task.setWeight($AIWeightDestroyTurret); } else %task.setWeight($AIWeightReturnTurretFire); } } else { if (%task.engageTurret.isEnabled() && getSimTime() - %client.lastDamageTurretTime < 5000) %task.setWeight($AIWeightReturnTurretFire); else %task.setWeight($AIWeightDestroyTurret); } } //else we died since - clear out the vars else { %task.engageTurret = -1; %task.setWeight(0); } } //else see if we have a new target else if (isObject(%client.lastDamageTurret) && %client.lastDamageTurret.getDataBlock().getClassName() $= "TurretData") { %task.engageTurret = %client.lastDamageTurret; %task.attackInitted = false; if (%client.lastDamageTurret.isEnabled() && %client.lastDamageTurretTime < 5000) %task.setWeight($AIWeightReturnTurretFire); else %task.setWeight($AIWeightDestroyTurret); } //else no turret to attack... (later, do a query to find turrets before they attack) else { %task.engageTurret = -1; %task.setWeight(0); } } function AIEngageTurretTask::monitor(%task, %client) { if (isObject(%task.engageTurret) && %task.engageTurret.getDataBlock().getClassName() $= "TurretData") { //set the AI to fire at the turret %client.setEngageTarget(-1); %client.setTargetObject(%task.engageTurret); %clientPos = %client.player.getWorldBoxCenter(); %turretPos = %task.engageTurret.getWorldBoxCenter(); //control the movement - first, hide, then wait, then attack if (!%task.attackInitted) { %task.attackInitted = true; %task.startAttackTime = getSimTime(); %task.hideLocation = %client.getHideLocation(%turretPos, 40.0, %clientPos, 4.0); %client.stepMove(%task.hideLocation, 2.0); } else if (getSimTime() - %task.startAttackTime > 5000) { %client.stepMove(%task.engageTurret.getWorldBoxCenter(), 8.0); } } } //----------------------------------------------------------------------------- //AIAvoidMineTask is responsible for detecting/destroying enemy mines... function AIDetectMineTask::init(%task, %client) { } function AIDetectMineTask::assume(%task, %client) { %task.setWeightFreq(7); %task.setMonitorFreq(7); } function AIDetectMineTask::retire(%task, %client) { %task.engageMine = -1; %task.attackInitted = false; %client.setTargetObject(-1); } function AIDetectMineTask::weight(%task, %client) { //crappy hack, but they need the proper weapon before they can destroy a mine... %player = %client.player; if (!isObject(%player)) return; %hasPlasma = (%player.getInventory("Plasma") > 0) && (%player.getInventory("PlasmaAmmo") > 0); %hasDisc = (%player.getInventory("Disc") > 0) && (%player.getInventory("DiscAmmo") > 0); if (!%hasPlasma && !%hasDisc) { %task.setWeight(0); return; } //if we're already attacking a mine, if (%task.engageMine > 0 && isObject(%task.engageMine)) { %task.setWeight($AIWeightDetectMine); return; } //see if we're within the viscinity of a new (enemy) mine %task.engageMine = -1; %closestMine = -1; %closestDist = 15; //initialize so only mines within 15 m will be detected... %mineCount = $AIDeployedMineSet.getCount(); for (%i = 0; %i < %mineCount; %i++) { %mine = $AIDeployedMineSet.getObject(%i); %mineTeam = %mine.sourceObject.team; %minePos = %mine.getWorldBoxCenter(); %clPos = %client.player.getWorldBoxCenter(); //see if the mine is the closest... %mineDist = VectorDist(%minePos, %clPos); if (%mineDist < %closestDist) { //now see if we're more or less heading towards the mine... %clVelocity = %client.player.getVelocity(); %clVelocity = getWord(%clVelocity, 0) SPC getWord(%clVelocity, 1) SPC "0"; %mineVector = VectorSub(%minePos, %clPos); %mineVector = getWord(%mineVector, 0) SPC getWord(%mineVector, 1) SPC "0"; if (VectorLen(%clVelocity) > 2.0 && VectorLen(%mineVector > 2.0)) { %clNormal = VectorNormalize(%clVelocity); %mineNormal = VectorNormalize(%mineVector); if (VectorDot(%clNormal, %mineNormal) > 0.3) { %closestMine = %mine; %closestDist = %mineDist; } } } } //see if we found a mine to attack if (%closestMine > 0) { %task.engageMine = %closestMine; %task.attackInitted = false; %task.setWeight($AIWeightDetectMine); } else %task.setWeight(0); } function AIDetectMineTask::monitor(%task, %client) { if (%task.engageMine > 0 && isObject(%task.engageMine)) { if (!%task.attackInitted) { %task.attackInitted = true; %client.stepRangeObject(%task.engageMine, "DefaultRepairBeam", 6, 12); %client.setEngageTarget(-1); %client.setTargetObject(-1); } else if (%client.getStepStatus() $= "Finished") { %client.stop(); %client.setTargetObject(%task.engageMine); } } } //----------------------------------------------------------------------------- PK !(scripts/aiDnD.cs//----------------------------------------------- // AI functions for Capture and Hold function aidnd() { exec("scripts/aiDnD.cs"); } function DnDGame::AIInit(%game) { for (%i = 1; %i <= %game.numTeams; %i++) { if (!isObject($ObjectiveQ[%i])) { $ObjectiveQ[%i] = new AIObjectiveQ(); MissionCleanup.add($ObjectiveQ[%i]); } error("team " @ %i @ " objectives load..."); $ObjectiveQ[%i].clear(); AIInitObjectives(%i, %game); } //call the default AIInit() function AIInit(); } function DnDGame::onAIRespawn(%game, %client) { //add the default tasks if (! %client.defaultTasksAdded) { %client.defaultTasksAdded = true; %client.addTask(AIEngageTask); %client.addTask(AIPickupItemTask); %client.addTask(AITauntCorpseTask); %client.addTask(AIPatrolTask); %client.addtask(AIEngageTurretTask); %client.addtask(AIDetectMineTask); } } function DnDGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clAttacker && %clAttacker != %clVictim && %clAttacker.team == %clVictim.team) { schedule(250, %clVictim, "AIPlayAnimSound", %clVictim, %clAttacker.player.getWorldBoxCenter(), "wrn.watchit", -1, -1, 0); //clear the "lastDamageClient" tag so we don't turn on teammates... unless it's uberbob! %clVictim.lastDamageClient = -1; } } function DnDGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clVictim.team != %clAttacker.team) DefaultGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement); } function DnDGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement) { DefaultGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implement); } function DnDGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim) AIMessageThread("Sorry", %clAttacker, %clVictim); } function DnDGame::AIplayerCaptureFlipFlop(%game, %player, %flipFlop) { } PK !(_xӍ##scripts/aiHumanTasks.cs function aiAddHumanObjective(%client, %objective, %targetClient, %fromCmdMap) { //first, make sure the objective Q for the given team exists if (!isObject($ObjectiveQ[%client.team])) return 0; //if a target client is specified, create a link if we can... if (%targetClient > 0) { if (aiHumanHasControl(%client, %targetClient) || (%targetClient.isAIControlled() && !aiAlreadyControlled(%targetClient))) aiSetHumanControl(%client, %targetClient); else return 0; } //special (hacky) case here for AIOBombLocation objectives if (%objective.getName() $= "AIOBombLocation") { if (!isObject($AIBombLocationSet)) return 0; %objective.team = %client.team; $AIBombLocationSet.add(%objective); return %objective; } //parse the type of objective, and see if it already exists... %useThisObjective = -1; %objQ = $ObjectiveQ[%client.team]; if (%objective.getName() $= "AIOEscortPlayer" || %objective.getName() $= "AIOAttackPlayer") { //first, make sure the objective is legit if (!AIClientIsAlive(%objective.targetClientId)) return 0; //fill in the description: %objective.description = %objective.getName() SPC getTaggedString(%objective.targetClientId.name); //now see if the objective already exists... %count = %objQ.getCount(); for (%i = 0; %i < %count; %i++) { %obj = %objQ.getObject(%i); if (%obj.getName() $= %objective.getName()) { //if we've found a previously existing version, use it instead of the new objective if (%obj.issuedByClientId == %client && %obj.targetClientId == %objective.targetClientId) { %useThisObjective = %obj; break; } } } } else if (%objective.getName() $= "AIODefendLocation" || %objective.getName() $= "AIOAttackLocation") { //make sure it's a valid objective if (%objective.location $= "" || %objective.location $= "0 0 0") return 0; //fill in the description: %objective.description = %objective.getName() @ " at" SPC %objective.location; //look for a duplicate... %count = %objQ.getCount(); for (%i = 0; %i < %count; %i++) { %obj = %objQ.getObject(%i); if (%obj.getName() $= %objective.getName()) { if (%obj.issuedByClientId == %client && VectorDist(%objective.location, %obj.location) < 30) { %useThisObjective = %obj; break; } } } } else if (%objective.getName() $= "AIOAttackObject" || %objective.getName() $= "AIORepairObject" || %objective.getName() $= "AIOLazeObject" || %objective.getName() $= "AIOMortarObject" || %objective.getName() $= "AIOTouchObject") { //make sure it's a valid objective if (!isObject(%objective.targetObjectId)) return 0; //fill in the description: %objective.description = %objective.getName() SPC %objective.targetObjectId.getDataBlock().getName(); //look for a duplicate... %count = %objQ.getCount(); for (%i = 0; %i < %count; %i++) { %obj = %objQ.getObject(%i); if (%obj.getName() $= %objective.getName()) { if (%obj.issuedByClientId == %client && %objective.targetObjectId == %obj.targetObjectId) { %useThisObjective = %obj; break; } } } } else if (%objective.getName() $= "AIODeployEquipment") { //make sure it's a valid objective if (%objective.location $= "" || %objective.location $= "0 0 0" || %objective.equipment $= "") return 0; //fill in the description: %objective.description = %objective.getName() SPC %objective.equipment SPC "at" SPC %objective.location; //look for a duplicate... %count = %objQ.getCount(); for (%i = 0; %i < %count; %i++) { %obj = %objQ.getObject(%i); if (%obj.getName() $= %objective.getName()) { if (%obj.issuedByClientId == %client && VectorDist(%objective.location, %obj.location) < 8 && %objective.equipment == %obj.equipment) { %useThisObjective = %obj; break; } } } } //if we found a previously added objective, delete the submitted one if (%useThisObjective > 0) { %objective.delete(); } //otherwise add it to the objective Q else { %useThisObjective = %objective; $ObjectiveQ[%client.team].add(%useThisObjective); %objective.shouldAcknowledge = true; //now that it's been added, see if anyone picks it up within 10 seconds schedule(10000, %objective, "AIReassessHumanObjective", %objective); } //now see if we're supposed to force the target to the objective //the link will have already been checked at the top... if (%targetClient > 0) { //if we were previously assigned to an objective which was forced on this client, we need to delete it... %prevObjective = %targetClient.objective; if (%prevObjective != %useThisObjective && %prevObjective.issuedByClientId == %targetClient.controlByHuman) { AIClearObjective(%prevObjective); %prevObjective.delete(); } //if the command is an escort command, issue it at the forced escort weight instead %forcedWeight = $AIWeightHumanIssuedCommand; if (%useThisObjective.getName() $= "AIOEscortPlayer") %forcedWeight = $AIWeightHumanIssuedEscort; //reweight the client's objective %testWeight = 0; if (isObject(%client.objective)) %testWeight = %client.objective.weight(%client, %client.objectiveLevel, 0, %inventoryStr); if (%testWeight <= 0 || %testWeight > %client.objectiveWeight) %client.objectiveWeight = %testWeight; //see if we should force the objective if (%targetClient.objectiveWeight <= %forcedWeight) { AIForceObjective(%targetClient, %useThisObjective, %forcedWeight); //clearing the prev objective will undo the link - re-do it here aiSetHumanControl(%client, %targetClient); //send the "command accepted response" if (!%fromCmdMap) { if (isObject(%client.player) && VectorDist(%targetClient.player.position, %client.player.position) <= 40) schedule(250, %targetClient.player, "AIPlayAnimSound", %targetClient, %client.player.getWorldBoxCenter(), "cmd.acknowledge", 1, 1, 0); } else serverCmdAcceptTask(%targetClient, %client, -1, %useThisObjective.ackDescription); } else { //send the "command declined response" if (!%fromCmdMap) { if (isObject(%client.player) && VectorDist(%targetClient.player.position, %client.player.position) <= 40) { schedule(250, %targetClient.player, "AIPlayAnimSound", %targetClient, %client.player.getWorldBoxCenter(), "cmd.decline", -1, -1, 0); schedule(2000, %client.player, "AIRespondToEvent", %client, 'ChatCmdWhat', %targetClient); } } else serverCmdDeclineTask(%targetClient, %client, %useThisObjective.ackDescription); } } //return the objective used, so the calling function can know whether to delete the parameter one... return %useThisObjective; } function AIReassessHumanObjective(%objective) { if (%objective.issuedByHuman) { //see if there's anyone still assigned to this objective if (!AIClientIsAlive(%objective.clientLevel1) && !AIClientIsAlive(%objective.clientLevel2) && !AIClientIsAlive(%objective.clientLevel3)) { AIClearObjective(%objective); %objective.delete(); } //else reassess this objective in another 10 seconds else schedule(10000, %objective, "AIReassessHumanObjective", %objective); } } function aiAttemptHumanControl(%humanClient, %aiClient) { if (!aiAlreadyControlled(%aiClient)) { aiSetHumanControl(%humanClient, %aiClient); return true; } else return false; } function aiHumanHasControl(%humanClient, %aiClient) { if (AIClientIsAlive(%humanClient) && AIClientIsAlive(%aiClient)) if (%humanClient.controlAI == %aiClient && %aiClient.controlByHuman == %humanClient) return true; return false; } function aiAlreadyControlled(%aiClient) { if (AIClientIsAlive(%aiClient) && AIClientIsAlive(%aiClient.controlByHuman)) if (%aiClient.controlByHuman.controlAI == %aiClient) return true; return false; } function aiReleaseHumanControl(%humanClient, %aiClient) { //make sure they were actually linked if (!aiHumanHasControl(%humanClient, %aiClient)) return; aiBreakHumanControl(%humanClient, %aiClient); } function aiSetHumanControl(%humanClient, %aiClient) { //make sure it's from a human to an ai if (%humanClient.isAIControlled() || !%aiClient.isAIControlled()) return; //these checks should be redundant, but... if (%humanClient.controlAI > 0) aiBreakHumanControl(%humanClient, %humanClient.controlAI); if (%aiClient.controlByHuman > 0) aiBreakHumanControl(%aiClient.controlByHuman, %aiClient); //create the link %humanClient.controlAI = %aiClient; %aiClient.controlByHuman = %humanClient; } function aiBreakHumanControl(%humanClient, %aiClient) { //make sure they were actually linked if (!aiHumanHasControl(%humanClient, %aiClient)) return; //for now, just break the link, and worry about unassigning objectives later... %humanClient.controlAI = ""; %aiClient.controlByHuman = ""; }PK !(==scripts/aiHunters.cs//----------------------------------------------- // AI functions for Hunters //--------------------------------------------------------------------------- // globals $AIHuntersFlagSearchRadius = 300; $AIHuntersCloseFlagDist = 40; $AIHuntersAttackClientFlagCount = 10; $AIHuntersMinFlagsToCap = 3; //--------------------------------------------------------------------------- function HuntersGame::onAIRespawn(%game, %client) { //add the default task if (! %client.defaultTasksAdded) { %client.defaultTasksAdded = true; %client.addTask(AIEngageTask); %client.addTask(AIPickupItemTask); %client.addTask(AIUseInventoryTask); %client.addTask(AITauntCorpseTask); %client.addTask(AIEngageTurretTask); %client.addtask(AIDetectMineTask); %client.addTask(AIPatrolTask); %client.huntersTask = %client.addTask(AIHuntersTask); } //set the inv flag %client.spawnUseInv = true; } //--------------------------------------------------------------------------- function HuntersGame::AIInit(%game) { //call the default AIInit() function AIInit(); } //--------------------------------------------------------------------------- //AIHuntersTask functions //--------------------------------------------------------------------------- function AIHuntersTask::init(%task, %client) { } //--------------------------------------------------------------------------- function AIHuntersTask::assume(%task, %client) { %task.setWeightFreq(10); %task.setMonitorFreq(10); %task.pickupFlag = -1; %task.engageTarget = -1; %task.getHealth = -1; %task.capFlags = false; } function AIHuntersTask::retire(%task, %client) { %task.pickupFlag = -1; %task.engageTarget = -1; %task.getHealth = -1; %task.capFlags = false; } //--------------------------------------------------------------------------- function AIHuntersTask::weight(%task, %client) { // init flag search vars %player = %client.player; if (!isObject(%player)) return; %clientPos = %player.getWorldBoxCenter(); %task.pickupFlag = -1; %task.engageTarget = -1; %task.capFlags = false; //find the closest flag %flagVars = AIFindClosestFlag(%client, $AIHuntersFlagSearchRadius); %closestFlag = getWord(%flagVars, 0); %closestFlagDist = getWord(%flagVars, 1); //find the dist to the nexus %nexusPos = Game.Nexus.getId().getWorldBoxCenter(); %nexusDist = %client.getPathDistance(%nexusPos); if (%nexusDist < 0) %nexusDist = 32767; //validate the health item if (isObject(%task.getHealth)) { if (%task.getHealth.isHidden()) %task.getHealth = -1; else if ((%task.getHealth.getDataBlock().getName() $= "DeployedStationInventory") || (%task.getHealth.getDataBlock().getName() $= "StationInventory")) { if (%task.getHealth.isDisabled() && !%task.getHealth.isPowered()) %task.getHealth = -1; } } //find the dist to the closest health %healthDist = 32767; %damage = %client.player.getDamagePercent(); if (%client.flagCount < 5) %damageTolerance = 0.7; else %damageTolerance = 0.25 + ((%client.getSkillLevel() * %client.getSkillLevel()) * 0.35); if (%damage > %damageTolerance) { if (!isObject(%task.getHealth)) { //search for a health kit %closestHealth = AIFindSafeItem(%client, "Health"); if (isObject(%closestHealth)) { %healthDist = %client.getPathDistance(%closestHealth.getWorldBoxCenter()); if (%healthDist < 0) %healthDist = 32767; else %healthItem = %closestHealth; } //else search for an inventory station else { %result = AIFindClosestInventory(%client, false); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (isObject(%closestInv)) { %healthDist = %closestDist; %healthItem = %closestInv; } } } else { %healthDist = %client.getPathDistance(%task.getHealth.getWorldBoxCenter()); if (%healthDist < 0) { %healthDist = 32767; %task.getHealth = -1; } } } else %task.getHealth = -1; //see if we need to cap - make sure we're actually able first %mustCap = false; %shouldCap = false; %numToScore = %client.flagCount - 1; %hoardModeOn = Game.hoardModeActive(); if ((!Game.greedMode || %numToScore >= Game.greedMinFlags) && !Game.hoardModeActive() && %numToScore >= $AIHuntersMinFlagsToCap) { //find out how many points would be scored %potentialScore = (%numToScore * (%numToScore + 1)) / 2; //find out how many flags we need to take the lead... %needFlagsForLead = 0; %highestScore = 0; %clientIsInLead = false; if (Game.teamMode) { %teamCount = Game.numTeams; for (%i = 1; %i <= %teamCount; %i++) { if ($teamScore[%i] > %highestScore) %highestScore = $teamScore[%i]; } //see if we're in the lead... if (%highestScore == $teamScore[%client.team]) %clientIsInLead = true; else { %tempScore = $teamScore[%client.team] + %potentialScore; %flagValue = %numToScore + 1; while (%tempScore < %highestScore) { %tempScore += %flagValue; %flagValue++; %needFlagsForLead++; } } } else { %clientCount = ClientGroup.getCount(); for (%i = 0; %i < %clientCount; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.score > %highestScore) %highestScore = %cl.score; } //see if we're in the lead if (%highestScore == %client.score) %clientIsInLead = true; else { %tempScore = %client.score + %potentialScore; %flagValue = %numToScore + 1; while (%tempScore < %highestScore) { %tempScore += %flagValue; %flagValue++; %needFlagsForLead++; } } } //the current target is more dangerous than the closest enemy %currentTarget = %client.getEngageTarget(); if (AIClientIsAlive(%currentTarget)) { %closestEnemy = %currentTarget; %closestEnemydist = %client.getPathDistance(%currentTarget.player.position); if (%closestEnemyDist < 0) %closestEnemyDist = 32767; } else { %losTimeout = $AIClientMinLOSTime + ($AIClientLOSTimeout * %client.getSkillLevel()); %result = AIFindClosestEnemy(%client, $AIHuntersCloseFlagDist, %losTimeout); %closestEnemy = getWord(%result, 0); %closestEnemydist = getWord(%result, 1); } //find out how much time is left... %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); //If there's a tough or equal enemy nearby, or no flags, think about capping //ie. never cap if there are flags nearby and no enemies... if ((AICheckEnemyDanger(%client, 35) >= 3 && %damage > %damageTolerance) || (!isObject(%closestFlag) || %closestFlagDist > $AIHuntersCloseFlagDist)) { //if we've got enough to take the lead, and there are no flags in the vicinity if ((!%clientIsInLead && %needFlagsForLead == 0) || %highestScore == 0) %mustCap = true; //else if we're about to get our butt kicked... else if (AIClientIsAlive(%closestEnemy) && AIEngageWhoWillWin(%closestEnemy, %client) == %closestEnemy) { %mustCap = true; } //else if there's no time left in the mission, cap whatever we've got now... else if (%curTimeLeftMS <= 30000) %mustCap = true; //else we don't need to cap - see if we should to play it smart else { //if we'd need more than just a couple to take the lead... %waitForFlagsTolerance = %client.getSkillLevel() * $AIHuntersMinFlagsToCap * 2; if (%needFlagsForLead == 0 || (%needFlagsForLead > %waitForFlagsTolerance)) { %numEnemyFlags = 0; %clientCount = ClientGroup.getCount(); for (%i = 0; %i < %clientCount; %i++) { %cl = ClientGroup.getObject(%i); if (%cl != %client && %cl.flagCount > %numEnemyFlags) %numEnemyFlags = %cl.flagCount; } //if we're in the lead, or no one has the flags we need, or it's team mode, //decide whether to cap based on skill level if (%needFlagsForLead == 0 || %numEnemyFlags < %needFlagsForLead || Game.teamMode) { if (%numToScore >= $AIHuntersMinFlagsToCap + (%client.getSkillLevel() * %client.getSkillLevel() * 15)) { %shouldCap = true; } } } } } //now that we've checked all the possibilities, see if we should or must cap if (%mustCap || %shouldCap) { if (%mustCap) %task.setWeight($AIHuntersWeightMustCap); else %task.setWeight($AIHuntersWeightShouldCap); %task.capFlags = true; return; } } //////////////////////////////////////////////////////////////////////////////////// // if we've made it this far, we either can't cap, or there's no need to cap... // //////////////////////////////////////////////////////////////////////////////////// //see if we need health if (%damage > %damageTolerance && (isObject(%healthItem) || isObject(%task.getHealth))) { if (!isObject(%task.getHealth)) %task.getHealth = %healthItem; %task.setWeight($AIHuntersWeightNeedHealth); return; } //find the closest player with the most flags (that we have los to) %losTimeout = $AIClientMinLOSTime + ($AIClientLOSTimeout * %client.getSkillLevel()); %bestClientToEngage = findClientWithMostFlags(%client, %losTimeout); %bestClientDist = 32767; if (AIClientIsAlive(%bestClientToEngage)) { %bestClientDist = %client.getPathDistance(%bestClientToEngage.player.position); if (%bestClientDist < 0) %bestClientDist = 32767; } //see if there's a flag if (isObject(%closestFlag)) { //see if there's a client to shoot if (AIClientIsAlive(%bestClientToEngage)) { //calc weight base on closesness to the nearest flag vs. and number of flags the client has... %engageDistFactor = 30 + %bestClientDist - (%bestClientToEngage.flagCount * 5); if (%closestFlagDist < %engageDistFactor) { %task.pickupFlag = %closestFlag; %task.engageTarget = %bestClientToEngage; %task.setWeight($AIHuntersWeightPickupFlag); } //otherwise, ignore the flag, and go for the client else { %task.pickupFlag = -1; %task.engageTarget = %bestClientToEngage; %task.setWeight($AIHuntersWeightMustEngage); } } //else no one to attack else { %task.pickupFlag = %closestFlag; %task.engageTarget = -1; %task.setWeight($AIHuntersWeightPickupFlag); } } //else no flag, see if we have someone to attack else if (AIClientIsAlive(%bestClientToEngage)) { %task.pickupFlag = -1; %task.engageTarget = %bestClientToEngage; %task.setWeight($AIHuntersWeightShouldEngage); } //nothing hunter's related to do... else { %task.pickupFlag = -1; %task.engageTarget = -1; %task.setWeight(0); } } //--------------------------------------------------------------------------- function AIHuntersTask::monitor(%task, %client) { //see if we should cap if (%task.capFlags) { %nexusPos = Game.Nexus.getId().getWorldBoxCenter(); %client.stepMove(%nexusPos, 0.25); } //see if we've got a flag to pick up and/or someone to engage else if (isObject(%task.pickupFlag)) { %client.stepMove(%task.pickupFlag.getWorldBoxCenter(), 0.25); if (AIClientIsAlive(%task.engageTarget)) %client.setEngageTarget(%task.engageTarget); } //see if we've should go for health... else if (isObject(%task.getHealth)) { %client.stepMove(%task.getHealth.getWorldBoxCenter(), 1); if (AIClientIsAlive(%task.engageTarget)) %client.setEngageTarget(%task.engageTarget); } //else see if there's just someone to engage else if (AIClientIsAlive(%task.engageTarget)) %client.stepEngage(%task.engageTarget); //if we're not engaging someone related to the hunters task, engage whoever the AIEngageTask wants... else %client.setEngageTarget(%client.shouldEngage); } //--------------------------------------------------------------------------- // AIHunters utility functions //--------------------------------------------------------------------------- //this function checks to make sure a bot isn't in a mosh pit of enemies //notice it cheats by not using LOS... ) function AICheckEnemyDanger(%client, %radius) { %numEnemies = 0; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (AIClientIsAlive(%cl) && %cl.team != %client.team) { %dist = %client.getPathDistance(%cl.player.position); if (%dist < %radius) { %winner = AIEngageWhoWillWin(%cl, %client); if (%winner == %cl) %numEnemies += 3; else if (%winner != %client) %numEnemies++; } } } return %numEnemies; } function AIFindClosestFlag(%client, %radius) { %closestFlag = -1; %closestDist = %radius; %flagCount = $FlagGroup.getCount(); for (%i = 0; %i < %flagCount; %i++) { %flag = $FlagGroup.getObject(%i); %flagPos = %flag.getWorldBoxCenter(); %dist = %client.getPathDistance(%flagPos); if (%dist > 0 && %dist < %closestDist) { %closestDist = %dist; %closestFlag = %flag; } } return %closestFlag @ " " @ %closestDist; } //--------------------------------------------------------------------------- function findClientWithMostFlags(%srcClient, %losTimeout) { %clientCount = 0; %closestClient = -1; %highestFlagFactor = -1; //take both distance and flag count into consideration %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); //make sure we find someone who's alive, and on an opposing team if (AIClientIsAlive(%cl) && %cl.team != %srcClient.team) { %clIsCloaked = false; if (%cl.player.getInventory("CloakingPack") > 0 && %cl.player.getImageState($BackpackSlot) $= "activate") %clIsCloaked = true; //make sure the client can see the enemy %hasLOS = %srcClient.hasLOSToClient(%cl); %losTime = %srcClient.getClientLOSTime(%cl); if (%hasLOS || (%losTime < %losTimeout && AIClientIsAlive(%cl, %losTime + 1000))) { %testPos = %cl.player.getWorldBoxCenter(); %distance = %srcClient.getPathDistance(%testPos); if (%distance < 0) %distance = 32767; //calculate the flag factor %flagFactor = (100 - %distance) + (%cl.flagCount * 5); //see if it's the most suitable client... if (%flagFactor > %highestFlagFactor && (!%clIsCloaked || %distance < 8)) { %closestClient = %cl; %highestFlagFactor = %flagFactor; } } } } return %closestClient; } //--------------------------------------------------------------------------- function aih() { exec("scripts/aiHunters.cs"); } function aiHlist() { %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.isAIControlled()) error(%cl SPC getTaggedString(%cl.name) SPC "score:" SPC %cl.score SPC "flags:" SPC %cl.flagCount - 1 SPC "capFlags:" SPC %cl.huntersTask.capFlags); } } PK !(sscripts/aiInventory.cs//------------------------------ //AI Inventory functions function AINeedEquipment(%equipmentList, %client) { %index = 0; %item = getWord(%equipmentList, %index); //first, see if we're testing the armor class as well... if (%item $= "Heavy" || %item $= "Medium" || %item $= "Light") { if (%client.player.getArmorSize() !$= %item) return true; %index++; %item = getWord(%equipmentList, %index); } while (%item !$= "") { if (%client.player.getInventory(%item) == 0) return true; //get the next item %index++; %item = getWord(%equipmentList, %index); } //made it through the list without needing anything return false; } function AIBuyInventory(%client, %requiredEquipment, %equipmentSets, %buyInvTime) { //make sure we have a live player %player = %client.player; if (!isObject(%player)) return "Failed"; if (! AIClientIsAlive(%client)) return "Failed"; //see if we've already initialized our state machine if (%client.buyInvTime == %buyInvTime) return AIProcessBuyInventory(%client); //if the closest inv station is not a remote, buy the first available set... %result = AIFindClosestInventory(%client, false); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (%closestInv <= 0) return "Failed"; //see if the closest inv station was a remote %buyingSet = false; %usingRemote = false; if (%closestInv.getDataBlock().getName() $= "DeployedStationInventory") { //see if we can buy at least the required equipment from the set if (%requiredEquipment !$= "") { if (! AIMustUseRegularInvStation(%requiredEquipment, %client)) %canUseRemote = true; else %canUseRemote = false; } else { %inventorySet = AIFindSameArmorEquipSet(%equipmentSets, %client); if (%inventorySet !$= "") %canUseRemote = true; else %canUseRemote = false; } //if we can't use a remote, we need to look for a regular inv station if (! %canUseRemote) { %result = AIFindClosestInventory(%client, true); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (%closestInv <= 0) return "Failed"; } else %usingRemote = true; } //at this point we've found the closest inv, see which set/list we need to buy if (!%usingRemote) { //choose the equipment first equipment set if (%equipmentSets !$= "") { %inventorySet = getWord(%equipmentSets, 0); %buyingSet = true; } else { %inventorySet = %requiredEquipment; %buyingSet = false; } } else { %inventorySet = AIFindSameArmorEquipSet(%equipmentSets, %client); if (%inventorySet $= "") { %inventorySet = %requiredEquipment; %buyingSet = false; } else %buyingSet = true; } //init some vars for the state machine... %client.buyInvTime = %buyInvTime; //used to mark the begining of the inv buy session %client.invToUse = %closestInv; //used if we need to go to an alternate inv station %client.invWaitTime = ""; //used to track how long we've been waiting %client.invBuyList = %inventorySet; //the list/set of items we're going to buy... %client.buyingSet = %buyingSet; //whether it's a list or a set... %client.isSeekingInv = false; %client.seekingInv = ""; //now process the state machine return AIProcessBuyInventory(%client); } function AIProcessBuyInventory(%client) { //get some vars %player = %client.player; if (!isObject(%player)) return "Failed"; %closestInv = %client.invToUse; %inventorySet = %client.invBuyList; %buyingSet = %client.buyingSet; //make sure it's still valid, enabled, and on our team if (! (%closestInv > 0 && isObject(%closestInv) && (%closestInv.team <= 0 || %closestInv.team == %client.team) && %closestInv.isEnabled())) { //reset the state machine %client.buyInvTime = 0; return "InProgress"; } //make sure the inventory station is not blocked %invLocation = %closestInv.getWorldBoxCenter(); InitContainerRadiusSearch(%invLocation, 2, $TypeMasks::PlayerObjectType); %objSrch = containerSearchNext(); if (%objSrch == %client.player) %objSrch = containerSearchNext(); //the closestInv is busy... if (%objSrch > 0) { //have the AI range the inv if (%client.seekingInv $= "" || %client.seekingInv != %closestInv) { %client.invWaitTime = ""; %client.seekingInv = %closestInv; %client.stepRangeObject(%closestInv, "DefaultRepairBeam", 5, 10); } //inv is still busy - see if we're within range else if (%client.getStepStatus() $= "Finished") { //initialize the wait time if (%client.invWaitTime $= "") %client.invWaitTime = getSimTime() + 5000 + (getRandom() * 10000); //else see if we've waited long enough else if (getSimTime() > %client.invWaitTime) { schedule(250, %client, "AIPlayAnimSound", %client, %objSrch.getWorldBoxCenter(), "vqk.move", -1, -1, 0); %client.invWaitTime = getSimTime() + 5000 + (getRandom() * 10000); } } else { //in case we got bumped, and are ranging the target again... %client.invWaitTime = ""; } } //else if we've triggered the inv, automatically give us the equipment... else if (isObject(%closestInv) && isObject(%closestInv.trigger) && VectorDist(%closestInv.trigger.getWorldBoxCenter(), %player.getWorldBoxCenter()) < 1.5) { //first stop... %client.stop(); %index = 0; if (%buyingSet) { //first, clear the players inventory %player.clearInventory(); %item = $AIEquipmentSet[%inventorySet, %index]; } else %item = getWord(%inventorySet, %index); //armor must always be bought first if (%item $= "Light" || %item $= "Medium" || %item $= "Heavy") { %player.setArmor(%item); %index++; } //set the data block after the armor had been upgraded %playerDataBlock = %player.getDataBlock(); //next, loop through the inventory set, and buy each item if (%buyingSet) %item = $AIEquipmentSet[%inventorySet, %index]; else %item = getWord(%inventorySet, %index); while (%item !$= "") { //set the inventory amount to the maximum quantity available if (%player.getInventory(AmmoPack) > 0) %ammoPackQuantity = AmmoPack.max[%item]; else %ammoPackQuantity = 0; %quantity = %player.getDataBlock().max[%item] + %ammoPackQuantity; if ($InvBanList[$CurrentMissionType, %item]) %quantity = 0; %player.setInventory(%item, %quantity); //get the next item %index++; if (%buyingSet) %item = $AIEquipmentSet[%inventorySet, %index]; else %item = getWord(%inventorySet, %index); } //put a weapon in the bot's hand... %player.cycleWeapon(); //return a success return "Finished"; } //else, keep moving towards the inv station else { if (isObject(%closestInv) && isObject(%closestInv.trigger)) { //quite possibly we may need to deal with what happens if a bot doesn't have a path to the inv... //the current premise is that no inventory stations are "unpathable"... //if (%client.isSeekingInv) //{ // %dist = %client.getPathDistance(%closestInv.trigger.getWorldBoxCenter()); // if (%dist < 0) // error("DEBUG Tinman - still need to handle bot stuck trying to get to an inv!"); //} %client.stepMove(%closestInv.trigger.getWorldBoxCenter(), 1.5); %client.isSeekingInv = true; } return "InProgress"; } } function AIFindSameArmorEquipSet(%equipmentSets, %client) { %clientArmor = %client.player.getArmorSize(); %index = 0; %set = getWord(%equipmentSets, %index); while (%set !$= "") { if ($AIEquipmentSet[%set, 0] $= %clientArmor) return %set; //get the next equipment set in the list of sets %index++; %set = getWord(%equipmentSets, %index); } return ""; } function AIMustUseRegularInvStation(%equipmentList, %client) { %clientArmor = %client.player.getArmorSize(); //first, see if the set contains an item not available %needRemoteInv = false; %index = 0; %item = getWord(%equipmentList, 0); while (%item !$= "") { if (%item $= "InventoryDeployable" || (%clientArmor !$= "Light" && %item $= "SniperRifle") || (%clientArmor $= "Light" && (%item $= "Mortar" || %item $= "MissileLauncher"))) { return true; } else { %index++; %item = getWord(%equipmentList, %index); } } if (%needRemoteInv) return true; //otherwise, see if the set begins with an armor class %needArmor = %equipmentList[0]; if (%needArmor !$= "Light" && %needArmor !$= "Medium" && %needArmor !$= "Heavy") return false; //also including looking for an inventory set if (%needArmor != %client.player.getArmorSize()) return true; //we must be fine... return false; } function AICouldUseItem(%client, %item) { if(!AIClientIsAlive(%client)) return false; %player = %client.player; if (!isObject(%player)) return false; %playerDataBlock = %client.player.getDataBlock(); %armor = %player.getArmorSize(); %type = %item.getDataBlock().getName(); //check packs first if (%type $= "RepairPack" || %type $= "EnergyPack" || %type $= "ShieldPack" || %type $= "CloakingPack" || %type $= "AmmoPack") { if (%client.player.getMountedImage($BackpackSlot) <= 0) return true; else return false; } //if the item is acutally, a corpse, check the corpse inventory... if (%item.isCorpse) { %corpse = %item; if (%corpse.getInventory("ChainGunAmmo") > 0 && %player.getInventory(%type) < %playerDataBlock.max[ChainGunAmmo]) return true; if (%corpse.getInventory("PlasmaAmmo") > 0 && %player.getInventory(%type) < %playerDataBlock.max[PlasmaAmmo]) return true; if (%corpse.getInventory("DiscAmmo") > 0 && %player.getInventory(%type) < %playerDataBlock.max[DiscAmmo]) return true; if (%corpse.getInventory("GrenadeLauncher") > 0 && %player.getInventory(%type) < %playerDataBlock.max[GrenadeLauncher]) return true; if (%corpse.getInventory("MortarAmmo") > 0 && %player.getInventory(%type) < %playerDataBlock.max[MortarAmmo] && %player.getInventory("Mortar") > 0) return true; } else { //check ammo %quantity = mFloor(%playerDataBlock.max[%type]); if (%player.getInventory(%type) < %quantity) { if (%type $= "ChainGunAmmo") return true; if (%type $= "PlasmaAmmo") return true; if (%type $= "DiscAmmo") return true; if (%type $= "GrenadeLauncher") return true; if (%type $= "MortarAmmo" && %player.getInventory("Mortar") > 0) return true; //check mines and grenades as well if (%type $= "Grenade" || %type $= "FlashGrenade" || %type $= "ConcussionGrenade") return true; } //see if we can carry another weapon... if (AICanPickupWeapon(%client, %type)) return true; } //guess we didn't find anything useful... (should still check for mines and grenades) return false; } function AIEngageOutofAmmo(%client) { //this function only cares about weapons used in engagement... //no mortars, or missiles %player = %client.player; if (!isObject(%player)) return false; %ammoWeapons = 0; %energyWeapons = 0; //get our inventory %hasBlaster = (%player.getInventory("Blaster") > 0); %hasPlasma = (%player.getInventory("Plasma") > 0); %hasChain = (%player.getInventory("Chaingun") > 0); %hasDisc = (%player.getInventory("Disc") > 0); %hasGrenade = (%player.getInventory("GrenadeLauncher") > 0); %hasSniper = (%player.getInventory("SniperRifle") > 0) && (%player.getInventory("EnergyPack") > 0); %hasELF = (%player.getInventory("ELFGun") > 0); %hasMortar = (%player.getInventory("Mortar") > 0); %hasMissile = (%player.getInventory("MissileLauncher") > 0); %hasLance = (%player.getInventory("ShockLance") > 0); if (%hasBlaster || %hasSniper || %hasElf || %hasLance) return false; else { // we only have ammo type weapons if(%hasDisc && (%player.getInventory("DiscAmmo") > 0)) return false; else if(%hasChain && (%player.getInventory("ChainGunAmmo") > 0)) return false; else if(%hasGrenade && (%player.getInventory("GrenadeLauncherAmmo") > 0)) return false; else if(%hasPlasma && (%player.getInventory("PlasmaAmmo") > 0)) return false; } return true; // were out! } function AICanPickupWeapon(%client, %weapon) { //first, make sure it's not a weapon we already have... %player = %client.player; if (!isObject(%player)) return false; %armor = %player.getArmorSize(); if (%player.getInventory(%weapon) > 0) return false; //make sure the %weapon given is a weapon they can use for engagement if (%weapon !$= "Blaster" && %weapon !$= "Plasma" && %weapon !$= "Chaingun" && %weapon !$= "Disc" && %weapon !$= "GrenadeLauncher" && %weapon !$= "SniperRifle" && %weapon !$= "ELFGun" && %weapon !$= "ShockLance") { return false; } %weaponCount = 0; if (%player.getInventory("Blaster") > 0) %weaponCount++; if (%player.getInventory("Plasma") > 0) %weaponCount++; if (%player.getInventory("Chaingun") > 0) %weaponCount++; if (%player.getInventory("Disc") > 0) %weaponCount++; if (%player.getInventory("GrenadeLauncher") > 0) %weaponCount++; if (%player.getInventory("SniperRifle") > 0) %weaponCount++; if (%player.getInventory("ELFGun") > 0) %weaponCount++; if (%player.getInventory("Mortar") > 0) %weaponCount++; if (%player.getInventory("MissileLauncher") > 0) %weaponCount++; if (%player.getInventory("ShockLance") > 0) %weaponCount++; if ((%armor $= "Light" && %weaponCount < 3) || (%armor $= "Medium" && %weaponCount < 4) || (%armor $= "Heavy" && %weaponCount < 5)) { if ((%type $= "Mortar" && %armor !$= "Heavy") || (%type $= "MissileLauncher" && %armor $= "Light") || (%type $= "SniperRifle" && %armor !$= "Light")) return false; else return true; } //else we're full of weapons already... return false; } function AIEngageWeaponRating(%client) { %player = %client.player; if (!isObject(%player)) return; %playerDataBlock = %client.player.getDataBlock(); //get our inventory %hasBlaster = (%player.getInventory("Blaster") > 0); %hasPlasma = (%player.getInventory("Plasma") > 0 && %player.getInventory("PlasmaAmmo") >= 1); %hasChain = (%player.getInventory("Chaingun") > 0 && %player.getInventory("ChaingunAmmo") >= 1); %hasDisc = (%player.getInventory("Disc") > 0 && %player.getInventory("DiscAmmo") >= 1); %hasGrenade = (%player.getInventory("GrenadeLauncher") > 0 && %player.getInventory("GrenadeLauncherAmmo") >= 1); %hasSniper = (%player.getInventory("SniperRifle") > 0) && (%player.getInventory("EnergyPack") > 0); %hasELF = (%player.getInventory("ELFGun") > 0); //check ammo %quantity = mFloor(%playerDataBlock.max[%type] * 0.7); %rating = 0; if (%hasBlaster) %rating += 9; if (%hasSniper) %rating += 9; if (%hasElf) %rating += 9; if (%hasDisc) { %quantity = %player.getInventory("DiscAmmo") / %playerDataBlock.max["DiscAmmo"]; %rating += 15 + (15 * %quantity); } if (%hasPlasma) { %quantity = %player.getInventory("PlasmaAmmo") / %playerDataBlock.max["PlasmaAmmo"]; %rating += 15 + (15 * %quantity); } if (%hasChain) { %quantity = %player.getInventory("ChainGunAmmo") / %playerDataBlock.max["ChainGunAmmo"]; %rating += 15 + (15 * %quantity); } //not really an effective weapon for hand to hand... // if (%hasGrenade) // { // %quantity = %player.getInventory("GrenadeLauncherAmmo") / %playerDataBlock.max["GrenadeLauncherAmmo"]; // %rating += 10 + (15 * %quantity); // } //note a rating of 20+ means at least two energy weapons, or an ammo weapon with at least 1/3 ammo... return %rating; } function AIFindSafeItem(%client, %needType) { %player = %client.player; if (!isObject(%player)) return -1; %closestItem = -1; %closestDist = 32767; %itemCount = $AIItemSet.getCount(); for (%i = 0; %i < %itemCount; %i++) { %item = $AIItemSet.getObject(%i); if (%item.isHidden()) continue; %type = %item.getDataBlock().getName(); if ((%needType $= "Health" && (%type $= "RepairKit" || %type $= "RepairPatch") && %player.getDamagePercent() > 0) || (%needType $= "Ammo" && (%type $= "ChainGunAmmo" || %type $= "PlasmaAmmo" || %type $= "DiscAmmo" || %type $= "GrenadeLauncherAmmo" || %type $= "MortarAmmo") && AICouldUseItem(%client, %item)) || (%needType $= "Ammo" && AICanPickupWeapon(%type)) || ((%needType $= "" || %needType $= "Any") && AICouldUseItem(%client, %item))) { //first, see if it's close to us... %distance = %client.getPathDistance(%item.getTransform()); if (%distance > 0 && %distance < %closestDist) { //now see if it's got bad enemies near it... %clientCount = ClientGroup.getCount(); for (%j = 0; %j < %clientCount; %j++) { %cl = ClientGroup.getObject(%j); if (%cl == %client || %cl.team == %client.team || !AIClientIsAlive(%cl)) continue; //if the enemy is stronger, see if they're close to the item if (AIEngageWhoWillWin(%client, %cl) == %cl) { %tempDist = %client.getPathDistance(%item.getWorldBoxCenter()); if (%tempDist > 0 && %tempDist < %distance + 50) continue; } //either no enemy, or a weaker one... %closestItem = %item; %closestDist = %distance; } } } } return %closestItem; } function AIChooseObjectWeapon(%client, %targetObject, %distToTarg, %mode, %canUseEnergyStr, %environmentStr) { //get our inventory %player = %client.player; if (!isObject(%player)) return; if (!isObject(%targetObject)) return; %canUseEnergy = (%canUseEnergyStr $= "true"); %inWater = (%environmentStr $= "water"); %hasBlaster = (%player.getInventory("Blaster") > 0) && %canUseEnergy; %hasPlasma = (%player.getInventory("Plasma") > 0) && (%player.getInventory("PlasmaAmmo") > 0) && !%inWater; %hasChain = (%player.getInventory("Chaingun") > 0) && (%player.getInventory("ChaingunAmmo") > 0); %hasDisc = (%player.getInventory("Disc") > 0) && (%player.getInventory("DiscAmmo") > 0); %hasGrenade = (%player.getInventory("GrenadeLauncher") > 0) && (%player.getInventory("GrenadeLauncherAmmo") > 0); %hasMortar = (%player.getInventory("Mortar") > 0) && (%player.getInventory("MortarAmmo") > 0); %hasRepairPack = (%player.getInventory("RepairPack") > 0) && %canUseEnergy; %hasTargetingLaser = (%player.getInventory("TargetingLaser") > 0) && %canUseEnergy; %hasMissile = (%player.getInventory("MissileLauncher") > 0) && (%player.getInventory("MissileLauncherAmmo") > 0); //see if we're destroying the object if (%mode $= "Destroy") { if ((%targetObject.getDataBlock().getClassName() $= "TurretData" || %targetObject.getDataBlock().getName() $= "MineDeployed") && %distToTarg < 50) { if (%hasPlasma) %useWeapon = "Plasma"; else if (%hasDisc) %useWeapon = "Disc"; else if (%hasBlaster) %useWeapon = "Blaster"; else if (%hasChain) %useWeapon = "Chaingun"; else %useWeapon = "NoAmmo"; } else if (%distToTarg < 40) { if (%hasPlasma) %useWeapon = "Plasma"; else if (%hasChain) %useWeapon = "Chaingun"; else if (%hasBlaster) %useWeapon = "Blaster"; else if (%hasDisc) %useWeapon = "Disc"; else %useWeapon = "NoAmmo"; } else %useWeapon = "NoAmmo"; } //else See if we're repairing the object else if (%mode $= "Repair") { if (%hasRepairPack) %useWeapon = "RepairPack"; else %useWeapon = "NoAmmo"; } //else see if we're lazing the object else if (%mode $= "Laze") { if (%hasTargetingLaser) %useWeapon = "TargetingLaser"; else %useWeapon = "NoAmmo"; } //else see if we're mortaring the object else if (%mode $= "Mortar") { if (%hasMortar) %useWeapon = "Mortar"; else %useWeapon = "NoAmmo"; } //else see if we're rocketing the object else if (%mode $= "Missile" || %mode $= "MissileNoLock") { if (%hasMissile) %useWeapon = "MissileLauncher"; else %useWeapon = "NoAmmo"; } //now select the weapon switch$ (%useWeapon) { case "Blaster": %client.player.use("Blaster"); %client.setWeaponInfo("EnergyBolt", 25, 50, 1, 0.1); case "Plasma": %client.player.use("Plasma"); %client.setWeaponInfo("PlasmaBolt", 25, 50); case "Chaingun": %client.player.use("Chaingun"); %client.setWeaponInfo("ChaingunBullet", 30, 75, 150); case "Disc": %client.player.use("Disc"); %client.setWeaponInfo("DiscProjectile", 30, 75); case "GrenadeLauncher": %client.player.use("GrenadeLauncher"); %client.setWeaponInfo("BasicGrenade", 40, 75); case "Mortar": %client.player.use("Mortar"); %client.setWeaponInfo("MortarShot", 100, 350); case "RepairPack": if (%player.getImageState($BackpackSlot) $= "Idle") %client.player.use("RepairPack"); %client.setWeaponInfo("DefaultRepairBeam", 40, 75, 300, 0.1); case "TargetingLaser": %client.player.use("TargetingLaser"); %client.setWeaponInfo("BasicTargeter", 20, 300, 300, 0.1); case "MissileLauncher": %client.player.use("MissileLauncher"); %client.setWeaponInfo("ShoulderMissile", 80, 300); case "NoAmmo": %client.setWeaponInfo("NoAmmo", 30, 75); } } function AIChooseEngageWeapon(%client, %targetClient, %distToTarg, %canUseEnergyStr, %environmentStr) { //get some status %player = %client.player; if (!isObject(%player)) return; %enemy = %targetClient.player; if (!isObject(%enemy)) return; %canUseEnergy = (%canUseEnergyStr $= "true"); %inWater = (%environmentStr $= "water"); %outdoors = (%environmentStr $= "outdoors"); %targVelocity = %targetClient.player.getVelocity(); %targEnergy = %targetClient.player.getEnergyPercent(); %targDamage = %targetClient.player.getDamagePercent(); %myEnergy = %player.getEnergyPercent(); %myDamage = %player.getDamagePercent(); //get our inventory %hasBlaster = (%player.getInventory("Blaster") > 0) && %canUseEnergy; %hasPlasma = (%player.getInventory("Plasma") > 0) && (%player.getInventory("PlasmaAmmo") > 0) && !%inWater; %hasChain = (%player.getInventory("Chaingun") > 0) && (%player.getInventory("ChaingunAmmo") > 0); %hasDisc = (%player.getInventory("Disc") > 0) && (%player.getInventory("DiscAmmo") > 0); %hasGrenade = (%player.getInventory("GrenadeLauncher") > 0) && (%player.getInventory("GrenadeLauncherAmmo") > 0); %hasSniper = (%player.getInventory("SniperRifle") > 0) && (%player.getInventory("EnergyPack") > 0) && %canUseEnergy && !%inWater; %hasELF = (%player.getInventory("ELFGun") > 0) && %canUseEnergy && !%inWater; %hasMortar = (%player.getInventory("Mortar") > 0) && (%player.getInventory("MortarAmmo") > 0); %hasMissile = (%player.getInventory("MissileLauncher") > 0) && (%player.getInventory("MissileLauncherAmmo") > 0); %hasShockLance = (%player.getInventory("ShockLance") > 0) && %canUseEnergy && !%inWater; //choose the weapon %useWeapon = "NoAmmo"; //first, see if it's a pilot we're shooting if (%dist > 50 && %enemy.isMounted() && %hasMissile) { %useWeapon = "MissileLauncher"; } else if (%distToTarg < 5 && %hasShockLance) { %useWeapon = "ShockLance"; } else if (%distToTarg < 15) { if (%hasELF && %myEnergy > 0.5 && %targEnergy > 0.3 && %myDamage < %targDamage && %targetZ > %myZ + 20) %useWeapon = "ELFGun"; else if (%hasPlasma) %useWeapon = "Plasma"; else if (%hasChain) %useWeapon = "Chaingun"; else if (%hasBlaster) %useWeapon = "Blaster"; else if (%hasELF && %targEnergy > 0.2) %useWeapon = "ELFGun"; else if (%hasDisc) %useWeapon = "Disc"; else if (%hasShockLance) %useWeapon = "ShockLance"; } else if (%distToTarg < 35) { if (%hasELF && %targEnergy > 0.4 && (%myDamage < 0.3 || %myDamage - %targDamage < 0.2) && %targetZ > %myZ + 20) %useWeapon = "ELFGun"; else if (!%outdoors && %hasPlasma) %useWeapon = "Plasma"; else if (%hasChain && %hasDisc) { %speed = VectorDist("0 0 0", %targVelocity); %myZ = getWord(%player.getTransform(), 2); %targetZ = getWord(%enemy.getTransform(), 2); %targetZVel = getWord(%targVelocity, 2); if (%speed > 15.0 || %targetZ > %myZ || %targetZVel > 1.0) %useWeapon = "Chaingun"; else %useWeapon = "Disc"; } else if (%hasPlasma) %useWeapon = "Plasma"; else if (%hasChain) %useWeapon = "Chaingun"; else if (%hasDisc) %useWeapon = "Disc"; else if (%hasBlaster) %useWeapon = "Blaster"; } else if (%distToTarg < 60) { if (%hasGrenade) %useWeapon = "GrenadeLauncher"; else if (%hasSniper && %myEnergy > 0.6) %useWeapon = "SniperRifle"; } else if (%distToTarg < 80) { if (%hasSniper && %myEnergy > 0.4) %useWeapon = "SniperRifle"; else if (%hasDisc) %useWeapon = "Disc"; else if (%hasChain) %useWeapon = "Chaingun"; else if (%hasBlaster) %useWeapon = "Blaster"; } else { if (%hasSniper) %useWeapon = "SniperRifle"; } //now make sure we actually selected something if (%useWeapon $= "NoAmmo") { if (%hasDisc) %useWeapon = "Disc"; else if (%hasChain) %useWeapon = "Chaingun"; else if (%hasPlasma) %useWeapon = "Plasma"; else if (%hasBlaster) %useWeapon = "Blaster"; else if (%hasELF) %useWeapon = "ELFGun"; else if (%hasSniper) %useWeapon = "SniperRifle"; else if (%hasShockLance) %useWeapon = "ShockLance"; else if (%hasGrenade) %useWeapon = "GrenadeLauncher"; else if (%hasMissile) %useWeapon = "MissileLauncher"; } //now select the weapon switch$ (%useWeapon) { case "Blaster": %client.player.use("Blaster"); %client.setWeaponInfo("EnergyBolt", 25, 50, 1, 0.1); case "Plasma": %client.player.use("Plasma"); %client.setWeaponInfo("PlasmaBolt", 25, 50); case "Chaingun": %client.player.use("Chaingun"); %client.setWeaponInfo("ChaingunBullet", 30, 75, 150); case "Disc": %client.player.use("Disc"); %client.setWeaponInfo("DiscProjectile", 30, 75); case "GrenadeLauncher": %client.player.use("GrenadeLauncher"); %client.setWeaponInfo("BasicGrenade", 40, 75); case "SniperRifle": %client.player.use("SniperRifle"); %client.setWeaponInfo("BasicSniperShot", 80, 350, 1, 0.75, 0.5); case "ELFGun": %client.player.use("ELFGun"); %client.setWeaponInfo("BasicELF", 25, 45, 90, 0.1); case "ShockLance": %client.player.use("ShockLance"); %client.setWeaponInfo("BasicShocker", 0.5, 8, 1, 0.1); case "MissileLauncher": %client.player.use("MissileLauncher"); %client.setWeaponInfo("ShoulderMissile", 80, 350); case "NoAmmo": %client.setWeaponInfo("NoAmmo", 30, 75); } } //function is called once per frame, to handle packs, healthkits, grenades, etc... function AIProcessEngagement(%client, %target, %type, %projectile) { //make sure we're still alive if (! AIClientIsAlive(%client)) return; //clear the pressFire %client.pressFire(-1); //see if we have to use a repairkit %player = %client.player; if (!isObject(%player)) return; if (%client.getSkillLevel() > 0.1 && %player.getDamagePercent() > 0.3 && %player.getInventory("RepairKit") > 0) { //add in a "skill" value to delay the using of the repair kit for up to 10 seconds... %elapsedTime = getSimTime() - %client.lastDamageTime; %skillValue = (1.0 - %client.getSkillLevel()) * (1.0 - %client.getSkillLevel()); if (%elapsedTime > (%skillValue * 20000)) %player.use("RepairKit"); } //see if we've been blinded if (%player.getWhiteOut() > 0.6) %client.setBlinded(2000); //else see if there's a grenade in the vicinity... else { %count = $AIGrenadeSet.getCount(); for (%i = 0; %i < %count; %i++) { %grenade = $AIGrenadeSet.getObject(%i); //make sure the grenade isn't ours if (%grenade.sourceObject.client != %client) { //see if it's within 15 m if (VectorDist(%grenade.position, %client.player.position) < 15) { %client.setDangerLocation(%grenade.position, 20); break; } } } } //if we're being hunted by a seeker projectile, throw a flare grenade if (%player.getInventory("FlareGrenade") > 0) { %missileCount = MissileSet.getCount(); for (%i = 0; %i < %missileCount; %i++) { %missile = MissileSet.getObject(%i); if (%missile.getTargetObject() == %player) { //see if the missile is within range if (VectorDist(%missile.getTransform(), %player.getTransform()) < 50) { %player.throwStrength = 1.5; %player.use("FlareGrenade"); break; } } } } //see what we're fighting switch$ (%type) { case "player": //make sure the target is alive if (AIClientIsAlive(%target)) { //if the target is in range, and within 10-40 m, and heading in this direction, toss a grenade if (!$AIDisableGrenades && %client.getSkillLevel() >= 0.3) { if (%player.getInventory("Grenade") > 0) %grenadeType = "Grenade"; else if (%player.getInventory("FlashGrenade") > 0) %grenadeType = "FlashGrenade"; else if (%player.getInventory("ConcussionGrenade") > 0) %grenadeType = "ConcussionGrenade"; else %grenadeType = ""; if (%grenadeType !$= "" && %client.targetInSight()) { //see if the predicted location of the target is within 10m %targPos = %target.player.getWorldBoxCenter(); %clientPos = %player.getWorldBoxCenter(); //make sure we're not *way* above the target if (getWord(%clientPos, 2) - getWord(%targPos, 2) < 3) { %dist = VectorDist(%targPos, %clientPos); %direction = VectorDot(VectorSub(%clientPos, %targPos), %target.player.getVelocity()); %facing = VectorDot(VectorSub(%client.getAimLocation(), %clientPos), VectorSub(%targPos, %clientPos)); if (%dist > 20 && %dist < 45 && (%direction > 0.9 || %direction < -0.9) && (%facing > 0.9)) { %player.throwStrength = 1.0; %player.use(%grenadeType); } } } } //see if we have a shield pack that we need to use if (%player.getInventory("ShieldPack") > 0) { if (%projectile > 0 && %player.getImageState($BackpackSlot) $= "Idle") { %player.use("Backpack"); } else if (%projectile <= 0 && %player.getImageState($BackpackSlot) $= "activate") { %player.use("Backpack"); } } } case "object": %hasGrenade = %player.getInventory("Grenade"); if (%hasGrenade && %client.targetInRange()) { %targPos = %target.getWorldBoxCenter(); %myPos = %player.getWorldBoxCenter(); %dist = VectorDist(%targPos, %myPos); if (%dist > 5 && %dist < 20) { %player.throwStrength = 1.0; %player.use("Grenade"); } } case "none": //use the repair pack if we have one if (%player.getDamagePercent() > 0 && %player.getInventory(RepairPack) > 0) { if (%player.getImageState($BackpackSlot) $= "Idle") %client.player.use("RepairPack"); else //sustain the fire for 30 frames - this callback is timesliced... %client.pressFire(30); } } } function AIFindClosestInventory(%client, %armorChange) { %closestInv = -1; %closestDist = 32767; %depCount = 0; %depGroup = nameToID("MissionCleanup/Deployables"); if (%depGroup > 0) %depCount = %depGroup.getCount(); // there exists a deployed station, lets find it if(!%armorChange && %depCount > 0) { for(%i = 0; %i < %depCount; %i++) { %obj = %depGroup.getObject(%i); if(%obj.getDataBlock().getName() $= "DeployedStationInventory" && %obj.team == %client.team && %obj.isEnabled()) { %distance = %client.getPathDistance(%obj.getTransform()); if (%distance > 0 && %distance < %closestDist) { %closestInv = %obj; %closestDist = %distance; } } } } // still check if there is one that is closer %invCount = $AIInvStationSet.getCount(); for (%i = 0; %i < %invCount; %i++) { %invStation = $AIInvStationSet.getObject(%i); if (%invStation.team <= 0 || %invStation.team == %client.team) { //error("DEBUG: found an inventory station: " @ %invStation @ " status: " @ %invStation.isPowered()); //make sure the station is powered if (!%invStation.isDisabled() && %invStation.isPowered()) { %dist = %client.getPathDistance(%invStation.getTransform()); if (%dist > 0 && %dist < %closestDist) { %closestInv = %invStation; %closestDist = %dist; } } } } return %closestInv @ " " @ %closestDist; } //------------------------------ //find the closest inventories for the objective weight functions function AIFindClosestInventories(%client) { %closestInv = -1; %closestDist = 32767; %closestRemoteInv = -1; %closestRemoteDist = 32767; %depCount = 0; %depGroup = nameToID("MissionCleanup/Deployables"); //first, search for the nearest deployable inventory station if (isObject(%depGroup)) { %depCount = %depGroup.getCount(); for (%i = 0; %i < %depCount; %i++) { %obj = %depGroup.getObject(%i); if (%obj.getDataBlock().getName() $= "DeployedStationInventory" && %obj.team == %client.team && %obj.isEnabled()) { %distance = %client.getPathDistance(%obj.getTransform()); if (%distance > 0 && %distance < %closestRemoteDist) { %closestRemoteInv = %obj; %closestRemoteDist = %distance; } } } } // now find the closest regular inventory station %invCount = $AIInvStationSet.getCount(); for (%i = 0; %i < %invCount; %i++) { %invStation = $AIInvStationSet.getObject(%i); if (%invStation.team <= 0 || %invStation.team == %client.team) { //make sure the station is powered if (!%invStation.isDisabled() && %invStation.isPowered()) { %dist = %client.getPathDistance(%invStation.getTransform()); if (%dist > 0 && %dist < %closestDist) { %closestInv = %invStation; %closestDist = %dist; } } } } //if the regular inv station is closer than the deployed, don't bother with the remote if (%closestDist < %closestRemoteDist) %returnStr = %closestInv SPC %closestDist; else %returnStr = %closestInv SPC %closestDist SPC %closestRemoteInv SPC %closestRemoteDist; return %returnStr; } //------------------------------ //AI Equipment Configs $EquipConfigIndex = -1; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "Heavy"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "AmmoPack"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "Plasma"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "PlasmaAmmo"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "Mortar"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "MortarAmmo"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[HeavyAmmoSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "Heavy"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "ShieldPack"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "Plasma"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "PlasmaAmmo"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "Mortar"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "MortarAmmo"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[HeavyShieldSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "Heavy"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "EnergyPack"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "Plasma"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "PlasmaAmmo"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "ELFGun"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "Mortar"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "MortarAmmo"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[HeavyEnergySet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "Heavy"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "RepairPack"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "ELFGun"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "Mortar"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "MortarAmmo"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[HeavyRepairSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "Heavy"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "TurretIndoorDeployable"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "ELFGun"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[HeavyIndoorTurretSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "Heavy"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "InventoryDeployable"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "ELFGun"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[HeavyInventorySet, $EquipConfigIndex++] = "Mine"; //------------------------------ $EquipConfigIndex = -1; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "Medium"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "RepairPack"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "Plasma"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "PlasmaAmmo"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[MediumRepairSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "Medium"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "ShieldPack"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "Plasma"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "PlasmaAmmo"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[MediumShieldSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "Medium"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "EnergyPack"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "ELFGun"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[MediumEnergySet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "Medium"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "EnergyPack"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "MissileLauncher"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "MissileLauncherAmmo"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "ELFGun"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[MediumMissileSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "Medium"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "TurretOutdoorDeployable"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "ELFGun"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[MediumOutdoorTurretSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "Medium"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "TurretIndoorDeployable"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "ELFGun"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[MediumIndoorTurretSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "Medium"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "InventoryDeployable"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "ELFGun"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[MediumInventorySet, $EquipConfigIndex++] = "Mine"; //------------------------------ $EquipConfigIndex = -1; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "Light"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "EnergyPack"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[LightEnergyDefault, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "Light"; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "EnergyPack"; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "SniperRifle"; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[LightEnergySniper, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "Light"; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "EnergyPack"; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "ELFGun"; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[LightEnergyELF, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "Light"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "ShieldPack"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "Plasma"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "PlasmaAmmo"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[LightShieldSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "Light"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "CloakingPack"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "Plasma"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "PlasmaAmmo"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "FlashGrenade"; $AIEquipmentSet[LightCloakSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "Light"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "RepairPack"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "GrenadeLauncher"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "GrenadeLauncherAmmo"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[LightRepairSet, $EquipConfigIndex++] = "Mine"; $EquipConfigIndex = -1; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "Light"; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "EnergyPack"; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "Disc"; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "DiscAmmo"; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "Chaingun"; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "ChaingunAmmo"; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "SniperRifle"; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "TargetingLaser"; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "RepairKit"; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "Grenade"; $AIEquipmentSet[LightSniperChain, $EquipConfigIndex++] = "Mine"; PK !(X`S`Sscripts/aiObjectiveBuilder.cs// used to automatically create all objectives for a mission function AIgeneratorObjectiveInit(%object) { if(%object.isUnderTerrain) return; // no objectives for generators that act as a simple power sources if(%object.team > 0) { %homeTeam = %object.team; if(%homeTeam == 1) %enemyTeam = 2; else %enemyTeam = 1; addAIObjective(%enemyTeam, createDefaultAttack(%object, $AIWeightAttackGenerator[1], $AIWeightAttackGenerator[2])); addAIObjective(%homeTeam, createDefaultRepair(%object, $AIWeightRepairGenerator[1], $AIWeightRepairGenerator[2])); addAIObjective(%homeTeam, createDefaultDefend(%object, $AIWeightDefendGenerator[1], $AIWeightDefendGenerator[2])); } else { addAIObjective(1, createDefaultRepair(%object, $AIWeightRepairGenerator[1], $AIWeightRepairGenerator[2])); addAIObjective(1, createDefaultAttack(%object, $AIWeightAttackGenerator[1], $AIWeightAttackGenerator[2])); addAIObjective(1, createDefaultDefend(%object, $AIWeightDefendGenerator[1], $AIWeightDefendGenerator[2])); addAIObjective(2, createDefaultRepair(%object, $AIWeightRepairGenerator[1], $AIWeightRepairGenerator[2])); addAIObjective(2, createDefaultAttack(%object, $AIWeightAttackGenerator[1], $AIWeightAttackGenerator[2])); addAIObjective(2, createDefaultDefend(%object, $AIWeightDefendGenerator[1], $AIWeightDefendGenerator[2])); } } //-------------------------------------------------------------------------------------------------------- function AIsensorObjectiveInit(%object) { if(%object.team > 0) { %homeTeam = %object.team; if(%homeTeam == 1) %enemyTeam = 2; else %enemyTeam = 1; addAIObjective(%homeTeam, createDefaultRepair(%object, $AIWeightRepairTurret[1], $AIWeightRepairTurret[2])); addAIObjective(%enemyTeam, createDefaultMortar(%object, $AIWeightMortarTurret[1], $AIWeightMortarTurret[2])); } else { addAIObjective(1, createDefaultRepair(%object, $AIWeightRepairTurret[1], $AIWeightRepairTurret[2])); addAIObjective(1, createDefaultMortar(%object, $AIWeightMortarTurret[1], $AIWeightMortarTurret[2])); addAIObjective(2, createDefaultRepair(%object, $AIWeightRepairTurret[1], $AIWeightRepairTurret[2])); addAIObjective(2, createDefaultMortar(%object, $AIWeightMortarTurret[1], $AIWeightMortarTurret[2])); } } //-------------------------------------------------------------------------------------------------------- function AIflipflopObjectiveInit(%object) { // this will always start out neutral (Team 0) addAIObjective(1, createDefaultDefend(%object, $AIWeightDefendFlipFlop[1], $AIWeightDefendFlipFlop[2])); addAIObjective(1, createDefaultTouch(%object, $AIWeightCaptureFlipFlop[1], $AIWeightCaptureFlipFlop[2])); addAIObjective(2, createDefaultDefend(%object, $AIWeightDefendFlipFlop[1], $AIWeightDefendFlipFlop[2])); addAIObjective(2, createDefaultTouch(%object, $AIWeightCaptureFlipFlop[1], $AIWeightCaptureFlipFlop[2])); } //-------------------------------------------------------------------------------------------------------- function AIturretObjectiveInit(%object) { if(%object.team > 0) { %homeTeam = %object.team; if(%homeTeam == 1) %enemyTeam = 2; else %enemyTeam = 1; addAIObjective(%homeTeam, createDefaultRepair(%object, $AIWeightRepairTurret[1], $AIWeightRepairTurret[2])); // attack for indoor turrets, mortar for outside turrets if(%object.getDataBlock().getName() $= "SentryTurret") addAIObjective(%enemyTeam, createDefaultAttack(%object, $AIWeightAttackInventory[1], $AIWeightAttackInventory[2])); else addAIObjective(%enemyTeam, createDefaultMortar(%object, $AIWeightMortarTurret[1], $AIWeightMortarTurret[2])); } else { addAIObjective(1, createDefaultRepair(%object, $AIWeightRepairTurret[1], $AIWeightRepairTurret[2])); addAIObjective(1, createDefaultMortar(%object, $AIWeightMortarTurret[1], $AIWeightMortarTurret[2])); addAIObjective(2, createDefaultRepair(%object, $AIWeightRepairTurret[1], $AIWeightRepairTurret[2])); addAIObjective(2, createDefaultMortar(%object, $AIWeightMortarTurret[1], $AIWeightMortarTurret[2])); } } //-------------------------------------------------------------------------------------------------------- function AIinventoryObjectiveInit(%object) { if(%object.team > 0) { %homeTeam = %object.team; if(%homeTeam == 1) %enemyTeam = 2; else %enemyTeam = 1; addAIObjective(%homeTeam, createDefaultRepair(%object, $AIWeightRepairInventory[1], $AIWeightRepairInventory[2])); addAIObjective(%enemyTeam, createDefaultAttack(%object, $AIWeightAttackInventory[1], $AIWeightAttackInventory[2])); } else { addAIObjective(1, createDefaultRepair(%object, $AIWeightRepairInventory[1], $AIWeightRepairInventory[2])); addAIObjective(1, createDefaultAttack(%object, $AIWeightAttackInventory[1], $AIWeightAttackInventory[2])); addAIObjective(2, createDefaultRepair(%object, $AIWeightRepairInventory[1], $AIWeightRepairInventory[2])); addAIObjective(2, createDefaultAttack(%object, $AIWeightAttackInventory[1], $AIWeightAttackInventory[2])); } } //-------------------------------------------------------------------------------------------------------- function createDefaultTouch(%object, %weight1, %weight2) { %objective = new AIObjective(AIOTouchObject) { dataBlock = "AIObjectiveMarker"; description = "Capture the " @ %object.getName(); weightLevel1 = %weight1; weightLevel2 = %weight2; mode = "TouchFlipFlop"; targetObject = %object.getName(); targetClientId = -1; targetObjectId = -1; offense = true; location = %object.getWorldBoxCenter(); desiredEquipment = "Light EnergyPack"; buyEquipmentSet = "LightEnergyDefault"; }; if(%object.missionTypesList !$= "") %objective.gameType = %object.missionTypesList; %objective.position = %objective.location; return %objective; } //-------------------------------------------------------------------------------------------------------- function createDefaultMortar(%object, %weight1, %weight2) { %objective = new AIObjective(AIOMortarObject) { dataBlock = "AIObjectiveMarker"; description = "Mortar the " @ %object.getDataBlock().getName(); targetObject = %object.getName(); targetObjectId = %object; targetClientId = -1; weightLevel1 = %weight1; weightLevel2 = %weight2; location = %object.getWorldBoxCenter(); offense = true; equipment = "Mortar MortarAmmo"; buyEquipmentSet = "HeavyAmmoSet"; }; if(%object.missionTypesList !$= "") %objective.gameType = %object.missionTypesList; %objective.position = %objective.location; return %objective; } //-------------------------------------------------------------------------------------------------------- function createDefaultRepair(%object, %weight1, %weight2) { %objective = new AIObjective(AIORepairObject) { dataBlock = "AIObjectiveMarker"; description = "Repair the " @ %object.getDataBlock().getName(); targetObject = %object.getName(); targetObjectId = %object; targetClientId = -1; weightLevel1 = %weight1; weightLevel2 = %weight2; location = %object.getWorldBoxCenter(); defense = true; equipment = "RepairPack"; buyEquipmentSet = "MediumRepairSet"; }; if(%object.missionTypesList !$= "") %objective.gameType = %object.missionTypesList; %objective.position = %objective.location; return %objective; } //-------------------------------------------------------------------------------------------------------- function createDefaultAttack(%object, %weight1, %weight2) { %objective = new AIObjective(AIOAttackObject) { dataBlock = "AIObjectiveMarker"; description = "Attack the " @ %object.getDataBlock().getName(); targetObject = %object.getName(); targetObjectId = %object; targetClientId = -1; weightLevel1 = %weight1; weightLevel2 = %weight2; location = %object.getWorldBoxCenter(); offense = true; desiredEquipment = "ShieldPack"; buyEquipmentSet = "HeavyAmmoSet"; }; if(%object.missionTypesList !$= "") %objective.gameType = %object.missionTypesList; %objective.position = %objective.location; return %objective; } //-------------------------------------------------------------------------------------------------------- function createDefaultDefend(%object, %weight1, %weight2) { %objective = new AIObjective(AIODefendLocation) { dataBlock = "AIObjectiveMarker"; description = "Defend the " @ %object.getDataBlock().getName(); targetObject = %object.getName(); targetObjectId = %object; targetClientId = -1; weightLevel1 = %weight1; weightLevel2 = %weight2; location = %object.getWorldBoxCenter(); defense = true; desiredEquipment = "ShieldPack Plasma PlasmaAmmo"; buyEquipmentSet = "HeavyShieldSet"; }; if(%object.missionTypesList !$= "") %objective.gameType = %object.missionTypesList; %objective.position = %objective.location; return %objective; } //-------------------------------------------------------------------------------------------------------- function AIflagObjectiveInit(%flag) { %homeTeam = %flag.team; if(%homeTeam == 1) %enemyTeam = 2; else %enemyTeam = 1; if(%flag.missionTypesList !$= "") { %missionSpecific = true; %misType = %flag.missionTypesList; } %newObjective = new AIObjective(AIODefendLocation) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $AIWeightDefendFlag[1]; weightLevel2 = $AIWeightDefendFlag[2]; description = "Defend our flag"; targetObject = %flag.getName(); targetObjectId = %flag; targetClientId = -1; location = %flag.getWorldBoxCenter(); defense = true; desiredEquipment = "ShieldPack Plasma PlasmaAmmo"; buyEquipmentSet = "HeavyShieldSet"; chat = "ChatSelfDefendFlag DefendBase"; }; if(%missionSpecific) %newObjective.gameType = %misType; else %newObjective.gameType = "all"; %newObjective.position = %newObjective.location; addAIObjective(%homeTeam, %newObjective); %newObjective = new AIObjective(AIOTouchObject) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $AIWeightGrabFlag[1]; weightLevel2 = $AIWeightGrabFlag[2]; description = "Grab the enemy flag"; targetObject = %flag.getName(); targetObjectId = %flag; targetClientId = -1; location = %flag.getWorldBoxCenter(); mode = "FlagGrab"; offense = true; desiredEquipment = "Light EnergyPack"; buyEquipmentSet = "LightEnergyDefault"; }; if(%missionSpecific) %newObjective.gameType = %misType; else %newObjective.gameType = "all"; %newObjective.position = %newObjective.location; addAIObjective(%enemyTeam, %newObjective); //NOTE: for this objective, we need to fill in the targetClientId when the flag is taken %newObjective = new AIObjective(AIOAttackPlayer) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $AIWeightKillFlagCarrier[1]; weightLevel2 = $AIWeightKillFlagCarrier[2]; description = "Kill the enemy flag carrier"; mode = "FlagCarrier"; targetObject = %flag.getName(); targetObjectId = -1; targetClientId = -1; offense = true; desiredEquipment = "Light EnergyPack"; buyEquipmentSet = "LightEnergySniper"; }; if(%missionSpecific) %newObjective.gameType = %misType; else %newObjective.gameType = "all"; %newObjective.position = %flag.getWorldBoxCenter(); addAIObjective(%homeTeam, %newObjective); //NOTE: for this objective, we need to fill in the location when the flag is grabbed %newObjective = new AIObjective(AIOTouchObject) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $AIWeightCapFlag[1]; weightLevel2 = $AIWeightCapFlag[2]; description = "Capture the flag!"; targetObject = %flag.getName(); targetObjectId = %flag; targetClientId = -1; mode = "FlagCapture"; offense = true; defense = true; }; if(%missionSpecific) %newObjective.gameType = %misType; else %newObjective.gameType = "all"; %newObjective.position = %flag.getWorldBoxCenter(); addAIObjective(%enemyTeam, %newObjective); %newObjective = new AIObjective(AIOTouchObject) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $AIWeightReturnFlag[1]; weightLevel2 = $AIWeightReturnFlag[2]; description = "Return our flag"; targetObject = %flag.getName(); targetObjectId = %flag; targetClientId = -1; location = %flag.getWorldBoxCenter(); mode = "FlagDropped"; offense = true; defense = true; }; if(%missionSpecific) %newObjective.gameType = %misType; else %newObjective.gameType = "all"; %newObjective.position = %newObjective.location; addAIObjective(%homeTeam, %newObjective); %newObjective = new AIObjective(AIOTouchObject) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $AIWeightReturnFlag[1]; weightLevel2 = $AIWeightReturnFlag[2]; description = "Grab the dropped enemy flag"; targetObject = %flag.getName(); targetObjectId = %flag; targetClientId = -1; mode = "FlagDropped"; offense = true; defense = true; }; if(%missionSpecific) %newObjective.gameType = %misType; else %newObjective.gameType = "all"; %newObjective.position = %flag.getWorldBoxCenter(); addAIObjective(%enemyTeam, %newObjective); } //-------------------------------------------------------------------------------------------------------- function addAIObjective(%team, %objective) { if(AIObjectiveExists(%objective, %team) == false) nameToId("MissionGroup/Teams/team" @ %team @ "/AIObjectives").add(%objective); else %objective.delete(); } //-------------------------------------------------------------------------------------------------------- function AICreateObjectives() { messageBoxOkCancel("Build Objectives", "Are you sure you want to build all mission objectives?", "AIBuildObjectives();"); } function AIBuildObjectives() { // make sure there exists our objectives group for(%i = 0; %i <= Game.numTeams; %i++) { %objGroup = nameToId("MissionGroup/Teams/team" @ %i @ "/AIObjectives"); %teamGroup = nameToID("MissionGroup/Teams/team" @ %i); if(%objGroup <= 0) { %set = new SimGroup(AIObjectives); %teamGroup.add(%set); } else { // there already exists a folder for AIobjectives // remove any objectives that are not locked %count = 0; while(%objGroup.getCount() && (%count != %objGroup.getCount())) { %obj = %objGroup.getObject(%count); if(!%obj.locked) %objGroup.remove(%obj); else %count++; } } } for(%k = 0; %k <= Game.numTeams; %k++) { %teamGroup = nameToID("MissionGroup/Teams/team" @ %k); %teamGroup.AIobjectiveInit(false); } } //-------------------------------------------------------------------------------------------------------- function SimGroup::AIobjectiveInit(%this) { for(%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).AIobjectiveInit(); } //-------------------------------------------------------------------------------------------------------- function GameBase::AIobjectiveInit(%this) { %this.getDataBlock().AIobjectiveInit(%this); } //-------------------------------------------------------------------------------------------------------- function AssignName(%object) { %root = %object.getDataBlock().getName(); if (%root $= "") %root = "Unknown"; if (%object.team >= 0) %newName = "Team" @ %object.team @ %root; else %newName = "Unnamed" @ %root; %i = 1; while (isObject(%newName @ %i)) %i++; %object.setName(%newName @ %i); } //-------------------------------------------------------------------------------------------------------- function StationInventory::AIobjectiveInit(%data, %object) { if(%object.getName() $= "") AssignName(%object); AIinventoryObjectiveInit(%object); } //-------------------------------------------------------------------------------------------------------- function Generator::AIobjectiveInit(%data, %object) { if(%object.getName() $= "") AssignName(%object); if(!%object.isUnderTerrain) AIgeneratorObjectiveInit(%object); } //-------------------------------------------------------------------------------------------------------- function TurretData::AIobjectiveInit(%data, %object) { if(%object.getName() $= "") AssignName(%object); AIturretObjectiveInit(%object); } //-------------------------------------------------------------------------------------------------------- function Sensor::AIobjectiveInit(%data, %object) { if(%object.getName() $= "") AssignName(%object); AIsensorObjectiveInit(%object); } //-------------------------------------------------------------------------------------------------------- function Flag::AIobjectiveInit(%data, %object) { if(%object.getName() $= "") AssignName(%object); AIflagObjectiveInit(%object); } //-------------------------------------------------------------------------------------------------------- function FlipFlop::AIobjectiveInit(%data, %object) { if(%object.getName() $= "") AssignName(%object); AIflipflopObjectiveInit(%object); } //-------------------------------------------------------------------------------------------------------- function saveObjectives() { for(%i = 1; %i <= 2; %i++) saveObjectives(%i); } //-------------------------------------------------------------------------------------------------------- function saveObjectiveFile(%team) { // check for read-only %fileName = $CurrentMission @ "team" @ %team @ ".cs"; %file = "base/missions/" @ %fileName; if(!isWriteableFileName(%file)) { error("Objectives file '" @ %fileName @ "' is not writeable."); return; } // ok, were good to save. %objectives = nameToId("MissionGroup/Teams/team" @ %team @ "/AIObjectives"); %objectives.save("missions/" @ %fileName); } //-------------------------------------------------------------------------------------------------------- function LoadObjectives(%numTeams) { for(%i = 1; %i <= %numTeams; %i++) loadObjectivesFile(%i); } //-------------------------------------------------------------------------------------------------------- function LoadObjectivesFile(%team) { %file = $CurrentMission @ "team" @ %team; exec("missions/" @ %file); %newObjSet = nameToId("MissionCleanup/AIObjectives"); if(%newObjSet > 0) { %group = NameToId("MissionGroup/Teams/team" @ %team); %oldObjSet = NameToId("MissionGroup/Teams/team" @ %team @ "/AIObjectives"); if(%oldObjSet > 0) { %oldObjSet.delete(); %group.add(%newObjSet); } } else error("no objectives file for team" @ %team @ ". Loading defaults..."); } //-------------------------------------------------------------------------------------------------------- function AIObjectiveExists(%newObjective, %team) { %objGroup = nameToId("MissionGroup/Teams/team" @ %team @ "/AIObjectives"); %objCount = %objGroup.getCount(); %exists = false; for(%i = 0; %i < %objCount; %i++) { %obj = %objGroup.getObject(%i); if(%obj.getName() $= %newObjective.getName()) { if((%obj.getName() $= "AIOMortarObject") || (%obj.getName() $= "AIORepairObject") || (%obj.getName() $= "AIOAttackObject") || (%obj.getName() $= "AIODefendLocation")) { if(%obj.targetObjectId == %newObjective.targetObjectId) %exists = true; } else if((%obj.getName() $= "AIOTouchObject") || (%obj.getName() $= "AIOAttackPlayer")) { if(%obj.mode $= %newObjective.mode) if(%obj.description $= %newObjective.description) %exists = true; } } } return %exists; } PK !(i&scripts/aiObjectives.cs//------------------------------ //AI Objective Q functions... $ObjectiveClientsSet = 0; function AIObjectiveFindClients(%objective) { //create and clear the set if (! $ObjectiveClientsSet) { $ObjectiveClientsSet = new SimSet(); MissionCleanup.add($ObjectiveClientSet); } $ObjectiveClientsSet.clear(); %clientCount = 0; %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.objective == %objective) $ObjectiveClientsSet.add(%cl); } return $ObjectiveClientsSet.getCount(); } function AIObjectiveGetClosestClient(%location, %team) { if (%location $= "") return -1; if (%team $= "") %team = 0; %closestClient = -1; %closestDistance = 32767; %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.isAIControlled() && (%cl.team == %team || %team == 0) && AIClientIsAlive(%cl)) { %testPos = %cl.player.getWorldBoxCenter(); %distance = VectorDist(%location, %testPos); if (%distance < %closestDistance) { %closestDistance = %distance; %closestClient = %cl; } } } return %closestClient; } function AICountObjectives(%team) { %objCount = 0; %count = $ObjectiveQ[%team].getCount(); for (%i = 0; %i < %count; %i++) { %grp = $ObjectiveQ[%team].getObject(%i); if (%grp.getClassName() !$= "AIObjective") %objCount += %grp.getCount(); else %objCount++; } error("DEBUG" SPC %team SPC "has" SPC %objCount SPC "objectives."); } function AIAddTableObjective(%objective, %weight, %level, %bump, %position) { $objTable[%position, objective] = %objective; $objTable[%position, weight] = %weight; $objTable[%position, level] = %level; $objTable[%position, bump] = %bump; $objTableCount = %position + 1; } function AIChooseObjective(%client, %useThisObjectiveQ) { //pick which objectiveQ to use, or use the default if (%useThisObjectiveQ <= 0 && %client.team < 0) return; if (%useThisObjectiveQ <= 0) %useThisObjectiveQ = $ObjectiveQ[%client.team]; if (!isObject(%useThisObjectiveQ) || %useThisObjectiveQ.getCount() <= 0) return; //since most objectives check for inventory, find the closest inventory stations first %inventoryStr = AIFindClosestInventories(%client); //find the most appropriate objective if (!%client.objective) { //note, the table is never empty, during the course of this function AIAddTableObjective(0, 0, 0, 0, 0); } else { //should re-evaluate the current objective weight - but never decrease the weight!!! %testWeight = %client.objective.weight(%client, %client.objectiveLevel, 0, %inventoryStr); if (%testWeight <= 0 || %testWeight > %client.objectiveWeight) %client.objectiveWeight = %testWeight; if (%client.objectiveWeight > 0) AIAddTableObjective(%client.objective, %client.objectiveWeight, %client.objectiveLevel, 0, 0); else AIAddTableObjective(0, 0, 0, 0, 0); } %objCount = %useThisObjectiveQ.getCount(); for (%i = 0; %i < %objCount; %i++) { %objective = %useThisObjectiveQ.getObject(%i); //don't re-evaluate the client's own if (%objective == %client.objective) continue; //try this objective at each of the 4 weight levels to see if it is weighted higher for (%level = 1; %level <= 4; %level++) { %minWeight = 0; %bumpWeight = 0; %bumpClient = ""; //we can bump clients off the objective for the first three levels if (%level <= 3) { //if the objective is part of a group, check the whole group if (%objective.group > 0) { %bumpClient = %objective.group.clientLevel[%level]; %bumpWeight = %bumpClient.objectiveWeight; } else { %bumpClient = %objective.clientLevel[%level]; %bumpWeight = %bumpClient.objectiveWeight; } } //find the minimum weight the objective must have to be considered %minWeight = (%bumpWeight > $objTable[0, weight] ? %bumpWeight : $objTable[0, weight]); //evaluate the weight %weight = %objective.weight(%client, %level, %minWeight, %inventoryStr); //make sure we got a valid weight if (%weight <= 0) break; //if it's the highest so far, it now replaces anything else in the table if (%weight > $objTable[0, weight]) { //never bump someone unless you out- weight them if (%weight > %bumpWeight) { AIAddTableObjective(%objective, %weight, %level, %bumpClient, 0); //no need to keep checking the other levels break; } } //else if it's equal to the highest objective we've seen so far, and higher from our current objective else if (%weight == $objTable[0, weight] && %weight > %client.objectiveWeight) { //never bump someone unless you outweigh them if (%weight > %bumpWeight) { //if this wouldn't require us to bump someone, or the table is empty if (%bumpWeight <= 0 || $objTable[0, weight] <= 0) { //if the table currently contains objectives which would require bumping someone, clear it if ($objTable[0, bump] > 0) %position = 0; else %position = $objTableCount; //add it to the table AIAddTableObjective(%objective, %weight, %level, %bumpClient, %position); //no need to keep checking the other levels break; } //otherwise, the table is not empty, and this would require us to bump someone //only add it if everything else in the table would also require us to bump someone else if ($objTable[0, bump] > 0) { AIAddTableObjective(%objective, %weight, %level, %bumpClient, $objTableCount); //no need to keep checking the other levels break; } } } //else it must have been less than our highest objective so far- again, no need to keep checking other levels... else break; } } //if we have a table of possible objectives which are higher than our current- choose one at random if ($objTableCount > 0 && $objTable[0, objective] != %client.objective) { //choose the new one %index = mFloor(getRandom() * ($objTableCount - 0.01)); //clear the old objective if (%client.objective) { if (%client.objectiveLevel <= 3) { if (%client.objective.group > 0) { if (%client.objective.group.clientLevel[%client.objectiveLevel] == %client) %client.objective.group.clientLevel[%client.objectiveLevel] = ""; } else { if (%client.objective.clientLevel[%client.objectiveLevel] == %client) %client.objective.clientLevel[%client.objectiveLevel] = ""; } } %client.objective.unassignClient(%client); } //assign the new %chooseObjective = $objTable[%index, objective]; %client.objective = %chooseObjective; %client.objectiveWeight = $objTable[%index, weight]; %client.objectiveLevel = $objTable[%index, level]; if (%client.objectiveLevel <= 3) { if (%chooseObjective.group > 0) %chooseObjective.group.clientLevel[%client.objectiveLevel] = %client; else %chooseObjective.clientLevel[%client.objectiveLevel] = %client; } %chooseObjective.assignClient(%client); //see if this objective needs to be acknowledged if (%chooseObjective.shouldAcknowledge && %chooseObjective.issuedByHuman && isObject(%chooseObjective.issuedByClientId)) { //cancel any pending acknowledgements - a bot probably just got bumped off this objective cancel(%chooseObjective.ackSchedule); %chooseObjective.ackSchedule = schedule(5500, %chooseObjective, "AIAcknowledgeObjective", %client, %chooseObjective); } //if we had to bump someone off this objective, %bumpClient = $objTable[%index, bump]; if (%bumpClient > 0) { //unassign the bumped client and choose a new objective AIUnassignClient(%bumpClient); Game.AIChooseGameObjective(%bumpClient); } } //debuging - refresh aidebugq() if required //if ($AIDebugTeam >= 0) // aiDebugQ($AIDebugTeam); } function AIAcknowledgeObjective(%client, %objective) { %objective.shouldAcknowledge = false; //make sure the client is still assigned to this objective if (%client.objective == %objective) serverCmdAcceptTask(%client, %objective.issuedByClientId, -1, %objective.ackDescription); } function AIForceObjective(%client, %newObjective, %useWeight) { //if we found a new objective, release the old, and assign the new if (%newObjective && %newObjective != %client.objective) { //see if someone was already assigned to this objective if (%newObjective.group > 0) %prevClient = newObjective.group.clientLevel[1]; else %prevClient = newObjective.clientLevel[1]; if (%prevClient > 0) AIUnassignClient(%prevClient); //see if we should override the weight if (%useWeight < %newObjective.weightLevel1) %useWeight = %newObjective.weightLevel1; //release the client, and force the assignment AIUnassignClient(%client); %client.objective = %newObjective; %client.objectiveWeight = %useWeight; %client.objectiveLevel = 1; if (%newObjective.group > 0) %newObjective.group.clientLevel[1] = %client; else %newObjective.clientLevel[1] = %client; %newObjective.forceClientId = %client; %newObjective.assignClient(%client); //don't acknowledge anything that's been forced... %newObjective.shouldAcknowledge = false; //now reassign the prev client if (%prevClient) Game.AIChooseGameObjective(%prevClient); } //debuging - refresh aidebugq() if required //if ($AIDebugTeam >= 0) // aiDebugQ($AIDebugTeam); } function AIUnassignClient(%client) { //first, dissolve any link with a human aiReleaseHumanControl(%client.controlByHuman, %client); if (%client.objective) { if (%client.objectiveLevel <= 3) { if (%client.objective.group > 0) { //make sure the clientLevel was actually this client if (%client.objective.group.clientLevel[%client.objectiveLevel] == %client) %client.objective.group.clientLevel[%client.objectiveLevel] = ""; } else { if (%client.objective.clientLevel[%client.objectiveLevel] == %client) %client.objective.clientLevel[%client.objectiveLevel] = ""; } } %client.objective.unassignClient(%client); %client.objective = ""; %client.objectiveWeight = 0; } //debuging - refresh aidebugq() if required //if ($AIDebugTeam >= 0) // aiDebugQ($AIDebugTeam); } function AIClearObjective(%objective) { %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.objective == %objective) AIUnassignClient(%cl); } //debuging - refresh aidebugq() if required //if ($AIDebugTeam >= 0) // aiDebugQ($AIDebugTeam); } //------------------------------ //TASKS AND OBJECTIVES function AIDefendLocation::initFromObjective(%task, %objective, %client) { //initialize the task vars from the objective %task.baseWeight = %client.objectiveWeight; %task.targetObject = %objective.targetObjectId; if (%objective.Location !$= "") %task.location = %objective.location; else %task.location = %objective.targetObjectId.getWorldBoxCenter(); %task.equipment = %objective.equipment; %task.buyEquipmentSet = %objective.buyEquipmentSet; %task.desiredEquipment = %objective.desiredEquipment; %task.issuedByClient = %objective.issuedByClientId; %task.chat = %objective.chat; //initialize other task vars %task.sendMsg = true; %task.sendMsgTime = 0; %task.engageTarget = -1; } function AIDefendLocation::assume(%task, %client) { %task.setWeightFreq(15); %task.setMonitorFreq(15); %client.inPerimeter = false; %client.needEquipment = AINeedEquipment(%task.equipment, %client); //even if we don't *need* equipemnt, see if we should buy some... if (! %client.needEquipment && %task.buyEquipmentSet !$= "") { //see if we could benefit from inventory %needArmor = AIMustUseRegularInvStation(%task.desiredEquipment, %client); %result = AIFindClosestInventory(%client, %needArmor); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (AINeedEquipment(%task.desiredEquipment, %client) && %closestInv > 0) { %result = AIFindClosestEnemy(%client, 200, $AIClientLOSTimeout); %closestEnemy = getWord(%result, 0); %closestEnemydist = getWord(%result, 1); if (%closestEnemy <= 0 || (%closestEnemyDist > %closestDist * 1.5)) %client.needEquipment = true; } } //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); //set a flag to determine if the objective should be re-aquired when the object is destroyed %task.reassignOnDestroyed = false; } function AIDefendLocation::retire(%task, %client) { %task.engageVehicle = -1; %client.setTargetObject(-1); } function AIDefendLocation::weight(%task, %client) { //update the task weight if (%task == %client.objectiveTask) %task.baseWeight = %client.objectiveWeight; %player = %client.player; if (!isObject(%player)) return; %hasMissile = (%player.getInventory("MissileLauncher") > 0) && (%player.getInventory("MissileLauncherAmmo") > 0); //if we're defending with a missile launcher, our first priority is to take out vehicles... //see if we're already attacking a vehicle... if (%task.engageVehicle > 0 && isObject(%task.engageVehicle) && %hasMissile) { //set the weight %task.setWeight(%task.baseWeight); return; } //search for a new vehicle to attack %task.engageVehicle = -1; %losTimeout = $AIClientMinLOSTime + ($AIClientLOSTimeout * %client.getSkillLevel()); %result = AIFindClosestEnemyPilot(%client, 300, %losTimeout); %pilot = getWord(%result, 0); %pilotDist = getWord(%result, 1); //if we've got missiles, and a vehicle to attack... if (%hasMissile && AIClientIsAlive(%pilot)) { %task.engageVehicle = %pilot.vehicleMounted; %client.needEquipment = false; } //otherwise look for a regular enemy to fight... else { %result = AIFindClosestEnemyToLoc(%client, %task.location, 100, %losTimeout); %closestEnemy = getWord(%result, 0); %closestdist = getWord(%result, 1); //see if we found someone if (%closestEnemy > 0) %task.engageTarget = %closestEnemy; else { %task.engageTarget = -1; //see if someone is near me... %result = AIFindClosestEnemy(%client, 100, %losTimeout); %closestEnemy = getWord(%result, 0); %closestdist = getWord(%result, 1); if (%closestEnemy <= 0 || %closestDist > 70) %client.setEngageTarget(-1); } } //set the weight %task.setWeight(%task.baseWeight); } function AIDefendLocation::monitor(%task, %client) { //first, buy the equipment if (%client.needEquipment) { %task.setMonitorFreq(5); if (%task.equipment !$= "") %equipmentList = %task.equipment; else %equipmentList = %task.desiredEquipment; %result = AIBuyInventory(%client, %equipmentList, %task.buyEquipmentSet, %task.buyInvTime); if (%result $= "InProgress") return; else if (%result $= "Finished") { %task.setMonitorFreq(15); %client.needEquipment = false; } else if (%result $= "Failed") { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } } //if we made it past the inventory buying, reset the inv time %task.buyInvTime = getSimTime(); //chat if (%task.sendMsg) { if (%task.sendMsgTime == 0) %task.sendMsgTime = getSimTime(); else if (getSimTime() - %task.sendMsgTime > 7000) { %task.sendMsg = false; if (%client.isAIControlled()) { if (%task.chat !$= "") { %chatMsg = getWord(%task.chat, 0); %chatTemplate = getWord(%task.chat, 1); if (%chatTemplate !$= "") AIMessageThreadTemplate(%chatTemplate, %chatMsg, %client, -1); else AIMessageThread(%task.chat, %client, -1); } else if (%task.targetObject > 0) { %type = %task.targetObject.getDataBlock().getName(); if (%type $= "Flag") AIMessageThreadTemplate("DefendBase", "ChatSelfDefendFlag", %client, -1); else if (%type $= "GeneratorLarge") AIMessageThreadTemplate("DefendBase", "ChatSelfDefendGenerator", %client, -1); else if (%type $= "StationVehicle") AIMessageThreadTemplate("DefendBase", "ChatSelfDefendVehicle", %client, -1); else if (%type $= "SensorLargePulse") AIMessageThreadTemplate("DefendBase", "ChatSelfDefendSensors", %client, -1); else if (%type $= "SensorMediumPulse") AIMessageThreadTemplate("DefendBase", "ChatSelfDefendSensors", %client, -1); else if (%type $= "TurretBaseLarge") AIMessageThreadTemplate("DefendBase", "ChatSelfDefendTurrets", %client, -1); } } } } //if the defend location task has an object, set the "reset" flag if (%task == %client.objectiveTask && isObject(%task.targetObject)) { if (%task.targetObject.getDamageState() !$= "Destroyed") %task.reassignOnDestroyed = true; else { if (%task.reassignOnDestroyed) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); return; } } } //first, check for a vehicle to engage if (%task.engageVehicle > 0 && isObject(%task.engageVehicle)) { %client.stop(); %client.clearStep(); %client.setEngageTarget(-1); %client.setTargetObject(%task.engageVehicle, 300, "Missile"); } else { //clear the target vehicle... %client.setTargetObject(-1); //see if we're engaging a player if (%client.getEngageTarget() > 0) { //too far, or killed the enemy - return home if (%client.getStepStatus() !$= "InProgress" || %distance > 75) { %client.setEngageTarget(-1); %client.stepMove(%task.location, 8.0); } } //else see if we have a target to begin attacking else if (%task.engageTarget > 0) %client.stepEngage(%task.engageTarget); //else move to a random location around where we are defending else if (%client.getStepName() !$= "AIStepIdlePatrol") { %dist = VectorDist(%client.player.getWorldBoxCenter(), %task.location); if (%dist < 10) { //dissolve the human control link and re-evaluate the weight if (%task == %client.objectiveTask) { if (aiHumanHasControl(%task.issuedByClient, %client)) { aiReleaseHumanControl(%client.controlByHuman, %client); //should re-evaluate the current objective weight %inventoryStr = AIFindClosestInventories(%client); %client.objectiveWeight = %client.objective.weight(%client, %client.objectiveLevel, 0, %inventoryStr); } } %client.stepIdle(%task.location); } else %client.stepMove(%task.location, 8.0); } } //see if we're supposed to be engaging anyone... if (!AIClientIsAlive(%client.getEngageTarget()) && AIClientIsAlive(%client.shouldEngage)) %client.setEngageTarget(%client.shouldEngage); } //------------------------------ function AIAttackLocation::initFromObjective(%task, %objective, %client) { //initialize the task vars from the objective %task.baseWeight = %client.objectiveWeight; %task.location = %objective.location; %task.equipment = %objective.equipment; %task.buyEquipmentSet = %objective.buyEquipmentSet; %task.desiredEquipment = %objective.desiredEquipment; %task.issuedByClient = %objective.issuedByClientId; %task.chat = %objective.chat; //initialize other task vars %task.sendMsg = true; %task.sendMsgTime = 0; %task.engageTarget = -1; } function AIAttackLocation::assume(%task, %client) { %task.setWeightFreq(30); %task.setMonitorFreq(30); %client.needEquipment = AINeedEquipment(%task.equipment, %client); //even if we don't *need* equipemnt, see if we should buy some... if (! %client.needEquipment && %task.buyEquipmentSet !$= "") { //see if we could benefit from inventory %needArmor = AIMustUseRegularInvStation(%task.desiredEquipment, %client); %result = AIFindClosestInventory(%client, %needArmor); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (AINeedEquipment(%task.desiredEquipment, %client) && %closestInv > 0) { %result = AIFindClosestEnemyToLoc(%client, %task.location, 50, $AIClientLOSTimeout); %closestEnemy = getWord(%result, 0); if (%closestEnemy <= 0) %client.needEquipment = true; } } //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); %task.snipeLocation = ""; %task.hideLocation = ""; %task.moveToPosition = true; %task.moveToSnipe = false; %task.nextSnipeTime = 0; } function AIAttackLocation::retire(%task, %client) { } function AIAttackLocation::weight(%task, %client) { //update the task weight if (%task == %client.objectiveTask) %task.baseWeight = %client.objectiveWeight; //if we're a sniper, we're going to cheat, and see if there are clients near the attack location %losTimeout = $AIClientMinLOSTime + ($AIClientLOSTimeout * %client.getSkillLevel()); %distToLoc = VectorDist(%client.player.getWorldBoxCenter(), %task.location); if (%client.player.getInventory(SniperRifle) > 0 && %client.player.getInventory(EnergyPack) > 0 && %distToLoc > 60) %result = AIFindClosestEnemyToLoc(%client, %task.location, 50, $AIClientLOSTimeout, true); //otherwise, do the search normally. (cheat ignores LOS)... else %result = AIFindClosestEnemyToLoc(%client, %task.location, 50, %losTimeout, false); %closestEnemy = getWord(%result, 0); %closestdist = getWord(%result, 1); %task.setWeight(%task.baseWeight); //see if we found someone if (%closestEnemy > 0) %task.engageTarget = %closestEnemy; else %task.engageTarget = -1; } function AIAttackLocation::monitor(%task, %client) { //first, buy the equipment if (%client.needEquipment) { %task.setMonitorFreq(5); if (%task.equipment !$= "") %equipmentList = %task.equipment; else %equipmentList = %task.desiredEquipment; %result = AIBuyInventory(%client, %equipmentList, %task.buyEquipmentSet, %task.buyInvTime); if (%result $= "InProgress") return; else if (%result $= "Finished") { %task.setMonitorFreq(30); %client.needEquipment = false; } else if (%result $= "Failed") { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } } //if we made it past the inventory buying, reset the inv time %task.buyInvTime = getSimTime(); //chat if (%task.sendMsg) { if (%task.sendMsgTime == 0) %task.sendMsgTime = getSimTime(); else if (getSimTime() - %task.sendMsgTime > 7000) { %task.sendMsg = false; if (%client.isAIControlled()) { if (%task.chat !$= "") { %chatMsg = getWord(%task.chat, 0); %chatTemplate = getWord(%task.chat, 1); if (%chatTemplate !$= "") AIMessageThreadTemplate(%chatTemplate, %chatMsg, %client, -1); else AIMessageThread(%task.chat, %client, -1); } else AIMessageThreadTemplate("AttackBase", "ChatSelfAttack", %client, -1); } } } //how far are we from the location we're defending %myPos = %client.player.getWorldBoxCenter(); %distance = %client.getPathDistance(%task.location); if (%distance < 0) %distance = 32767; if (%client.player.getInventory(SniperRifle) > 0 && %client.player.getInventory(EnergyPack) > 0) { //first, find an LOS location if (%task.snipeLocation $= "") { %task.snipeLocation = %client.getLOSLocation(%task.location, 150, 250); %task.hideLocation = %client.getHideLocation(%task.location, VectorDist(%task.location, %task.snipeLocation), %task.snipeLocation, 1); %client.stepMove(%task.hideLocation, 4.0); %task.moveToPosition = true; } else { //see if we can acquire a target %energy = %client.player.getEnergyPercent(); %distToSnipe = VectorDist(%task.snipelocation, %client.player.getWorldBoxCenter()); %distToHide = VectorDist(%task.hidelocation, %client.player.getWorldBoxCenter()); //until we're in position, we can move using the AIModeExpress, after that, we only want to walk... if (%task.moveToPosition) { if (%distToHide < 4.0) { //dissolve the human control link if (%task == %client.objectiveTask) { if (aiHumanHasControl(%task.issuedByClient, %client)) { aiReleaseHumanControl(%client.controlByHuman, %client); //should re-evaluate the current objective weight %inventoryStr = AIFindClosestInventories(%client); %client.objectiveWeight = %client.objective.weight(%client, %client.objectiveLevel, 0, %inventoryStr); } } %task.moveToPosition = false; } } else if (%task.moveToSnipe) { if (%energy > 0.75 && %client.getStepStatus() $= "Finished") { %client.stepMove(%task.snipeLocation, 4.0, $AIModeWalk); %client.setEngageTarget(%task.engageTarget); } else if (%energy < 0.4) { %client.setEngageTarget(-1); %client.stepMove(%task.hideLocation, 4.0); %task.nextSnipeTime = getSimTime() + 4000 + (getRandom() * 4000); %task.moveToSnipe = false; } } else if (%energy > 0.5 && %task.engageTarget > 0 && getSimTime() > %task.nextSnipeTime) { %client.stepRangeObject(%task.engageTarget.player.getWorldBoxCenter(), "BasicSniperShot", 150, 250, %task.snipelocation); %client.aimAt(%task.engageTarget.player.getWorldBoxCenter(), 8000); %task.moveToSnipe = true; } } } else { //else see if we have a target to begin attacking if (%client.getEngageTarget() <= 0 && %task.engageTarget > 0) %client.stepEngage(%task.engageTarget); //else move to the location we're defending else if (%client.getEngageTarget() <= 0) { %client.stepMove(%task.location, 8.0); if (VectorDist(%client.player.position, %task.location) < 10) { //dissolve the human control link if (%task == %client.objectiveTask) { if (aiHumanHasControl(%task.issuedByClient, %client)) { aiReleaseHumanControl(%client.controlByHuman, %client); //should re-evaluate the current objective weight %inventoryStr = AIFindClosestInventories(%client); %client.objectiveWeight = %client.objective.weight(%client, %client.objectiveLevel, 0, %inventoryStr); } } } } } //see if we're supposed to be engaging anyone... if (!AIClientIsAlive(%client.getEngageTarget()) && AIClientIsAlive(%client.shouldEngage)) %client.setEngageTarget(%client.shouldEngage); } //------------------------------ function AIAttackPlayer::initFromObjective(%task, %objective, %client) { %task.baseWeight = %client.objectiveWeight; %task.targetClient = %objective.targetClientId; %task.equipment = %objective.equipment; %task.buyEquipmentSet = %objective.buyEquipmentSet; %task.desiredEquipment = %objective.desiredEquipment; %task.issuedByClient = %objective.issuedByClientId; } function AIAttackPlayer::assume(%task, %client) { %task.setWeightFreq(15); %task.setMonitorFreq(15); %client.needEquipment = AINeedEquipment(%task.equipment, %client); if (! %client.needEquipment) %client.stepEngage(%task.targetClient); //even if we don't *need* equipemnt, see if we should buy some... if (! %client.needEquipment && %task.buyEquipmentSet !$= "") { //see if we could benefit from inventory %needArmor = AIMustUseRegularInvStation(%task.desiredEquipment, %client); %result = AIFindClosestInventory(%client, %needArmor); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (AINeedEquipment(%task.desiredEquipment, %client) && %closestInv > 0) { %distToTarg = %client.getPathDistance(%task.targetClient.player.getWorldBoxCenter()); if (%distToTarg < 0 || %distToTarg > 100) %client.needEquipment = true; } } //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); } function AIAttackPlayer::retire(%task, %client) { //dissolve the human control link if (%task == %client.objectiveTask) aiReleaseHumanControl(%client.controlByHuman, %client); } function AIAttackPlayer::weight(%task, %client) { //update the task weight if (%task == %client.objectiveTask) %task.baseWeight = %client.objectiveWeight; %task.setWeight(%task.baseWeight); } function AIAttackPlayer::monitor(%task, %client) { //first, buy the equipment if (%client.needEquipment) { %task.setMonitorFreq(5); if (%task.equipment !$= "") %equipmentList = %task.equipment; else %equipmentList = %task.desiredEquipment; %result = AIBuyInventory(%client, %equipmentList, %task.buyEquipmentSet, %task.buyInvTime); if (%result $= "InProgress") return; else if (%result $= "Finished") { %task.setMonitorFreq(15); %client.needEquipment = false; %client.stepEngage(%task.targetClient); } else if (%result $= "Failed") { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } } //if we made it past the inventory buying, reset the inv time %task.buyInvTime = getSimTime(); //cheap hack for now... make the bot always know where you are... %client.clientDetected(%task.targetClient); //make sure we're still attacking... if (%client.getStepName() !$= "AIStepEngage") %client.stepEngage(%task.targetClient); //make sure we're still attacking the right target %client.setEngageTarget(%task.targetClient); if (%client.getStepStatus() !$= "InProgress" && %task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } } //------------------------------ function AITouchObject::initFromObjective(%task, %objective, %client) { %task.baseWeight = %client.objectiveWeight; %task.targetObject = %objective.targetObjectId; %task.mode = %objective.mode; if (%objective.mode $= "FlagCapture") %task.location = %objective.location; else if(%objective.mode $= "TouchFlipFlop") %task.location = %objective.location; else %task.location = ""; %task.equipment = %objective.equipment; %task.buyEquipmentSet = %objective.buyEquipmentSet; %task.desiredEquipment = %objective.desiredEquipment; %task.issuedByClient = %objective.issuedByClientId; %task.sendMsgTime = 0; if (%task.mode $= "FlagGrab") %task.sendMsg = true; else %task.sendMsg = false; } function AITouchObject::assume(%task, %client) { %task.setWeightFreq(15); %task.setMonitorFreq(15); %task.engageTarget = 0; %client.needEquipment = AINeedEquipment(%task.equipment, %client); //even if we don't *need* equipemnt, see if we should buy some... if (! %client.needEquipment && (%task.mode $= "FlagGrab" || %task.mode $= "TouchFlipFlop") && %task.buyEquipmentSet !$= "") { //see if we could benefit from inventory %needArmor = AIMustUseRegularInvStation(%task.desiredEquipment, %client); %result = AIFindClosestInventory(%client, %needArmor); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (AINeedEquipment(%task.desiredEquipment, %client) && %closestInv > 0) { //find where we are %clientPos = %client.player.getWorldBoxCenter(); %distToObject = %client.getPathDistance(%task.location); if (%distToObject < 0 || %closestDist < %distToObject) %client.needEquipment = true; } } //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); } function AITouchObject::retire(%task, %client) { } function AITouchObject::weight(%task, %client) { //update the task weight if (%task == %client.objectiveTask) %task.baseWeight = %client.objectiveWeight; //see if we can find someone to shoot at... if (%client.getEngageTarget() <= 0) { %losTimeout = $AIClientMinLOSTime + ($AIClientLOSTimeout * %client.getSkillLevel()); %myLocation = %client.player.getWorldBoxCenter(); %result = AIFindClosestEnemy(%client, 40, %losTimeout); %task.engageTarget = getWord(%result, 0); } %task.setWeight(%task.baseWeight); } function AITouchObject::monitor(%task, %client) { //first, buy the equipment if (%client.needEquipment) { %task.setMonitorFreq(5); if (%task.equipment !$= "") %equipmentList = %task.equipment; else %equipmentList = %task.desiredEquipment; %result = AIBuyInventory(%client, %equipmentList, %task.buyEquipmentSet, %task.buyInvTime); if (%result $= "InProgress") return; else if (%result $= "Finished") { %task.setMonitorFreq(15); %client.needEquipment = false; } else if (%result $= "Failed") { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } } //if we made it past the inventory buying, reset the inv time %task.buyInvTime = getSimTime(); //chat if (%task.sendMsg) { if (%task.sendMsgTime == 0) %task.sendMsgTime = getSimTime(); else if (getSimTime() - %task.sendMsgTime > 7000) { %task.sendMsg = false; if (%client.isAIControlled()) { if (%task.mode $= "FlagGrab") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackFlag", %client, -1); } } } //keep updating the position, in case the flag is flying through the air... if (%task.location !$= "") %touchPos = %task.location; else %touchPos = %task.targetObject.getWorldBoxCenter(); //see if we need to engage a new target %engageTarget = %client.getEngageTarget(); if (!AIClientIsAlive(%engageTarget) && %task.engageTarget > 0) %client.setEngageTarget(%task.engageTarget); //else see if we should abandon the engagement else if (AIClientIsAlive(%engageTarget)) { %myPos = %client.player.getWorldBoxCenter(); %testPos = %engageTarget.player.getWorldBoxCenter(); %distance = %client.getPathDistance(%testPos); if (%distance < 0 || %distance > 70) %client.setEngageTarget(-1); } //see if we have completed our objective if (%task == %client.objectiveTask) { %completed = false; switch$ (%task.mode) { case "TouchFlipFlop": if (%task.targetObject.team == %client.team) %completed = true; case "FlagGrab": if (!%task.targetObject.isHome) %completed = true; case "FlagDropped": if ((%task.targetObject.isHome) || (%task.targetObject.carrier !$= "")) %completed = true; case "FlagCapture": if (%task.targetObject.carrier != %client.player) %completed = true; } if (%completed) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); return; } } if (%task.mode $= "FlagCapture") { %homeFlag = $AITeamFlag[%client.team]; //if we're within range of the flag's home position, and the flag isn't home, start idling... if (VectorDist(%client.player.position, %touchPos) < 40 && !%homeFlag.isHome) { if (%client.getStepName() !$= "AIStepIdlePatrol") %client.stepIdle(%touchPos); } else %client.stepMove(%touchPos, 0.25); } else %client.stepMove(%touchPos, 0.25); if (VectorDist(%client.player.position, %touchPos) < 10) { //dissolve the human control link if (%task == %client.objectiveTask) { if (aiHumanHasControl(%task.issuedByClient, %client)) { aiReleaseHumanControl(%client.controlByHuman, %client); //should re-evaluate the current objective weight %inventoryStr = AIFindClosestInventories(%client); %client.objectiveWeight = %client.objective.weight(%client, %client.objectiveLevel, 0, %inventoryStr); } } } //see if we're supposed to be engaging anyone... if (!AIClientIsAlive(%client.getEngageTarget()) && AIClientIsAlive(%client.shouldEngage)) %client.setEngageTarget(%client.shouldEngage); } //------------------------------ function AIEscortPlayer::initFromObjective(%task, %objective, %client) { %task.baseWeight = %client.objectiveWeight; %task.targetClient = %objective.targetClientId; %task.equipment = %objective.equipment; %task.buyEquipmentSet = %objective.buyEquipmentSet; %task.desiredEquipment = %objective.desiredEquipment; %task.issuedByClient = %objective.issuedByClientId; %task.forceClient = %objective.forceClientId; } function AIEscortPlayer::assume(%task, %client) { %task.setWeightFreq(15); %task.setMonitorFreq(15); %task.rangedTarget = false; if (%task == %client.objectiveTask && %client == %task.forceClient && %task.issuedByClient == %task.targetClient) { %client.needEquipment = false; %client.mountVehicle = false; } else { %client.needEquipment = AINeedEquipment(%task.equipment, %client); if (! %client.needEquipment) %client.stepEscort(%task.targetClient); //even if we don't *need* equipemnt, see if we should buy some... if (! %client.needEquipment && %task.buyEquipmentSet !$= "") { //see if we could benefit from inventory %needArmor = AIMustUseRegularInvStation(%task.desiredEquipment, %client); %result = AIFindClosestInventory(%client, %needArmor); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (AINeedEquipment(%task.desiredEquipment, %client) && %closestInv > 0) { //find where we are %clientPos = %client.player.getWorldBoxCenter(); %targPos = %task.targetClient.player.getWorldBoxCenter(); %distToTarg = %client.getPathDistance(%targPos); if (%closestDist < 50 && (%distToTarg < 0 || %distToTarg > 100)) %client.needEquipment = true; } } } //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); } function AIEscortPlayer::retire(%task, %client) { %client.clearStep(); if(%client.player.isMounted()) AIDisembarkVehicle(%client); //clear the target object %client.setTargetObject(-1); } function AIEscortPlayer::weight(%task, %client) { //update the task weight if (%task == %client.objectiveTask) %task.baseWeight = %client.objectiveWeight; //make sure we still have someone to escort if (!AiClientIsAlive(%task.targetClient)) { %task.setWeight(0); return; } //always shoot at the closest person to the client being escorted %targetPos = %task.targetClient.player.getWorldBoxCenter(); %losTimeout = $AIClientMinLOSTime + ($AIClientLOSTimeout * %client.getSkillLevel()); %result = AIFindClosestEnemyToLoc(%client, %targetPos, 50, %losTimeout); %task.engageTarget = getWord(%result, 0); if (!AIClientIsAlive(%task.engageTarget)) { if (AIClientIsAlive(%task.targetClient.lastDamageClient, %losTimeout) && getSimTime() - %task.targetClient.lastDamageTime < %losTimeout) %task.engageTarget = %task.targetClient.lastDamageClient; } if (!AIClientIsAlive(%task.engageTarget)) { %myPos = %client.player.getWorldBoxCenter(); %result = AIFindClosestEnemy(%client, 50, %losTimeout); %task.engageTarget = getWord(%result, 0); } //if both us and the person we're escorting are in a vehicle, set the weight high! if (%task.targetClient.player.isMounted() && %client.player.isMounted()) { %vehicle = %client.vehicleMounted; if (%vehicle > 0 && isObject(%vehicle) && %vehicle.getDamagePercent() < 0.8) %task.setWeight($AIWeightVehicleMountedEscort); else %task.setWeight(%task.baseWeight); } else %task.setWeight(%task.baseWeight); //find out if our escortee is lazing a target... %task.missileTarget = -1; %targetCount = ServerTargetSet.getCount(); for (%i = 0; %i < %targetCount; %i++) { %targ = ServerTargetSet.getObject(%i); if (%targ.sourceObject == %task.targetClient.player) { //find out which item is being targetted... %targPoint = %targ.getTargetPoint(); InitContainerRadiusSearch(%targPoint, 10, $TypeMasks::TurretObjectType | $TypeMasks::StaticShapeObjectType); %task.missileTarget = containerSearchNext(); break; } } } function AIEscortPlayer::monitor(%task, %client) { //make sure we still have someone to escort if (!AiClientIsAlive(%task.targetClient)) { if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } //first, buy the equipment if (%client.needEquipment) { %task.setMonitorFreq(5); if (%task.equipment !$= "") %equipmentList = %task.equipment; else %equipmentList = %task.desiredEquipment; %result = AIBuyInventory(%client, %equipmentList, %task.buyEquipmentSet, %task.buyInvTime); if (%result $= "InProgress") return; else if (%result $= "Finished") { %task.setMonitorFreq(15); %client.needEquipment = false; %client.stepEscort(%task.targetClient); %task.buyInvTime = getSimTime(); } else if (%result $= "Failed") { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } } //see if our target is mounted in a vehicle... if (%task.targetClient.player.isMounted()) { //find the passenger seat the bot will take %vehicle = %task.targetClient.vehicleMounted; %node = findAIEmptySeat(%vehicle, %client.player); //make sure there is an empty seat if (%node < 0 && %client.vehicleMounted != %task.targetClient.vehicleMounted) { if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } //find the passenger seat location... %slotPosition = %vehicle.getSlotTransform(%node); //make sure we're in the correct armor - assault tanks cannot have a heavy... if (%task.targetClient.vehicleMounted.getDataBlock().getName() $= "AssaultVehicle") { //if the bot is in a heavy, break off the escort... if (%client.player.getArmorSize() $= "Heavy") { if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } //throw away any packs that won't fit if (%client.player.getInventory(InventoryDeployable) > 0) %client.player.throwPack(); else if (%client.player.getInventory(TurretIndoorDeployable) > 0) %client.player.throwPack(); else if (%client.player.getInventory(TurretOutdoorDeployable) > 0) %client.player.throwPack(); } if (%client.player.isMounted()) { //make sure it's the same vehicle :) if (%client.vehicleMounted != %vehicle) AIDisembarkVehicle(%client); } else { //mount the vehicle %client.stepMove(%slotPosition, 0.25, $AIModeMountVehicle); } } else { //disembark if we're mounted, but our target isn't (anymore) if (%client.player.isMounted()) AIDisembarkVehicle(%client); } //see if we're supposed to be mortaring/missiling something... %hasMortar = (%client.player.getInventory("Mortar") > 0) && (%client.player.getInventory("MortarAmmo") > 0); %hasMissile = (%client.player.getInventory("MissileLauncher") > 0) && (%client.player.getInventory("MissileLauncherAmmo") > 0); if (!isObject(%task.engageTarget) && isobject(%task.missileTarget) && %task.missileTarget.getDamageState() !$= "Destroyed" && (%hasMortar || %hasMissile)) { if (%task.rangedTarget) { %client.stop(); %client.clearStep(); %client.setEngageTarget(-1); if (%hasMortar) %client.setTargetObject(%task.missileTarget, 250, "Mortar"); else %client.setTargetObject(%task.missileTarget, 500, "MissileNoLock"); } else if (%client.getStepName() !$= "AIStepRangeObject") { if (%hasMortar) %client.stepRangeObject(%task.missileTarget, "MortarShot", 100, 200); else %client.stepRangeObject(%task.missileTarget, "BasicTargeter", 50, 500); } else if (%client.getStepStatus() $= "Finished") %task.rangedTarget = true; } else { %task.rangedTarget = false; %client.setTargetObject(-1); if (%client.getStepName() !$= "AIStepEscort") %client.stepEscort(%task.targetClient); } //make sure we're still shooting... %client.setEngageTarget(%task.engageTarget); //see if we're supposed to be engaging anyone... if (!AIClientIsAlive(%client.getEngageTarget()) && AIClientIsAlive(%client.shouldEngage)) %client.setEngageTarget(%client.shouldEngage); } //------------------------------ function AIAttackObject::initFromObjective(%task, %objective, %client) { %task.baseWeight = %client.objectiveWeight; %task.targetObject = %objective.targetObjectId; %task.equipment = %objective.equipment; %task.buyEquipmentSet = %objective.buyEquipmentSet; %task.desiredEquipment = %objective.desiredEquipment; %task.issuedByClient = %objective.issuedByClientId; //initialize other task vars %task.sendMsg = true; %task.sendMsgTime = 0; } function AIAttackObject::assume(%task, %client) { %task.setWeightFreq(15); %task.setMonitorFreq(5); %client.needEquipment = AINeedEquipment(%task.equipment, %client); //even if we don't *need* equipemnt, see if we should buy some... if (! %client.needEquipment && %task.buyEquipmentSet !$= "") { //see if we could benefit from inventory %needArmor = AIMustUseRegularInvStation(%task.desiredEquipment, %client); %result = AIFindClosestInventory(%client, %needArmor); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (AINeedEquipment(%task.desiredEquipment, %client) && %closestInv > 0) { //find where we are %clientPos = %client.player.getWorldBoxCenter(); %objPos = %task.targetObject.getWorldBoxCenter(); %distToObject = %client.getPathDistance(%objPos); if (%distToObject < 0 || %closestDist < %distToObject) %client.needEquipment = true; } } //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); } function AIAttackObject::retire(%task, %client) { %client.setTargetObject(-1); } function AIAttackObject::weight(%task, %client) { //update the task weight if (%task == %client.objectiveTask) %task.baseWeight = %client.objectiveWeight; //let the monitor decide when to stop attacking %task.setWeight(%task.baseWeight); } function AIAttackObject::monitor(%task, %client) { //first, buy the equipment if (%client.needEquipment) { %task.setMonitorFreq(5); if (%task.equipment !$= "") %equipmentList = %task.equipment; else %equipmentList = %task.desiredEquipment; %result = AIBuyInventory(%client, %equipmentList, %task.buyEquipmentSet, %task.buyInvTime); if (%result $= "InProgress") return; else if (%result $= "Finished") { %task.setMonitorFreq(15); %client.needEquipment = false; } else if (%result $= "Failed") { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } } //if we made it past the inventory buying, reset the inv time %task.buyInvTime = getSimTime(); //chat if (%task.sendMsg) { if (%task.sendMsgTime == 0) %task.sendMsgTime = getSimTime(); else if (getSimTime() - %task.sendMsgTime > 7000) { %task.sendMsg = false; if (%client.isAIControlled()) { if (%task.chat !$= "") { %chatMsg = getWord(%task.chat, 0); %chatTemplate = getWord(%task.chat, 1); if (%chatTemplate !$= "") AIMessageThreadTemplate(%chatTemplate, %chatMsg, %client, -1); else AIMessageThread(%task.chat, %client, -1); } else if (%task.targetObject > 0) { %type = %task.targetObject.getDataBlock().getName(); if (%type $= "GeneratorLarge") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackGenerator", %client, -1); else if (%type $= "SensorLargePulse") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackSensors", %client, -1); else if (%type $= "SensorMediumPulse") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackSensors", %client, -1); else if (%type $= "TurretBaseLarge") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackTurrets", %client, -1); else if (%type $= "StationVehicle") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackVehicle", %client, -1); } } } } //set the target object if (isObject(%task.targetObject) && %task.targetObject.getDamageState() !$= "Destroyed") { %client.setTargetObject(%task.targetObject, 40, "Destroy"); //move towards the object until we're within range if (! %client.targetInRange()) %client.stepMove(%task.targetObject.getWorldBoxCenter(), 8.0); else { //dissolve the human control link if (%task == %client.objectiveTask) aiReleaseHumanControl(%client.controlByHuman, %client); %client.stop(); } } else { %client.setTargetObject(-1); %client.stop(); //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } } } //------------------------------ function AIRepairObject::initFromObjective(%task, %objective, %client) { %task.baseWeight = %client.objectiveWeight; %task.targetObject = %objective.targetObjectId; //need to force this objective to only require a repair pack //%task.equipment = %objective.equipment; %task.equipment = "RepairPack"; %task.buyEquipmentSet = %objective.buyEquipmentSet; %task.desiredEquipment = %objective.desiredEquipment; %task.issuedByClient = %objective.issuedByClientId; %task.deployed = %objective.deployed; if (%task.deployed) { %task.location = %objective.position; %task.deployDirection = MatrixMulVector("0 0 0 " @ getWords(%objective.getTransform(), 3, 6), "0 1 0"); %task.deployDirection = VectorNormalize(%task.deployDirection); } } function AIRepairObject::assume(%task, %client) { %task.setWeightFreq(15); %task.setMonitorFreq(15); %client.needEquipment = AINeedEquipment(%task.equipment, %client); //clear the target object, and range it %client.setTargetObject(-1); if (! %client.needEquipment) { if (%task.deployed) { %task.repairLocation = VectorAdd(%task.location,VectorScale(%task.deployDirection, -4.0)); %client.stepMove(%task.repairLocation, 0.25); } else %client.stepRangeObject(%task.targetObject, "DefaultRepairBeam", 3, 8); } //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); %task.needToRangeTime = 0; %task.pickupRepairPack = -1; %task.usingInv = false; //set a tag to help the repairPack.cs script fudge acquiring a target %client.repairObject = %task.targetObject; } function AIRepairObject::retire(%task, %client) { %client.setTargetObject(-1); %client.repairObject = -1; } function AIRepairObject::weight(%task, %client) { //update the task weight if (%task == %client.objectiveTask) %task.baseWeight = %client.objectiveWeight; //let the monitor decide when to stop repairing %task.setWeight(%task.baseWeight); } function AIRepairObject::monitor(%task, %client) { //first, buy the equipment if (%client.needEquipment) { %task.setMonitorFreq(5); //first, see if we still need a repair pack if (%client.player.getInventory(RepairPack) > 0) { %client.needEquipment = false; %task.setMonitorFreq(15); //if this is to repair a deployed object, walk to the deploy point... if (%task.deployed) { %task.repairLocation = VectorAdd(%task.location,VectorScale(%task.deployDirection, -4.0)); %client.stepMove(%task.repairLocation, 0.25); } //otherwise, we'll need to range it... else %client.stepRangeObject(%task.targetObject, "DefaultRepairBeam", 3, 8); } else { // check to see if there's a repair pack nearby %closestRepairPack = -1; %closestRepairDist = 32767; //search the AIItemSet for a repair pack (someone might have dropped one...) %itemCount = $AIItemSet.getCount(); for (%i = 0; %i < %itemCount; %i++) { %item = $AIItemSet.getObject(%i); if (%item.getDataBlock().getName() $= "RepairPack" && !%item.isHidden()) { %dist = %client.getPathDistance(%item.getWorldBoxCenter()); if (%dist > 0 && %dist < %closestRepairDist) { %closestRepairPack = %item; %closestRepairDist = %dist; } } } //choose whether we're picking up the closest pack, or buying from an inv station... if ((isObject(%closestRepairPack) && %closestRepairPack != %task.pickupRepairPack) || (%task.buyInvTime != %client.buyInvTime)) { %task.pickupRepairPack = %closestRepairPack; //initialize the inv buying %task.buyInvTime = getSimTime(); AIBuyInventory(%client, "RepairPack", %task.buyEquipmentSet, %task.buyInvTime); //now decide which is closer if (isObject(%closestRepairPack)) { if (isObject(%client.invToUse)) { %dist = %client.getPathDistance(%item.position); if (%dist > %closestRepairDist) %task.usingInv = true; else %task.usingInv = false; } else %task.usingInv = false; } else %task.usingInv = true; } //now see if we found a closer repair pack if (!%task.usingInv) { %client.stepMove(%task.pickupRepairPack.position, 0.25); %distToPack = %client.getPathDistance(%task.pickupRepairPack.position); if (%distToPack < 10 && %client.player.getMountedImage($BackpackSlot) > 0) %client.player.throwPack(); //and we're finished until we actually have a repair pack... return; } else { %result = AIBuyInventory(%client, "RepairPack", %task.buyEquipmentSet, %task.buyInvTime); if (%result $= "InProgress") return; else if (%result $= "Finished") { %client.needEquipment = false; %task.setMonitorFreq(15); //if this is to repair a deployed object, walk to the deploy point... if (%task.deployed) { %task.repairLocation = VectorAdd(%task.location,VectorScale(%task.deployDirection, -4.0)); %client.stepMove(%task.repairLocation, 0.25); } //otherwise, we'll need to range it... else %client.stepRangeObject(%task.targetObject, "DefaultRepairBeam", 3, 8); } else if (%result $= "Failed") { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } } } } //if we made it past the inventory buying, reset the inv time %task.buyInvTime = getSimTime(); //chat if (%task.sendMsg) { if (%task.sendMsgTime == 0) %task.sendMsgTime = getSimTime(); else if (getSimTime() - %task.sendMsgTime > 7000) { %task.sendMsg = false; if (%client.isAIControlled()) { if (%task.chat !$= "") { %chatMsg = getWord(%task.chat, 0); %chatTemplate = getWord(%task.chat, 1); if (%chatTemplate !$= "") AIMessageThreadTemplate(%chatTemplate, %chatMsg, %client, -1); else AIMessageThread(%task.chat, %client, -1); } else if (%task.targetObject > 0) { %type = %task.targetObject.getDataBlock().getName(); if (%type $= "GeneratorLarge") AIMessageThreadTemplate("RepairBase", "ChatSelfRepairGenerator", %client, -1); else if (%type $= "StationVehicle") AIMessageThreadTemplate("RepairBase", "ChatSelfRepairVehicle", %client, -1); else if (%type $= "SensorLargePulse") AIMessageThreadTemplate("RepairBase", "ChatSelfRepairSensors", %client, -1); else if (%type $= "SensorMediumPulse") AIMessageThreadTemplate("RepairBase", "ChatSelfRepairSensors", %client, -1); else if (%type $= "TurretBaseLarge") AIMessageThreadTemplate("RepairBase", "ChatSelfRepairTurrets", %client, -1); } } } } //set the target object if (%task.targetObject.getDamagePercent() > 0) { //make sure we still have equipment %client.needEquipment = AINeedEquipment(%task.equipment, %client); if (%client.needEquipment) { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); return; } } if (%task.deployed) { //see if we're within range of the deploy location %clLoc = %client.player.position; %distance = VectorDist(%clLoc, %task.repairLocation); %dist2D = VectorDist(%client.player.position, getWords(%task.repairLocation, 0, 1) SPC getWord(%client.player.position, 2)); //set the aim when we get near the target... this will be overwritten when we're actually trying to deploy if (%distance < 10 && %dist2D < 10) %client.aimAt(%task.location, 1000); //see if we're at the deploy location if ((%client.pathDistRemaining(20) > %distance + 0.25) || %dist2D > 0.3) { %client.setTargetObject(-1); %client.stepMove(%task.repairLocation, 0.25); } else { %client.stop(); %client.setTargetObject(%task.targetObject, 8.0, "Repair"); } } else { %currentTime = getSimTime(); if (%currentTime > %task.needToRangeTime) { //force a rangeObject every 10 seconds... %task.needToRangeTime = %currentTime + 6000; %client.setTargetObject(-1); %client.stepRangeObject(%task.targetObject, "DefaultRepairBeam", 3, 8); } //if we've ranged the object, start repairing, else unset the object else if (%client.getStepStatus() $= "Finished") { //dissolve the human control link if (%task == %client.objectiveTask) aiReleaseHumanControl(%client.controlByHuman, %client); %client.setTargetObject(%task.targetObject, 8.0, "Repair"); } else %client.setTargetObject(-1); } } else { %client.setTargetObject(-1); //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } } } //------------------------------ function AILazeObject::initFromObjective(%task, %objective, %client) { %task.baseWeight = %client.objectiveWeight; %task.targetObject = %objective.targetObjectId; %task.equipment = %objective.equipment; %task.buyEquipmentSet = %objective.buyEquipmentSet; %task.desiredEquipment = %objective.desiredEquipment; %task.issuedByClient = %objective.issuedByClientId; %task.msgAck = true; %task.msgFire = true; } function AILazeObject::assume(%task, %client) { %task.setWeightFreq(30); %task.setMonitorFreq(30); %client.needEquipment = AINeedEquipment(%task.equipment, %client); //clear the target object, and range it %client.setTargetObject(-1); if (! %client.needEquipment) %client.stepRangeObject(%task.targetObject, "BasicTargeter", 80, 300, %task.issuedByClient.player.getWorldBoxCenter()); //set up some task vars %task.celebrate = false; %task.waitTimerMS = 0; //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); } function AILazeObject::retire(%task, %client) { %client.setTargetObject(-1); } function AILazeObject::weight(%task, %client) { //update the task weight if (%task == %client.objectiveTask) %task.baseWeight = %client.objectiveWeight; //let the monitor decide when to stop lazing %task.setWeight(%task.baseWeight); } function AILazeObject::monitor(%task, %client) { //first, buy the equipment if (%client.needEquipment) { %task.setMonitorFreq(5); if (%task.equipment !$= "") %equipmentList = %task.equipment; else %equipmentList = %task.desiredEquipment; %result = AIBuyInventory(%client, %equipmentList, %task.buyEquipmentSet, %task.buyInvTime); if (%result $= "InProgress") return; else if (%result $= "Finished") { %task.setMonitorFreq(30); %client.needEquipment = false; %client.stepRangeObject(%task.targetObject, "BasicTargeter", 80, 300); } else if (%result $= "Failed") { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } } //if we made it past the inventory buying, reset the inv time %task.buyInvTime = getSimTime(); //set the target object if (isObject(%task.targetObject) && %task.targetObject.getDamageState() !$= "Destroyed") { //make sure we still have equipment %client.needEquipment = AINeedEquipment(%task.equipment, %client); if (%client.needEquipment) { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); return; } } //look to see if anyone else is also targetting... %foundTarget = false; %numTargets = ServerTargetSet.getCount(); for (%i = 0; %i < %numTargets; %i++) { %targ = ServerTargetSet.getObject(%i); if (%targ.sourceObject != %client.player) { %targDist = VectorDist(%targ.getTargetPoint(), %task.targetObject.getWorldBoxCenter()); if (%targDist < 10) { %foundTarget = true; break; } } } if (%foundTarget) { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) AIUnassignClient(%client); } else if (%client.getStepStatus() $= "Finished") { //dissolve the human control link if (%task == %client.objectiveTask) aiReleaseHumanControl(%client.controlByHuman, %client); %client.setTargetObject(%task.targetObject, 300, "Laze"); %task.celebrate = true; %task.waitTimerMS = 0; //make sure we only say "fire..." once if (%task.msgFire) { AIMessageThread("FireOnTarget", %client, -1); %task.msgFire = false; } } else { %client.aimAt(%task.targetObject.getWorldBoxCenter(), 1000); %client.setTargetObject(-1); } } else { %client.setTargetObject(-1); if (%task.celebrate) { if (%task.waitTimerMS == 0) { //add in a "woohoo"! :) //choose the animation range %minCel = 3; %maxCel = 8; //pick a random sound if (getRandom() > 0.25) %sound = "gbl.awesome"; else if (getRandom() > 0.5) %sound = "gbl.thanks"; else if (getRandom() > 0.75) %sound = "gbl.nice"; else %sound = "gbl.rock"; %randTime = mFloor(getRandom() * 500) + 1; schedule(%randTime, %client, "AIPlayAnimSound", %client, %task.targetObject.getWorldBoxCenter(), %sound, %minCel, %maxCel, 0); //set the timer %task.waitTimerMS = getSimTime(); } //else see if the celebration period is over else if (getSimTime() - %task.waitTimerMS > 3000) %task.celebrate = false; } else { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } } } } //------------------------------ function AIMortarObject::initFromObjective(%task, %objective, %client) { %task.baseWeight = %client.objectiveWeight; %task.targetObject = %objective.targetObjectId; %task.equipment = %objective.equipment; %task.buyEquipmentSet = %objective.buyEquipmentSet; %task.desiredEquipment = %objective.desiredEquipment; %task.issuedByClient = %objective.issuedByClientId; %task.mode = %task.targetObject.getDataBlock().getName(); %task.sendMsgTime = 0; %task.sendMsg = true; } function AIMortarObject::assume(%task, %client) { %task.setWeightFreq(30); %task.setMonitorFreq(30); %task.state = moveToRange; %task.waitForTargetter = true; %task.celebrate = false; %task.waitTimerMS = 0; %task.targetAcquired = false; %task.sayAcquired = true; %client.needEquipment = AINeedEquipment(%task.equipment, %client); //even if we don't *need* equipemnt, see if we should buy some... if (! %client.needEquipment && %task.buyEquipmentSet !$= "") { //see if we could benefit from inventory %needArmor = AIMustUseRegularInvStation(%task.desiredEquipment, %client); %result = AIFindClosestInventory(%client, %needArmor); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); if (AINeedEquipment(%task.desiredEquipment, %client) && %closestInv > 0) { //find where we are %clientPos = %client.player.getWorldBoxCenter(); %objPos = %task.targetObject.getWorldBoxCenter(); %distToObject = %client.getPathDistance(%objPos); if (%distToObject < 0 || %closestDist < %distToObject) %client.needEquipment = true; } } //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); } function AIMortarObject::retire(%task, %client) { %client.setTargetObject(-1); //remove the associated lazeObjective if (%task.targetterObjective) { AIClearObjective(%task.targetterObjective); %task.targetterObjective.delete(); %task.targetterObjective = ""; } } function AIMortarObject::weight(%task, %client) { //update the task weight if (%task == %client.objectiveTask) %task.baseWeight = %client.objectiveWeight; //let the monitor decide when to stop mortaring %task.setWeight(%task.baseWeight); } function AIMortarObject::monitor(%task, %client) { //first, buy the equipment if (%client.needEquipment) { %task.setMonitorFreq(5); if (%task.equipment !$= "") %equipmentList = %task.equipment; else %equipmentList = %task.desiredEquipment; %result = AIBuyInventory(%client, %equipmentList, %task.buyEquipmentSet, %task.buyInvTime); if (%result $= "InProgress") return; else if (%result $= "Finished") { %task.setMonitorFreq(30); %client.needEquipment = false; } else if (%result $= "Failed") { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } } //if we made it past the inventory buying, reset the inv time %task.buyInvTime = getSimTime(); //chat if (%task.sendMsg) { if (%task.sendMsgTime == 0) %task.sendMsgTime = getSimTime(); else if (getSimTime() - %task.sendMsgTime > 7000) { %task.sendMsg = false; if (%client.isAIControlled()) { if (%task.chat !$= "") { %chatMsg = getWord(%task.chat, 0); %chatTemplate = getWord(%task.chat, 1); if (%chatTemplate !$= "") AIMessageThreadTemplate(%chatTemplate, %chatMsg, %client, -1); else AIMessageThread(%task.chat, %client, -1); } else if (%task.targetObject > 0) { %type = %task.targetObject.getDataBlock().getName(); if (%type $= "GeneratorLarge") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackGenerator", %client, -1); else if (%type $= "SensorLargePulse") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackSensors", %client, -1); else if (%type $= "SensorMediumPulse") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackSensors", %client, -1); else if (%type $= "TurretBaseLarge") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackTurrets", %client, -1); else if (%type $= "StationVehicle") AIMessageThreadTemplate("AttackBase", "ChatSelfAttackVehicle", %client, -1); } } } } //make sure we still have something to destroy if (isObject(%task.targetObject) && %task.targetObject.getDamageState() !$= "Destroyed") { %clientPos = %client.player.getWorldBoxCenter(); %targetPos = %task.targetObject.getWorldBoxCenter(); %distance = %client.getPathDistance(%targetPos); if (%distance < 0) %distance = 32767; //make sure we still have equipment %client.needEquipment = AINeedEquipment(%task.equipment, %client); if (%client.needEquipment) { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); return; } } //next move to within 220 else if (%distance > 220) { %client.setTargetObject(-1); %client.stepMove(%task.targetObject.getWorldBoxCenter(), 15); } //now start ask for someone to laze the target, and start a 20 sec timer else if (%task.waitForTargetter) { //see if we've started the timer if (%task.waitTimerMS == 0) { //range the object %client.stepRangeObject(%task.targetObject, "MortarShot", 100, 200); //now ask for a targeter... %targetType = %task.targetObject.getDataBlock().getName(); if (%targetType $= "TurretBaseLarge") AIMessageThread("ChatCmdTargetTurret", %client, -1); else if (%targetType $= "SensorLargePulse") AIMessageThread("ChatCmdTargetSensors", %client, -1); else if (%targetType $= "SensorMediumPulse") AIMessageThread("ChatCmdTargetSensors", %client, -1); else AIMessageThread("ChatNeedTarget", %client, -1); %task.waitTimerMS = getSimTime(); //create the objective if (! %task.targetterObjective) { %task.targetterObjective = new AIObjective(AIOLazeObject) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $AIWeightLazeObject[1]; weightLevel2 = $AIWeightLazeObject[2]; description = "Laze the " @ %task.targetObject.getName(); targetObjectId = %task.targetObject; issuedByClientId = %client; offense = true; equipment = "TargetingLaser"; }; MissionCleanup.add(%task.targetterObjective); $ObjectiveQ[%client.team].add(%task.targetterObjective); } %task.targetterObjective.lastLazedTime = 0; //remove the escort (want a targetter instead) if (%client.escort) { AIClearObjective(%client.escort); %client.escort.delete(); %client.escort = ""; } } else { %elapsedTime = getSimTime() - %task.waitTimerMS; if (%task.targetterObjective.group > 0) %targetter = %task.targetterObjective.group.clientLevel[1]; else %targetter = %task.targetterObjective.clientLevel[1]; //see if we can find a target near our objective %task.targetAcquired = false; %numTargets = ServerTargetSet.getCount(); for (%i = 0; %i < %numTargets; %i++) { %targ = ServerTargetSet.getObject(%i); %targDist = VectorDist(%targ.getTargetPoint(), %task.targetObject.getWorldBoxCenter()); if (%targDist < 20) { %task.targetAcquired = true; break; } } if (%task.targetAcquired) { %task.waitForTargetter = false; %task.waitTimerMS = 0; %task.celebrate = true; %task.sayAcquired = false; AIMessageThread("ChatTargetAcquired", %client, -1); } //else see if we've run out of time else if ((! %targetter || ! %targetter.isAIControlled()) && %elapsedTime > 20000) { %task.waitForTargetter = false; %task.waitTimerMS = 0; %task.celebrate = true; } } } //now we should finally be attacking with or without a targetter //eventually, the target will be destroyed, or we'll run out of ammo... else { //dissolve the human control link if (%task == %client.objectiveTask) aiReleaseHumanControl(%client.controlByHuman, %client); //see if we didn't acquired a spotter along the way if (%task.targetterObjective.group > 0) %targetter = %task.targetterObjective.group.clientLevel[1]; else %targetter = %task.targetterObjective.clientLevel[1]; if (! %task.targetAcquired && AIClientIsAlive(%targetter) && %targetter.isAIControlled()) { %client.setTargetObject(-1); %task.waitForTargetter = true; } else { //see if we can find a target near our objective if (! %task.targetAcquired) { %numTargets = ServerTargetSet.getCount(); for (%i = 0; %i < %numTargets; %i++) { %targ = ServerTargetSet.getObject(%i); %targDist = VectorDist(%targ.getTargetPoint(), %task.targetObject.getWorldBoxCenter()); if (%targDist < 20) { %task.targetAcquired = true; break; } } //see if we found a target (must be by a human) if (%task.targetAcquired && %task.sayAcquired) { %task.sayAcquired = false; AIMessageThread("ChatTargetAcquired", %client, -1); } } //set the target object, and keep attacking it if (%client.getStepStatus() $= "Finished") %client.setTargetObject(%task.targetObject, 250, "Mortar"); else %client.setTargetObject(-1); } } } //the target must have been destroyed :) else { //dissolve the human control link if (%task == %client.objectiveTask) aiReleaseHumanControl(%client.controlByHuman, %client); %client.setTargetObject(-1); %client.clearStep(); %client.stop(); if (%task.celebrate) { if (%task.waitTimerMS == 0) { //client animation "woohoo"! :) //choose the animation range %minCel = 3; %maxCel = 8; //pick a random sound if (getRandom() > 0.25) %sound = "gbl.awesome"; else if (getRandom() > 0.5) %sound = "gbl.thanks"; else if (getRandom() > 0.75) %sound = "gbl.nice"; else %sound = "gbl.rock"; %randTime = mFloor(getRandom() * 500) + 1; schedule(%randTime, %client, "AIPlayAnimSound", %client, %task.targetObject.getWorldBoxCenter(), %sound, %minCel, %maxCel, 0); //team message AIMessageThread("ChatEnemyTurretsDestroyed", %client, -1); //set the timer %task.waitTimerMS = getSimTime(); } //else see if the celebration period is over else if (getSimTime() - %task.waitTimerMS > 3000) %task.celebrate = false; } else { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } } } } //------------------------------ function AIDeployEquipment::initFromObjective(%task, %objective, %client) { //initialize the task vars from the objective %task.baseWeight = %client.objectiveWeight; %task.location = %objective.location; %task.equipment = %objective.equipment; %task.buyEquipmentSet = %objective.buyEquipmentSet; %task.desiredEquipment = %objective.desiredEquipment; %task.issuedByClient = %objective.issuedByClientId; %task.chat = %objective.chat; //initialize other task vars %task.sendMsg = true; %task.sendMsgTime = 0; //use the Y-axis of the rotation as the desired direction of deployement, //and calculate a walk to point 3 m behind the deploy point. %task.deployDirection = MatrixMulVector("0 0 0 " @ getWords(%objective.getTransform(), 3, 6), "0 1 0"); %task.deployDirection = VectorNormalize(%task.deployDirection); } function AIDeployEquipment::assume(%task, %client) { %task.setWeightFreq(15); %task.setMonitorFreq(15); %client.needEquipment = AINeedEquipment(%task.equipment, %client); //mark the current time for the buy inventory state machine %task.buyInvTime = getSimTime(); %task.passes = 0; %task.deployAttempts = 0; %task.checkObstructed = false; %task.waitMove = 0; } function AIDeployEquipment::retire(%task, %client) { } function AIDeployEquipment::weight(%task, %client) { //update the task weight if (%task == %client.objectiveTask) %task.baseWeight = %client.objectiveWeight; %task.setWeight(%task.baseWeight); } function findTurretDeployPoint(%client, %location, %attempt) { %player = %client.player; if (!isObject(%player)) return "0 0 0"; %feetPos = posFromTransform(%player.getTransform()); %temp = VectorSub(%location, %feetPos); %temp2 = getWord(%temp, 0) @ " " @ getWord(%temp, 1) @ " 0"; %facingVector = VectorNormalize(%temp2); %aimPoint = VectorAdd(%feetPos, %facingVector); //assume that there will be 10 attempts %height = getWord(%location, 2) + 1.0 - (0.2 * %attempt); %aimAt = getWord(%aimPoint, 0) @ " " @ getWord(%aimPoint, 1) @ " " @ %height; return %aimAt; } function AIDeployEquipment::monitor(%task, %client) { //first, buy the equipment if (%client.needEquipment) { %task.setMonitorFreq(5); if (%task.equipment !$= "") %equipmentList = %task.equipment; else %equipmentList = %task.desiredEquipment; %result = AIBuyInventory(%client, %equipmentList, %task.buyEquipmentSet, %task.buyInvTime); if (%result $= "InProgress") return; else if (%result $= "Finished") { %task.setMonitorFreq(30); %client.needEquipment = false; //if we made it past the inventory buying, reset the inv time %task.buyInvTime = getSimTime(); } else if (%result $= "Failed") { //if this task is the objective task, choose a new objective if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } return; } } //chat if (%task.sendMsg) { if (%task.sendMsgTime == 0) %task.sendMsgTime = getSimTime(); else if (getSimTime() - %task.sendMsgTime > 7000) { %task.sendMsg = false; if (%client.isAIControlled()) { if (%task.chat !$= "") { %chatMsg = getWord(%task.chat, 0); %chatTemplate = getWord(%task.chat, 1); if (%chatTemplate !$= "") AIMessageThreadTemplate(%chatTemplate, %chatMsg, %client, -1); else AIMessageThread(%task.chat, %client, -1); } } } } //see if we're supposed to be engaging anyone... if (AIClientIsAlive(%client.shouldEngage)) { %hasLOS = %client.hasLOSToClient(%client.shouldEngage); %losTime = %client.getClientLOSTime(%client.shouldEngage); if (%hasLOS || %losTime < 1000) %client.setEngageTarget(%client.shouldEngage); else %client.setEngageTarget(-1); } else %client.setEngageTarget(-1); //calculate the deployFromLocation %factor = -1 * (3 - (%task.passes * 0.5)); %task.deployFromLocation = VectorAdd(%task.location,VectorScale(%task.deployDirection, %factor)); //see if we're within range of the deploy location %clLoc = %client.player.position; %distance = VectorDist(%clLoc, %task.deployFromLocation); %dist2D = VectorDist(%client.player.position, getWords(%task.deployFromLocation, 0, 1) SPC getWord(%client.player.position, 2)); //set the aim when we get near the target... this will be overwritten when we're actually trying to deploy if (%distance < 10 && %dist2D < 10) %client.aimAt(%task.location, 1000); if ((%client.pathDistRemaining(20) > %distance + 0.25) || %dist2D > 0.5) { %task.deployAttempts = 0; %task.checkObstructed = false; %task.waitMove = 0; %client.stepMove(%task.deployFromLocation, 0.25); %task.setMonitorFreq(15); return; } if (%task.deployAttempts < 10 && %task.passes < 5 && !AIClientIsAlive(%client.getEngageTarget())) { //dissolve the human control link if (%task == %client.objectiveTask) aiReleaseHumanControl(%client.controlByHuman, %client); %task.setMonitorFreq(3); %client.stop(); if (%task.deployAttempts == 0) %deployPoint = %task.location; else %deployPoint = findTurretDeployPoint(%client, %task.location, %task.deployAttempts); if(%deployPoint !$= "") { // we have possible point %task.deployAttempts++; %client.aimAt(%deployPoint, 2000); //try to deploy the backpack %client.deployPack = true; %client.lastDeployedObject = -1; %client.player.use(Backpack); // check if pack deployed if (isObject(%client.lastDeployedObject)) { //see if there's a "repairObject" objective for the newly deployed thingy... if (%task == %client.objectiveTask) { %deployedObject = %client.lastDeployedObject; //search the current objective group and search for a "repair Object" task... %objective = %client.objective; //delete any previously associated "AIORepairObject" objective if (isObject(%objective.repairObjective)) { AIClearObjective(%objective.repairObjective); %objective.repairObjective.delete(); %objective.repairObjective = ""; } //add the repair objective %objective.repairObjective = new AIObjective(AIORepairObject) { dataBlock = "AIObjectiveMarker"; weightLevel1 = %objective.weightLevel1 - 60; weightLevel2 = 0; description = "Repair the " @ %deployedObject.getDataBlock().getName(); targetObjectId = %deployedObject; issuedByClientId = %client; offense = false; defense = true; equipment = "RepairPack"; }; %objective.repairObjective.deployed = true; %objective.repairObjective.setTransform(%objective.getTransform()); %objective.repairObjective.group = %objective.group; MissionCleanup.add(%objective.repairObjective); $ObjectiveQ[%client.team].add(%objective.repairObjective); //finally, unassign the client so he'll go do something else... AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } //finished return; } } } else if (!%task.checkObstructed) { %task.checkObstructed = true; //see if anything is in our way InitContainerRadiusSearch(%task.location, 4, $TypeMasks::MoveableObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::PlayerObjectType); %objSrch = containerSearchNext(); if (%objSrch == %client.player) %objSrch = containerSearchNext(); if (%objSrch) AIMessageThread("ChatMove", %client, -1); } else if (%task.waitMove < 5 && %task.passes < 5) { %task.waitMove++; //try another pass at deploying if (%task.waitMove == 5) { %task.waitMove = 0; %task.passes++; %task.deployAttempts = 0; //see if we're *right* underneath the deploy point %deployDist2D = VectorDist(getWords(%client.player.position, 0, 1) @ "0", getWords(%task.location, 0, 1) @ "0"); if (%deployDist2D < 0.25) { %client.pressjump(); %client.deployPack = true; %client.player.use(Backpack); // check if pack deployed if(%client.player.getMountedImage($BackpackSlot) == 0) { //don't add a "repairObject" objective for ceiling turrets if (%task == %client.objectiveTask) { AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } } } } } else { //find a new assignment - and remove this one from the Queue if (%task == %client.objectiveTask) { error(%client SPC "from team" SPC %client.team SPC "is invalidating objective:" SPC %client.objective SPC "UNABLE TO DEPLOY EQUIPMENT"); %client.objective.isInvalid = true; AIUnassignClient(%client); Game.AIChooseGameObjective(%client); } } } //------------------------------ //AI Objective functions function ClientHasAffinity(%objective, %client) { if (%objective.offense && %client.offense) return true; else if (%objective.defense && !%client.offense) return true; else return false; } function ClientHasRequiredEquipment(%objective, %client) { return true; } function AIODefault::weight(%objective, %client, %level, %inventoryStr) { //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client)) return 0; //set the base weight switch (%level) { case 1: %weight = %objective.weightLevel1; case 2: %weight = %objective.weightLevel2; case 3: %weight = %objective.weightLevel3; default: %weight = %objective.weightLevel4; } //check Affinity if (ClientHasAffinity(%objective, %client)) %weight += 40; //if the objective doesn't require any equipment, it automatically get's the +100... if (%objective.equipment $= "" && %objective.desiredEquipment $= "") %weight += 100; else { //check equipment requirement %needEquipment = AINeedEquipment(%objective.equipment, %client); //check Required equipment if (%objective.equipment !$= "" && !%needEquipment) %weight += 100; //figure out the percentage of desired equipment the bot has else if (%objective.desiredEquipment !$= "") { %count = getWordCount(%objective.desiredEquipment); %itemCount = 0; for (%i = 0; %i < %count; %i++) { %item = getWord(%objective.desiredEquipment, %i); if (!AINeedEquipment(%item, %client)) %itemCount++; } //add to the weight %weight += mFloor((%itemCount / %count) * 75); } } //find the distance to target if (%objective.targetClientId !$= "" || %objective.targetObjectId !$= "") { if (AIClientIsAlive(%objective.targetClientId)) { %targetPos = %objective.targetClientId.player.getWorldBoxCenter(); } else if (VectorDist(%objective.location, "0 0 0") > 1) %targetPos = %objective.location; else { if(%objective.targetObjectId > 0) %targetPos = %objective.targetObjectId.getWorldBoxCenter(); } } //make sure the destination is accessible %distance = %client.getPathDistance(%targetPos); if (%distance < 0) return 0; %closestInvIsRemote = (getWordCount(%inventoryStr) == 4); %closestInv = getWord(%inventoryStr, 0); %closestDist = getWord(%inventoryStr, 1); %closestRemoteInv = getWord(%inventoryStr, 2); %closestRemoteDist = getWord(%inventoryStr, 3); //if we need equipment, the distance is from the client, to an inv, then to the target if (%needEquipment) { //if we need a regular inventory station, and one doesn't exist, exit if (!isObject(%closestInv) && %needArmor) return 0; //find the closest inv based on whether we require armor (from a regular inv station) if (!%closestInvIsRemote) { %needArmor = false; %weightDist = %closestDist; %weightInv = %closestInv; } else { %needArmor = AIMustUseRegularInvStation(%objective.equipment, %client); if (%needArmor) { %weightDist = %closestDist; %weightInv = %closestInv; } else { %weightDist = %closestRemoteDist; %weightInv = %closestRemoteInv; } } //if we don't need armor, and there's no inventory station, see if the equipment we need //is something we can pick up off the ground (likely this would be a repair pack...) if (%weightDist >= 32767) { %itemType = getWord(%objective.equipment, 0); %found = false; %itemCount = $AIItemSet.getCount(); for (%i = 0; %i < %itemCount; %i++) { %item = $AIItemSet.getObject(%i); if (%item.getDataBlock().getName() $= %itemType && !%item.isHidden()) { %weightDist = %client.getPathDistance(%item.getWorldBoxCenter()); if (%weightDist > 0) { %weightInv = %item; //set the var so the distance function will work... %found = true; break; } } } if (! %found) return 0; } //now find the distance used for weighting the objective %tempDist = AIGetPathDistance(%targetPos, %weightInv.getWorldBoxCenter()); if (%tempDist < 0) %tempDist = 32767; %distance = %weightDist + %tempDist; } //see if we're within 200 m if (%distance < 200) %weight += 30; //see if we're within 90 m if (%distance < 90) %weight += 30; //see if we're within 45 m if (%distance < 45) %weight += 30; //see if we're within 20 m if (%distance < 20) %weight += 30; //final return, since we've made it through all the rest return %weight; } function AIODefault::QuickWeight(%objective, %client, %level, %minWeight) { //can't do a quick weight when re-evaluating a client's current objective if (%client.objective == %objective) return true; //do a quick check to disqualify this objective if it can't meet the minimum weight switch (%level) { case 1: %testWeight = %objective.weightLevel1; case 2: %testWeight = %objective.weightLevel2; case 3: %testWeight = %objective.weightLevel3; default: %testWeight = %objective.weightLevel4; } if (%testWeight + 260 < %minWeight) return false; else return true; } //------------------------------ function AIODefendLocation::weight(%this, %client, %level, %minWeight, %inventoryStr) { // if were playing CnH, check who owns this if (%this.targetObjectId > 0) { if (!isObject(%this.targetObjectId) || %this.targetObjectId.isHidden() || %this.targetObjectId.team != %client.team) return 0; } //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client)) return 0; //do a quick check to disqualify this objective if it can't meet the minimum weight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) { if (%this.targetObjectId > 0 && %this.issuedByClientId == %client.controlByHuman) { if ($AIWeightHumanIssuedCommand < %minWeight) return 0; } else return 0; } %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); //if the object has been destroyed, reduce the weight if (%this.targetObjectId > 0) { //see if we were forced on the objective if (%this.issuedByClientId == %client.controlByHuman && %weight < $AIWeightHumanIssuedCommand) %weight = $AIWeightHumanIssuedCommand; //else see if the object has been destroyed else if (!isObject(%this.targetObjectId) || %this.targetObjectId.getDamageState() $= "Destroyed") %weight -= 320; } return %weight; } function AIODefendLocation::assignClient(%this, %client) { %client.objectiveTask = %client.addTask(AIDefendLocation); %client.objectiveTask.initFromObjective(%this, %client); } function AIODefendLocation::unassignClient(%this, %client) { %client.removeTask(%client.objectiveTask); %client.objectiveTask = ""; } //------------------------------ function AIOAttackLocation::weight(%this, %client, %level, %minWeight, %inventoryStr) { //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client)) return 0; //now, if this bot is linked to a human who has issued this command, up the weight if (%this.issuedByClientId == %client.controlByHuman) { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) { if ($AIWeightHumanIssuedCommand < %minWeight) return 0; else %weight = $AIWeightHumanIssuedCommand; } else { // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); if (%weight < $AIWeightHumanIssuedCommand) %weight = $AIWeightHumanIssuedCommand; } } else { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) return 0; // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); } return %weight; } function AIOAttackLocation::assignClient(%this, %client) { %client.objectiveTask = %client.addTask(AIAttackLocation); %client.objectiveTask.initFromObjective(%this, %client); } function AIOAttackLocation::unassignClient(%this, %client) { %client.removeTask(%client.objectiveTask); %client.objectiveTask = ""; } //------------------------------ function AIOTouchObject::weight(%this, %client, %level, %minWeight, %inventoryStr) { //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client)) return 0; if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) return 0; switch$ (%this.mode) { case "TouchFlipFlop": if(%this.targetObjectId.team == %client.team || %this.targetObjectId.isHidden()) return 0; else return AIODefault::weight(%this, %client, %level, %inventoryStr); case "FlagGrab": if (! %this.targetObjectId.isHome) return 0; else return AIODefault::weight(%this, %client, %level, %inventoryStr); case "FlagDropped": if ((%this.targetObjectId.isHome) || (%this.targetObjectId.carrier !$= "")) return 0; else return AIODefault::weight(%this, %client, %level, %inventoryStr); case "FlagCapture": if (%this.targetObjectId.carrier != %client.player) return 0; else { //find our home flag location %homeTeam = %client.team; %homeFlag = $AITeamFlag[%homeTeam]; %this.location = %homeFlag.originalPosition; return AIODefault::weight(%this, %client, %level, %inventoryStr); } } return 0; } function AIOTouchObject::assignClient(%this, %client) { %client.objectiveTask = %client.addTask(AITouchObject); %client.objectiveTask.initFromObjective(%this, %client); //create an AIOEscortPlayer objective to help out, if required if (%this.mode $= "FlagGrab") { %client.escort = new AIObjective(AIOEscortPlayer) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $AIWeightEscortOffense[1]; weightLevel2 = $AIWeightEscortOffense[2]; description = "Escort " @ getTaggedString(%client.name); targetClientId = %client; offense = true; desiredEquipment = "EnergyPack"; buyEquipmentSet = "LightEnergyELF"; }; MissionCleanup.add(%client.escort); $ObjectiveQ[%client.team].add(%client.escort); } else if (%this.mode $= "FlagCapture") { %client.escort = new AIObjective(AIOEscortPlayer) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $AIWeightEscortCapper[1]; weightLevel2 = $AIWeightEscortCapper[2]; description = "Escort " @ getTaggedString(%client.name); targetClientId = %client; offense = true; desiredEquipment = "EnergyPack"; buyEquipmentSet = "LightEnergyDefault"; }; MissionCleanup.add(%client.escort); $ObjectiveQ[%client.team].add(%client.escort); } } function AIOTouchObject::unassignClient(%this, %client) { //kill the escort objective if (%client.escort) { AIClearObjective(%client.escort); %client.escort.delete(); %client.escort = ""; } %client.removeTask(%client.objectiveTask); %client.objectiveTask = ""; } //------------------------------ function AIOAttackPlayer::weight(%this, %client, %level, %minWeight, %inventoryStr) { //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client)) return 0; //if we're attacking the flag carrier, make sure a flag carrier exists if (%this.mode $= "FlagCarrier") { if (%this.targetObjectId.carrier $= "") return 0; else %this.targetClientId = %this.targetObjectId.carrier.client; } //now, if this bot is linked to a human who has issued this command, up the weight if (%this.issuedByClientId == %client.controlByHuman) { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) { if ($AIWeightHumanIssuedCommand < %minWeight) return 0; else %weight = $AIWeightHumanIssuedCommand; } else { // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); if (%weight < $AIWeightHumanIssuedCommand) %weight = $AIWeightHumanIssuedCommand; } } else { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) return 0; // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); } return %weight; } function AIOAttackPlayer::assignClient(%this, %client) { %client.objectiveTask = %client.addTask(AIAttackPlayer); %client.objectiveTask.initFromObjective(%this, %client); } function AIOAttackPlayer::unassignClient(%this, %client) { %client.removeTask(%client.objectiveTask); %client.objectiveTask = ""; } //------------------------------ function AIOEscortPlayer::weight(%this, %client, %level, %minWeight, %inventoryStr) { //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client) || ! AIClientIsAlive(%this.targetClientId)) return 0; //can't escort yourself if (%client == %this.targetClientId) return 0; //make sure the class is appropriate if (%this.forceClientId <= 0 && %this.issuedByClientId != %client.controlByHuman) { %targArmor = %this.targetClientId.player.getArmorSize(); %myArmor = %client.player.getArmorSize(); if ((%targArmor $= "Light" && %myArmor !$= "Light") || %myArmor $= "Heavy") return 0; } //can't bump a forced client from level 1 if (%this.forceClientId > 0 && %this.forceClientId != %client && %level == 1) return 0; //if this bot is linked to a human who has issued this command, up the weight if (%this.issuedByClientId == %client.controlByHuman) { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) { if ($AIWeightHumanIssuedEscort < %minWeight) return 0; else %weight = $AIWeightHumanIssuedEscort; } else { // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); if (%weight < $AIWeightHumanIssuedEscort) %weight = $AIWeightHumanIssuedEscort; } } else { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) return 0; // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); } return %weight; } function AIOEscortPlayer::assignClient(%this, %client) { %client.objectiveTask = %client.addTask(AIEscortPlayer); %client.objectiveTask.initFromObjective(%this, %client); } function AIOEscortPlayer::unassignClient(%this, %client) { %client.removeTask(%client.objectiveTask); %client.objectiveTask = ""; } //------------------------------ function AIOAttackObject::weight(%this, %client, %level, %minWeight, %inventoryStr) { // if were playing CnH, check who owns this if (!isObject(%this.targetObjectId) || %this.targetObjectId.isHidden() || %this.targetObjectId.team == %client.team) return 0; //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client)) return 0; //no need to attack if the object is already destroyed if (!isObject(%this.targetObjectId) || %this.targetObjectId.getDamageState() $= "Destroyed") return 0; else { //if this bot is linked to a human who has issued this command, up the weight if (%this.issuedByClientId == %client.controlByHuman) { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) { if ($AIWeightHumanIssuedCommand < %minWeight) return 0; else %weight = $AIWeightHumanIssuedCommand; } else { // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); if (%weight < $AIWeightHumanIssuedCommand) %weight = $AIWeightHumanIssuedCommand; } } else { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) return 0; // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); } return %weight; } } function AIOAttackObject::assignClient(%this, %client) { %client.objectiveTask = %client.addTask(AIAttackObject); %client.objectiveTask.initFromObjective(%this, %client); } function AIOAttackObject::unassignClient(%this, %client) { %client.removeTask(%client.objectiveTask); %client.objectiveTask = ""; } //------------------------------ function AIORepairObject::weight(%this, %client, %level, %minWeight, %inventoryStr) { // if were playing CnH, check who owns this if (!isObject(%this.targetObjectId) || %this.targetObjectId.isHidden() || %this.targetObjectId.team != %client.team) return 0; //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client)) return 0; //no need to repair if the object isn't in need if (!isObject(%this.targetObjectId) || %this.targetObjectId.getDamagePercent() <= 0) return 0; else { //if this bot is linked to a human who has issued this command, up the weight if (%this.issuedByClientId == %client.controlByHuman) { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) { if ($AIWeightHumanIssuedCommand < %minWeight) return 0; else %weight = $AIWeightHumanIssuedCommand; } else { // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); if (%weight < $AIWeightHumanIssuedCommand) %weight = $AIWeightHumanIssuedCommand; } } else { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) return 0; // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); } return %weight; } } function AIORepairObject::assignClient(%this, %client) { %client.objectiveTask = %client.addTask(AIRepairObject); %client.objectiveTask.initFromObjective(%this, %client); } function AIORepairObject::unassignClient(%this, %client) { %client.removeTask(%client.objectiveTask); %client.objectiveTask = ""; } //------------------------------ function AIOLazeObject::weight(%this, %client, %level, %minWeight, %inventoryStr) { //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client)) return 0; //see if it's already being lazed %numTargets = ServerTargetSet.getCount(); for (%i = 0; %i < %numTargets; %i++) { %targ = ServerTargetSet.getObject(%i); if (%targ.sourceObject != %client.player) { %targDist = VectorDist(%targ.getTargetPoint(), %this.targetObjectId.getWorldBoxCenter()); if (%targDist < 10) { %this.lastLazedTime = getSimTime(); %this.lastLazedClient = %targ.sourceObject.client; break; } } } //no need to laze if the object is already destroyed if (!isObject(%this.targetObjectId) || %this.targetObjectId.getDamageState() $= "Destroyed") return 0; else if (%this.targetObjectId.isHidden() || %this.targetObjectId.team != %client.team) return 0; else if (getSimTime() - %this.lastLazedTime <= 15000 && %this.lastLazedClient != %client) return 0; else { //set the base weight switch (%level) { case 1: %weight = %this.weightLevel1; case 2: %weight = %this.weightLevel2; case 3: %weight = %this.weightLevel3; default: %weight = %this.weightLevel4; } //check Affinity if (ClientHasAffinity(%this, %client)) %weight += 100; //for now, do not deviate from the current assignment to laze a target, if you don't //already have a targeting laser. %needEquipment = AINeedEquipment(%this.equipment, %client); if (!%needEquipment) %weight += 100; else if (!aiHumanHasControl(%client.controlByHuman, %client)) return 0; //see if this client is close to the issuing client if (%this.issuedByClientId > 0) { if (! AIClientIsAlive(%this.issuedByClientId)) return 0; %distance = %client.getPathDistance(%this.issuedByClientId.player.getWorldBoxCenter()); if (%distance < 0) %distance = 32767; //see if we're within 200 m if (%distance < 200) %weight += 30; //see if we're within 90 m if (%distance < 90) %weight += 30; //see if we're within 45 m if (%distance < 45) %weight += 30; } //now, if this bot is linked to a human who has issued this command, up the weight if (%this.issuedByClientId == %client.controlByHuman && %weight < $AIWeightHumanIssuedCommand) %weight = $AIWeightHumanIssuedCommand; return %weight; } } function AIOLazeObject::assignClient(%this, %client) { %client.objectiveTask = %client.addTask(AILazeObject); %client.objectiveTask.initFromObjective(%this, %client); } function AIOLazeObject::unassignClient(%this, %client) { %client.removeTask(%client.objectiveTask); %client.objectiveTask = ""; } //------------------------------ function AIOMortarObject::weight(%this, %client, %level, %minWeight, %inventoryStr) { // if were playing CnH, check who owns this if (!isObject(%this.targetObjectId) || %this.targetObjectId.isHidden() || %this.targetObjectId.team == %client.team) return 0; //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client)) return 0; //no need to attack if the object is already destroyed if (%this.targetObjectId.getDamageState() $= "Destroyed") return 0; else { //if this bot is linked to a human who has issued this command, up the weight if (%this.issuedByClientId == %client.controlByHuman) { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) { if ($AIWeightHumanIssuedCommand < %minWeight) return 0; else %weight = $AIWeightHumanIssuedCommand; } else { // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); if (%weight < $AIWeightHumanIssuedCommand) %weight = $AIWeightHumanIssuedCommand; } } else { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) return 0; // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); } return %weight; } } function AIOMortarObject::assignClient(%this, %client) { %client.objectiveTask = %client.addTask(AIMortarObject); %client.objectiveTask.initFromObjective(%this, %client); //create the escort objective (require a targeting laser in this case...) %client.escort = new AIObjective(AIOEscortPlayer) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $AIWeightEscortOffense[1]; weightLevel2 = $AIWeightEscortOffense[2]; description = "Escort " @ getTaggedString(%client.name); targetClientId = %client; offense = true; equipment = "TargetingLaser"; buyEquipmentSet = "LightEnergyDefault"; }; MissionCleanup.add(%client.escort); $ObjectiveQ[%client.team].add(%client.escort); } function AIOMortarObject::unassignClient(%this, %client) { //kill the escort objective if (%client.escort) { AIClearObjective(%client.escort); %client.escort.delete(); %client.escort = ""; } %client.removeTask(%client.objectiveTask); %client.objectiveTask = ""; } //------------------------------------------------------------------------ //If the function ShapeBaseImageData::testInvalidDeployConditions() changes at all, those changes need to be reflected here function AIODeployEquipment::weight(%this, %client, %level, %minWeight, %inventoryStr) { //make sure the player is still alive!!!!! if (! AIClientIsAlive(%client)) return 0; //make sure the deploy objective is valid if (%this.isInvalid) return 0; //first, make sure we haven't deployed too many... if (%this.equipment $= "TurretOutdoorDeployable" || %this.equipment $= "TurretIndoorDeployable") %maxAllowed = countTurretsAllowed(%this.equipment); else %maxAllowed = $TeamDeployableMax[%this.equipment]; if ($TeamDeployedCount[%client.team, %this.equipment] >= %maxAllowed) return 0; //now make sure there are no other items in the way... InitContainerRadiusSearch(%this.location, $MinDeployableDistance, $TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::TSStaticShapeObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::ItemObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::TurretObjectType); %objSearch = containerSearchNext(); //make sure we're not invalidating the deploy location with the client's own player object if (%objSearch == %client.player) %objSearch = containerSearchNext(); //did we find an object which would block deploying the equipment? if (isObject(%objSearch)) return 0; //now run individual checks based on the equipment type... if (%this.equipment $= "TurretIndoorDeployable") { //check if there's another turret close to the deploy location InitContainerRadiusSearch(%this.location, $TurretIndoorSpaceRadius, $TypeMasks::StaticShapeObjectType); %found = containerSearchNext(); if (isObject(%found)) { %foundName = %found.getDataBlock().getName(); if ((%foundName $= TurretDeployedFloorIndoor) || (%foundName $= "TurretDeployedWallIndoor") || (%foundName $= "TurretDeployedCeilingIndoor") || (%foundName $= "TurretDeployedOutdoor")) return 0; } //now see if there are too many turrets in the area... %highestDensity = 0; InitContainerRadiusSearch(%this.location, $TurretIndoorSphereRadius, $TypeMasks::StaticShapeObjectType); %found = containerSearchNext(); while (isObject(%found)) { %foundName = %found.getDataBlock().getName(); if ((%foundName $= "TurretDeployedFloorIndoor") || (%foundName $= "TurretDeployedWallIndoor") || (%foundName $= "TurretDeployedCeilingIndoor") || (%foundName $= "TurretDeployedOutdoor")) { //found one %numTurretsNearby++; %nearbyDensity = testNearbyDensity(%found, $TurretIndoorSphereRadius); if (%nearbyDensity > %highestDensity) %highestDensity = %nearbyDensity; } %found = containerSearchNext(); } if (%numTurretsNearby > %highestDensity) %highestDensity = %numTurretsNearby; //now see if the area is already saturated if (%highestDensity > $TurretIndoorMaxPerSphere) return 0; } else if (%this.equipment $= "TurretOutdoorDeployable") { //check if there's another turret close to the deploy location InitContainerRadiusSearch(%this.location, $TurretOutdoorSpaceRadius, $TypeMasks::StaticShapeObjectType); %found = containerSearchNext(); if (isObject(%found)) { %foundName = %found.getDataBlock().getName(); if ((%foundName $= "TurretDeployedFloorIndoor") || (%foundName $= "TurretDeployedWallIndoor") || (%foundName $= "TurretDeployedCeilingIndoor") || (%foundName $= "TurretDeployedOutdoor")) return 0; } //now see if there are too many turrets in the area... %highestDensity = 0; InitContainerRadiusSearch(%this.location, $TurretOutdoorSphereRadius, $TypeMasks::StaticShapeObjectType); %found = containerSearchNext(); while (isObject(%found)) { %foundName = %found.getDataBlock().getName(); if ((%foundName $= "TurretDeployedFloorIndoor") || (%foundName $= "TurretDeployedWallIndoor") || (%foundName $= "TurretDeployedCeilingIndoor") || (%foundName $= "TurretDeployedOutdoor")) { //found one %numTurretsNearby++; %nearbyDensity = testNearbyDensity(%found, $TurretOutdoorSphereRadius); if (%nearbyDensity > %highestDensity) %highestDensity = %nearbyDensity; } %found = containerSearchNext(); } if (%numTurretsNearby > %highestDensity) %highestDensity = %numTurretsNearby; //now see if the area is already saturated if (%highestDensity > $TurretOutdoorMaxPerSphere) return 0; } //check equipment requirement %needEquipment = AINeedEquipment(%this.equipment, %client); //if don't need equipment, see if we've past the "point of no return", and should continue regardless if (! %needEquipment) { %needArmor = AIMustUseRegularInvStation(%this.equipment, %client); %result = AIFindClosestInventory(%client, %needArmor); %closestInv = getWord(%result, 0); %closestDist = getWord(%result, 1); //if we're too far from the inv to go back, or we're too close to the deploy location, force continue if (%closestDist > 50 && VectorDist(%client.player.getWorldBoxCenter(), %task.location) < 50) { %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); if (%weight < $AIWeightContinueDeploying) %weight = $AIWeightContinueDeploying; return %weight; } } //if this bot is linked to a human who has issued this command, up the weight if (%this.issuedByClientId == %client.controlByHuman) { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) { if ($AIWeightHumanIssuedCommand < %minWeight) return 0; else %weight = $AIWeightHumanIssuedCommand; } else { // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); if (%weight < $AIWeightHumanIssuedCommand) %weight = $AIWeightHumanIssuedCommand; } } else { //make sure we have the potential to reach the minWeight if (!AIODefault::QuickWeight(%this, %client, %level, %minWeight)) return 0; // calculate the default... %weight = AIODefault::weight(%this, %client, %level, %inventoryStr); } return %weight; } function AIODeployEquipment::assignClient(%this, %client) { %client.objectiveTask = %client.addTask(AIDeployEquipment); %task = %client.objectiveTask; %task.initFromObjective(%this, %client); } function AIODeployEquipment::unassignClient(%this, %client) { %client.removeTask(%client.objectiveTask); %client.objectiveTask = ""; } //------------------------------------------------------------------------ PK !(X\??scripts/aiRabbit.cs//----------------------------------------------- // AI functions for Rabbit //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- function RabbitGame::onAIRespawn(%game, %client) { //add the default task if (! %client.defaultTasksAdded) { %client.defaultTasksAdded = true; %client.addTask(AIPickupItemTask); %client.addTask(AIUseInventoryTask); %client.addTask(AITauntCorpseTask); %client.rabbitTask = %client.addTask(AIRabbitTask); } //set the inv flag %client.spawnUseInv = true; } //--------------------------------------------------------------------------- function RabbitGame::AIInit(%game) { //call the default AIInit() function AIInit(); } //--------------------------------------------------------------------------- //AIRabbitTask functions //--------------------------------------------------------------------------- function AIRabbitTask::init(%task, %client) { } //--------------------------------------------------------------------------- function AIRabbitTask::assume(%task, %client) { %task.setWeightFreq(20); %task.setMonitorFreq(20); %task.findLocation = true; } function AIRabbitTask::retire(%task, %client) { } //--------------------------------------------------------------------------- function AIRabbitTask::weight(%task, %client) { %player = %client.player; //see if I have the flag if ($AIRabbitFlag.carrier == %player) %task.setWeight($AIRabbitWeightDefault); //else see if I'm close to the flag else { if (isObject($AIRabbitFlag.carrier)) %distToFlag = %client.getPathDistance($AIRabbitFlag.carrier.getWorldBoxCenter()); else %distToFlag = %client.getPathDistance($AIRabbitFlag.getWorldBoxCenter()); //if the flag is pretty close, or the inv station is quite far... if (%distToFlag > 0 && %distToFlag < 50) %task.setWeight($AIRabbitWeightDefault); else %task.setWeight($AIRabbitWeightNeedInv); //see if the spawnUseInv flag should be reset if (%client.spawnUseInv) { if (!isObject($AIRabbitFlag.carrier)) { //see if there are any bots closer to a dropped flag %found = false; for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl != %client && %cl.isAIControlled() && isObject(%cl.player)) { %dist = VectorDist(%cl.player.position, $AIRabbitFlag.position); if (%dist < %distToFlag) { %found = true; break; } } } //reset the spawnUseInv flag if we're the closest if (!%found) %client.spawnUsInv = false; } } } } //--------------------------------------------------------------------------- function AIRabbitTask::monitor(%task, %client) { %player = %client.player; //if we have the flag - run if ($AIRabbitFlag.carrier == %player) { if (%task.findLocation) { %damage = %player.getDamagePercent(); if (%damage > 0.3) { //search for a health kit %closestHealth = AIFindSafeItem(%client, "Health"); if (%closestHealth > 0) { %task.seekLocation = %closestHealth.getWorldBoxCenter(); %foundItemLocation = true; } } else if (!%foundItemLocation && AIEngageOutOfAmmo(%client)) { //search for a Ammo or a weapon... %closestItem = AIFindSafeItem(%client, "Ammo"); if (%closestItem > 0) { %task.seekLocation = %closestItem.getWorldBoxCenter(); %foundItemLocation = true; } } //now see if we don't really have good equipment... else if (!%foundItemLocation && AIEngageWeaponRating(%client) < 20) { //search for any useful item %closestItem = AIFindSafeItem(%client, "Any"); if (%closestItem > 0) { %task.seekLocation = %closestItem.getWorldBoxCenter(); %foundItemLocation = true; } } //else, search for any spot on the map that isn't covered with enemies... else { //try 10 times %task.seekLocation = %player.position; %farthestLocation = ""; %farthestDist = 0; %occupiedLocation = ""; for (%i = 0; %i < 10; %i++) { %testLocation = Game.pickPlayerSpawn(%client, true); if (%testLocation == -1) break; %dist = %client.getPathDistance(%testLocation); if (%dist < 0 || %dist > %farthestDist) { //see if it's unoccupied... %result = AIFindClosestEnemyToLoc(%client, %task.location, 50, $AIClientLOSTimeout, true); %closestEnemy = getWord(%result, 0); %closestdist = getWord(%result, 1); if (!AIClientIsAlive(%closestEnemy)) %farthestLocation = %testLocation; else %occupiedLocation = %testLocation; } } if (%farthestLocation $= "") %task.seekLocation = %occupiedLocation; else %task.seekLocation = %farthestLocation; } //set the flag and go there %task.findLocation = false; %client.stepMove(%task.seekLocation, 8); } else { //keep going there... %client.stepMove(%task.seekLocation, 8); //see if we've arrived %distToDest = %client.getPathDistance(%task.seekLocation); if (%distToDest > 0 && %distToDest < 10) { %task.findLocation = true; } } //don't forget to shoot back at whoever shot me last if (%client.lastDamageClient != %client) %client.setEngageTarget(%client.lastDamageClient); } //else if someone else has the flag - shoot them else if (isObject($AIRabbitFlag.carrier)) { %client.clientDetected($AIRabbitFlag.carrier.client); %client.stepEngage($AIRabbitFlag.carrier.client); } //else the flag has been dropped else { %client.stepMove($AIRabbitFlag.position, 0.25); %client.setEngageTarget(-1); } } //--------------------------------------------------------------------------- // AIRabbit utility functions //--------------------------------------------------------------------------- function air() { exec("scripts/aiRabbit.cs"); } PK !({` scripts/aiSiege.cs// // aiSiege.cs // function SiegeGame::onAIRespawn(%game, %client) { //add the default tasks if (! %client.defaultTasksAdded) { %client.defaultTasksAdded = true; %client.addTask(AIEngageTask); %client.addTask(AIPickupItemTask); %client.addTask(AITauntCorpseTask); %client.addTask(AIEngageTurretTask); %client.addtask(AIDetectMineTask); } } function SiegeGame::AIInit(%game) { for (%i = 0; %i <= %game.numTeams; %i++) { if (!isObject($ObjectiveQ[%i])) { $ObjectiveQ[%i] = new AIObjectiveQ(); MissionCleanup.add($ObjectiveQ[%i]); } error("team " @ %i @ " objectives load..."); $ObjectiveQ[%i].clear(); AIInitObjectives(%i, %game); } //call the default AIInit() function AIInit(); } function SiegeGame::AIChooseGameObjective(%game, %client) { //the objectives on team1 are all offense objectives, team2 has the defensive ones.. if (%client.team == %game.offenseTeam) AIChooseObjective(%client, $ObjectiveQ[1]); else AIChooseObjective(%client, $ObjectiveQ[2]); } function SiegeGame::AIHalfTime(%game) { //clear all the bots, and clean up all the sets, objective qs, etc... AIMissionEnd(); //reset everything from scratch %game.aiInit(); //respawn all the bots for (%i = 0; %i < ClientGroup.getCount(); %i++) { %cl = ClientGroup.getObject(%i); if (%cl.isAIControlled()) onAIRespawn(%cl); } } function SiegeGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clAttacker && %clAttacker != %clVictim && %clAttacker.team == %clVictim.team) { schedule(250, %clVictim, "AIPlayAnimSound", %clVictim, %clAttacker.player.getWorldBoxCenter(), "wrn.watchit", -1, -1, 0); //clear the "lastDamageClient" tag so we don't turn on teammates... unless it's uberbob! %clVictim.lastDamageClient = -1; } } function SiegeGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clVictim.team != %clAttacker.team) DefaultGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement); } function SiegeGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim && !%clVictim.isAIControlled()) { // The Bot is only a little sorry: if ( getRandom() > 0.9 ) AIMessageThread("ChatSorry", %clAttacker, %clVictim); } } PK !(̵  scripts/aiTeamHunters.csexec("scripts/aiHunters.cs"); //---------------------------------------------------------------------------// //AI functions for playing TEAM HUNTERS function TeamHuntersGame::AIInit(%game) { for (%i = 1; %i <= %game.numTeams; %i++) { if (!isObject($ObjectiveQ[%i])) { $ObjectiveQ[%i] = new AIObjectiveQ(); MissionCleanup.add($ObjectiveQ[%i]); } error("team " @ %i @ " objectives load..."); $ObjectiveQ[%i].clear(); AIInitObjectives(%i, %game); } //call the default AIInit() function AIInit(); } function TeamHuntersGame::onAIRespawn(%game, %client) { HuntersGame::onAIRespawn(%game, %client); } function TeamHuntersGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clAttacker && %clAttacker != %clVictim && %clAttacker.team == %clVictim.team) { schedule(250, %clVictim, "AIPlayAnimSound", %clVictim, %clAttacker.player.getWorldBoxCenter(), "wrn.watchit", -1, -1, 0); //clear the "lastDamageClient" tag so we don't turn on teammates... unless it's uberbob! %clVictim.lastDamageClient = -1; } } function TeamHuntersGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement) { if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim && !%clVictim.isAIControlled()) { // The Bot is only a little sorry: if ( getRandom() > 0.9 ) AIMessageThread("ChatSorry", %clAttacker, %clVictim); } } PK !(RZZscripts/badlandsPropMap.cs//-------------------------------------- Desert interior texture property mapping addMaterialMapping("badlands/bd_ichute01", "environment: special/chuteTexture 0.25"); addMaterialMapping("badlands/bd_ichute02a", "environment: special/chuteTexture 0.25"); //"Color: red green blue startAlpha endAlpha" //Soft sound = 0 //Hard sound = 1 //Metal sound = 2 //Snow sound = 3 addMaterialMapping("terrain/BadLands.DirtBumpy", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/BadLands.DirtChipped", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/BadLands.DirtYellow", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/BadLands.DirtYellowCracked", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/BadLands.RockBrown", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/BadLands.RockChipped", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/BadLands.RockCracked", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0"); PK !(WKscripts/bioderm_heavy.csdatablock TSShapeConstructor(BiodermHeavyDts) { baseShape = "bioderm_heavy.dts"; sequence0 = "bioderm_heavy_root.dsq root"; sequence1 = "bioderm_heavy_forward.dsq run"; sequence2 = "bioderm_heavy_back.dsq back"; sequence3 = "bioderm_heavy_side.dsq side"; sequence4 = "bioderm_heavy_lookde.dsq look"; sequence5 = "bioderm_heavy_lookms.dsq lookms"; sequence6 = "bioderm_heavy_head.dsq head"; sequence7 = "bioderm_heavy_headside.dsq headside"; sequence8 = "bioderm_heavy_jet.dsq jet"; sequence9 = "bioderm_heavy_land.dsq land"; sequence10 = "bioderm_heavy_fall.dsq fall"; sequence11 = "bioderm_heavy_jump.dsq jump"; sequence12 = "bioderm_heavy_recoilde.dsq light_recoil"; sequence13 = "bioderm_heavy_idlePDA.dsq idlePDA"; sequence14 = "bioderm_heavy_diehead.dsq death1"; sequence15 = "bioderm_heavy_diechest.dsq death2"; sequence16 = "bioderm_heavy_dieback.dsq death3"; sequence17 = "bioderm_heavy_dieknees.dsq death4"; sequence18 = "bioderm_heavy_diesidelft.dsq death5"; sequence19 = "bioderm_heavy_diesidert.dsq death6"; sequence20 = "bioderm_heavy_dieleglft.dsq death7"; sequence21 = "bioderm_heavy_dielegrt.dsq death8"; sequence22 = "bioderm_heavy_dieslump.dsq death9"; sequence23 = "bioderm_heavy_dieforward.dsq death10"; sequence24 = "bioderm_heavy_diespin.dsq death11"; sequence25 = "bioderm_heavy_celsalute.dsq cel1"; sequence26 = "bioderm_heavy_celyeah.dsq cel2"; sequence27 = "bioderm_heavy_tauntbest.dsq cel3"; sequence28 = "bioderm_heavy_celroar.dsq cel4"; sequence29 = "bioderm_heavy_tauntbull.dsq cel5"; sequence30 = "bioderm_heavy_celflex2.dsq cel6"; sequence31 = "bioderm_heavy_celgora.dsq cel7"; sequence32 = "bioderm_heavy_celjump.dsq cel8"; sequence33 = "bioderm_heavy_ski.dsq ski"; sequence34 = "bioderm_heavy_standjump.dsq standjump"; sequence35 = "bioderm_heavy_looknw.dsq looknw"; }; PK !(Ja$scripts/bioderm_light.csdatablock TSShapeConstructor(BiodermLightDts) { baseShape = "bioderm_light.dts"; sequence0 = "bioderm_light_root.dsq root"; sequence1 = "bioderm_light_forward.dsq run"; sequence2 = "bioderm_light_back.dsq back"; sequence3 = "bioderm_light_side.dsq side"; sequence4 = "bioderm_light_lookde.dsq look"; sequence5 = "bioderm_light_lookms.dsq lookms"; sequence6 = "bioderm_light_head.dsq head"; sequence7 = "bioderm_light_headside.dsq headSide"; sequence8 = "bioderm_light_jet.dsq jet"; sequence9 = "bioderm_light_land.dsq land"; sequence10 = "bioderm_light_fall.dsq fall"; sequence11 = "bioderm_light_jump.dsq jump"; sequence12 = "bioderm_light_recoilde.dsq light_recoil"; sequence13 = "bioderm_light_idlePDA.dsq idlePDA"; sequence14 = "bioderm_light_scoutroot.dsq scoutroot"; sequence15 = "bioderm_light_dieback.dsq death1"; sequence16 = "bioderm_light_diespin.dsq death2"; sequence17 = "bioderm_light_diechest.dsq death3"; sequence18 = "bioderm_light_dieforward.dsq death4"; sequence19 = "bioderm_light_diehead.dsq death5"; sequence20 = "bioderm_light_dieknees.dsq death6"; sequence21 = "bioderm_light_dieleglft.dsq death7"; sequence22 = "bioderm_light_dielegrt.dsq death8"; sequence23 = "bioderm_light_diesidelft.dsq death9"; sequence24 = "bioderm_light_diesidert.dsq death10"; sequence25 = "bioderm_light_dieslump.dsq death11"; sequence26 = "bioderm_light_celsalute.dsq cel1"; sequence27 = "bioderm_light_celyeah.dsq cel2"; sequence28 = "bioderm_light_tauntbest.dsq cel3"; sequence29 = "bioderm_light_celroar.dsq cel4"; sequence30 = "bioderm_light_tauntbull.dsq cel5"; sequence31 = "bioderm_light_celflex2.dsq cel6"; sequence32 = "bioderm_light_celgora.dsq cel7"; sequence33 = "bioderm_light_celjump.dsq cel8"; sequence34 = "bioderm_light_sitting.dsq sitting"; sequence35 = "bioderm_light_ski.dsq ski"; sequence36 = "bioderm_light_standjump.dsq standjump"; sequence37 = "bioderm_light_looknw.dsq looknw"; }; PK !(*60scripts/bioderm_medium.csdatablock TSShapeConstructor(BiodermMediumDts) { baseShape = "bioderm_medium.dts"; sequence0 = "bioderm_medium_root.dsq root"; sequence1 = "bioderm_medium_forward.dsq run"; sequence2 = "bioderm_medium_back.dsq back"; sequence3 = "bioderm_medium_side.dsq side"; sequence4 = "bioderm_medium_lookde.dsq look"; sequence5 = "bioderm_medium_head.dsq head"; sequence6 = "bioderm_medium_headside.dsq headside"; sequence7 = "bioderm_medium_jet.dsq jet"; sequence8 = "bioderm_medium_land.dsq land"; sequence9 = "bioderm_medium_fall.dsq fall"; sequence10 = "bioderm_medium_jump.dsq jump"; sequence11 = "bioderm_medium_idlePDA.dsq idlePDA"; sequence12 = "bioderm_medium_lookms.dsq lookms"; sequence13 = "bioderm_medium_sitting.dsq sitting"; sequence14 = "bioderm_medium_recoilde.dsq light_recoil"; sequence15 = "bioderm_medium_dieback.dsq death1"; sequence16 = "bioderm_medium_diespin.dsq death2"; sequence17 = "bioderm_medium_diehead.dsq death3"; sequence18 = "bioderm_medium_diechest.dsq death4"; sequence19 = "bioderm_medium_dieforward.dsq death5"; sequence20 = "bioderm_medium_dieknees.dsq death6"; sequence21 = "bioderm_medium_dieleglft.dsq death7"; sequence22 = "bioderm_medium_dielegrt.dsq death8"; sequence23 = "bioderm_medium_diesidelft.dsq death9"; sequence24 = "bioderm_medium_diesidert.dsq death10"; sequence25 = "bioderm_medium_dieslump.dsq death11"; sequence26 = "bioderm_medium_celsalute.dsq cel1"; sequence27 = "bioderm_medium_celyeah.dsq cel2"; sequence28 = "bioderm_medium_tauntbest.dsq cel3"; sequence29 = "bioderm_medium_celroar.dsq cel4"; sequence30 = "bioderm_medium_tauntbull.dsq cel5"; sequence31 = "bioderm_medium_celflex2.dsq cel6"; sequence32 = "bioderm_medium_celgora.dsq cel7"; sequence33 = "bioderm_medium_celjump.dsq cel8"; sequence34 = "bioderm_medium_ski.dsq ski"; sequence35 = "bioderm_medium_standjump.dsq standjump"; sequence36 = "bioderm_medium_looknw.dsq looknw"; }; PK !( <\\scripts/camera.cs$Camera::movementSpeed = 40; datablock CameraData(Observer) { mode = "observerStatic"; firstPersonOnly = true; }; datablock CameraData(CommanderCamera) { mode = "observerStatic"; firstPersonOnly = true; }; function CommanderCamera::onTrigger( %data, %obj, %trigger, %state ) { // no need to do anything here. } function Observer::onTrigger(%data,%obj,%trigger,%state) { // state = 0 means that a trigger key was released if (%state == 0) return; //first, give the game the opportunity to prevent the observer action if (!Game.ObserverOnTrigger(%data, %obj, %trigger, %state)) return; //now observer functions if you press the "throw" if (%trigger >= 4) return; //trigger types: 0:fire 1:altTrigger 2:jump 3:jet 4:throw %client = %obj.getControllingClient(); if (%client == 0) return; switch$ (%obj.mode) { case "justJoined": if (isDemo()) clearCenterPrint(%client); //press FIRE if (%trigger == 0) { // clear intro message clearBottomPrint( %client ); //spawn the player commandToClient(%client, 'setHudMode', 'Standard'); Game.assignClientTeam(%client); Game.spawnPlayer( %client, $MatchStarted ); if( $MatchStarted ) { %client.camera.setFlyMode(); %client.setControlObject( %client.player ); } else { %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); %client.setControlObject( %client.camera ); } } //press JET else if (%trigger == 3) { //cycle throw the static observer spawn points %markerObj = Game.pickObserverSpawn(%client, true); %transform = %markerObj.getTransform(); %obj.setTransform(%transform); %obj.setFlyMode(); } //press JUMP else if (%trigger == 2) { //switch the observer mode to observing clients if (isObject(%client.observeFlyClient)) serverCmdObserveClient(%client, %client.observeFlyClient); else serverCmdObserveClient(%client, -1); displayObserverHud(%client, %client.observeClient); messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name); } case "playerDeath": // Attached to a dead player - spawn regardless of trigger type if(!%client.waitRespawn && getSimTime() > %client.suicideRespawnTime) { commandToClient(%client, 'setHudMode', 'Standard'); Game.spawnPlayer( %client, true ); %client.camera.setFlyMode(); %client.setControlObject(%client.player); } case "PreviewMode": if (%trigger == 0) { commandToClient(%client, 'setHudMode', 'Standard'); if( %client.lastTeam ) Game.clientJoinTeam( %client, %client.lastTeam ); else { Game.assignClientTeam( %client, true ); // Spawn the player: Game.spawnPlayer( %client, false ); } %client.camera.setFlyMode(); %client.setControlObject( %client.player ); } case "toggleCameraFly": // this is the default camera mode case "observerFly": // Free-flying observer camera if (%trigger == 0) { if( !$Host::TournamentMode && $MatchStarted ) { // reset observer params clearBottomPrint(%client); commandToClient(%client, 'setHudMode', 'Standard'); if( %client.lastTeam !$= "" && %client.lastTeam != 0 && Game.numTeams > 1) { Game.clientJoinTeam( %client, %client.lastTeam, $MatchStarted ); %client.camera.setFlyMode(); %client.setControlObject( %client.player ); } else { Game.assignClientTeam( %client ); // Spawn the player: Game.spawnPlayer( %client, true ); %client.camera.setFlyMode(); %client.setControlObject( %client.player ); ClearBottomPrint( %client ); } } else if( !$Host::TournamentMode ) { clearBottomPrint(%client); Game.assignClientTeam( %client ); // Spawn the player: Game.spawnPlayer( %client, false ); %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); %client.setControlObject( %client.camera ); } } //press JET else if (%trigger == 3) { %markerObj = Game.pickObserverSpawn(%client, true); %transform = %markerObj.getTransform(); %obj.setTransform(%transform); %obj.setFlyMode(); } //press JUMP else if (%trigger == 2) { //switch the observer mode to observing clients if (isObject(%client.observeFlyClient)) serverCmdObserveClient(%client, %client.observeFlyClient); else serverCmdObserveClient(%client, -1); observerFollowUpdate( %client, %client.observeClient, false ); displayObserverHud(%client, %client.observeClient); messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name); } case "observerStatic": // Non-moving observer camera %next = (%trigger == 3 ? true : false); %markerObj = Game.pickObserverSpawn(%client, %next); %transform = %markerObj.getTransform(); %obj.setTransform(%transform); %obj.setFlyMode(); case "observerStaticNoNext": // Non-moving, non-cycling observer camera case "observerTimeout": // Player didn't respawn quickly enough if (%trigger == 0) { clearBottomPrint(%client); commandToClient(%client, 'setHudMode', 'Standard'); if( %client.lastTeam ) Game.clientJoinTeam( %client, %client.lastTeam, true ); else { Game.assignClientTeam( %client ); // Spawn the player: Game.spawnPlayer( %client, true ); } %client.camera.setFlyMode(); %client.setControlObject( %client.player ); } //press JET else if (%trigger == 3) { %markerObj = Game.pickObserverSpawn(%client, true); %transform = %markerObj.getTransform(); %obj.setTransform(%transform); %obj.setFlyMode(); } //press JUMP else if (%trigger == 2) { //switch the observer mode to observing clients if (isObject(%client.observeFlyClient)) serverCmdObserveClient(%client, %client.observeFlyClient); else serverCmdObserveClient(%client, -1); // update the observer list for this client observerFollowUpdate( %client, %client.observeClient, false ); displayObserverHud(%client, %client.observeClient); messageClient(%client.observeClient, 'Observer', '\c1%1 is now observing you.', %client.name); } case "observerFollow": // Observer attached to a moving object (assume player for now...) //press FIRE - cycle to next client if (%trigger == 0) { %nextClient = findNextObserveClient(%client); %prevObsClient = %client.observeClient; if (%nextClient > 0 && %nextClient != %client.observeClient) { // update the observer list for this client observerFollowUpdate( %client, %nextClient, true ); //set the new object %transform = %nextClient.player.getTransform(); if( !%nextClient.isMounted() ) { %obj.setOrbitMode(%nextClient.player, %transform, 0.5, 4.5, 4.5); %client.observeClient = %nextClient; } else { %mount = %nextClient.player.getObjectMount(); if( %mount.getDataBlock().observeParameters $= "" ) %params = %transform; else %params = %mount.getDataBlock().observeParameters; %obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); %client.observeClient = %nextClient; } //send the message(s) displayObserverHud(%client, %nextClient); messageClient(%nextClient, 'Observer', '\c1%1 is now observing you.', %client.name); messageClient(%prevObsClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); } } //press JET - cycle to prev client else if (%trigger == 3) { %prevClient = findPrevObserveClient(%client); %prevObsClient = %client.observeClient; if (%prevClient > 0 && %prevClient != %client.observeClient) { // update the observer list for this client observerFollowUpdate( %client, %prevClient, true ); //set the new object %transform = %prevClient.player.getTransform(); if( !%prevClient.isMounted() ) { %obj.setOrbitMode(%prevClient.player, %transform, 0.5, 4.5, 4.5); %client.observeClient = %prevClient; } else { %mount = %prevClient.player.getObjectMount(); if( %mount.getDataBlock().observeParameters $= "" ) %params = %transform; else %params = %mount.getDataBlock().observeParameters; %obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); %client.observeClient = %prevClient; } //send the message(s) displayObserverHud(%client, %prevClient); messageClient(%prevClient, 'Observer', '\c1%1 is now observing you.', %client.name); messageClient(%prevObsClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); } } //press JUMP else if (%trigger == 2) { // update the observer list for this client observerFollowUpdate( %client, -1, false ); //toggle back to observer fly mode %obj.mode = "observerFly"; %obj.setFlyMode(); updateObserverFlyHud(%client); messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name); } case "pre-game": if(!$Host::TournamentMode || $CountdownStarted) return; if(%client.notReady) { %client.notReady = ""; MessageAll( 0, '\c1%1 is READY.', %client.name ); if(%client.notReadyCount < 3) centerprint( %client, "\nWaiting for match start (FIRE if not ready)", 0, 3); else centerprint( %client, "\nWaiting for match start", 0, 3); } else { %client.notReadyCount++; if(%client.notReadyCount < 4) { %client.notReady = true; MessageAll( 0, '\c1%1 is not READY.', %client.name ); centerprint( %client, "\nPress FIRE when ready.", 0, 3 ); } return; } CheckTourneyMatchStart(); } } function Observer::setMode(%data, %obj, %mode, %targetObj) { if(%mode $= "") return; %client = %obj.getControllingClient(); switch$ (%mode) { case "justJoined": commandToClient(%client, 'setHudMode', 'Observer'); %markerObj = Game.pickObserverSpawn(%client, true); %transform = %markerObj.getTransform(); %obj.setTransform(%transform); %obj.setFlyMode(); case "pre-game": commandToClient(%client, 'setHudMode', 'Observer'); %obj.setOrbitMode( %targetObj, %targetObj.getTransform(), 0.5, 4.5, 4.5); case "observerFly": // Free-flying observer camera commandToClient(%client, 'setHudMode', 'Observer'); %markerObj = Game.pickObserverSpawn(%client, true); %transform = %markerObj.getTransform(); %obj.setTransform(%transform); %obj.setFlyMode(); case "observerStatic" or "observerStaticNoNext": // Non-moving observer camera %markerObj = Game.pickObserverSpawn(%client, true); %transform = %markerObj.getTransform(); %obj.setTransform(%transform); case "observerFollow": // Observer attached to a moving object (assume player for now...) %transform = %targetObj.getTransform(); if( !%targetObj.isMounted() ) %obj.setOrbitMode(%targetObj, %transform, 0.5, 4.5, 4.5); else { %mount = %targetObj.getObjectMount(); if( %mount.getDataBlock().observeParameters $= "" ) %params = %transform; else %params = %mount.getDataBlock().observeParameters; %obj.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); } case "observerTimeout": commandToClient(%client, 'setHudMode', 'Observer'); %markerObj = Game.pickObserverSpawn(%client, true); %transform = %markerObj.getTransform(); %obj.setTransform(%transform); %obj.setFlyMode(); } %obj.mode = %mode; } function findNextObserveClient(%client) { %index = -1; %count = ClientGroup.getCount(); if (%count <= 1) return -1; for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl == %client.observeClient) { %index = %i; break; } } //now find the next client (note, if not found, %index still == -1) %index++; if (%index >= %count) %index = 0; %newClient = -1; for (%i = %index; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl != %client && %cl.player > 0) { %newClient = %cl; break; } } //if we didn't find anyone, search from the beginning again if (%newClient < 0) { for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl != %client && %cl.player > 0) { %newClient = %cl; break; } } } //if we still haven't found anyone (new), give up.. if (%newClient < 0 || %newClient.player == %player) return -1; } function findPrevObserveClient(%client) { %index = -1; %count = ClientGroup.getCount(); if (%count <= 1) return -1; for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl == %client.observeClient) { %index = %i; break; } } //now find the prev client %index--; if (%index < 0) %index = %count - 1; %newClient = -1; for (%i = %index; %i >= 0; %i--) { %cl = ClientGroup.getObject(%i); if (%cl != %client && %cl.player > 0) { %newClient = %cl; break; } } //if we didn't find anyone, search from the end again if (%newClient < 0) { for (%i = %count - 1; %i >= 0; %i--) { %cl = ClientGroup.getObject(%i); if (%cl != %client && %cl.player > 0) { %newClient = %cl; break; } } } //if we still haven't found anyone (new), give up.. if (%newClient < 0 || %newClient.player == %player) return -1; } function observeClient(%client) { if( $testcheats ) { //pass in -1 to choose any client... commandToServer('observeClient', %client); } } function serverCmdObserveClient(%client, %target) { //clear the observer fly mode var... %client.observeFlyClient = -1; //cancel any scheduled update cancel(%client.obsHudSchedule); // must be an observer when observing other clients if( %client.getControlObject() != %client.camera) return; //can't observer yourself if (%client == %target) return; %count = ClientGroup.getCount(); //can't go into observer mode if you're the only client if (%count <= 1) return; //make sure the target actually exists if (%target > 0) { %found = false; for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl == %target) { %found = true; break; } } if (!%found) return; } else { %client.observeClient = -1; %target = findNextObserveClient(%client); if (%target <= 0) return; } //send the message if (%client.camera.mode !$= "observerFollow") { if (isObject(%client.player)) %client.player.scriptKill(0); //messageAllExcept(%client, -1, 'ClientNowObserver', '\c1%1 is now an observer.', %client.name); //messageClient(%client, 'YouNowObserver', '\c1You are now observing %1.', %target.name); } %client.camera.getDataBlock().setMode(%client.camera, "observerFollow", %target.player); %client.setControlObject(%client.camera); //tag is used if a client who is being observed dies... %client.observeClient = %target; } function observerFollowUpdate( %client, %nextClient, %cycle ) { %Oclient = %client.observeClient; if( %Oclient $= "" ) return; // changed to observer fly... if( %nextClient == -1 ) { // find us in their observer list and remove, then reshuffle the list... for( %i = 0; %i < %Oclient.observeCount; %i++ ) { if( %Oclient.observers[%i] == %client ) { %Oclient.observeCount--; %Oclient.observers[%i] = %Oclient.observers[%Oclient.observeCount]; %Oclient.observers[%Oclient.observeCount] = ""; break; } } return; // were done.. } // changed from observer fly to observer follow... if( !%cycle && %nextClient != -1 ) { // if nobody is observing this guy, initialize their observer count... if( %nextClient.observeCount $= "" ) %nextClient.observeCount = 0; // add us to their list of observers... %nextClient.observers[%nextClient.observeCount] = %client; %nextClient.observeCount++; return; // were done. } if( %nextClient != -1 ) { // cycling to the next client... for( %i = 0; %i < %Oclient.observeCount; %i++ ) { // first remove us from our prev client's list... if( %Oclient.observers[%i] == %client ) { %Oclient.observeCount--; %Oclient.observers[%i] = %Oclient.observers[%Oclient.observeCount]; %Oclient.observers[%Oclient.observeCount] = ""; break; // screw you guys, i'm goin home! } } // if nobody is observing this guy, initialize their observer count... if( %nextClient.observeCount $= "" ) %nextClient.observeCount = 0; // now add us to the new clients list... %nextClient.observeCount++; %nextClient.observers[%nextClient.observeCount - 1] = %client; } } function updateObserverFlyHud(%client) { //just in case there are two threads going... cancel(%client.obsHudSchedule); %client.observeFlyClient = -1; //make sure the client is supposed to be in observer fly mode... if (!isObject(%client) || %client.team != 0 || %client.getControlObject() != %client.camera || %client.camera.mode $= "observerFollow") return; //get various info about the player's eye %srcEyeTransform = %client.camera.getTransform(); %srcEyePoint = firstWord(%srcEyeTransform) @ " " @ getWord(%srcEyeTransform, 1) @ " " @ getWord(%srcEyeTransform, 2); %srcEyeVector = MatrixMulVector("0 0 0 " @ getWords(%srcEyeTransform, 3, 6), "0 1 0"); %srcEyeVector = VectorNormalize(%srcEyeVector); //see if there's an enemy near our defense location... %clientCount = 0; %count = ClientGroup.getCount(); %viewedClient = -1; %clientDot = -1; for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); //make sure we find an AI who's alive and not the client if (%cl != %client && isObject(%cl.player)) { //make sure the player is within range %clPos = %cl.player.getWorldBoxCenter(); %distance = VectorDist(%clPos, %srcEyePoint); if (%distance <= 30) { //create the vector from the client to the client %clVector = VectorNormalize(VectorSub(%clPos, %srcEyePoint)); //see if the dot product is greater than our current, and greater than 0.6 %dot = VectorDot(%clVector, %srcEyeVector); if (%dot > 0.6 && %dot > %clientDot) { //make sure we're not looking through walls... %mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType; %losResult = containerRayCast(%srcEyePoint, %clPos, %mask); %losObject = GetWord(%losResult, 0); if (!isObject(%losObject)) { %viewedClient = %cl; %clientDot = %dot; } } } } } if (isObject(%viewedClient)) displayObserverHud(%client, 0, %viewedClient); else displayObserverHud(%client, 0); %client.observeFlyClient = %viewedClient; //schedule the next... %client.obsHudSchedule = schedule(500, %client, updateObserverFlyHud, %client); } PK !(cbIIscripts/cannedChatItems.cs//-------------------------------------------------------------------------- // // cannedChatItems.cs // //-------------------------------------------------------------------------- $MinChatItemId = 0; $MaxChatItemId = 0; if ( !isObject( CannedChatItems ) ) new SimGroup( CannedChatItems ); //-------------------------------------------------------------------------- function installChatItem( %command, %text, %audioFile, %animCel, %teamOnly, %defaultkeys, %play3D ) { %cmdId = getSubStr( %command, 1, strlen( %command ) - 1 ); %name = getTaggedString(%command); //echo( "** cmdId = " @ %cmdId @ " **" ); if ( !isObject( $ChatTable[%cmdId] ) ) { if ( %animCel == 0 ) %animation = ""; else %animation = "cel" @ %animCel; //error("defvoicebinds="@$defaultVoiceBinds@",keyPress="@%keyPress@",keyCmd="@%keyCmd); $ChatTable[%cmdId] = new CannedChatItem() { name = %name; text = %text; audioFile = %audioFile; animation = %animation; teamOnly = %teamOnly; defaultKeys = %defaultkeys; play3D = %play3D; }; CannedChatItems.add( $ChatTable[%cmdId] ); if ( $MinChatItemId == 0 || %cmdId < $MinChatItemId ) $MinChatItemId = %cmdId; if ( %cmdId > $MaxChatItemId ) $MaxChatItemId = %cmdId; } } //-------------------------------------------------------------------------- function installChatItemCallback( %command, %callback ) { %cmdId = getSubStr( %command, 1, strlen( %command ) - 1 ); // make sure there is a chat item created if(isObject($ChatTable[%cmdId])) { for(%i = 0; (%aCallback = $ChatCallbacks[%cmdId, %i]) !$= ""; %i++) { // dont allow multiple instances if(%aCallback == %callback) return; } $ChatCallbacks[%cmdId, %i] = %callback; } } function processChatItemCallbacks( %command ) { %cmdId = getSubStr( %command, 1, strlen( %command ) - 1 ); // make sure an actual chat item if(isObject($ChatTable[%cmdId])) for(%i = 0; (%callback = $ChatCallbacks[%cmdId, %i]) !$= ""; %i++) call(%callback, $ChatTable[%cmdId]); } //-------------------------------------------------------------------------- // ANIMATIONS installChatItem( 'ChatAnimAnnoyed', "", "vqk.move", 4, false, "VGAA", true ); installChatItem( 'ChatAnimGetSome', "", "gbl.brag", 3, false, "VGAG", true ); installChatItem( 'ChatAnimDance', "", "gbl.woohoo", 5, false, "VGAD", true ); installChatItem( 'ChatAnimSalute', "", "slf.tsk.generic", 1, false, "VGAS", true ); installChatItem( 'ChatAnimWave', "", "gbl.hi", 2, false, "VGAW", true ); installChatItem( 'ChatAnimSpec1', "", "gbl.obnoxious", 6, false, "VGAZ", true ); installChatItem( 'ChatAnimSpec2', "", "gbl.aww", 7, false, "VGAX", true ); installChatItem( 'ChatAnimSpec3', "", "gbl.awesome", 8, false, "VGAC", true ); //-------------------------------------------------------------------------- // ATTACK installChatItem( 'ChatCmdAttack', "Attack!", "att.attack", 0, true, "VAA", false ); installChatItem( 'ChatCmdAttackBase', "Attack the enemy base!", "att.base", 0, true, "VAB", false ); installChatItem( 'ChatCmdAttackChase', "Recover our flag!", "att.chase", 0, true, "VAC", false ); installChatItem( 'ChatCmdAttackDistract', "Disrupt the enemy defense!", "att.distract", 0, true, "VAD", false ); installChatItem( 'ChatCmdAttackFlag', "Get the enemy flag!", "att.flag", 0, true, "VAF", false ); installChatItem( 'ChatCmdAttackGenerator', "Destroy the enemy generator!", "att.generator", 0, true, "VAG", false ); installChatItem( 'ChatCmdAttackObjective', "Attack the objective!", "att.objective", 0, true, "VAO", false ); installChatItem( 'ChatCmdAttackReinforce', "Reinforce the offense!", "att.reinforcements", 0, true, "VAR", false ); installChatItem( 'ChatCmdAttackSensors', "Destroy enemy sensors!", "att.sensors", 0, true, "VAS", false ); installChatItem( 'ChatCmdAttackTurrets', "Destroy enemy turrets!", "att.turrets", 0, true, "VAT", false ); installChatItem( 'ChatCmdAttackWait', "Wait for my signal before attacking!", "att.wait", 0, true, "VAW", false ); installChatItem( 'ChatCmdAttackVehicle', "Destroy the enemy vehicle!", "att.vehicle", 0, true, "VAV", false ); //-------------------------------------------------------------------------- // BASE installChatItem( 'ChatBaseTaken', "Our base is taken.", "bas.taken", 0, true, "VBT", false ); installChatItem( 'ChatEnemyInBase', "The enemy's in our base.", "bas.enemy", 0, true, "VBE", false ); installChatItem( 'ChatBaseClear', "Our base is clear.", "bas.clear", 0, true, "VBC", false ); installChatItem( 'ChatCmdRetakeBase', "Retake our base!", "bas.retake", 0, true, "VBR", false ); installChatItem( 'ChatBaseSecure', "Our base is secure.", "bas.secure", 0, true, "VBS", false ); //-------------------------------------------------------------------------- // DEFENSE installChatItem( 'ChatCmdDefendBase', "Defend our base!", "def.base", 0, true, "VDB", false ); installChatItem( 'ChatCmdDefendCarrier', "Cover our flag carrier!", "def.carrier", 0, true, "VDC", false ); installChatItem( 'ChatCmdDefendEntrances', "Defend the entrances!", "def.entrances", 0, true, "VDE", false ); installChatItem( 'ChatCmdDefendFlag', "Defend our flag!", "def.flag", 0, true, "VDF", false ); installChatItem( 'ChatCmdDefendGenerator', "Protect the generator!", "def.generator", 0, true, "VDG", false ); installChatItem( 'ChatCmdDefendMe', "Cover me!", "def.me", 0, true, "VDM", false ); installChatItem( 'ChatCmdDefendObjective', "Defend the objective!", "def.objective", 0, true, "VDO", false ); installChatItem( 'ChatCmdDefendReinforce', "Reinforce our defense!", "def.reinforce", 0, true, "VDR", false ); installChatItem( 'ChatCmdDefendSensors', "Defend our sensors!", "def.sensors", 0, true, "VDS", false ); installChatItem( 'ChatCmdDefendTurrets', "Defend our turrets!", "def.turrets", 0, true, "VDT", false ); installChatItem( 'ChatCmdDefendVehicle', "Defend our vehicle!", "def.vehicle", 0, true, "VDV", false ); installChatItem( 'ChatCmdDefendNexus', "Defend the nexus!", "def.nexus", 0, true, "VDN", false ); //-------------------------------------------------------------------------- // COMMAND RESPONSE installChatItem( 'ChatCmdAcknowledged', "Command acknowledged.", "cmd.acknowledge", 0, true, "VCA", false ); installChatItem( 'ChatCmdWhat', "What's your assignment?", "cmd.bot", 0, true, "VCW", false ); installChatItem( 'ChatCmdCompleted', "Command completed.", "cmd.completed", 0, true, "VCC", false ); installChatItem( 'ChatCmdDeclined', "Command declined.", "cmd.decline", 0, true, "VCD", false ); //-------------------------------------------------------------------------- // ENEMY STATUS installChatItem( 'ChatEnemyBaseDisabled', "Enemy base is disabled.", "ene.base", 0, true, "VEB", false ); installChatItem( 'ChatEnemyDisarray', "The enemy is disrupted. Attack!", "ene.disarray", 0, true, "VED", false ); installChatItem( 'ChatEnemyGeneratorDestroyed', "Enemy generator destroyed.", "ene.generator", 0, true, "VEG", false ); installChatItem( 'ChatEnemyRemotesDestroyed', "Enemy remote equipment destroyed.", "ene.remotes", 0, true, "VER", false ); installChatItem( 'ChatEnemySensorsDestroyed', "Enemy sensors destroyed.", "ene.sensors", 0, true, "VES", false ); installChatItem( 'ChatEnemyTurretsDestroyed', "Enemy turrets destroyed.", "ene.turrets", 0, true, "VET", false ); installChatItem( 'ChatEnemyVehicleDestroyed', "Enemy vehicle station destroyed.", "ene.vehicle", 0, true, "VEV", false ); //-------------------------------------------------------------------------- // FLAG installChatItem( 'ChatFlagGotIt', "I have the enemy flag!", "flg.flag", 0, true, "VFF", false ); installChatItem( 'ChatCmdGiveMeFlag', "Give me the flag!", "flg.give", 0, true, "VFG", false ); installChatItem( 'ChatCmdReturnFlag', "Retrieve our flag!", "flg.retrieve", 0, true, "VFR", false ); installChatItem( 'ChatFlagSecure', "Our flag is secure.", "flg.secure", 0, true, "VFS", false ); installChatItem( 'ChatCmdTakeFlag', "Take the flag from me!", "flg.take", 0, true, "VFT", false ); installChatItem( 'ChatCmdHunterGiveFlags', "Give your flags to me!", "flg.huntergive", 0, true, "VFO", false ); installChatItem( 'ChatCmdHunterTakeFlags', "Take my flags!", "flg.huntertake", 0, true, "VFP", false ); //-------------------------------------------------------------------------- // GLOBAL COMPLIMENTS installChatItem( 'ChatAwesome', "Awesome!", "gbl.awesome", 0, false, "VGCA", false ); installChatItem( 'ChatGoodGame', "Good game!", "gbl.goodgame", 0, false, "VGCG", false ); installChatItem( 'ChatNice', "Nice move!", "gbl.nice", 0, false, "VGCN", false ); installChatItem( 'ChatYouRock', "You rock!", "gbl.rock", 0, false, "VGCR", false ); installChatItem( 'ChatGreatShot', "Great shot!", "gbl.shooting", 0, false , "VGCS"); //-------------------------------------------------------------------------- // GLOBAL installChatItem( 'ChatHi', "Hi.", "gbl.hi", 0, false, "VGH", false ); installChatItem( 'ChatBye', "Bye.", "gbl.bye", 0, false, "VGB", false ); installChatItem( 'ChatGlobalYes', "Yes.", "gbl.yes", 0, false, "VGY", false ); installChatItem( 'ChatGlobalNo', "No.", "gbl.no", 0, false, "VGN", false ); installChatItem( 'ChatAnyTime', "Any time.", "gbl.anytime", 0, false, "VGRA", false ); installChatItem( 'ChatDontKnow', "I don't know.", "gbl.dunno", 0, false, "VGRD", false ); installChatItem( 'ChatOops', "Oops!", "gbl.oops", 0, false, "VGO", false ); installChatItem( 'ChatQuiet', "Quiet!", "gbl.quiet", 0, false, "VGQ", false ); installChatItem( 'ChatShazbot', "Shazbot!", "gbl.shazbot", 0, false, "VGS", false ); installChatItem( 'ChatCheer', "Woohoo!", "gbl.woohoo", 0, false, "VGW", false ); installChatItem( 'ChatThanks', "Thanks.", "gbl.thanks", 0, false, "VGRT", false ); installChatItem( 'ChatWait', "Wait a sec.", "gbl.wait", 0, false, "VGRW", false ); //-------------------------------------------------------------------------- // TRASH TALK installChatItem( 'ChatAww', "Aww, that's too bad!", "gbl.aww", 0, false, "VGTA", false ); installChatItem( 'ChatBrag', "I am the greatest!", "gbl.brag", 0, false, "VGTG", false ); installChatItem( 'ChatObnoxious', "That's the best you can do?", "gbl.obnoxious", 0, false, "VGTB", false ); installChatItem( 'ChatSarcasm', "THAT was graceful!", "gbl.sarcasm", 0, false, "VGTT", false ); installChatItem( 'ChatLearn', "When ya gonna learn?", "gbl.when", 0, false, "VGTW", false ); //-------------------------------------------------------------------------- // NEED installChatItem( 'ChatNeedBombardier', "Need a bombardier.", "need.bombardier", 0, true, "VNB", false ); installChatItem( 'ChatNeedCover', "Need covering fire.", "need.cover", 0, true, "VNC", false ); installChatItem( 'ChatNeedDriver', "Need driver for ground vehicle.", "need.driver", 0, true, "VND", false ); installChatItem( 'ChatNeedEscort', "Vehicle needs escort.", "need.escort", 0, true, "VNE", false ); installChatItem( 'ChatNeedPilot', "Need pilot for turbograv.", "need.flyer", 0, true, "VNP", false ); installChatItem( 'ChatNeedPassengers', "Gunship ready! Need a ride?", "need.gunship", 0, true, "VNG", false ); installChatItem( 'ChatNeedHold', "Hold that vehicle! I'm coming!", "need.hold", 0, true, "VNH", false ); installChatItem( 'ChatNeedRide', "I need a ride!", "need.ride", 0, true, "VNR", false ); installChatItem( 'ChatNeedSupport', "Need vehicle support!", "need.support", 0, true, "VNS", false ); installChatItem( 'ChatNeedTailgunner', "Need a tailgunner.", "need.tailgunner", 0, true, "VNT", false ); installChatItem( 'ChatNeedDestination', "Where to?", "need.where", 0, true, "VNW", false ); //-------------------------------------------------------------------------- // REPAIR installChatItem( 'ChatRepairBase', "Repair our base!", "rep.base", 0, true, "VRB", false ); installChatItem( 'ChatRepairGenerator', "Repair our generator!", "rep.generator", 0, true, "VRG", false ); installChatItem( 'ChatRepairMe', "Repair me!", "rep.me", 0, true, "VRM", false ); installChatItem( 'ChatRepairSensors', "Repair our sensors!", "rep.sensors", 0, true, "VRS", false ); installChatItem( 'ChatRepairTurrets', "Repair our turrets!", "rep.turrets", 0, true, "VRT", false ); installChatItem( 'ChatRepairVehicle', "Repair our vehicle station!", "rep.vehicle", 0, true, "VRV", false ); //-------------------------------------------------------------------------- // SELF ATTACK installChatItem( 'ChatSelfAttack', "I will attack.", "slf.att.attack", 0, true, "VSAA", false ); installChatItem( 'ChatSelfAttackBase', "I'll attack the enemy base.", "slf.att.base", 0, true, "VSAB", false ); installChatItem( 'ChatSelfAttackFlag', "I'll go for the enemy flag.", "slf.att.flag", 0, true, "VSAF", false ); installChatItem( 'ChatSelfAttackGenerator', "I'll attack the enemy generator.", "slf.att.generator", 0, true, "VSAG", false ); installChatItem( 'ChatSelfAttackSensors', "I'll attack the enemy sensors.", "slf.att.sensors", 0, true, "VSAS", false ); installChatItem( 'ChatSelfAttackTurrets', "I'll attack the enemy turrets.", "slf.att.turrets", 0, true, "VSAT", false ); installChatItem( 'ChatSelfAttackVehicle', "I'll attack the enemy vehicle station.", "slf.att.vehicle", 0, true, "VSAV", false ); //-------------------------------------------------------------------------- // SELF DEFEND installChatItem( 'ChatSelfDefendBase', "I'll defend our base.", "slf.def.base", 0, true, "VSDB", false ); installChatItem( 'ChatSelfDefend', "I'm defending.", "slf.def.defend", 0, true, "VSDD", false ); installChatItem( 'ChatSelfDefendFlag', "I'll defend our flag.", "slf.def.flag", 0, true, "VSDF", false ); installChatItem( 'ChatSelfDefendGenerator', "I'll defend our generator.", "slf.def.generator", 0, true, "VSDG", false ); installChatItem( 'ChatSelfDefendNexus', "I'll defend the nexus.", "slf.def.nexus", 0, true, "VSDN", false ); installChatItem( 'ChatSelfDefendSensors', "I'll defend our sensors.", "slf.def.sensors", 0, true, "VSDS", false ); installChatItem( 'ChatSelfDefendTurrets', "I'll defend our turrets.", "slf.def.turrets", 0, true, "VSDT", false ); installChatItem( 'ChatSelfDefendVehicle', "I'll defend our vehicle bay.", "slf.def.vehicle", 0, true, "VSDV", false ); //-------------------------------------------------------------------------- // SELF REPAIR installChatItem( 'ChatSelfRepairBase', "I'll repair our base.", "slf.rep.base", 0, true, "VSRB", false ); installChatItem( 'ChatSelfRepairEquipment', "I'll repair our equipment.", "slf.rep.equipment", 0, true, "VSRE", false ); installChatItem( 'ChatSelfRepairGenerator', "I'll repair our generator.", "slf.rep.generator", 0, true, "VSRG", false ); installChatItem( 'ChatSelfRepair', "I'm on repairs.", "slf.rep.repairing", 0, true, "VSRR", false ); installChatItem( 'ChatSelfRepairSensors', "I'll repair our sensors.", "slf.rep.sensors", 0, true, "VSRS", false ); installChatItem( 'ChatSelfRepairTurrets', "I'll repair our turrets.", "slf.rep.turrets", 0, true, "VSRT", false ); installChatItem( 'ChatSelfRepairVehicle', "I'll repair our vehicle station.", "slf.rep.vehicle", 0, true, "VSRV", false ); //-------------------------------------------------------------------------- // SELF TASK installChatItem( 'ChatTaskCover', "I'll cover you.", "slf.tsk.cover", 0, true, "VSTC", false ); installChatItem( 'ChatTaskSetupD', "I'll set up defenses.", "slf.tsk.defense", 0, true, "VSTD", false ); installChatItem( 'ChatTaskOnIt', "I'm on it.", "slf.tsk.generic", 0, true, "VSTO", false ); installChatItem( 'ChatTaskSetupRemote', "I'll deploy remote equipment.", "slf.tsk.remotes", 0, true, "VSTR", false ); installChatItem( 'ChatTaskSetupSensors', "I'll deploy sensors.", "slf.tsk.sensors", 0, true, "VSTS", false ); installChatItem( 'ChatTaskSetupTurrets', "I'll deploy turrets.", "slf.tsk.turrets", 0, true, "VSTT", false ); installChatItem( 'ChatTaskVehicle', "I'll get a vehicle ready.", "slf.tsk.vehicle", 0, true, "VSTV", false ); //-------------------------------------------------------------------------- // TARGET installChatItem( 'ChatTargetAcquired', "Target acquired.", "tgt.acquired", 0, true, "VTA", false ); installChatItem( 'ChatCmdTargetBase', "Target the enemy base! I'm in position.", "tgt.base", 0, true, "VTB", false ); installChatItem( 'ChatTargetDestroyed', "Target destroyed!", "tgt.destroyed", 0, true, "VTD", false ); installChatItem( 'ChatCmdTargetFlag', "Target their flag! I'm in position.", "tgt.flag", 0, true, "VTF", false ); installChatItem( 'ChatTargetFire', "Fire on my target!", "tgt.my", 0, true, "VTM", false ); installChatItem( 'ChatTargetNeed', "Need a target painted!", "tgt.need", 0, true, "VTN", false ); installChatItem( 'ChatCmdTargetSensors', "Target their sensors! I'm in position.", "tgt.sensors", 0, true, "VTS", false ); installChatItem( 'ChatCmdTargetTurret', "Target their turret! I'm in position.", "tgt.turret", 0, true, "VTT", false ); installChatItem( 'ChatCmdTargetWait', "Wait! I'll be in range soon.", "tgt.wait", 0, true, "VTW", false ); //-------------------------------------------------------------------------- // WARNING installChatItem( 'ChatWarnBomber', "Incoming bomber!", "wrn.bomber", 0, true, "VWB", false ); installChatItem( 'ChatWarnEnemies', "Incoming hostiles!", "wrn.enemy", 0, true, "VWE", false ); installChatItem( 'ChatWarnVehicles', "Incoming vehicles!", "wrn.vehicles", 0, true, "VWV", false ); installChatItem( 'ChatWarnShoot', "Watch where you're shooting!", "wrn.watchit", 0, true, "VWW", false ); //-------------------------------------------------------------------------- // VERY QUICK installChatItem( 'ChatWelcome', "Any time.", "vqk.anytime", 0, true, "VVA", false ); installChatItem( 'ChatIsBaseSecure', "Is our base secure?", "vqk.base", 0, true, "VVB", false ); installChatItem( 'ChatCeaseFire', "Cease fire!", "vqk.ceasefire", 0, true, "VVC", false ); installChatItem( 'ChatDunno', "I don't know.", "vqk.dunno", 0, true, "VVD", false ); installChatItem( 'ChatHelp', "HELP!", "vqk.help", 0, true, "VVH", false ); installChatItem( 'ChatMove', "Move, please!", "vqk.move", 0, true, "VVM", false ); installChatItem( 'ChatTeamNo', "No.", "vqk.no", 0, true, "VVN", false ); installChatItem( 'ChatSorry', "Sorry.", "vqk.sorry", 0, true, "VVS", false ); installChatItem( 'ChatTeamThanks', "Thanks.", "vqk.thanks", 0, true, "VVT", false ); installChatItem( 'ChatTeamWait', "Wait, please.", "vqk.wait", 0, true, "VVW", false ); installChatItem( 'ChatTeamYes', "Yes.", "vqk.yes", 0, true, "VVY", false ); PK !(Rscripts/chatMenuHud.cs//------------------------------------------------------------------------------ // // 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 ) { %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" ); PK !(Z0i  scripts/client.cs//---------------------------------------------------------------------------- //---------------------------------------------------------------------------- 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 "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) { // clean some stuff up. MessageHud.close(); purgeResources(); if (!$pref::NoClearConsole) cls(); commandToServer('MissionStartPhase2Done', %seq); } 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 ); } PK !(9Y.Y.scripts/clientAudio.cs//-------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------- datablock EffectProfile(BountyBellEffect) { effectname = "misc/bounty_bonus"; minDistance = 2.5; maxDistance = 5.0; }; // ordered list of providers $AudioProviders[0, name] = "Creative Labs EAX 2 (TM)"; $AudioProviders[0, isHardware] = true; $AudioProviders[0, enableEnvironment] = true; $AudioProviders[1, name] = "Creative Labs EAX (TM)"; $AudioProviders[1, isHardware] = true; $AudioProviders[1, enableEnvironment] = true; $AudioProviders[2, name] = "DirectSound3D Hardware Support"; $AudioProviders[2, isHardware] = true; $AudioProviders[2, enableEvironment] = false; $AudioProviders[3, name] = "Miles Fast 2D Positional Audio"; $AudioProviders[3, isHardware] = false; $AudioProviders[3, enableEvironment] = false; // defaults $Audio::defaultDriver = "miles"; $Audio::innerFalloffScale = "1.0"; $Audio::dynamicMemorySize = (1 << 20); function audioIsHardwareProvider(%provider) { for(%i = 0; $AudioProviders[%i, name] !$= ""; %i++) if(%provider $= $AudioProviders[%i, name]) return($AudioProviders[%i, isHardware]); return(false); } function audioIsEnvironmentProvider(%provider) { for(%i = 0; $AudioProviders[%i, name] !$= ""; %i++) if(%provider $= $AudioProviders[%i, name]) return($AudioProviders[%i, enableEnvironment]); return(false); } function audioUpdateProvider(%provider) { // check if should be using hardware settings by default alxDisableOuterFalloffs(false); for(%i = 0; $AudioProviders[%i, name] !$= ""; %i++) { if(%provider $= $AudioProviders[%i, name]) { // hardware if($AudioProviders[%i, isHardware]) { alxDisableOuterFalloffs(true); alxSetInnerFalloffScale(0.4); } // environment %enable = $pref::Audio::environmentEnabled && audioIsEnvironmentProvider(%provider); alxEnableEnvironmental(%enable); break; } } } function initAudio() { $Audio::originalProvider = alxGetContexti(ALC_PROVIDER); %providerName = alxGetContextstr(ALC_PROVIDER_NAME, $Audio::originalProvider); audioUpdateProvider(%providerName); // voice? if($pref::Audio::enableVoiceCapture) $Audio::captureInitialized = alxCaptureInit(); // Set volume based on prefs: alxListenerf( AL_GAIN_LINEAR, $pref::Audio::masterVolume ); alxContexti( ALC_BUFFER_DYNAMIC_MEMORY_SIZE, $Audio::dynamicMemorySize ); alxSetChannelVolume( $EffectAudioType, $pref::Audio::effectsVolume ); alxSetChannelVolume( $VoiceAudioType, $pref::Audio::voiceVolume ); alxSetChannelVolume( $ChatAudioType, $pref::Audio::radioVolume ); alxSetChannelVolume( $MusicAudioType, $pref::Audio::musicVolume ); alxSetChannelVolume( $GuiAudioType, $pref::Audio::guiVolume ); alxSetChannelVolume( $RadioAudioType, $pref::Audio::radioVolume ); alxSetCaptureGainScale( $pref::Audio::captureGainScale ); // cap the codec levels if( $platform $= "linux" ) { if( $pref::Audio::encodingLevel != 3) $pref::Audio::encodingLevel = 3; $pref::Audio::decodingMask &= 8; } else { if( $pref::Audio::encodingLevel > 2) $pref::Audio::encodingLevel = 2; $pref::Audio::decodingMask &= 7; } } if($Audio::initialized) initAudio(); //-------------------------------------------------------------------------- // MP3-Music player new ScriptObject(MusicPlayer) { class = MP3Audio; currentTrack = ""; repeat = true; }; function MP3Audio::stop(%this) { alxStopMusic(); } function getRandomTrack() { if ( isDemo() ) return( "desert" ); %val = mFloor(getRandom(0, 4)); switch(%val) { case 0: return "lush"; case 1: return "volcanic"; case 2: return "badlands"; case 3: return "ice"; case 4: return "desert"; } } function MP3Audio::play(%this) { if(%this.currentTrack $= "") %this.currentTrack = getRandomTrack(); %this.playTrack(%this.currentTrack); } function MP3Audio::playTrack(%this, %trackName) { %this.currentTrack = %trackName; if($pref::Audio::musicEnabled) { if ( isDemo() ) alxPlayMusic("demo_base\\music\\" @ %trackName @ ".mp3"); else alxPlayMusic("base\\music\\" @ %trackName @ ".mp3"); } } function finishedMusicStream(%stopped) { if(%stopped $= "true") return; if(MusicPlayer.repeat) MusicPlayer.playTrack(MusicPlayer.currentTrack); } function clientCmdPlayMusic(%trackname) { if(%trackname !$= "") MusicPlayer.playTrack(%trackName); } function clientCmdStopMusic() { MusicPlayer.stop(); } //-------------------------------------- // Audio Profiles // new EffectProfile(eButtonDown) { effectname = "gui/buttonDown"; minDistance = 10; }; new EffectProfile(eButtonOver) { effectname = "gui/buttonOver"; minDistance = 10; }; new AudioDescription(AudioGui) { volume = 1.0; isLooping= false; is3D = false; type = $GuiAudioType; }; new AudioDescription(AudioChat) { volume = 1.0; isLooping= false; is3D = false; type = $ChatAudioType; }; new AudioDescription(AudioGuiLoop) { volume = 1.0; isLooping= true; is3D = false; type = $GuiAudioType; }; new AudioProfile(sButtonDown) { filename = "gui/buttonDown.wav"; description = "audioGui"; preload = true; effect = eButtonDown; }; new AudioProfile(sButtonOver) { filename = "gui/buttonOver.wav"; description = "audioGui"; preload = true; effect = eButtonOver; }; new AudioProfile(sGotMail) { filename = "gui/youvegotmail.wav"; description = "audioGui"; preload = true; }; new EffectProfile(eLaunchMenuOpen) { effectname = "gui/launchMenuOpen"; minDistance = 10; }; new AudioProfile(sLaunchMenuOpen) { filename = "gui/launchMenuOpen.wav"; description = "audioGui"; preload = true; effect = eLaunchMenuOpen; }; new AudioProfile(sLaunchMenuOver) { filename = "gui/buttonOver.wav"; description = "audioGui"; preload = true; effect = eButtonOver; }; new AudioProfile(VoteForSound) { filename = "gui/buttonOver.wav"; description = "audioGui"; preload = true; }; new AudioProfile(VoteAgainstSound) { filename = "gui/buttonOver.wav"; description = "audioGui"; preload = true; }; new AudioProfile(TaskAcceptedSound) { filename = "fx/misc/command_accept.wav"; description = "audioGui"; preload = true; }; new AudioProfile(TaskDeclinedSound) { filename = "fx/misc/command_deny.wav"; description = "audioGui"; preload = true; }; new AudioProfile(TaskCompletedSound) { filename = "fx/misc/command_complete.wav"; description = "audioGui"; preload = true; }; new AudioProfile(InputDeniedSound) { filename = "fx/misc/diagnostic_beep.wav"; description = "audioGui"; preload = true; }; //-------------------------------------------------------------------------- //-------------------------------------- Shapebase lock/homing tones... new AudioDescription(AudioLockTones) { volume = 1.0; isLooping= true; is3D = false; type = $EffectAudioType; }; new AudioProfile(sSearchingTone) // Sound that the FIRER hears when SEEKING a "hot" target { filename = "fx/weapons/missile_firer_search.wav"; description = "audioLockTones"; preload = true; }; new AudioProfile(sLockedTone) // Sound that the FIRER hears when a "hot" target is LOCKED { filename = "fx/weapons/missile_firer_lock.wav"; description = "audioLockTones"; preload = true; }; new AudioProfile(sMissileLockWarningTone) // Sound that the TARGET hears when a LOCK has been achieved { filename = "fx/weapons/missile_target_lock.wav"; description = "audioLockTones"; preload = true; }; new AudioProfile(sMissileHomingWarningTone) // Sound that the TARGET hears when a missile has been locked onto the target and is IN THE AIR { filename = "fx/weapons/missile_target_inbound.wav"; description = "audioLockTones"; preload = true; }; //-------------------------------------------------------------------------- new AudioProfile(HudInventoryHumSound) { filename = "gui/inventory_hum.wav"; description = "AudioGuiLoop"; preload = true; }; new EffectProfile(HudInventoryActivateEffect) { effectname = "gui/inventory_on"; minDistance = 10; }; new AudioProfile(HudInventoryActivateSound) { filename = "gui/inventory_on.wav"; description = "AudioGui"; preload = true; effect = HudInventoryActivateEffect; }; new EffectProfile(HudInventoryDeactivateEffect) { effectname = "gui/inventory_off"; minDistance = 10; }; new AudioProfile(HudInventoryDeactivateSound) { filename = "gui/inventory_off.wav"; description = "AudioGui"; preload = true; effect = HudInventoryDeactivateEffect; }; new AudioProfile(CommandMapHumSound) { filename = "gui/command_hum.wav"; description = "AudioGuiLoop"; preload = true; }; new EffectProfile(CommandMapActivateEffect) { effectname = "gui/command_on"; minDistance = 10; }; new AudioProfile(CommandMapActivateSound) { filename = "gui/command_on.wav"; description = "AudioGui"; effect = CommandMapActivateEffect; preload = true; }; new EffectProfile(CommandMapDeactivateEffect) { effectname = "gui/command_off"; minDistance = 10; }; new AudioProfile(CommandMapDeactivateSound) { filename = "gui/command_off.wav"; description = "AudioGui"; preload = true; effect = CommandMapDeactivateEffect; }; new AudioProfile(ShellScreenHumSound) { filename = "gui/shell_hum.wav"; description = "AudioGuiLoop"; preload = true; }; new AudioProfile(LoadingScreenSound) { filename = "gui/loading_hum.wav"; description = "AudioGuiLoop"; preload = true; }; new AudioProfile(VotePassSound) { filename = "fx/misc/vote_passes.wav"; description = "AudioGui"; preload = true; }; new AudioProfile(VoteNotPassSound) { filename = "fx/misc/vote_fails.wav"; description = "AudioGui"; preload = true; }; new AudioProfile(AdminForceSound) { filename = "fx/misc/bounty_completed.wav"; description = "AudioGui"; preload = true; }; new AudioProfile(VoteInitiatedSound) { filename = "fx/misc/vote_initiated.wav"; description = "AudioGui"; preload = true; }; // Tinman - not being used anymore... // new AudioProfile(OutOfBoundsSound) // { // filename = "gui/vote_nopass.wav"; // description = "AudioGuiLoop"; // preload = true; // }; new AudioProfile(BountyBellSound) { filename = "fx/misc/bounty_bonus.wav"; description = "AudioGui"; preload = true; }; new AudioProfile(SiegeSwitchSides) { filename = "fx/misc/siege_switching.wav"; description = "AudioGui"; preload = true; }; new EffectProfile(ObjectiveCompletedEffect) { effectname = "misc/bounty_bonus"; minDistance = 10; }; new AudioProfile(ObjectiveCompleted) { filename = "fx/misc/bounty_bonus.wav"; description = "AudioGui"; effect = ObjectiveCompletedEffect; preload = true; }; PK !(oE##scripts/clientDefaults.cs$JoinGamePort = 28000; $pref::Audio::activeDriver = "default"; if ( $platform $= "linux" ) { $pref::Audio::drivers = "OpenAL"; } else { $pref::Audio::drivers = "Miles"; } $pref::Audio::frequency = 22050; $pref::Audio::sampleBits = 16; $pref::Audio::channels = 2; $pref::Audio::enableVoiceCapture = 1; $pref::Audio::voiceChannels = 1; if ( $platform $= "linux" ) { $pref::Audio::encodingLevel = 3; $pref::Audio::decodingMask = 8; } else { $pref::Audio::encodingLevel = 0; $pref::Audio::decodingMask = 1; } $pref::Audio::forceMaxDistanceUpdate = 0; $pref::Audio::environmentEnabled = 0; $pref::Audio::musicEnabled = 1; $pref::Audio::musicVolume = 0.8; $pref::Audio::masterVolume = 0.8; $pref::Audio::effectsVolume = 1.0; $pref::Audio::voiceVolume = 1.0; $pref::Audio::guiVolume = 0.8; $pref::Audio::radioVolume = 0.8; $pref::Audio::captureGainScale = 1.0; $pref::currentChatMenu = "defaultChatMenu"; $pref::Email::Column0 = 30; $pref::Email::Column1 = 250; $pref::Email::Column2 = 250; $pref::Email::Column3 = 150; $pref::Email::ComposeWindowPos = "74 32"; $pref::Email::ComposeWindowExtent = "500 408"; $pref::Email::SortColumnKey = 3; $pref::Email::SortInc = 1; $pref::EnableBadWordFilter = 1; $pref::FavNames0 = "SCOUT SNIPER"; $pref::FavNames1 = "SCOUT ASSASSIN"; $pref::FavNames2 = "SCOUT DEFENSE"; $pref::FavNames3 = "ASSAULT OFFENSE"; $pref::FavNames4 = "ASSAULT DEPLOYER"; $pref::FavNames5 = "ASSAULT DEFENSE"; $pref::FavNames6 = "TAILGUNNER"; $pref::FavNames7 = "JUGGERNAUT OFFENSE"; $pref::FavNames8 = "JUGGERNAUT DEPLOYER"; $pref::FavNames9 = "JUGGERNAUT DEFENSE"; $pref::FavNames10 = "SCOUT FLAG CHASER"; $pref::FavNames11 = "ASSAULT DESTROYER"; $pref::FavNames12 = "LANDSPIKE DEPLOYER"; $pref::FavNames13 = "INVENTORY DEPLOYER"; $pref::FavNames14 = "FORWARD ASSAULT"; $pref::FavNames15 = "EARLY WARNING"; $pref::FavNames16 = "DECOY"; $pref::FavNames17 = "HEAVY LOVE"; $pref::FavNames18 = "FLAG DEFENDER"; $pref::FavNames19 = "INFILTRATOR"; $pref::Favorite0 = "armor\tScout\tweapon\tLaser Rifle\tweapon\tSpinfusor\tweapon\tGrenade Launcher\tpack\tEnergy Pack\tGrenade\tFlare Grenade\tMine\tMine"; $pref::Favorite1 = "armor\tScout\tweapon\tPlasma Rifle\tweapon\tChaingun\tweapon\tShocklance\tpack\tCloak Pack\tGrenade\tWhiteout Grenade\tMine\tMine"; $pref::Favorite2 = "armor\tScout\tweapon\tBlaster\tweapon\tSpinfusor\tweapon\tPlasma Rifle\tpack\tShield Pack\tGrenade\tGrenade\tMine\tMine"; $pref::Favorite3 = "armor\tAssault\tweapon\tPlasma Rifle\tweapon\tSpinfusor\tweapon\tGrenade Launcher\tweapon\tChaingun\tpack\tShield Pack\tGrenade\tGrenade\tMine\tMine"; $pref::Favorite4 = "armor\tAssault\tweapon\tPlasma Rifle\tweapon\tBlaster\tweapon\tSpinfusor\tweapon\tMissile Launcher\tpack\tInventory Station\tGrenade\tDeployable Camera\tMine\tMine"; $pref::Favorite5 = "armor\tAssault\tweapon\tChaingun\tweapon\tSpinfusor\tweapon\tMissile Launcher\tweapon\tELF Projector\tpack\tShield Pack\tGrenade\tConcussion Grenade\tMine\tMine"; $pref::Favorite6 = "armor\tAssault\tweapon\tChaingun\tweapon\tGrenade Launcher\tweapon\tBlaster\tweapon\tMissile Launcher\tpack\tAmmunition Pack\tGrenade\tFlare Grenade\tMine\tMine"; $pref::Favorite7 = "armor\tJuggernaut\tweapon\tPlasma Rifle\tweapon\tSpinfusor\tweapon\tGrenade Launcher\tweapon\tFusion Mortar\tweapon\tMissile Launcher\tpack\tAmmunition Pack\tGrenade\tGrenade\tMine\tMine"; $pref::Favorite8 = "armor\tJuggernaut\tweapon\tChaingun\tweapon\tMissile Launcher\tweapon\tFusion Mortar\tweapon\tPlasma Rifle\tweapon\tBlaster\tpack\tInventory Station\tGrenade\tDeployable Camera\tMine\tMine"; $pref::Favorite9 = "armor\tJuggernaut\tweapon\tBlaster\tweapon\tPlasma Rifle\tweapon\tGrenade Launcher\tweapon\tMissile Launcher\tweapon\tFusion Mortar\tpack\tShield Pack\tGrenade\tConcussion Grenade\tMine\tMine"; $pref::Favorite10 = "armor\tScout\tweapon\tChaingun\tweapon\tGrenade Launcher\tweapon\tELF Projector\tpack\tEnergy Pack\tGrenade\tConcussion Grenade\tMine\tMine"; $pref::Favorite11 = "armor\tAssault\tweapon\tBlaster\tweapon\tPlasma Rifle\tweapon\tSpinfusor\tweapon\tGrenade Launcher\tpack\tShield Pack\tGrenade\tGrenade\tMine\tMine"; $pref::Favorite12 = "armor\tAssault\tweapon\tChaingun\tweapon\tSpinfusor\tweapon\tPlasma Rifle\tweapon\tGrenade Launcher\tpack\tLandspike Turret\tGrenade\tGrenade\tMine\tMine"; $pref::Favorite13 = "armor\tAssault\tweapon\tPlasma Rifle\tweapon\tSpinfusor\tweapon\tGrenade Launcher\tweapon\tChaingun\tpack\tInventory Station\tGrenade\tGrenade\tMine\tMine"; $pref::Favorite14 = "armor\tAssault\tweapon\tELF Projector\tweapon\tGrenade Launcher\tweapon\tSpinfusor\tweapon\tMissile Launcher\tpack\tEnergy Pack\tGrenade\tWhiteout Grenade\tMine\tMine"; $pref::Favorite15 = "armor\tAssault\tweapon\tChaingun\tweapon\tSpinfusor\tweapon\tGrenade Launcher\tweapon\tELF Projector\tpack\tPulse Sensor Pack\tGrenade\tConcussion Grenade\tMine\tMine"; $pref::Favorite16 = "armor\tScout\tweapon\tChaingun\tweapon\tGrenade Launcher\tweapon\tSpinfusor\tpack\tSensor Jammer Pack\tGrenade\tWhiteout Grenade\tMine\tMine"; $pref::Favorite17 = "armor\tJuggernaut\tweapon\tChaingun\tweapon\tSpinfusor\tweapon\tPlasma Rifle\tweapon\tFusion Mortar\tweapon\tMissile Launcher\tpack\tShield Pack\tGrenade\tConcussion Grenade\tMine\tMine"; $pref::Favorite18 = "armor\tJuggernaut\tweapon\tSpinfusor\tweapon\tGrenade Launcher\tweapon\tFusion Mortar\tweapon\tPlasma Rifle\tweapon\tChaingun\tpack\tShield Pack\tGrenade\tGrenade\tMine\tMine"; $pref::Favorite19 = "armor\tScout\tweapon\tChaingun\tweapon\tSpinfusor\tweapon\tShocklance\tpack\tSatchel Charge\tGrenade\tDeployable Camera\tMine\tMine"; $pref::Forum::Column0 = 290; $pref::Forum::Column1 = 265; $pref::Forum::Column2 = 159; $pref::Forum::CacheSize = 100; $pref::Forum::PostWindowPos = "69 32"; $pref::Forum::PostWindowExtent = "500 408"; $pref::HudMessageLogSize = 40; $pref::Input::ActiveConfig = "MyConfig"; $pref::Input::LinkMouseSensitivity = 1; $pref::Input::KeyboardTurnSpeed = 0.1; $pref::Interior::TexturedFog = 0; $pref::IRCClient::autoreconnect = 1; $pref::IRCClient::awaymsg = "Don't be alarmed. I'm going to step away from my computer."; $pref::IRCClient::banmsg = "Get out. And stay out!"; $pref::IRCClient::kickmsg = "Alright, you're outta here!"; $pref::IRCClient::hostmsg = "left to host a game."; $pref::IRCClient::showJoin = true; $pref::IRCClient::showLeave = true; $pref::Lobby::Column1 = 120; $pref::Lobby::Column2 = 120; $pref::Lobby::Column3 = 50; $pref::Lobby::Column4 = 50; $pref::Lobby::Column5 = 50; $pref::Lobby::SortColumnKey = 3; $pref::Lobby::SortInc = 0; $pref::Net::graphFields = 43; $pref::Net::simPacketLoss = 0; $pref::Net::simPing = 0; $pref::Net::DisplayOnMaster = "Always"; $pref::Net::RegionMask = 2; $pref::Net::CheckEmail = 0; $pref::Net::DisconnectChat = 0; $pref::Net::LagThreshold = 400; $pref::Net::Preset = 1; $pref::Net::PacketRateToClient = 16; $pref::Net::PacketSize = 240; $pref::Net::PacketRateToServer = 20; $pref::News::PostWindowPos = "85 39"; $pref::News::PostWindowExtent = "470 396"; $pref::Player::Count = 0; $pref::Player::Current = 0; $pref::Player::defaultFov = 90; $pref::Player::zoomSpeed = 0; $pref::RememberPassword = 0; $pref::sceneLighting::cacheSize = 60000; $pref::sceneLighting::purgeMethod = "lastModified"; $pref::sceneLighting::cacheLighting = 1; $pref::sceneLighting::terrainGenerateLevel = 1; $pref::ServerBrowser::activeFilter = 0; $pref::ServerBrowser::Column0 = "0 183"; $pref::ServerBrowser::Column1 = "1 60"; $pref::ServerBrowser::Column2 = "2 30"; $pref::ServerBrowser::Column3 = "3 45"; $pref::ServerBrowser::Column4 = "4 120"; $pref::ServerBrowser::Column5 = "5 140"; $pref::ServerBrowser::Column6 = "7 80"; $pref::ServerBrowser::Column7 = "8 80"; $pref::ServerBrowser::Column8 = "9 170"; if ( !isDemo() ) { $pref::ServerBrowser::Column9 = "6 74"; $pref::ServerBrowser::Column10 = "10 70"; $pref::ServerBrowser::Column11 = "11 100"; } $pref::ServerBrowser::FavoriteCount = 0; $pref::ServerBrowser::SortColumnKey = 3; $pref::ServerBrowser::SortInc = 1; $pref::ServerBrowser::InfoWindowOpen = 0; $pref::ServerBrowser::InfoWindowPos = "145 105"; $pref::ServerBrowser::InfoWindowExtent = "350 270"; $pref::ServerBrowser::IgnoreCase = 1; $pref::Shell::lastBackground = 0; $pref::Terrain::DynamicLights = 1; $pref::toggleVehicleView = 0; $pref::Topics::Column0 = 245; $pref::Topics::Column1 = 50; $pref::Topics::Column2 = 125; $pref::Topics::Column3 = 134; $pref::Topics::SortColumnKey = 3; $pref::Topics::SortInc = 0; $pref::Video::displayDevice = "OpenGL"; $pref::chatHudLength = 1; $pref::useImmersion = 1; $pref::Video::fullScreen = 1; $pref::Video::allowOpenGL = 1; $pref::Video::allowD3D = 1; $pref::Video::preferOpenGL = 1; $pref::Video::appliedPref = 0; $pref::Video::disableVerticalSync = 1; $pref::VisibleDistanceMod = 1.0; $pref::OpenGL::force16BitTexture = 0; $pref::OpenGL::forcePalettedTexture = 1; $pref::OpenGL::maxHardwareLights = 3; $pref::OpenGL::allowTexGen = 1; $pref::Vehicle::pilotTeleport = 1; PK !(G*ә!!scripts/clientTasks.cs//------------------------------------------------------------------------------ // Client tasks //------------------------------------------------------------------------------ $MAX_OUTSTANDING_TASKS = 10; function clientCmdResetTaskList() { if((TaskList.currentTask != -1) && isObject(TaskList.currentTask)) { TaskList.currentTask.delete(); TaskList.currentTask = -1; } TaskList.currentTask = -1; TaskList.reset(); } //-------------------------------------------------------------------------- function clientCmdTaskInfo(%client, %aiObjtive, %team, %description) { // copy the info TaskList.currentTaskClient = %client; TaskList.currentAIObjective = %aiObjective; TaskList.currentTaskIsTeam = %team; TaskList.currentTaskDescription = detag(%description); } function clientAcceptTask(%task) { %task.sendToServer(); commandToServer('AcceptTask', %task.client, %task.AIObjective, %task.description); TaskList.removeTask(%task, true); //play the audio alxPlay(TaskAcceptedSound, 0, 0, 0); } function clientDeclineTask(%task) { commandToServer('DeclineTask', %task.client, %task.description, %task.team); TaskList.removeTask(%task, false); //play the audio alxPlay(TaskDeclinedSound, 0, 0, 0); } function clientTaskCompleted() { if((TaskList.currentTask != -1) && isObject(TaskList.currentTask)) { commandToServer('CompletedTask', TaskList.currentTask.client, TaskList.currentTask.description); TaskList.currentTask.delete(); TaskList.currentTask = -1; //play the audio alxPlay(TaskDeclinedSound, 0, 0, 0); } } //------------------------------------------------------------------------------ // HUD information //------------------------------------------------------------------------------ function clientCmdPotentialTeamTask(%description) { addMessageHudLine("\c2Team:\cr " @ detag(%description) @ "."); } function clientCmdPotentialTask(%from, %description) { addMessageHudLine("\c3" @ detag(%from) @ ":\cr " @ detag(%description) @ "."); } function clientCmdTaskDeclined(%from, %description) { addMessageHudLine(detag(%from) @ " refused your task '" @ detag(%description) @ "'."); } function clientCmdTaskAccepted(%from, %description) { addMessageHudLine(detag(%from) @ " accepted your task '" @ detag(%description) @ "'."); } function clientCmdTaskCompleted(%from, %description) { addMessageHudLine(detag(%from) @ " completed your task '" @ detag(%description) @ "'."); } function clientCmdAcceptedTask(%description) { addMessageHudLine("\c3Your current task is:\cr " @ %description); } //------------------------------------------------------------------------------ function clientAcceptCurrentTask() { %task = TaskList.getCurrentTask(); if(%task != -1) clientAcceptTask(%task); } function clientDeclineCurrentTask() { %task = TaskList.getCurrentTask(); if(%task != -1) clientDeclineTask(%task); } //-------------------------------------------------------------------------- // TaskList: //-------------------------------------------------------------------------- function TaskList::onAdd(%this) { %this.ownedTasks = -1; %this.currentTask = -1; %this.reset(); // install some chat callbacks installChatItemCallback('ChatCmdAcknowledged', clientAcceptCurrentTask); installChatItemCallback('ChatCmdCompleted', clientTaskCompleted); installChatItemCallback('ChatCmdDeclined', clientDeclineCurrentTask); } function TaskList::reset(%this) { %this.currentTaskClient = -1; %this.currentAIObjective = -1; %this.currentTaskIsTeam = false; %this.currentTaskDescription = ""; if((%this.ownedTasks != -1) && isObject(%this.ownedTasks)) %this.ownedTasks.delete(); %this.ownedTasks = new SimGroup(); %this.currentIndex = 1; %this.clear(); } function TaskList::onRemove(%this) { if((%this.ownedTasks != -1) && isObject(%this.ownedTasks)) %this.ownedTasks.delete(); } function TaskList::handleDyingTask(%this, %task) { %this.ownedTasks.add(%task); } //-------------------------------------------------------------------------- function TaskList::getLastTask(%this) { %count = %this.rowCount(); if(%count == 0) return(-1); return(%this.getRowId(%count - 1)); } function TaskList::getCurrentTask(%this) { if(%this.isVisible()) { %id = %this.getSelectedId(); if(%id != -1) return(%id); } return(%this.getLastTask()); } function TaskList::addTask(%this, %task) { // remove any duplicate... %count = %this.rowCount(); for(%i = 0; %i < %count; %i++) { %oldTask = %this.getRowId(%i); if((%oldTask.client == %task.client) && (detag(%oldTask.description) $= detag(%task.description))) { %this.removeTask(%oldTask, false); break; } } // need to remove the oldest task? if(%this.rowCount() == $MAX_OUTSTANDING_TASKS) %this.removeTask(%this.getRowId(0), false); %this.addRow(%task, %task.clientName @ "\t" @ detag(%task.description), %this.rowCount()); } function TaskList::removeTask(%this, %task, %close) { %row = %this.getRowNumById(%task); if(%row == -1) return; %select = %this.getSelectedId() == %task; if(isObject(%task)) %task.delete(); %this.removeRow(%row); if(%select && (%this.rowCount() != 0)) { if(%row == %this.rowCount()) %row = %row - 1; %this.setSelectedRow(%row); } if(%close && %this.isVisible()) showTaskHudDlg(false); } function TaskList::updateSelected(%this, %show) { %task = %this.getSelectedId(); if(%task == -1) return; if(%show) { %task.addPotentialTask(); if(CommanderMapGui.open) CommanderMap.selectClientTarget(%task, true); else NavHud.keepClientTargetAlive(%task); } else { if(CommanderMapGui.open) CommanderMap.selectClientTarget(%task, false); else NavHud.keepClientTargetAlive(0); } } function TaskList::selectLatest(%this) { %this.setSelectedRow(-1); %id = %this.getLastTask(); if(%id == -1) return; %this.setSelectedById(%id); %this.updateSelected(true); } function TaskList::selectPrevious(%this) { %id = %this.getSelectedId(); if(%id == -1) { %this.selectLatest(); return; } %row = %this.getRowNumById(%id); if(%row == 0) %row = %this.rowCount() - 1; else %row -= 1; %this.setSelectedRow(%row); %this.updateSelected(true); } function TaskList::selectNext(%this) { %id = %this.getSelectedId(); if(%id == -1) { %this.selectLatest(); return; } %row = %this.getRowNumById(%id); if(%row == (%this.rowCount() - 1)) %row = 0; else %row += 1; %this.setSelectedRow(%row); %this.updateSelected(true); } //-------------------------------------------------------------------------- function showTaskHudDlg(%show) { if(%show) { if(!TaskHudDlg.isVisible()) { TaskHudDlg.setVisible(true); Canvas.pushDialog(TaskHudDlg); } } else { if(TaskHudDlg.isVisible()) { TaskHudDlg.setVisible(false); Canvas.popDialog(TaskHudDlg); } } } //-------------------------------------------------------------------------- // - toggle 'visible' so this, and other, controls can determine if it is up function toggleTaskListDlg(%val) { if(%val) { if(ChatMenuHudDlg.isVisible() || TaskHudDlg.isVisible()) showTaskHudDlg(false); else showTaskHudDlg(true); } } new ActionMap(TaskHudMap); TaskHudMap.bindCmd(keyboard, "up", "TaskList.selectPrevious();", ""); TaskHudMap.bindCmd(keyboard, "down", "TaskList.selectNext();", ""); TaskHudMap.bindCmd(keyboard, "escape", "if(TaskHudDlg.isVisible()) showTaskHudDlg(false);", ""); function TaskHudDlg::onWake(%this) { TaskHudMap.push(); TaskList.setVisible(true); TaskList.selectLatest(); } function TaskHudDlg::onSleep(%this) { TaskHudMap.pop(); TaskList.setVisible(false); TaskList.updateSelected(false); //make sure the action maps are still pushed in the correct order... updateActionMaps(); }PK !(9Tscripts/commanderMap.cs//-------------------------------------------------------------------------- // ActionMap: //-------------------------------------------------------------------------- $CommanderMap::useMovementKeys = false; // help overlay toggle function toggleCmdMapHelpGui( %val ) { if ( %val) toggleCmdMapHelpText(); } // shortcuts to buttons: top buttons function toggleAction(%control) { %control.setValue(!%control.getValue()); %control.onAction(); } function bindAction(%fromMap, %command, %bindCmd, %bind1, %bind2 ) { if(!isObject(%fromMap)) return(false); %bind = %fromMap.getBinding(%command); if(%bind $= "") return(false); // only allow keyboard %device = getField(%bind, 0); if(%device !$= "keyboard") return(false); %action = getField(%bind, 1); // bind or bindcmd? if(%bindCmd) CommanderKeyMap.bindCmd( %device, %action, %bind1, %bind2 ); else CommanderKeyMap.bind( %device, %action, %bind1 ); return(true); } function createCommanderKeyMap() { if(isObject(CommanderKeyMap)) CommanderKeyMap.delete(); new ActionMap(CommanderKeyMap); // copy in all the binds we want from the moveMap CommanderKeyMap.copyBind( moveMap, ToggleMessageHud ); CommanderKeyMap.copyBind( moveMap, TeamMessageHud ); CommanderKeyMap.copyBind( moveMap, resizeChatHud ); CommanderKeyMap.copyBind( moveMap, pageMessageHudUp ); CommanderKeyMap.copyBind( moveMap, pageMessageHudDown ); CommanderKeyMap.copyBind( moveMap, activateChatMenuHud ); // Miscellaneous other binds: CommanderKeyMap.copyBind( moveMap, voteYes ); CommanderKeyMap.copyBind( moveMap, voteNo ); CommanderKeyMap.copyBind( moveMap, toggleCommanderMap ); CommanderKeyMap.copyBind( moveMap, toggleHelpGui ); CommanderKeyMap.copyBind( moveMap, toggleScoreScreen); CommanderKeyMap.copyBind( moveMap, startRecordingDemo ); CommanderKeyMap.copyBind( moveMap, stopRecordingDemo ); CommanderKeyMap.copyBind( moveMap, voiceCapture ); CommanderKeyMap.bindCmd( keyboard, escape, "", "toggleCommanderMap( true );" ); // grab help key from movemap if(!bindAction( moveMap, toggleHelpGui, false, toggleCmdMapHelpGui )) CommanderKeyMap.bind( keyboard, F1, toggleCmdMapHelpGui ); // Bind the command assignment/response keys as well: CommanderKeyMap.copyBind( moveMap, toggleTaskListDlg ); CommanderKeyMap.copyBind( moveMap, fnAcceptTask ); CommanderKeyMap.copyBind( moveMap, fnDeclineTask ); CommanderKeyMap.copyBind( moveMap, fnTaskCompleted ); CommanderKeyMap.copyBind( moveMap, fnResetTaskList ); // button shortcuts CommanderKeyMap.bindCmd( keyboard, 1, "toggleAction(CMDPlayersButton);", "" ); CommanderKeyMap.bindCmd( keyboard, 2, "toggleAction(CMDTacticalButton);", "" ); CommanderKeyMap.bindCmd( keyboard, 3, "toggleAction(CMDDeployedTacticalButton);", "" ); CommanderKeyMap.bindCmd( keyboard, 4, "toggleAction(CMDMiscButton);", "" ); CommanderKeyMap.bindCmd( keyboard, 5, "toggleAction(CMDDeployedMiscButton);", "" ); CommanderKeyMap.bindCmd( keyboard, 6, "toggleAction(CMDWaypointsButton);", "" ); CommanderKeyMap.bindCmd( keyboard, 7, "toggleAction(CMDObjectivesButton);", "" ); // bottom buttons CommanderKeyMap.bindCmd( keyboard, w, "toggleAction(CMDShowSensorsButton);", "" ); CommanderKeyMap.bindCmd( keyboard, space, "cycleMouseMode();", "" ); CommanderKeyMap.bindCmd( keyboard, q, "toggleAction(CMDCenterButton);", "" ); CommanderKeyMap.bindCmd( keyboard, t, "toggleAction(CMDTextButton);", "" ); CommanderKeyMap.bindCmd( keyboard, b, "toggleAction(CMDCameraButton);", "" ); // camera control (always arrows) CommanderKeyMap.bindCmd( keyboard, left, "CommanderMap.cameraMove(left, true);", "commanderMap.cameraMove(left, false);" ); CommanderKeyMap.bindCmd( keyboard, right, "CommanderMap.cameraMove(right, true);", "commanderMap.cameraMove(right, false);" ); CommanderKeyMap.bindCmd( keyboard, up, "CommanderMap.cameraMove(up, true);", "commanderMap.cameraMove(up, false);" ); CommanderKeyMap.bindCmd( keyboard, down, "CommanderMap.cameraMove(down, true);", "commanderMap.cameraMove(down, false);" ); CommanderKeyMap.bindCmd( keyboard, numpadadd, "CommanderMap.cameraMove(in, true);", "commanderMap.cameraMove(in, false);" ); CommanderKeyMap.bindCmd( keyboard, numpadminus, "CommanderMap.cameraMove(out, true);", "commanderMap.cameraMove(out, false);" ); CommanderKeyMap.bindCmd( keyboard, a, "CommanderMap.cameraMove(in, true);", "commanderMap.cameraMove(in, false);" ); CommanderKeyMap.bindCmd( keyboard, z, "CommanderMap.cameraMove(out, true);", "commanderMap.cameraMove(out, false);" ); // steal the movement keys? (more likely than others to be a duplicate binding) if($CommanderMap::useMovementKeys) { bindAction( moveMap, moveleft, true, "CommanderMap.cameraMove(left, true);", "commanderMap.cameraMove(left, false);" ); bindAction( moveMap, moveright, true, "CommanderMap.cameraMove(right, true);", "commanderMap.cameraMove(right, false);" ); bindAction( moveMap, moveforward, true, "CommanderMap.cameraMove(up, true);", "commanderMap.cameraMove(up, false);" ); bindAction( moveMap, movebackward, true, "CommanderMap.cameraMove(down, true);", "commanderMap.cameraMove(down, false);" ); } else { CommanderKeyMap.bindCmd( keyboard, s, "CommanderMap.cameraMove(left, true);", "commanderMap.cameraMove(left, false);" ); CommanderKeyMap.bindCmd( keyboard, f, "CommanderMap.cameraMove(right, true);", "commanderMap.cameraMove(right, false);" ); CommanderKeyMap.bindCmd( keyboard, e, "CommanderMap.cameraMove(up, true);", "commanderMap.cameraMove(up, false);" ); CommanderKeyMap.bindCmd( keyboard, d, "CommanderMap.cameraMove(down, true);", "commanderMap.cameraMove(down, false);" ); } } //-------------------------------------------------------------------------- // Default Icons: new CommanderIconData(CMDDefaultIcon) { selectImage = "animation base_select true true looping 100"; hilightImage = "animation base_select true true flipflop 100"; }; new CommanderIconData(CMDAssignedTaskIcon) { baseImage = "static diamond_not_selected true true"; selectImage = "animation assigned_task_anim false true looping 100"; hilightImage = "animation assigned_task_anim false true looping 100"; }; new CommanderIconData(CMDPotentialTaskIcon) { baseImage = "static diamond_not_selected true true"; selectImage = "animation assigned_task_anim false true looping 100"; hilightImage = "animation assigned_task_anim false true looping 100"; }; new CommanderIconData(CMDWaypointIcon) { baseImage = "animation waypoint_anim false false looping 100"; }; //-------------------------------------------------------------------------- // CommanderMapGui: //-------------------------------------------------------------------------- function clientCmdResetCommandMap() { CommanderMapGui.reset(); } function clientCmdScopeCommanderMap(%scope) { if(!isPlayingDemo()) return; if(%scope) { CommanderMap.openAllCategories(); CommanderMapGui.open(); } else CommanderMapGui.close(); } function CommanderMapGui::onWake(%this) { clientCmdControlObjectReset(); commandToServer('ScopeCommanderMap', true); createCommanderKeyMap(); CommanderKeyMap.push(); if ( $HudHandle[CommandScreen] ) alxStop( $HudHandle[CommandScreen] ); alxPlay(CommandMapActivateSound, 0, 0, 0); $HudHandle[CommandScreen] = alxPlay(CommandMapHumSound, 0, 0, 0); CMDTextButton.setValue(CommanderMap.renderText); // follow the player the first time if(%this.firstWake) { CommanderMap.selectControlObject(); CommanderMap.followLastSelected(); %this.firstWake = false; } if(CommanderTV.open) CommanderTV.watchTarget(CommanderTV.target); // chat hud dialog Canvas.pushDialog(MainChatHud); chatHud.attach(HudMessageVector); %this.open = true; } function CommanderMapGui::onSleep(%this) { %this.open = false; commandToServer('ScopeCommanderMap', false); if(CMContextPopup.visible == true) CMContextPopup.reset(); CommanderKeyMap.pop(); Canvas.popDialog(MainChatHud); alxStop($HudHandle[CommandScreen]); alxPlay(CommandMapDeactivateSound, 0, 0, 0); $HudHandle[CommandScreen] = ""; // will reset the control object on this client.. should only be sent // if this gui is being removed outside of CommanderMapGui::close() if(CommanderTV.open && CommanderTV.attached) commandToServer('AttachCommanderCamera', -1); //always set the cursor back to an arrow when you leave... Canvas.setCursor(CMDCursorArrow); } function CommanderMapGui::open(%this) { if(%this.open) return; commandToServer('SetPDAPose', true); Canvas.setContent(%this); } function CommanderMapGui::close(%this) { if(!%this.open) return; // only need to have control object reset if still attached to an object // if(CommanderTV.open && CommanderTV.attached) // { commandToServer('ResetControlObject'); // reset the attached state since we will not be getting an attached response CommanderTV.attached = false; // } // else // clientCmdControlObjectReset(); commandToServer('SetPDAPose', false); } function CommanderMapGui::toggle(%this) { if(%this.open) %this.close(); else %this.open(); } function CommanderMapGui::onAdd(%this) { %this.open = false; new GuiControl(CMContextPopupDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; new GuiCommanderMapPopupMenu(CMContextPopup) { profile = "CommanderPopupProfile"; position = "0 0"; extent = "0 0"; minExtent = "0 0"; maxPopupHeight = "200"; }; }; CMContextPopup.numEntries = 0; CMContextPopup.actionMap = -1; CMContextPopup.focusedEntry = -1; CMContextPopup.visible = false; CMContextPopup.target = -1; } function CommanderMapGui::reset(%this) { clientCmdControlObjectReset(); CommanderMap.openAllCategories(); CommanderMap.resetCamera(); CommanderTV.watchTarget(-1); // remove all tasks and clean task list clientCmdResetTaskList(); // reset waypoints if(isObject($ClientWaypoints)) $ClientWaypoints.delete(); // this can be called when not connected to a server if(isObject(ServerConnection)) { $ClientWaypoints = new SimGroup(); ServerConnection.add($ClientWaypoints); } %this.firstWake = true; CommanderTree.currentWaypointID = 0; } function CommanderMapGui::openCameraControl(%this, %open) { %step = getWord(CommanderTV.extent, 1); %x = getWord(CommanderTreeContainer.position, 0); %y = getWord(CommanderTreeContainer.position, 1); %w = getWord(CommanderTreeContainer.extent, 0); %h = getWord(CommanderTreeContainer.extent, 1); if(%open) %h = %h - %step; else %h = %h + %step; CommanderTreeContainer.resize(%x, %y, %w, %h); CommanderTV.setVisible(%open); CommanderTV.open = %open; CommanderTV.watchTarget(CommanderTV.target); if(!CommanderTV.open) commandToServer('AttachCommanderCamera', -1); } //-------------------------------------------------------------------------- // CMContextPopup: //-------------------------------------------------------------------------- function CMContextPopup::reset(%this) { if(%this.actionMap != -1) { %this.actionMap.pop(); %this.actionMap.delete(); } for(%i = 0; %i < %this.numEntries; %i++) { %this.entryKeys[%i] = ""; %this.entryCommands[%i] = ""; } %this.visible = false; %this.numEntries = 0; %this.actionMap = -1; if(%this.focusedEntry != -1) %this.focusedEntry.lockFocus(false); %this.focusedEntry = -1; %this.forceClose(); Canvas.popDialog(CMContextPopupDlg); // need to delete the target if it was not used if(isObject(%this.target)) { if(%this.target.getTargetId() != -1) %this.target.delete(); %this.target = -1; } } function CMContextPopup::display(%this) { if(%this.numEntries == 0) return; %this.actionMap = new ActionMap(); for(%i = 0; %i < %this.numEntries; %i++) if(%this.entryKeys[%i] !$= "") %this.actionMap.bindCmd(keyboard, %this.entryKeys[%i], "", %this @ ".onKeySelect(" @ %i @ ");"); %this.actionMap.bindCmd(keyboard, escape, "", %this @ ".reset();"); %this.actionMap.push(); if(%this.focusedEntry != -1) %this.focusedEntry.lockFocus(true); %this.visible = true; Canvas.pushDialog(CMContextPopupDlg); %this.forceOnAction(); } function CMContextPopup::addEntry(%this, %key, %text, %command) { %idx = %this.numEntries; %this.entryKeys[%idx] = %key; %this.entryCommands[%idx] = %command; %this.numEntries++; %this.add(%text, %idx); } function CMContextPopup::onKeySelect(%this, %index) { %this.onSelect(%index, %this.getTextById(%index)); } function CMContextPopup::onSelect(%this, %index, %value) { CommanderTree.processCommand(%this.entryCommands[%index], %this.target, %this.typeTag); %this.reset(); } function CMContextPopup::onCancel( %this ) { %this.reset(); } //------------------------------------------------------------------------------ // CommanderTree: //------------------------------------------------------------------------------ function CommanderTree::onAdd(%this) { %this.headerHeight = 20; %this.entryHeight = 20; %this.reset(); %this.addCategory("Clients", "Teammates", "clients"); %this.addCategory("Tactical", "Tactical Assets", "targets"); %this.addCategory("DTactical", "Deployed Tactical", "targets"); %this.addCategory("Support", "Support Assets", "targets"); %this.addCategory("DSupport", "Deployed Support", "targets"); %this.addCategory("Waypoints", "Waypoints", "waypoints"); %this.addCategory("Objectives", "Objectives", "targets"); // targetType entries use registered info if no ShapeBaseData exists %this.registerEntryType("Clients", getTag('_ClientConnection'), false, "commander/MiniIcons/com_player_grey", "255 255 255"); %this.registerEntryType("Waypoints", $CMD_WAYPOINTTYPEID, false, "commander/MiniIcons/com_waypoint_grey", "0 255 0"); %this.registerEntryType("Waypoints", $CMD_ASSIGNEDTASKTYPEID, false, "commander/MiniIcons/com_waypoint_grey", "0 0 255"); // %this.registerEntryType("Waypoints", $CMD_POTENTIALTASKTYPEID, false, "commander/MiniIcons/com_waypoint_grey", "255 255 0"); } function CommanderTree::onCategoryOpen(%this, %category, %open) { switch$ (%category) { case "Clients": CMDPlayersButton.setValue(%open); case "Tactical": CMDTacticalButton.setValue(%open); case "DTactical": CMDDeployedTacticalButton.setValue(%open); case "Support": CMDMiscButton.setValue(%open); case "DSupport": CMDDeployedMiscButton.setValue(%open); case "Waypoints": CMDWaypointsButton.setValue(%open); case "Objectives": CMDObjectivesButton.setValue(%open); } } function CommanderTree::controlObject(%this, %targetId) { commandToServer('ControlObject', %targetId); } //------------------------------------------------------------------------------ // CommanderMap: //------------------------------------------------------------------------------ function GuiCommanderMap::onAdd(%this) { %this.setMouseMode(select); %this.setTargetTypeVisible($CMD_POTENTIALTASKTYPEID, true); %this.setTargetTypeVisible($CMD_ASSIGNEDTASKTYPEID, true); } function GuiCommanderMap::onSelect(%this, %targetId, %nameTag, %typeTag, %select) { if(%select) { if(CommanderTV.target != %targetId) CommanderTV.watchTarget(%targetId); } else CommanderTV.watchTarget(-1); } function GuiCommanderMap::openCategory(%this, %ctrl, %name, %open) { %ctrl.setValue(%open); CommanderTree.openCategory(%name, %open); } function GuiCommanderMap::openAllCategories(%this) { %this.openCategory(CMDPlayersButton, "Clients", 1); %this.openCategory(CMDTacticalButton, "Tactical", 1); %this.openCategory(CMDDeployedTacticalButton, "DTactical", 1); %this.openCategory(CMDMiscButton, "Support", 1); %this.openCategory(CMDDeployedMiscButton, "DSupport", 1); %this.openCategory(CMDWaypointsButton, "Waypoints", 1); %this.openCategory(CMDObjectivesButton, "Objectives", 1); } //------------------------------------------------------------------------------ // Issuing commands //------------------------------------------------------------------------------ // misc. tasks (sensor group -1 is considered friendly with these) $CommandTask['PotentialTask', 0, text] = "\c1A\crccept"; $CommandTask['PotentialTask', 0, tag] = 'TaskAccepted'; $CommandTask['PotentialTask', 0, hotkey] = "a"; $CommandTask['PotentialTask', 1, text] = "\c1D\crecline"; $CommandTask['PotentialTask', 1, tag] = 'TaskDeclined'; $CommandTask['PotentialTask', 1, hotkey] = "d"; $CommandTask['AssignedTask', 0, text] = "\c1C\crompleted"; $CommandTask['AssignedTask', 0, tag] = 'TaskCompleted'; $CommandTask['AssignedTask', 0, hotkey] = "c"; $CommandTask['AssignedTask', 1, text] = "\c1R\cremove"; $CommandTask['AssignedTask', 1, tag] = 'TaskRemoved'; $CommandTask['AssignedTask', 1, hotkey] = "d"; $CommandTask['Location', 0, text] = "\c1D\crefend"; $CommandTask['Location', 0, tag] = 'DefendLocation'; $CommandTask['Location', 0, hotkey] = "d"; $CommandTask['Location', 1, text] = "\c1M\creet (at)"; $CommandTask['Location', 1, tag] = 'MeetLocation'; $CommandTask['Location', 1, hotkey] = "m"; $CommandTask['Location', 2, text] = "\c1B\cromb (at)"; $CommandTask['Location', 2, tag] = 'BombLocation'; $CommandTask['Location', 2, hotkey] = "b"; $CommandTask['Location', 3, text] = "\c1A\crttack"; $CommandTask['Location', 3, tag] = 'AttackLocation'; $CommandTask['Location', 3, hotkey] = "a"; $CommandTask['Location', 4, text] = "Deploy \c1I\crnventory"; $CommandTask['Location', 4, tag] = 'DeployEquipment'; $CommandTask['Location', 4, hotkey] = "i"; $CommandTask['Location', 5, text] = "Deploy \c1T\crurrets"; $CommandTask['Location', 5, tag] = 'DeployTurret'; $CommandTask['Location', 5, hotkey] = "t"; $CommandTask['Location', 6, text] = "Deploy \c1S\crensors"; $CommandTask['Location', 6, tag] = 'DeploySensor'; $CommandTask['Location', 6, hotkey] = "s"; $CommandTask['Location', 7, text] = "Create \c1W\craypoint"; $CommandTask['Location', 7, tag] = 'CreateWayPoint'; $CommandTask['Location', 7, hotkey] = "w"; $CommandTask['Waypoint', 0, text] = "\c1D\crelete waypoint"; $CommandTask['Waypoint', 0, tag] = 'DeleteWayPoint'; $CommandTask['Waypoint', 0, hotkey] = "d"; // object tasks $CommandTask['Player', 0, text] = "\c1E\crscort"; $CommandTask['Player', 0, tag] = 'EscortPlayer'; $CommandTask['Player', 0, hotkey] = "e"; $CommandTask['Player', 1, text] = "\c1R\crepair"; $CommandTask['Player', 1, tag] = 'RepairPlayer'; $CommandTask['Player', 1, hotkey] = "r"; $CommandTask['Player', 2, text] = "\c1A\crttack"; $CommandTask['Player', 2, tag] = 'AttackPlayer'; $CommandTask['Player', 2, hotkey] = "a"; $CommandTask['Player', 2, enemy] = true; $CommandTask['Flag', 0, text] = "\c1D\crefend"; $CommandTask['Flag', 0, tag] = 'DefendFlag'; $CommandTask['Flag', 0, hotkey] = "d"; $CommandTask['Flag', 1, text] = "\c1R\creturn"; $CommandTask['Flag', 1, tag] = 'ReturnFlag'; $CommandTask['Flag', 1, hotkey] = "r"; $CommandTask['Flag', 2, text] = "\c1C\crapture"; $CommandTask['Flag', 2, tag] = 'CaptureFlag'; $CommandTask['Flag', 2, hotkey] = "c"; $CommandTask['Flag', 2, enemy] = true; $CommandTask['Objective', 0, text] = "\c1C\crapture"; $CommandTask['Objective', 0, tag] = 'CaptureObjective'; $CommandTask['Objective', 0, hotkey] = "c"; $CommandTask['Objective', 1, text] = "\c1D\crefend"; $CommandTask['Objective', 1, tag] = 'DefendObjective'; $CommandTask['Objective', 1, hotkey] = "d"; $CommandTask['Object', 0, text] = "\c1R\crepair"; $CommandTask['Object', 0, tag] = 'RepairObject'; $CommandTask['Object', 0, hotkey] = "r"; $CommandTask['Object', 1, text] = "\c1D\crefend"; $CommandTask['Object', 1, tag] = 'DefendObject'; $CommandTask['Object', 1, hotkey] = "d"; $CommandTask['Object', 2, text] = "\c1A\crttack"; $CommandTask['Object', 2, tag] = 'AttackObject'; $CommandTask['Object', 2, hotkey] = "a"; $CommandTask['Object', 2, enemy] = true; $CommandTask['Object', 3, text] = "\c1L\craze"; $CommandTask['Object', 3, tag] = 'LazeObject'; $CommandTask['Object', 3, hotkey] = "l"; $CommandTask['Object', 3, enemy] = true; $CommandTask['Object', 4, text] = "\c1M\crortar"; $CommandTask['Object', 4, tag] = 'MortarObject'; $CommandTask['Object', 4, hotkey] = "m"; $CommandTask['Object', 4, enemy] = true; $CommandTask['Object', 5, text] = "\c1B\cromb"; $CommandTask['Object', 5, tag] = 'BombObject'; $CommandTask['Object', 5, hotkey] = "b"; $CommandTask['Object', 5, enemy] = true; function GuiCommanderMap::issueCommand(%this, %target, %typeTag, %nameTag, %sensorGroup, %mousePos) { CMContextPopup.position = %mousePos; CMContextPopup.clear(); CMContextPopup.target = %target; CMContextPopup.typeTag = %typeTag; CMContextPopup.nameTag = %nameTag; CMContextPopup.sensorGroup = %sensorGroup; %taskType = %this.getCommandType(%typeTag); if(%taskType $= "") { // script created target? if(%target.getTargetId() == -1) %target.delete(); CMDContextPopup.target = -1; return; } %this.buildPopupCommands(%taskType, %sensorGroup); CMContextPopup.display(); } function GuiCommanderMap::getCommandType(%this, %typeTag) { // special case (waypoints, location, tasks...) if(%typeTag == $CMD_LOCATIONTYPEID) return('Location'); else if(%typeTag == $CMD_WAYPOINTTYPEID) return('Waypoint'); else if(%typeTag == $CMD_POTENTIALTASKTYPEID) return('PotentialTask'); else if(%typeTag == $CMD_ASSIGNEDTASKTYPEID) return('AssignedTask'); // the handled types here (default is 'Object') switch$(getTaggedString(%typeTag)) { case "_ClientConnection": return('Player'); case "Flag": return('Flag'); case "Objective": return('Objective'); } return('Object'); } function GuiCommanderMap::buildPopupCommands(%this, %taskType, %sensorGroup) { %enemy = (%sensorGroup != ServerConnection.getSensorGroup()) && (%sensorGroup != -1); for(%i = 0; $CommandTask[%taskType, %i, text] !$= ""; %i++) { if(%enemy == $CommandTask[%taskType, %i, enemy]) { CMContextPopup.addEntry($CommandTask[%taskType, %i, hotkey], $CommandTask[%taskType, %i, text], $CommandTask[%taskType, %i, tag]); } } } //-------------------------------------------------------------------------- // Command processing //-------------------------------------------------------------------------- function CommanderTree::processCommand(%this, %command, %target, %typeTag) { switch$(getTaggedString(%command)) { // waypoints: tree owns the waypoint targets case "CreateWayPoint": %name = "Waypoint " @ %this.currentWaypointID++; %target.createWaypoint(%name); %id = %target.getTargetId(); if(%id != -1) { $ClientWaypoints.add(%target); CMContextPopup.target = -1; } return; case "DeleteWayPoint": %target.delete(); CMContextPopup.target = -1; return; // tasks: case "TaskAccepted": clientAcceptTask(%target); return; case "TaskDeclined": clientDeclineTask(%target); return; case "TaskCompleted": clientTaskCompleted(); return; case "TaskRemoved": %target.delete(); CMContextPopup.target = -1; return; } %numClients = %this.getNumTargets("Clients"); %numSelected = %this.getNumSelectedTargets("Clients"); if((%numSelected == 0) || (%numSelected == %numClients)) %team = true; else %team = false; %target.sendToServer(); commandToServer('BuildClientTask', %command, %team); if(%team) { commandToServer('SendTaskToTeam'); } else { for(%i = 0; %i < %numSelected; %i++) { %targetId = %this.getSelectedTarget("Clients", %i); commandToServer('SendTaskToClientTarget', %targetId); } } // delete target? if(%target.getTargetId() == -1) { CMContextPopup.target = -1; %target.delete(); } } //------------------------------------------------------------------------------ function CommanderTV::watchTarget(%this, %targetId) { if(%targetId < 0) %targetId = -1; if(%this.attached) commandToServer('AttachCommanderCamera', -1); %this.target = %targetId; if(%this.open && (%this.target != -1)) commandToServer('AttachCommanderCamera', %this.target); } function clientCmdCameraAttachResponse(%attached) { CommanderTV.attached = %attached; } //------------------------------------------------------------------------------ // CommanderTV control //------------------------------------------------------------------------------ new ActionMap(CommanderTVControl); CommanderTVControl.bind(mouse, xaxis, yaw); CommanderTVControl.bind(mouse, yaxis, pitch); function CommanderTV_ButtonPress(%val) { if(%val) { CommanderTVControl.push(); CursorOff(); } else { CommanderTVControl.pop(); GlobalActionMap.unbind(mouse, button0); if(CommanderMapGui.open) { CursorOn(); Canvas.setCursor(CMDCursorArrow); } } } function CommanderTVScreen::onMouseEnter(%this, %mod, %pos, %count) { GlobalActionMap.bind(mouse, button0, CommanderTV_ButtonPress); } function CommanderTVScreen::onMouseLeave(%this, %mod, %pos, %count) { GlobalActionMap.unbind(mouse, button0); } //------------------------------------------------------------------------------ // Buttons: play button down sounds here so script onAction call plays sound as well //------------------------------------------------------------------------------ // top buttons: function CMDPlayersButton::onAction(%this) { CommanderTree.openCategory("Clients", %this.getValue()); alxPlay(sButtonDown, 0, 0, 0); } function CMDTacticalButton::onAction(%this) { CommanderTree.openCategory("Tactical", %this.getValue()); alxPlay(sButtonDown, 0, 0, 0); } function CMDDeployedTacticalButton::onAction(%this) { CommanderTree.openCategory("DTactical", %this.getValue()); alxPlay(sButtonDown, 0, 0, 0); } function CMDMiscButton::onAction(%this) { CommanderTree.openCategory("Support", %this.getValue()); alxPlay(sButtonDown, 0, 0, 0); } function CMDDeployedMiscButton::onAction(%this) { CommanderTree.openCategory("DSupport", %this.getValue()); alxPlay(sButtonDown, 0, 0, 0); } function CMDWaypointsButton::onAction(%this) { CommanderTree.openCategory("Waypoints", %this.getValue()); alxPlay(sButtonDown, 0, 0, 0); } function CMDObjectivesButton::onAction(%this) { CommanderTree.openCategory("Objectives", %this.getValue()); alxPlay(sButtonDown, 0, 0, 0); } // bottom buttons: function CMDShowSensorsButton::onAction(%this) { CommanderMap.renderSensors = %this.getValue(); alxPlay(sButtonDown, 0, 0, 0); } // there should be, at most, one depressed mouse mode button function setMouseMode(%mode) { switch$(%mode) { case "select": CMDMoveSelectButton.setValue(false); CMDZoomButton.setValue(false); case "move": CMDMoveSelectButton.setValue(true); CMDZoomButton.setValue(false); case "zoom": CMDMoveSelectButton.setValue(false); CMDZoomButton.setValue(true); } CommanderMap.setMouseMode(%mode); alxPlay(sButtonDown, 0, 0, 0); } function cycleMouseMode() { switch$(CommanderMap.getMouseMode()) { case "select": setMouseMode("move"); case "move": setMouseMode("zoom"); case "zoom": setMouseMode("select"); } } function CMDMoveSelectButton::onAction(%this) { if(%this.getValue()) setMouseMode(move); else setMouseMode(select); } function CMDZoomButton::onAction(%this) { if(%this.getValue()) setMouseMode(zoom); else setMouseMode(select); } function CMDCenterButton::onAction(%this) { CommanderMap.followLastSelected(); alxPlay(sButtonDown, 0, 0, 0); } function CMDTextButton::onAction(%this) { CommanderMap.renderText = %this.getValue(); alxPlay(sButtonDown, 0, 0, 0); } function CMDCameraButton::onAction(%this) { CommanderMapGui.openCameraControl(%this.getValue()); alxPlay(sButtonDown, 0, 0, 0); } //--------------------------------------------------------------------------- // - the server may be down and client will not be able to get out of this object // by using the escape key; so, schedule a timeout period to reset $ServerResponseTimeout = 1500; function processControlObjectEscape() { if($ScheduledEscapeTask) return; $ScheduledEscapeTask = schedule($ServerResonseTimeout, 0, clientCmdControlObjectReset); commandToServer('ResetControlObject'); } function clientCmdControlObjectResponse(%ack, %info) { // if ack'd then %info is the tag for the object otherwise it is a decline message if(%ack == true) { new ActionMap(ControlActionMap); ControlActionMap.bindCmd(keyboard, escape, "processControlObjectEscape();", ""); $PlayerIsControllingObject = true; clientCmdSetHudMode("Object", %info); // at this point, we are not attached to an object CommanderTV.attached = false; Canvas.setContent(PlayGui); } else addMessageHudLine("\c3Failed to control object: \cr" @ %info); } function clientCmdControlObjectReset() { if($ScheduledEscapeTask) { cancel($ScheduledEscapeTask); $ScheduledEscapeTask = 0; } if(isObject(ControlActionMap)) ControlActionMap.delete(); if ($PlayerIsControllingObject) { $PlayerIsControllingObject = false; ClientCmdSetHudMode("Standard"); } if(CommanderMapGui.open) Canvas.setContent(PlayGui); } PK !(88scripts/commanderMapHelpText.cs$cmdMapHelpTextShown = false; function toggleCmdMapHelpText() { if(CmdMapHelpTextGui.visible) CmdMapHelpTextGui.setVisible(false); else { if(!$cmdMapHelpTextShown) { teamButtonText.setValue("Left click to select, right click to give commands."); tacticalButtonText.setValue("Turrets and friendly vehicles. Click the square after a turret's name to control it."); supportButtonText.setValue("Your team's stations, generators, cameras, and sensors."); waypointButtonText.setValue("All waypoints."); objectiveButtonText.setValue("All flags and switches."); handToolText.setValue("Toggles between hand (for moving the map) and pointer (for selecting objects and dragging selection)."); zoomToolText.setValue("When this tool is on, left click to zoom in and right click to zoom out."); centerToolText.setValue("Centers your view on selected object. If nothing is selected, centers the view on mission area."); textToolText.setValue("Toggles map text labels on and off."); cameraToolText.setValue("Gives you a small camera view of the area around selected object. Waypoints and enemy objects can not be viewed."); sensorToolText.setValue("Toggles all sensor spheres on/off so you can check your team's sensor coverage."); generalHelpText.setValue("Right click any object to display commands. Click on the command or type the highlighted letter to issue it to your team. To command an individual, click on the player's name, then issue the command."); $cmdMapHelpTextShown = true; } CmdMapHelpTextGui.setVisible(true); } } PK !(_('scripts/commanderMapIcons.cs// "type image overlay modulate {anim flags} {anim speed}" datablock CommanderIconData(CMDPlayerIcon) { baseImage = "static com_player_grey_24x false true"; selectImage = "static com_player_grey_24x_glow true true"; hilightImage = "static com_player_grey_24x_glow true true"; }; datablock CommanderIconData(CMDGeneratorIcon) { baseImage = "static com_icon_generator false true"; selectImage = "static com_icon_generator_glow true true"; hilightImage = "static com_icon_generator_glow true true"; }; datablock CommanderIconData(CMDSolarGeneratorIcon) { baseImage = "static com_icon_solar_gen false true"; selectImage = "static com_icon_solar_gen_glow true true"; hilightImage = "static com_icon_solar_gen_glow true true"; }; datablock CommanderIconData(CMDHoverScoutIcon) { baseImage = "static com_icon_landscout false true"; selectImage = "static com_icon_landscout_glow true true"; hilightImage = "static com_icon_landscout_glow true true"; }; datablock CommanderIconData(CMDFlyingScoutIcon) { baseImage = "static com_icon_scout false true"; selectImage = "static com_icon_scout_glow true true"; hilightImage = "static com_icon_scout_glow true true"; }; datablock CommanderIconData(CMDFlyingBomberIcon) { baseImage = "static com_icon_bomber false true"; selectImage = "static com_icon_bomber_glow true true"; hilightImage = "static com_icon_bomber_glow true true"; }; datablock CommanderIconData(CMDFlyingHAPCIcon) { baseImage = "static com_icon_hapc false true"; selectImage = "static com_icon_hapc_glow true true"; hilightImage = "static com_icon_hapc_glow true true"; }; datablock CommanderIconData(CMDGroundTankIcon) { baseImage = "static com_icon_tank false true"; selectImage = "static com_icon_tank_glow true true"; hilightImage = "static com_icon_tank_glow true true"; }; datablock CommanderIconData(CMDTurretIcon) { baseImage = "static com_icon_turret false true"; selectImage = "static com_icon_turret_glow true true"; hilightImage = "static com_icon_turret_glow true true"; }; datablock CommanderIconData(CMDCameraIcon) { baseImage = "static com_icon_camera false true"; selectImage = "static com_icon_camera true true"; hilightImage = "static com_icon_camera true true"; }; datablock CommanderIconData(CMDFlagIcon) { baseImage = "static com_icon_flag_outside false true"; selectImage = "static com_icon_flag_outside_glow true true"; hilightImage = "static com_icon_flag_outside_glow true true"; }; datablock CommanderIconData(CMDGroundMPBIcon) { baseImage = "static com_icon_mpb false true"; selectImage = "static com_icon_mpb_glow true true"; hilightImage = "static com_icon_mpb_glow true true"; }; datablock CommanderIconData(CMDSwitchIcon) { baseImage = "static com_icon_genericswitch false true"; selectImage = "static com_icon_genericswitch_glow true true"; hilightImage = "static com_icon_genericswitch_glow true true"; }; datablock CommanderIconData(CMDStationIcon) { baseImage = "static com_icon_inventory false true"; selectImage = "static com_icon_inventory_glow true true"; hilightImage = "static com_icon_inventory_glow true true"; }; datablock CommanderIconData(CMDVehicleStationIcon) { baseImage = "static com_icon_vehicle_inventory false true"; selectImage = "static com_icon_vehicle_inventory_glow true true"; hilightImage = "static com_icon_vehicle_inventory_glow true true"; }; datablock CommanderIconData(CMDSensorIcon) { baseImage = "static com_icon_sensor false true"; selectImage = "static com_icon_sensor_glow true true"; hilightImage = "static com_icon_sensor_glow true true"; }; PK !( scripts/commanderProfiles.cs//------------------------------------------------------------------------------ // Cursors //------------------------------------------------------------------------------ new GuiCursor(CMDCursorArrow) { hotSpot = "6 1"; bitmapName = "commander/cursors/com_cursor_arrow_icon"; }; new GuiCursor(CMDCursorHandOpen) { hotSpot = "13 14"; bitmapName = "commander/cursors/com_handopen_icon"; }; new GuiCursor(CMDCursorHandClosed) { hotSpot = "13 14"; bitmapName = "commander/cursors/com_handclose_icon"; }; new GuiCursor(CMDCursorZoom) { hotSpot = "8 7"; bitmapName = "commander/cursors/com_maglass_icon"; }; new GuiCursor(CMDCursorSelectAdd) { hotSpot = "11 11"; bitmapName = "commander/cursors/com_pointer_pos_icon"; }; new GuiCursor(CMDCursorSelectRemove) { hotSpot = "11 11"; bitmapName = "commander/cursors/com_pointer_icon"; }; //------------------------------------------------------------------------------ // Audio //------------------------------------------------------------------------------ new AudioDescription(AudioLoop2D) { volume = "1.0"; isLooping = true; is3D = false; type = $GuiAudioType; }; new AudioProfile(sStatic) { filename = "fx/misc/static.wav"; description = AudioLoop2D; preload = true; }; //------------------------------------------------------------------------------ // Profiles //------------------------------------------------------------------------------ new GuiControlProfile("CommanderTreeContentProfile") { opaque = true; fillColor = "140 140 140"; border = false; }; new GuiControlProfile("CommanderScrollContentProfile") { opaque = true; fillColor = "0 0 0"; border = false; }; new GuiControlProfile("CommanderButtonProfile") { opaque = false; fontType = $ShellButtonFont; fontSize = $ShellButtonFontSize; fontColor = "8 19 6"; fontColorHL = "25 68 56"; fontColorNA = "98 98 98"; fixedExtent = true; justify = "center"; bitmap = "gui/shll_button"; textOffset = "0 11"; soundButtonOver = sButtonOver; tab = false; canKeyFocus = false; }; new GuiControlProfile("CommanderGuiProfile") { opaque = true; fillColor = "0 0 0"; }; new GuiControlProfile("CommanderPopupProfile") { fontType = "Arial Bold"; fontSize = 14; opaque = true; fillColor = "65 141 148"; border = true; borderColor= "105 181 188"; justify = center; fontColors[0] = "255 255 255"; // text color fontColors[1] = "255 255 0"; // hotkey color }; new GuiControlProfile("CommanderTreeProfile") { fontColors[0] = "220 220 220"; // CategoryNormal fontColors[1] = "230 169 0"; // CategoryHilight fontColors[2] = "170 170 170"; // CategoryEmpty fontColors[3] = "255 255 0"; // ClientNoneEntry fontColors[4] = "255 255 255"; // TargetEntry };PK !(kk߲scripts/commonDialogs.cs//------------------------------------------------------------------------------ // // commonDialogs.cs // //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // MessageBox OK dialog: //------------------------------------------------------------------------------ function MessageBoxOK( %title, %message, %callback ) { MBOKFrame.setTitle( %title ); MBOKText.setText( "" @ %message ); //MessageBoxOKDlg.callback = %callback; MBOKButton.command = %callback SPC "Canvas.popDialog(MessageBoxOKDlg);"; Canvas.pushDialog( MessageBoxOKDlg ); } //------------------------------------------------------------------------------ function MessageBoxOKDlg::onWake( %this ) { } //------------------------------------------------------------------------------ function MessageBoxOKDlg::onSleep( %this ) { %this.callback = ""; } //------------------------------------------------------------------------------ // MessageBox OK/Cancel dialog: //------------------------------------------------------------------------------ function MessageBoxOKCancel( %title, %message, %callback, %cancelCallback ) { MBOKCancelFrame.setTitle( %title ); MBOKCancelText.setText( "" @ %message ); //MessageBoxOKCancelDlg.callback = %callback; //MessageBoxOKCancelDlg.cancelCallback = %cancelCallback; MBOKCancelButtonOK.command = %callback SPC "Canvas.popDialog(MessageBoxOKCancelDlg);"; MBOKCancelButtonCancel.command = %cancelCallback SPC "Canvas.popDialog(MessageBoxOKCancelDlg);"; Canvas.pushDialog( MessageBoxOKCancelDlg ); } //------------------------------------------------------------------------------ function MessageBoxOKCancelDlg::onWake( %this ) { } //------------------------------------------------------------------------------ function MessageBoxOKCancelDlg::onSleep( %this ) { %this.callback = ""; } //------------------------------------------------------------------------------ // MessageBox Yes/No dialog: //------------------------------------------------------------------------------ function MessageBoxYesNo( %title, %message, %yesCallback, %noCallback ) { MBYesNoFrame.setTitle( %title ); MBYesNoText.setText( "" @ %message ); //MessageBoxYesNoDlg.yesCallBack = %yesCallback; //MessageBoxYesNoDlg.noCallback = %noCallBack; MBYesNoButtonYes.command = %yesCallback SPC "Canvas.popDialog(MessageBoxYesNoDlg);"; MBYesNoButtonNo.command = %noCallback SPC "Canvas.popDialog(MessageBoxYesNoDlg);"; Canvas.pushDialog( MessageBoxYesNoDlg ); } //------------------------------------------------------------------------------ function MessageBoxYesNoDlg::onWake( %this ) { } //------------------------------------------------------------------------------ function MessageBoxYesNoDlg::onSleep( %this ) { %this.yesCallback = ""; %this.noCallback = ""; } //------------------------------------------------------------------------------ // Message popup dialog: //------------------------------------------------------------------------------ function MessagePopup( %title, %message, %delay ) { // Currently two lines max. MessagePopFrame.setTitle( %title ); MessagePopText.setText( "" @ %message ); Canvas.pushDialog( MessagePopupDlg ); if ( %delay !$= "" ) schedule( %delay, 0, CloseMessagePopup ); } //------------------------------------------------------------------------------ function CloseMessagePopup() { Canvas.popDialog( MessagePopupDlg ); } //------------------------------------------------------------------------------ // Pick Team dialog: //------------------------------------------------------------------------------ function PickTeamDlg::onWake( %this ) { } //------------------------------------------------------------------------------ function PickTeamDlg::onSleep( %this ) { } //------------------------------------------------------------------------------ // ex: ShellGetLoadFilename( "stuff\*.*", isLoadable, loadStuff ); // -- only adds files that pass isLoadable // -- calls 'loadStuff(%filename)' on dblclick or ok //------------------------------------------------------------------------------ function ShellGetLoadFilename( %title, %fileSpec, %validate, %callback ) { $loadFileCommand = %callback @ "( getField( LOAD_FileList.getValue(), 0 ) );"; LOAD_FileList.altCommand = $loadFileCommand SPC "Canvas.popDialog(ShellLoadFileDlg);"; LOAD_LoadBtn.command = $loadFileCommand SPC "Canvas.popDialog(ShellLoadFileDlg);"; if ( %title $= "" ) LOAD_Title.setTitle( "LOAD FILE" ); else LOAD_Title.setTitle( %title ); LOAD_LoadBtn.setActive( false ); Canvas.pushDialog( ShellLoadFileDlg ); fillLoadSaveList( LOAD_FileList, %fileSpec, %validate, false ); } //------------------------------------------------------------------------------ function fillLoadSaveList( %ctrl, %fileSpec, %validate, %isSave ) { %ctrl.clear(); %id = 0; for ( %file = findFirstFile( %fileSpec ); %file !$= ""; %file = findNextFile( %fileSpec ) ) { if ( %validate $= "" || call( %validate, %file ) ) { %ctrl.addRow( %id, fileBase( %file ) TAB %file ); if ( %isSave ) { if ( !isWriteableFileName( "base/" @ %file ) ) %ctrl.setRowActive( %id, false ); } %id++; } } %ctrl.sort( 0 ); } //------------------------------------------------------------------------------ function LOAD_FileList::onSelect( %this, %id, %text ) { LOAD_LoadBtn.setActive( true ); } //------------------------------------------------------------------------------ // ex: ShellGetSaveFilename( "stuff\*.*", isLoadable, saveStuff, currentName ); // -- only adds files to list that pass isLoadable // -- calls 'saveStuff(%filename)' on dblclick or ok //------------------------------------------------------------------------------ function ShellGetSaveFilename( %title, %fileSpec, %validate, %callback, %current ) { SAVE_FileName.setValue( %current ); $saveFileCommand = "if ( SAVE_FileName.getValue() !$= \"\" ) " @ %callback @ "( SAVE_FileName.getValue() );"; SAVE_FileName.altCommand = $saveFileCommand SPC "Canvas.popDialog(ShellSaveFileDlg);"; SAVE_SaveBtn.command = $saveFileCommand SPC "Canvas.popDialog(ShellSaveFileDlg);"; if ( %title $= "" ) SAVE_Title.setTitle( "SAVE FILE" ); else SAVE_Title.setTitle( %title ); // Right now this validation stuff is worthless... //SAVE_SaveBtn.setActive( isWriteableFileName( "base/" @ %current @ $loadSaveExt ) ); Canvas.pushDialog( ShellSaveFileDlg ); fillLoadSaveList( SAVE_FileList, %fileSpec, %validate, true ); } //------------------------------------------------------------------------------ function SAVE_FileList::onSelect( %this, %id, %text ) { if ( %this.isRowActive( %id ) ) SAVE_FileName.setValue( getField( %this.getValue(), 0 ) ); } //------------------------------------------------------------------------------ function SAVE_FileList::onDoubleClick( %this ) { %id = %this.getSelectedId(); if ( %this.isRowActive( %id ) ) { error("D'oh - double clicking is broken for PURE/DEMO executables"); eval( $saveFileCommand ); Canvas.popDialog( ShellSaveFileDlg ); } } //------------------------------------------------------------------------------ function SAVE_FileName::checkValid( %this ) { // Right now this validation stuff is worthless... //SAVE_SaveBtn.setActive( isWriteableFileName( "base/" @ %this.getValue() @ $loadSaveExt ) ); } PK !(𤱂scripts/controlDefaults.csif ( isObject( moveMap ) ) moveMap.delete(); new ActionMap(moveMap); //------------------------------------------------------------------------------ // 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; } function moveright(%val) { $mvRightAction = %val; } 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 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); } 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(); } } $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); PK !(gscripts/creditsGui.csfunction 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/Cred_" @ $CreditsPicIndex @ ".png"); } else CREDITS_Pic.setBitmap("gui/Cred_1.bm8"); //music array if (!isDemo()) { $CreditsMusic[0] = "badlands"; $CreditsMusic[1] = "desert"; $CreditsMusic[2] = "ice"; $CreditsMusic[3] = "lush"; $CreditsMusic[4] = "volcanic"; } 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(10, 0, scrollTheCredits); } function creditsNextPic() { //no slide show in the demo... if (isDemo()) return; cancel($CreditsSlideShow); if (!$CreditsPaused) { $CreditsPicIndex += 1; if ($CreditsPicIndex > 46) $CreditsPicindex = 1; //set the bitmap CREDITS_Pic.setBitmap("gui/Cred_" @ $CreditsPicIndex @ ".png"); } //schedule the next bitmap $CreditsSlideShow = schedule(5000, 0, creditsNextPic); }PK !(F%scripts/creditsText.cs// Credits list addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine("Producer/Director"); addCreditsLine("Dave \"QIX\" Georgeson"); addCreditsLine(""); addCreditsLine("Associate Producer"); addCreditsLine("Daryl \"Snow Leopard\" Nichols, Jr."); addCreditsLine(""); addCreditsLine("Lead Programmer"); addCreditsLine("Mark \"Got Milk?\" Frohnmayer"); addCreditsLine(""); addCreditsLine("Software Engineers"); addCreditsLine("John \"Sne/\\ker\" Alden"); addCreditsLine("Kelly \"East\" Asay"); addCreditsLine("Shawn \"Raf\" Eastley"); addCreditsLine("Clark \"Shark\" Fagot"); addCreditsLine("John \"berBob\" Folliard"); addCreditsLine("Brad \"BigDevDawg\" Heinz"); addCreditsLine("\"Missing\" Lincoln Hutton"); addCreditsLine("Greg \"Jett\" Lancaster"); addCreditsLine("Dave \"Symlink\" Moore"); addCreditsLine("Brian \"Twitch\" Ramage"); addCreditsLine("Mitch \"Skeet\" Shaw"); addCreditsLine("Tinman \"Kidney Thief\""); addCreditsLine(""); addCreditsLine("Designers"); addCreditsLine("Eric \"Rated z\" Lanz"); addCreditsLine("Dave \"Diamondback\" Meddish"); addCreditsLine("Jesse \"DrAwkward\" Russell"); addCreditsLine(""); addCreditsLine("Art Direction"); addCreditsLine("Craig \"jimmy\" Maitlen"); addCreditsLine(""); addCreditsLine("Artists"); addCreditsLine("Robert \"Pelias Maximus\" Caracol"); addCreditsLine("Ian \"ETCmodel02\" Christy "); addCreditsLine("Jade \"FrankRizzo\" Dhabolt"); addCreditsLine("Jon \"OrphanKazrak\" Lanz"); addCreditsLine("Dave \"OldDawg\" Lauck"); addCreditsLine("Matthew \"Rickets\" Reynolds"); addCreditsLine("Paul \"Decoy\" Rheinfelder"); addCreditsLine("Thomas \"TOMIN8R\" VanVelkinburgh"); addCreditsLine(""); addCreditsLine("Writer"); addCreditsLine("Blake \"Hexabolic\" Hutchins"); addCreditsLine(""); addCreditsLine("HTML Community"); addCreditsLine("Pat McCarthy"); addCreditsLine("Joe Gartska"); addCreditsLine(""); addCreditsLine("Director of Quality Assurance"); addCreditsLine("Gary \"Koros\" Stevens"); addCreditsLine(""); addCreditsLine("Compatibility Lab Supervisor"); addCreditsLine("Pat \"3 Legged Dingo\" Callahan"); addCreditsLine(""); addCreditsLine("QA Supervisor, Core Game"); addCreditsLine("Ken \"Sunshine\" Eaton"); addCreditsLine(""); addCreditsLine("Quality Assurance"); addCreditsLine("Abhishake \"Harley\" Behl"); addCreditsLine("Angus \"Chewtoy\" Campbell"); addCreditsLine("Aaron \"Boomer1111\" Denke"); addCreditsLine("Trent \"RabidSquirrel\" Donelson"); addCreditsLine("Jonalee \"cHiLaKwEeN\" Gil"); addCreditsLine("Phil \"Philtre\" Kuhlmey"); addCreditsLine("Craig \"NEK\" Marshall"); addCreditsLine("Sean \"Baby Emu\" Meichle"); addCreditsLine("David \"Plik\" Peterson"); addCreditsLine("Robert \"Mortal Wombat\" Quattrone"); addCreditsLine("Connor \"der Todesritter\" Salisbury"); addCreditsLine("Joe \"Callahan\" Smith"); addCreditsLine("Mark \"SurferMark\" Storie"); addCreditsLine("Sue \"Othello\" Ung"); addCreditsLine("Cody \"Infirmo\" Yarbrough"); addCreditsLine("Drew \"Mongo\" Zilm"); addCreditsLine(""); addCreditsLine("QA Internationalization:"); addCreditsLine("Lloyd \"Tank\" Madden"); addCreditsLine("Frank \"Schnack\" Matzke"); addCreditsLine("Markus \"Beule\" Rafflenbeul"); addCreditsLine(""); addCreditsLine("Motion Capture Team"); addCreditsLine("Technical Director: Troy McFarland"); addCreditsLine("Performer: Cosmo Hom"); addCreditsLine(""); addCreditsLine("Digital Video Support Team"); addCreditsLine("Director: Jim\"zootboy\" Carey"); addCreditsLine("Sage \"3Dkid\" Freeman"); addCreditsLine("Steve \"opticNerve\" Bradford"); addCreditsLine("Tonya \"Agentmoody\" Stumphauzer"); addCreditsLine("Troy \"cann n fodder\" McFarland"); addCreditsLine("Kate \"reelBoss\" Alley"); addCreditsLine(""); addCreditsLine("Movie Intro"); addCreditsLine("PBDigital, Inc."); addCreditsLine(""); addCreditsLine("Installer"); addCreditsLine("Chris Mahnken"); addCreditsLine(""); addCreditsLine("Special Thanks"); addCreditsLine("Mark Brenneman"); addCreditsLine("Nels Bruckner"); addCreditsLine("Barry Drew"); addCreditsLine("Tim Gift"); addCreditsLine("Gerald Harrison"); addCreditsLine("Shannon Holder"); addCreditsLine("Jared Keller"); addCreditsLine("Ti Kwa"); addCreditsLine("Joe Maruschak"); addCreditsLine("Rick Overman"); addCreditsLine("Helen Pai"); addCreditsLine("Scott Rudi"); addCreditsLine("Shawn Sharp"); addCreditsLine("Neal Skorpen"); addCreditsLine("Weston Tracy"); addCreditsLine("Pete Walker"); addCreditsLine("Maren Wyatt"); addCreditsLine("Scott Youngblood"); addCreditsLine(""); addCreditsLine("zlib Development Team"); addCreditsLine("libPNG Development Team"); // TR2 addCreditsLine(""); addCreditsLine("Team Rabbit 2"); addCreditsLine("Codality, Inc."); addCreditsLine(""); addCreditsLine("Codality President/Designer"); addCreditsLine("Michael \"KineticPoet\" Johnston"); addCreditsLine(""); addCreditsLine("Codality Developers"); addCreditsLine("Dan \"daunt\" Kolta"); addCreditsLine("Scott \"FSB-AO\" Estabrook"); addCreditsLine(""); addCreditsLine("Codality Sound Effects"); addCreditsLine("John \"CObbler\" Carter"); addCreditsLine("Buddy \"sLaM\" Pritchard"); addCreditsLine(""); addCreditsLine("Codality 3D Artist"); addCreditsLine("Gregg \"illy\" Fellows"); addCreditsLine(""); addCreditsLine("Codality Additional Maps"); addCreditsLine("Alan \"Nefilim\" Schwertel"); addCreditsLine(""); addCreditsLine("Codality 2D Artist"); addCreditsLine("Kenneth \"SONOFMAN\" Cook"); addCreditsLine(""); addCreditsLine("Codality Special Thanks"); addCreditsLine("Eric \"Special\" Chu"); addCreditsLine("Jonathan \"Sojourn\" Parker"); addCreditsLine("Matt \"aerobahn\" Willis"); addCreditsLine("Taylor \"Banana Man\" Stewart"); addCreditsLine("Team 5150"); addCreditsLine("Team Euphoria"); addCreditsLine("Team Imperial Elite"); addCreditsLine(""); addCreditsLine("Business Unit Manager for Sierra Studios"); addCreditsLine("Mark Hood"); addCreditsLine(""); addCreditsLine("Brand Manager"); addCreditsLine("Lee Rossini"); addCreditsLine(""); addCreditsLine("European Brand Manager"); addCreditsLine("Djamil Kemal"); addCreditsLine(""); addCreditsLine("Europe/Asia Marketing Manager"); addCreditsLine("Michael Fuller"); addCreditsLine(""); addCreditsLine("Asia Brand Manager"); addCreditsLine("Deana Erickson"); addCreditsLine(""); addCreditsLine("Director of Marketing"); addCreditsLine("Koren Buckner"); addCreditsLine(""); addCreditsLine("VP of Marketing"); addCreditsLine("Jim Veevaert"); addCreditsLine(""); addCreditsLine("Channel Promotions"); addCreditsLine("Michael Whitehead"); addCreditsLine(""); addCreditsLine("Web Development Mgr."); addCreditsLine("Guy Welch"); addCreditsLine(""); addCreditsLine("Marketing Assistant"); addCreditsLine("Michael Cowan"); addCreditsLine(""); addCreditsLine("Public Relations Mgr."); addCreditsLine("Hillary Crowley "); addCreditsLine(""); addCreditsLine("Director"); addCreditsLine("Creative Services"); addCreditsLine("Laura Kleinhofs "); addCreditsLine(""); addCreditsLine("Creative Director For"); addCreditsLine("Creative Services"); addCreditsLine("Brandon Walker"); addCreditsLine(""); addCreditsLine("Sr. Account Manager"); addCreditsLine("Creative Services"); addCreditsLine("Kevin Lamb"); addCreditsLine(""); addCreditsLine("Package Design"); addCreditsLine("Moore Design Group"); addCreditsLine(""); addCreditsLine("Production Manager"); addCreditsLine("Sheri-Lou Stannard"); addCreditsLine(""); addCreditsLine("Manual Layout"); addCreditsLine("Kim McGovern"); addCreditsLine(""); addCreditsLine("Localization Coordinator"); addCreditsLine("Warren Wright"); addCreditsLine(""); addCreditsLine("Sound Effects"); addCreditsLine("EFX/Wilshire Studios"); addCreditsLine("CS Productions Inc."); addCreditsLine(""); addCreditsLine("Voice Recording"); addCreditsLine("Bad Animals"); addCreditsLine(""); addCreditsLine("Voice Processing"); addCreditsLine("CS Productions Inc."); addCreditsLine(""); addCreditsLine("Music"); addCreditsLine("Tim Clarke and Score! Studios"); addCreditsLine(""); addCreditsLine("Sierra On-Line Multiplayer Services"); addCreditsLine("Aaron Hunt"); addCreditsLine("Erik De Bonte"); addCreditsLine("Bill Dewey"); addCreditsLine("Colen Garoutte-Carson"); addCreditsLine("Max Klaiser"); addCreditsLine("Brent LaPoint"); addCreditsLine("Neeraj Murarka"); addCreditsLine("Mike Nicolino"); addCreditsLine("Lee Olds"); addCreditsLine("Ross Perez"); addCreditsLine("Darren Robinson"); addCreditsLine("Brian Rothstein"); addCreditsLine("Jeff Routledge"); addCreditsLine("Dean Webster"); addCreditsLine("Kelly Zmak"); addCreditsLine(""); addCreditsLine("Voice Talent"); addCreditsLine("John Armstrong"); addCreditsLine("Mark Berry"); addCreditsLine("Kiamalise Budak"); addCreditsLine("Kymberli Colbourne"); addCreditsLine("Craig English"); addCreditsLine("Kit Harris"); addCreditsLine("Jay Hopper"); addCreditsLine("Mike Madeoy"); addCreditsLine("Dex Manley"); addCreditsLine("Kate Myre"); addCreditsLine("Matt Reidy"); addCreditsLine("Gary Schwartz"); addCreditsLine("Jen Taylor"); addCreditsLine(""); addCreditsLine("Linux Port"); addCreditsLine("Loki Software, Inc."); addCreditsLine(""); addCreditsLine("Loki President"); addCreditsLine("Scott \"Highlander\" Draeker"); addCreditsLine(""); addCreditsLine("Linux Installer"); addCreditsLine("Stephane \"Megastep\" Peter"); addCreditsLine(""); addCreditsLine("Linux Programming"); addCreditsLine("Michael \"Briareos\" Vance"); addCreditsLine("Joe \"TsaoTsao\" Valenzuela"); addCreditsLine("Sam \"Hercules\" Lantinga"); addCreditsLine(""); addCreditsLine("Linux Q/A and Support"); addCreditsLine("Andy \"Yoda\" Mecham"); addCreditsLine("Mike \"Heimdall\" Phillips"); addCreditsLine(""); addCreditsLine("Linux Manual"); addCreditsLine("Kayt \"Sigyn\" Sorhaindo"); addCreditsLine(""); addCreditsLine("Loki Artwork"); addCreditsLine("Jason \"Pais\" Kim"); addCreditsLine(""); addCreditsLine("Loki System Support"); addCreditsLine("Rafael \"Raistlin\" Barrero"); addCreditsLine(""); addCreditsLine("Loki Business Manager"); addCreditsLine("Yvonne \"YDS\" De Sollar"); addCreditsLine(""); addCreditsLine("Loki Customer Support"); addCreditsLine("Brandon \"Particle\" Carter"); addCreditsLine(""); addCreditsLine("Loki Beta Testers"); addCreditsLine("James \"idcmp\" Atwill"); addCreditsLine("Brandon \"bbeattie\" Beattie"); addCreditsLine("Fionn Behrens"); addCreditsLine("Jonathan \"Suraklyn\" Bowser"); addCreditsLine("Patrick \"Phineas\" Calhoun"); addCreditsLine("Wayne \"ttol\" Chang"); addCreditsLine("Nash \"twostar\" Clemens"); addCreditsLine("Mike \"madcat\" Delaney"); addCreditsLine("Matthew \"DivineHawk\" Eaton"); addCreditsLine("Rodney \"meff\" Gordon II"); addCreditsLine("Pavan \"Phantom\" Gupta"); addCreditsLine("Christopher \"Malkier\" Hahn"); addCreditsLine("John \"OverCode\" Hall"); addCreditsLine("Jesse \"Abysmal\" Hanna"); addCreditsLine("Steven \"Ashari\" Hatfield"); addCreditsLine("David \"NeoTron\" Hedbor"); addCreditsLine("Matt \"malloc_master\" Helsley"); addCreditsLine("Simon \"red_one\" Hill"); addCreditsLine("Gareth \"3D-Guru\" Hughes"); addCreditsLine("Zephaniah E. Hull"); addCreditsLine("Guy \"Guido\" Hutchison"); addCreditsLine("Joshua Kleiner"); addCreditsLine("Geoff \"Rambo\" Lewis"); addCreditsLine("Jason \"Deadman\" Lundy"); addCreditsLine("Gregory \"Centove\" McLean"); addCreditsLine("Patrick \"WormBoy\" McNeill"); addCreditsLine("Jeff \"Judecca\" Mrochuk"); addCreditsLine("Patrick \"linuxpunkr...\" Mullen"); addCreditsLine("Prof. Dr. Nao"); addCreditsLine("Jody \"Dweebs\" Newell"); addCreditsLine("Bob \"Shapecharge\" O'Brien"); addCreditsLine("Kyle \"JebusSaveMe\" Olsen"); addCreditsLine("John \"joe\" Osborne"); addCreditsLine("Chris \"Super-K\" Osgood"); addCreditsLine("Jon \"Railroad\" Revie"); addCreditsLine("Michael \"M00k3y\" Ritner"); addCreditsLine("Aron \"Govt.Cheese\" Rosenberg"); addCreditsLine("Yuri \"Mystro\" Sagalov"); addCreditsLine("Marinus \"foser\" Schraal"); addCreditsLine("SKILL5"); addCreditsLine("Ryan Stotts"); addCreditsLine("Dan \"XFree86\" Temple"); addCreditsLine("Terry \"keerf\" Warner"); addCreditsLine("Chris \"UmytBnxt\" Watkins"); addCreditsLine("Michael \"themime\" Whitten"); addCreditsLine(""); addCreditsLine("GLSetup Team"); addCreditsLine("Chris Hecker"); addCreditsLine("Rob Felter"); addCreditsLine(""); addCreditsLine(""); addCreditsLine("Thanks to all the wives, girlfriends and children of the hardworking Dev Team members. Your patience and sacrifice has allowed us to complete a project of which we are all tremendously proud. None of it would have been possible without you."); addCreditsLine(""); addCreditsLine(""); addCreditsLine("Meta Testers"); addCreditsLine("Alex Flagg"); addCreditsLine("Alex \"LogRoller\" Ogilvie"); addCreditsLine("Adam Mitter"); addCreditsLine("Alan \"Otter\" Ragg"); addCreditsLine("Alex \"SaGe\" Chappuis"); addCreditsLine("Alexandre \"[cF]Alex\" Clerc-Gagnoux"); addCreditsLine("Allen \"TheRedDread\" Drennan"); addCreditsLine("Andreas Jalsovec"); addCreditsLine("Anton Wiegert"); addCreditsLine("Arden H. \"TF Pookie\" Nguyen"); addCreditsLine("Bart \"=DB=Seven\" Smith"); addCreditsLine("Ben \"Diox\" May"); addCreditsLine("Ben \"Hypn0tik\" Tamler"); addCreditsLine("Ben \"Stan\" Gray"); addCreditsLine("Bobby \"Mogart\" Rider"); addCreditsLine("Bodhi \"Heliometus Max\" Daher"); addCreditsLine("Brad \"Bort\" Klann"); addCreditsLine("Bret D. \"Bacchus\" Wilson"); addCreditsLine("Brian \"Aftershock\" Parker"); addCreditsLine("Carl \"Daddy\" Anderson"); addCreditsLine("Charlie Schillberg"); addCreditsLine("Chason \"Phantom Stranger\" Ellis"); addCreditsLine("Chris \"Pie4Foo\" Abele"); addCreditsLine("Chris \"Tythan\" Caviness"); addCreditsLine("Chris \"Fubar\" Duncan"); addCreditsLine("Christian \"S3 Crucifix\" Peth"); addCreditsLine("Colin \"Dark Wraith\" Howitt"); addCreditsLine("Cory \"Omega Man\" Altheide"); addCreditsLine("\"Cowboy\" Ben Alman"); addCreditsLine("Crystal McHale"); addCreditsLine("Dan \"Avatar\" Lyons"); addCreditsLine("Daniel \"|5150|Keyser\" Gallegos"); addCreditsLine("Daniel \"Emp\" Arnold"); addCreditsLine("Daniel \"Snaggs\" Soderstrom"); addCreditsLine("Daniel \"Trebz\" Nolan"); addCreditsLine("Daniel \"Wizard_TPG\" Neilsen"); addCreditsLine("Daniel \"Shadow Mage\" Nichols"); addCreditsLine("Daniel \"Spooger\" Patton"); addCreditsLine("Danny \"OmegaRed\" Cotton"); addCreditsLine("Darion \"Shadower\" Lowenstein"); addCreditsLine("Darren \"Fidelio\" Mitchell"); addCreditsLine("Dave \"Tycho\" Fried"); addCreditsLine("David \"DOX\" Oxwell"); addCreditsLine("David \"Killdawg\" DeBoer"); addCreditsLine("David MacIntosh"); addCreditsLine("Dean \"VolcoM\" Sykes"); addCreditsLine("Dean Tate"); addCreditsLine("Dennis \"Chickenboo\" Fox"); addCreditsLine("Erik \"Mustard\" de Jong"); addCreditsLine("Gabor \"Dezso a HUN\" Orban"); addCreditsLine("Gabriel \"Warwitch\" David"); addCreditsLine("Gavin \"Suds\" Henrick"); addCreditsLine("Gino \"tAngGSI\" Gard"); addCreditsLine("Glenn \"IcyHot\" Wisbey"); addCreditsLine("Gregory \"Brak Panda\" Pesochin"); addCreditsLine("Gregory \"Strife\" Hill"); addCreditsLine("Hannes \"Cohen\" Wagner"); addCreditsLine("Ian \"Kowboy\" Gonsalves"); addCreditsLine("Ian Threadgold"); addCreditsLine("J Alex \"Blackheart\" Wheeler"); addCreditsLine("James \"Warbird\" Gentry III"); addCreditsLine("James C. \"Lothos\" Hanna"); addCreditsLine("Jason \"Circuit\" Jenkins"); addCreditsLine("Jason \"Iron Chef\" Goodowens"); addCreditsLine("Jason \"Lumberjack\" De Arte"); addCreditsLine("Jeff \"Hellsfury\" Shaw"); addCreditsLine("Jeremy \"Xevious\" Burke"); addCreditsLine("Jerry \"Tycho Brahe\" Holkins"); addCreditsLine("Joe \"Quadrature\" Downs"); addCreditsLine("Joe Bell Grant"); addCreditsLine("Joern \"Pangur\" Schnautz"); addCreditsLine("John \"Dr.Jones\" Burnett"); addCreditsLine("Jon \"Ratorasniki\" Naiman"); addCreditsLine("Jonathan \"Chaser\" Bale"); addCreditsLine("Joost \"jschuur\" Schuur"); addCreditsLine("Josh \"Red Sirus\" Hoey"); addCreditsLine("Kevin \"Rifter\" Rank"); addCreditsLine("Kevin \"Kevlar\" Middleton"); addCreditsLine("Kyle \"{DP}AzN^DoG\" Godfrey"); addCreditsLine("Kyle \"Wiggy\" Bennett"); addCreditsLine("Laura \"Dolph Lundgren\" Schreiner"); addCreditsLine("Lorne \"Writer\" Laliberte"); addCreditsLine("Mac \"McNaughton\" Miller"); addCreditsLine("Mario \"Lone Gunman\" Batlle"); addCreditsLine("Mark \"Ferret-of-Death\" Siciliano"); addCreditsLine("Mark \"Old Skul\" Szabo"); addCreditsLine("Mark \"Panama Jack\" Dickenson"); addCreditsLine("Markus Rafflenbeul"); addCreditsLine("Mat Bettinson"); addCreditsLine("Matt \"{SiR}SoulJAH\" Culp"); addCreditsLine("Matt \"Colosus\" DeWald"); addCreditsLine("Matt Sobotka"); addCreditsLine("Matthew \"4u2c\" McKeown"); addCreditsLine("Mattijs \"3bird\" Jonker"); addCreditsLine("Michael \"Optimizer\" Hamlett"); addCreditsLine("Michael \"Rave\" Mogill"); addCreditsLine("Michael A Nance"); addCreditsLine("Michael James \"Tenabrae\" Edwards"); addCreditsLine("Mike \"Ragman\" Hillebrecht"); addCreditsLine("Mike \"Gabriel\" Krahulik"); addCreditsLine("Mike \"Gangreen\" Burton"); addCreditsLine("Moussa Khan"); addCreditsLine("N. David \"MlakMavet\" Griffin"); addCreditsLine("Nathan \"[HvC]NaTeDoGG\" Sweet"); addCreditsLine("Nick \"Enhanced Panda\" Orlich"); addCreditsLine("Nick \"Leb\" Petska"); addCreditsLine("Nick S. \"Enlightened One\" Pasto"); addCreditsLine("Nikita \"FSB-SPY\" Bogolyubov"); addCreditsLine("Olivier \"[cf] OroX\" Roulx"); addCreditsLine("Omar Yehia"); addCreditsLine("Pamela A. \"Diva\" Holmberg"); addCreditsLine("Paul \"RuinatioN\" Wright"); addCreditsLine("Paul \"Teknoice\" Morris"); addCreditsLine("Penny \"Killer Girl\" Miller"); addCreditsLine("Peter \"dev\" Kazmierow"); addCreditsLine("Ric \"Dr Chmod\" Moseley"); addCreditsLine("\"NoFix\""); addCreditsLine("Rob \"Coyote\" Duffy"); addCreditsLine("Robert Huebner"); addCreditsLine("Rod Chrenek"); addCreditsLine("Ron Oliver II"); addCreditsLine("Ross \"Bytor\" Carlson"); addCreditsLine("Roy \"Cannonfodder\" Greenhalgh"); addCreditsLine("Ryan \"Kelster\" Kelly"); addCreditsLine("Ryan \"Onyxwulf\" Gilfillan"); addCreditsLine("Ryan \"StoneWolf\" Thernes"); addCreditsLine("Scott \"Smedly\" Medlin"); addCreditsLine("Sean \"Pubknight\" Bryson "); addCreditsLine("Sebastien \"[cF]PreD\" Guillemet"); addCreditsLine("Shane \"Mental Trousers\" Taylor"); addCreditsLine("Shane \"Santa\" Beaumont"); addCreditsLine("Shane \"Shaneman\" Evans"); addCreditsLine("Stefan Grufman"); addCreditsLine("Stefan \"Skace\" Kiehne"); addCreditsLine("Stephen \"Cato\" Farquhar"); addCreditsLine("Stephen \"SL83\" Limowski"); addCreditsLine("Steve \"Presto\" Eisner"); addCreditsLine("Taylor \"Emo1313\" Suchan"); addCreditsLine("Thomas \"Mantis\" Kumpik, Jr."); addCreditsLine("Tim \"Zear\" Hammock"); addCreditsLine("Todd \"Fuzzy Lumpkins\" Sjoblom"); addCreditsLine("Tom \"Falcon\" Vogt"); addCreditsLine("Tyler \"Raskal\" Jacobson"); addCreditsLine("Tyler \"Sty\" Frans"); addCreditsLine("Tyler Wilson"); addCreditsLine("Werner Poetzelberger"); addCreditsLine("Willem \"Talita\" Bison"); addCreditsLine("William \"Altaic\" Knop"); addCreditsLine(""); addCreditsLine("Beta Testers"); addCreditsLine("Aaron Brown"); addCreditsLine("Aaron Butler"); addCreditsLine("Aaron Reed"); addCreditsLine("Aaron Scott Reed"); addCreditsLine("Aaron Semeniuk"); addCreditsLine("Aaron Wisner"); addCreditsLine("Aaron Younger"); addCreditsLine("Adam B. Argo"); addCreditsLine("Adam Becker"); addCreditsLine("Adam Corvin"); addCreditsLine("Adam England"); addCreditsLine("Adam King"); addCreditsLine("Adam Kleifield "); addCreditsLine("Adam McCreight"); addCreditsLine("Adam Mitter"); addCreditsLine("Adam S. Pedersen"); addCreditsLine("Adam Toering"); addCreditsLine("Adam Williams"); addCreditsLine("Adrian Telfer"); addCreditsLine("Akihiro Inoue"); addCreditsLine("Al Harrington"); addCreditsLine("Alan Peng"); addCreditsLine("Alan Ragg"); addCreditsLine("Alayton Norgard"); addCreditsLine("Alberto Petrozzi"); addCreditsLine("Alden Tan"); addCreditsLine("Alex Chappuis"); addCreditsLine("Alex Flagg"); addCreditsLine("Alex Gourley"); addCreditsLine("Alex Jakes JR"); addCreditsLine("Alex Jeng"); addCreditsLine("Alex Ogilvie"); addCreditsLine("Alex Porter"); addCreditsLine("Alex Taylor"); addCreditsLine("Alex Zanfir"); addCreditsLine("Alexander Baldoria"); addCreditsLine("Alexander Flagg"); addCreditsLine("Alexander Marschal"); addCreditsLine("Alexander van Rijn"); addCreditsLine("Alexandr Koshelev"); addCreditsLine("Alexandre Clerc-Gagnoux"); addCreditsLine("Alexandre Pomi"); addCreditsLine("Alexandre Ramos"); addCreditsLine("Alexei Sapsford"); addCreditsLine("Allen Drennan"); addCreditsLine("Allen Grusecki"); addCreditsLine("Amir Assali"); addCreditsLine("Amir Grad"); addCreditsLine("Anatoly Ropotov"); addCreditsLine("Andre Koch"); addCreditsLine("Andrea Primadei"); addCreditsLine("Andreas Leondidis"); addCreditsLine("Andrew Baum"); addCreditsLine("Andrew Fort"); addCreditsLine("Andrew Price"); addCreditsLine("Andrew Stockman"); addCreditsLine("Andy Chong"); addCreditsLine("Andy Swanson"); addCreditsLine("Angus Campbell"); addCreditsLine("Anthony Bermudez"); addCreditsLine("Anthony Mills"); addCreditsLine("Antonio Ferrari"); addCreditsLine("Antti Htinen"); addCreditsLine("Arden H Nguyen"); addCreditsLine("Arthur Troncoso"); addCreditsLine("Ata Yavalar"); addCreditsLine("Attila Fur"); addCreditsLine("Audie Martin"); addCreditsLine("Barbara J. Webb"); addCreditsLine("Baret Julien"); addCreditsLine("Baron Wolt"); addCreditsLine("Bart Haesaerts"); addCreditsLine("Bart Maegh"); addCreditsLine("Bart Peiren"); addCreditsLine("Bart Smith"); addCreditsLine("Bart Waeterschoot"); addCreditsLine("Beau Hale"); addCreditsLine("Ben Anderson"); addCreditsLine("Ben Cantwell"); addCreditsLine("Ben Cuthbert"); addCreditsLine("Ben De Decker"); addCreditsLine("Ben Dobbs"); addCreditsLine("Ben Floren"); addCreditsLine("Ben Gray"); addCreditsLine("Ben Lawton"); addCreditsLine("Ben Martel"); addCreditsLine("Ben May"); addCreditsLine("Ben Pierson"); addCreditsLine("Ben Stone"); addCreditsLine("Ben Tamler"); addCreditsLine("Benjamin Alman"); addCreditsLine("Benjamin Denholm"); addCreditsLine("Benjamin Luck"); addCreditsLine("Benot Dewaele"); addCreditsLine("Bernd Berheide"); addCreditsLine("Bernhard Seiser"); addCreditsLine("Bill Eccleston"); addCreditsLine("Bill Lewis"); addCreditsLine("Bill Rodenbaugh"); addCreditsLine("Bjorn Sleypen"); addCreditsLine("Bo McCoy"); addCreditsLine("Bodhi Daher"); addCreditsLine("Boris Stock"); addCreditsLine("Brad Butcher"); addCreditsLine("Brad Conner"); addCreditsLine("Brad DeLong"); addCreditsLine("Brad Goehring"); addCreditsLine("Brad Herman"); addCreditsLine("Brad Klann"); addCreditsLine("Bram Noz"); addCreditsLine("Brandon Cantrell"); addCreditsLine("Brandon Knez"); addCreditsLine("Brandon W. Easley"); addCreditsLine("Brandy Straatman"); addCreditsLine("Bret D. Wilson"); addCreditsLine("Brett Carlson"); addCreditsLine("Bri Pas"); addCreditsLine("Brian Barnes"); addCreditsLine("Brian Charles Moses"); addCreditsLine("Brian Helms"); addCreditsLine("Brian Hon"); addCreditsLine("Brian Lorey"); addCreditsLine("Brian Mercer"); addCreditsLine("Brian Nakash"); addCreditsLine("Brian Parker"); addCreditsLine("Brian Vitale"); addCreditsLine("Brian Walsh"); addCreditsLine("Brian Weberling"); addCreditsLine("Brian Wright"); addCreditsLine("Brice Gharst"); addCreditsLine("Brion Miller"); addCreditsLine("Bruce Oberleitner"); addCreditsLine("Bryan Heard"); addCreditsLine("Bryan Stroop"); addCreditsLine("Buddy Pritchard"); addCreditsLine("C. Henrique Olifiers"); addCreditsLine("C. Kyle Bennett"); addCreditsLine("C.D. Thurman"); addCreditsLine("Caleb Cauthon"); addCreditsLine("Camere Danilo"); addCreditsLine("Camille Castel"); addCreditsLine("Carl Anderson"); addCreditsLine("Carl Andersson"); addCreditsLine("Carl Buckley"); addCreditsLine("Carl Chambers"); addCreditsLine("Carla Louisa Andrews"); addCreditsLine("Carlos Delgado"); addCreditsLine("Carolyn Manis"); addCreditsLine("Casey O'Connor"); addCreditsLine("Casper Lund"); addCreditsLine("Cedric Hourcade"); addCreditsLine("Chad Jolly"); addCreditsLine("Channon Wong"); addCreditsLine("Charl Theron"); addCreditsLine("Charles Cresswell"); addCreditsLine("Charles F. Gast"); addCreditsLine("Charles Koelemay"); addCreditsLine("Charlie VanDyke"); addCreditsLine("Chason Ellis"); addCreditsLine("Choi Byeong-Ho"); addCreditsLine("Chow Yun"); addCreditsLine("Chris Abele"); addCreditsLine("Chris Aster"); addCreditsLine("Chris Becton"); addCreditsLine("Chris Boucher"); addCreditsLine("Chris Boyd"); addCreditsLine("Chris Browning"); addCreditsLine("Chris Buckler"); addCreditsLine("Chris Cacioppo"); addCreditsLine("Chris Calande"); addCreditsLine("Chris Cauthen"); addCreditsLine("Chris Caviness"); addCreditsLine("Chris Cullen"); addCreditsLine("Chris Dettmann"); addCreditsLine("Chris Duncan"); addCreditsLine("Chris Farmer"); addCreditsLine("Chris Fields"); addCreditsLine("Chris Frederick"); addCreditsLine("Chris Hersey"); addCreditsLine("Chris Hewitt"); addCreditsLine("Chris Holfeld"); addCreditsLine("Chris Houston"); addCreditsLine("Chris Jones"); addCreditsLine("Chris Joyce"); addCreditsLine("Chris Kissinger"); addCreditsLine("Chris Mahnken"); addCreditsLine("Chris Mermagen"); addCreditsLine("Chris Walker"); addCreditsLine("Chris Weatherwax"); addCreditsLine("Chris Weeks"); addCreditsLine("Chris Willis"); addCreditsLine("Chris Wilson"); addCreditsLine("Chris Youren"); addCreditsLine("Christian D. Loftus"); addCreditsLine("Christian Davis"); addCreditsLine("Christian Peth"); addCreditsLine("Christoher Rex Prangnell"); addCreditsLine("Christoph Hagenbrock"); addCreditsLine("Christoph Schwayer"); addCreditsLine("Christopher Clarke"); addCreditsLine("Christopher Donahue"); addCreditsLine("Christopher Duffield"); addCreditsLine("Christopher Forbes Davidson"); addCreditsLine("Christopher Gray"); addCreditsLine("Christopher J. Burden"); addCreditsLine("Christopher Jones"); addCreditsLine("Christopher Tan"); addCreditsLine("Chuang Li-chung"); addCreditsLine("Chuck Houlette"); addCreditsLine("Chum Chancharadeth"); addCreditsLine("Clarence Jones"); addCreditsLine("Clark Bradley"); addCreditsLine("Clay Reyer"); addCreditsLine("Clay Taylor"); addCreditsLine("Clayton Griffin"); addCreditsLine("Cliff Yaun"); addCreditsLine("Clint Gallon"); addCreditsLine("Cody Edwards"); addCreditsLine("Colin Howitt"); addCreditsLine("Colin Korbelas"); addCreditsLine("Colin Laughlin"); addCreditsLine("Colin murray"); addCreditsLine("Collin Theseira"); addCreditsLine("Cory Altheide"); addCreditsLine("Cory Hill"); addCreditsLine("Cory Miller"); addCreditsLine("Craig Beers"); addCreditsLine("Craig Paterson"); addCreditsLine("Crystal McHale"); addCreditsLine("Curtis Campbell"); addCreditsLine("Curtis Rock"); addCreditsLine("Daire Garvey"); addCreditsLine("Dallas Harris"); addCreditsLine("Damien Webber"); addCreditsLine("Damien Webber"); addCreditsLine("Dan Ilan"); addCreditsLine("Dan Kolta"); addCreditsLine("Dan Lyons"); addCreditsLine("Dan Peters"); addCreditsLine("Dan Schmierer"); addCreditsLine("Dan Sego"); addCreditsLine("Dane Barber"); addCreditsLine("Daniel Chenoweth"); addCreditsLine("Daniel Costantini"); addCreditsLine("Daniel Gallegos"); addCreditsLine("Daniel J. Patton"); addCreditsLine("Daniel Medini"); addCreditsLine("Daniel Neilsen"); addCreditsLine("Daniel Nolan"); addCreditsLine("Daniel Palmer"); addCreditsLine("Daniel Smith"); addCreditsLine("Daniel Soderstrom"); addCreditsLine("Danny Cotton"); addCreditsLine("Danny Van Bronkhorst"); addCreditsLine("Darion Lowenstein"); addCreditsLine("Darko Miodrag"); addCreditsLine("Darragh O' Toole"); addCreditsLine("Darren Asato"); addCreditsLine("Darren Menzies"); addCreditsLine("Darren Mitchell"); addCreditsLine("Darren Sorrell"); addCreditsLine("Darren Tabor"); addCreditsLine("Dave Benedict"); addCreditsLine("Dave Calame"); addCreditsLine("Dave Fried"); addCreditsLine("Dave Schwinger"); addCreditsLine("Dave Warner"); addCreditsLine("Dave Wight"); addCreditsLine("David Bonds"); addCreditsLine("David Chubb"); addCreditsLine("David De Boer"); addCreditsLine("David Higgins"); addCreditsLine("David Lindberg"); addCreditsLine("David Liu"); addCreditsLine("David Oxwell"); addCreditsLine("David Paukstys"); addCreditsLine("David Peterson"); addCreditsLine("David Quinn"); addCreditsLine("David Richards"); addCreditsLine("David Stetz"); addCreditsLine("David W. Atchley"); addCreditsLine("Dean Sykes"); addCreditsLine("Deffi"); addCreditsLine("Denish Puspparajah"); addCreditsLine("Dennis Fox"); addCreditsLine("Dennis Goedbloed"); addCreditsLine("Dennis Gurock"); addCreditsLine("Dennis Oden"); addCreditsLine("Dennis Price"); addCreditsLine("Dennis vd Broek"); addCreditsLine("Derek Bao"); addCreditsLine("Derek McGee"); addCreditsLine("Derek Millar"); addCreditsLine("Derek Mulder"); addCreditsLine("Derrick T. Woolworth"); addCreditsLine("Devin Blair"); addCreditsLine("Devin C. Glenn"); addCreditsLine("Devin L. Ganger"); addCreditsLine("Dimitri Gunsing"); addCreditsLine("Dion Clapperton"); addCreditsLine("Dirk Lambert"); addCreditsLine("Dirk Moerenhout"); addCreditsLine("Dominic Carus"); addCreditsLine("Donald Ho"); addCreditsLine("Donald Mills"); addCreditsLine("Duncan Law"); addCreditsLine("Duncan McLeod"); addCreditsLine("Dustin Lesan"); addCreditsLine("Dustin Miller"); addCreditsLine("Dyanne Lee"); addCreditsLine("Ed Molnar"); addCreditsLine("Ed Sin"); addCreditsLine("Eddie Manso"); addCreditsLine("Eddie Pierce"); addCreditsLine("Editorial GameSurf"); addCreditsLine("Edric Borja"); addCreditsLine("Eduardo Amaro"); addCreditsLine("Edward Van Brunt"); addCreditsLine("Elliot Naiman"); addCreditsLine("Emanuele"); addCreditsLine("Emiliano Saurin"); addCreditsLine("Ephraim Brodsky"); addCreditsLine("Erbil Salihoglu"); addCreditsLine("Eric Bultman"); addCreditsLine("Eric Hudzikiewicz"); addCreditsLine("Eric Iovan"); addCreditsLine("Eric Manko"); addCreditsLine("Eric Ray"); addCreditsLine("Eric Ross"); addCreditsLine("Eric Soulvie"); addCreditsLine("Eric Stankelis"); addCreditsLine("Eric Takamoto"); addCreditsLine("Eric Toledo"); addCreditsLine("Erick Apeles"); addCreditsLine("Erik de Jong"); addCreditsLine("Erik Gulbrandsen"); addCreditsLine("Ernie Page"); addCreditsLine("Erwin Esener"); addCreditsLine("Espen Andresen"); addCreditsLine("Eugene Goh"); addCreditsLine("Everett Whiteway"); addCreditsLine("Fabian Ianigro"); addCreditsLine("Faizaan Ghauri"); addCreditsLine("Fiona Stevens"); addCreditsLine("Francesco Sorrentino"); addCreditsLine("Francis To"); addCreditsLine("Frank Canedy"); addCreditsLine("Frank Collins"); addCreditsLine("Frank Hop"); addCreditsLine("Frank McGee"); addCreditsLine("Franz Tfferl"); addCreditsLine("Fred Cheng"); addCreditsLine("Fred Hill"); addCreditsLine("Frederik Kruse Hannibal"); addCreditsLine("Fulvio Tagliento"); addCreditsLine("Gabe Othman"); addCreditsLine("Gabor Orban"); addCreditsLine("Gabriel David"); addCreditsLine("Gary Caine"); addCreditsLine("Gary J. Talley"); addCreditsLine("Gary McWilliams"); addCreditsLine("Gary Milante"); addCreditsLine("Gary Schweisthal"); addCreditsLine("Gavin Henrick"); addCreditsLine("Geoff Dodd"); addCreditsLine("Geoffrey Forman"); addCreditsLine("George Campbell"); addCreditsLine("George Ganas"); addCreditsLine("George Wingard"); addCreditsLine("Gilberto Barbicinti"); addCreditsLine("Gino Gard"); addCreditsLine("Glenn Reasor"); addCreditsLine("Glenn Wisbey"); addCreditsLine("Gordon Lee"); addCreditsLine("Gordon Mak"); addCreditsLine("Gordon Wilcox"); addCreditsLine("Goty Liu"); addCreditsLine("Greg Barnett"); addCreditsLine("Greg Gilleland"); addCreditsLine("Greg Habetler"); addCreditsLine("Greg Milton"); addCreditsLine("Greg Romaszka"); addCreditsLine("Greg Walk"); addCreditsLine("Gregory Hill"); addCreditsLine("Gregory Peng"); addCreditsLine("Gregory Pesochin"); addCreditsLine("Greigg Stein"); addCreditsLine("Guillaume Neron"); addCreditsLine("Gunnar Schumann"); addCreditsLine("Guy Mirisciotta"); addCreditsLine("H.Yamao"); addCreditsLine("Hamed Khoojinian"); addCreditsLine("Hannes Wagner"); addCreditsLine("Hans David Lemons"); addCreditsLine("Harold Brown"); addCreditsLine("Harry Glaser"); addCreditsLine("Harry Kambouropoulos"); addCreditsLine("Hashish HasnaIn"); addCreditsLine("Heath Fischer"); addCreditsLine("Helge Nesen"); addCreditsLine("Hendrik Bauer"); addCreditsLine("Hendrik Strobel"); addCreditsLine("Henk Schaefer"); addCreditsLine("Henry Lee"); addCreditsLine("Henry Martins"); addCreditsLine("Hugh Norton-Smith"); addCreditsLine("Hugh Spencer"); addCreditsLine("Hunter Luisi"); addCreditsLine("Ian Glenn"); addCreditsLine("Ian Redden"); addCreditsLine("Ian Threadgold"); addCreditsLine("Igor Bachinsky"); addCreditsLine("Issac Rosser"); addCreditsLine("Iwan Khouw"); addCreditsLine("J. Scott Randall"); addCreditsLine("Jaap de Heer"); addCreditsLine("Jack Mamais"); addCreditsLine("Jaesson Yeo"); addCreditsLine("James Balough"); addCreditsLine("James Batty"); addCreditsLine("James C. Hanna"); addCreditsLine("James Ell"); addCreditsLine("James Gentry III"); addCreditsLine("James Logan"); addCreditsLine("James Molson"); addCreditsLine("James Ramsey"); addCreditsLine("James Tucker"); addCreditsLine("James Weisgerber"); addCreditsLine("Jamie Reep"); addCreditsLine("Jan Siarov"); addCreditsLine("Jani Sundstrom"); addCreditsLine("Janne Puonti"); addCreditsLine("Jared Black"); addCreditsLine("Jared Keller"); addCreditsLine("Jarle Hauglum"); addCreditsLine("Jason Alday"); addCreditsLine("Jason Alombro"); addCreditsLine("Jason Bergman"); addCreditsLine("Jason Cross"); addCreditsLine("Jason De Arte"); addCreditsLine("Jason Fleming"); addCreditsLine("Jason Gill"); addCreditsLine("Jason Goodfellow"); addCreditsLine("Jason Goodowens"); addCreditsLine("Jason Jenkins"); addCreditsLine("Jason Kinnear"); addCreditsLine("Jason Kochan"); addCreditsLine("Jason Newington"); addCreditsLine("Jason Robert Nelson"); addCreditsLine("Jason Widy"); addCreditsLine("Javier Jimnez"); addCreditsLine("Jay Johnson"); addCreditsLine("Jay Weitekamp"); addCreditsLine("Jeff Buckland"); addCreditsLine("Jeff Chang"); addCreditsLine("Jeff Day"); addCreditsLine("Jeff Dotson"); addCreditsLine("Jeff Drouet"); addCreditsLine("Jeff Greth"); addCreditsLine("Jeff Hedges"); addCreditsLine("Jeff Lofgren"); addCreditsLine("Jeff Shauger"); addCreditsLine("Jeff Shaw"); addCreditsLine("Jeff Streeter"); addCreditsLine("Jeff Tom"); addCreditsLine("Jeffrey A. Tindle"); addCreditsLine("Jeffrey Rudolph"); addCreditsLine("Jelle Twerda"); addCreditsLine("Jens Larsson"); addCreditsLine("Jeppe Christensen"); addCreditsLine("Jeremy Burke"); addCreditsLine("Jeremy Chookas"); addCreditsLine("Jeremy Klemm"); addCreditsLine("Jeremy Rogers"); addCreditsLine("Jeremy Werkheiser"); addCreditsLine("Jeroen Rasschaert"); addCreditsLine("Jerry Annin"); addCreditsLine("Jerry Holkins"); addCreditsLine("Jerry Qassar"); addCreditsLine("Jesse Maher"); addCreditsLine("Jesse Smith"); addCreditsLine("Jim Andrews"); addCreditsLine("Jim Dale"); addCreditsLine("Jim Gosney"); addCreditsLine("Jim Richardson"); addCreditsLine("Jimmy Chandler"); addCreditsLine("Jimmy van der Have"); addCreditsLine("Joe Diamond"); addCreditsLine("Joe Dopp"); addCreditsLine("Joe Downs"); addCreditsLine("Joe Falcomata"); addCreditsLine("Joe Kennedy"); addCreditsLine("Joe Mauga"); addCreditsLine("Joe McGuire"); addCreditsLine("Joe Prowell"); addCreditsLine("Joe Seifert"); addCreditsLine("Joel Bruick"); addCreditsLine("Joern Schnautz"); addCreditsLine("Joey Snailham"); addCreditsLine("Johan Khne"); addCreditsLine("John Bialick"); addCreditsLine("John Buckingham"); addCreditsLine("John Burnett"); addCreditsLine("John Cain"); addCreditsLine("John Colin Hanna"); addCreditsLine("John Davis"); addCreditsLine("John DeBruyn"); addCreditsLine("John Dodds"); addCreditsLine("John Finr"); addCreditsLine("John Hazelden"); addCreditsLine("John Hemaloto"); addCreditsLine("John K. Ogi"); addCreditsLine("John Kilmartin"); addCreditsLine("John Kok Chung Yoong"); addCreditsLine("John Mattison"); addCreditsLine("John Nielsen"); addCreditsLine("John Reque"); addCreditsLine("John Rodriguez"); addCreditsLine("John Tackman"); addCreditsLine("John Titus"); addCreditsLine("John Wolf"); addCreditsLine("Johnny Christensen"); addCreditsLine("Jon Callirgos"); addCreditsLine("Jon Naiman"); addCreditsLine("Jon Norris"); addCreditsLine("Jon Pudge"); addCreditsLine("Jon Simon"); addCreditsLine("Jonas Hansen"); addCreditsLine("Jonathan Bale"); addCreditsLine("Jonathan Fingas"); addCreditsLine("Jonathan Hill"); addCreditsLine("Jonathan Hilmer"); addCreditsLine("Jonathan Parker"); addCreditsLine("Jonathan Peters"); addCreditsLine("Jonathan Reed"); addCreditsLine("Jonathan Slark"); addCreditsLine("Jonathan W. Hebert"); addCreditsLine("Jonathan Whitehouse"); addCreditsLine("Jone Kajan"); addCreditsLine("Jordan Cheetin"); addCreditsLine("Jordan Mercier"); addCreditsLine("Joscha Dzielak"); addCreditsLine("Jose Magana"); addCreditsLine("Josef Jahn"); addCreditsLine("Joseph Downs"); addCreditsLine("Joseph Liu"); addCreditsLine("Joseph Walling"); addCreditsLine("Josh Hoey"); addCreditsLine("Joshua Geary"); addCreditsLine("Juan Pablo Erices"); addCreditsLine("Jurgen De Vos"); addCreditsLine("Justin Darity"); addCreditsLine("Justin Forward"); addCreditsLine("Justin Meske"); addCreditsLine("Justin Talley"); addCreditsLine("Karen Cobb"); addCreditsLine("Karen Holland"); addCreditsLine("Kar-Hai Chu"); addCreditsLine("Kari Gardner"); addCreditsLine("Karl Heck"); addCreditsLine("Karl Seguin"); addCreditsLine("Karre Knudsen"); addCreditsLine("Keith Allen Brown"); addCreditsLine("Keith Hampe"); addCreditsLine("Keith Lehman"); addCreditsLine("Keith Lu"); addCreditsLine("Kelly Christians"); addCreditsLine("Kelvin Kim"); addCreditsLine("Ken Herritt"); addCreditsLine("Ken Holst"); addCreditsLine("Kenneth Goh"); addCreditsLine("Kenric Tam"); addCreditsLine("Kent Daniels"); addCreditsLine("Kenzo Iwanaga"); addCreditsLine("Keoni van't Groenewout"); addCreditsLine("Kevin Christian"); addCreditsLine("Kevin Fuhst"); addCreditsLine("Kevin Lee"); addCreditsLine("Kevin Middleton"); addCreditsLine("Kevin R. McGaffey"); addCreditsLine("Kevin Rank"); addCreditsLine("Kevin Tanghe"); addCreditsLine("Kibeom Song"); addCreditsLine("Kim Anderson"); addCreditsLine("Kim Dae Uk"); addCreditsLine("Kishan Shri"); addCreditsLine("Kody Dickerson"); addCreditsLine("Kohei Iwanaga"); addCreditsLine("Kolya Rice"); addCreditsLine("Kris Bugbee"); addCreditsLine("Kris Thomson"); addCreditsLine("Kristian Christensen"); addCreditsLine("Kristo Kurtn"); addCreditsLine("Kurt Sund"); addCreditsLine("Kwabena Otchere"); addCreditsLine("Kyle Doris"); addCreditsLine("Kyle Godfrey"); addCreditsLine("Kyle Job"); addCreditsLine("Kyle Leveque"); addCreditsLine("Kyle Morrison"); addCreditsLine("Lance Tegner"); addCreditsLine("Lars Jelstad"); addCreditsLine("Laura Schreiner"); addCreditsLine("Lawrence Chung"); addCreditsLine("Lawrence Jupina"); addCreditsLine("Lee Weaver"); addCreditsLine("Leif Anderson"); addCreditsLine("Leonard Pak"); addCreditsLine("Leslie Ho Bee Chew"); addCreditsLine("Liam Byrne"); addCreditsLine("Lian Bredenkamp"); addCreditsLine("Lim Eui Taek"); addCreditsLine("Liviu Stan"); addCreditsLine("Lon Chen"); addCreditsLine("Lord Olav Rekve III"); addCreditsLine("Loren Oldham"); addCreditsLine("Lorne Laliberte"); addCreditsLine("Louie Ramones"); addCreditsLine("Lucas Goodwin"); addCreditsLine("Lucas Tvrdik"); addCreditsLine("Luis Zapata"); addCreditsLine("Luiz Ricardo Malheiros"); addCreditsLine("Luke McBeath"); addCreditsLine("Manu De Gersem"); addCreditsLine("Marc Broekhoven"); addCreditsLine("Marc Bunin"); addCreditsLine("Marc Chang"); addCreditsLine("Marc Cobelens"); addCreditsLine("Marc Elvy"); addCreditsLine("Marc Rehder"); addCreditsLine("Marco Amato"); addCreditsLine("Marco Casati"); addCreditsLine("Marcus Hurst"); addCreditsLine("Marcus Miller"); addCreditsLine("Mariano Porta"); addCreditsLine("Mario Batlle"); addCreditsLine("Mario Olivier"); addCreditsLine("Maritza Kvalsvik"); addCreditsLine("Marius Andre Aasly"); addCreditsLine("Mark Brieden"); addCreditsLine("Mark Caldwell"); addCreditsLine("Mark de Jong"); addCreditsLine("Mark Dickenson"); addCreditsLine("Mark Fiore"); addCreditsLine("Mark Hephner"); addCreditsLine("Mark Siciliano"); addCreditsLine("Mark Steurer"); addCreditsLine("Mark Szabo"); addCreditsLine("Mark Yocom"); addCreditsLine("Markus Cichy"); addCreditsLine("Markus Eisenblaetter"); addCreditsLine("Markus Eskermo"); addCreditsLine("Markus Roth"); addCreditsLine("Martin Kremer"); addCreditsLine("Martin Parker"); addCreditsLine("Mat Bettinson"); addCreditsLine("Mathew Zauher"); addCreditsLine("Mathias Lindfeldt"); addCreditsLine("Mathieu Bouchard"); addCreditsLine("Matt Berkland"); addCreditsLine("Matt Brunmeier"); addCreditsLine("Matt Chandronait"); addCreditsLine("Matt Cohen"); addCreditsLine("Matt Collins"); addCreditsLine("Matt Craw"); addCreditsLine("Matt Culp"); addCreditsLine("Matt Davis"); addCreditsLine("Matt DeWald"); addCreditsLine("Matt Grange"); addCreditsLine("Matt Green"); addCreditsLine("Matt McCall"); addCreditsLine("Matt Timlin"); addCreditsLine("Matt Vilcsak"); addCreditsLine("Matt Wilson"); addCreditsLine("Matthew A. Clarke"); addCreditsLine("Matthew Frolick"); addCreditsLine("Matthew Jenkins"); addCreditsLine("Matthew Keen"); addCreditsLine("Matthew Keith"); addCreditsLine("Matthew McKeown"); addCreditsLine("Matthew Williams"); addCreditsLine("Matthias Schneidt"); addCreditsLine("Maurice Kambach"); addCreditsLine("Maurice Tan"); addCreditsLine("Mauro Artou"); addCreditsLine("Max Robins"); addCreditsLine("Melissa Webb"); addCreditsLine("Meredith Marine"); addCreditsLine("Michael A Pratt"); addCreditsLine("Michael Carroll"); addCreditsLine("Michael Dunne"); addCreditsLine("Michael Ennis"); addCreditsLine("Michael Hamlett"); addCreditsLine("Michael Jacovina"); addCreditsLine("Michael Johnston"); addCreditsLine("Michael Kenney"); addCreditsLine("Michael Parks"); addCreditsLine("Michael Strong"); addCreditsLine("Michael Tan It Han"); addCreditsLine("Michael Valera"); addCreditsLine("Michael van Huystee"); addCreditsLine("Michael Voigt"); addCreditsLine("Michael Waldvogle"); addCreditsLine("Michael Wichter"); addCreditsLine("Michael Thornton"); addCreditsLine("Mickey Borchardt"); addCreditsLine("Miguel Schneeberger"); addCreditsLine("Mika Hyvonen"); addCreditsLine("Mikael Garde Nielsen"); addCreditsLine("Mike Benton"); addCreditsLine("Mike Burton"); addCreditsLine("Mike Comroe"); addCreditsLine("Mike Cutillo"); addCreditsLine("Mike Dally"); addCreditsLine("Mike Fedorov"); addCreditsLine("Mike Hillebrecht"); addCreditsLine("Mike Large"); addCreditsLine("Mike Leeder"); addCreditsLine("Mike Mann"); addCreditsLine("Mike Plavin"); addCreditsLine("Mike Ransom"); addCreditsLine("Mike Swanson"); addCreditsLine("Mike Weiss"); addCreditsLine("Mikkel Johansen"); addCreditsLine("Ming Jack Po"); addCreditsLine("Minos Dounias"); addCreditsLine("Moonja Choi"); addCreditsLine("Morghan Laswell"); addCreditsLine("Motohiko Kimura"); addCreditsLine("Moussa Khan"); addCreditsLine("Myles Angell"); addCreditsLine("N. David Griffin"); addCreditsLine("Naoki Yokoyama"); addCreditsLine("Nate Timperley"); addCreditsLine("Nathan Clark"); addCreditsLine("Nathan Sweet"); addCreditsLine("Neal Sample"); addCreditsLine("Neale Guy"); addCreditsLine("Neil Crabaugh"); addCreditsLine("Neil Witkin"); addCreditsLine("Nelson Billedo"); addCreditsLine("Nemar Velasquez"); addCreditsLine("Niall Chadwick"); addCreditsLine("Nic Minnis"); addCreditsLine("Nicholas Chea"); addCreditsLine("Nicholas Paufler"); addCreditsLine("Nick Berthet"); addCreditsLine("Nick Bogolyubov"); addCreditsLine("Nick Carr"); addCreditsLine("Nick Goebel"); addCreditsLine("Nick Martini"); addCreditsLine("Nick Orlich"); addCreditsLine("Nick Petska"); addCreditsLine("Nick Rose"); addCreditsLine("Nick S. Pasto"); addCreditsLine("Nico Schlichting"); addCreditsLine("Nicolas Roux"); addCreditsLine("Niklas Westerlund"); addCreditsLine("Nikolai Sagun"); addCreditsLine("Octavian Busuioc"); addCreditsLine("Ola Olsson"); addCreditsLine("Olivier Roulx"); addCreditsLine("Omar Yehia"); addCreditsLine("Or Yerushalmi"); addCreditsLine("Orlando Rojas"); addCreditsLine("Oscar Bossi"); addCreditsLine("P. Bryan Edge-Salois"); addCreditsLine("P.J. Allen"); addCreditsLine("Pamela A. Holmberg"); addCreditsLine("Pamela McClean"); addCreditsLine("Paolo Ne"); addCreditsLine("Paolo Petrini"); addCreditsLine("Pr Nordenstam"); addCreditsLine("Pascal Buettikofer"); addCreditsLine("Pascal Woudenberg"); addCreditsLine("Pat Callahan"); addCreditsLine("Pat Donovan"); addCreditsLine("Patricio Foieri"); addCreditsLine("Patrick Bryant"); addCreditsLine("Patrick Fitzsimons"); addCreditsLine("Patrick Kramer"); addCreditsLine("Patrick Peters"); addCreditsLine("Patrick Thomas"); addCreditsLine("Patrick Zerr"); addCreditsLine("Patrizia Bischof"); addCreditsLine("Paul Adriance"); addCreditsLine("Paul Barnes"); addCreditsLine("Paul Doucet"); addCreditsLine("Paul Grimes"); addCreditsLine("Paul Hormis"); addCreditsLine("Paul J. Paella"); addCreditsLine("Paul Jeacock"); addCreditsLine("Paul Magyar"); addCreditsLine("Paul McClelland"); addCreditsLine("Paul Morris"); addCreditsLine("Paul Polzer"); addCreditsLine("Paul Prestopnik"); addCreditsLine("Paul Ruhan"); addCreditsLine("Paul Tousignant"); addCreditsLine("Paul Warren"); addCreditsLine("Paul Wedgwood"); addCreditsLine("Paul Williams"); addCreditsLine("Paul Wright"); addCreditsLine("Penny Miller"); addCreditsLine("Per Kristiansen"); addCreditsLine("Per Vestersgaard-Andersen"); addCreditsLine("Pete Harris"); addCreditsLine("Peter Baker"); addCreditsLine("Peter Brindpke"); addCreditsLine("Peter Brock Madsen"); addCreditsLine("Peter Davis"); addCreditsLine("Peter Kazmierow"); addCreditsLine("Peter Mayberry"); addCreditsLine("Peter Pistorius"); addCreditsLine("Peter Romano"); addCreditsLine("Peter Vaisvil"); addCreditsLine("Peter Wittig"); addCreditsLine("Petter Eriksson"); addCreditsLine("Petteri Taipale"); addCreditsLine("Phil & Rebecca Carey"); addCreditsLine("Phil Pappas"); addCreditsLine("Philip Charles Maslied"); addCreditsLine("Philip Schultz"); addCreditsLine("Phill Curiale"); addCreditsLine("Phillip Ervin"); addCreditsLine("Phillip Kono"); addCreditsLine("Phillip Ploesser"); addCreditsLine("Phillip Stewart"); addCreditsLine("Pchhacker Lee"); addCreditsLine("Prasad Galpoththawela"); addCreditsLine("Radu Lucian"); addCreditsLine("Rafi Zaguri"); addCreditsLine("Ragnar Lonn"); addCreditsLine("Ramiro Salgado Echeverria"); addCreditsLine("Raphael Choo Boon Leck"); addCreditsLine("Rasmus Have"); addCreditsLine("Rene Bortko"); addCreditsLine("Rene Wesselius"); addCreditsLine("Ren-Wey Yang"); addCreditsLine("Res Ngata"); addCreditsLine("Reto Baumann"); addCreditsLine("Ric Moseley"); addCreditsLine("Richard Casto"); addCreditsLine("Richard Cole"); addCreditsLine("Richard Egglestone"); addCreditsLine("Richard Freeouf"); addCreditsLine("Richard Low"); addCreditsLine("Richard McCarthy"); addCreditsLine("Richard Shackleton"); addCreditsLine("Richard Thurlow"); addCreditsLine("Rick Buford"); addCreditsLine("Ricky Fernandez"); addCreditsLine("Rino Nielsen"); addCreditsLine("Rob Cundiff"); addCreditsLine("Rob Duffy"); addCreditsLine("Rob Jones"); addCreditsLine("Rob Rynda"); addCreditsLine("Rob Tyre"); addCreditsLine("Rob Weller"); addCreditsLine("Robert Apsel"); addCreditsLine("Robert Cass"); addCreditsLine("Robert Hinkle"); addCreditsLine("Robert Jahnel"); addCreditsLine("Robert Layser"); addCreditsLine("Robert LeBlanc"); addCreditsLine("Robert Polzer"); addCreditsLine("Robert Villasana"); addCreditsLine("Roberto Toldo"); addCreditsLine("Rocco Borg"); addCreditsLine("Rod Chrenek"); addCreditsLine("Rogelio Olguin"); addCreditsLine("Roger Sewell"); addCreditsLine("Roland Chabbey"); addCreditsLine("Ron Anshel"); addCreditsLine("Ronen Lazarovitch"); addCreditsLine("Ross A. Carlson"); addCreditsLine("Ross Carlson"); addCreditsLine("Ross Litchfield"); addCreditsLine("Roy Greenhalgh"); addCreditsLine("Rozsonits Lszl"); addCreditsLine("Rozsonits Tibor"); addCreditsLine("Ruben Eikeland"); addCreditsLine("Ruben Pauwels"); addCreditsLine("Rune Fjeld Olsen"); addCreditsLine("Rune Hkansson"); addCreditsLine("Rune Warhuus"); addCreditsLine("Russ Davies"); addCreditsLine("Russell Mein"); addCreditsLine("Russell Thompson"); addCreditsLine("Ryan Bailey"); addCreditsLine("Ryan Counts"); addCreditsLine("Ryan Gilfillan"); addCreditsLine("Ryan Hopsecker"); addCreditsLine("Ryan Kelly"); addCreditsLine("Ryan Lee"); addCreditsLine("Ryan Schoonmaker"); addCreditsLine("Ryan Thernes"); addCreditsLine("Sam Mackrill"); addCreditsLine("Sam Tanis"); addCreditsLine("Sam Whitehead"); addCreditsLine("Samuel Heffley"); addCreditsLine("Samuel L Jones"); addCreditsLine("Sarah Johnstone"); addCreditsLine("Scott Abeyta"); addCreditsLine("Scott Allison"); addCreditsLine("Scott Bair"); addCreditsLine("Scott Dennis"); addCreditsLine("Scott Egashira"); addCreditsLine("Scott Estabrook"); addCreditsLine("Scott Jenkins"); addCreditsLine("Scott Kennedy"); addCreditsLine("Scott McCulloch"); addCreditsLine("Scott Medlin"); addCreditsLine("Scott Miller"); addCreditsLine("Scott Pearson"); addCreditsLine("Scott Stahl"); addCreditsLine("Scotty Theriot"); addCreditsLine("Sean Brezniak"); addCreditsLine("Sean Bryson"); addCreditsLine("Sean Claflin"); addCreditsLine("Sean Dawson"); addCreditsLine("Sean Fitzsimons"); addCreditsLine("Sean M. Davis"); addCreditsLine("Sean Parramore"); addCreditsLine("Sean Polzer"); addCreditsLine("Sean Stanley"); addCreditsLine("Sean Swayze"); addCreditsLine("Sean Uezu"); addCreditsLine("Sebastian Stange"); addCreditsLine("Sebastien Guillemet"); addCreditsLine("Sebastien Jesionka"); addCreditsLine("Sergey Kovrov"); addCreditsLine("Seth Buntain"); addCreditsLine("Seth Thompson"); addCreditsLine("Shae Pritchard-Martinez"); addCreditsLine("Shane Beaumont"); addCreditsLine("Shane Evans"); addCreditsLine("Shane Froebel"); addCreditsLine("Shane Taylor"); addCreditsLine("Shaun Newsome"); addCreditsLine("Shawn Christenson"); addCreditsLine("Shelby Townsend"); addCreditsLine("Si Donbavand"); addCreditsLine("Simon Gooding"); addCreditsLine("Simon Malo"); addCreditsLine("Simon Muir"); addCreditsLine("Simon Pedersen"); addCreditsLine("Sing Wu"); addCreditsLine("Sjaak Ursinus"); addCreditsLine("Skip McIlvaine"); addCreditsLine("Sohail Bhamani"); addCreditsLine("Spencer Tsai"); addCreditsLine("Stacey A Ross"); addCreditsLine("Stan C Audle"); addCreditsLine("Stan Ilin"); addCreditsLine("Stan James"); addCreditsLine("Stef Johannes Henderson"); addCreditsLine("Stefan Grufman"); addCreditsLine("Stefan Kiesel"); addCreditsLine("Stefano Petrullo"); addCreditsLine("Stefano Zanola"); addCreditsLine("Steffen Knapp"); addCreditsLine("Stephan Brezinsky"); addCreditsLine("Stephen Cimprich"); addCreditsLine("Stephen Le Petit"); addCreditsLine("Stephen Limowski"); addCreditsLine("Stephen Lynch"); addCreditsLine("Stephen Summerell"); addCreditsLine("Steve Bailey"); addCreditsLine("Steve Batham"); addCreditsLine("Steve Carrion"); addCreditsLine("Steve Gibson"); addCreditsLine("Steve Nixon"); addCreditsLine("Steve Pompel"); addCreditsLine("Steve Saulle"); addCreditsLine("Steve Smith"); addCreditsLine("Steve Stryd"); addCreditsLine("Steve Tory"); addCreditsLine("Steven E. Adams"); addCreditsLine("Steven Grossman"); addCreditsLine("Steven Kats"); addCreditsLine("Steven Knox"); addCreditsLine("Steven Kusewicz"); addCreditsLine("Stewart Laufer"); addCreditsLine("Stewart Tosh"); addCreditsLine("Stuart Ross Robertson"); addCreditsLine("T.J. Allard"); addCreditsLine("Takafumi Kobayashi"); addCreditsLine("Takashi Morikawa"); addCreditsLine("Tal Muskal"); addCreditsLine("Tal Nelson"); addCreditsLine("Tan Peng Koon"); addCreditsLine("Tanner Burgess"); addCreditsLine("Taylor Stewart"); addCreditsLine("Taylor Suchan"); addCreditsLine("Teck Wong"); addCreditsLine("Terje Alexander Barth"); addCreditsLine("Tero Heija"); addCreditsLine("Theresa Petersen"); addCreditsLine("Thomas Dnnecke"); addCreditsLine("Thomas From"); addCreditsLine("Thomas Goemaere"); addCreditsLine("Thomas Hardy"); addCreditsLine("Thomas Kumpik, Jr."); addCreditsLine("Thomas Prinz"); addCreditsLine("Thomas R. Bissell III"); addCreditsLine("Thomas Ribbeck"); addCreditsLine("Tiffany Diaz"); addCreditsLine("Tim Engelman"); addCreditsLine("Tim Hammock"); addCreditsLine("Tim Kautz"); addCreditsLine("Tim ONeil"); addCreditsLine("Tim Rider"); addCreditsLine("Tim Smith"); addCreditsLine("Tim Thompson"); addCreditsLine("Tim Yeung"); addCreditsLine("Timen Wuestman"); addCreditsLine("Timothy C. Stanton"); addCreditsLine("Timothy Lewis"); addCreditsLine("Todd Northcutt"); addCreditsLine("Todd Sjoblom"); addCreditsLine("Tom Beijar Johansson"); addCreditsLine("Tom Carel"); addCreditsLine("Tom Ellis"); addCreditsLine("Tom Fulton"); addCreditsLine("Tom Gordon"); addCreditsLine("Tom Roger Tran"); addCreditsLine("Tom Szabo"); addCreditsLine("Tom Vogt"); addCreditsLine("Tomi Partanen"); addCreditsLine("Toni Ahonen"); addCreditsLine("Tony Caskanette"); addCreditsLine("Torbjrn stlund"); addCreditsLine("Travis Ramme"); addCreditsLine("Trent Donelson"); addCreditsLine("Trevor Lanz"); addCreditsLine("Trevor McGuire"); addCreditsLine("Troy H. Benson"); addCreditsLine("Troy Lee"); addCreditsLine("Tyler Endicott"); addCreditsLine("Tyler Frans"); addCreditsLine("Tyler Jacobson"); addCreditsLine("Tyler Jensen"); addCreditsLine("Tyler Lott"); addCreditsLine("Uli Muller"); addCreditsLine("Verner Fortelius"); addCreditsLine("Vic Stelter"); addCreditsLine("Vidar Alms Pettersen"); addCreditsLine("Ville Halonen"); addCreditsLine("Vincent Cunniffe"); addCreditsLine("Vitor Coelho"); addCreditsLine("Wai wong"); addCreditsLine("Wasif Azmat"); addCreditsLine("Wayne Opai"); addCreditsLine("Wayne Tory"); addCreditsLine("Wayne Wallace"); addCreditsLine("Werner Ptzelberger"); addCreditsLine("Wes Sanders"); addCreditsLine("Will Belknap"); addCreditsLine("Will Erickson"); addCreditsLine("Will Preisch"); addCreditsLine("Willem Bison"); addCreditsLine("William Everett"); addCreditsLine("William Goldberg"); addCreditsLine("William Helm"); addCreditsLine("William Houston"); addCreditsLine("William Klimke"); addCreditsLine("William Knop"); addCreditsLine("William Moss"); addCreditsLine("William Prideaux-Brune"); addCreditsLine("William Sherriff"); addCreditsLine("Wilson Bilkovich"); addCreditsLine("Wing Hon Lai"); addCreditsLine("Wu Yiheng"); addCreditsLine("Yanai Sachs"); addCreditsLine("YeongJin Bae"); addCreditsLine("Yongchan Jee"); addCreditsLine("Yves Peckstadt"); addCreditsLine("Zach McCuin"); addCreditsLine("Zachary Charles "); addCreditsLine("Zachary Denholm"); addCreditsLine("Zion Mizrahi"); addCreditsLine("Zsolt Vincze"); addCreditsLine(""); addCreditsLine("Operation Big Booze"); addCreditsLine("Phil \"Vlad\" Pappas"); addCreditsLine("Greg \"Satan\" Romaszka"); addCreditsLine("Steve \"Cpt.Wussie!!!\" Snow"); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine(""); addCreditsLine("So Long, and Thanks For All The Fish."); addCreditsLine("Tribes2 Development Team", true); PK !(VR--scripts/cursors.cs//----------------------------------------------------------------------------- // Torque Game Engine // // Copyright (c) 2001 GarageGames.Com //----------------------------------------------------------------------------- //------------------------------------------------------------------------------ // Editor Cursors //------------------------------------------------------------------------------ new GuiCursor(EditorHandCursor) { hotSpot = "7 0"; bitmapName = "gui/CUR_hand.png"; }; new GuiCursor(EditorRotateCursor) { hotSpot = "11 18"; bitmapName = "gui/CUR_rotate.png"; }; new GuiCursor(EditorMoveCursor) { hotSpot = "9 13"; bitmapName = "gui/CUR_grab.png"; }; new GuiCursor(EditorArrowCursor) { hotSpot = "0 0"; bitmapName = "gui/CUR_3darrow.png"; }; new GuiCursor(EditorUpDownCursor) { hotSpot = "5 10"; bitmapName = "gui/CUR_3dupdown"; }; new GuiCursor(EditorLeftRightCursor) { hotSpot = "9 5"; bitmapName = "gui/CUR_3dleftright"; }; new GuiCursor(EditorDiagRightCursor) { hotSpot = "8 8"; bitmapName = "gui/CUR_3ddiagright"; }; new GuiCursor(EditorDiagLeftCursor) { hotSpot = "8 8"; bitmapName = "gui/CUR_3ddiagleft"; }; new GuiControl(EmptyControl) { profile = "GuiButtonProfile"; }; PK !( scripts/damageTypes.cs//-------------------------------------------------------------------------- // TYPES OF ALLOWED DAMAGE //-------------------------------------------------------------------------- $DamageType::Default = 0; $DamageType::Blaster = 1; $DamageType::Plasma = 2; $DamageType::Bullet = 3; $DamageType::Disc = 4; $DamageType::Grenade = 5; $DamageType::Laser = 6; // NOTE: This value is referenced directly in code. DO NOT CHANGE! $DamageType::ELF = 7; $DamageType::Mortar = 8; $DamageType::Missile = 9; $DamageType::ShockLance = 10; $DamageType::Mine = 11; $DamageType::Explosion = 12; $DamageType::Impact = 13; // Object to object collisions $DamageType::Ground = 14; // Object to ground collisions $DamageType::Turret = 15; $DamageType::PlasmaTurret = 16; $DamageType::AATurret = 17; $DamageType::ElfTurret = 18; $DamageType::MortarTurret = 19; $DamageType::MissileTurret = 20; $DamageType::IndoorDepTurret = 21; $DamageType::OutdoorDepTurret = 22; $DamageType::SentryTurret = 23; $DamageType::OutOfBounds = 24; $DamageType::Lava = 25; $DamageType::ShrikeBlaster = 26; $DamageType::BellyTurret = 27; $DamageType::BomberBombs = 28; $DamageType::TankChaingun = 29; $DamageType::TankMortar = 30; $DamageType::SatchelCharge = 31; $DamageType::MPBMissile = 32; $DamageType::Lightning = 33; $DamageType::VehicleSpawn = 34; $DamageType::ForceFieldPowerup = 35; $DamageType::Crash = 36; // DMM -- added so MPBs that blow up under water get a message $DamageType::Water = 97; //Tinman - used in Hunters for cheap bastards ;) $DamageType::NexusCamping = 98; // MES -- added so CTRL-K can get a distinctive message $DamageType::Suicide = 99; // Etc, etc. $DamageTypeText[0] = 'default'; $DamageTypeText[1] = 'blaster'; $DamageTypeText[2] = 'plasma'; $DamageTypeText[3] = 'chaingun'; $DamageTypeText[4] = 'disc'; $DamageTypeText[5] = 'grenade'; $DamageTypeText[6] = 'laser'; $DamageTypeText[7] = 'ELF'; $DamageTypeText[8] = 'mortar'; $DamageTypeText[9] = 'missile'; $DamageTypeText[10] = 'shocklance'; $DamageTypeText[11] = 'mine'; $DamageTypeText[12] = 'explosion'; $DamageTypeText[13] = 'impact'; $DamageTypeText[14] = 'ground'; $DamageTypeText[15] = 'turret'; $DamageTypeText[16] = 'plasma turret'; $DamageTypeText[17] = 'AA turret'; $DamageTypeText[18] = 'ELF turret'; $DamageTypeText[19] = 'mortar turret'; $DamageTypeText[20] = 'missile turret'; $DamageTypeText[21] = 'clamp turret'; $DamageTypeText[22] = 'spike turret'; $DamageTypeText[23] = 'sentry turret'; $DamageTypeText[24] = 'out of bounds'; $DamageTypeText[25] = 'lava'; $DamageTypeText[26] = 'shrike blaster'; $DamageTypeText[27] = 'belly turret'; $DamageTypeText[28] = 'bomber bomb'; $DamageTypeText[29] = 'tank chaingun'; $DamageTypeText[30] = 'tank mortar'; $DamageTypeText[31] = 'satchel charge'; $DamageTypeText[32] = 'MPB missile'; $DamageTypeText[33] = 'lighting'; $DamageTypeText[35] = 'ForceField'; $DamageTypeText[36] = 'Crash'; $DamageTypeText[98] = 'nexus camping'; $DamageTypeText[99] = 'suicide'; // ##### PLEASE DO NOT REORDER THE DAMAGE PROFILE TABLES BELOW ##### // (They are set up in the same order as the "Weapons Matrix.xls" sheet for ease of reference when balancing) //---------------------------------------------------------------------------- // VEHICLE DAMAGE PROFILES //---------------------------------------------------------------------------- //**** SHRIKE SCOUT FIGHTER **** datablock SimDataBlock(ShrikeDamageProfile) { shieldDamageScale[$DamageType::Blaster] = 1.75; shieldDamageScale[$DamageType::Bullet] = 1.75; shieldDamageScale[$DamageType::ELF] = 1.0; shieldDamageScale[$DamageType::ShockLance] = 0.5; shieldDamageScale[$DamageType::Laser] = 1.0; shieldDamageScale[$DamageType::ShrikeBlaster] = 4.0; shieldDamageScale[$DamageType::BellyTurret] = 2.0; shieldDamageScale[$DamageType::AATurret] = 3.0; shieldDamageScale[$DamageType::IndoorDepTurret] = 2.5; shieldDamageScale[$DamageType::OutdoorDepTurret] = 2.5; shieldDamageScale[$DamageType::SentryTurret] = 2.5; shieldDamageScale[$DamageType::Disc] = 1.5; shieldDamageScale[$DamageType::Grenade] = 1.0; shieldDamageScale[$DamageType::Mine] = 3.0; shieldDamageScale[$DamageType::Missile] = 3.0; shieldDamageScale[$DamageType::Mortar] = 2.0; shieldDamageScale[$DamageType::Plasma] = 1.0; shieldDamageScale[$DamageType::BomberBombs] = 3.0; shieldDamageScale[$DamageType::TankChaingun] = 3.0; shieldDamageScale[$DamageType::TankMortar] = 2.0; shieldDamageScale[$DamageType::MissileTurret] = 3.0; shieldDamageScale[$DamageType::MortarTurret] = 2.0; shieldDamageScale[$DamageType::PlasmaTurret] = 2.0; shieldDamageScale[$DamageType::SatchelCharge] = 3.5; shieldDamageScale[$DamageType::Default] = 1.0; shieldDamageScale[$DamageType::Impact] = 1.1; shieldDamageScale[$DamageType::Ground] = 1.0; shieldDamageScale[$DamageType::Explosion] = 3.0; shieldDamageScale[$DamageType::Lightning] = 10.0; damageScale[$DamageType::Blaster] = 1.0; damageScale[$DamageType::Bullet] = 1.0; damageScale[$DamageType::ELF] = 0.0; damageScale[$DamageType::ShockLance] = 0.50; damageScale[$DamageType::Laser] = 1.0; damageScale[$DamageType::ShrikeBlaster] = 3.5; damageScale[$DamageType::BellyTurret] = 1.2; damageScale[$DamageType::AATurret] = 1.5; damageScale[$DamageType::IndoorDepTurret] = 1.5; damageScale[$DamageType::OutdoorDepTurret] = 1.5; damageScale[$DamageType::SentryTurret] = 1.5; damageScale[$DamageType::Disc] = 1.25; damageScale[$DamageType::Grenade] = 0.75; damageScale[$DamageType::Mine] = 4.0; damageScale[$DamageType::Missile] = 2.0; damageScale[$DamageType::Mortar] = 2.0; damageScale[$DamageType::Plasma] = 0.5; damageScale[$DamageType::BomberBombs] = 2.0; damageScale[$DamageType::TankChaingun] = 2.0; damageScale[$DamageType::TankMortar] = 2.0; damageScale[$DamageType::MissileTurret] = 1.5; damageScale[$DamageType::MortarTurret] = 2.0; damageScale[$DamageType::PlasmaTurret] = 2.0; damageScale[$DamageType::SatchelCharge] = 3.5; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 1.1; damageScale[$DamageType::Ground] = 1.0; damageScale[$DamageType::Explosion] = 2.0; damageScale[$DamageType::Lightning] = 10.0; }; //**** THUNDERSWORD BOMBER **** datablock SimDataBlock(BomberDamageProfile) { shieldDamageScale[$DamageType::Blaster] = 1.0; shieldDamageScale[$DamageType::Bullet] = 1.0; shieldDamageScale[$DamageType::ELF] = 1.0; shieldDamageScale[$DamageType::ShockLance] = 0.5; shieldDamageScale[$DamageType::Laser] = 1.0; shieldDamageScale[$DamageType::ShrikeBlaster] = 3.5; shieldDamageScale[$DamageType::BellyTurret] = 2.0; shieldDamageScale[$DamageType::AATurret] = 3.0; shieldDamageScale[$DamageType::IndoorDepTurret] = 2.25; shieldDamageScale[$DamageType::OutdoorDepTurret] = 2.25; shieldDamageScale[$DamageType::SentryTurret] = 2.25; shieldDamageScale[$DamageType::Disc] = 1.0; shieldDamageScale[$DamageType::Grenade] = 1.0; shieldDamageScale[$DamageType::Mine] = 3.0; shieldDamageScale[$DamageType::Missile] = 3.0; shieldDamageScale[$DamageType::Mortar] = 2.0; shieldDamageScale[$DamageType::Plasma] = 1.0; shieldDamageScale[$DamageType::BomberBombs] = 3.0; shieldDamageScale[$DamageType::TankChaingun] = 3.0; shieldDamageScale[$DamageType::TankMortar] = 2.0; shieldDamageScale[$DamageType::MissileTurret] = 3.0; shieldDamageScale[$DamageType::MortarTurret] = 2.0; shieldDamageScale[$DamageType::PlasmaTurret] = 2.0; shieldDamageScale[$DamageType::SatchelCharge] = 3.5; shieldDamageScale[$DamageType::Default] = 1.0; shieldDamageScale[$DamageType::Impact] = 0.8; shieldDamageScale[$DamageType::Ground] = 1.0; shieldDamageScale[$DamageType::Explosion] = 3.0; shieldDamageScale[$DamageType::Lightning] = 10.0; damageScale[$DamageType::Blaster] = 0.75; damageScale[$DamageType::Bullet] = 0.75; damageScale[$DamageType::ELF] = 0.0; damageScale[$DamageType::ShockLance] = 0.50; damageScale[$DamageType::Laser] = 1.0; damageScale[$DamageType::ShrikeBlaster] = 2.5; damageScale[$DamageType::BellyTurret] = 1.2; damageScale[$DamageType::AATurret] = 1.5; damageScale[$DamageType::IndoorDepTurret] = 1.25; damageScale[$DamageType::OutdoorDepTurret] = 1.25; damageScale[$DamageType::SentryTurret] = 1.25; damageScale[$DamageType::Disc] = 1.0; damageScale[$DamageType::Grenade] = 0.75; damageScale[$DamageType::Mine] = 4.0; damageScale[$DamageType::Missile] = 1.5; damageScale[$DamageType::Mortar] = 2.0; damageScale[$DamageType::Plasma] = 0.5; damageScale[$DamageType::BomberBombs] = 2.0; damageScale[$DamageType::TankChaingun] = 2.0; damageScale[$DamageType::TankMortar] = 2.0; damageScale[$DamageType::MissileTurret] = 1.5; damageScale[$DamageType::MortarTurret] = 2.0; damageScale[$DamageType::PlasmaTurret] = 2.0; damageScale[$DamageType::SatchelCharge] = 3.5; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 0.8; damageScale[$DamageType::Ground] = 1.0; damageScale[$DamageType::Explosion] = 2.0; damageScale[$DamageType::Lightning] = 10.0; }; //**** HAVOC TRANSPORT **** datablock SimDataBlock(HavocDamageProfile) { shieldDamageScale[$DamageType::Blaster] = 1.0; shieldDamageScale[$DamageType::Bullet] = 1.0; shieldDamageScale[$DamageType::ELF] = 1.0; shieldDamageScale[$DamageType::ShockLance] = 0.5; shieldDamageScale[$DamageType::Laser] = 1.0; shieldDamageScale[$DamageType::ShrikeBlaster] = 3.5; shieldDamageScale[$DamageType::BellyTurret] = 2.0; shieldDamageScale[$DamageType::AATurret] = 3.0; shieldDamageScale[$DamageType::IndoorDepTurret] = 2.25; shieldDamageScale[$DamageType::OutdoorDepTurret] = 2.25; shieldDamageScale[$DamageType::SentryTurret] = 2.25; shieldDamageScale[$DamageType::Disc] = 1.0; shieldDamageScale[$DamageType::Grenade] = 1.0; shieldDamageScale[$DamageType::Mine] = 3.0; shieldDamageScale[$DamageType::Missile] = 3.0; shieldDamageScale[$DamageType::Mortar] = 2.0; shieldDamageScale[$DamageType::Plasma] = 1.0; shieldDamageScale[$DamageType::BomberBombs] = 3.0; shieldDamageScale[$DamageType::TankChaingun] = 3.0; shieldDamageScale[$DamageType::TankMortar] = 2.0; shieldDamageScale[$DamageType::MissileTurret] = 3.0; shieldDamageScale[$DamageType::MortarTurret] = 2.0; shieldDamageScale[$DamageType::PlasmaTurret] = 2.0; shieldDamageScale[$DamageType::SatchelCharge] = 3.5; shieldDamageScale[$DamageType::Default] = 1.0; shieldDamageScale[$DamageType::Impact] = 0.5; shieldDamageScale[$DamageType::Ground] = 1.0; shieldDamageScale[$DamageType::Explosion] = 3.0; shieldDamageScale[$DamageType::Lightning] = 10.0; damageScale[$DamageType::Blaster] = 0.75; damageScale[$DamageType::Bullet] = 0.75; damageScale[$DamageType::ELF] = 0.0; damageScale[$DamageType::ShockLance] = 0.50; damageScale[$DamageType::Laser] = 1.0; damageScale[$DamageType::ShrikeBlaster] = 2.5; damageScale[$DamageType::BellyTurret] = 1.2; damageScale[$DamageType::AATurret] = 1.5; damageScale[$DamageType::IndoorDepTurret] = 1.25; damageScale[$DamageType::OutdoorDepTurret] = 1.25; damageScale[$DamageType::SentryTurret] = 1.25; damageScale[$DamageType::Disc] = 1.0; damageScale[$DamageType::Grenade] = 0.75; damageScale[$DamageType::Mine] = 4.0; damageScale[$DamageType::Missile] = 1.5; damageScale[$DamageType::Mortar] = 2.0; damageScale[$DamageType::Plasma] = 0.5; damageScale[$DamageType::BomberBombs] = 2.0; damageScale[$DamageType::TankChaingun] = 2.0; damageScale[$DamageType::TankMortar] = 2.0; damageScale[$DamageType::MissileTurret] = 1.5; damageScale[$DamageType::MortarTurret] = 2.0; damageScale[$DamageType::PlasmaTurret] = 2.0; damageScale[$DamageType::SatchelCharge] = 3.5; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 0.5; damageScale[$DamageType::Ground] = 1.0; damageScale[$DamageType::Explosion] = 2.0; damageScale[$DamageType::Lightning] = 10.0; }; //**** WILDCAT GRAV CYCLE **** datablock SimDataBlock(WildcatDamageProfile) { shieldDamageScale[$DamageType::Blaster] = 2.0; shieldDamageScale[$DamageType::Bullet] = 2.5; shieldDamageScale[$DamageType::ELF] = 1.0; shieldDamageScale[$DamageType::ShockLance] = 1.0; shieldDamageScale[$DamageType::Laser] = 4.0; shieldDamageScale[$DamageType::ShrikeBlaster] = 6.0; shieldDamageScale[$DamageType::BellyTurret] = 2.0; shieldDamageScale[$DamageType::AATurret] = 2.0; shieldDamageScale[$DamageType::IndoorDepTurret] = 2.5; shieldDamageScale[$DamageType::OutdoorDepTurret] = 2.5; shieldDamageScale[$DamageType::Disc] = 2.5; shieldDamageScale[$DamageType::Grenade] = 2.0; shieldDamageScale[$DamageType::Mine] = 4.0; shieldDamageScale[$DamageType::Missile] = 4.0; shieldDamageScale[$DamageType::Mortar] = 2.0; shieldDamageScale[$DamageType::Plasma] = 2.0; shieldDamageScale[$DamageType::BomberBombs] = 2.5; shieldDamageScale[$DamageType::TankChaingun] = 3.0; shieldDamageScale[$DamageType::TankMortar] = 2.0; shieldDamageScale[$DamageType::MissileTurret] = 4.0; shieldDamageScale[$DamageType::MortarTurret] = 2.0; shieldDamageScale[$DamageType::PlasmaTurret] = 2.0; shieldDamageScale[$DamageType::SatchelCharge] = 3.0; shieldDamageScale[$DamageType::Default] = 1.0; shieldDamageScale[$DamageType::Impact] = 1.25; shieldDamageScale[$DamageType::Ground] = 1.0; shieldDamageScale[$DamageType::Explosion] = 2.0; shieldDamageScale[$DamageType::Lightning] = 5.0; damageScale[$DamageType::Blaster] = 1.5; damageScale[$DamageType::Bullet] = 1.2; damageScale[$DamageType::ELF] = 0.0; damageScale[$DamageType::ShockLance] = 0.50; damageScale[$DamageType::Laser] = 2.0; damageScale[$DamageType::ShrikeBlaster] = 4.0; damageScale[$DamageType::BellyTurret] = 1.5; damageScale[$DamageType::AATurret] = 1.0; damageScale[$DamageType::IndoorDepTurret] = 1.0; damageScale[$DamageType::OutdoorDepTurret] = 1.0; damageScale[$DamageType::Disc] = 1.25; damageScale[$DamageType::Grenade] = 1.0; damageScale[$DamageType::Mine] = 4.0; damageScale[$DamageType::Missile] = 1.2; damageScale[$DamageType::Mortar] = 1.0; damageScale[$DamageType::Plasma] = 1.5; damageScale[$DamageType::BomberBombs] = 2.0; damageScale[$DamageType::TankChaingun] = 2.0; damageScale[$DamageType::TankMortar] = 1.0; damageScale[$DamageType::MissileTurret] = 1.2; damageScale[$DamageType::MortarTurret] = 1.0; damageScale[$DamageType::PlasmaTurret] = 1.0; damageScale[$DamageType::SatchelCharge] = 2.2; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 1.25; damageScale[$DamageType::Ground] = 1.0; damageScale[$DamageType::Explosion] = 1.0; damageScale[$DamageType::Lightning] = 5.0; }; //**** BEOWULF TANK **** datablock SimDataBlock(TankDamageProfile) { shieldDamageScale[$DamageType::Blaster] = 0.6; shieldDamageScale[$DamageType::Bullet] = 0.75; shieldDamageScale[$DamageType::ELF] = 1.0; shieldDamageScale[$DamageType::ShockLance] = 0.5; shieldDamageScale[$DamageType::Laser] = 1.0; shieldDamageScale[$DamageType::ShrikeBlaster] = 1.75; shieldDamageScale[$DamageType::BellyTurret] = 1.25; shieldDamageScale[$DamageType::AATurret] = 0.8; shieldDamageScale[$DamageType::IndoorDepTurret] = 1.0; shieldDamageScale[$DamageType::OutdoorDepTurret] = 1.0; shieldDamageScale[$DamageType::Disc] = 0.8; shieldDamageScale[$DamageType::Grenade] = 0.8; shieldDamageScale[$DamageType::Mine] = 3.25; shieldDamageScale[$DamageType::Missile] = 2.0; shieldDamageScale[$DamageType::Mortar] = 1.7; shieldDamageScale[$DamageType::Plasma] = 1.0; shieldDamageScale[$DamageType::BomberBombs] = 1.5; shieldDamageScale[$DamageType::TankChaingun] = 1.5; shieldDamageScale[$DamageType::TankMortar] = 1.8; shieldDamageScale[$DamageType::MissileTurret] = 1.25; shieldDamageScale[$DamageType::MortarTurret] = 1.0; shieldDamageScale[$DamageType::PlasmaTurret] = 1.25; shieldDamageScale[$DamageType::SatchelCharge] = 2.0; shieldDamageScale[$DamageType::Default] = 1.0; shieldDamageScale[$DamageType::Impact] = 0.75; shieldDamageScale[$DamageType::Ground] = 0.75; shieldDamageScale[$DamageType::Explosion] = 2.0; shieldDamageScale[$DamageType::Lightning] = 10.0; damageScale[$DamageType::Blaster] = 0.75; damageScale[$DamageType::Bullet] = 0.75; damageScale[$DamageType::ELF] = 0.0; damageScale[$DamageType::ShockLance] = 0.50; damageScale[$DamageType::Laser] = 1.0; damageScale[$DamageType::ShrikeBlaster] = 2.0; damageScale[$DamageType::BellyTurret] = 1.0; damageScale[$DamageType::AATurret] = 1.0; damageScale[$DamageType::IndoorDepTurret] = 1.0; damageScale[$DamageType::OutdoorDepTurret] = 1.0; damageScale[$DamageType::Disc] = 1.0; damageScale[$DamageType::Grenade] = 1.0; damageScale[$DamageType::Mine] = 2.25; damageScale[$DamageType::Missile] = 1.25; damageScale[$DamageType::Mortar] = 1.4; damageScale[$DamageType::Plasma] = 0.5; damageScale[$DamageType::BomberBombs] = 1.0; damageScale[$DamageType::TankChaingun] = 0.75; damageScale[$DamageType::TankMortar] = 1.6; damageScale[$DamageType::MissileTurret] = 1.25; damageScale[$DamageType::MortarTurret] = 1.0; damageScale[$DamageType::PlasmaTurret] = 1.0; damageScale[$DamageType::SatchelCharge] = 2.0; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 0.75; damageScale[$DamageType::Ground] = 0.75; damageScale[$DamageType::Explosion] = 1.0; damageScale[$DamageType::Lightning] = 10.0; }; //**** JERICHO MPB **** datablock SimDataBlock(MPBDamageProfile) { shieldDamageScale[$DamageType::Blaster] = 0.6; shieldDamageScale[$DamageType::Bullet] = 0.75; shieldDamageScale[$DamageType::ELF] = 1.0; shieldDamageScale[$DamageType::ShockLance] = 0.5; shieldDamageScale[$DamageType::Laser] = 1.0; shieldDamageScale[$DamageType::ShrikeBlaster] = 1.75; shieldDamageScale[$DamageType::BellyTurret] = 1.25; shieldDamageScale[$DamageType::AATurret] = 0.8; shieldDamageScale[$DamageType::IndoorDepTurret] = 1.0; shieldDamageScale[$DamageType::OutdoorDepTurret] = 1.0; shieldDamageScale[$DamageType::Disc] = 0.8; shieldDamageScale[$DamageType::Grenade] = 0.8; shieldDamageScale[$DamageType::Mine] = 3.25; shieldDamageScale[$DamageType::Missile] = 2.0; shieldDamageScale[$DamageType::Mortar] = 0.8; shieldDamageScale[$DamageType::Plasma] = 1.0; shieldDamageScale[$DamageType::BomberBombs] = 1.5; shieldDamageScale[$DamageType::TankChaingun] = 1.5; shieldDamageScale[$DamageType::TankMortar] = 1.4; shieldDamageScale[$DamageType::MissileTurret] = 1.25; shieldDamageScale[$DamageType::MortarTurret] = 1.0; shieldDamageScale[$DamageType::PlasmaTurret] = 1.25; shieldDamageScale[$DamageType::SatchelCharge] = 2.0; shieldDamageScale[$DamageType::Default] = 1.0; shieldDamageScale[$DamageType::Impact] = 0.5; shieldDamageScale[$DamageType::Ground] = 0.5; shieldDamageScale[$DamageType::Explosion] = 2.0; shieldDamageScale[$DamageType::Lightning] = 10.0; damageScale[$DamageType::Blaster] = 0.75; damageScale[$DamageType::Bullet] = 0.75; damageScale[$DamageType::ELF] = 0.0; damageScale[$DamageType::ShockLance] = 0.50; damageScale[$DamageType::Laser] = 1.0; damageScale[$DamageType::ShrikeBlaster] = 2.0; damageScale[$DamageType::BellyTurret] = 1.0; damageScale[$DamageType::AATurret] = 1.0; damageScale[$DamageType::IndoorDepTurret] = 1.0; damageScale[$DamageType::OutdoorDepTurret] = 1.0; damageScale[$DamageType::Disc] = 1.0; damageScale[$DamageType::Grenade] = 1.0; damageScale[$DamageType::Mine] = 2.25; damageScale[$DamageType::Missile] = 1.25; damageScale[$DamageType::Mortar] = 1.0; damageScale[$DamageType::Plasma] = 0.5; damageScale[$DamageType::BomberBombs] = 1.0; damageScale[$DamageType::TankChaingun] = 0.75; damageScale[$DamageType::TankMortar] = 1.0; damageScale[$DamageType::MissileTurret] = 1.25; damageScale[$DamageType::MortarTurret] = 1.0; damageScale[$DamageType::PlasmaTurret] = 1.0; damageScale[$DamageType::SatchelCharge] = 2.0; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 0.5; damageScale[$DamageType::Ground] = 0.5; damageScale[$DamageType::Explosion] = 1.0; damageScale[$DamageType::Lightning] = 10.0; }; //---------------------------------------------------------------------------- // TURRET DAMAGE PROFILES //---------------------------------------------------------------------------- datablock SimDataBlock(TurretDamageProfile) { shieldDamageScale[$DamageType::Blaster] = 0.8; shieldDamageScale[$DamageType::Bullet] = 0.8; shieldDamageScale[$DamageType::ELF] = 1.0; shieldDamageScale[$DamageType::ShockLance] = 0.5; shieldDamageScale[$DamageType::Laser] = 1.0; shieldDamageScale[$DamageType::ShrikeBlaster] = 3.0; shieldDamageScale[$DamageType::BellyTurret] = 2.0; shieldDamageScale[$DamageType::AATurret] = 1.0; shieldDamageScale[$DamageType::IndoorDepTurret] = 1.0; shieldDamageScale[$DamageType::OutdoorDepTurret] = 1.0; shieldDamageScale[$DamageType::SentryTurret] = 1.0; shieldDamageScale[$DamageType::Disc] = 1.0; shieldDamageScale[$DamageType::Grenade] = 1.5; shieldDamageScale[$DamageType::Mine] = 3.0; shieldDamageScale[$DamageType::Missile] = 3.0; shieldDamageScale[$DamageType::Mortar] = 3.0; shieldDamageScale[$DamageType::Plasma] = 1.0; shieldDamageScale[$DamageType::BomberBombs] = 2.0; shieldDamageScale[$DamageType::TankChaingun] = 1.5; shieldDamageScale[$DamageType::TankMortar] = 3.0; shieldDamageScale[$DamageType::MissileTurret] = 3.0; shieldDamageScale[$DamageType::MortarTurret] = 3.0; shieldDamageScale[$DamageType::PlasmaTurret] = 2.0; shieldDamageScale[$DamageType::SatchelCharge] = 4.5; shieldDamageScale[$DamageType::Default] = 1.0; shieldDamageScale[$DamageType::Impact] = 1.0; shieldDamageScale[$DamageType::Ground] = 1.0; shieldDamageScale[$DamageType::Explosion] = 2.0; shieldDamageScale[$DamageType::Lightning] = 5.0; damageScale[$DamageType::Blaster] = 0.8; damageScale[$DamageType::Bullet] = 0.9; damageScale[$DamageType::ELF] = 0.0; damageScale[$DamageType::ShockLance] = 0.50; damageScale[$DamageType::Laser] = 1.0; damageScale[$DamageType::ShrikeBlaster] = 1.0; damageScale[$DamageType::BellyTurret] = 0.6; damageScale[$DamageType::AATurret] = 1.0; damageScale[$DamageType::IndoorDepTurret] = 1.0; damageScale[$DamageType::OutdoorDepTurret] = 1.0; damageScale[$DamageType::SentryTurret] = 1.0; damageScale[$DamageType::Disc] = 1.1; damageScale[$DamageType::Grenade] = 1.0; damageScale[$DamageType::Mine] = 1.5; damageScale[$DamageType::Missile] = 1.25; damageScale[$DamageType::Mortar] = 1.25; damageScale[$DamageType::Plasma] = 0.75; damageScale[$DamageType::BomberBombs] = 1.0; damageScale[$DamageType::TankChaingun] = 1.25; damageScale[$DamageType::TankMortar] = 1.25; damageScale[$DamageType::MissileTurret] = 1.25; damageScale[$DamageType::MortarTurret] = 1.25; damageScale[$DamageType::PlasmaTurret] = 1.25; damageScale[$DamageType::SatchelCharge] = 1.5; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 1.0; damageScale[$DamageType::Ground] = 1.0; damageScale[$DamageType::Explosion] = 1.0; damageScale[$DamageType::Lightning] = 5.0; }; //---------------------------------------------------------------------------- // STATIC SHAPE DAMAGE PROFILES //---------------------------------------------------------------------------- datablock SimDataBlock(StaticShapeDamageProfile) { shieldDamageScale[$DamageType::Blaster] = 0.8; shieldDamageScale[$DamageType::Bullet] = 1.0; shieldDamageScale[$DamageType::ELF] = 1.0; shieldDamageScale[$DamageType::ShockLance] = 1.0; shieldDamageScale[$DamageType::Laser] = 1.0; shieldDamageScale[$DamageType::ShrikeBlaster] = 2.0; shieldDamageScale[$DamageType::BellyTurret] = 1.5; shieldDamageScale[$DamageType::AATurret] = 1.0; shieldDamageScale[$DamageType::IndoorDepTurret] = 1.0; shieldDamageScale[$DamageType::OutdoorDepTurret] = 1.0; shieldDamageScale[$DamageType::Turret] = 1.0; shieldDamageScale[$DamageType::SentryTurret] = 1.0; shieldDamageScale[$DamageType::Disc] = 1.0; shieldDamageScale[$DamageType::Grenade] = 1.2; shieldDamageScale[$DamageType::Mine] = 2.0; shieldDamageScale[$DamageType::Missile] = 3.0; shieldDamageScale[$DamageType::Mortar] = 3.0; shieldDamageScale[$DamageType::Plasma] = 1.5; shieldDamageScale[$DamageType::BomberBombs] = 2.0; shieldDamageScale[$DamageType::TankChaingun] = 1.5; shieldDamageScale[$DamageType::TankMortar] = 3.0; shieldDamageScale[$DamageType::MissileTurret] = 3.0; shieldDamageScale[$DamageType::MortarTurret] = 3.0; shieldDamageScale[$DamageType::PlasmaTurret] = 2.0; shieldDamageScale[$DamageType::SatchelCharge] = 6.0; shieldDamageScale[$DamageType::Default] = 1.0; shieldDamageScale[$DamageType::Impact] = 1.25; shieldDamageScale[$DamageType::Ground] = 1.0; shieldDamageScale[$DamageType::Explosion] = 2.0; shieldDamageScale[$DamageType::Lightning] = 5.0; damageScale[$DamageType::Blaster] = 1.0; damageScale[$DamageType::Bullet] = 1.0; damageScale[$DamageType::ELF] = 0.0; damageScale[$DamageType::ShockLance] = 1.0; damageScale[$DamageType::Laser] = 1.0; damageScale[$DamageType::ShrikeBlaster] = 2.0; damageScale[$DamageType::BellyTurret] = 1.2; damageScale[$DamageType::AATurret] = 1.0; damageScale[$DamageType::IndoorDepTurret] = 1.0; damageScale[$DamageType::OutdoorDepTurret] = 1.0; damageScale[$DamageType::SentryTurret] = 1.0; damageScale[$DamageType::Disc] = 1.15; damageScale[$DamageType::Grenade] = 1.2; damageScale[$DamageType::Mine] = 2.0; damageScale[$DamageType::Missile] = 2.0; damageScale[$DamageType::Mortar] = 2.0; damageScale[$DamageType::Plasma] = 1.25; damageScale[$DamageType::BomberBombs] = 1.0; damageScale[$DamageType::TankChaingun] = 1.0; damageScale[$DamageType::TankMortar] = 2.0; damageScale[$DamageType::MissileTurret] = 2.0; damageScale[$DamageType::MortarTurret] = 2.0; damageScale[$DamageType::PlasmaTurret] = 2.0; damageScale[$DamageType::SatchelCharge] = 4.0; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 1.25; damageScale[$DamageType::Ground] = 1.0; damageScale[$DamageType::Explosion] = 1.0; damageScale[$DamageType::Lightning] = 5.0; }; //---------------------------------------------------------------------------- // PLAYER DAMAGE PROFILES //---------------------------------------------------------------------------- datablock SimDataBlock(LightPlayerDamageProfile) { damageScale[$DamageType::Blaster] = 1.3; damageScale[$DamageType::Bullet] = 1.2; damageScale[$DamageType::ELF] = 0.75; damageScale[$DamageType::ShockLance] = 1.0; damageScale[$DamageType::Laser] = 1.12; damageScale[$DamageType::ShrikeBlaster] = 1.10; damageScale[$DamageType::BellyTurret] = 1.0; damageScale[$DamageType::AATurret] = 0.7; damageScale[$DamageType::IndoorDepTurret] = 1.3; damageScale[$DamageType::OutdoorDepTurret] = 1.3; damageScale[$DamageType::SentryTurret] = 1.0; damageScale[$DamageType::Disc] = 1.0; damageScale[$DamageType::Grenade] = 1.2; damageScale[$DamageType::Mine] = 1.0; damageScale[$DamageType::Missile] = 1.0; damageScale[$DamageType::Mortar] = 1.3; damageScale[$DamageType::Plasma] = 1.0; damageScale[$DamageType::BomberBombs] = 3.0; damageScale[$DamageType::TankChaingun] = 1.7; damageScale[$DamageType::TankMortar] = 1.0; damageScale[$DamageType::MissileTurret] = 1.0; damageScale[$DamageType::MortarTurret] = 1.3; damageScale[$DamageType::PlasmaTurret] = 1.0; damageScale[$DamageType::SatchelCharge] = 3.0; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 1.2; damageScale[$DamageType::Ground] = 1.0; damageScale[$DamageType::Explosion] = 1.0; damageScale[$DamageType::Lightning] = 1.0; }; datablock SimDataBlock(MediumPlayerDamageProfile) { damageScale[$DamageType::Blaster] = 1.0; damageScale[$DamageType::Bullet] = 1.0; damageScale[$DamageType::ELF] = 0.75; damageScale[$DamageType::ShockLance] = 1.0; damageScale[$DamageType::Laser] = 1.1; damageScale[$DamageType::ShrikeBlaster] = 1.0; damageScale[$DamageType::BellyTurret] = 1.0; damageScale[$DamageType::AATurret] = 0.7; damageScale[$DamageType::IndoorDepTurret] = 1.0; damageScale[$DamageType::OutdoorDepTurret] = 1.0; damageScale[$DamageType::SentryTurret] = 1.0; damageScale[$DamageType::Disc] = 0.8; damageScale[$DamageType::Grenade] = 1.0; damageScale[$DamageType::Mine] = 0.9; damageScale[$DamageType::Missile] = 0.8; damageScale[$DamageType::Mortar] = 1.0; damageScale[$DamageType::Plasma] = 0.65; damageScale[$DamageType::BomberBombs] = 3.0; damageScale[$DamageType::TankChaingun] = 1.5; damageScale[$DamageType::TankMortar] = 0.85; damageScale[$DamageType::MissileTurret] = 0.8; damageScale[$DamageType::MortarTurret] = 1.0; damageScale[$DamageType::PlasmaTurret] = 0.65; damageScale[$DamageType::SatchelCharge] = 3.0; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 1.0; damageScale[$DamageType::Ground] = 1.0; damageScale[$DamageType::Explosion] = 0.8; damageScale[$DamageType::Lightning] = 1.2; }; datablock SimDataBlock(HeavyPlayerDamageProfile) { damageScale[$DamageType::Blaster] = 0.7; damageScale[$DamageType::Bullet] = 0.6; damageScale[$DamageType::ELF] = 0.75; damageScale[$DamageType::ShockLance] = 1.0; damageScale[$DamageType::Laser] = 0.67; damageScale[$DamageType::ShrikeBlaster] = 0.8; damageScale[$DamageType::BellyTurret] = 0.8; damageScale[$DamageType::AATurret] = 0.6; damageScale[$DamageType::IndoorDepTurret] = 0.7; damageScale[$DamageType::OutdoorDepTurret] = 0.7; damageScale[$DamageType::SentryTurret] = 1.0; damageScale[$DamageType::Disc] = 0.6; damageScale[$DamageType::Grenade] = 0.8; damageScale[$DamageType::Mine] = 0.8; damageScale[$DamageType::Missile] = 0.6; damageScale[$DamageType::Mortar] = 0.7; damageScale[$DamageType::Plasma] = 0.4; damageScale[$DamageType::BomberBombs] = 3.0; damageScale[$DamageType::TankChaingun] = 1.3; damageScale[$DamageType::TankMortar] = 0.7; damageScale[$DamageType::MissileTurret] = 0.6; damageScale[$DamageType::MortarTurret] = 0.6; damageScale[$DamageType::PlasmaTurret] = 0.4; damageScale[$DamageType::SatchelCharge] = 3.0; damageScale[$DamageType::Default] = 1.0; damageScale[$DamageType::Impact] = 0.8; damageScale[$DamageType::Ground] = 1.0; damageScale[$DamageType::Explosion] = 0.6; damageScale[$DamageType::Lightning] = 1.4; }; PK !(9rLeescripts/deathMessages.cs ///////////////////////////////////////////////////////////////////////////////////////////////// // %1 = Victim's name // // %2 = Victim's gender (value will be either "him" or "her") // // %3 = Victim's possessive gender (value will be either "his" or "her") // // %4 = Killer's name // // %5 = Killer's gender (value will be either "him" or "her") // // %6 = Killer's possessive gender (value will be either "his" or "her") // // %7 = implement that killed the victim (value is the object number of the bullet, disc, etc) // ///////////////////////////////////////////////////////////////////////////////////////////////// $DeathMessageCampingCount = 1; $DeathMessageCamping[0] = '\c0%1 was killed for camping near the Nexus.'; //Out of Bounds deaths $DeathMessageOOBCount = 1; $DeathMessageOOB[0] = '\c0%1 was killed for loitering outside the mission area.'; $DeathMessageLavaCount = 4; $DeathMessageLava[0] = '\c0%1\'s last thought before falling into the lava : \'Oops\'.'; $DeathMessageLava[1] = '\c0%1 makes the supreme sacrifice to the lava gods.'; $DeathMessageLava[2] = '\c0%1 looks surprised by the lava - but only briefly.'; $DeathMessageLava[3] = '\c0%1 wimps out by jumping into the lava and trying to make it look like an accident.'; $DeathMessageLightningCount = 3; $DeathMessageLightning[0] = '\c0%1 was killed by lightning!'; $DeathMessageLightning[1] = '\c0%1 caught a lightning bolt!'; $DeathMessageLightning[2] = '\c0%1 stuck %3 finger in Mother Nature\'s light socket.'; //these used when a player presses ctrl-k $DeathMessageSuicideCount = 5; $DeathMessageSuicide[0] = '\c0%1 blows %3 own head off!'; $DeathMessageSuicide[1] = '\c0%1 ends it all. Cue violin music.'; $DeathMessageSuicide[2] = '\c0%1 kills %2self.'; $DeathMessageSuicide[3] = '\c0%1 goes for the quick and dirty respawn.'; $DeathMessageSuicide[4] = '\c0%1 self-destructs in a fit of ennui.'; $DeathMessageVehPadCount = 1; $DeathMessageVehPad[0] = '\c0%1 got caught in a vehicle\'s spawn field.'; $DeathMessageFFPowerupCount = 1; $DeathMessageFFPowerup[0] = '\c0%1 got caught up in a forcefield during power up.'; $DeathMessageRogueMineCount = 1; $DeathMessageRogueMine[$DamageType::Mine, 0] = '\c0%1 is all mine.'; //these used when a player kills himself (other than by using ctrl - k) $DeathMessageSelfKillCount = 5; $DeathMessageSelfKill[$DamageType::Blaster, 0] = '\c0%1 kills %2self with a blaster.'; $DeathMessageSelfKill[$DamageType::Blaster, 1] = '\c0%1 makes a note to watch out for blaster ricochets.'; $DeathMessageSelfKill[$DamageType::Blaster, 2] = '\c0%1\'s blaster kills its hapless owner.'; $DeathMessageSelfKill[$DamageType::Blaster, 3] = '\c0%1 deftly guns %2self down with %3 own blaster.'; $DeathMessageSelfKill[$DamageType::Blaster, 4] = '\c0%1 has a fatal encounter with %3 own blaster.'; $DeathMessageSelfKill[$DamageType::Plasma, 0] = '\c0%1 kills %2self with plasma.'; $DeathMessageSelfKill[$DamageType::Plasma, 1] = '\c0%1 turns %2self into plasma-charred briquettes.'; $DeathMessageSelfKill[$DamageType::Plasma, 2] = '\c0%1 swallows a white-hot mouthful of %3 own plasma.'; $DeathMessageSelfKill[$DamageType::Plasma, 3] = '\c0%1 immolates %2self.'; $DeathMessageSelfKill[$DamageType::Plasma, 4] = '\c0%1 experiences the joy of cooking %2self.'; $DeathMessageSelfKill[$DamageType::Disc, 0] = '\c0%1 kills %2self with a disc.'; $DeathMessageSelfKill[$DamageType::Disc, 1] = '\c0%1 catches %3 own spinfusor disc.'; $DeathMessageSelfKill[$DamageType::Disc, 2] = '\c0%1 heroically falls on %3 own disc.'; $DeathMessageSelfKill[$DamageType::Disc, 3] = '\c0%1 helpfully jumps into %3 own disc\'s explosion.'; $DeathMessageSelfKill[$DamageType::Disc, 4] = '\c0%1 plays Russian roulette with %3 spinfusor.'; $DeathMessageSelfKill[$DamageType::Grenade, 0] = '\c0%1 destroys %2self with a grenade!'; //applies to hand grenades *and* grenade launcher grenades $DeathMessageSelfKill[$DamageType::Grenade, 1] = '\c0%1 took a bad bounce from %3 own grenade!'; $DeathMessageSelfKill[$DamageType::Grenade, 2] = '\c0%1 pulled the pin a shade early.'; $DeathMessageSelfKill[$DamageType::Grenade, 3] = '\c0%1\'s own grenade turns on %2.'; $DeathMessageSelfKill[$DamageType::Grenade, 4] = '\c0%1 blows %2self up real good.'; $DeathMessageSelfKill[$DamageType::Mortar, 0] = '\c0%1 kills %2self with a mortar!'; $DeathMessageSelfKill[$DamageType::Mortar, 1] = '\c0%1 hugs %3 own big green boomie.'; $DeathMessageSelfKill[$DamageType::Mortar, 2] = '\c0%1 mortars %2self all over the map.'; $DeathMessageSelfKill[$DamageType::Mortar, 3] = '\c0%1 experiences %3 mortar\'s payload up close.'; $DeathMessageSelfKill[$DamageType::Mortar, 4] = '\c0%1 suffered the wrath of %3 own mortar.'; $DeathMessageSelfKill[$DamageType::Missile, 0] = '\c0%1 kills %2self with a missile!'; $DeathMessageSelfKill[$DamageType::Missile, 1] = '\c0%1 runs a missile up %3 own tailpipe.'; $DeathMessageSelfKill[$DamageType::Missile, 2] = '\c0%1 tests the missile\'s shaped charge on %2self.'; $DeathMessageSelfKill[$DamageType::Missile, 3] = '\c0%1 achieved missile lock on %2self.'; $DeathMessageSelfKill[$DamageType::Missile, 4] = '\c0%1 gracefully smoked %2self with a missile!'; $DeathMessageSelfKill[$DamageType::Mine, 0] = '\c0%1 kills %2self with a mine!'; $DeathMessageSelfKill[$DamageType::Mine, 1] = '\c0%1\'s mine violently reminds %2 of its existence.'; $DeathMessageSelfKill[$DamageType::Mine, 2] = '\c0%1 plants a decisive foot on %3 own mine!'; $DeathMessageSelfKill[$DamageType::Mine, 3] = '\c0%1 fatally trips on %3 own mine!'; $DeathMessageSelfKill[$DamageType::Mine, 4] = '\c0%1 makes a note not to run over %3 own mines.'; $DeathMessageSelfKill[$DamageType::SatchelCharge, 0] = '\c0%1 goes out with a bang!'; //applies to most explosion types $DeathMessageSelfKill[$DamageType::SatchelCharge, 1] = '\c0%1 fall down...go boom.'; $DeathMessageSelfKill[$DamageType::SatchelCharge, 2] = '\c0%1 explodes in that fatal kind of way.'; $DeathMessageSelfKill[$DamageType::SatchelCharge, 3] = '\c0%1 experiences explosive decompression!'; $DeathMessageSelfKill[$DamageType::SatchelCharge, 4] = '\c0%1 splashes all over the map.'; $DeathMessageSelfKill[$DamageType::Ground, 0] = '\c0%1 lands too hard.'; $DeathMessageSelfKill[$DamageType::Ground, 1] = '\c0%1 finds gravity unforgiving.'; $DeathMessageSelfKill[$DamageType::Ground, 2] = '\c0%1 craters on impact.'; $DeathMessageSelfKill[$DamageType::Ground, 3] = '\c0%1 pancakes upon landing.'; $DeathMessageSelfKill[$DamageType::Ground, 4] = '\c0%1 loses a game of chicken with the ground.'; //used when a player is killed by a teammate $DeathMessageTeamKillCount = 1; $DeathMessageTeamKill[$DamageType::Blaster, 0] = '\c0%4 TEAMKILLED %1 with a blaster!'; $DeathMessageTeamKill[$DamageType::Plasma, 0] = '\c0%4 TEAMKILLED %1 with a plasma rifle!'; $DeathMessageTeamKill[$DamageType::Bullet, 0] = '\c0%4 TEAMKILLED %1 with a chaingun!'; $DeathMessageTeamKill[$DamageType::Disc, 0] = '\c0%4 TEAMKILLED %1 with a spinfusor!'; $DeathMessageTeamKill[$DamageType::Grenade, 0] = '\c0%4 TEAMKILLED %1 with a grenade!'; $DeathMessageTeamKill[$DamageType::Laser, 0] = '\c0%4 TEAMKILLED %1 with a laser rifle!'; $DeathMessageTeamKill[$DamageType::Elf, 0] = '\c0%4 TEAMKILLED %1 with an ELF projector!'; $DeathMessageTeamKill[$DamageType::Mortar, 0] = '\c0%4 TEAMKILLED %1 with a mortar!'; $DeathMessageTeamKill[$DamageType::Missile, 0] = '\c0%4 TEAMKILLED %1 with a missile!'; $DeathMessageTeamKill[$DamageType::Shocklance, 0] = '\c0%4 TEAMKILLED %1 with a shocklance!'; $DeathMessageTeamKill[$DamageType::Mine, 0] = '\c0%4 TEAMKILLED %1 with a mine!'; $DeathMessageTeamKill[$DamageType::SatchelCharge, 0] = '\c0%4 blew up TEAMMATE %1!'; $DeathMessageTeamKill[$DamageType::Impact, 0] = '\c0%4 runs down TEAMMATE %1!'; //these used when a player is killed by an enemy $DeathMessageCount = 5; $DeathMessage[$DamageType::Blaster, 0] = '\c0%4 kills %1 with a blaster.'; $DeathMessage[$DamageType::Blaster, 1] = '\c0%4 pings %1 to death.'; $DeathMessage[$DamageType::Blaster, 2] = '\c0%1 gets a pointer in blaster use from %4.'; $DeathMessage[$DamageType::Blaster, 3] = '\c0%4 fatally embarrasses %1 with %6 pea shooter.'; $DeathMessage[$DamageType::Blaster, 4] = '\c0%4 unleashes a terminal blaster barrage into %1.'; $DeathMessage[$DamageType::Plasma, 0] = '\c0%4 roasts %1 with the plasma rifle.'; $DeathMessage[$DamageType::Plasma, 1] = '\c0%4 gooses %1 with an extra-friendly burst of plasma.'; $DeathMessage[$DamageType::Plasma, 2] = '\c0%4 entices %1 to try a faceful of plasma.'; $DeathMessage[$DamageType::Plasma, 3] = '\c0%4 introduces %1 to the plasma immolation dance.'; $DeathMessage[$DamageType::Plasma, 4] = '\c0%4 slaps The Hot Kiss of Death on %1.'; $DeathMessage[$DamageType::Bullet, 0] = '\c0%4 rips %1 up with the chaingun.'; $DeathMessage[$DamageType::Bullet, 1] = '\c0%4 happily chews %1 into pieces with %6 chaingun.'; $DeathMessage[$DamageType::Bullet, 2] = '\c0%4 administers a dose of Vitamin Lead to %1.'; $DeathMessage[$DamageType::Bullet, 3] = '\c0%1 suffers a serious hosing from %4\'s chaingun.'; $DeathMessage[$DamageType::Bullet, 4] = '\c0%4 bestows the blessings of %6 chaingun on %1.'; $DeathMessage[$DamageType::Disc, 0] = '\c0%4 demolishes %1 with the spinfusor.'; $DeathMessage[$DamageType::Disc, 1] = '\c0%4 serves %1 a blue plate special.'; $DeathMessage[$DamageType::Disc, 2] = '\c0%4 shares a little blue friend with %1.'; $DeathMessage[$DamageType::Disc, 3] = '\c0%4 puts a little spin into %1.'; $DeathMessage[$DamageType::Disc, 4] = '\c0%1 becomes one of %4\'s greatest hits.'; $DeathMessage[$DamageType::Grenade, 0] = '\c0%4 eliminates %1 with a grenade.'; //applies to hand grenades *and* grenade launcher grenades $DeathMessage[$DamageType::Grenade, 1] = '\c0%4 blows up %1 real good!'; $DeathMessage[$DamageType::Grenade, 2] = '\c0%1 gets annihilated by %4\'s grenade.'; $DeathMessage[$DamageType::Grenade, 3] = '\c0%1 receives a kaboom lesson from %4.'; $DeathMessage[$DamageType::Grenade, 4] = '\c0%4 turns %1 into grenade salad.'; $DeathMessage[$DamageType::Laser, 0] = '\c0%1 becomes %4\'s latest pincushion.'; $DeathMessage[$DamageType::Laser, 1] = '\c0%4 picks off %1 with %6 laser rifle.'; $DeathMessage[$DamageType::Laser, 2] = '\c0%4 uses %1 as the targeting dummy in a sniping demonstration.'; $DeathMessage[$DamageType::Laser, 3] = '\c0%4 pokes a shiny new hole in %1 with %6 laser rifle.'; $DeathMessage[$DamageType::Laser, 4] = '\c0%4 caresses %1 with a couple hundred megajoules of laser.'; $DeathMessage[$DamageType::Elf, 0] = '\c0%4 fries %1 with the ELF projector.'; $DeathMessage[$DamageType::Elf, 1] = '\c0%4 bug zaps %1 with %6 ELF.'; $DeathMessage[$DamageType::Elf, 2] = '\c0%1 learns the shocking truth about %4\'s ELF skills.'; $DeathMessage[$DamageType::Elf, 3] = '\c0%4 electrocutes %1 without a sponge.'; $DeathMessage[$DamageType::Elf, 4] = '\c0%4\'s ELF projector leaves %1 a crispy critter.'; $DeathMessage[$DamageType::Mortar, 0] = '\c0%4 obliterates %1 with the mortar.'; $DeathMessage[$DamageType::Mortar, 1] = '\c0%4 drops a mortar round right in %1\'s lap.'; $DeathMessage[$DamageType::Mortar, 2] = '\c0%4 delivers a mortar payload straight to %1.'; $DeathMessage[$DamageType::Mortar, 3] = '\c0%4 offers a little "heavy love" to %1.'; $DeathMessage[$DamageType::Mortar, 4] = '\c0%1 stumbles into %4\'s mortar reticle.'; $DeathMessage[$DamageType::Missile, 0] = '\c0%4 intercepts %1 with a missile.'; $DeathMessage[$DamageType::Missile, 1] = '\c0%4 watches %6 missile touch %1 and go boom.'; $DeathMessage[$DamageType::Missile, 2] = '\c0%4 got sweet tone on %1.'; $DeathMessage[$DamageType::Missile, 3] = '\c0By now, %1 has realized %4\'s missile killed %2.'; $DeathMessage[$DamageType::Missile, 4] = '\c0%4\'s missile rains little pieces of %1 all over the ground.'; $DeathMessage[$DamageType::Shocklance, 0] = '\c0%4 reaps a harvest of %1 with the shocklance.'; $DeathMessage[$DamageType::Shocklance, 1] = '\c0%4 feeds %1 the business end of %6 shocklance.'; $DeathMessage[$DamageType::Shocklance, 2] = '\c0%4 stops %1 dead with the shocklance.'; $DeathMessage[$DamageType::Shocklance, 3] = '\c0%4 eliminates %1 in close combat.'; $DeathMessage[$DamageType::Shocklance, 4] = '\c0%4 ruins %1\'s day with one zap of a shocklance.'; $DeathMessage[$DamageType::Mine, 0] = '\c0%4 kills %1 with a mine.'; $DeathMessage[$DamageType::Mine, 1] = '\c0%1 doesn\'t see %4\'s mine in time.'; $DeathMessage[$DamageType::Mine, 2] = '\c0%4 gets a sapper kill on %1.'; $DeathMessage[$DamageType::Mine, 3] = '\c0%1 puts his foot on %4\'s mine.'; $DeathMessage[$DamageType::Mine, 4] = '\c0One small step for %1, one giant mine kill for %4.'; $DeathMessage[$DamageType::SatchelCharge, 0] = '\c0%4 buys %1 a ticket to the moon.'; //satchel charge only $DeathMessage[$DamageType::SatchelCharge, 1] = '\c0%4 blows %1 into low orbit.'; $DeathMessage[$DamageType::SatchelCharge, 2] = '\c0%4 makes %1 a hugely explosive offer.'; $DeathMessage[$DamageType::SatchelCharge, 3] = '\c0%4 turns %1 into a cloud of satchel-vaporized armor.'; $DeathMessage[$DamageType::SatchelCharge, 4] = '\c0%4\'s satchel charge leaves %1 nothin\' but smokin\' boots.'; $DeathMessageHeadshotCount = 3; $DeathMessageHeadshot[$DamageType::Laser, 0] = '\c0%4 drills right through %1\'s braincase with %6 laser.'; $DeathMessageHeadshot[$DamageType::Laser, 1] = '\c0%4 pops %1\'s head like a cheap balloon.'; $DeathMessageHeadshot[$DamageType::Laser, 2] = '\c0%1 loses %3 head over %4\'s laser skill.'; //These used when a player is run over by a vehicle $DeathMessageVehicleCount = 5; $DeathMessageVehicle[0] = '\c0%4 runs down %1.'; $DeathMessageVehicle[1] = '\c0%1 acquires that run-down feeling from %4.'; $DeathMessageVehicle[2] = '\c0%4 transforms %1 into tribal roadkill.'; $DeathMessageVehicle[3] = '\c0%1 makes a painfully close examination of %4\'s front bumper.'; $DeathMessageVehicle[4] = '\c0%1\'s messy death leaves a mark on %4\'s vehicle finish.'; $DeathMessageVehicleCrashCount = 5; $DeathMessageVehicleCrash[ $DamageType::Crash, 0 ] = '\c0%1 fails to eject in time.'; $DeathMessageVehicleCrash[ $DamageType::Crash, 1 ] = '\c0%1 becomes one with his vehicle dashboard.'; $DeathMessageVehicleCrash[ $DamageType::Crash, 2 ] = '\c0%1 drives under the influence of death.'; $DeathMessageVehicleCrash[ $DamageType::Crash, 3 ] = '\c0%1 makes a perfect three hundred point landing.'; $DeathMessageVehicleCrash[ $DamageType::Crash, 4 ] = '\c0%1 heroically pilots his vehicle into something really, really hard.'; $DeathMessageVehicleFriendlyCount = 3; $DeathMessageVehicleFriendly[0] = '\c0%1 gets in the way of a friendly vehicle.'; $DeathMessageVehicleFriendly[1] = '\c0Sadly, a friendly vehicle turns %1 into roadkill.'; $DeathMessageVehicleFriendly[2] = '\c0%1 becomes an unsightly ornament on a team vehicle\'s hood.'; $DeathMessageVehicleUnmannedCount = 3; $DeathMessageVehicleUnmanned[0] = '\c0%1 gets in the way of a runaway vehicle.'; $DeathMessageVehicleUnmanned[1] = '\c0An unmanned vehicle kills the pathetic %1.'; $DeathMessageVehicleUnmanned[2] = '\c0%1 is struck down by an empty vehicle.'; //These used when a player is killed by a nearby equipment explosion $DeathMessageExplosionCount = 3; $DeathMessageExplosion[0] = '\c0%1 was killed by exploding equipment!'; $DeathMessageExplosion[1] = '\c0%1 stood a little too close to the action!'; $DeathMessageExplosion[2] = '\c0%1 learns how to be collateral damage.'; //These used when an automated turret kills an enemy player $DeathMessageTurretKillCount = 3; $DeathMessageTurretKill[$DamageType::PlasmaTurret, 0] = '\c0%1 is killed by a plasma turret.'; $DeathMessageTurretKill[$DamageType::PlasmaTurret, 1] = '\c0%1\'s body now marks the location of a plasma turret.'; $DeathMessageTurretKill[$DamageType::PlasmaTurret, 2] = '\c0%1 is fried by a plasma turret.'; $DeathMessageTurretKill[$DamageType::AATurret, 0] = '\c0%1 is killed by an AA turret.'; $DeathMessageTurretKill[$DamageType::AATurret, 1] = '\c0%1 is shot down by an AA turret.'; $DeathMessageTurretKill[$DamageType::AATurret, 2] = '\c0%1 takes fatal flak from an AA turret.'; $DeathMessageTurretKill[$DamageType::ElfTurret, 0] = '\c0%1 is killed by an ELF turret.'; $DeathMessageTurretKill[$DamageType::ElfTurret, 1] = '\c0%1 is zapped by an ELF turret.'; $DeathMessageTurretKill[$DamageType::ElfTurret, 2] = '\c0%1 is short-circuited by an ELF turret.'; $DeathMessageTurretKill[$DamageType::MortarTurret, 0] = '\c0%1 is killed by a mortar turret.'; $DeathMessageTurretKill[$DamageType::MortarTurret, 1] = '\c0%1 enjoys a mortar turret\'s attention.'; $DeathMessageTurretKill[$DamageType::MortarTurret, 2] = '\c0%1 is blown to kibble by a mortar turret.'; $DeathMessageTurretKill[$DamageType::MissileTurret, 0] = '\c0%1 is killed by a missile turret.'; $DeathMessageTurretKill[$DamageType::MissileTurret, 1] = '\c0%1 is shot down by a missile turret.'; $DeathMessageTurretKill[$DamageType::MissileTurret, 2] = '\c0%1 is blown away by a missile turret.'; $DeathMessageTurretKill[$DamageType::IndoorDepTurret, 0] = '\c0%1 is killed by a clamp turret.'; $DeathMessageTurretKill[$DamageType::IndoorDepTurret, 1] = '\c0%1 gets burned by a clamp turret.'; $DeathMessageTurretKill[$DamageType::IndoorDepTurret, 2] = '\c0A clamp turret eliminates %1.'; $DeathMessageTurretKill[$DamageType::OutdoorDepTurret, 0] = '\c0A spike turret neatly drills %1.'; $DeathMessageTurretKill[$DamageType::OutdoorDepTurret, 1] = '\c0%1 gets taken out by a spike turret.'; $DeathMessageTurretKill[$DamageType::OutdoorDepTurret, 2] = '\c0%1 dies under a spike turret\'s love.'; $DeathMessageTurretKill[$DamageType::SentryTurret, 0] = '\c0%1 didn\'t see that Sentry turret, but it saw %2...'; $DeathMessageTurretKill[$DamageType::SentryTurret, 1] = '\c0%1 needs to watch for Sentry turrets.'; $DeathMessageTurretKill[$DamageType::SentryTurret, 2] = '\c0%1 now understands how Sentry turrets work.'; //used when a player is killed by a teammate controlling a turret $DeathMessageCTurretTeamKillCount = 1; $DeathMessageCTurretTeamKill[$DamageType::PlasmaTurret, 0] = '\c0%4 TEAMKILLED %1 with a plasma turret!'; $DeathMessageCTurretTeamKill[$DamageType::AATurret, 0] = '\c0%4 TEAMKILLED %1 with an AA turret!'; $DeathMessageCTurretTeamKill[$DamageType::ELFTurret, 0] = '\c0%4 TEAMKILLED %1 with an ELF turret!'; $DeathMessageCTurretTeamKill[$DamageType::MortarTurret, 0] = '\c0%4 TEAMKILLED %1 with a mortar turret!'; $DeathMessageCTurretTeamKill[$DamageType::MissileTurret, 0] = '\c0%4 TEAMKILLED %1 with a missile turret!'; $DeathMessageCTurretTeamKill[$DamageType::IndoorDepTurret, 0] = '\c0%4 TEAMKILLED %1 with a clamp turret!'; $DeathMessageCTurretTeamKill[$DamageType::OutdoorDepTurret, 0] = '\c0%4 TEAMKILLED %1 with a spike turret!'; $DeathMessageCTurretTeamKill[$DamageType::SentryTurret, 0] = '\c0%4 TEAMKILLED %1 with a sentry turret!'; $DeathMessageCTurretTeamKill[$DamageType::BomberBombs, 0] = '\c0%4 TEAMKILLED %1 in a bombastic explosion of raining death.'; $DeathMessageCTurretTeamKill[$DamageType::BellyTurret, 0] = '\c0%4 TEAMKILLED %1 by annihilating him from a belly turret.'; $DeathMessageCTurretTeamKill[$DamageType::TankChainGun, 0] = '\c0%4 TEAMKILLED %1 with his tank\'s chaingun.'; $DeathMessageCTurretTeamKill[$DamageType::TankMortar, 0] = '\c0%4 TEAMKILLED %1 by lobbing the BIG green death from a tank.'; $DeathMessageCTurretTeamKill[$DamageType::ShrikeBlaster, 0] = '\c0%4 TEAMKILLED %1 by strafing from a Shrike.'; $DeathMessageCTurretTeamKill[$DamageType::MPBMissile, 0] = '\c0%4 TEAMKILLED %1 when the MPB locked onto him.'; //used when a player is killed by an uncontrolled, friendly turret $DeathMessageCTurretAccdtlKillCount = 1; $DeathMessageCTurretAccdtlKill[$DamageType::PlasmaTurret, 0] = '\c0%1 got in the way of a plasma turret!'; $DeathMessageCTurretAccdtlKill[$DamageType::AATurret, 0] = '\c0%1 got in the way of an AA turret!'; $DeathMessageCTurretAccdtlKill[$DamageType::ELFTurret, 0] = '\c0%1 got in the way of an ELF turret!'; $DeathMessageCTurretAccdtlKill[$DamageType::MortarTurret, 0] = '\c0%1 got in the way of a mortar turret!'; $DeathMessageCTurretAccdtlKill[$DamageType::MissileTurret, 0] = '\c0%1 got in the way of a missile turret!'; $DeathMessageCTurretAccdtlKill[$DamageType::IndoorDepTurret, 0] = '\c0%1 got in the way of a clamp turret!'; $DeathMessageCTurretAccdtlKill[$DamageType::OutdoorDepTurret, 0] = '\c0%1 got in the way of a spike turret!'; $DeathMessageCTurretAccdtlKill[$DamageType::SentryTurret, 0] = '\c0%1 got in the way of a Sentry turret!'; //these messages for owned or controlled turrets $DeathMessageCTurretKillCount = 3; $DeathMessageCTurretKill[$DamageType::PlasmaTurret, 0] = '\c0%4 torches %1 with a plasma turret!'; $DeathMessageCTurretKill[$DamageType::PlasmaTurret, 1] = '\c0%4 fries %1 with a plasma turret!'; $DeathMessageCTurretKill[$DamageType::PlasmaTurret, 2] = '\c0%4 lights up %1 with a plasma turret!'; $DeathMessageCTurretKill[$DamageType::AATurret, 0] = '\c0%4 shoots down %1 with an AA turret.'; $DeathMessageCTurretKill[$DamageType::AATurret, 1] = '\c0%1 gets shot down by %1\'s AA turret.'; $DeathMessageCTurretKill[$DamageType::AATurret, 2] = '\c0%4 takes out %1 with an AA turret.'; $DeathMessageCTurretKill[$DamageType::ElfTurret, 0] = '\c0%1 gets zapped by ELF gunner %4.'; $DeathMessageCTurretKill[$DamageType::ElfTurret, 1] = '\c0%1 gets barbecued by ELF gunner %4.'; $DeathMessageCTurretKill[$DamageType::ElfTurret, 2] = '\c0%1 gets shocked by ELF gunner %4.'; $DeathMessageCTurretKill[$DamageType::MortarTurret, 0] = '\c0%1 is annihilated by %4\'s mortar turret.'; $DeathMessageCTurretKill[$DamageType::MortarTurret, 1] = '\c0%1 is blown away by %4\'s mortar turret.'; $DeathMessageCTurretKill[$DamageType::MortarTurret, 2] = '\c0%1 is pureed by %4\'s mortar turret.'; $DeathMessageCTurretKill[$DamageType::MissileTurret, 0] = '\c0%4 shows %1 a new world of pain with a missile turret.'; $DeathMessageCTurretKill[$DamageType::MissileTurret, 1] = '\c0%4 pops %1 with a missile turret.'; $DeathMessageCTurretKill[$DamageType::MissileTurret, 2] = '\c0%4\'s missile turret lights up %1\'s, uh, ex-life.'; $DeathMessageCTurretKill[$DamageType::IndoorDepTurret, 0] = '\c0%1 is chewed up and spat out by %4\'s clamp turret.'; $DeathMessageCTurretKill[$DamageType::IndoorDepTurret, 1] = '\c0%1 is knocked out by %4\'s clamp turret.'; $DeathMessageCTurretKill[$DamageType::IndoorDepTurret, 2] = '\c0%4\'s clamp turret drills %1 nicely.'; $DeathMessageCTurretKill[$DamageType::OutdoorDepTurret, 0] = '\c0%1 is chewed up by %4\'s spike turret.'; $DeathMessageCTurretKill[$DamageType::OutdoorDepTurret, 1] = '\c0%1 feels the burn from %4\'s spike turret.'; $DeathMessageCTurretKill[$DamageType::OutdoorDepTurret, 2] = '\c0%1 is nailed by %4\'s spike turret.'; $DeathMessageCTurretKill[$DamageType::SentryTurret, 0] = '\c0%4 caught %1 by surprise with a turret.'; $DeathMessageCTurretKill[$DamageType::SentryTurret, 1] = '\c0%4\'s turret took out %1.'; $DeathMessageCTurretKill[$DamageType::SentryTurret, 2] = '\c0%4 blasted %1 with a turret.'; $DeathMessageCTurretKill[$DamageType::BomberBombs, 0] = '\c0%1 catches %4\'s bomb in both teeth.'; $DeathMessageCTurretKill[$DamageType::BomberBombs, 1] = '\c0%4 leaves %1 a smoking bomb crater.'; $DeathMessageCTurretKill[$DamageType::BomberBombs, 2] = '\c0%4 bombs %1 back to the 20th century.'; $DeathMessageCTurretKill[$DamageType::BellyTurret, 0] = '\c0%1 eats a big helping of %4\'s belly turret bolt.'; $DeathMessageCTurretKill[$DamageType::BellyTurret, 1] = '\c0%4 plants a belly turret bolt in %1\'s belly.'; $DeathMessageCTurretKill[$DamageType::BellyTurret, 2] = '\c0%1 fails to evade %4\'s deft bomber strafing.'; $DeathMessageCTurretKill[$DamageType::TankChainGun, 0] = '\c0%1 enjoys the rich, metallic taste of %4\'s tank slug.'; $DeathMessageCTurretKill[$DamageType::TankChainGun, 1] = '\c0%4\'s tank chaingun plays sweet music all over %1.'; $DeathMessageCTurretKill[$DamageType::TankChainGun, 2] = '\c0%1 receives a stellar exit wound from %4\'s tank slug.'; $DeathMessageCTurretKill[$DamageType::TankMortar, 0] = '\c0Whoops! %1 + %4\'s tank mortar = Dead %1.'; $DeathMessageCTurretKill[$DamageType::TankMortar, 1] = '\c0%1 learns the happy explosion dance from %4\'s tank mortar.'; $DeathMessageCTurretKill[$DamageType::TankMortar, 2] = '\c0%4\'s tank mortar has a blast with %1.'; $DeathMessageCTurretKill[$DamageType::ShrikeBlaster, 0] = '\c0%1 dines on a Shrike blaster sandwich, courtesy of %4.'; $DeathMessageCTurretKill[$DamageType::ShrikeBlaster, 1] = '\c0The blaster of %4\'s Shrike turns %1 into finely shredded meat.'; $DeathMessageCTurretKill[$DamageType::ShrikeBlaster, 2] = '\c0%1 gets drilled big-time by the blaster of %4\'s Shrike.'; $DeathMessageCTurretKill[$DamageType::MPBMissile, 0] = '\c0%1 intersects nicely with %4\'s MPB Missile.'; $DeathMessageCTurretKill[$DamageType::MPBMissile, 1] = '\c0%4\'s MPB Missile makes armored chowder out of %1.'; $DeathMessageCTurretKill[$DamageType::MPBMissile, 2] = '\c0%1 has a brief, explosive fling with %4\'s MPB Missile.'; $DeathMessageTurretSelfKillCount = 3; $DeathMessageTurretSelfKill[0] = '\c0%1 somehow kills %2self with a turret.'; $DeathMessageTurretSelfKill[1] = '\c0%1 apparently didn\'t know the turret was loaded.'; $DeathMessageTurretSelfKill[2] = '\c0%1 helps his team by killing himself with a turret.'; PK !(R44scripts/debuggerGui.cs // debugger is just a simple TCP object if (!isObject(TCPDebugger)) new TCPObject(TCPDebugger); //-------------------------------------------------------------- // TCP function defs //-------------------------------------------------------------- function DebuggerConsoleView::print(%this, %line) { %row = %this.addRow(0, %line); %this.scrollVisible(%row); } function TCPDebugger::onLine(%this, %line) { echo("Got line=>" @ %line); %cmd = firstWord(%line); %rest = restWords(%line); if(%cmd $= "PASS") %this.handlePass(%rest); else if(%cmd $= "COUT") %this.handleLineOut(%rest); else if(%cmd $= "FILELISTOUT") %this.handleFileList(%rest); else if(%cmd $= "BREAKLISTOUT") %this.handleBreakList(%rest); else if(%cmd $= "BREAK") %this.handleBreak(%rest); else if(%cmd $= "RUNNING") %this.handleRunning(); else if(%cmd $= "EVALOUT") %this.handleEvalOut(%rest); else if(%cmd $= "OBJTAGLISTOUT") %this.handleObjTagList(%rest); else %this.handleError(%line); } //-------------------------------------------------------------- // handlers for messages from the server //-------------------------------------------------------------- function TCPDebugger::handlePass(%this, %message) { if(%message $= "WrongPass") { DebuggerConsoleView.print("Disconnected - wrong password."); %this.disconnect(); } else if(%message $= "Connected.") { DebuggerConsoleView.print("Connected."); DebuggerStatus.setValue("CONNECTED"); %this.send("FILELIST\r\n"); } } function TCPDebugger::handleLineOut(%this, %line) { DebuggerConsoleView.print(%line); } function TCPDebugger::handleFileList(%this, %line) { DebuggerFilePopup.clear(); %word = 0; while((%file = getWord(%line, %word)) !$= "") { %word++; DebuggerFilePopup.add(%file, %word); } } function TCPDebugger::handleBreakList(%this, %line) { %file = getWord(%line, 0); if(%file != $DebuggerFile) return; %pairs = getWord(%line, 1); %curLine = 1; DebuggerFileView.clearBreakPositions(); //set the possible break positions for(%i = 0; %i < %pairs; %i++) { %skip = getWord(%line, %i * 2 + 2); %breaks = getWord(%line, %i * 2 + 3); %curLine += %skip; for(%j = 0; %j < %breaks; %j++) { DebuggerFileView.setBreakPosition(%curLine); %curLine++; } } //now set the actual break points... for (%i = 0; %i < DebuggerBreakPoints.rowCount(); %i++) { %breakText = DebuggerBreakPoints.getRowText(%i); %breakLine = getField(%breakText, 0); %breakFile = getField(%breakText, 1); if (%breakFile == $DebuggerFile) DebuggerFileView.setBreak(%breakLine); } } function TCPDebugger::handleBreak(%this, %line) { DebuggerStatus.setValue("BREAK"); // query all the watches for(%i = 0; %i < DebuggerWatchView.rowCount(); %i++) { %id = DebuggerWatchView.getRowId(%i); %row = DebuggerWatchView.getRowTextById(%id); %expr = getField(%row, 0); %this.send("EVAL " @ %id @ " 0 " @ %expr @ "\r\n"); } // update the call stack window DebuggerCallStack.clear(); %file = getWord(%line, 0); %lineNumber = getWord(%line, 1); %funcName = getWord(%line, 2); DbgOpenFile(%file, %lineNumber, true); %nextWord = 3; %rowId = 0; %id = 0; while(1) { DebuggerCallStack.setRowById(%id, %file @ "\t" @ %lineNumber @ "\t" @ %funcName); %id++; %file = getWord(%line, %nextWord); %lineNumber = getWord(%line, %nextWord + 1); %funcName = getWord(%line, %nextWord + 2); %nextWord += 3; if(%file $= "") break; } } function TCPDebugger::handleRunning(%this) { DebuggerFileView.setCurrentLine(-1, true); DebuggerCallStack.clear(); DebuggerStatus.setValue("RUNNING..."); } function TCPDebugger::handleEvalOut(%this, %line) { %id = firstWord(%line); %value = restWords(%line); //see if it's the cursor watch, or from the watch window if (%id < 0) DebuggerCursorWatch.setText(DebuggerCursorWatch.expr SPC "=" SPC %value); else { %row = DebuggerWatchView.getRowTextById(%id); if(%row $= "") return; %expr = getField(%row, 0); DebuggerWatchView.setRowById(%id, %expr @ "\t" @ %value); } } function TCPDebugger::handleObjTagList(%this, %line) { } function TCPDebugger::handleError(%this, %line) { DebuggerConsoleView.print("ERROR - bogus message: " @ %line); } //-------------------------------------------------------------- // handlers for connection related functions //-------------------------------------------------------------- function TCPDebugger::onDNSResolve(%this) { } function TCPDebugger::onConnecting(%this) { } function TCPDebugger::onConnected(%this) { // send the password on connect. // %this.send(%this.password @ "\r\n"); // tinman - this function never get's called - instead // send the password immediately... } function TCPDebugger::onConnectFailed(%this) { } function TCPDebugger::onDisconnect(%this) { } function DebuggerFilePopup::onSelect(%this, %id, %text) { DbgOpenFile(%text, 0, false); } //-------------------------------------------------------------- // Gui glue functions //-------------------------------------------------------------- $DbgWatchSeq = 1; function DbgWatchDialogAdd() { %expr = WatchDialogExpression.getValue(); if (%expr !$= "") { DebuggerWatchView.setRowById($DbgWatchSeq, %expr @"\t(unknown)"); TCPDebugger.send("EVAL " @ $DbgWatchSeq @ " 0 " @ %expr @ "\r\n"); $DbgWatchSeq++; } //don't forget to close the dialog Canvas.popDialog(DebuggerWatchDlg); } function DbgWatchDialogEdit() { %newValue = EditWatchDialogValue.getValue(); %id = DebuggerWatchView.getSelectedId(); if (%id >= 0) { %row = DebuggerWatchView.getRowTextById(%id); %expr = getField(%row, 0); if (%newValue $= "") %assignment = %expr @ " = \"\""; else %assignment = %expr @ " = " @ %newValue; TCPDebugger.send("EVAL " @ %id @ " 0 " @ %assignment @ "\r\n"); } //don't forget to close the dialog Canvas.popDialog(DebuggerEditWatchDlg); } function DbgSetCursorWatch(%expr) { DebuggerCursorWatch.expr = %expr; if (DebuggerCursorWatch.expr $= "") DebuggerCursorWatch.setText(""); else TCPDebugger.send("EVAL -1 0 " @ DebuggerCursorWatch.expr @ "\r\n"); } function DebuggerCallStack::onAction(%this) { %id = %this.getSelectedId(); if(%id == -1) return; %text = %this.getRowTextById(%id); %file = getField(%text, 0); %line = getField(%text, 1); DbgOpenFile(%file, %line, %id == 0); } function DbgConnect() { %address = DebuggerConnectAddress.getValue(); %port = DebuggerConnectPort.getValue(); %password = DebuggerConnectPassword.getValue(); if ((%address !$= "" ) && (%port !$= "" ) && (%password !$= "" )) { TCPDebugger.connect(%address @ ":" @ %port); TCPDebugger.schedule(5000, send, %password @ "\r\n"); TCPDebugger.password = %password; } //don't forget to close the dialog Canvas.popDialog(DebuggerConnectDlg); } function DbgBreakConditionSet() { %condition = BreakCondition.getValue(); %passct = BreakPassCount.getValue(); %clear = BreakClear.getValue(); if (%condition $= "") %condition = "true"; if (%passct $= "") %passct = "0"; if (%clear $= "") %clear = "false"; //set the condition %id = DebuggerBreakPoints.getSelectedId(); if(%id != -1) { %bkp = DebuggerBreakPoints.getRowTextById(%id); DbgSetBreakPoint(getField(%bkp, 1), getField(%bkp, 0), %clear, %passct, %condition); } //don't forget to close the dialog Canvas.popDialog(DebuggerBreakConditionDlg); } function DbgOpenFile(%file, %line, %selectLine) { if (%file !$= "") { //open the file in the file view if (DebuggerFileView.open(%file)) { DebuggerFileView.setCurrentLine(%line, %selectLine); if (%file !$= $DebuggerFile) { TCPDebugger.send("BREAKLIST " @ %file @ "\r\n"); $DebuggerFile = %file; } } } } function DbgFileViewFind() { %searchString = DebuggerFindStringText.getValue(); %result = DebuggerFileView.findString(%searchString); //don't forget to close the dialog Canvas.popDialog(DebuggerFindDlg); } function DbgFileBreakPoints(%file, %points) { DebuggerFileView.breakPoints(%file, %points); } // BRKSET:file line clear passct expr - set a breakpoint on the file,line function DbgSetBreakPoint(%file, %line, %clear, %passct, %expr) { if(!%clear) { if(%file == $DebuggerFile) DebuggerFileView.setBreak(%line); } DebuggerBreakPoints.addBreak(%file, %line, %clear, %passct, %expr); TCPDebugger.send("BRKSET " @ %file @ " " @ %line @ " " @ %clear @ " " @ %passct @ " " @ %expr @ "\r\n"); } function DbgRemoveBreakPoint(%file, %line) { if(%file == $DebuggerFile) DebuggerFileView.removeBreak(%line); TCPDebugger.send("BRKCLR " @ %file @ " " @ %line @ "\r\n"); DebuggerBreakPoints.removeBreak(%file, %line); } $DbgBreakId = 0; function DebuggerBreakPoints::addBreak(%this, %file, %line, %clear, %passct, %expr) { // columns 0 = line, 1 = file, 2 = expr %textLine = %line @ "\t" @ %file @ "\t" @ %expr @ "\t" @ %passct @ "\t" @ %clear; %selId = %this.getSelectedId(); %selText = %this.getRowTextById(%selId); if(getField(%selText, 0) $= %line && getField(%selText, 1) $= %file) { %this.setRowById(%selId, %textLine); } else { %this.addRow($DbgBreakId, %textLine); $DbgBreakId++; } } function DebuggerBreakPoints::removeBreak(%this, %file, %line) { for(%i = 0; %i < %this.rowCount(); %i++) { %id = %this.getRowId(%i); %text = %this.getRowTextById(%id); if(getField(%text, 0) $= %line && getField(%text, 1) $= %file) { %this.removeRowById(%id); return; } } } function DbgDeleteSelectedBreak() { %selectedBreak = DebuggerBreakPoints.getSelectedId(); %rowNum = DebuggerBreakPoints.getRowNumById(%selectedWatch); if (%rowNum >= 0) { %breakText = DebuggerBreakPoints.getRowText(%rowNum); %breakLine = getField(%breakText, 0); %breakFile = getField(%breakText, 1); DbgRemoveBreakPoint(%breakFile, %breakLine); } } function DebuggerBreakPoints::clearBreaks(%this) { while(%this.rowCount()) { %id = %this.getRowId(0); %text = %this.getRowTextById(%id); %file = getField(%text, 1); %line = getField(%text, 0); DbgRemoveBreakPoint(%file, %line); } } function DebuggerBreakPoints::onAction(%this) { %id = %this.getSelectedId(); if(%id == -1) return; %text = %this.getRowTextById(%id); %line = getField(%text, 0); %file = getField(%text, 1); DbgOpenFile(%file, %line, 0); } function DebuggerFileView::onRemoveBreakPoint(%this, %line) { %file = $DebuggerFile; DbgRemoveBreakPoint(%file, %line); } function DebuggerFileView::onSetBreakPoint(%this, %line) { %file = $DebuggerFile; DbgSetBreakPoint(%file, %line, 0, 0, true); } function DbgConsoleEntryReturn() { %msg = DbgConsoleEntry.getValue(); if (%msg !$= "") { DebuggerConsoleView.print("%" @ %msg); if (DebuggerStatus.getValue() $= "NOT CONNECTED") DebuggerConsoleView.print("*** Not connected."); else if (DebuggerStatus.getValue() $= "BREAK") DebuggerConsoleView.print("*** Target is in BREAK mode."); else TCPDebugger.send("CEVAL " @ %msg @ "\r\n"); } DbgConsoleEntry.setValue(""); } function DbgConsolePrint(%status) { DebuggerConsoleView.print(%status); } function DbgStackAddFrame(%file, %line, %funcName) { if ((%file !$= "") && (%line !$= "") && (%funcName !$= "")) DebuggerCallStack.add(%file, %line, %funcName); } function DbgStackGetFrame() { return DebuggerCallStack.getFrame(); } function DbgStackClear() { DebuggerCallStack.clear(); } function DbgSetWatch(%expr) { if (%expr !$= "") DebuggerWatchView.set(%expr); } function DbgDeleteSelectedWatch() { %selectedWatch = DebuggerWatchView.getSelectedId(); %rowNum = DebuggerWatchView.getRowNumById(%selectedWatch); DebuggerWatchView.removeRow(%rowNum); } function DbgRefreshWatches() { // query all the watches for(%i = 0; %i < DebuggerWatchView.rowCount(); %i++) { %id = DebuggerWatchView.getRowId(%i); %row = DebuggerWatchView.getRowTextById(%id); %expr = getField(%row, 0); TCPDebugger.send("EVAL " @ %id @ " 0 " @ %expr @ "\r\n"); } } function DbgClearWatches() { DebuggerWatchView.clear(); } function dbgStepIn() { TCPDebugger.send("STEPIN\r\n"); } function dbgStepOut() { TCPDebugger.send("STEPOUT\r\n"); } function dbgStepOver() { TCPDebugger.send("STEPOVER\r\n"); } function dbgContinue() { TCPDebugger.send("CONTINUE\r\n"); } DebuggerConsoleView.setActive(false); PK !(R"33scripts/deployables.cs// deployable objects script // // remote pulse sensor, remote motion sensor, remote turrets (indoor // and outdoor), remote inventory station, remote ammo station // Note: cameras are treated as grenades, not "regular" deployables $TurretIndoorSpaceRadius = 20; // deployed turrets must be this many meters apart $InventorySpaceRadius = 20; // deployed inventory must be this many meters apart $TurretIndoorSphereRadius = 50; // radius for turret frequency check $TurretIndoorMaxPerSphere = 4; // # of turrets allowed in above radius $TurretOutdoorSpaceRadius = 25; // deployed turrets must be this many meters apart $TurretOutdoorSphereRadius = 60; // radius for turret frequency check $TurretOutdoorMaxPerSphere = 4; // # of turrets allowed in above radius $TeamDeployableMax[InventoryDeployable] = 5; $TeamDeployableMax[TurretIndoorDeployable] = 10; $TeamDeployableMax[TurretOutdoorDeployable] = 10; $TeamDeployableMax[PulseSensorDeployable] = 15; $TeamDeployableMax[MotionSensorDeployable] = 15; $TeamDeployableMin[TurretIndoorDeployable] = 4; $TeamDeployableMin[TurretOutdoorDeployable] = 4; $NotDeployableReason::None = 0; $NotDeployableReason::MaxDeployed = 1; $NotDeployableReason::NoSurfaceFound = 2; $NotDeployableReason::SlopeTooGreat = 3; $NotDeployableReason::SelfTooClose = 4; $NotDeployableReason::ObjectTooClose = 5; $NotDeployableReason::NoTerrainFound = 6; $NotDeployableReason::NoInteriorFound = 7; $NotDeployableReason::TurretTooClose = 8; $NotDeployableReason::TurretSaturation = 9; $NotDeployableReason::SurfaceTooNarrow = 10; $NotDeployableReason::InventoryTooClose = 11; $MinDeployableDistance = 2.5; $MaxDeployableDistance = 5.0; //meters from body // -------------------------------------------- // effect datablocks // -------------------------------------------- datablock EffectProfile(TurretDeployEffect) { effectname = "packs/generic_deploy"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(SensorDeployEffect) { effectname = "powered/sensor_activate"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(MotionSensorDeployEffect) { effectname = "powered/motion_sensor_activate"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(StationDeployEffect) { effectname = "packs/inventory_deploy"; minDistance = 2.5; maxDistance = 5.0; }; // -------------------------------------------- // sound datablocks // -------------------------------------------- datablock AudioProfile(TurretDeploySound) { fileName = "fx/packs/turret_place.wav"; description = AudioClose3d; preload = true; effect = TurretDeployEffect; }; datablock AudioProfile(SensorDeploySound) { fileName = "fx/powered/sensor_activate.wav"; description = AudioClose3d; preload = true; effect = SensorDeployEffect; // z0dd - ZOD - Durt, 6/24/02. Eh? This shouldn't be in here. //effect = MotionSensorDeployEffect; }; datablock AudioProfile(MotionSensorDeploySound) { fileName = "fx/powered/motion_sensor_activate.wav"; description = AudioClose3d; preload = true; // z0dd - ZOD - Durt, 6/24/02. This should be in here. effect = MotionSensorDeployEffect; }; datablock AudioProfile(StationDeploySound) { fileName = "fx/packs/inventory_deploy.wav"; description = AudioClose3d; preload = true; effect = StationDeployEffect; }; // -------------------------------------------- // deployable debris definition datablock DebrisData( DeployableDebris ) { explodeOnMaxBounce = false; elasticity = 0.40; friction = 0.5; lifetime = 17.0; lifetimeVariance = 0.0; minSpinSpeed = 60; maxSpinSpeed = 600; numBounces = 10; bounceVariance = 0; staticOnMaxBounce = true; useRadiusMass = true; baseRadius = 0.2; velocity = 5.0; velocityVariance = 2.5; }; // -------------------------------------------- // deployable inventory station datablock StaticShapeData(DeployedStationInventory) : StaticShapeDamageProfile { className = Station; shapeFile = "deploy_inventory.dts"; maxDamage = 0.70; destroyedLevel = 0.70; disabledLevel = 0.42; explosion = DeployablesExplosion; expDmgRadius = 8.0; expDamage = 0.35; expImpulse = 500.0; dynamicType = $TypeMasks::StationObjectType; isShielded = true; energyPerDamagePoint = 110; maxEnergy = 50; rechargeRate = 0.20; renderWhenDestroyed = false; doesRepair = true; deployedObject = true; cmdCategory = "DSupport"; cmdIcon = CMDStationIcon; cmdMiniIconName = "commander/MiniIcons/com_inventory_grey"; targetNameTag = 'Deployable'; targetTypeTag = 'Station'; debrisShapeName = "debris_generic_small.dts"; debris = DeployableDebris; heatSignature = 0; }; datablock ShapeBaseImageData(InventoryDeployableImage) { mass = 15; emap = true; shapeFile = "pack_deploy_inventory.dts"; item = InventoryDeployable; mountPoint = 1; offset = "0 0 0"; deployed = DeployedStationInventory; heatSignature = 0; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Idle"; isLarge = true; maxDepSlope = 30; deploySound = StationDeploySound; flatMinDeployDis = 1.0; flatMaxDeployDis = 5.0; minDeployDis = 2.5; maxDeployDis = 5.0; }; datablock ItemData(InventoryDeployable) { className = Pack; catagory = "Deployables"; shapeFile = "pack_deploy_inventory.dts"; mass = 3.0; elasticity = 0.2; friction = 0.6; pickupRadius = 1; rotate = false; image = "InventoryDeployableImage"; pickUpName = "an inventory pack"; heatSignature = 0; computeCRC = true; emap = true; }; // -------------------------------------------- // deployable motion sensor datablock SensorData(DeployMotionSensorObj) { detects = true; detectsUsingLOS = true; detectsActiveJammed = false; detectsPassiveJammed = true; detectsCloaked = true; detectionPings = false; detectMinVelocity = 2; detectRadius = 60; }; datablock StaticShapeData(DeployedMotionSensor) : StaticShapeDamageProfile { className = Sensor; shapeFile = "deploy_sensor_motion.dts"; maxDamage = 0.6; destroyedLevel = 0.6; disabledLevel = 0.4; explosion = DeployablesExplosion; dynamicType = $TypeMasks::SensorObjectType; deployedObject = true; cmdCategory = "DSupport"; cmdIcon = CMDSensorIcon; cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor"; targetNameTag = 'Deployable Motion'; targetTypeTag = 'Sensor'; sensorData = DeployMotionSensorObj; sensorRadius = DeployMotionSensorObj.detectRadius; sensorColor = "9 136 255"; deployAmbientThread = true; debrisShapeName = "debris_generic_small.dts"; debris = DeployableDebris; heatSignature = 0; }; datablock ShapeBaseImageData(MotionSensorDeployableImage) { shapeFile = "pack_deploy_sensor_motion.dts"; item = MotionSensorDeployable; mountPoint = 1; offset = "0 0 0"; deployed = DeployedMotionSensor; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Idle"; maxDepSlope = 360; deploySound = MotionSensorDeploySound; emap = true; heatSignature = 1; minDeployDis = 0.5; maxDeployDis = 5.0; //meters from body }; datablock ItemData(MotionSensorDeployable) { className = Pack; catagory = "Deployables"; shapeFile = "pack_deploy_sensor_motion.dts"; mass = 2.0; elasticity = 0.2; friction = 0.6; pickupRadius = 1; rotate = false; image = "MotionSensorDeployableImage"; pickUpName = "a motion sensor pack"; computeCRC = true; emap = true; heatSignature = 0; //maxSensors = 3; maxSensors = 2; }; // -------------------------------------------- // deployable pulse sensor datablock SensorData(DeployPulseSensorObj) { detects = true; detectsUsingLOS = true; detectsPassiveJammed = false; detectsCloaked = false; detectionPings = true; detectRadius = 150; }; datablock StaticShapeData(DeployedPulseSensor) : StaticShapeDamageProfile { className = Sensor; shapeFile = "deploy_sensor_pulse.dts"; maxDamage = 0.6; destroyedLevel = 0.6; disabledLevel = 0.4; explosion = DeployablesExplosion; dynamicType = $TypeMasks::SensorObjectType; deployedObject = true; cmdCategory = "DSupport"; cmdIcon = CMDSensorIcon; cmdMiniIconName = "commander/MiniIcons/com_deploypulsesensor"; targetNameTag = 'Deployable'; targetTypeTag = 'Pulse Sensor'; sensorData = DeployPulseSensorObj; sensorRadius = DeployPulseSensorObj.detectRadius; sensorColor = "255 194 9"; deployAmbientThread = true; debrisShapeName = "debris_generic_small.dts"; debris = DeployableDebris; heatSignature = 0; }; datablock ShapeBaseImageData(PulseSensorDeployableImage) { shapeFile = "pack_deploy_sensor_pulse.dts"; item = PulseSensorDeployable; mountPoint = 1; offset = "0 0 0"; deployed = DeployedPulseSensor; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Idle"; deploySound = SensorDeploySound; maxDepSlope = 40; emap = true; heatSignature = 0; minDeployDis = 0.5; maxDeployDis = 5.0; //meters from body }; datablock ItemData(PulseSensorDeployable) { className = Pack; catagory = "Deployables"; shapeFile = "pack_deploy_sensor_pulse.dts"; mass = 2.0; elasticity = 0.2; friction = 0.6; pickupRadius = 1; rotate = false; image = "PulseSensorDeployableImage"; pickUpName = "a pulse sensor pack"; computeCRC = true; emap = true; maxSensors = 2; }; // -------------------------------------------- // deployable outdoor turret datablock ShapeBaseImageData(TurretOutdoorDeployableImage) { mass = 15; shapeFile = "pack_deploy_turreto.dts"; item = TurretOutdoorDeployable; mountPoint = 1; offset = "0 0 0"; deployed = TurretDeployedOutdoor; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Idle"; maxDamage = 4.5; destroyedLevel = 4.5; disabledLevel = 4.0; isLarge = true; emap = true; maxDepSlope = 40; deploySound = TurretDeploySound; minDeployDis = 0.5; maxDeployDis = 5.0; //meters from body }; datablock ItemData(TurretOutdoorDeployable) { className = Pack; catagory = "Deployables"; shapeFile = "pack_deploy_turreto.dts"; mass = 3.0; elasticity = 0.2; friction = 0.6; pickupRadius = 1; rotate = false; image = "TurretOutdoorDeployableImage"; pickUpName = "a landspike turret pack"; computeCRC = true; emap = true; }; // -------------------------------------------- // deployable indoor turret (3 varieties -- floor, wall and ceiling) datablock ShapeBaseImageData(TurretIndoorDeployableImage) { mass = 15; shapeFile = "pack_deploy_turreti.dts"; item = TurretIndoorDeployable; mountPoint = 1; offset = "0 0 0"; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Idle"; isLarge = true; emap = true; maxDepSlope = 360; deploySound = TurretDeploySound; minDeployDis = 0.5; maxDeployDis = 5.0; //meters from body }; datablock ItemData(TurretIndoorDeployable) { className = Pack; catagory = "Deployables"; shapeFile = "pack_deploy_turreti.dts"; mass = 3.0; elasticity = 0.2; friction = 0.6; pickupRadius = 1; rotate = false; image = "TurretIndoorDeployableImage"; pickUpName = "a spider clamp turret pack"; computeCRC = true; emap = true; }; // -------------------------------------------- // miscellaneous yet handy functions function posFromTransform(%transform) { // the first three words of an object's transform are the object's position %position = getWord(%transform, 0) @ " " @ getWord(%transform, 1) @ " " @ getWord(%transform, 2); return %position; } function rotFromTransform(%transform) { // the last four words of an object's transform are the object's rotation %rotation = getWord(%transform, 3) @ " " @ getWord(%transform, 4) @ " " @ getWord(%transform, 5) @ " " @ getWord(%transform, 6); return %rotation; } function posFromRaycast(%transform) { // the 2nd, 3rd, and 4th words returned from a successful raycast call are the position of the point %position = getWord(%transform, 1) @ " " @ getWord(%transform, 2) @ " " @ getWord(%transform, 3); return %position; } function normalFromRaycast(%transform) { // the 5th, 6th and 7th words returned from a successful raycast call are the normal of the surface %norm = getWord(%transform, 4) @ " " @ getWord(%transform, 5) @ " " @ getWord(%transform, 6); return %norm; } function addToDeployGroup(%object) { // all deployables should go into a special group for AI purposes %depGroup = nameToID("MissionCleanup/Deployables"); if(%depGroup <= 0) { %depGroup = new SimGroup("Deployables"); MissionCleanup.add(%depGroup); } %depGroup.add(%object); } function Deployables::searchView(%obj, %searchRange, %mask) { // get the eye vector and eye transform of the player %eyeVec = %obj.getEyeVector(); %eyeTrans = %obj.getEyeTransform(); // extract the position of the player's camera from the eye transform (first 3 words) %eyePos = posFromTransform(%eyeTrans); // normalize the eye vector %nEyeVec = VectorNormalize(%eyeVec); // scale (lengthen) the normalized eye vector according to the search range %scEyeVec = VectorScale(%nEyeVec, %searchRange); // add the scaled & normalized eye vector to the position of the camera %eyeEnd = VectorAdd(%eyePos, %scEyeVec); // see if anything gets hit %searchResult = containerRayCast(%eyePos, %eyeEnd, %mask, 0); return %searchResult; } //-----------------------// // Deployable Procedures // //-----------------------// //------------------------------------------------- function ShapeBaseImageData::testMaxDeployed(%item, %plyr) { if(%item.item $= TurretOutdoorDeployable || %item.item $= TurretIndoorDeployable) %itemCount = countTurretsAllowed(%item.item); else %itemCount = $TeamDeployableMax[%item.item]; return $TeamDeployedCount[%plyr.team, %item.item] >= %itemCount; } //------------------------------------------------- function ShapeBaseImageData::testNoSurfaceInRange(%item, %plyr) { return ! Deployables::searchView(%plyr, $MaxDeployDistance, $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType); } //------------------------------------------------- function ShapeBaseImageData::testSlopeTooGreat(%item) { if (%item.surface) { return getTerrainAngle(%item.surfaceNrm) > %item.maxDepSlope; } } //------------------------------------------------- function ShapeBaseImageData::testSelfTooClose(%item, %plyr) { InitContainerRadiusSearch(%item.surfacePt, $MinDeployDistance, $TypeMasks::PlayerObjectType); return containerSearchNext() == %plyr; } //------------------------------------------------- function ShapeBaseImageData::testObjectTooClose(%item) { %mask = ($TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::ItemObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::TurretObjectType); InitContainerRadiusSearch( %item.surfacePt, $MinDeployDistance, %mask ); %test = containerSearchNext(); return %test; } //------------------------------------------------- function TurretOutdoorDeployableImage::testNoTerrainFound(%item) { return %item.surface.getClassName() !$= TerrainBlock; } function ShapeBaseImageData::testNoTerrainFound(%item, %surface) { //don't check this for non-Landspike turret deployables } //------------------------------------------------- function TurretIndoorDeployableImage::testNoInteriorFound(%item) { return %item.surface.getClassName() !$= InteriorInstance; } function ShapeBaseImageData::testNoInteriorFound(%item, %surface) { //don't check this for non-Clasping turret deployables } //------------------------------------------------- function TurretIndoorDeployableImage::testHavePurchase(%item, %xform) { %footprintRadius = 0.34; %collMask = $TypeMasks::InteriorObjectType; return %item.deployed.checkDeployPurchase(%xform, %footprintRadius, %collMask); } function ShapeBaseImageData::testHavePurchase(%item, %xform) { //don't check this for non-Clasping turret deployables return true; } //------------------------------------------------- function ShapeBaseImageData::testInventoryTooClose(%item, %plyr) { return false; } function InventoryDeployableImage::testInventoryTooClose(%item, %plyr) { InitContainerRadiusSearch(%item.surfacePt, $InventorySpaceRadius, $TypeMasks::StaticShapeObjectType); // old function was only checking whether the first object found was a turret -- also wasn't checking // which team the object was on %turretInRange = false; while((%found = containerSearchNext()) != 0) { %foundName = %found.getDataBlock().getName(); if( (%foundName $= DeployedStationInventory) ) if (%found.team == %plyr.team) { %turretInRange = true; break; } } return %turretInRange; } function TurretIndoorDeployableImage::testTurretTooClose(%item, %plyr) { InitContainerRadiusSearch(%item.surfacePt, $TurretIndoorSpaceRadius, $TypeMasks::StaticShapeObjectType); // old function was only checking whether the first object found was a turret -- also wasn't checking // which team the object was on %turretInRange = false; while((%found = containerSearchNext()) != 0) { %foundName = %found.getDataBlock().getName(); if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor) ) if (%found.team == %plyr.team) { %turretInRange = true; break; } } return %turretInRange; } function TurretOutdoorDeployableImage::testTurretTooClose(%item, %plyr) { InitContainerRadiusSearch(%item.surfacePt, $TurretOutdoorSpaceRadius, $TypeMasks::StaticShapeObjectType); // old function was only checking whether the first object found was a turret -- also wasn't checking // which team the object was on %turretInRange = false; while((%found = containerSearchNext()) != 0) { %foundName = %found.getDataBlock().getName(); if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor) ) if (%found.team == %plyr.team) { %turretInRange = true; break; } } return %turretInRange; } function ShapeBaseImageData::testTurretTooClose(%item, %plyr) { //don't check this for non-turret deployables } //------------------------------------------------- function TurretIndoorDeployableImage::testTurretSaturation(%item) { %highestDensity = 0; InitContainerRadiusSearch(%item.surfacePt, $TurretIndoorSphereRadius, $TypeMasks::StaticShapeObjectType); %found = containerSearchNext(); while(%found) { %foundName = %found.getDataBlock().getName(); if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor) ) { //found one %numTurretsNearby++; %nearbyDensity = testNearbyDensity(%found, $TurretIndoorSphereRadius); if (%nearbyDensity > %highestDensity) %highestDensity = %nearbyDensity; } %found = containerSearchNext(); } if (%numTurretsNearby > %highestDensity) %highestDensity = %numTurretsNearby; return %highestDensity > $TurretIndoorMaxPerSphere; } function TurretOutdoorDeployableImage::testTurretSaturation(%item) { %highestDensity = 0; InitContainerRadiusSearch(%item.surfacePt, $TurretOutdoorSphereRadius, $TypeMasks::StaticShapeObjectType); %found = containerSearchNext(); while(%found) { %foundName = %found.getDataBlock().getName(); if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor) ) { //found one %numTurretsNearby++; %nearbyDensity = testNearbyDensity(%found, $TurretOutdoorSphereRadius); if (%nearbyDensity > %highestDensity) %highestDensity = %nearbyDensity; } %found = containerSearchNext(); } if (%numTurretsNearby > %highestDensity) %highestDensity = %numTurretsNearby; return %highestDensity > $TurretOutdoorMaxPerSphere; } function ShapeBaseImageData::testTurretSaturation(%item, %surfacePt) { //don't check this for non-turret deployables } function testNearbyDensity(%item, %radius) { //this checks how many turrets are in adjacent spheres in case placing a new one overloads them. %surfacePt = posFromTransform(%item.getTransform()); %turretCount = 0; InitContainerRadiusSearch(%surfacePt, %radius, $TypeMasks::StaticShapeObjectType); %found = containerSearchNext(); while(%found) { %foundName = %found.getDataBlock().getName(); if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor) ) %turretCount++; %found = containerSearchNext(); } return %turretCount; } //------------------------------------------------- //if this function, or any of the included tests are changed, those changes need to be reflected in function: //AIODeployEquipment::weight(%this, %client, %level), found in aiObjectives.cs --tinman function ShapeBaseImageData::testInvalidDeployConditions(%item, %plyr, %slot) { cancel(%plyr.deployCheckThread); %disqualified = $NotDeployableReason::None; //default $MaxDeployDistance = %item.maxDeployDis; $MinDeployDistance = %item.minDeployDis; %surface = Deployables::searchView(%plyr, $MaxDeployDistance, ($TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType)); if (%surface) { %surfacePt = posFromRaycast(%surface); %surfaceNrm = normalFromRaycast(%surface); // Check that point to see if anything is objstructing it... %eyeTrans = %plyr.getEyeTransform(); %eyePos = posFromTransform(%eyeTrans); %searchResult = containerRayCast(%eyePos, %surfacePt, -1, %plyr); if (!%searchResult) { %item.surface = %surface; %item.surfacePt = %surfacePt; %item.surfaceNrm = %surfaceNrm; } else { if(checkPositions(%surfacePT, posFromRaycast(%searchResult))) { %item.surface = %surface; %item.surfacePt = %surfacePt; %item.surfaceNrm = %surfaceNrm; } else { // Don't set the item %disqualified = $NotDeployableReason::ObjectTooClose; } } if(!getTerrainAngle(%surfaceNrm) && %item.flatMaxDeployDis !$= "") { $MaxDeployDistance = %item.flatMaxDeployDis; $MinDeployDistance = %item.flatMinDeployDis; } } if (%item.testMaxDeployed(%plyr)) { %disqualified = $NotDeployableReason::MaxDeployed; } else if (%item.testNoSurfaceInRange(%plyr)) { %disqualified = $NotDeployableReason::NoSurfaceFound; } else if (%item.testNoTerrainFound(%surface)) { %disqualified = $NotDeployableReason::NoTerrainFound; } else if (%item.testNoInteriorFound()) { %disqualified = $NotDeployableReason::NoInteriorFound; } else if (%item.testSlopeTooGreat(%surface, %surfaceNrm)) { %disqualified = $NotDeployableReason::SlopeTooGreat; } else if (%item.testSelfTooClose(%plyr, %surfacePt)) { %disqualified = $NotDeployableReason::SelfTooClose; } else if (%item.testObjectTooClose(%surfacePt)) { %disqualified = $NotDeployableReason::ObjectTooClose; } else if (%item.testTurretTooClose(%plyr)) { %disqualified = $NotDeployableReason::TurretTooClose; } else if (%item.testInventoryTooClose(%plyr)) { %disqualified = $NotDeployableReason::InventoryTooClose; } else if (%item.testTurretSaturation()) { %disqualified = $NotDeployableReason::TurretSaturation; } else if (%disqualified == $NotDeployableReason::None) { // Test that there are no objstructing objects that this object // will intersect with // %rot = %item.getInitialRotation(%plyr); if(%item.deployed.className $= "DeployedTurret") { %xform = %item.deployed.getDeployTransform(%item.surfacePt, %item.surfaceNrm); } else { %xform = %surfacePt SPC %rot; } if (!%item.deployed.checkDeployPos(%xform)) { %disqualified = $NotDeployableReason::ObjectTooClose; } else if (!%item.testHavePurchase(%xform)) { %disqualified = $NotDeployableReason::SurfaceTooNarrow; } } if (%plyr.getMountedImage($BackpackSlot) == %item) //player still have the item? { if (%disqualified) activateDeploySensorRed(%plyr); else activateDeploySensorGrn(%plyr); if (%plyr.client.deployPack == true) %item.attemptDeploy(%plyr, %slot, %disqualified); else { %plyr.deployCheckThread = %item.schedule(25, "testInvalidDeployConditions", %plyr, %slot); //update checks every 50 milliseconds } } else deactivateDeploySensor(%plyr); } function checkPositions(%pos1, %pos2) { %passed = true; if((mFloor(getWord(%pos1, 0)) - mFloor(getWord(%pos2,0)))) %passed = false; if((mFloor(getWord(%pos1, 1)) - mFloor(getWord(%pos2,1)))) %passed = false; if((mFloor(getWord(%pos1, 2)) - mFloor(getWord(%pos2,2)))) %passed = false; return %passed; } function ShapeBaseImageData::attemptDeploy(%item, %plyr, %slot, %disqualified) { deactivateDeploySensor(%plyr); Deployables::displayErrorMsg(%item, %plyr, %slot, %disqualified); } function activateDeploySensorRed(%pl) { if(%pl.deploySensor !$= "red") { messageClient(%pl.client, 'msgDeploySensorRed', ""); %pl.deploySensor = "red"; } } function activateDeploySensorGrn(%pl) { if(%pl.deploySensor !$= "green") { messageClient(%pl.client, 'msgDeploySensorGrn', ""); %pl.deploySensor = "green"; } } function deactivateDeploySensor(%pl) { if (%pl.deploySensor !$= "") { messageClient(%pl.client, 'msgDeploySensorOff', ""); %pl.deploySensor = ""; } } function Deployables::displayErrorMsg(%item, %plyr, %slot, %error) { deactivateDeploySensor(%plyr); %errorSnd = '~wfx/misc/misc.error.wav'; switch (%error) { case $NotDeployableReason::None: %item.onDeploy(%plyr, %slot); messageClient(%plyr.client, 'MsgTeamDeploySuccess', ""); return; case $NotDeployableReason::NoSurfaceFound: %msg = '\c2Item must be placed within reach.%1'; case $NotDeployableReason::MaxDeployed: %msg = '\c2Your team\'s control network has reached its capacity for this item.%1'; case $NotDeployableReason::SlopeTooGreat: %msg = '\c2Surface is too steep to place this item on.%1'; case $NotDeployableReason::SelfTooClose: %msg = '\c2You are too close to the surface you are trying to place the item on.%1'; case $NotDeployableReason::ObjectTooClose: %msg = '\c2You cannot place this item so close to another object.%1'; case $NotDeployableReason::NoTerrainFound: %msg = '\c2You must place this on outdoor terrain.%1'; case $NotDeployableReason::NoInteriorFound: %msg = '\c2You must place this on a solid surface.%1'; case $NotDeployableReason::TurretTooClose: %msg = '\c2Interference from a nearby turret prevents placement here.%1'; case $NotDeployableReason::TurretSaturation: %msg = '\c2There are too many turrets nearby.%1'; case $NotDeployableReason::SurfaceTooNarrow: %msg = '\c2There is not adequate surface to clamp to here.%1'; case $NotDeployableReason::InventoryTooClose: %msg = '\c2Interference from a nearby inventory prevents placement here.%1'; default: %msg = '\c2Deploy failed.'; } messageClient(%plyr.client, 'MsgDeployFailed', %msg, %errorSnd); } function ShapeBaseImageData::onActivate(%data, %obj, %slot) { //Tinman - apparently, anything that uses the generic onActivate() method is a deployable. //repair packs, cloak packs, shield, etc... all overload this method... %data.testInvalidDeployConditions(%obj, %slot); //whether the test passed or not, reset the image trigger (deployables don't have an on/off toggleable state) %obj.setImageTrigger(%slot, false); } function ShapeBaseImageData::onDeploy(%item, %plyr, %slot) { if(%item.item $= "MotionSensorDeployable" || %item.item $= "PulseSensorDeployable") { %plyr.deploySensors--; %plyr.client.updateSensorPackText(%plyr.deploySensors); if(%plyr.deploySensors <= 0) { // take the deployable off the player's back and out of inventory %plyr.unmountImage(%slot); %plyr.decInventory(%item.item, 1); } } else { // take the deployable off the player's back and out of inventory %plyr.unmountImage(%slot); %plyr.decInventory(%item.item, 1); } // create the actual deployable %rot = %item.getInitialRotation(%plyr); if(%item.deployed.className $= "DeployedTurret") %className = "Turret"; else %className = "StaticShape"; %deplObj = new (%className)() { dataBlock = %item.deployed; }; // set orientation if(%className $= "Turret") %deplObj.setDeployRotation(%item.surfacePt, %item.surfaceNrm); else %deplObj.setTransform(%item.surfacePt SPC %rot); // set the recharge rate right away if(%deplObj.getDatablock().rechargeRate) %deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate); // set team, owner, and handle %deplObj.team = %plyr.client.Team; %deplObj.owner = %plyr.client; // set the sensor group if it needs one if(%deplObj.getTarget() != -1) setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team); // place the deployable in the MissionCleanup/Deployables group (AI reasons) addToDeployGroup(%deplObj); //let the AI know as well... AIDeployObject(%plyr.client, %deplObj); // play the deploy sound serverPlay3D(%item.deploySound, %deplObj.getTransform()); // increment the team count for this deployed object $TeamDeployedCount[%plyr.team, %item.item]++; %deplObj.deploy(); return %deplObj; } function ShapeBaseImageData::getInitialRotation(%item, %plyr) { return rotFromTransform(%plyr.getTransform()); } function MotionSensorDeployableImage::getInitialRotation(%item, %plyr) { %rotAxis = vectorNormalize(vectorCross(%item.surfaceNrm, "0 0 1")); if (getWord(%item.surfaceNrm, 2) == 1 || getWord(%item.surfaceNrm, 2) == -1) %rotAxis = vectorNormalize(vectorCross(%item.surfaceNrm, "0 1 0")); return %rotAxis SPC mACos(vectorDot(%item.surfaceNrm, "0 0 1")); } function MotionSensorDeployable::onPickup(%this, %pack, %player, %amount) { // %this = Sensor pack datablock // %pack = Sensor pack object number // %player = player // %amount = amount picked up (1) if(%pack.sensors $= "") { // assume that this is a pack that has been placed in a mission // this case was handled in ::onInventory below (max sensors); } else { // find out how many sensor were in the pack %player.deploySensors = %pack.sensors; %player.client.updateSensorPackText(%player.deploySensors); } } function MotionSensorDeployable::onThrow(%this,%pack,%player) { // %this = Sensor pack datablock // %pack = Sensor pack object number // %player = player %player.throwSensorPack = 1; %pack.sensors = %player.deploySensors; %player.deploySensors = 0; %player.client.updateSensorPackText(%player.deploySensors); // do the normal ItemData::onThrow stuff -- sound and schedule deletion serverPlay3D(ItemThrowSound, %player.getTransform()); %pack.schedulePop(); } function MotionSensorDeployable::onInventory(%this,%player,%value) { // %this = Sensor pack datablock // %player = player // %value = 1 if gaining a pack, 0 if losing a pack if(%player.getClassName() $= "Player") { if(%value) { // player picked up or bought a motion sensor pack %player.deploySensors = %this.maxSensors; %player.client.updateSensorPackText(%player.deploySensors); } else { // player dropped or sold a motion sensor pack if(%player.throwSensorPack) { // player threw the pack %player.throwSensorPack = 0; // everything handled in ::onThrow above } else { //the pack was sold at an inventory station, or unmounted because the player // used all the sensors %player.deploySensors = 0; %player.client.updateSensorPackText(%player.deploySensors); } } } Pack::onInventory(%this,%player,%value); } function PulseSensorDeployable::onPickup(%this, %pack, %player, %amount) { // %this = Sensor pack datablock // %pack = Sensor pack object number // %player = player // %amount = amount picked up (1) if(%pack.sensors $= "") { // assume that this is a pack that has been placed in a mission // this case was handled in ::onInventory below (max sensors); } else { // find out how many sensor were in the pack %player.deploySensors = %pack.sensors; %player.client.updateSensorPackText(%player.deploySensors); } } function PulseSensorDeployable::onThrow(%this,%pack,%player) { // %this = Sensor pack datablock // %pack = Sensor pack object number // %player = player %player.throwSensorPack = 1; %pack.sensors = %player.deploySensors; %player.deploySensors = 0; %player.client.updateSensorPackText(%player.deploySensors); // do the normal ItemData::onThrow stuff -- sound and schedule deletion serverPlay3D(ItemThrowSound, %player.getTransform()); %pack.schedulePop(); } function PulseSensorDeployable::onInventory(%this,%player,%value) { // %this = Sensor pack datablock // %player = player // %value = 1 if gaining a pack, 0 if losing a pack if(%player.getClassName() $= "Player") { if(%value) { // player picked up or bought a motion sensor pack %player.deploySensors = %this.maxSensors; %player.client.updateSensorPackText(%player.deploySensors); } else { // player dropped or sold a motion sensor pack if(%player.throwSensorPack) { // player threw the pack %player.throwSensorPack = 0; // everything handled in ::onThrow above } else { //the pack was sold at an inventory station, or unmounted because the player // used all the sensors %player.deploySensors = 0; %player.client.updateSensorPackText(%player.deploySensors); } } } Pack::onInventory(%this,%player,%value); } function TurretIndoorDeployableImage::getInitialRotation(%item, %plyr) { %surfaceAngle = getTerrainAngle(%item.surfaceNrm); if(%surfaceAngle > 155) %item.deployed = TurretDeployedCeilingIndoor; else if(%surfaceAngle > 45) %item.deployed = TurretDeployedWallIndoor; else %item.deployed = TurretDeployedFloorIndoor; } function TurretIndoorDeployable::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors } function TurretOutdoorDeployable::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors } function InventoryDeployable::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors } // --------------------------------------------------------------------------------------- // deployed station functions function DeployedStationInventory::onEndSequence(%data, %obj, %thread) { Parent::onEndSequence(%data, %obj, %thread); if(%thread == $DeployThread) { %trigger = new Trigger() { dataBlock = stationTrigger; polyhedron = "-0.125 0.0 0.1 0.25 0.0 0.0 0.0 -0.7 0.0 0.0 0.0 1.0"; }; MissionCleanup.add(%trigger); %trans = %obj.getTransform(); %vSPos = getWords(%trans,0,2); %vRot = getWords(%trans,3,5); %vAngle = getWord(%trans,6); %matrix = VectorOrthoBasis(%vRot @ " " @ %vAngle + 0.0); %yRot = getWords(%matrix, 3, 5); %pos = vectorAdd(%vSPos, vectorScale(%yRot, -0.1)); %trigger.setTransform(%pos @ " " @ %vRot @ " " @ %vAngle); // associate the trigger with the station %trigger.station = %obj; %trigger.mainObj = %obj; %trigger.disableObj = %obj; %obj.trigger = %trigger; } } //-------------------------------------------------------------------------- //DeployedMotionSensor: //-------------------------------------------------------------------------- function DeployedMotionSensor::onDestroyed(%this, %obj, %prevState) { //%obj.hide(true); Parent::onDestroyed(%this, %obj, %prevState); $TeamDeployedCount[%obj.team, MotionSensorDeployable]--; %obj.schedule(500, "delete"); } //-------------------------------------------------------------------------- //DeployedPulseSensor: //-------------------------------------------------------------------------- function PulseSensorDeployableImage::onActivate(%data, %obj, %slot) { Parent::onActivate( %data, %obj, %slot ); //%data.testInvalidDeployConditions(%obj, %slot); } function DeployedPulseSensor::onDestroyed(%this, %obj, %prevState) { Parent::onDestroyed(%this, %obj, %prevState); $TeamDeployedCount[%obj.team, PulseSensorDeployable]--; %obj.schedule(300, "delete"); } // --------------------------------------------------------------------------------------- // deployed turret functions function DeployedTurret::onAdd(%data, %obj) { Parent::onAdd(%data, %obj); // auto-mount the barrel %obj.mountImage(%data.barrel, 0, false); } function DeployedTurret::onDestroyed(%this, %obj, %prevState) { Parent::onDestroyed(%this, %obj, %prevState); %turType = %this.getName(); // either it'll be an outdoor turret, or one of the three types of indoor turret // (floor, ceiling, wall) if(%turType $= "TurretDeployedOutdoor") %turType = "TurretOutdoorDeployable"; else %turType = "TurretIndoorDeployable"; // decrement team count $TeamDeployedCount[%obj.team, %turType]--; %obj.schedule(700, "delete"); } function countTurretsAllowed(%type) { for(%j = 1; %j < Game.numTeams; %j++) %teamPlayerCount[%j] = 0; %numClients = ClientGroup.getCount(); for(%i = 0; %i < %numClients; %i++) { %cl = ClientGroup.getObject(%i); if(%cl.team > 0) %teamPlayerCount[%cl.team]++; } // the bigger team determines the number of turrets allowed %maxPlayers = %teamPlayerCount[1] > %teamPlayerCount[2] ? %teamPlayerCount[1] : %teamPlayerCount[2]; // each team can have 1 turret of each type (indoor/outdoor) for every 2 players // minimum and maximums are defined in deployables.cs %teamTurretMax = mFloor(%maxPlayers / 2); if(%teamTurretMax < $TeamDeployableMin[%type]) %teamTurretMax = $TeamDeployableMin[%type]; else if(%teamTurretMax > $TeamDeployableMax[%type]) %teamTurretMax = $TeamDeployableMax[%type]; return %teamTurretMax; } PK !(Cscripts/depthSort.cs moveMap.bindCmd(keyboard,o,"","toggleDepthTest();"); moveMap.bindCmd(keyboard,j,"","toggleDepthSort();"); moveMap.bindCmd(keyboard,k,"","toggleRenderDepth();"); moveMap.bindCmd(keyboard,l,"","toggleHoldDepthTest();"); function toggleDepthTest() { if ($Collision::testDepthSortList) { $Collision::testDepthSortList = false; echo("Turning OFF testing of DepthSortList"); } else { $Collision::testDepthSortList = true; echo("Turning ON testing of DepthSortList"); } } function toggleDepthSort() { if ($Collision::depthSort) { $Collision::depthSort = false; echo("Turning OFF depth sort on depthSortList"); } else { $Collision::depthSort = true; echo("Turning ON depth sort on depthSortList"); } } function toggleRenderDepth() { if ($Collision::depthRender) { $Collision::depthRender = false; echo("Turning OFF depth rendering on DepthSortList"); } else { $Collision::depthRender = true; echo("Turning ON depth rendering on DepthSortList"); } } function toggleHoldDepthTest() { if ($Collision::renderAlways) { $Collision::renderAlways = false; $Collision::testDepthSortList = true; } else { $Collision::renderAlways = true; $Collision::testDepthSortList = false; } } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // PK !( MMscripts/desertPropMap.cs//-------------------------------------- Desert interior texture property mapping addMaterialMapping("desert/cp_ichute01", "environment: special/chuteTexture 0.25"); addMaterialMapping("desert/cp_ichute02", "environment: special/chuteTexture 0.25"); //"Color: red green blue startAlpha endAlpha" //Soft sound = 0 //Hard sound = 1 //Metal sound = 2 //Snow sound = 3 addMaterialMapping("terrain/DesertWorld.RockFractured", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0"); addMaterialMapping("terrain/DesertWorld.RockSmooth", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0"); addMaterialMapping("terrain/DesertWorld.Sand", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0"); addMaterialMapping("terrain/DesertWorld.SandBrun", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0"); addMaterialMapping("terrain/DesertWorld.SandDark", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0"); addMaterialMapping("terrain/DesertWorld.SandOrange", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0"); addMaterialMapping("terrain/DesertWorld.SandOxidized", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0"); PK !(Dˆ2uuscripts/editor.bind.cs//----------------------------------------------------------------------------- // Torque Game Engine // // Copyright (c) 2001 GarageGames.Com // Portions Copyright (c) 2001 by Sierra Online, Inc. //----------------------------------------------------------------------------- //------------------------------------------------------------------------------ // Mission Editor Manager new ActionMap(EditorMap); EditorMap.bindCmd(keyboard, "f1", "contextHelp();", ""); EditorMap.bindCmd(keyboard, "escape", "editor.close();", ""); EditorMap.bindCmd(keyboard, "i", "Canvas.pushDialog(interiorDebugDialog);", ""); PK !(ˈ^ scripts/editor.cs//----------------------------------------------------------------------------- // 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(); } } PK !(2=-scripts/editorRender.cs//------------------------------------------------------------------------------ // Console onEditorRender functions: //------------------------------------------------------------------------------ // Functions: // - renderSphere([pos], [radius], ); // - renderCircle([pos], [normal], [radius], ); // - renderTriangle([pnt], [pnt], [pnt]); // - renderLine([start], [end], ); // // Variables: // - consoleFrameColor - line prims are rendered with this // - consoleFillColor // - consoleSphereLevel - level of polyhedron subdivision // - consoleCircleSegments // - consoleLineWidth //------------------------------------------------------------------------------ function SpawnSphere::onEditorRender(%this, %editor, %selected, %expanded) { if(%selected $= "true") { %editor.consoleFrameColor = "255 0 0"; %editor.consoleFillColor = "0 0 0 0"; %editor.renderSphere(%this.getWorldBoxCenter(), %this.radius, 1); } } function AudioEmitter::onEditorRender(%this, %editor, %selected, %expanded) { if(%selected $= "true" && %this.is3D && !%this.useProfileDescription) { %editor.consoleFillColor = "0 0 0 0"; %editor.consoleFrameColor = "255 0 0"; %editor.renderSphere(%this.getTransform(), %this.minDistance, 1); %editor.consoleFrameColor = "0 0 255"; %editor.renderSphere(%this.getTransform(), %this.maxDistance, 1); } } //function Item::onEditorRender(%this, %editor, %selected, %expanded) //{ // if(%this.getDataBlock().getName() $= "MineDeployed") // { // %editor.consoleFillColor = "0 0 0 0"; // %editor.consoleFrameColor = "255 0 0"; // %editor.renderSphere(%this.getWorldBoxCenter(), 6, 1); // } //}PK !(%scripts/environmentals.cs// Used by interiors: ------------------------------------------------------ datablock AudioProfile(Universal_Base_1) { filename = "fx/environment/base_1.wav"; description = AudioLooping2d; }; datablock AudioProfile(Universal_Base_2) { filename = "fx/environment/base_2.wav"; description = AudioLooping2d; }; datablock AudioProfile(Universal_Base_3) { filename = "fx/environment/base_3.wav"; description = AudioLooping2d; }; datablock AudioProfile(Universal_Base_Pulse_1) { filename = "fx/environment/base_pulse_1.wav"; description = AudioLooping2d; }; datablock AudioProfile(Universal_Base_Pulse_2) { filename = "fx/environment/base_pulse_2.wav"; description = AudioLooping2d; }; datablock AudioProfile(sPowerUp) { filename = "fx/powered/base_power_on.wav"; description = Audio2d; preload = true; }; datablock AudioProfile(sPowerDown) { filename = "fx/powered/base_power_off.wav"; description = Audio2d; preload = true; }; PK !(Sddscripts/forceField.cs//-------------------------------------------------------------------------- // Force fields: // // accept the following commands: // open() // close() // //-------------------------------------------------------------------------- datablock ForceFieldBareData(defaultForceFieldBare) { fadeMS = 1000; baseTranslucency = 0.30; powerOffTranslucency = 0.0; teamPermiable = false; otherPermiable = false; color = "0.0 0.55 0.99"; powerOffColor = "0.0 0.0 0.0"; targetNameTag = 'Force Field'; targetTypeTag = 'ForceField'; texture[0] = "skins/forcef1"; texture[1] = "skins/forcef2"; texture[2] = "skins/forcef3"; texture[3] = "skins/forcef4"; texture[4] = "skins/forcef5"; framesPerSec = 10; numFrames = 5; scrollSpeed = 15; umapping = 1.0; vmapping = 0.15; }; datablock ForceFieldBareData(defaultTeamSlowFieldBare) { fadeMS = 1000; baseTranslucency = 0.3; powerOffTranslucency = 0.0; teamPermiable = true; otherPermiable = false; color = "0.28 0.89 0.31"; powerOffColor = "0.0 0.0 0.0"; targetTypeTag = 'ForceField'; texture[0] = "skins/forcef1"; texture[1] = "skins/forcef2"; texture[2] = "skins/forcef3"; texture[3] = "skins/forcef4"; texture[4] = "skins/forcef5"; framesPerSec = 10; numFrames = 5; scrollSpeed = 15; umapping = 1.0; vmapping = 0.15; }; datablock ForceFieldBareData(defaultAllSlowFieldBare) { fadeMS = 1000; baseTranslucency = 0.30; powerOffTranslucency = 0.0; teamPermiable = true; otherPermiable = true; color = "1.0 0.4 0.0"; powerOffColor = "0.0 0.0 0.0"; targetTypeTag = 'ForceField'; texture[0] = "skins/forcef1"; texture[1] = "skins/forcef2"; texture[2] = "skins/forcef3"; texture[3] = "skins/forcef4"; texture[4] = "skins/forcef5"; framesPerSec = 10; numFrames = 5; scrollSpeed = 15; umapping = 1.0; vmapping = 0.15; }; datablock ForceFieldBareData(defaultNoTeamSlowFieldBare) { fadeMS = 1000; baseTranslucency = 0.30; powerOffTranslucency = 0.0; teamPermiable = false; otherPermiable = true; color = "1.0 0.0 0.0"; powerOffColor = "0.0 0.0 0.0"; targetTypeTag = 'ForceField'; texture[0] = "skins/forcef1"; texture[1] = "skins/forcef2"; texture[2] = "skins/forcef3"; texture[3] = "skins/forcef4"; texture[4] = "skins/forcef5"; framesPerSec = 10; numFrames = 5; scrollSpeed = 15; umapping = 1.0; vmapping = 0.15; }; datablock ForceFieldBareData(defaultSolidFieldBare) { fadeMS = 1000; baseTranslucency = 0.30; powerOffTranslucency = 0.0; teamPermiable = false; otherPermiable = false; color = "1.0 0.0 0.0"; powerOffColor = "0.0 0.0 0.0"; targetTypeTag = 'ForceField'; texture[0] = "skins/forcef1"; texture[1] = "skins/forcef2"; texture[2] = "skins/forcef3"; texture[3] = "skins/forcef4"; texture[4] = "skins/forcef5"; framesPerSec = 10; numFrames = 5; scrollSpeed = 15; umapping = 1.0; vmapping = 0.15; }; function ForceFieldBare::onTrigger(%this, %triggerId, %on) { // Default behavior for a field: // if triggered: go to open state (last waypoint) // if untriggered: go to closed state (first waypoint) if (%on == 1) { %this.triggerCount++; } else { if (%this.triggerCount > 0) %this.triggerCount--; } if (%this.triggerCount > 0) { %this.open(); } else { %this.close(); } } function ForceFieldBareData::gainPower(%data, %obj) { Parent::gainPower(%data, %obj); %obj.close(); // activate the field's physical zone %pzGroup = nameToID("MissionCleanup/PZones"); if(%pzGroup > 0) { %ffp = -1; for(%i = 0; %i < %pzGroup.getCount(); %i++) { %pz = %pzGroup.getObject(%i); if(%pz.ffield == %obj) { %ffp = %pz; break; } } if(%ffp > 0) { %ffp.activate(); if( %data.getName() $= "defaultForceFieldBare" ) { killAllPlayersWithinZone( %data, %obj ); } else if( %data.getName() $= "defaultTeamSlowFieldBare" ) { %team = %obj.team; killAllPlayersWithinZone( %data, %obj, %team ); } } } //else // error("No PZones group to search!"); } function killAllPlayersWithinZone( %data, %obj, %team ) { for( %c = 0; %c < ClientGroup.getCount(); %c++ ) { %client = ClientGroup.getObject(%c); if( isObject( %client.player ) ) { if( %forceField = %client.player.isInForceField() )// isInForceField() will return the id of the ff or zero { if( %forceField == %obj ) { if( %team !$= "" && %team == %client.team ) return; else { %client.player.blowup(); // chunkOrama! %client.player.scriptkill($DamageType::ForceFieldPowerup); } } } } } } function ForceFieldBareData::losePower(%data, %obj) { Parent::losePower(%data, %obj); %obj.open(); // deactivate the field's physical zone %pzGroup = nameToID("MissionCleanup/PZones"); if(%pzGroup > 0) { %ffp = -1; for(%i = 0; %i < %pzGroup.getCount(); %i++) { %pz = %pzGroup.getObject(%i); if(%pz.ffield == %obj) { %ffp = %pz; break; } } if(%ffp > 0) { %ffp.deactivate(); } } //else // error(""); } function ForceFieldBareData::onAdd(%data, %obj) { Parent::onAdd(%data, %obj); %pz = new PhysicalZone() { position = %obj.position; rotation = %obj.rotation; scale = %obj.scale; polyhedron = "0.000000 1.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000"; velocityMod = 0.1; gravityMod = 1.0; appliedForce = "0 0 0"; ffield = %obj; }; %pzGroup = nameToID("MissionCleanup/PZones"); if(%pzGroup <= 0) { %pzGroup = new SimGroup("PZones"); MissionCleanup.add(%pzGroup); } %pzGroup.add(%pz); //MissionCleanupGroup.add(%pz); } PK !(! A= = scripts/gameBase.cs 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 ForceFieldBare::damage() { } 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); } PK !(/Qh`scripts/gameCanvas.csfunction SimSet::removeStable(%this, %object) { if(%this.getCount() < 2) { %this.remove(%object); return; } %last = %this.getObject(%this.getCount() - 1); %this.remove(%object); %this.pushToBack(%last); } if(!isObject(GameDialogSet)) { new SimSet(GameDialogSet); RootGroup.add(GameDialogSet); } function GuiCanvas::setGameMode(%this, %on) { if(%this.gameMode == %on) return; %this.gameMode = %on; if(%this.gameMode) { %this.setContent(%this.gameContent); for(%i = 0; %i < GameDialogSet.getCount(); %i++) %this.pushDialog(GameDialogSet.getObject(%i)); } else Canvas.setContent(LobbyGui); } function GuiCanvas::pushGameDialog(%this, %dialog) { GameDialogSet.add(%dialog); if(%this.gameMode) %this.pushDialog(%dialog); } function GuiCanvas::popGameDialog(%this, %dialog) { GameDialogSet.removeStable(%dialog); if(%this.gameMode) %this.popDialog(%dialog); }PK !(F ((scripts/graphBuild.cs// offline graph building $MAXNODECOUNT = 5000; function makeJettableGraphOffline(%NAVorSPAWN) { if (%NAVorSPAWN $= "Spawn") echo("--> Building Spawn Graph"); else echo("--> Building Nav Graph"); // Inform what we're generating- navGraph.setGenMode(%NAVorSPAWN); // Upload ground and floor data- navGraph::exteriorInspect(); navGraph::generateInterior(); // navGraph.makeGraph(); // navGraph.findBridges(); // navGraph.pushBridges(); navGraph.assemble(); navGraph.cullIslands(); navGraph.makeGraph(); navGraph.pushBridges(); navGraph.makeTables(); return false; } function doTablebuildOffline() { navGraph.prepLOS("0 0 0"); while(navGraph.makeLOS()) %percent++; } PK !(cscripts/heavy_male.csdatablock TSShapeConstructor(HeavyMaleDts) { baseShape = "heavy_male.dts"; sequence0 = "heavy_male_root.dsq root"; sequence1 = "heavy_male_forward.dsq run"; sequence2 = "heavy_male_back.dsq back"; sequence3 = "heavy_male_side.dsq side"; sequence4 = "heavy_male_lookde.dsq look"; sequence5 = "heavy_male_head.dsq head"; sequence6 = "heavy_male_fall.dsq fall"; sequence7 = "heavy_male_jet.dsq jet"; sequence8 = "heavy_male_land.dsq land"; sequence9 = "heavy_male_jump.dsq jump"; sequence10 = "heavy_male_recoilde.dsq light_recoil"; sequence11 = "heavy_male_idlepda.dsq pda"; sequence12 = "heavy_male_headside.dsq headside"; sequence13 = "heavy_male_lookms.dsq lookms"; sequence14 = "heavy_male_diehead.dsq death1"; sequence15 = "heavy_male_diechest.dsq death2"; sequence16 = "heavy_male_dieback.dsq death3"; sequence17 = "heavy_male_diesidelf.dsq death4"; sequence18 = "heavy_male_diesidert.dsq death5"; sequence19 = "heavy_male_dieforward.dsq death6"; // heavy_male_dieleglf sequence20 = "heavy_male_diechest.dsq death7"; // heavy_male_dielegrt sequence21 = "heavy_male_dieslump.dsq death8"; sequence22 = "heavy_male_dieforward.dsq death9"; // heavy_male_dieknees sequence23 = "heavy_male_dieforward.dsq death10"; sequence24 = "heavy_male_diespin.dsq death11"; sequence25 = "heavy_male_celsalute.dsq cel1"; sequence26 = "heavy_male_celwave.dsq cel2"; sequence27 = "heavy_male_tauntbest.dsq cel3"; sequence28 = "heavy_male_tauntimp.dsq cel4"; sequence29 = "heavy_male_celdance.dsq cel5"; sequence30 = "heavy_male_celflex.dsq cel6"; sequence31 = "heavy_male_celtaunt.dsq cel7"; sequence32 = "heavy_male_celjump.dsq cel8"; sequence33 = "heavy_male_ski.dsq ski"; sequence34 = "heavy_male_standjump.dsq standjump"; sequence35 = "heavy_male_looknw.dsq looknw"; }; PK !(ԬQscripts/help.cs//----------------------------------------------------------------------------- // Torque Engine // // Copyright (c) 2001 GarageGames.Com //----------------------------------------------------------------------------- function HelpDlg::onWake(%this) { HelpFileList.entryCount = 0; HelpFileList.clear(); for(%file = findFirstFile("*.hfl"); %file !$= ""; %file = findNextFile("*.hfl")) { HelpFileList.fileName[HelpFileList.entryCount] = %file; HelpFileList.addRow(HelpFileList.entryCount, fileBase(%file)); HelpFileList.entryCount++; } HelpFileList.sortNumerical(0); HelpFileList.setSelectedRow(0); } function HelpFileList::onSelect(%this, %row) { %fo = new FileObject(); %fo.openForRead(%this.fileName[%row]); %text = ""; while(!%fo.isEOF()) %text = %text @ %fo.readLine() @ "\n"; %fo.delete(); HelpText.setText(%text); } function getHelp(%helpName) { trace(1); Canvas.pushDialog(HelpDlg); if(%helpName !$= "") { %index = HelpFileList.findTextIndex(%helpName); HelpFileList.setSelectedRow(%index); } trace(0); } function contextHelp() { for(%i = 0; %i < Canvas.getCount(); %i++) { if(Canvas.getObject(%i).getName() $= HelpDlg) { Canvas.popDialog(HelpDlg); return; } } %content = Canvas.getContent(); %helpPage = %content.getHelpPage(); getHelp(%helpPage); } function GuiControl::getHelpPage(%this) { return %this.helpPage; } function GuiMLTextCtrl::onURL(%this, %url) { if(getSubStr(%url, 0, 5) $= "help/") getHelp(getSubStr(%url, 5, 100000)); else gotoWebPage( %url ); } PK !(u~scripts/helpGuiText.cs$helpTextShown = false; function toggleHelpText() { // if HUD has been altered, do not show helpTextGui if(helpTextGui.visible) helpTextGui.setVisible(false); else { if(!$helpTextShown) { objHudText.setValue("Displays important information about the current mission."); chatHudText.setValue("Chat messages from other players are displayed here."); energyHudText.setValue("Your armor's available energy. Heat (the red bar) increases as you use jets."); compassHudText.setValue("Compass spins as you turn. Clock shows mission time. If the center is flashing red, you've been detected."); damageHudText.setValue("You are dead if this reaches zero."); reticleHudText.setValue("Your weapon fire hits approximately in the center of this."); inventoryHudText.setValue("Shows (left to right) number of grenades, mines, health kits and beacons."); weaponsHudText.setValue("Shows your available weapons, plus a targeting laser."); $helpTextShown = true; } helpTextGui.setVisible(true); } } PK mF-Fwwwscripts/hud.cs//-------------------------------------------------------------------------- function GameConnection::sensorPing(%this, %ping) { sensorHud.ping = %ping; sensorHud.update(); } function GameConnection::sensorJammed(%this, %jam) { sensorHud.jam = %jam; sensorHud.update(); } function SensorHud::update(%this) { if(!%this.ping && !%this.jam) { %this.setVisible(false); sensorHudBack.setVisible(true); return; } %this.setVisible(true); sensorHudBack.setVisible(false); if(%this.jam) %this.color = %this.jamColor; else %this.color = %this.pingColor; } // - anything which should be reset on new server/mission function clientCmdResetHud() { deploySensor.setVisible(false); controlObjectText.setVisible(false); sensorHud.jam = false; sensorHud.ping = false; sensorHud.update(); } //-------------------------------------------------------------------------- $vehicleReticle[AssaultVehicle, 1, bitmap] = "gui/hud_ret_tankchaingun"; $vehicleReticle[AssaultVehicle, 1, frame] = true; $vehicleReticle[AssaultVehicle, 2, bitmap] = "gui/hud_ret_tankmortar"; $vehicleReticle[AssaultVehicle, 2, frame] = true; $vehicleReticle[BomberFlyer, 1, bitmap] = "gui/hud_ret_shrike"; $vehicleReticle[BomberFlyer, 1, frame] = false; $vehicleReticle[BomberFlyer, 2, bitmap] = ""; $vehicleReticle[BomberFlyer, 2, frame] = false; $vehicleReticle[BomberFlyer, 3, bitmap] = "gui/hud_ret_targlaser"; $vehicleReticle[BomberFlyer, 3, frame] = false; function GameConnection::setVWeaponsHudActive(%client, %slot) { %veh = %client.player.getObjectMount(); %vehType = %veh.getDatablock().getName(); commandToClient(%client, 'setVWeaponsHudActive', %slot, %vehType); } function clientCmdSetVWeaponsHudActive(%num, %vType) { //vWeaponsBox.setActiveWeapon(%num); if(%num > $numVWeapons) %num = $numVWeapons; for(%i = 1; %i <= $numVWeapons; %i++) { %oldHilite = "vWeap" @ %i @ "Hilite"; %oldHilite.setVisible(false); } %newHilite = "vWeap" @ %num @ "Hilite"; %newHilite.setVisible(true); // set the bitmap and frame for the reticle reticleHud.setBitmap($vehicleReticle[%vType, %num, bitmap]); reticleFrameHud.setVisible($vehicleReticle[%vType, %num, frame]); } function GameConnection::setVWeaponsHudClearAll(%client) { commandToClient(%client, 'setVWeaponsHudClearAll'); } function clientCmdSetVWeaponsHudClearAll() { //vWeaponsBox.clearAll(); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- function GameConnection::setWeaponsHudBitmap(%client, %slot, %name, %bitmap) { commandToClient(%client, 'setWeaponsHudBitmap',%slot,%name,%bitmap); } //---------------------------------------------------------------------------- function clientCmdSetWeaponsHudBitmap(%slot, %name, %bitmap) { $WeaponNames[%slot] = %name; weaponsHud.setWeaponBitmap(%slot,%bitmap); } //---------------------------------------------------------------------------- function GameConnection::setWeaponsHudItem(%client, %name, %ammoAmount, %addItem) { //error("GC:SWHI name="@%name@",ammoAmount="@%ammoAmount@",addItem="@%addItem); // for(%i = 0; %i < $WeaponsHudCount; %i++) // if($WeaponsHudData[%i, itemDataName] $= %name) // { // if($WeaponsHudData[%i, ammoDataName] !$= "") { // %ammoInv = %client.player.inv[$WeaponsHudData[%i, ammoDataName]]; // //error(" ----- player has " @ %ammoInv SPC $WeaponsHudData[%i, ammoDataName]); // //error("SWHI:Setting weapon "@%name@" ("@%i@") ammo to " @ %ammoInv); // commandToClient(%client, 'setWeaponsHudItem',%i,%ammoInv, %addItem); // } // else { // //error("SWHI:Setting weapon "@%name@" ("@%i@") ammo to infinite"); // commandToClient(%client, 'setWeaponsHudItem',%i,-1, %addItem); // } // break; // } // My try... for(%i = 0; %i < $WeaponsHudCount; %i++) if($WeaponsHudData[%i, itemDataName] $= %name) { if($WeaponsHudData[%i, ammoDataName] !$= "") { %ammoInv = %client.player.inv[$WeaponsHudData[%i, ammoDataName]]; //error(" ----- player has " @ %ammoInv SPC $WeaponsHudData[%i, ammoDataName]); //error("SWHI:Setting weapon "@%name@" ("@%i@") ammo to " @ %ammoInv); commandToClient(%client, 'setWeaponsHudItem',%i,%ammoInv, %addItem); } else { //error("SWHI:Setting weapon "@%name@" ("@%i@") ammo to infinite"); commandToClient(%client, 'setWeaponsHudItem',%i,-1, %addItem); } break; } } //---------------------------------------------------------------------------- function clientCmdSetWeaponsHudItem(%slot, %ammoAmount, %addItem) { if(%addItem) { //error("adding weapon to hud in slot " @ %slot @ " with ammo " @ %ammoAmount); weaponsHud.addWeapon(%slot, %ammoAmount); } else { //error("removing weapon from hud"); weaponsHud.removeWeapon(%slot); } } //---------------------------------------------------------------------------- function GameConnection::setWeaponsHudAmmo(%client, %name, %ammoAmount) { for(%i = 0; %i < $WeaponsHudCount; %i++) if($WeaponsHudData[%i, ammoDataName] $= %name) { //error("SWHA:Setting ammo "@%name@" for weapon "@%i@" to " @ %ammoAmount); commandToClient(%client, 'setWeaponsHudAmmo',%i, %ammoAmount); break; } } //---------------------------------------------------------------------------- function clientCmdSetWeaponsHudAmmo(%slot, %ammoAmount) { weaponsHud.setAmmo(%slot, %ammoAmount); } //---------------------------------------------------------------------------- // z0dd - ZOD, 9/13/02. Serverside reticles, sever tells client what file to use. function GameConnection::setWeaponsHudActive(%client, %name, %clearActive) { if(%clearActive) { commandToClient(%client, 'setWeaponsHudActive', -1); } else { for(%i = 0; %i < $WeaponsHudCount; %i++) { if($WeaponsHudData[%i, itemDataName] $= %name) { commandToClient(%client, 'setWeaponsHudActive', %i, $WeaponsHudData[%i, reticle], $WeaponsHudData[%i, visible]); break; } } } } //---------------------------------------------------------------------------- // z0dd- ZOD, 9/13/02. Serverside reticles, sever tells client what file to use. function clientCmdSetWeaponsHudActive(%slot, %ret, %vis) { // z0dd - ZOD, 9/30/02. Changed for lazy scripter backward compatibility. weaponsHud.setActiveWeapon(%slot); switch$($WeaponNames[%slot]) { case "Blaster": reticleHud.setBitmap("gui/ret_blaster"); reticleFrameHud.setVisible(true); case "Plasma": reticleHud.setBitmap("gui/ret_plasma"); reticleFrameHud.setVisible(true); case "Chaingun": reticleHud.setBitmap("gui/ret_chaingun"); reticleFrameHud.setVisible(true); case "Disc": reticleHud.setBitmap("gui/ret_disc"); reticleFrameHud.setVisible(true); case "GrenadeLauncher": reticleHud.setBitmap("gui/ret_grenade"); reticleFrameHud.setVisible(true); case "SniperRifle": reticleHud.setBitmap("gui/hud_ret_sniper"); reticleFrameHud.setVisible(false); case "ELFGun": reticleHud.setBitmap("gui/ret_elf"); reticleFrameHud.setVisible(true); case "Mortar": reticleHud.setBitmap("gui/ret_mortor"); reticleFrameHud.setVisible(true); case "MissileLauncher": reticleHud.setBitmap("gui/ret_missile"); reticleFrameHud.setVisible(true); case "ShockLance": reticleHud.setBitmap("gui/hud_ret_shocklance"); reticleFrameHud.setVisible(false); case "TargetingLaser": reticleHud.setBitmap("gui/hud_ret_targlaser"); reticleFrameHud.setVisible(false); case "TR2Disc": reticleHud.setBitmap("gui/ret_disc"); reticleFrameHud.setVisible(true); case "TR2GrenadeLauncher": reticleHud.setBitmap("gui/ret_grenade"); reticleFrameHud.setVisible(true); case "TR2Chaingun": reticleHud.setBitmap("gui/ret_chaingun"); reticleFrameHud.setVisible(true); case "TR2Mortar": reticleHud.setBitmap("gui/ret_mortor"); reticleFrameHud.setVisible(true); case "TR2Shocklance": reticleHud.setBitmap("gui/hud_ret_shocklance"); reticleFrameHud.setVisible(false); case "TR2GoldTargetingLaser": reticleHud.setBitmap("gui/hud_ret_targlaser"); reticleFrameHud.setVisible(false); case "TR2SilverTargetingLaser": reticleHud.setBitmap("gui/hud_ret_targlaser"); reticleFrameHud.setVisible(false); default: reticleHud.setBitmap(%ret); reticleFrameHud.setVisible(%vis); } } function clientCmdSetRepairReticle() { reticleHud.setBitmap("gui/ret_chaingun"); reticleFrameHud.setVisible(true); } //---------------------------------------------------------------------------- function GameConnection::setWeaponsHudBackGroundBmp(%client, %name) { commandToClient(%client, 'setWeaponsHudBackGroundBmp',%name); } //---------------------------------------------------------------------------- function clientCmdSetWeaponsHudBackGroundBmp(%name) { weaponsHud.setBackGroundBitmap(%name); } //---------------------------------------------------------------------------- function GameConnection::setWeaponsHudHighLightBmp(%client, %name) { commandToClient(%client, 'setWeaponsHudHighLightBmp',%name); } //---------------------------------------------------------------------------- function clientCmdSetWeaponsHudHighLightBmp(%name) { weaponsHud.setHighLightBitmap(%name); } //---------------------------------------------------------------------------- function GameConnection::setWeaponsHudInfiniteAmmoBmp(%client, %name) { commandToClient(%client, 'setWeaponsHudInfiniteAmmoBmp',%name); } //---------------------------------------------------------------------------- function clientCmdSetWeaponsHudInfiniteAmmoBmp(%name) { weaponsHud.setInfiniteAmmoBitmap(%name); } //---------------------------------------------------------------------------- function GameConnection::setWeaponsHudClearAll(%client) { commandToClient(%client, 'setWeaponsHudClearAll'); } //---------------------------------------------------------------------------- function clientCmdSetWeaponsHudClearAll() { weaponsHud.clearAll(); } //---------------------------------------------------------------------------- // Ammo Hud //---------------------------------------------------------------------------- function GameConnection::setAmmoHudCount(%client, %amount) { commandToClient(%client, 'setAmmoHudCount', %amount); } //---------------------------------------------------------------------------- function clientCmdSetAmmoHudCount(%amount) { if(%amount == -1) ammoHud.setValue(""); else ammoHud.setValue(%amount); } //---------------------------------------------------------------------------- // Backpack Hud //---------------------------------------------------------------------------- $BackpackHudData[0, itemDataName] = "AmmoPack"; $BackpackHudData[0, bitmapName] = "gui/hud_new_packammo"; $BackpackHudData[1, itemDataName] = "CloakingPack"; $BackpackHudData[1, bitmapName] = "gui/hud_new_packcloak"; $BackpackHudData[2, itemDataName] = "EnergyPack"; $BackpackHudData[2, bitmapName] = "gui/hud_new_packenergy"; $BackpackHudData[3, itemDataName] = "RepairPack"; $BackpackHudData[3, bitmapName] = "gui/hud_new_packrepair"; $BackpackHudData[4, itemDataName] = "SatchelCharge"; $BackpackHudData[4, bitmapName] = "gui/hud_new_packsatchel"; $BackpackHudData[5, itemDataName] = "ShieldPack"; $BackpackHudData[5, bitmapName] = "gui/hud_new_packshield"; $BackpackHudData[6, itemDataName] = "InventoryDeployable"; $BackpackHudData[6, bitmapName] = "gui/hud_new_packinventory"; $BackpackHudData[7, itemDataName] = "MotionSensorDeployable"; $BackpackHudData[7, bitmapName] = "gui/hud_new_packmotionsens"; $BackpackHudData[8, itemDataName] = "PulseSensorDeployable"; $BackpackHudData[8, bitmapName] = "gui/hud_new_packradar"; $BackpackHudData[9, itemDataName] = "TurretOutdoorDeployable"; $BackpackHudData[9, bitmapName] = "gui/hud_new_packturretout"; $BackpackHudData[10, itemDataName] = "TurretIndoorDeployable"; $BackpackHudData[10, bitmapName] = "gui/hud_new_packturretin"; $BackpackHudData[11, itemDataName] = "SensorJammerPack"; $BackpackHudData[11, bitmapName] = "gui/hud_new_packsensjam"; $BackpackHudData[12, itemDataName] = "AABarrelPack"; $BackpackHudData[12, bitmapName] = "gui/hud_new_packturret"; $BackpackHudData[13, itemDataName] = "FusionBarrelPack"; $BackpackHudData[13, bitmapName] = "gui/hud_new_packturret"; $BackpackHudData[14, itemDataName] = "MissileBarrelPack"; $BackpackHudData[14, bitmapName] = "gui/hud_new_packturret"; $BackpackHudData[15, itemDataName] = "PlasmaBarrelPack"; $BackpackHudData[15, bitmapName] = "gui/hud_new_packturret"; $BackpackHudData[16, itemDataName] = "ELFBarrelPack"; $BackpackHudData[16, bitmapName] = "gui/hud_new_packturret"; $BackpackHudData[17, itemDataName] = "MortarBarrelPack"; $BackpackHudData[17, bitmapName] = "gui/hud_new_packturret"; $BackpackHudData[18, itemDataName] = "SatchelUnarmed"; $BackpackHudData[18, bitmapName] = "gui/hud_satchel_unarmed"; // TR2 $BackpackHudData[19, itemDataName] = "TR2EnergyPack"; $BackpackHudData[19, bitmapName] = "gui/hud_new_packenergy"; $BackpackHudCount = 20; function GameConnection::clearBackpackIcon(%client) { commandToClient(%client, 'setBackpackHudItem', 0, 0); } function GameConnection::setBackpackHudItem(%client, %name, %addItem) { for(%i = 0; %i < $BackpackHudCount; %i++) if($BackpackHudData[%i, itemDataName] $= %name) commandToClient(%client, 'setBackpackHudItem', %i, %addItem); } function clientCmdSetBackpackHudItem(%num, %addItem) { if(%addItem) { backpackIcon.setBitmap($BackpackHudData[%num, bitmapName]); backpackFrame.setVisible(true); backpackIcon.setVisible(true); backpackFrame.pack = true; } else { backpackIcon.setBitmap(""); backpackFrame.setVisible(false); backpackText.setValue(""); backpackText.setVisible(false); backpackFrame.pack = false; } } function GameConnection::updateSensorPackText(%client, %num) { commandToClient(%client, 'updatePackText', %num); } function clientCmdUpdatePackText(%num) { backpackText.setValue(%num); if(%num == 0) backpackText.setVisible(false); else backpackText.setVisible(true); } // Pack Icons Activate / Deactivate function clientCmdSetSatchelArmed() { backpackIcon.setBitmap( "gui/hud_satchel_armed" ); } function clientCmdsetCloakIconOn() { backpackIcon.setBitmap( "gui/hud_new_packcloak_armed" ); } function clientCmdsetCloakIconOff() { backpackIcon.setBitmap( "gui/hud_new_packcloak" ); } function clientCmdsetRepairPackIconOn() { backpackIcon.setBitmap( "gui/hud_new_packrepair_armed" ); } function clientCmdsetRepairPackIconOff() { backpackIcon.setBitmap( "gui/hud_new_packrepair" ); } function clientCmdsetShieldIconOn() { backpackIcon.setBitmap( "gui/hud_new_packshield_armed" ); } function clientCmdsetShieldIconOff() { backpackIcon.setBitmap( "gui/hud_new_packshield" ); } function clientCmdsetSenJamIconOn() { backpackIcon.setBitmap( "gui/hud_new_packsensjam_armed" ); } function clientCmdsetSenJamIconOff() { backpackIcon.setBitmap( "gui/hud_new_packsensjam" ); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- $InventoryHudData[0, bitmapName] = "gui/hud_handgren"; $InventoryHudData[0, itemDataName] = Grenade; $InventoryHudData[0, ammoDataName] = Grenade; $InventoryHudData[0, slot] = 0; $InventoryHudData[1, bitmapName] = "gui/hud_mine"; $InventoryHudData[1, itemDataName] = Mine; $InventoryHudData[1, ammoDataName] = Mine; $InventoryHudData[1, slot] = 1; $InventoryHudData[2, bitmapName] = "gui/hud_medpack"; $InventoryHudData[2, itemDataName] = RepairKit; $InventoryHudData[2, ammoDataName] = RepairKit; $InventoryHudData[2, slot] = 3; $InventoryHudData[3, bitmapName] = "gui/hud_whiteout_gren"; $InventoryHudData[3, itemDataName] = FlashGrenade; $InventoryHudData[3, ammoDataName] = FlashGrenade; $InventoryHudData[3, slot] = 0; $InventoryHudData[4, bitmapName] = "gui/hud_concuss_gren"; $InventoryHudData[4, itemDataName] = ConcussionGrenade; $InventoryHudData[4, ammoDataName] = ConcussionGrenade; $InventoryHudData[4, slot] = 0; $InventoryHudData[5, bitmapName] = "gui/hud_handgren"; $InventoryHudData[5, itemDataName] = FlareGrenade; $InventoryHudData[5, ammoDataName] = FlareGrenade; $InventoryHudData[5, slot] = 0; $InventoryHudData[6, bitmapName] = "gui/hud_handgren"; $InventoryHudData[6, itemDataName] = CameraGrenade; $InventoryHudData[6, ammoDataName] = CameraGrenade; $InventoryHudData[6, slot] = 0; $InventoryHudData[7, bitmapName] = "gui/hud_beacon"; $InventoryHudData[7, itemDataName] = Beacon; $InventoryHudData[7, ammoDataName] = Beacon; $InventoryHudData[7, slot] = 2; // TR2 $InventoryHudData[8, bitmapName] = "gui/hud_handgren"; $InventoryHudData[8, itemDataName] = TR2Grenade; $InventoryHudData[8, ammoDataName] = TR2Grenade; $InventoryHudData[8, slot] = 0; $InventoryHudCount = 9; //---------------------------------------------------------------------------- // Inventory Hud //---------------------------------------------------------------------------- //------------------------------------------------------------------------- --- function GameConnection::setInventoryHudBitmap(%client, %slot, %name, %bitmap) { commandToClient(%client, 'setInventoryHudBitmap',%slot,%name,%bitmap); } //---------------------------------------------------------------------------- function clientCmdSetInventoryHudBitmap(%slot, %name, %bitmap) { inventoryHud.setInventoryBitmap(%slot,%bitmap); } //---------------------------------------------------------------------------- function GameConnection::setInventoryHudItem(%client, %name, %amount, %addItem) { for(%i = 0; %i < $InventoryHudCount; %i++) if($InventoryHudData[%i, itemDataName] $= %name) { if($InventoryHudData[%i, ammoDataName] !$= "") commandToClient(%client, 'setInventoryHudItem',$InventoryHudData[%i, slot],%amount, %addItem); else commandToClient(%client, 'setInventoryHudItem',$InventoryHudData[%i, slot],-1, %addItem); break; } } //---------------------------------------------------------------------------- function clientCmdSetInventoryHudItem(%slot, %amount, %addItem) { if(%addItem) inventoryHud.addInventory(%slot, %amount); else inventoryHud.removeInventory(%slot); } //---------------------------------------------------------------------------- function GameConnection::setInventoryHudAmount(%client, %name, %amount) { for(%i = 0; %i < $InventoryHudCount; %i++) if($InventoryHudData[%i, ammoDataName] $= %name) { commandToClient(%client, 'setInventoryHudAmount',$InventoryHudData[%i, slot], %amount); break; } } //---------------------------------------------------------------------------- function clientCmdSetInventoryHudAmount(%slot, %amount) { inventoryHud.setAmount(%slot, %amount); } //---------------------------------------------------------------------------- function GameConnection::setInventoryHudBackGroundBmp(%client, %name) { commandToClient(%client, 'setInventoryHudBackGroundBmp',%name); } //---------------------------------------------------------------------------- function clientCmdSetInventoryHudBackGroundBmp(%name) { inventoryHud.setBackGroundBitmap(%name); } //---------------------------------------------------------------------------- function GameConnection::setInventoryHudClearAll(%client) { commandToClient(%client, 'setInventoryHudClearAll'); } //---------------------------------------------------------------------------- function clientCmdSetInventoryHudClearAll() { inventoryHud.clearAll(); backpackIcon.setBitmap( "" ); backpackFrame.setVisible( false ); backpackText.setValue( "" ); backpackText.setVisible(false); backpackFrame.pack = false; } //---------------------------------------------------------------------------- // MessageHud function MessageHud::open(%this) { %offset = 6; if(%this.isVisible()) return; if(%this.isTeamMsg) %text = "TEAM:"; else %text = "GLOBAL:"; MessageHud_Text.setValue(%text); %windowPos = "8 " @ ( getWord( outerChatHud.position, 1 ) + getWord( outerChatHud.extent, 1 ) + 1 ); %windowExt = getWord( OuterChatHud.extent, 0 ) @ " " @ getWord( MessageHud_Frame.extent, 1 ); if( MainVoteHud.isVisible() ) { %votePos = firstWord( MainVoteHud.position ) @ " " @ ( getWord( OuterChatHud.extent, 1 ) + getWord( messageHud_Frame.extent, 1 ) + 10 ); MainVoteHud.position = %votePos; } if( voiceCommHud.isVisible() ) { %vCommPos = firstWord( voiceCommHud.position ) SPC ( getWord( OuterChatHud.extent, 1 ) + getWord( messageHud_Frame.extent, 1 ) + 18 ); voiceCommHud.position = %vCommPos; } %textExtent = getWord(MessageHud_Text.extent, 0); %ctrlExtent = getWord(MessageHud_Frame.extent, 0); Canvas.pushDialog(%this); messageHud_Frame.position = %windowPos; messageHud_Frame.extent = %windowExt; MessageHud_Edit.position = setWord(MessageHud_Edit.position, 0, %textExtent + %offset); MessageHud_Edit.extent = setWord(MessageHud_Edit.extent, 0, %ctrlExtent - %textExtent - (2 * %offset)); %this.setVisible(true); deactivateKeyboard(); MessageHud_Edit.makeFirstResponder(true); } //------------------------------------------------------------------------------ function MessageHud::close(%this) { if(!%this.isVisible()) return; // readjust vote hud if open if( MainVoteHud.isVisible() ) { %tempY = getWord(outerChatHud.position, 1) + getWord(outerChatHud.extent, 1) + 2; %mainVoteX = firstWord(mainVoteHud.position); %voteHudPos = %mainVoteX SPC %tempY; mainVoteHud.position = %voteHudPos; } // put voice comm hud back where it was (if it moved) %vTempY = getWord(outerChatHud.position, 1) + getWord(outerChatHud.extent, 1) + 12; %mainCommX = firstWord(voiceCommHud.position); %commHudPos = %mainCommX SPC %vTempY; voiceCommHud.position = %commHudPos; Canvas.popDialog(%this); %this.setVisible(false); if ( $enableDirectInput ) activateKeyboard(); MessageHud_Edit.setValue(""); } //------------------------------------------------------------------------------ function MessageHud::toggleState(%this) { if(%this.isVisible()) %this.close(); else %this.open(); } //------------------------------------------------------------------------------ function MessageHud_Edit::onEscape(%this) { MessageHud.close(); } //------------------------------------------------------------------------------ function MessageHud_Edit::eval(%this) { %text = trim(%this.getValue()); if(%text !$= "") { if(MessageHud.isTeamMsg) commandToServer('teamMessageSent', %text); else commandToServer('messageSent', %text); } MessageHud.close(); } //------------------------------------------------------------------------------ // main chat hud function MainChatHud::onWake( %this ) { // set the chat hud to the users pref %this.setChatHudLength( $Pref::ChatHudLength ); } // chat hud sizes $outerChatLenY[1] = 72; $outerChatLenY[2] = 140; $outerChatLenY[3] = 200; // size for scroll $chatScrollLenY[1] = 64; $chatScrollLenY[2] = 128; $chatScrollLenY[3] = 192; //------------------------------------------------------------------------------ function MainChatHud::setChatHudLength( %this, %length ) { %outerChatLenX = firstWord(outerChatHud.extent); %chatScrollLenX = firstWord(chatScrollHud.extent); %OCHextent = %outerChatLenX SPC $outerChatLenY[%length]; %CSHextent = %chatScrollLenX SPC $chatScrollLenY[%length]; outerChatHud.extent = %OCHextent; chatScrollHud.extent = %CSHextent; %totalLines = HudMessageVector.getNumLines(); %posLines = %length * 4; %linesOver = ( %totalLines - %posLines ) * 14; ChatPageDown.position = ( firstWord( outerChatHud.extent ) - 20 ) @ " " @ ( $chatScrollLenY[%length] - 6 ); if( ( %linesOver > 0 ) && !%sizeIncrease ) { %linesOver = %totalLines - %posLines; %posAdjust = %linesOver * ChatHud.profile.fontSize + 3; %newPos = "0" @ " " @ ( -1 * %posAdjust ); ChatHud.position = %newPos; } else if( %sizeIncrease && ( %linesOver > 0 ) ) { %curPos = getWord( ChatHud.position, 1 ); %newY = %curPos + ( 4 * 14 ); %newPos = "0 " @ %newY; ChatHud.position = %newPos; } else if( %linesOver <= 0 ) { ChatHud.position = "0 0"; } // adjust votehud and voicecommhud to be just beneath chathud %tempY = getWord(outerChatHud.position, 1) + getWord(outerChatHud.extent, 1) + 2; %vTempY = %tempY + 10; %mainVoteX = firstWord(mainVoteHud.position); %vCommX = firstWord(voiceCommHud.position); %voteHudPos = %mainVoteX SPC %tempY; %vCommPos = %vCommX SPC %vTempY; mainVoteHud.position = %voteHudPos; voiceCommHud.position = %vCommPos; ChatHud.resize(firstWord(ChatHud.position), getWord(ChatHud.position, 1), firstWord(ChatHud.extent), getWord(ChatHud.extent, 1)); } //------------------------------------------------------------------------------ function MainChatHud::nextChatHudLen( %this ) { $pref::chatHudLength++; if($pref::chatHudLength == 4) { $pref::chatHudLength = 1; %sizeIncrease = false; ChatPageDown.position = ( firstWord( outerChatHud.extent ) - 20 ) @ " 50"; } else %sizeIncrease = true; %outerChatLenX = firstWord(outerChatHud.extent); %chatScrollLenX = firstWord(chatScrollHud.extent); %OCHextent = %outerChatLenX SPC $outerChatLenY[$pref::chatHudLength]; %CSHextent = %chatScrollLenX SPC $chatScrollLenY[$pref::chatHudLength]; outerChatHud.extent = %OCHextent; chatScrollHud.extent = %CSHextent; %totalLines = HudMessageVector.getNumLines(); %posLines = $pref::chatHudLength * 4; %linesOver = %totalLines - %posLines; ChatPageDown.position = ( firstWord( outerChatHud.extent ) - 20 ) @ " " @ ( $chatScrollLenY[$pref::chatHudLength] - 6 ); if( ( %linesOver > 0 ) && !%sizeIncrease ) { %linesOver = %totalLines - %posLines; %posAdjust = %linesOver * $ShellFontSize; %newPos = "0" @ " " @ ( -1 * %posAdjust ); ChatHud.position = %newPos; } else if( %sizeIncrease && ( %linesOver > 0 ) ) { %curPos = getWord( ChatHud.position, 1 ); %newY = %curPos + ( 4 * $ShellFontSize ); %newPos = "0 " @ %newY; ChatHud.position = %newPos; } else if( %linesOver <= 0 ) { ChatHud.position = "0 0"; } // adjust votehud to be just beneath chathud %tempY = getWord(outerChatHud.position, 1) + getWord(outerChatHud.extent, 1) + 2; %vTempY = %tempY + 10; %mainVoteX = firstWord(mainVoteHud.position); %vCommX = firstWord(voiceCommHud.position); %voteHudPos = %mainVoteX SPC %tempY; %vCommPos = %vCommX SPC %vTempY; mainVoteHud.position = %voteHudPos; voiceCommHud.position = %vCommPos; ChatHud.resize(firstWord(ChatHud.position), getWord(ChatHud.position, 1), firstWord(ChatHud.extent), getWord(ChatHud.extent, 1)); } //---------------------------------------------------------------------------- // MessageHud key handlers function ToggleMessageHud(%make) { if(%make) { MessageHud.isTeamMsg = false; MessageHud.toggleState(); } } //------------------------------------------------------------------------------ function TeamMessageHud(%make) { if(%make) { MessageHud.isTeamMsg = true; MessageHud.toggleState(); } } //---------------------------------------------------------------------------- // MessageHud message handlers function serverCmdTeamMessageSent(%client, %text) { if(strlen(%text) >= $Host::MaxMessageLen) %text = getSubStr(%text, 0, $Host::MaxMessageLen); chatMessageTeam(%client, %client.team, '\c3%1: %2', %client.name, %text); } //------------------------------------------------------------------------------ function serverCmdMessageSent(%client, %text) { if(strlen(%text) >= $Host::MaxMessageLen) %text = getSubStr(%text, 0, $Host::MaxMessageLen); chatMessageAll(%client, '\c4%1: %2', %client.name, %text); } //-------------------------------------------------------------------------- function toggleHuds(%tag) { if($Hud[%tag] && $Hud[%tag].pushed) hideHud(%tag); else showHud(%tag); } //------------------------------------------------------------------------------ //modes are standard, pilot, passenger, object, observer $HudMode = "Observer"; $HudModeType = "HoverBike"; $HudModeNode = 0; function ClientCmdSetHudMode(%mode, %type, %node) { $HudMode = detag(%mode); $HudModeType = detag(%type); $HudModeNode = %node; clientCmdDisplayHuds(); } //------------------------------------------------------------------------------ $ControlObjectReticle[AABarrelLarge, bitmap] = "ret_chaingun"; $ControlObjectReticle[AABarrelLarge, frame] = true; $ControlObjectReticle[ELFBarrelLarge, bitmap] = "ret_elf"; $ControlObjectReticle[ELFBarrelLarge, frame] = true; $ControlObjectReticle[DeployableIndoorBarrel, bitmap] = "ret_blaster"; $ControlObjectReticle[DeployableIndoorBarrel, frame] = true; $ControlObjectReticle[MissileBarrelLarge, bitmap] = "ret_missile"; $ControlObjectReticle[MissileBarrelLarge, frame] = true; $ControlObjectReticle[MortarBarrelLarge, bitmap] = "ret_mortor"; // mortor? hahaha $ControlObjectReticle[MortarBarrelLarge, frame] = true; $ControlObjectReticle[DeployableOutdoorBarrel, bitmap] = "ret_blaster"; $ControlObjectReticle[DeployableOutdoorBarrel, frame] = true; $ControlObjectReticle[PlasmaBarrelLarge, bitmap] = "ret_plasma"; $ControlObjectReticle[PlasmaBarrelLarge, frame] = true; $ControlObjectReticle[SentryTurretBarrel, bitmap] = "ret_blaster"; $ControlObjectReticle[SentryTurretBarrel, frame] = true; function setControlObjectReticle(%type) { if($ControlObjectReticle[%type, bitmap] !$= "") { reticleHud.setBitmap("gui/" @ $ControlObjectReticle[%type, bitmap]); reticleFrameHud.setVisible($ControlObjectReticle[%type, frame]); retCenterHud.setVisible(true); } else retCenterHud.setVisible(false); } function updateActionMaps() { //pop the action maps... if ( isObject( moveMap ) ) moveMap.pop(); if ( isObject( passengerKeys ) ) passengerKeys.pop(); if ( isObject( observerBlockMap ) ) observerBlockMap.pop(); if ( isObject( observerMap ) ) observerMap.pop(); if ( isObject( pickTeamMap ) ) pickTeamMap.pop(); if ( isObject( halftimeMap ) ) halftimeMap.delete(); //if (isObject(flyingCameraMove)) // flyingCameraMove.pop(); if (isObject(ControlActionMap)) ControlActionMap.pop(); // push the proper map switch$ ($HudMode) { case "Pilot": passengerKeys.push(); case "Passenger": moveMap.push(); case "Object": moveMap.push(); ControlActionMap.push(); case "Observer": moveMap.push(); if ( isObject( observerBlockMap ) ) observerBlockMap.delete(); // Create an action map just to block unwanted parts of the move map: new ActionMap( observerBlockMap ); observerBlockMap.blockBind( moveMap, jump ); observerBlockMap.blockBind( moveMap, mouseFire ); observerBlockMap.blockBind( moveMap, mouseJet ); observerBlockMap.blockBind( moveMap, toggleZoom ); observerBlockMap.blockBind( moveMap, setZoomFOV ); observerBlockMap.push(); observerMap.push(); // Make sure that "Spawn" is bound: if ( observerMap.getBinding( mouseFire ) $= "" ) observerMap.copyBind( moveMap, mouseFire ); case "PickTeam": //////////////////////// // pickTeam Keys ////////////////////// if( !isObject( pickTeamMap ) ) new ActionMap( pickTeamMap ); pickTeamMap.copyBind( moveMap, toggleMessageHud ); pickTeamMap.push(); case "SiegeHalftime": new ActionMap( halftimeMap ); halftimeMap.bindCmd( keyboard, escape, "", "escapeFromGame();" ); halftimeMap.copyBind( moveMap, toggleMessageHud ); halftimeMap.copyBind( moveMap, teamMessageHud ); halftimeMap.copyBind( moveMap, activateChatMenuHud ); halftimeMap.copyBind( moveMap, resizeChatHud ); halftimeMap.copyBind( moveMap, pageMessageHudUp ); halftimeMap.copyBind( moveMap, pageMessageHudDown ); halftimeMap.copyBind( moveMap, voiceCapture ); halftimeMap.push(); //case 'Standard': default: moveMap.push(); } } //------------------------------------------------------------------------------ function ClientCmdDisplayHuds() { if ( $LaunchMode $= "InteriorView" ) return; // only update action maps if playGui is current content %content = Canvas.getContent(); %PlayGuiActive = isObject(%content) && ( %content.getName() $= "PlayGui" ); if ( %PlayGuiActive ) updateActionMaps(); ammoHud.setVisible(false); objectiveHud.setVisible(false); inventoryHud.setVisible(false); backpackFrame.setVisible(false); weaponsHud.setVisible(false); retCenterHud.setVisible(false); HudClusterBack.setVisible(false); outerChatHud.setVisible(false); clockHud.setVisible(false); controlObjectText.setVisible(false); siegeHalftimeHud.setVisible(false); clientCmdToggleDashHud(false); %hideCursor = true; switch$ ($HudMode) { case "Pilot": clientCmdShowVehicleGauges($HudModeType, $HudModeNode); clientCmdToggleDashHud(true); objectiveHud.setVisible(true); dashBoardHud.setposition(0, 0); retCenterHud.setVisible(true); HudClusterBack.setVisible(true); outerChatHud.setVisible(true); clockHud.setVisible(true); case "Passenger": clientCmdShowVehicleGauges($HudModeType, $HudModeNode); clientCmdToggleDashHud(true); objectiveHud.setVisible(true); dashBoardHud.setPosition(0, 0); ammoHud.setVisible(true); objectiveHud.setVisible(true); inventoryHud.setVisible(true); weaponsHud.setVisible(true); if(backpackFrame.pack) backpackFrame.setVisible(true); retCenterHud.setVisible(true); HudClusterBack.setVisible(true); outerChatHud.setVisible(true); clockHud.setVisible(true); case "Object": ammoHud.setVisible(true); HudClusterBack.setVisible(true); outerChatHud.setVisible(true); controlObjectText.setVisible(true); clockHud.setVisible(true); setControlObjectReticle($HudModeType); case "Observer": objectiveHud.setVisible(true); HudClusterBack.setVisible(true); outerChatHud.setVisible(true); clockHud.setVisible(true); case "SiegeHalftime": closeHud( "", "", 'scoreScreen' ); closeHud( "", "", 'inventoryScreen' ); closeHud( "", "", 'vehicleHud' ); objectiveHud.setVisible(true); outerChatHud.setVisible(true); siegeHalftimeHud.setVisible(true); %hideCursor = false; case "PickTeam": ammoHud.setVisible(false); objectiveHud.setVisible(false); inventoryHud.setVisible(false); backpackFrame.setVisible(false); weaponsHud.setVisible(false); retCenterHud.setVisible(false); HudClusterBack.setVisible(false); outerChatHud.setVisible(true); controlObjectText.setVisible(false); clockHud.setVisible(false); //case 'Standard': default: ammoHud.setVisible(true); objectiveHud.setVisible(true); inventoryHud.setVisible(true); weaponsHud.setVisible(true); if(backpackFrame.pack) backpackFrame.setVisible(true); retCenterHud.setVisible(true); HudClusterBack.setVisible(true); outerChatHud.setVisible(true); clockHud.setVisible(true); if(voteHud.voting) mainVoteHud.setVisible(1); else mainVoteHud.setVisible(0); } if ( PlayGui.hideCursor != %hideCursor ) { PlayGui.hideCursor = %hideCursor; if ( %PlayGuiActive ) Canvas.updateCursorState(); } } function dashboardHud::onResize(%this, %width, %height) { %currentWidth = getWord(dashboardHud.getPosition(), 0); %currentHeight = getWord(dashboardHud.getPosition(), 1); %screenWidth = getWord(getResolution(), 0); %screenHeight = getWord(getResolution(), 1); switch$ ($HudMode) { case "Pilot": if(%screenHeight <= 480) { if($HudModeNode == 0) { %xVal = 0; %yVal = 339; } else { %xVal = 0; %yVal = 320; } } else if(%screenHeight <= 600) { if($HudModeNode == 0) { %xVal = 80; %yVal = 455; } else { %xVal = 80; %yVal = 440; } } else { %xVal = (%screenWidth - 640) / 2; %yVal = (%screenheight - 480) + 360; } case "Passenger": %xVal = (%screenWidth - 640) / 2; %yVal = (%screenheight - 480) + 360; } if(%currentWidth != %xVal || %currentHeight != %yVal) dashBoardHud.setPosition(%xVal, %yVal); } function clientcmdTogglePlayHuds(%val) { ammoHud.setVisible(%val); objectiveHud.setVisible(%val); inventoryHud.setVisible(%val); if(backpackFrame.pack) backpackFrame.setVisible(%val); weaponsHud.setVisible(%val); retCenterHud.setVisible(%val); HudClusterBack.setVisible(%val); outerChatHud.setVisible(%val); clockHud.setVisible(%val); if(%val) { if(voteHud.voting) mainVoteHud.setVisible(1); } else mainVoteHud.setVisible(0); } //------------------------------------------------------------------------------ function toggleCursorHuds(%tag) { if($Hud[%tag] !$= "" && $Hud[%tag].pushed) { hideHud(%tag); clientCmdTogglePlayHuds(true); } else { showHud(%tag); clientCmdTogglePlayHuds(false); } } //------------------------------------------------------------------------------ function showHud(%tag) { commandToServer('ShowHud', %tag); } //------------------------------------------------------------------------------ function serverCmdShowHud(%client, %tag) { %tagName = getWord(%tag, 1); %tag = getWord(%tag, 0); messageClient(%client, 'OpenHud', "", %tag); switch$ (%tag) { case 'inventoryScreen': %client.numFavsCount = 0; inventoryScreen::updateHud(1,%client,%tag); case 'vehicleHud': vehicleHud::updateHud(1,%client,%tag); case 'scoreScreen': updateScoreHudThread(%client, %tag); } } //------------------------------------------------------------------------------ function updateScoreHudThread(%client, %tag) { Game.updateScoreHud(%client, %tag); cancel(%client.scoreHudThread); %client.scoreHudThread = schedule(3000, %client, "updateScoreHudThread", %client, %tag); } //------------------------------------------------------------------------------ function hideHud(%tag) { commandToServer('HideHud', %tag); } //------------------------------------------------------------------------------ function serverCmdHideHud(%client, %tag) { %tag = getWord(%tag, 0); messageClient(%client, 'CloseHud', "", %tag); switch$ (%tag) { case 'scoreScreen': cancel(%client.scoreHudThread); %client.scoreHudThread = ""; } } //------------------------------------------------------------------------------ addMessageCallback('OpenHud', openHud); addMessageCallback('CloseHud', closeHud); addMessageCallback('ClearHud', clearHud); addMessageCallback('SetLineHud', setLineHud); addMessageCallback('RemoveLineHud', removeLineHud); //------------------------------------------------------------------------------ function openHud(%msgType, %msgString, %tag) { // Vehicle hud can only be pushed on the PlayGui: if ( %tag $= 'vehicleHud' && Canvas.getContent() != PlayGui.getId() ) return; %tagName = getWord(%tag, 1); %tag = getWord(%tag, 0); if($Hud[%tag] $= "") { %tagName.loadHud(%tag); %tagName.setupHud(%tag); } Canvas.pushDialog($Hud[%tag]); $Hud[%tag].pushed = 1; } //------------------------------------------------------------------------------ function closeHud(%msgType, %msgString, %tag) { %tag = getWord(%tag, 0); if($Hud[%tag].pushed) { $Hud[%tag].setVisible(false); Canvas.popDialog($Hud[%tag]); $Hud[%tag].pushed = 0; } } //------------------------------------------------------------------------------ function clearHud(%msgType, %msgString, %tag, %a0) { %tag = getWord(%tag, 0); %startingLine = detag(%a0); while ($Hud[%tag].data[%startingLine, 0] !$= "") { for(%i = 0; %i < $Hud[%tag].numCol; %i++) { //remove and delete the hud line %obj = $Hud[%tag].data[%startingLine, %i]; $Hud[%tag].childGui.remove(%obj); $Hud[%tag].data[%startingLine, %i] = ""; %obj.delete(); } %startingLine++; } //don't forget to adjust the size accordingly... if (%tag $= 'scoreScreen') { %height = 0; %guiCtrl = $Hud[%tag].childGui; if(isObject(%guiCtrl)) { //set the new extent to be the position + extent of the last element... %height = 0; if (%guiCtrl.getCount() > 0) { %lastCtrl = %guiCtrl.getObject(%guiCtrl.getCount() - 1); %height = getWord(%lastCtrl.position, 1) + getWord(%lastCtrl.extent, 1); } //now reset the extent %guiCtrl.resize(getWord(%guiCtrl.position, 0), getWord(%guiCtrl.position, 1), getWord(%guiCtrl.extent, 0), %height); } } } //------------------------------------------------------------------------------ function removeLineHud(%msgType, %msgString, %hudName, %lineNumber, %a0, %a1, %a2, %a3) { %tag = getWord(%hudName, 0); %lineNum = detag(%lineNumber); if($Hud[%tag].data[%lineNum,0] !$= "") for(%i = 0; %i < $Hud[%tag].numCol; %i++) { $Hud[%tag].childGui.remove($Hud[%tag].data[%lineNum, %i]); $Hud[%tag].data[%lineNum, %i] = ""; } //don't forget to adjust the size accordingly... if (%tag $= 'scoreScreen') { %height = 0; %guiCtrl = $Hud[%tag].childGui; //set the new extent to be the position + extent of the last element... %height = 0; if (%guiCtrl.getCount() > 0) { %lastCtrl = %guiCtrl.getObject(%guiCtrl.getCount() - 1); %height = getWord(%lastCtrl.position, 1) + getWord(%lastCtrl.extent, 1); } //now reset the extent %guiCtrl.resize(getWord(%guiCtrl.position, 0), getWord(%guiCtrl.position, 1), getWord(%guiCtrl.extent, 0), %height); } } //------------------------------------------------------------------------------ function setLineHud(%msgType, %msgString, %hudName, %lineNumber, %a0, %a1, %a2, %a3, %a4) { %tag = getWord(%hudName, 0); %lineNum = detag(%lineNumber); if(!isObject($Hud[%tag].data[%lineNum, 0])) { $Hud[%tag].numCol = addLine(%tag, %lineNum, %a0, %a1, %a2, %a3); for(%i = 0; %i < $Hud[%tag].numCol; %i++) $Hud[%tag].childGui.add($Hud[%tag].data[%lineNum, %i]); } for(%i = 0; %i < $Hud[%tag].numCol; %i++) $Hud[%tag].data[%lineNum, %i].hudSetValue(detag(%a[%i]),detag(%a4)); //don't forget to adjust the size accordingly... if (%tag $= 'scoreScreen') { %height = 0; %guiCtrl = $Hud[%tag].childGui; //set the new extent to be the position + extent of the last element... %height = 0; if (%guiCtrl.getCount() > 0) { %lastCtrl = %guiCtrl.getObject(%guiCtrl.getCount() - 1); %height = getWord(%lastCtrl.position, 1) + getWord(%lastCtrl.extent, 1); } //now reset the extent %guiCtrl.resize(getWord(%guiCtrl.position, 0), getWord(%guiCtrl.position, 1), getWord(%guiCtrl.extent, 0), %height); } } //------------------------------------------------------------------------------ function GuiButtonCtrl::hudSetValue(%obj, %text) { %obj.setValue(%text); } //------------------------------------------------------------------------------ function GuiTextCtrl::hudSetValue(%obj, %text) { %obj.setValue(%text); } //------------------------------------------------------------------------------ function GuiMLTextCtrl::hudSetValue(%obj, %text) { %obj.setValue(%text); } //------------------------------------------------------------------------------ function GuiPopUpMenuCtrl::hudSetValue(%obj, %text, %textOverFlow) { if(%textOverFlow !$= "") %text = %text @ %textOverFlow; %obj.clear(); %value = getField(%text,0); %startVal = 1; if(%value $= "noSelect") { %obj.replaceText(false); %value = getField(%text,1); %startVal = 2; } else %obj.replaceText(true); %obj.setValue(%value); if(getFieldCount(%text) > 1) { %obj.setActive(true); for(%i = %startVal; %i < getFieldCount(%text); %i++) %obj.add(getField(%text, %i), %i); } else %obj.setActive(false); } //------------------------------------------------------------------------------ function ShellTabButton::hudSetValue( %obj, %text ) { %obj.setText( %text ); } //------------------------------------------------------------------------------ function addLine(%tag, %lineNum, %a0, %a1, %a2, %a3) { %colNum = 0; if(isObject($Hud[%tag])) %colNum = $Hud[%tag].addLine(%tag, %lineNum, detag(%a2), detag(%a3)); return %colNum; } //------------------------------------------------------------------------------ function INV_Menu::onSelect( %obj, %index, %text ) { %favList = $Hud['inventoryScreen'].data[0, 1].type TAB $Hud['inventoryScreen'].data[0, 1].getValue(); for ( %i = 1; %i < $Hud['inventoryScreen'].count; %i++ ) %favList = %favList TAB $Hud['inventoryScreen'].data[%i, 1].type TAB $Hud['inventoryScreen'].data[%i, 1].getValue(); commandToServer( 'setClientFav', %favList ); } //------------------------------------------------------------------------------ function INV_ListMenu::onSelect( %obj, %id, %text, %force ) { // Deselect the current tab ( because it was on the OLD list ): if ( InventoryScreen.selId !$= "" ) { $Hud['inventoryScreen'].staticData[0, InventoryScreen.selId].setValue( false ); InventoryScreen.selId = ""; } $pref::FavCurrentList = %id; %favListStart = %id * 10; // Select the currently selected favorite if it is now visible: %tab = $pref::FavCurrentSelect - ( $pref::FavCurrentList * 10 ) + 1; if ( %tab > 0 && %tab < 11 ) { InventoryScreen.selId = %tab; $Hud['inventoryScreen'].staticData[0, %tab].setValue( true ); } %obj.clear(); %obj.setValue( %text ); %count = 10; %list = 0; for ( %index = 0; $pref::FavNames[%index] !$= ""; %index++ ) { if ( %index >= %count - 1 ) { if ( %count != %favListStart + 10 ) %obj.add( "Favorites " @ %index - 8 @ " - " @ %index + 1, %list ); %count += 10; %list++; } } for ( %i = 0; %i < 10; %i++ ) { $Hud['inventoryScreen'].staticData[0, %i + 1].command = "InventoryScreen.onTabSelect(" @ %favListStart + %i @ ");"; $Hud['inventoryScreen'].staticData[0, %i + 1].setText( strupr( $pref::FavNames[%favListStart + %i] ) ); } } //------------------------------------------------------------------------------ function serverCmdSetClientFav(%client, %text) { if ( getWord( getField( %text, 0 ), 0 ) $= armor ) { %client.curFavList = %text; %validList = checkInventory( %client, %text ); %client.favorites[0] = getField( %text, 1 ); %armor = getArmorDatablock( %client, $NameToInv[getField( %validList,1 )] ); %weaponCount = 0; %packCount = 0; %grenadeCount = 0; %mineCount = 0; %count = 1; %client.weaponIndex = ""; %client.packIndex = ""; %client.grenadeIndex = ""; %client.mineIndex = ""; for(%i = 3; %i < getFieldCount(%validList); %i = %i + 2) { %setItem = false; switch$ (getField(%validList,%i-1)) { case weapon: if(%weaponCount < %armor.maxWeapons) { if(!%weaponCount) %client.weaponIndex = %count; else %client.weaponIndex = %client.weaponIndex TAB %count; %weaponCount++; %setItem = true; } case pack: if(%packCount < 1) { %client.packIndex = %count; %packCount++; %setItem = true; } case grenade: if(%grenadeCount < %armor.maxGrenades) { if(!%grenadeCount) %client.grenadeIndex = %count; else %client.grenadeIndex = %client.grenadeIndex TAB %count; %grenadeCount++; %setItem = true; } case mine: if(%mineCount < %armor.maxMines) { if(!%mineCount) %client.mineIndex = %count; else %client.mineIndex = %client.mineIndex TAB %count; %mineCount++; %setItem = true; } } if(%setItem) { %client.favorites[%count] = getField(%validList, %i); %count++; } } %client.numFavs = %count; %client.numFavsCount = 0; inventoryScreen::updateHud(1, %client, 'inventoryScreen'); } } //------------------------------------------------------------------------------ function getCenterPos(%tag) { %TerExtDivX = getWord(PlayGui.extent, 0) / 2; %TerExtDivY = getWord(PlayGui.extent, 1) / 2; %HudExtDivX = getWord($Hud[%tag].extent,0) / 2; %HudExtDivY = getWord($Hud[%tag].extent,1) / 2; %pos = %TerExtDivX - %HudExtDivX @ " " @ %TerExtDivY - %HudExtDivY; return %pos; } //------------------------------------------------------------------------------ function hideZoomHud() { ZoomHud.setVisible(false); ZoomHud.hideThread = 0; } function calcZoomFOV() { if($pref::player::currentFOV == $pref::player::defaultFov / 2) $pref::player::currentFOV = $pref::player::defaultFov / 5; else $pref::player::currentFOV = $pref::player::currentFOV / 2; if($pref::player::currentFOV < 4) $pref::player::currentFOV = $pref::player::defaultFov / 2; if(!$ZoomOn) { %pos = getZoomCenter($pref::player::defaultFov / $pref::player::currentFOV); %extent = getZoomExtent($pref::player::defaultFov / $pref::player::currentFOV); ZoomHud.resize(getWord(%pos, 0), getWord(%pos, 1), getWord(%extent, 0), getWord(%extent, 1)); if(ZoomHud.hideThread != 0) cancel(ZoomHud.hideThread); ZoomHud.hideThread = schedule(5000, 0, hideZoomHud); ZoomHud.setVisible(true); } else setFov( $pref::player::currentFOV ); } //------------------------------------------------------------------------------ function getZoomCenter(%power) { %power += (%power/4); %TerExtDivX = mFloor(getWord(PlayGui.extent, 0) / 2); %TerExtDivY = mFloor(getWord(PlayGui.extent, 1) / 2); %HudExtDivX = mFloor((getWord(PlayGui.extent, 0) / %power)/2); %HudExtDivY = mFloor((getWord(PlayGui.extent, 1) / %power)/2); %pos = %TerExtDivX - %HudExtDivX @ " " @ %TerExtDivY - %HudExtDivY; return %pos; } //------------------------------------------------------------------------------ function getZoomExtent(%power) { %power += (%power/4); %HudExtDivX = mFloor(getWord(PlayGui.extent, 0) / %power); %HudExtDivY = mFloor(getWord(PlayGui.extent, 1) / %power); %val = %HudExtDivX @ " " @ %HudExtDivY; return %val; } //------------------------------------------------------------------------------ function hideAllHuds() { objectiveHud.setVisible( false ); outerChatHud.setVisible( false ); energyHud.setVisible( false ); damageHud.setVisible( false ); sensorHudBack.setVisible( false ); controlObjectText.setVisible( false ); } //------------------------------------------------------------------------------ function restoreAllHuds() { objectiveHud.setVisible( true ); outerChatHud.setVisible( true ); energyHud.setVisible( true ); damageHud.setVisible( true ); sensorHudBack.setVisible( true ); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // voting hud stuff ///////////////////////////////////////////////// addMessageCallback('clearVoteHud', clearVoteHud); addMessageCallback('addYesVote', addYesVote); addMessageCallback('addNoVote', addNoVote); addMessageCallback('openVoteHud', openVoteHud); addMessageCallback('closeVoteHud', closeVoteHud); addMessageCallback('VoteStarted', initVote); //------------------------------------------------------------------------------ function initVote(%msgType, %msgString) { if(!$BottomPrintActive) { %yBind = strUpr(getField(moveMap.getBinding(voteYes), 1)); %nBind = strUpr(getField(moveMap.getBinding(voteNo), 1)); %message = detag(%msgString) @ "\nPress " @ %yBind @ " to vote YES or " @ %nBind @ " to vote NO."; clientCmdBottomPrint(%message, 10, 2); } } function openVoteHud(%msgType, %msgString, %numClients, %passPercent) { alxPlay(VoteInitiatedSound, 0, 0, 0); voteHud.voting = true; voteHud.totalVotes = 0; voteHud.size = %numClients; voteHud.quorum = (%numClients / 2); if(voteHud.quorum < 1) voteHud.quorum = 1; voteHud.pass = voteHud.quorum * %passPercent; voteHud.setPassValue(%passPercent); passHash.position = firstWord( mainVoteHud.extent) * %passPercent + 1 @ " -1"; if( MessageHud.isVisible() ) { %votePos = firstWord( MainVoteHud.position ) @ " " @ ( getWord( OuterChatHud.extent, 1 ) + getWord( messageHud_Frame.extent, 1 ) + 12 ); MainVoteHud.position = %votePos; } else { %tempY = getWord(outerChatHud.position, 1) + getWord(outerChatHud.extent, 1) + 2; %mainVoteX = firstWord(mainVoteHud.position); %voteHudPos = %mainVoteX SPC %tempY; mainVoteHud.position = %voteHudPos; } voteHud.setVisible(true); mainVoteHud.setVisible(true); } function stripBind(%string) { return getSubstr(%string, 9, 90); } //------------------------------------------------------------------------------ function CloseVoteHud(%msgType, %msgString) { voteHud.setVisible(false); mainVoteHud.setVisible(false); voteHud.yesCount = 0; voteHud.noCount = 0; voteHud.voting = false; } //------------------------------------------------------------------------------ function addYesVote(%msgType, %msgString) { voteHud.yesCount++; voteHud.totalVotes++; if(voteHud.isVisible()) { voteHud.setYesValue(voteHud.yesCount / voteHud.size); } } //------------------------------------------------------------------------------ function addNoVote(%msgType, %msgString) { voteHud.noCount++; voteHud.totalVotes++; if(voteHud.isVisible()) voteHud.setNoValue(voteHud.noCount / voteHud.size); } //------------------------------------------------------------------------------ function clearVoteHud(%msgType, %msgString) { voteHud.setYesValue(0.0); voteHud.setNoValue(0.0); } //------------------------------------------------------------------------------ function cleanUpHuds() { if($Hud['inventoryScreen'] !$= "") { for(%lineNum = 0; $Hud['inventoryScreen'].data[%lineNum, 0] !$= ""; %lineNum++) for(%i = 0; %i < $Hud['inventoryScreen'].numCol; %i++) { $Hud['inventoryScreen'].childGui.remove($Hud['inventoryScreen'].data[%lineNum, %i]); $Hud['inventoryScreen'].data[%lineNum, %i] = ""; } } } function displayObserverHud(%client, %targetClient, %potentialClient) { if (%targetClient > 0) bottomPrint(%client, "\nYou are now observing: " @ getTaggedString(%targetClient.name), 0, 3); else if (%potentialClient > 0) bottomPrint(%client, "\nObserver Fly Mode\n" @ getTaggedString(%potentialClient.name), 0, 3); else bottomPrint(%client, "\nObserver Fly Mode", 0, 3); } function hudFirstPersonToggled() { ammoHud.setVisible($firstPerson); } $testCount = 0; function testChatHud() { $testCount++; messageAll( '', "This is test number " @ $testCount ); $tester = schedule( 50, 0, "testChatHud"); } //------------------------------------------------------------------------- function HudNetDisplay::getPrefs(%this) { for(%i = 0; %i < 6; %i++) %this.renderField[%i] = ($pref::Net::graphFields >> %i) & 1; } function NetBarHud::infoUpdate(%this, %ping, %packetLoss, %sendPackets, %sendBytes, %receivePackets, %receiveBytes) { NetBarHudPingText.setText(mFormatFloat(%ping, "%4.0f") @ "ms"); NetBarHudPacketLossText.setText(mFormatFloat(%packetLoss, "%3.0f") @ "%"); NetBarHudSendBar.value = %sendPackets / $pref::Net::PacketRateToServer; NetBarHudReceiveBar.value = %receivePackets / $pref::Net::PacketRateToClient; } PK !(DbGGscripts/icePropMap.cs//-------------------------------------- Desert interior texture property mapping addMaterialMapping("ice/sw_ichute01", "environment: special/chuteTexture 0.25"); addMaterialMapping("ice/sw_ichute02", "environment: special/chuteTexture 0.25"); //"Color: red green blue startAlpha endAlpha" //Soft sound = 0 //Hard sound = 1 //Metal sound = 2 //Snow sound = 3 addMaterialMapping("terrain/IceWorld.Ice", "color: 0.9 0.9 0.9 0.4 0.0", "sound: 3"); addMaterialMapping("terrain/IceWorld.RockBlue", "color: 0.9 0.9 0.9 0.4 0.0", "sound: 3"); addMaterialMapping("terrain/IceWorld.Snow", "color: 0.9 0.9 0.9 0.4 0.0", "sound: 3"); addMaterialMapping("terrain/IceWorld.SnowIce", "color: 0.9 0.9 0.9 0.4 0.0", "sound: 3"); addMaterialMapping("terrain/IceWorld.SnowRock", "color: 0.9 0.9 0.9 0.4 0.0", "sound: 3"); PK ^>-F;;scripts/inventory.cs//---------------------------------------------------------------------------- // Item Datablocks // image = Name of mounted image datablock // onUse(%this,%object) // Item Image Datablocks // item = Name of item inventory datablock // ShapeBase Datablocks // max[Item] = Maximum amount that can be caried // ShapeBase Objects // inv[Item] = Count of item in inventory //---------------------------------------------------------------------------- $TestCheats = 0; function serverCmdUse(%client,%data) { // Item names from the client must converted // into DataBlocks // %data = ItemDataBlock[%item]; %client.getControlObject().use(%data); } function serverCmdThrow(%client,%data) { // Item names from the client must converted // into DataBlocks // %data = ItemDataBlock[%item]; %client.getControlObject().throw(%data); } function serverCmdThrowWeapon(%client,%data) { // Item names from the client must converted // into DataBlocks // %data = ItemDataBlock[%item]; %client.getControlObject().throwWeapon(); } function serverCmdThrowPack(%client,%data) { %client.getControlObject().throwPack(); } function serverCmdTogglePack(%client,%data) { // this function is apparently never called %client.getControlObject().togglePack(); } function serverCmdThrowFlag(%client) { //Game.playerDroppedFlag(%client.player); Game.dropFlag(%client.player); } function serverCmdSelectWeaponSlot( %client, %data ) { %client.getControlObject().selectWeaponSlot( %data ); } function serverCmdCycleWeapon( %client, %data ) { %client.getControlObject().cycleWeapon( %data ); } function serverCmdStartThrowCount(%client, %data) { %client.player.throwStart = getSimTime(); } function serverCmdEndThrowCount(%client, %data) { if(%client.player.throwStart == 0) return; // throwStrength will be how many seconds the key was held %throwStrength = (getSimTime() - %client.player.throwStart) / 150; // trim the time to fit between 0.5 and 1.5 if(%throwStrength > 1.5) %throwStrength = 1.5; else if(%throwStrength < 0.5) %throwStrength = 0.5; %throwScale = %throwStrength / 2; %client.player.throwStrength = %throwScale; %client.player.throwStart = 0; } //---------------------------------------------------------------------------- function ShapeBase::throwWeapon(%this) { if(Game.shapeThrowWeapon(%this)) { %image = %this.getMountedImage($WeaponSlot); %this.throw(%image.item); %this.client.setWeaponsHudItem(%image.item, 0, 0); } } function ShapeBase::throwPack(%this) { %image = %this.getMountedImage($BackpackSlot); %this.throw(%image.item); %this.client.setBackpackHudItem(%image.item, 0); } function ShapeBase::throw(%this,%data) { if(!isObject(%data)) return false; if (%this.inv[%data.getName()] > 0) { // save off the ammo count on this item if( %this.getInventory( %data ) < $AmmoIncrement[%data.getName()] ) %data.ammoStore = %this.getInventory( %data ); else %data.ammoStore = $AmmoIncrement[%data.getName()]; // Throw item first... %this.throwItem(%data); if($AmmoIncrement[%data.getName()] !$= "") %this.decInventory(%data,$AmmoIncrement[%data.getName()]); else %this.decInventory(%data,1); return true; } return false; } function ShapeBase::use(%this, %data) { //if(%data.class $= "Weapon") { // error("ShapeBase::use " @ %data); //} if(%data $= Grenade) { // figure out which grenade type you're using for(%x = 0; $InvGrenade[%x] !$= ""; %x++) { if(%this.inv[$NameToInv[$InvGrenade[%x]]] > 0) { %data = $NameToInv[$InvGrenade[%x]]; break; } } } else if(%data $= "Backpack") { %pack = %this.getMountedImage($BackpackSlot); // if you don't have a pack but have placed a satchel charge, detonate it if(!%pack && (%this.thrownChargeId > 0) && %this.thrownChargeId.armed ) { %this.playAudio( 0, SatchelChargeExplosionSound ); schedule( 800, %this, "detonateSatchelCharge", %this ); return true; } return false; } else if(%data $= Beacon) { %data.onUse(%this); if (%this.inv[%data.getName()] > 0) return true; } // default case if (%this.inv[%data.getName()] > 0) { %data.onUse(%this); return true; } return false; } function ShapeBase::pickup(%this,%obj,%amount) { %data = %obj.getDatablock(); %delta = %this.incInventory(%data,%amount); if (%delta) %data.onPickup(%obj,%this,%delta); return %delta; } function ShapeBase::hasInventory(%this, %data) { // changed because it was preventing weapons cycling correctly (MES) return (%this.inv[%data] > 0); } function ShapeBase::maxInventory(%this,%data) { if($TestCheats) return 999; else return %this.getDatablock().max[%data.getName()]; } function ShapeBase::incInventory(%this,%data,%amount) { %max = %this.maxInventory(%data); %cv = %this.inv[%data.getName()]; if (%cv < %max) { if (%cv + %amount > %max) %amount = %max - %cv; %this.setInventory(%data,%cv + %amount); %data.incCatagory(%this); // Inc the players weapon count return %amount; } return 0; } function ShapeBase::decInventory(%this,%data,%amount) { %name = %data.getName(); %cv = %this.inv[%name]; if (%cv > 0) { if (%cv < %amount) %amount = %cv; %this.setInventory(%data,%cv - %amount, true); %data.decCatagory(%this); // Dec the players weapon count return %amount; } return 0; } function SimObject::decCatagory(%this) { //function was added to reduce console err msg spam } function SimObject::incCatagory(%this) { //function was added to reduce console err msg spam } function ShapeBase::setInventory(%this,%data,%value,%force) { if (!isObject(%data)) return; %name = %data.getName(); if (%value < 0) %value = 0; else { if (!%force) { // Impose inventory limits %max = %this.maxInventory(%data); if (%value > %max) %value = %max; } } if (%this.inv[%name] != %value) { %this.inv[%name] = %value; %data.onInventory(%this,%value); if ( %data.className $= "Weapon" ) { if ( %this.weaponSlotCount $= "" ) %this.weaponSlotCount = 0; %cur = -1; for ( %slot = 0; %slot < %this.weaponSlotCount; %slot++ ) { if ( %this.weaponSlot[%slot] $= %name ) { %cur = %slot; break; } } if ( %cur == -1 ) { // Put this weapon in the next weapon slot: if ( %this.weaponSlot[%this.weaponSlotCount - 1] $= "TargetingLaser" ) { %this.weaponSlot[%this.weaponSlotCount - 1] = %name; %this.weaponSlot[%this.weaponSlotCount] = "TargetingLaser"; } else %this.weaponSlot[%this.weaponSlotCount] = %name; %this.weaponSlotCount++; } else { // Remove the weapon from the weapon slot: for ( %i = %cur; %i < %this.weaponSlotCount - 1; %i++ ) %this.weaponSlot[%i] = %this.weaponSlot[%i + 1]; %this.weaponSlot[%i] = ""; %this.weaponSlotCount--; } } %this.getDataBlock().onInventory(%data,%value); } return %value; } function ShapeBase::getInventory(%this,%data) { if ( isObject( %data ) ) return( %this.inv[%data.getName()] ); else return( 0 ); } // z0dd - ZOD, 9/13/02. Streamlined. function ShapeBase::hasAmmo( %this, %weapon ) { if(%weapon $= LaserRifle) return( %this.getInventory( EnergyPack ) ); if (%weapon.image.ammo $= "") { if (%weapon $= TargetingLaser) { return( false ); } else { return( true ); } } else { return( %this.getInventory( %weapon.image.ammo ) > 0 ); } } function SimObject::onInventory(%this, %obj) { //function was added to reduce console error msg spam } function ShapeBase::throwItem(%this,%data) { %item = new Item() { dataBlock = %data; rotation = "0 0 1 " @ (getRandom() * 360); }; %item.ammoStore = %data.ammoStore; MissionCleanup.add(%item); %this.throwObject(%item); } function ShapeBase::throwObject(%this,%obj) { //------------------------------------------- // z0dd - ZOD, 5/27/02. Fixes flags hovering // over friendly player when collision occurs if(%obj.getDataBlock().getName() $= "Flag") %obj.static = false; //------------------------------------------- //if the object is being thrown by a corpse, use a random vector if (%this.getState() $= "Dead") { %vec = (-1.0 + getRandom() * 2.0) SPC (-1.0 + getRandom() * 2.0) SPC getRandom(); %vec = vectorScale(%vec, 10); } // else Initial vel based on the dir the player is looking else { %eye = %this.getEyeVector(); %vec = vectorScale(%eye, 20); } // Add a vertical component to give the item a better arc %dot = vectorDot("0 0 1",%eye); if (%dot < 0) %dot = -%dot; %vec = vectorAdd(%vec,vectorScale("0 0 8",1 - %dot)); // Add player's velocity %vec = vectorAdd(%vec,%this.getVelocity()); %pos = getBoxCenter(%this.getWorldBox()); //since flags have a huge mass (so when you shoot them, they don't bounce too far) //we need to up the %vec so that you can still throw them... if (%obj.getDataBlock().getName() $= "Flag") %vec = vectorScale(%vec, 40); // %obj.setTransform(%pos); %obj.applyImpulse(%pos,%vec); %obj.setCollisionTimeout(%this); %data = %obj.getDatablock(); %data.onThrow(%obj,%this); //call the AI hook AIThrowObject(%obj); } function ShapeBase::clearInventory(%this) { %this.setInventory(RepairKit,0); %this.setInventory(Mine,0); //%this.setInventory(MineAir,0); //%this.setInventory(MineLand,0); //%this.setInventory(MineSticky,0); %this.setInventory(Grenade,0); %this.setInventory(FlashGrenade,0); %this.setInventory(ConcussionGrenade,0); %this.setInventory(FlareGrenade,0); %this.setInventory(CameraGrenade, 0); %this.setInventory(Blaster,0); %this.setInventory(Plasma,0); %this.setInventory(Disc,0); %this.setInventory(Chaingun, 0); %this.setInventory(Mortar, 0); %this.setInventory(GrenadeLauncher, 0); %this.setInventory(MissileLauncher, 0); %this.setInventory(SniperRifle, 0); %this.setInventory(TargetingLaser, 0); %this.setInventory(ELFGun, 0); %this.setInventory(ShockLance, 0); %this.setInventory(PlasmaAmmo,0); %this.setInventory(ChaingunAmmo, 0); %this.setInventory(DiscAmmo, 0); %this.setInventory(GrenadeLauncherAmmo, 0); %this.setInventory(MissileLauncherAmmo, 0); %this.setInventory(MortarAmmo, 0); %this.setInventory(Beacon, 0); // take away any pack the player has %curPack = %this.getMountedImage($BackpackSlot); if(%curPack > 0) %this.setInventory(%curPack.item, 0); } //---------------------------------------------------------------------------- function ShapeBase::cycleWeapon( %this, %data ) { if ( %this.weaponSlotCount == 0 ) return; %slot = -1; if ( %this.getMountedImage($WeaponSlot) != 0 ) { %curWeapon = %this.getMountedImage($WeaponSlot).item.getName(); for ( %i = 0; %i < %this.weaponSlotCount; %i++ ) { //error("curWeaponName == " @ %curWeaponName); if ( %curWeapon $= %this.weaponSlot[%i] ) { %slot = %i; break; } } } if ( %data $= "prev" ) { // Previous weapon... if ( %slot == 0 || %slot == -1 ) { %i = %this.weaponSlotCount - 1; %slot = 0; } else %i = %slot - 1; } else { // Next weapon... if ( %slot == ( %this.weaponSlotCount - 1 ) || %slot == -1 ) { %i = 0; %slot = ( %this.weaponSlotCount - 1 ); } else %i = %slot + 1; } %newSlot = -1; while ( %i != %slot ) { if ( %this.weaponSlot[%i] !$= "" && %this.hasInventory( %this.weaponSlot[%i] ) && %this.hasAmmo( %this.weaponSlot[%i] ) ) { // player has this weapon and it has ammo or doesn't need ammo %newSlot = %i; break; } if ( %data $= "prev" ) { if ( %i == 0 ) %i = %this.weaponSlotCount - 1; else %i--; } else { if ( %i == ( %this.weaponSlotCount - 1 ) ) %i = 0; else %i++; } } if ( %newSlot != -1 ) %this.use( %this.weaponSlot[%newSlot] ); } //---------------------------------------------------------------------------- function ShapeBase::selectWeaponSlot( %this, %data ) { if ( %data < 0 || %data > %this.weaponSlotCount || %this.weaponSlot[%data] $= "" || %this.weaponSlot[%data] $= "TargetingLaser" ) return; %this.use( %this.weaponSlot[%data] ); } //---------------------------------------------------------------------------- function serverCmdGiveAll(%client) { if($TestCheats) { %player = %client.player; %player.setInventory(RepairKit,999); %player.setInventory(Mine,999); //%player.setInventory(MineAir,999); //%player.setInventory(MineLand,999); //%player.setInventory(MineSticky,999); %player.setInventory(Grenade,999); %player.setInventory(FlashGrenade,999); %player.setInventory(FlareGrenade,999); %player.setInventory(ConcussionGrenade,999); %player.setInventory(CameraGrenade, 999); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Chaingun, 1); %player.setInventory(Disc,1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(SniperRifle, 1); %player.setInventory(ELFGun, 1); %player.setInventory(Mortar, 1); %player.setInventory(MissileLauncher, 1); %player.setInventory(ShockLance, 1); %player.setInventory(TargetingLaser, 1); %player.setInventory(MissileLauncherAmmo, 999); %player.setInventory(GrenadeLauncherAmmo, 999); %player.setInventory(MortarAmmo, 999); %player.setInventory(PlasmaAmmo,999); %player.setInventory(ChaingunAmmo, 999); %player.setInventory(DiscAmmo, 999); %player.setInventory(Beacon, 999); } } PK !(i99scripts/inventoryHud.cs//------------------------------------------------------------------------------ function setUpFavPrefs() { if($pref::FavCurrentSelect $= "") $pref::FavCurrentSelect = 0; for(%i = 0; %i < 10; %i++) { if($pref::FavNames[%i] $= "") $pref::FavNames[%i] = "Favorite " @ %i + 1; if($pref::Favorite[%i] $= "") $pref::Favorite[%i] = "armor\tLight Armor"; } if($pref::FavCurrentList $= "") $pref::FavCurrentList = 0; } $FavCurrent = 0; setUpFavPrefs(); $InvArmor[0] = "Scout"; $InvArmor[1] = "Assault"; $InvArmor[2] = "Juggernaut"; $NameToInv["Scout"] = "Light"; $NameToInv["Assault"] = "Medium"; $NameToInv["Juggernaut"] = "Heavy"; $InvWeapon[0] = "Blaster"; $InvWeapon[1] = "Plasma Rifle"; $InvWeapon[2] = "Chaingun"; $InvWeapon[3] = "Spinfusor"; $InvWeapon[4] = "Grenade Launcher"; $InvWeapon[5] = "Laser Rifle"; $InvWeapon[6] = "ELF Projector"; $InvWeapon[7] = "Fusion Mortar"; $InvWeapon[8] = "Missile Launcher"; $InvWeapon[9] = "Shocklance"; //$InvWeapon[10] = "Targeting Laser"; // AO $InvWeapon[10] = "TR2 Spinfusor"; $InvWeapon[11] = "TR2 Grenade Launcher"; $InvWeapon[12] = "TR2 Chaingun"; $InvWeapon[13] = "TR2 Shocklance"; $InvWeapon[14] = "TR2 Mortar"; // END AO $NameToInv["Blaster"] = "Blaster"; $NameToInv["Plasma Rifle"] = "Plasma"; $NameToInv["Chaingun"] = "Chaingun"; $NameToInv["Spinfusor"] = "Disc"; $NameToInv["Grenade Launcher"] = "GrenadeLauncher"; $NameToInv["Laser Rifle"] = "SniperRifle"; $NameToInv["ELF Projector"] = "ELFGun"; $NameToInv["Fusion Mortar"] = "Mortar"; $NameToInv["Missile Launcher"] = "MissileLauncher"; $NameToInv["Shocklance"] = "ShockLance"; //$NameToInv["Targeting Laser"] = "TargetingLaser"; // AO $NameToInv["TR2 Spinfusor"] = "TR2Disc"; $NameToInv["TR2 Grenade Launcher"] = "TR2GrenadeLauncher"; $NameToInv["TR2 Chaingun"] = "TR2Chaingun"; $NameToInv["TR2 Energy Pack"] = "TR2EnergyPack"; $NameToInv["TR2 Shocklance"] = "TR2Shocklance"; $NameToInv["TR2 Mortar"] = "TR2Mortar"; // END AO $InvPack[0] = "Energy Pack"; $InvPack[1] = "Repair Pack"; $InvPack[2] = "Shield Pack"; $InvPack[3] = "Cloak Pack"; $InvPack[4] = "Sensor Jammer Pack"; $InvPack[5] = "Ammunition Pack"; $InvPack[6] = "Satchel Charge"; $InvPack[7] = "Motion Sensor Pack"; $InvPack[8] = "Pulse Sensor Pack"; $InvPack[9] = "Inventory Station"; $InvPack[10] = "Landspike Turret"; $InvPack[11] = "Spider Clamp Turret"; $InvPack[12] = "ELF Turret Barrel"; $InvPack[13] = "Mortar Turret Barrel"; $InvPack[14] = "Plasma Turret Barrel"; $InvPack[15] = "AA Turret Barrel"; $InvPack[16] = "Missile Turret Barrel"; // TR2 $InvPack[17] = "TR2 Energy Pack"; // non-team mission pack choices (DM, Hunters, Rabbit) $NTInvPack[0] = "Energy Pack"; $NTInvPack[1] = "Repair Pack"; $NTInvPack[2] = "Shield Pack"; $NTInvPack[3] = "Cloak Pack"; $NTInvPack[4] = "Sensor Jammer Pack"; $NTInvPack[5] = "Ammunition Pack"; $NTInvPack[6] = "Satchel Charge"; $NTInvPack[7] = "Motion Sensor Pack"; $NTInvPack[8] = "Pulse Sensor Pack"; $NTInvPack[9] = "Inventory Station"; // TR2 $NTInvPack[17] = "TR2 Energy Pack"; $NameToInv["Energy Pack"] = "EnergyPack"; $NameToInv["Repair Pack"] = "RepairPack"; $NameToInv["Shield Pack"] = "ShieldPack"; $NameToInv["Cloak Pack"] = "CloakingPack"; $NameToInv["Sensor Jammer Pack"] = "SensorJammerPack"; $NameToInv["Ammunition Pack"] = "AmmoPack"; $NameToInv["Satchel Charge"] = "SatchelCharge"; $NameToInv["Motion Sensor Pack"] = "MotionSensorDeployable"; $NameToInv["Pulse Sensor Pack"] = "PulseSensorDeployable"; $NameToInv["Inventory Station"] = "InventoryDeployable"; $NameToInv["Landspike Turret"] = "TurretOutdoorDeployable"; $NameToInv["Spider Clamp Turret"] = "TurretIndoorDeployable"; $NameToInv["ELF Turret Barrel"] = "ELFBarrelPack"; $NameToInv["Mortar Turret Barrel"] = "MortarBarrelPack"; $NameToInv["Plasma Turret Barrel"] = "PlasmaBarrelPack"; $NameToInv["AA Turret Barrel"] = "AABarrelPack"; $NameToInv["Missile Turret Barrel"] = "MissileBarrelPack"; $InvGrenade[0] = "Grenade"; $InvGrenade[1] = "Whiteout Grenade"; $InvGrenade[2] = "Concussion Grenade"; $InvGrenade[3] = "Flare Grenade"; $InvGrenade[4] = "Deployable Camera"; $NameToInv["Grenade"] = "Grenade"; $NameToInv["Whiteout Grenade"] = "FlashGrenade"; $NameToInv["Concussion Grenade"] = "ConcussionGrenade"; $NameToInv["Flare Grenade"] = "FlareGrenade"; $NameToInv["Deployable Camera"] = "CameraGrenade"; // TR2 $InvGrenade[5] = "TR2Grenade"; $NameToInv["TR2Grenade"] = "TR2Grenade"; $InvMine[0] = "Mine"; $NameToInv["Mine"] = "Mine"; //$InvBanList[DeployInv, "ElfBarrelPack"] = 1; //$InvBanList[DeployInv, "MortarBarrelPack"] = 1; //$InvBanList[DeployInv, "PlasmaBarrelPack"] = 1; //$InvBanList[DeployInv, "AABarrelPack"] = 1; //$InvBanList[DeployInv, "MissileBarrelPack"] = 1; $InvBanList[DeployInv, "InventoryDeployable"] = 1; //------------------------------------------------------------------------------ function InventoryScreen::loadHud( %this, %tag ) { $Hud[%tag] = InventoryScreen; $Hud[%tag].childGui = INV_Root; $Hud[%tag].parent = INV_Root; } //------------------------------------------------------------------------------ function InventoryScreen::setupHud( %this, %tag ) { %favListStart = $pref::FavCurrentList * 10; %this.selId = $pref::FavCurrentSelect - %favListStart + 1; // Add the list menu: $Hud[%tag].staticData[0, 0] = new ShellPopupMenu(INV_ListMenu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "16 313"; extent = "170 36"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; maxPopupHeight = "220"; text = ""; }; // Add favorite tabs: for( %i = 0; %i < 10; %i++ ) { %yOffset = ( %i * 30 ) + 10; $Hud[%tag].staticData[0, %i + 1] = new ShellTabButton() { profile = "ShellTabProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 " @ %yOffset; extent = "206 38"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; command = "InventoryScreen.onTabSelect(" @ %favListStart + %i @ ");"; text = strupr( $pref::FavNames[%favListStart + %i] ); }; $Hud[%tag].staticData[0, %i + 1].setValue( ( %favListStart + %i ) == $pref::FavCurrentSelect ); $Hud[%tag].parent.add( $Hud[%tag].staticData[0, %i + 1] ); } %text = "Favorites " @ %favListStart + 1 SPC "-" SPC %favListStart + 10; $Hud[%tag].staticData[0, 0].onSelect( $pref::FavCurrentList, %text, true ); $Hud[%tag].parent.add( $Hud[%tag].staticData[0, 0] ); // Add the SAVE button: $Hud[%tag].staticData[1, 0] = new ShellBitmapButton() { profile = "ShellButtonProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "409 295"; extent = "75 38"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; command = "saveFavorite();"; text = "SAVE"; }; // Add the name edit control: $Hud[%tag].staticData[1, 1] = new ShellTextEditCtrl() { profile = "NewTextEditProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "217 295"; extent = "196 38"; minExtent = "8 8"; visible = "1"; altCommand = "saveFavorite()"; setFirstResponder = "1"; modal = "1"; helpTag = "0"; historySize = "0"; maxLength = "16"; }; $Hud[%tag].staticData[1, 1].setValue( $pref::FavNames[$pref::FavCurrentSelect] ); $Hud[%tag].parent.add( $Hud[%tag].staticData[1, 0] ); $Hud[%tag].parent.add( $Hud[%tag].staticData[1, 1] ); } //------------------------------------------------------------------------------ function InventoryScreen::addLine( %this, %tag, %lineNum, %type, %count ) { $Hud[%tag].count = %count; // Add label: %yOffset = ( %lineNum * 30 ) + 28; $Hud[%tag].data[%lineNum, 0] = new GuiTextCtrl() { profile = "ShellTextRightProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "228 " @ %yOffset; extent = "80 22"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = ""; }; // Add drop menu: $Hud[%tag].data[%lineNum, 1] = new ShellPopupMenu(INV_Menu) { profile = "ShellPopupProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "305 " @ %yOffset - 9; extent = "180 36"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; maxPopupHeight = "200"; text = ""; type = %type; }; return 2; } //------------------------------------------------------------------------------ function InventoryScreen::updateHud( %this, %client, %tag ) { %noSniperRifle = true; %armor = getArmorDatablock( %client, $NameToInv[%client.favorites[0]] ); if ( %client.lastArmor !$= %armor ) { %client.lastArmor = %armor; for ( %x = 0; %x < %client.lastNumFavs; %x++ ) messageClient( %client, 'RemoveLineHud', "", 'inventoryScreen', %x ); %setLastNum = true; } %cmt = $CurrentMissionType; //Create - ARMOR - List %armorList = %client.favorites[0]; for ( %y = 0; $InvArmor[%y] !$= ""; %y++ ) if ( $InvArmor[%y] !$= %client.favorites[0] ) %armorList = %armorList TAB $InvArmor[%y]; //Create - WEAPON - List for ( %y = 0; $InvWeapon[%y] !$= ""; %y++ ) { %notFound = true; for ( %i = 0; %i < getFieldCount( %client.weaponIndex ); %i++ ) { %WInv = $NameToInv[$InvWeapon[%y]]; if ( ( $InvWeapon[%y] $= %client.favorites[getField( %client.weaponIndex,%i )] ) || !%armor.max[%WInv] ) { %notFound = false; break; } else if ( "SniperRifle" $= $NameToInv[%client.favorites[getField( %client.weaponIndex,%i )]] ) { %noSniperRifle = false; %packList = "noSelect\tEnergy Pack\tEnergy Pack must be used when \tLaser Rifle is selected!"; %client.favorites[getField(%client.packIndex,0)] = "Energy Pack"; } } if ( !($InvBanList[%cmt, %WInv]) ) { if ( %notFound && %weaponList $= "" ) %weaponList = $InvWeapon[%y]; else if ( %notFound ) %weaponList = %weaponList TAB $InvWeapon[%y]; } } //Create - PACK - List if ( %noSniperRifle ) { if ( getFieldCount( %client.packIndex ) ) %packList = %client.favorites[getField( %client.packIndex, 0 )]; else { %packList = "EMPTY"; %client.numFavs++; } for ( %y = 0; $InvPack[%y] !$= ""; %y++ ) { %PInv = $NameToInv[$InvPack[%y]]; if ( ( $InvPack[%y] !$= %client.favorites[getField( %client.packIndex, 0 )]) && %armor.max[%PInv] && !($InvBanList[%cmt, %PInv])) %packList = %packList TAB $Invpack[%y]; } } //Create - GRENADE - List for ( %y = 0; $InvGrenade[%y] !$= ""; %y++ ) { %notFound = true; for(%i = 0; %i < getFieldCount( %client.grenadeIndex ); %i++) { %GInv = $NameToInv[$InvGrenade[%y]]; if ( ( $InvGrenade[%y] $= %client.favorites[getField( %client.grenadeIndex, %i )] ) || !%armor.max[%GInv] ) { %notFound = false; break; } } if ( !($InvBanList[%cmt, %GInv]) ) { if ( %notFound && %grenadeList $= "" ) %grenadeList = $InvGrenade[%y]; else if ( %notFound ) %grenadeList = %grenadeList TAB $InvGrenade[%y]; } } //Create - MINE - List for ( %y = 0; $InvMine[%y] !$= "" ; %y++ ) { %notFound = true; %MInv = $NameToInv[$InvMine[%y]]; for ( %i = 0; %i < getFieldCount( %client.mineIndex ); %i++ ) if ( ( $InvMine[%y] $= %client.favorites[getField( %client.mineIndex, %i )] ) || !%armor.max[%MInv] ) { %notFound = false; break; } if ( !($InvBanList[%cmt, %MInv]) ) { if ( %notFound && %mineList $= "" ) %mineList = $InvMine[%y]; else if ( %notFound ) %mineList = %mineList TAB $InvMine[%y]; } } %client.numFavsCount++; messageClient( %client, 'SetLineHud', "", %tag, 0, "Armor:", %armorList, armor, %client.numFavsCount ); %lineCount = 1; for ( %x = 0; %x < %armor.maxWeapons; %x++ ) { %client.numFavsCount++; if ( %x < getFieldCount( %client.weaponIndex ) ) { %list = %client.favorites[getField( %client.weaponIndex,%x )]; if ( %list $= Invalid ) { %client.favorites[%client.numFavs] = "INVALID"; %client.weaponIndex = %client.weaponIndex TAB %client.numFavs; } } else { %list = "EMPTY"; %client.favorites[%client.numFavs] = "EMPTY"; %client.weaponIndex = %client.weaponIndex TAB %client.numFavs; %client.numFavs++; } if ( %list $= empty ) %list = %list TAB %weaponList; else %list = %list TAB %weaponList TAB "EMPTY"; messageClient( %client, 'SetLineHud', "", %tag, %x + %lineCount, "Weapon Slot " @ %x + 1 @ ": ", %list , weapon, %client.numFavsCount ); } %lineCount = %lineCount + %armor.maxWeapons; %client.numFavsCount++; if ( getField( %packList, 0 ) !$= empty && %noSniperRifle ) %packList = %packList TAB "EMPTY"; %packText = %packList; %packOverFlow = ""; if ( strlen( %packList ) > 255 ) { %packText = getSubStr( %packList, 0, 255 ); %packOverFlow = getSubStr( %packList, 255, 512 ); } messageClient( %client, 'SetLineHud', "", %tag, %lineCount, "Pack:", %packText, pack, %client.numFavsCount, %packOverFlow ); %lineCount++; for( %x = 0; %x < %armor.maxGrenades; %x++ ) { %client.numFavsCount++; if ( %x < getFieldCount( %client.grenadeIndex ) ) { %list = %client.favorites[getField( %client.grenadeIndex, %x )]; if (%list $= Invalid) { %client.favorites[%client.numFavs] = "INVALID"; %client.grenadeIndex = %client.grenadeIndex TAB %client.numFavs; } } else { %list = "EMPTY"; %client.favorites[%client.numFavs] = "EMPTY"; %client.grenadeIndex = %client.grenadeIndex TAB %client.numFavs; %client.numFavs++; } if ( %list $= empty ) %list = %list TAB %grenadeList; else %list = %list TAB %grenadeList TAB "EMPTY"; messageClient( %client, 'SetLineHud', "", %tag, %x + %lineCount, "Grenade:", %list, grenade, %client.numFavsCount ); } %lineCount = %lineCount + %armor.maxGrenades; for ( %x = 0; %x < %armor.maxMines; %x++ ) { %client.numFavsCount++; if ( %x < getFieldCount( %client.mineIndex ) ) { %list = %client.favorites[getField( %client.mineIndex, %x )]; if ( %list $= Invalid ) { %client.favorites[%client.numFavs] = "INVALID"; %client.mineIndex = %client.mineIndex TAB %client.numFavs; } } else { %list = "EMPTY"; %client.favorites[%client.numFavs] = "EMPTY"; %client.mineIndex = %client.mineIndex TAB %client.numFavs; %client.numFavs++; } if ( %list !$= Invalid ) { if ( %list $= empty ) %list = %list TAB %mineList; else if ( %mineList !$= "" ) %list = %list TAB %mineList TAB "EMPTY"; else %list = %list TAB "EMPTY"; } messageClient( %client, 'SetLineHud', "", %tag, %x + %lineCount, "Mine:", %list, mine, %client.numFavsCount ); } if ( %setLastNum ) %client.lastNumFavs = %client.numFavs; } //------------------------------------------------------------------------------ function buyFavorites(%client) { // don't forget -- for many functions, anything done here also needs to be done // below in buyDeployableFavorites !!! %client.player.clearInventory(); %client.setWeaponsHudClearAll(); %cmt = $CurrentMissionType; %curArmor = %client.player.getDatablock(); %curDmgPct = getDamagePercent(%curArmor.maxDamage, %client.player.getDamageLevel()); // armor %client.armor = $NameToInv[%client.favorites[0]]; %client.player.setArmor( %client.armor ); %newArmor = %client.player.getDataBlock(); %client.player.setDamageLevel(%curDmgPct * %newArmor.maxDamage); %weaponCount = 0; // weapons for(%i = 0; %i < getFieldCount( %client.weaponIndex ); %i++) { %inv = $NameToInv[%client.favorites[getField( %client.weaponIndex, %i )]]; if( %inv !$= "" ) { %weaponCount++; %client.player.setInventory( %inv, 1 ); } // z0dd - ZOD, 9/13/02. Streamlining. if ( %inv.image.ammo !$= "" ) %client.player.setInventory( %inv.image.ammo, 400 ); } %client.player.weaponCount = %weaponCount; // pack %pCh = $NameToInv[%client.favorites[%client.packIndex]]; if ( %pCh $= "" ) %client.clearBackpackIcon(); else %client.player.setInventory( %pCh, 1 ); // if this pack is a deployable that has a team limit, warn the purchaser // if it's a deployable turret, the limit depends on the number of players (deployables.cs) if(%pCh $= "TurretIndoorDeployable" || %pCh $= "TurretOutdoorDeployable") %maxDep = countTurretsAllowed(%pCh); else %maxDep = $TeamDeployableMax[%pCh]; if(%maxDep !$= "") { %depSoFar = $TeamDeployedCount[%client.player.team, %pCh]; %packName = %client.favorites[%client.packIndex]; if(Game.numTeams > 1) %msTxt = "Your team has "@%depSoFar@" of "@%maxDep SPC %packName@"s deployed."; else %msTxt = "You have deployed "@%depSoFar@" of "@%maxDep SPC %packName@"s."; messageClient(%client, 'MsgTeamDepObjCount', %msTxt); } // grenades for ( %i = 0; %i < getFieldCount( %client.grenadeIndex ); %i++ ) { if ( !($InvBanList[%cmt, $NameToInv[%client.favorites[getField( %client.grenadeIndex, %i )]]]) ) %client.player.setInventory( $NameToInv[%client.favorites[getField( %client.grenadeIndex,%i )]], 30 ); } %client.player.lastGrenade = $NameToInv[%client.favorites[getField( %client.grenadeIndex,%i )]]; // if player is buying cameras, show how many are already deployed if(%client.favorites[%client.grenadeIndex] $= "Deployable Camera") { %maxDep = $TeamDeployableMax[DeployedCamera]; %depSoFar = $TeamDeployedCount[%client.player.team, DeployedCamera]; if(Game.numTeams > 1) %msTxt = "Your team has "@%depSoFar@" of "@%maxDep@" Deployable Cameras placed."; else %msTxt = "You have placed "@%depSoFar@" of "@%maxDep@" Deployable Cameras."; messageClient(%client, 'MsgTeamDepObjCount', %msTxt); } // mines // ----------------------------------------------------------------------------------------------------- // z0dd - ZOD, 5/8/02. Old code did not check to see if mines are banned, fixed. //for ( %i = 0; %i < getFieldCount( %client.mineIndex ); %i++ ) // %client.player.setInventory( $NameToInv[%client.favorites[getField( %client.mineIndex,%i )]], 30 ); for ( %i = 0; %i < getFieldCount( %client.mineIndex ); %i++ ) { if ( !($InvBanList[%cmt, $NameToInv[%client.favorites[getField( %client.mineIndex, %i )]]]) ) %client.player.setInventory( $NameToInv[%client.favorites[getField( %client.mineIndex,%i )]], 30 ); } // End z0dd - ZOD // ----------------------------------------------------------------------------------------------------- // miscellaneous stuff -- Repair Kit, Beacons, Targeting Laser if ( !($InvBanList[%cmt, RepairKit]) ) %client.player.setInventory( RepairKit, 1 ); if ( !($InvBanList[%cmt, Beacon]) ) %client.player.setInventory( Beacon, 400 ); if ( !($InvBanList[%cmt, TargetingLaser]) ) %client.player.setInventory( TargetingLaser, 1 ); // ammo pack pass -- hack! hack! if( %pCh $= "AmmoPack" ) invAmmoPackPass(%client); } //------------------------------------------------------------------------------ function buyDeployableFavorites(%client) { %player = %client.player; %prevPack = %player.getMountedImage($BackpackSlot); %player.clearInventory(); %client.setWeaponsHudClearAll(); %cmt = $CurrentMissionType; // players cannot buy armor from deployable inventory stations %weapCount = 0; for ( %i = 0; %i < getFieldCount( %client.weaponIndex ); %i++ ) { %inv = $NameToInv[%client.favorites[getField( %client.weaponIndex, %i )]]; if ( !($InvBanList[DeployInv, %inv]) ) { %player.setInventory( %inv, 1 ); // increment weapon count if current armor can hold this weapon if(%player.getDatablock().max[%inv] > 0) %weapCount++; // z0dd - ZOD, 9/13/02. Streamlining if ( %inv.image.ammo !$= "" ) %player.setInventory( %inv.image.ammo, 400 ); if(%weapCount >= %player.getDatablock().maxWeapons) break; } } %player.weaponCount = %weapCount; // give player the grenades and mines they chose, beacons, and a repair kit for ( %i = 0; %i < getFieldCount( %client.grenadeIndex ); %i++) { %GInv = $NameToInv[%client.favorites[getField( %client.grenadeIndex, %i )]]; %client.player.lastGrenade = %GInv; if ( !($InvBanList[DeployInv, %GInv]) ) %player.setInventory( %GInv, 30 ); } // if player is buying cameras, show how many are already deployed if(%client.favorites[%client.grenadeIndex] $= "Deployable Camera") { %maxDep = $TeamDeployableMax[DeployedCamera]; %depSoFar = $TeamDeployedCount[%client.player.team, DeployedCamera]; if(Game.numTeams > 1) %msTxt = "Your team has "@%depSoFar@" of "@%maxDep@" Deployable Cameras placed."; else %msTxt = "You have placed "@%depSoFar@" of "@%maxDep@" Deployable Cameras."; messageClient(%client, 'MsgTeamDepObjCount', %msTxt); } for ( %i = 0; %i < getFieldCount( %client.mineIndex ); %i++ ) { %MInv = $NameToInv[%client.favorites[getField( %client.mineIndex, %i )]]; if ( !($InvBanList[DeployInv, %MInv]) ) %player.setInventory( %MInv, 30 ); } if ( !($InvBanList[DeployInv, Beacon]) && !($InvBanList[%cmt, Beacon]) ) %player.setInventory( Beacon, 400 ); if ( !($InvBanList[DeployInv, RepairKit]) && !($InvBanList[%cmt, RepairKit]) ) %player.setInventory( RepairKit, 1 ); if ( !($InvBanList[DeployInv, TargetingLaser]) && !($InvBanList[%cmt, TargetingLaser]) ) %player.setInventory( TargetingLaser, 1 ); // players cannot buy deployable station packs from a deployable inventory station %packChoice = $NameToInv[%client.favorites[%client.packIndex]]; if ( !($InvBanList[DeployInv, %packChoice]) ) %player.setInventory( %packChoice, 1 ); // if this pack is a deployable that has a team limit, warn the purchaser // if it's a deployable turret, the limit depends on the number of players (deployables.cs) if(%packChoice $= "TurretIndoorDeployable" || %packChoice $= "TurretOutdoorDeployable") %maxDep = countTurretsAllowed(%packChoice); else %maxDep = $TeamDeployableMax[%packChoice]; if((%maxDep !$= "") && (%packChoice !$= "InventoryDeployable")) { %depSoFar = $TeamDeployedCount[%client.player.team, %packChoice]; %packName = %client.favorites[%client.packIndex]; if(Game.numTeams > 1) %msTxt = "Your team has "@%depSoFar@" of "@%maxDep SPC %packName@"s deployed."; else %msTxt = "You have deployed "@%depSoFar@" of "@%maxDep SPC %packName@"s."; messageClient(%client, 'MsgTeamDepObjCount', %msTxt); } if(%prevPack > 0) { // if player had a "forbidden" pack (such as a deployable inventory station) // BEFORE visiting a deployed inventory station AND still has that pack chosen // as a favorite, give it back if((%packChoice $= %prevPack.item) && ($InvBanList[DeployInv, %packChoice])) %player.setInventory( %prevPack.item, 1 ); } if(%packChoice $= "AmmoPack") invAmmoPackPass(%client); } //------------------------------------------------------------------------------------- function getAmmoStationLovin(%client) { //error("Much ammo station lovin applied"); %cmt = $CurrentMissionType; // weapons for(%i = 0; %i < %client.player.weaponSlotCount; %i++) { %weapon = %client.player.weaponSlot[%i]; // z0dd - ZOD, 9/13/02. Streamlining if ( %weapon.image.ammo !$= "" ) %client.player.setInventory( %weapon.image.ammo, 400 ); } // miscellaneous stuff -- Repair Kit, Beacons, Targeting Laser if ( !($InvBanList[%cmt, RepairKit]) ) %client.player.setInventory( RepairKit, 1 ); if ( !($InvBanList[%cmt, Beacon]) ) %client.player.setInventory( Beacon, 400 ); if ( !($InvBanList[%cmt, TargetingLaser]) ) %client.player.setInventory( TargetingLaser, 1 ); // Do we want to allow mines? Ammo stations in T1 didnt dispense mines. // if ( !($InvBanList[%cmt, Mine]) ) // %client.player.setInventory( Mine, 400 ); // grenades // we need to get rid of any grenades the player may have picked up %client.player.setInventory( Grenade, 0 ); %client.player.setInventory( ConcussionGrenade, 0 ); %client.player.setInventory( CameraGrenade, 0 ); %client.player.setInventory( FlashGrenade, 0 ); %client.player.setInventory( FlareGrenade, 0 ); // player should get the last type they purchased %grenType = %client.player.lastGrenade; // if the player hasnt been to a station they get regular grenades if(%grenType $= "") { //error("no gren type, using default..."); %grenType = Grenade; } if ( !($InvBanList[%cmt, %grenType]) ) %client.player.setInventory( %grenType, 30 ); // if player is buying cameras, show how many are already deployed if(%grenType $= "Deployable Camera") { %maxDep = $TeamDeployableMax[DeployedCamera]; %depSoFar = $TeamDeployedCount[%client.player.team, DeployedCamera]; if(Game.numTeams > 1) %msTxt = "Your team has "@%depSoFar@" of "@%maxDep@" Deployable Cameras placed."; else %msTxt = "You have placed "@%depSoFar@" of "@%maxDep@" Deployable Cameras."; messageClient(%client, 'MsgTeamDepObjCount', %msTxt); } if( %client.player.getMountedImage($BackpackSlot) $= "AmmoPack" ) invAmmoPackPass(%client); } function invAmmoPackPass(%client) { // "normal" ammo stuff (everything but mines and grenades) for ( %idx = 0; %idx < $numAmmoItems; %idx++ ) { %ammo = $AmmoItem[%idx]; %client.player.incInventory(%ammo, AmmoPack.max[%ammo]); } //our good friends, the grenade family *SIGH* // first find out what type of grenade the player has selected %grenFav = %client.favorites[getField(%client.grenadeIndex, 0)]; if((%grenFav !$= "EMPTY") && (%grenFav !$= "INVALID")) %client.player.incInventory($NameToInv[%grenFav], AmmoPack.max[$NameToInv[%grenFav]]); // now the same check for mines %mineFav = %client.favorites[getField(%client.mineIndex, 0)]; if((%mineFav !$= "EMPTY") && (%mineFav !$= "INVALID") && !($InvBanList[%cmt, Mine])) %client.player.incInventory($NameToInv[%mineFav], AmmoPack.max[$NameToInv[%mineFav]]); } //------------------------------------------------------------------------------ function loadFavorite( %index, %echo ) { $pref::FavCurrentSelect = %index; %list = mFloor( %index / 10 ); if ( isObject( $Hud['inventoryScreen'] ) ) { // Deselect the old tab: if ( InventoryScreen.selId !$= "" ) $Hud['inventoryScreen'].staticData[0, InventoryScreen.selId].setValue( false ); // Make sure we are looking at the same list: if ( $pref::FavCurrentList != %list ) { %favListStart = %list * 10; %text = "Favorites " @ %favListStart + 1 SPC "-" SPC %favListStart + 10; $Hud['inventoryScreen'].staticData[0, 0].onSelect( %list, %text, true ); } // Select the new tab: %tab = $pref::FavCurrentSelect - ( $pref::FavCurrentList * 10 ) + 1; InventoryScreen.selId = %tab; $Hud['inventoryScreen'].staticData[0, %tab].setValue( true ); // Update the Edit Name field: $Hud['inventoryScreen'].staticData[1, 1].setValue( $pref::FavNames[%index] ); } if ( %echo ) addMessageHudLine( "Inventory set \"" @ $pref::FavNames[%index] @ "\" selected." ); commandToServer( 'setClientFav', $pref::Favorite[%index] ); } //------------------------------------------------------------------------------ function saveFavorite() { if ( $pref::FavCurrentSelect !$= "" ) { %favName = $Hud['inventoryScreen'].staticData[1, 1].getValue(); $pref::FavNames[$pref::FavCurrentSelect] = %favName; $Hud['inventoryScreen'].staticData[0, $pref::FavCurrentSelect - ($pref::FavCurrentList * 10) + 1].setText( strupr( %favName ) ); //$Hud[%tag].staticData[1, 1].setValue( %favName ); %favList = $Hud['inventoryScreen'].data[0, 1].type TAB $Hud['inventoryScreen'].data[0, 1].getValue(); for ( %i = 1; %i < $Hud['inventoryScreen'].count; %i++ ) { %name = $Hud['inventoryScreen'].data[%i, 1].getValue(); if ( %name $= invalid ) %name = "EMPTY"; %favList = %favList TAB $Hud['inventoryScreen'].data[%i, 1].type TAB %name; } $pref::Favorite[$pref::FavCurrentSelect] = %favList; echo("exporting pref::* to ClientPrefs.cs"); export("$pref::*", "prefs/ClientPrefs.cs", False); } // else // addMessageHudLine("Must First Select A Favorite Button."); } //------------------------------------------------------------------------------ function addQuickPackFavorite( %pack, %item ) { // this has been such a success it has been changed to handle grenades // and other equipment as well as packs so everything seems to be called 'pack' // including the function itself. The default IS pack if(%item $= "") %item = "Pack"; %packFailMsg = "You cannot use that equipment with your selected loadout."; if ( !isObject($Hud['inventoryScreen'].staticData[1, 1]) || $Hud['inventoryScreen'].staticData[1, 1].getValue() $= "" ) { //if the player hasnt brought up the inv screen we use his current fav %currentFav = $pref::Favorite[$pref::FavCurrentSelect]; //echo(%currentFav); for ( %i = 0; %i < getFieldCount( %currentFav ); %i++ ) { %type = getField( %currentFav, %i ); %equipment = getField( %currentFav, %i++ ); %invalidPack = checkPackValidity(%pack, %equipment, %item ); if(%invalidPack) { addMessageHudLine( %packFailMsg ); return; } // Success-------------------------------------------------- if ( %type $= %item ) %favList = %favList @ %type TAB %pack @ "\t"; else %favList = %favList @ %type TAB %equipment @ "\t"; } //echo(%favList); } else { //otherwise we go with whats on the invScreen (even if its asleep) %armor = $Hud['inventoryScreen'].data[0, 1].getValue(); // check pack validity with armor %invalidPack = checkPackValidity(%pack, %armor, %item ); if(%invalidPack) { addMessageHudLine( %packFailMsg ); return; } %favList = $Hud['inventoryScreen'].data[0, 1].type TAB %armor; for ( %i = 1; %i < $Hud['inventoryScreen'].count; %i++ ) { //echo( $Hud['inventoryScreen'].Data[%i, 1].type); %type = $Hud['inventoryScreen'].data[%i, 1].type; %equipment = $Hud['inventoryScreen'].data[%i, 1].getValue(); if(%type $= %item) %equipment = %pack; // Special Cases again------------------------------------------------ %invalidPack = checkPackValidity(%pack, %equipment, %item ); if(%invalidPack) { addMessageHudLine( %packFailMsg ); return; } %favList = %favList TAB %type TAB %equipment; } //echo(%favList); } commandToServer( 'setClientFav', %favList ); //we message the player real nice like addMessageHudLine( "Inventory updated to " @ %pack @ "." ); } function checkPackValidity(%pack, %equipment, %item) { //echo("validityChecking:" SPC %pack SPC %equipment); // this is mostly for ease of mod makers // this is the base restrictions stuff // for your mod just overwrite this function and // change the restrictions and onlyUses // you must have #1 to use #2 //%restrict[#1, #2] = true; %restrict["Scout", "Inventory Station"] = true; %restrict["Scout", "Landspike Turret"] = true; %restrict["Scout", "Spider Clamp Turret"] = true; %restrict["Scout", "ELF Turret Barrel"] = true; %restrict["Scout", "Mortar Turret Barrel"] = true; %restrict["Scout", "AA Turret Barrel"] = true; %restrict["Scout", "Plasma Turret Barrel"] = true; %restrict["Scout", "Missile Turret Barrel"] = true; %restrict["Assault", "Cloak Pack"] = true; %restrict["Juggernaut", "Cloak Pack"] = true; // you can only use #1 if you have a #2 of type #3 //%require[#1] = #2 TAB #3; %require["Laser Rifle"] = "Pack" TAB "Energy Pack"; if(%restrict[%equipment, %pack] ) return true; else if(%require[%equipment] !$="" ) { if(%item $= getField(%require[%equipment], 0) ) { if(%pack !$= getField(%require[%equipment], 1) ) return true; } } } //------------------------------------------------------------------------------ function setDefaultInventory(%client) { commandToClient(%client,'InitLoadClientFavorites'); } //------------------------------------------------------------------------------ function checkInventory( %client, %text ) { %armor = getArmorDatablock( %client, $NameToInv[getField( %text, 1 )] ); %list = getField( %text, 0 ) TAB getField( %text, 1 ); %cmt = $CurrentMissionType; for( %i = 3; %i < getFieldCount( %text ); %i = %i + 2 ) { %inv = $NameToInv[getField(%text,%i)]; if ( (( %armor.max[%inv] && !($InvBanList[%cmt, %inv]) ) || getField( %text, %i ) $= Empty || getField( %text, %i ) $= Invalid) && (($InvTotalCount[getField( %text, %i - 1 )] - $BanCount[getField( %text, %i - 1 )]) > 0)) %list = %list TAB getField( %text, %i - 1 ) TAB getField( %text, %i ); else if( $InvBanList[%cmt, %inv] || %inv $= empty || %inv $= "") %list = %list TAB getField( %text, %i - 1 ) TAB "INVALID"; } return %list; } //------------------------------------------------------------------------------ function getArmorDatablock(%client, %size) { if ( %client.race $= "Bioderm" ) %armor = %size @ "Male" @ %client.race @ Armor; else %armor = %size @ %client.sex @ %client.race @ Armor; return %armor; } //------------------------------------------------------------------------------ function InventoryScreen::onWake(%this) { if ( $HudHandle[inventoryScreen] !$= "" ) alxStop( $HudHandle[inventoryScreen] ); alxPlay(HudInventoryActivateSound, 0, 0, 0); $HudHandle[inventoryScreen] = alxPlay(HudInventoryHumSound, 0, 0, 0); if ( isObject( hudMap ) ) { hudMap.pop(); hudMap.delete(); } new ActionMap( hudMap ); hudMap.blockBind( moveMap, toggleScoreScreen ); hudMap.blockBind( moveMap, toggleCommanderMap ); hudMap.bindCmd( keyboard, escape, "", "InventoryScreen.onDone();" ); hudMap.push(); } //------------------------------------------------------------------------------ function InventoryScreen::onSleep() { hudMap.pop(); hudMap.delete(); alxStop($HudHandle[inventoryScreen]); alxPlay(HudInventoryDeactivateSound, 0, 0, 0); $HudHandle[inventoryScreen] = ""; } //------------------------------------------------------------------------------ function InventoryScreen::onDone( %this ) { toggleCursorHuds( 'inventoryScreen' ); } //------------------------------------------------------------------------------ function InventoryScreen::onTabSelect( %this, %favId ) { loadFavorite( %favId, 0 ); } function createInvBanCount() { $BanCount["Armor"] = 0; $BanCount["Weapon"] = 0; $BanCount["Pack"] = 0; $BanCount["Grenade"] = 0; $BanCount["Mine"] = 0; for(%i = 0; $InvArmor[%i] !$= ""; %i++) if($InvBanList[$CurrentMissionType, $NameToInv[$InvArmor[%i]]]) $BanCount["Armor"]++; $InvTotalCount["Armor"] = %i; for(%i = 0; $InvWeapon[%i] !$= ""; %i++) if($InvBanList[$CurrentMissionType, $NameToInv[$InvWeapon[%i]]]) $BanCount["Weapon"]++; $InvTotalCount["Weapon"] = %i; for(%i = 0; $InvPack[%i] !$= ""; %i++) if($InvBanList[$CurrentMissionType, $NameToInv[$InvPack[%i]]]) $BanCount["Pack"]++; $InvTotalCount["Pack"] = %i; for(%i = 0; $InvGrenade[%i] !$= ""; %i++) if($InvBanList[$CurrentMissionType, $NameToInv[$InvGrenade[%i]]]) $BanCount["Grenade"]++; $InvTotalCount["Grenade"] = %i; for(%i = 0; $InvMine[%i] !$= ""; %i++) if($InvBanList[$CurrentMissionType, $NameToInv[$InvMine[%i]]]) $BanCount["Mine"]++; $InvTotalCount["Mine"] = %i; } PK !(ox IIscripts/item.cs//---------------------------------------------------------------------------- // When first mounted (assuming there is ammo): // SingleShot activate -> ready // Spinning activate -> idle (spin 0) // Sustained activate -> ready // DiscLauncher activate -> reload -> spinup -> ready // // Normal operation: // SingleShot ready -> fire -> reload -> ready // Spinning idle (spin 0) -> spinup -> ready -> fire -> spindown -> idle // Sustained ready -> fire -> reload -> ready // DiscLauncher ready -> fire -> reload -> spinup -> ready // Image properties // emap // preload // shapeFile // mountPoint // offset // rotation // firstPerson // mass // usesEnergy // minEnergy // accuFire // lightType // lightTime // lightRadius // lightColor // Image state variables // stateName // stateTransitionOnLoaded // stateTransitionOnNotLoaded // stateTransitionOnAmmo // stateTransitionOnNoAmmo // stateTransitionOnTriggerUp // stateTransitionOnTriggerDown // stateTransitionOnTimeout // stateTimeoutValue // stateFire // stateEnergyDrain // stateAllowImageChange // stateScaleAnimation // stateDirection // stateLoadedFlag // stateSpinThread // stateRecoil // stateSequence // stateSound // stateScript // stateEmitter // stateEmitterTime // stateEmitterNode //---------------------------------------------------------------------------- $ItemRespawnTime = 30000; $ItemPopTime = 30 * 1000; // 30 seconds $WeaponSlot = 0; $AuxiliarySlot = 1; $BackpackSlot = 2; $FlagSlot = 3; //---------------------------------------------------------------------------- datablock EffectProfile(ItemPickupEffect) { effectname = "packs/packs.pickupPack"; minDistance = 2.5; }; datablock AudioProfile(ItemPickupSound) { filename = "fx/packs/packs.pickuppack.wav"; description = AudioClosest3d; effect = ItemPickupEffect; preload = true; }; datablock EffectProfile(ItemThrowEffect) { effectname = "packs/packs.throwpack"; minDistance = 2.5; maxDistance = 2.5; }; datablock AudioProfile(ItemThrowSound) { filename = "fx/packs/packs.throwpack.wav"; description = AudioClosest3d; effect = ItemThrowEffect; preload = true; }; datablock AudioProfile(RepairPatchSound) { filename = "fx/misc/health_patch.wav"; description = AudioClosest3d; preload = true; effect = ItemPickupEffect; preload = true; }; function ItemData::create(%block) { if(%block $= "flag") %obj = new Item() { className = FlagObj; dataBlock = %block; static = false; rotate = false; }; else %obj = new Item() { dataBlock = %block; static = true; //rotate = true; // don't make "placed items" rotate rotate = false; }; return(%obj); } //-------------------------------------------------------------------------- function Item::schedulePop(%this) { %itemFadeTime = 1000; // items will take 1 second (1000 milliseconds) to fade out %this.startFade(%itemFadeTime, $ItemPopTime - %itemFadeTime, true); %this.schedule($ItemPopTime, "delete"); } function Item::respawn(%this) { %this.startFade(0, 0, true); %this.schedule($ItemRespawnTime + 100, "startFade", 1000, 0, false); %this.hide(true); %this.schedule($ItemRespawnTime, "hide", false); } //-------------------------------------------------------------------------- function ItemData::onThrow(%data,%obj,%shape) { serverPlay3D(ItemThrowSound, %obj.getTransform()); // don't schedule a delete for satchelCharges when they're deployed if(!%data.noTimeout) %obj.schedulePop(); } function ItemData::onInventory(%data,%shape,%value) { if (!%value) { // If we don't have any more of these items, make sure // we don't have an image mounted. %slot = %shape.getMountSlot(%data.image); if (%slot != -1) %shape.unmountImage(%slot); } } function ItemData::onEnterLiquid(%data, %obj, %coverage, %type) { if(%data.isInvincible) return; switch(%type) { case 0: //Water case 1: //Ocean Water case 2: //River Water case 3: //Stagnant Water case 4: //Lava %obj.delete(); case 5: //Hot Lava %obj.delete(); case 6: //Crusty Lava %obj.delete(); case 7: //Quick Sand } } function ItemData::onLeaveLiquid(%data, %obj, %type) { // dummy } function ItemData::onCollision(%data,%obj,%col) { // Default behavior for items is to get picked // by the colliding object. if (%col.getDataBlock().className $= Armor && %col.getState() !$= "Dead") { if (%col.isMounted()) return; if (%col.pickup(%obj, 1)) { if (%col.client) { messageClient(%col.client, 'MsgItemPickup', '\c0You picked up %1.', %data.pickUpName); serverPlay3D(ItemPickupSound, %col.getTransform()); } if (%obj.isStatic()) %obj.respawn(); else %obj.delete(); } } } //---------------------------------------------------------------------------- datablock ItemData(RepairKit) { className = HandInventory; catagory = "Misc"; shapeFile = "repair_kit.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2.0; pickUpName = "a repair kit"; alwaysAmbient = true; computeCRC = true; emap = true; }; function RepairKit::onUse(%data,%obj) { // Don't use the kit unless we're damaged if (%obj.getDamageLevel() != 0) { %obj.decInventory(%data,1); %obj.applyRepair(0.2); messageClient(%obj.client, 'MsgRepairKitUsed', '\c2Repair Kit Used.'); } } //---------------------------------------------------------------------------- datablock ItemData(RepairPatch) { catagory = "Misc"; shapeFile = "repair_patch.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2.0; pickUpName = "a repair patch"; alwaysAmbient = true; computeCRC = true; emap = true; }; function RepairPatch::onCollision(%data,%obj,%col) { if ( %col.getDataBlock().className $= Armor && %col.getDamageLevel() != 0 && %col.getState() !$= "Dead" ) { if (%col.isMounted()) return; %col.playAudio(0, RepairPatchSound); %col.applyRepair(0.125); %obj.respawn(); if (%col.client > 0) messageClient(%col.client, 'MsgItemPickup', '\c0You picked up %1.', %data.pickUpName); } } //---------------------------------------------------------------------------- // Flag: //---------------------------------------------------------------------------- datablock ShapeBaseImageData(FlagImage) { shapeFile = "flag.dts"; item = Flag; mountPoint = 2; offset = "0 0 0"; lightType = "PulsingLight"; lightColor = "0.5 0.5 0.5 1.0"; lightTime = "1000"; lightRadius = "3"; cloakable = false; }; datablock ItemData(Flag) { catagory = "Objectives"; shapefile = "flag.dts"; mass = 55; elasticity = 0.2; friction = 0.6; pickupRadius = 3; pickUpName = "a flag"; computeCRC = true; lightType = "PulsingLight"; lightColor = "0.5 0.5 0.5 1.0"; lightTime = "1000"; lightRadius = "3"; isInvincible = true; cmdCategory = "Objectives"; cmdIcon = CMDFlagIcon; cmdMiniIconName = "commander/MiniIcons/com_flag_grey"; targetTypeTag = 'Flag'; //used in CTF to mark the flag during a stalemate... hudImageNameFriendly[1] = "commander/MiniIcons/com_flag_grey"; hudImageNameEnemy[1] = "commander/MiniIcons/com_flag_grey"; hudRenderModulated[1] = true; hudRenderAlways[1] = true; hudRenderCenter[1] = true; hudRenderDistance[1] = true; hudRenderName[1] = true; }; //---------------------------------------------------------------------------- function Flag::onThrow(%data,%obj,%src) { Game.playerDroppedFlag(%src); } function Flag::onAdd(%this, %obj) { // make sure flags play "flapping" ambient thread Parent::onAdd(%this, %obj); %obj.playThread($AmbientThread, "ambient"); %blocker = new VehicleBlocker() { position = %obj.position; rotation = %obj.rotation; dimensions = "2 2 4"; }; MissionCleanup.add(%blocker); } function Flag::onCollision(%data,%obj,%col) { if (%col.getDataBlock().className $= Armor) { if (%col.isMounted()) return; // a player hit the flag Game.playerTouchFlag(%col, %obj); } } //---------------------------------------------------------------------------- // HuntersFlag: //---------------------------------------------------------------------------- datablock ShapeBaseImageData(HuntersFlagImage) { shapeFile = "Huntersflag.dts"; item = Flag; mountPoint = 2; offset = "0 0 0"; lightType = "PulsingLight"; lightColor = "0.5 0.5 0.5 1.0"; lightTime = "1000"; lightRadius = "3"; }; // 1: red // 2: blue // 4: yellow // 8: green datablock ItemData(HuntersFlag1) { className = HuntersFlag; shapefile = "Huntersflag.dts"; mass = 75; elasticity = 0.2; friction = 0.6; pickupRadius = 3; isInvincible = true; pickUpName = "a flag"; computeCRC = true; lightType = "PulsingLight"; lightColor = "0.8 0.2 0.2 1.0"; lightTime = "1000"; lightRadius = "3"; }; datablock ItemData(HuntersFlag2) : HuntersFlag1 { lightColor = "0.2 0.2 0.8 1.0"; }; datablock ItemData(HuntersFlag4) : HuntersFlag1 { lightColor = "0.8 0.8 0.2 1.0"; }; datablock ItemData(HuntersFlag8) : HuntersFlag1 { lightColor = "0.2 0.8 0.2 1.0"; }; function HuntersFlag::onRemove(%data, %obj) { // dont want target removed... } function HuntersFlag::onThrow(%data,%obj,%src) { Game.playerDroppedFlag(%src); } function HuntersFlag::onCollision(%data,%obj,%col) { if (%col.getDataBlock().className $= Armor) { if (%col.isMounted()) return; // a player hit the flag Game.playerTouchFlag(%col, %obj); } } //---------------------------------------------------------------------------- // Nexus: //---------------------------------------------------------------------------- datablock ItemData(Nexus) { catagory = "Objectives"; shapefile = "nexus_effect.dts"; mass = 10; elasticity = 0.2; friction = 0.6; pickupRadius = 2; icon = "CMDNexusIcon"; targetTypeTag = 'Nexus'; computeCRC = true; }; datablock ParticleData(NexusParticleDenied) { dragCoeffiecient = 0.4; gravityCoefficient = 3.0; inheritedVelFactor = 0.0; lifetimeMS = 1200; lifetimeVarianceMS = 400; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -200.0; spinRandomMax = 200.0; colors[0] = "0.3 0.0 0.0 1.0"; colors[1] = "0.5 0.0 0.0 0.5"; colors[2] = "0.7 0.0 0.0 0.0"; sizes[0] = 0.2; sizes[1] = 0.1; sizes[2] = 0.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(NexusParticleDeniedEmitter) { ejectionPeriodMS = 2; ejectionOffset = 0.2; periodVarianceMS = 0.5; ejectionVelocity = 10.0; velocityVariance = 4.0; thetaMin = 0.0; thetaMax = 30.0; lifetimeMS = 0; particles = "NexusParticleDenied"; }; datablock ParticleData(NexusParticleCap) { dragCoeffiecient = 0.4; gravityCoefficient = 3.0; inheritedVelFactor = 0.0; lifetimeMS = 1200; lifetimeVarianceMS = 400; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -200.0; spinRandomMax = 200.0; colors[0] = "0.5 0.8 0.2 1.0"; colors[1] = "0.6 0.9 0.3 1.0"; colors[2] = "0.7 1.0 0.4 1.0"; sizes[0] = 0.2; sizes[1] = 0.1; sizes[2] = 0.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(NexusParticleCapEmitter) { ejectionPeriodMS = 2; ejectionOffset = 0.5; periodVarianceMS = 0.5; ejectionVelocity = 10.0; velocityVariance = 4.0; thetaMin = 0.0; thetaMax = 30.0; lifetimeMS = 0; particles = "NexusParticleCap"; }; //---------------------------------------------------------------------------- function getVector(%string, %num) { %start = %num * 3; return getWords(%string,%start, %start + 2); } // -------------------------------------------- // explosion datablock // -------------------------------------------- datablock ExplosionData(DeployablesExplosion) { soundProfile = DeployablesExplosionSound; faceViewer = true; explosionShape = "effect_plasma_explosion.dts"; sizes[0] = "0.2 0.2 0.2"; sizes[1] = "0.3 0.3 0.3"; }; $TeamDeployableMax[TargetBeacon] = 10; $TeamDeployableMax[MarkerBeacon] = 20; datablock ItemData(Beacon) { className = HandInventory; catagory = "Misc"; shapeFile = "beacon.dts"; mass = 1; elasticity = 0.2; friction = 0.8; pickupRadius = 1; pickUpName = "a deployable beacon"; computeCRC = true; }; datablock StaticShapeData(DeployedBeacon) : StaticShapeDamageProfile { shapeFile = "beacon.dts"; explosion = DeployablesExplosion; maxDamage = 0.45; disabledLevel = 0.45; destroyedLevel = 0.45; targetNameTag = 'beacon'; deployedObject = true; dynamicType = $TypeMasks::SensorObjectType; debrisShapeName = "debris_generic_small.dts"; debris = SmallShapeDebris; }; function DeployedBeacon::onDestroyed(%data, %obj, %prevState) { if(%obj.getBeaconType() $= "friend") %bType = "MarkerBeacon"; else %bType = "TargetBeacon"; $TeamDeployedCount[%obj.team, %bType]--; %obj.schedule(500, delete); } function Beacon::onUse(%data, %obj) { // look for 3 meters along player's viewpoint for interior or terrain %searchRange = 3.0; %mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType; // get the eye vector and eye transform of the player %eyeVec = %obj.getEyeVector(); %eyeTrans = %obj.getEyeTransform(); // extract the position of the player's camera from the eye transform (first 3 words) %eyePos = posFromTransform(%eyeTrans); // normalize the eye vector %nEyeVec = VectorNormalize(%eyeVec); // scale (lengthen) the normalized eye vector according to the search range %scEyeVec = VectorScale(%nEyeVec, %searchRange); // add the scaled & normalized eye vector to the position of the camera %eyeEnd = VectorAdd(%eyePos, %scEyeVec); // see if anything gets hit %searchResult = containerRayCast(%eyePos, %eyeEnd, %mask, 0); if(!%searchResult ) { // no terrain/interior collision within search range if(%obj.inv[%data.getName()] > 0) messageClient(%obj.client, 'MsgBeaconNoSurface', '\c2Cannot place beacon. Too far from surface.'); return 0; } else { %searchObj = GetWord(%searchResult, 0); if(%searchObj.getType() & ($TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType) ) { // if there's already a beacon where player is aiming, switch its type // otherwise, player can't deploy a beacon there if(%searchObj.getDataBlock().getName() $= DeployedBeacon) switchBeaconType(%searchObj); else messageClient(%obj.client, 'MsgBeaconNoSurface', '\c2Cannot place beacon. Not a valid surface.'); return 0; } else if(%obj.inv[%data.getName()] <= 0) return 0; } // newly deployed beacons default to "target" type if($TeamDeployedCount[%obj.team, TargetBeacon] >= $TeamDeployableMax[TargetBeacon]) { messageClient(%obj.client, 'MsgDeployFailed', '\c2Your team\'s control network has reached its capacity for this item.~wfx/misc/misc.error.wav'); return 0; } %terrPt = posFromRaycast(%searchResult); %terrNrm = normalFromRaycast(%searchResult); %intAngle = getTerrainAngle(%terrNrm); // getTerrainAngle() function found in staticShape.cs %rotAxis = vectorNormalize(vectorCross(%terrNrm, "0 0 1")); if (getWord(%terrNrm, 2) == 1 || getWord(%terrNrm, 2) == -1) %rotAxis = vectorNormalize(vectorCross(%terrNrm, "0 1 0")); %rotation = %rotAxis @ " " @ %intAngle; %obj.decInventory(%data, 1); %depBeac = new BeaconObject() { dataBlock = "DeployedBeacon"; position = VectorAdd(%terrPt, VectorScale(%terrNrm, 0.05)); rotation = %rotation; }; $TeamDeployedCount[%obj.team, TargetBeacon]++; %depBeac.playThread($AmbientThread, "ambient"); %depBeac.team = %obj.team; %depBeac.sourceObject = %obj; // give it a team target %depBeac.setTarget(%depBeac.team); MissionCleanup.add(%depBeac); } function switchBeaconType(%beacon) { if(%beacon.getBeaconType() $= "friend") { // switch from marker beacon to target beacon if($TeamDeployedCount[%beacon.team, TargetBeacon] >= $TeamDeployableMax[TargetBeacon]) { messageClient(%beacon.sourceObject.client, 'MsgDeployFailed', '\c2Your team\'s control network has reached its capacity for this item.~wfx/misc/misc.error.wav'); return 0; } %beacon.setBeaconType(enemy); $TeamDeployedCount[%beacon.team, MarkerBeacon]--; $TeamDeployedCount[%beacon.team, TargetBeacon]++; } else { // switch from target beacon to marker beacon if($TeamDeployedCount[%beacon.team, MarkerBeacon] >= $TeamDeployableMax[MarkerBeacon]) { messageClient(%beacon.sourceObject.client, 'MsgDeployFailed', '\c2Your team\'s control network has reached its capacity for this item.~wfx/misc/misc.error.wav'); return 0; } %beacon.setBeaconType(friend); $TeamDeployedCount[%beacon.team, TargetBeacon]--; $TeamDeployedCount[%beacon.team, MarkerBeacon]++; } }PK !(k}ZLLscripts/joystickBind.cs//-------------------------------------------------------------------------- // // joystickBind.cs // //-------------------------------------------------------------------------- // Joystick functions: function joystickMoveX(%val) { $mvLeftAction = ( %val < 0.0 ); $mvRightAction = ( %val > 0.0 ); } function joystickMoveY(%val) { $mvForwardAction = ( %val < 0.0 ); $mvBackwardAction = ( %val > 0.0 ); } function joyYaw(%val) { $mvYaw += getMouseAdjustAmount( %val ); } function joyPitch(%val) { $mvPitch += getMouseAdjustAmount( %val ); }PK !(B`scripts/lavaPropMap.cs//-------------------------------------- Desert interior texture property mapping addMaterialMapping("lava/ds_ichute01", "environment: special/chuteTexture 0.25"); addMaterialMapping("lava/ds_ichute02", "environment: special/chuteTexture 0.25"); addMaterialMapping("lava/ds_jet01", "environment: special/lavareflect 0.3"); addMaterialMapping("lava/ds_jet02", "environment: special/lavareflect 0.3"); //"Color: red green blue startAlpha endAlpha" //Soft sound = 0 //Hard sound = 1 //Metal sound = 2 //Snow sound = 3 addMaterialMapping("terrain/LavaWorld.Crust", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 0"); addMaterialMapping("terrain/LavaWorld.LavaRockHot", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 0"); addMaterialMapping("terrain/LavaWorld.MuddyAsh", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 0"); addMaterialMapping("terrain/LavaWorld.RockBlack", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 0"); PK !(FM}##scripts/light_female.csdatablock TSShapeConstructor(LightFemaleDts) { baseShape = "light_female.dts"; sequence0 = "light_female_root.dsq root"; sequence1 = "light_female_forward.dsq run"; sequence2 = "light_female_back.dsq back"; sequence3 = "light_female_side.dsq side"; sequence4 = "light_female_lookde.dsq look"; sequence5 = "light_female_head.dsq head"; sequence6 = "light_female_headside.dsq headside"; sequence7 = "light_female_fall.dsq fall"; sequence8 = "light_female_jet.dsq jet"; sequence9 = "light_female_land.dsq land"; sequence10 = "light_female_jump.dsq jump"; sequence11 = "light_female_recoilde.dsq light_recoil"; sequence12 = "light_female_scoutroot.dsq scoutroot"; sequence13 = "light_female_looksn.dsq looksn"; sequence14 = "light_female_lookms.dsq lookms"; sequence15 = "light_female_sitting.dsq sitting"; sequence16 = "light_female_idlepda.dsq pda"; sequence17 = "light_female_diehead.dsq death1"; sequence18 = "light_female_diechest.dsq death2"; sequence19 = "light_female_dieback.dsq death3"; sequence20 = "light_female_diesidelf.dsq death4"; sequence21 = "light_female_diesidert.dsq death5"; sequence22 = "light_female_dieleglf.dsq death6"; sequence23 = "light_female_dielegrt.dsq death7"; sequence24 = "light_female_dieslump.dsq death8"; sequence25 = "light_female_dieknees.dsq death9"; sequence26 = "light_female_dieforward.dsq death10"; sequence27 = "light_female_diespin.dsq death11"; sequence28 = "light_female_celsalute.dsq cel1"; sequence29 = "light_female_celwave.dsq cel2"; sequence30 = "light_female_tauntbest.dsq cel3"; sequence31 = "light_female_tauntimp.dsq cel4"; sequence32 = "light_female_celdance.dsq cel5"; sequence33 = "light_female_tauntkiss.dsq cel6"; sequence34 = "light_female_tauntbutt.dsq cel7"; sequence35 = "light_female_celbow.dsq cel8"; sequence36 = "light_female_ski.dsq ski"; sequence37 = "light_female_standjump.dsq standjump"; sequence38 = "light_female_looknw.dsq looknw"; }; PK !(+scripts/light_male.csdatablock TSShapeConstructor(LightMaleDts) { baseShape = "light_male.dts"; sequence0 = "light_male_root.dsq root"; sequence1 = "light_male_forward.dsq run"; sequence2 = "light_male_back.dsq back"; sequence3 = "light_male_side.dsq side"; sequence4 = "light_male_lookde.dsq look"; sequence5 = "light_male_head.dsq head"; sequence6 = "light_male_fall.dsq fall"; sequence7 = "light_male_jet.dsq jet"; sequence8 = "light_male_land.dsq land"; sequence9 = "light_male_jump.dsq jump"; sequence10 = "light_male_diehead.dsq death1"; sequence11 = "light_male_diechest.dsq death2"; sequence12 = "light_male_dieback.dsq death3"; sequence13 = "light_male_diesidelf.dsq death4"; sequence14 = "light_male_diesidert.dsq death5"; sequence15 = "light_male_dieleglf.dsq death6"; sequence16 = "light_male_dielegrt.dsq death7"; sequence17 = "light_male_dieslump.dsq death8"; sequence18 = "light_male_dieknees.dsq death9"; sequence19 = "light_male_dieforward.dsq death10"; sequence20 = "light_male_diespin.dsq death11"; sequence21 = "light_male_idlepda.dsq pda"; sequence22 = "light_male_looksn.dsq looksn"; sequence23 = "light_male_lookms.dsq lookms"; sequence24 = "light_male_scoutroot.dsq scoutroot"; sequence25 = "light_male_headside.dsq headside"; sequence26 = "light_male_recoilde.dsq light_recoil"; sequence27 = "light_male_sitting.dsq sitting"; sequence28 = "light_male_celsalute.dsq cel1"; sequence29 = "light_male_celwave.dsq cel2"; sequence30 = "light_male_tauntbest.dsq cel3"; sequence31 = "light_male_tauntimp.dsq cel4"; sequence32 = "light_male_celdisco.dsq cel5"; sequence33 = "light_male_celflex.dsq cel6"; sequence34 = "light_male_celtaunt.dsq cel7"; sequence35 = "light_male_celrocky.dsq cel8"; sequence36 = "light_male_ski.dsq ski"; sequence37 = "light_male_standjump.dsq standjump"; sequence38 = "light_male_looknw.dsq looknw"; }; PK !(>-lscripts/lightning.cs//-------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- //-------------------------------------- Sounds // datablock AudioDescription(ThunderDescription) { volume = 1.0; isLooping= false; is3D = true; minDistance= 100.0; MaxDistance= 6400.0; type = $EffectAudioType; }; datablock AudioProfile(thunderCrash1) { filename = "fx/environment/ctmelody1.wav"; description = ThunderDescription; }; datablock AudioProfile(thunderCrash2) { filename = "fx/environment/ctmelody2.wav"; description = ThunderDescription; }; datablock AudioProfile(thunderCrash3) { filename = "fx/environment/ctmelody3.wav"; description = ThunderDescription; }; datablock AudioProfile(thunderCrash4) { filename = "fx/environment/ctmelody4.wav"; description = ThunderDescription; }; datablock AudioProfile(LightningHitSound) { filename = "fx/misc/lightning_impact.wav"; description = AudioExplosion3d; }; //-------------------------------------------------------------------------- //-------------------------------------- Default storm... // // Note to datablock editors: The lightning will randomly choose from the arrays // to build a strike. There are 8 slots for thunder sounds. Make sure all 8 slots // are filled. If necessary, duplicate the sounds/textures into the extra slots. // datablock LightningData(DefaultStorm) { directDamageType = $DamageType::Lightning; directDamage = 0.4; strikeTextures[0] = "special/skyLightning"; strikeSound = LightningHitSound; thunderSounds[0] = thunderCrash1; thunderSounds[1] = thunderCrash2; thunderSounds[2] = thunderCrash3; thunderSounds[3] = thunderCrash4; thunderSounds[4] = thunderCrash1; thunderSounds[5] = thunderCrash2; thunderSounds[6] = thunderCrash3; thunderSounds[7] = thunderCrash4; }; function LightningData::applyDamage(%data, %lightningObj, %targetObject, %position, %normal) { %targetObject.damage(%lightningObj, %position, %data.directDamage, %data.directDamageType); } PK !([Q1$$scripts/liquidProfiles.cs//----------------------------------------------------------------------------- // Liquid Texture Lists // new LiquidProfile(water) { liquidType = "water"; viscosity = "6"; density = "1"; submergeColor = 2/10 @ " " @ 6/10 @ " " @ 6/10 @ " " @ 3/10; surfaceTextures = "4"; surfaceTex0 = "liquidTiles/islandWater01.png"; surfaceTex1 = "liquidTiles/islandWater02.png"; surfaceTex2 = "liquidTiles/islandWater03.png"; surfaceTex3 = "liquidTiles/islandWater04.png"; surfaceTex4 = ""; surfaceTex5 = ""; surfaceTex6 = ""; surfaceTex7 = ""; effectTextures = "2"; effectTex0 = "liquidTiles/modulation03.png"; effectTex1 = "liquidTiles/modulation04.png"; effectTex2 = ""; effectTex3 = ""; effectTex4 = ""; effectTex5 = ""; effectTex6 = ""; effectTex7 = ""; modulatorTextures = "2"; modulatorTex0 = "liquidTiles/modulation03.png"; modulatorTex1 = "liquidTiles/modulation04.png"; modulatorTex2 = ""; modulatorTex3 = ""; waveAmplitude = ".75"; surfacePattern = "serpentine"; surfaceAngle = "30"; surfaceScale = ".05 .05"; effectPattern = "circular"; effectAngle = "-60"; effectScale = ".1 .1"; modulatorPattern = "serpentine"; modulatorAngle = "-30"; modulatorScale = ".07 -.07"; }; new LiquidProfile(oceanWater) { liquidType = "oceanWater"; viscosity = "6"; density = "1"; submergeColor = 2/10 @ " " @ 6/10 @ " " @ 6/10 @ " " @ 3/10; surfaceTextures = "4"; surfaceTex0 = "liquidTiles/islandWater01.png"; surfaceTex1 = "liquidTiles/islandWater02.png"; surfaceTex2 = "liquidTiles/islandWater03.png"; surfaceTex3 = "liquidTiles/islandWater04.png"; surfaceTex4 = ""; surfaceTex5 = ""; surfaceTex6 = ""; surfaceTex7 = ""; effectTextures = "2"; effectTex0 = "liquidTiles/modulation03.png"; effectTex1 = "liquidTiles/modulation04.png"; effectTex2 = ""; effectTex3 = ""; effectTex4 = ""; effectTex5 = ""; effectTex6 = ""; effectTex7 = ""; modulatorTextures = "2"; modulatorTex0 = "liquidTiles/modulation03.png"; modulatorTex1 = "liquidTiles/modulation04.png"; modulatorTex2 = ""; modulatorTex3 = ""; waveAmplitude = ".75"; surfacePattern = "serpentine"; surfaceAngle = "30"; surfaceScale = ".05 .05"; effectPattern = "circular"; effectAngle = "-60"; effectScale = ".1 .1"; modulatorPattern = "serpentine"; modulatorAngle = "-30"; modulatorScale = ".07 -.07"; }; new LiquidProfile(riverWater) { liquidType = "riverWater"; viscosity = "6"; density = "1"; submergeColor = 2/10 @ " " @ 6/10 @ " " @ 6/10 @ " " @ 3/10; surfaceTextures = "4"; surfaceTex0 = "liquidTiles/lushWater01.png"; surfaceTex1 = "liquidTiles/lushWater02.png"; surfaceTex2 = "liquidTiles/lushWater03.png"; surfaceTex3 = "liquidTiles/lushWater04.png"; surfaceTex4 = ""; surfaceTex5 = ""; surfaceTex6 = ""; surfaceTex7 = ""; effectTextures = "2"; effectTex0 = "liquidTiles/modulation03.png"; effectTex1 = "liquidTiles/modulation04.png"; effectTex2 = ""; effectTex3 = ""; effectTex4 = ""; effectTex5 = ""; effectTex6 = ""; effectTex7 = ""; modulatorTextures = "2"; modulatorTex0 = "liquidTiles/modulation03.png"; modulatorTex1 = "liquidTiles/modulation04.png"; modulatorTex2 = ""; modulatorTex3 = ""; waveAmplitude = ".5"; surfacePattern = "serpentine"; surfaceAngle = "30"; surfaceScale = ".05 .05"; effectPattern = "circular"; effectAngle = "-60"; effectScale = ".1 .1"; modulatorPattern = "serpentine"; modulatorAngle = "-30"; modulatorScale = ".07 -.07"; }; new LiquidProfile(stagnantWater) { liquidType = "stagnantWater"; viscosity = "6"; density = "1"; submergeColor = 2/10 @ " " @ 6/10 @ " " @ 6/10 @ " " @ 3/10; surfaceTextures = "4"; surfaceTex0 = "liquidTiles/lushWater01_algae.png"; surfaceTex1 = "liquidTiles/lushWater02_algae.png"; surfaceTex2 = "liquidTiles/lushWater03_algae.png"; surfaceTex3 = "liquidTiles/lushWater04_algae.png"; surfaceTex4 = ""; surfaceTex5 = ""; surfaceTex6 = ""; surfaceTex7 = ""; effectTextures = "2"; effectTex0 = "liquidTiles/modulation03.png"; effectTex1 = "liquidTiles/modulation04.png"; effectTex2 = ""; effectTex3 = ""; effectTex4 = ""; effectTex5 = ""; effectTex6 = ""; effectTex7 = ""; modulatorTextures = "2"; modulatorTex0 = "liquidTiles/modulation03.png"; modulatorTex1 = "liquidTiles/modulation04.png"; modulatorTex2 = ""; modulatorTex3 = ""; waveAmplitude = ".25"; surfacePattern = "circular"; surfaceAngle = "30"; surfaceScale = ".05 .05"; effectPattern = "circular"; effectAngle = "-60"; effectScale = ".1 .1"; modulatorPattern = "serpentine"; modulatorAngle = "-30"; modulatorScale = ".07 -.07"; }; new LiquidProfile(lava) { liquidType = "lava"; viscosity = "15"; density = "1"; submergeColor = 2/10 @ " " @ 6/10 @ " " @ 6/10 @ " " @ 3/10; surfaceTextures = "4"; surfaceTex0 = "terrainTiles/lavarockhot1.png"; surfaceTex1 = "terrainTiles/lavarockhot2.png"; surfaceTex2 = "terrainTiles/lavarockhot3.png"; surfaceTex3 = "terrainTiles/lavarockhot4.png"; surfaceTex4 = ""; surfaceTex5 = ""; surfaceTex6 = ""; surfaceTex7 = ""; effectTextures = "0"; effectTex0 = ""; effectTex1 = ""; effectTex2 = ""; effectTex3 = ""; effectTex4 = ""; effectTex5 = ""; effectTex6 = ""; effectTex7 = ""; modulatorTextures = "0"; modulatorTex0 = ""; modulatorTex1 = ""; modulatorTex2 = ""; modulatorTex3 = ""; waveAmplitude = ".15"; surfacePattern = "circular"; surfaceAngle = "30"; surfaceScale = ".05 .05"; effectPattern = "circular"; effectAngle = "-60"; effectScale = ".1 .1"; modulatorPattern = "none"; modulatorAngle = "0"; modulatorScale = "0 0"; }; new LiquidProfile(hotLava) { liquidType = "hotLava"; viscosity = "15"; density = "1"; submergeColor = 2/10 @ " " @ 6/10 @ " " @ 6/10 @ " " @ 3/10; surfaceTextures = "4"; surfaceTex0 = "terrainTiles/lavarockhot1.png"; surfaceTex1 = "terrainTiles/lavarockhot2.png"; surfaceTex2 = "terrainTiles/lavarockhot3.png"; surfaceTex3 = "terrainTiles/lavarockhot4.png"; surfaceTex4 = ""; surfaceTex5 = ""; surfaceTex6 = ""; surfaceTex7 = ""; effectTextures = "0"; effectTex0 = ""; effectTex1 = ""; effectTex2 = ""; effectTex3 = ""; effectTex4 = ""; effectTex5 = ""; effectTex6 = ""; effectTex7 = ""; modulatorTextures = "0"; modulatorTex0 = ""; modulatorTex1 = ""; modulatorTex2 = ""; modulatorTex3 = ""; waveAmplitude = ".15"; surfacePattern = "circular"; surfaceAngle = "30"; surfaceScale = ".05 .05"; effectPattern = "circular"; effectAngle = "-60"; effectScale = ".1 .1"; modulatorPattern = "none"; modulatorAngle = "0"; modulatorScale = "0 0"; }; new LiquidProfile(crustyLava) { liquidType = "lava"; viscosity = "15"; density = "1"; submergeColor = 2/10 @ " " @ 6/10 @ " " @ 6/10 @ " " @ 3/10; surfaceTextures = "4"; surfaceTex0 = "terrainTiles/muddyash1.png"; surfaceTex1 = "terrainTiles/muddyash2.png"; surfaceTex2 = "terrainTiles/muddyash3.png"; surfaceTex3 = "terrainTiles/muddyash4.png"; surfaceTex4 = ""; surfaceTex5 = ""; surfaceTex6 = ""; surfaceTex7 = ""; effectTextures = "0"; effectTex0 = ""; effectTex1 = ""; effectTex2 = ""; effectTex3 = ""; effectTex4 = ""; effectTex5 = ""; effectTex6 = ""; effectTex7 = ""; modulatorTextures = "0"; modulatorTex0 = ""; modulatorTex1 = ""; modulatorTex2 = ""; modulatorTex3 = ""; waveAmplitude = ".05"; surfacePattern = "circular"; surfaceAngle = "30"; surfaceScale = ".05 .05"; effectPattern = "circular"; effectAngle = "-60"; effectScale = ".02 .02"; modulatorPattern = "none"; modulatorAngle = "0"; modulatorScale = "0 0"; }; new LiquidProfile(quicksand) { liquidType = "quicksand"; viscosity = "15"; density = "1"; submergeColor = 2/10 @ " " @ 6/10 @ " " @ 6/10 @ " " @ 3/10; surfaceTextures = "4"; surfaceTex0 = "terrainTiles/mossDirt1.png"; surfaceTex1 = "terrainTiles/mossDirt2.png"; surfaceTex2 = "terrainTiles/mossDirt3.png"; surfaceTex3 = "terrainTiles/mossDirt4.png"; surfaceTex4 = ""; surfaceTex5 = ""; surfaceTex6 = ""; surfaceTex7 = ""; effectTextures = "0"; effectTex0 = ""; effectTex1 = ""; effectTex2 = ""; effectTex3 = ""; effectTex4 = ""; effectTex5 = ""; effectTex6 = ""; effectTex7 = ""; modulatorTextures = "0"; modulatorTex0 = ""; modulatorTex1 = ""; modulatorTex2 = ""; modulatorTex3 = ""; waveAmplitude = ".025"; surfacePattern = "circular"; surfaceAngle = "30"; surfaceScale = ".02 .02"; effectPattern = "circular"; effectAngle = "-60"; effectScale = ".01 .01"; modulatorPattern = "none"; modulatorAngle = "0"; modulatorScale = "0 0"; }; PK !('h..scripts/loadingGui.cs//------------------------------------------------------------------------------ // // LoadingGui.cs // //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function LoadingGui::onAdd(%this) { %this.qLineCount = 0; } //------------------------------------------------------------------------------ function LoadingGui::onWake(%this) { if ( $HudHandle[shellScreen] !$= "" ) { alxStop($HudHandle[shellScreen]); $HudHandle[shellScreen] = ""; } $HudHandle[loadingScreen] = alxPlay(LoadingScreenSound, 0, 0, 0); CloseMessagePopup(); } //------------------------------------------------------------------------------ function LoadingGui::onSleep(%this) { // Clear the load info: if ( %this.qLineCount !$= "" ) { for ( %line = 0; %line < %this.qLineCount; %line++ ) %this.qLine[%line] = ""; } %this.qLineCount = 0; LOAD_MapPic.setBitmap( "gui/Loading" ); LOAD_MapName.setText( "" ); LOAD_MapText.setText( "" ); LOAD_MissionType.setText( "" ); LOAD_GameText.setText( "" ); LoadingProgress.setValue( 0 ); alxStop($HudHandle[loadingScreen]); } //------------------------------------------------------------------------------ function clearLoadInfo() { for ( %line = 0; %line < $LoadQuoteLineCount; %line++ ) $LoadQuoteLine[%line] = ""; $LoadQuoteLineCount = 0; for ( %line = 0; %line < $LoadObjLineCount; %line++ ) $LoadObjLine[%line] = ""; $LoadObjLineCount = 0; for ( %line = 0; %line < $LoadRuleLineCount; %line++ ) $LoadRuleLine[%line] = ""; $LoadRuleLineCount = 0; } //------------------------------------------------------------------------------ function buildLoadInfo( %mission, %missionType ) { clearLoadInfo(); $CurrentMission = %mission; $MissionDisplayName = %mission; $MissionTypeDisplayName = %missionType; // Extract the map quote and objectives from the .mis file: %mapFile = "missions/" @ %mission @ ".mis"; %file = new FileObject(); if ( %file.openForRead( %mapFile ) ) { %state = "none"; while ( !%file.isEOF() ) { %line = %file.readLine(); if ( %state $= "none" ) { if ( getSubStr( %line, 0, 17 ) $= "// DisplayName = " ) $MissionDisplayName = getSubStr( %line, 17, 1000 ); else if ( %line $= "//--- MISSION QUOTE BEGIN ---" ) %state = "quote"; else if ( %line $= "//--- MISSION STRING BEGIN ---" ) %state = "objectives"; else if ( %missionType $= "SinglePlayer" ) { if ( getSubStr( %line, 0, 16 ) $= "// PlanetName = " ) $MissionTypeDisplayName = getSubStr( %line, 16, 1000 ); else if ( %line $= "//--- MISSION BLURB BEGIN ---" ) %state = "blurb"; } } else if ( %state $= "quote" ) { if ( %line $= "//--- MISSION QUOTE END ---" ) %state = "none"; else { $LoadQuoteLine[$LoadQuoteLineCount] = getSubStr( %line, 2, 1000 ); $LoadQuoteLineCount++; } } else if ( %state $= "objectives" ) { if ( %line $= "//--- MISSION STRING END ---" ) { if ( %missionType $= "SinglePlayer" ) %state = "none"; else { // Once we've got the end of the mission string, we are through. %state = "done"; break; } } else { %pos = strstr( %line, "]" ); if ( %pos == -1 ) { $LoadObjLine[$LoadObjLineCount] = getSubStr( %line, 2, 1000 ); $LoadObjLineCount++; } else if ( %pos > 3 ) { // Filter objective lines by mission type: %typeList = getSubStr( %line, 3, %pos - 3 ); if ( strstr( %typeList, %missionType ) != -1 ) { $LoadObjLine[$LoadObjLineCount] = getSubStr( %line, %pos + 1, 1000 ); $LoadObjLineCount++; } } else error( "Invalid mission objective line - \"" @ %line @ "\"" ); } } else if ( %state $= "blurb" ) { if ( %line $= "//--- MISSION BLURB END ---" ) { %state = "done"; break; } else { $LoadRuleLine[$LoadRuleLineCount] = getSubStr( %line, 2, 1000 ); $LoadRuleLineCount++; } } } %file.close(); } // Extract the rules of engagement from the Game.cs file: if ( %missionType !$= "SinglePlayer" ) { %gameFile = "scripts/" @ %missionType @ "Game.cs"; if ( %file.openForRead( %gameFile ) ) { %state = "none"; while ( !%file.isEOF() ) { %line = %file.readLine(); if ( %state $= "none" ) { if ( getSubStr( %line, 0, 17 ) $= "// DisplayName = " ) $MissionTypeDisplayName = getSubStr( %line, 17, 1000 ); if ( %line $= "//--- GAME RULES BEGIN ---" ) %state = "rules"; } else if ( %state $= "rules" ) { if ( %line $= "//--- GAME RULES END ---" ) { %state = "done"; break; } else { $LoadRuleLine[$LoadRuleLineCount] = getSubStr( %line, 2, 1000 ); $LoadRuleLineCount++; } } } %file.close(); } } %file.delete(); } //------------------------------------------------------------------------------ function dumpLoadInfo() { echo( "Mission = \"" @ $MissionDisplayName @ "\", Mission Type = \"" @ $MissionTypeDisplayName @ "\"" ); echo( "MISSION QUOTE: ( " @ $LoadQuoteLineCount @ " lines )" ); for ( %line = 0; %line < $LoadQuoteLineCount; %line++ ) echo( $LoadQuoteLine[%line] ); echo( " " ); echo( "MISSION STRING: ( " @ $LoadObjLineCount @ " lines )" ); for ( %line = 0; %line < $LoadObjLineCount; %line++ ) echo( $LoadObjLine[%line] ); echo( " " ); echo( "GAME RULES: ( " @ $LoadRuleLineCount @ " lines )" ); for ( %line = 0; %line < $LoadRuleLineCount; %line++ ) echo( $LoadRuleLine[%line] ); } //------------------------------------------------------------------------------ function sendLoadInfoToClient( %client ) { //error( "** SENDING LOAD INFO TO CLIENT " @ %client @ "! **" ); %singlePlayer = $CurrentMissionType $= "SinglePlayer"; messageClient( %client, 'MsgLoadInfo', "", $CurrentMission, $MissionDisplayName, $MissionTypeDisplayName ); // Send map quote: for ( %line = 0; %line < $LoadQuoteLineCount; %line++ ) { if ( $LoadQuoteLine[%line] !$= "" ) messageClient( %client, 'MsgLoadQuoteLine', "", $LoadQuoteLine[%line] ); } // Send map objectives: if ( %singlePlayer ) { switch ( $pref::TrainingDifficulty ) { case 2: %diff = "Medium"; case 3: %diff = "Hard"; default: %diff = "Easy"; } messageClient( %client, 'MsgLoadObjectiveLine', "", "DIFFICULTY: " @ %diff ); } for ( %line = 0; %line < $LoadObjLineCount; %line++ ) { if ( $LoadObjLine[%line] !$= "" ) messageClient( %client, 'MsgLoadObjectiveLine', "", $LoadObjLine[%line], !%singlePlayer ); } // Send rules of engagement: if ( !%singlePlayer ) messageClient( %client, 'MsgLoadRulesLine', "", "RULES OF ENGAGEMENT:", false ); for ( %line = 0; %line < $LoadRuleLineCount; %line++ ) { if ( $LoadRuleLine[%line] !$= "" ) messageClient( %client, 'MsgLoadRulesLine', "", $LoadRuleLine[%line], !%singlePlayer ); } messageClient( %client, 'MsgLoadInfoDone' ); } //------------------------------------------------------------------------------ addMessageCallback( 'MsgLoadInfo', handleLoadInfoMessage ); addMessageCallback( 'MsgLoadQuoteLine', handleLoadQuoteLineMessage ); addMessageCallback( 'MsgLoadObjectiveLine', handleLoadObjectiveLineMessage ); addMessageCallback( 'MsgLoadRulesLine', handleLoadRulesLineMessage ); addMessageCallback( 'MsgLoadInfoDone', handleLoadInfoDoneMessage ); //------------------------------------------------------------------------------ function handleLoadInfoMessage( %msgType, %msgString, %bitmapName, %mapName, %missionType ) { // Clear all of the loading info lines: for ( %line = 0; %line < LoadingGui.qLineCount; %line++ ) LoadingGui.qLine[%line] = ""; LoadingGui.qLineCount = 0; for ( %line = 0; %line < LobbyGui.objLineCount; %line++ ) LobbyGui.objLine[%line] = ""; LobbyGui.objLineCount = 0; if (!isDemo()) %loadBmp = "gui/load_" @ %bitmapName @ ".png"; else %loadBmp = "gui/load_" @ %bitmapName @ ".bm8"; if ( !isFile( "textures/" @ %loadBmp ) ) %loadBmp = "gui/loading"; LOAD_MapPic.setBitmap( %loadBmp ); LOAD_MapName.setText( %mapName ); LOAD_MissionType.setText( %missionType ); LOAD_MapText.setText( "" ); LOAD_GameText.setText( "" ); } //------------------------------------------------------------------------------ function handleLoadQuoteLineMessage( %msgType, %msgString, %line ) { LoadingGui.qLine[LoadingGui.qLineCount] = %line; LoadingGui.qLineCount++; %text = ""; for ( %line = 0; %line < LoadingGui.qLineCount - 1; %line++ ) %text = %text @ LoadingGui.qLine[%line] @ "\n"; %text = %text @ ""; %text = %text @ LoadingGui.qLine[%line] @ "\n"; // tag line LOAD_MapText.setText( %text ); } //------------------------------------------------------------------------------ function handleLoadObjectiveLineMessage( %msgType, %msgString, %line, %bulletStyle ) { LobbyGui.objLine[LobbyGui.objLineCount] = %line; LobbyGui.objLineCount++; if ( %bulletStyle ) %line = "" @ %line @ ""; %newText = LOAD_MapText.getText(); if ( %newText $= "" ) // In case there's no quote %newText = %line; else %newText = %newText NL %line; LOAD_MapText.setText( %newText ); } //------------------------------------------------------------------------------ function handleLoadRulesLineMessage( %msgType, %msgString, %line, %bulletStyle ) { if ( %bulletStyle ) %line = "" @ %line @ ""; %newText = LOAD_GameText.getText(); if ( %newText $= "" ) %newText = %line; else %newText = %newText NL %line; LOAD_GameText.setText( %newText ); } //------------------------------------------------------------------------------ function handleLoadInfoDoneMessage( %msgType, %msgString ) { LoadingGui.gotLoadInfo = true; }PK !(--scripts/lushPropMap.cs//-------------------------------------- Desert interior texture property mapping addMaterialMapping("lush/be_ichute01", "environment: special/chuteTexture 0.25"); addMaterialMapping("lush/be_ichute02", "environment: special/chuteTexture 0.25"); //"Color: red green blue startAlpha endAlpha" //Soft sound = 0 //Hard sound = 1 //Metal sound = 2 //Snow sound = 3 addMaterialMapping("terrain/LushWorld.DirtMossy", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/LushWorld.GrassDark", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/LushWorld.GrassLight", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/LushWorld.GrassMixed", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/LushWorld.LakeBed", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/LushWorld.RockLight", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0"); addMaterialMapping("terrain/LushWorld.RockMossy", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0"); PK !(.scripts/markers.cs//------------------------------------------------------------------------------ //* Markers //------------------------------------------------------------------------------ datablock MissionMarkerData(WayPointMarker) { catagory = "Misc"; shapeFile = "octahedron.dts"; }; datablock MissionMarkerData(SpawnSphereMarker) { catagory = "Misc"; shapeFile = "octahedron.dts"; }; datablock MissionMarkerData(AIObjectiveMarker) { catagory = "Misc"; shapeFile = "octahedron.dts"; }; datablock MissionMarkerData(FlagMarker) { shapeFile = "octahedron.dts"; hudImageNameFriendly[0] = "small_triangle"; hudImageNameEnemy[0] = "small_triangle"; hudRenderModulated[0] = true; hudRenderAlways[0] = true; hudRenderCenter[0] = true; hudRenderDistance[0] = true; hudRenderName[0] = true; }; //------------------------------------------------------------------------------ // - serveral marker types may share MissionMarker datablock type function MissionMarkerData::create(%block) { switch$(%block) { case "WayPointMarker": %obj = new WayPoint() { dataBlock = %block; }; return(%obj); case "SpawnSphereMarker": %obj = new SpawnSphere() { datablock = %block; }; return(%obj); case "AIObjectiveMarker": %obj = new AIObjective() { datablock = %block; }; return(%obj); } return(-1); }PK !(uY  scripts/medium_female.csdatablock TSShapeConstructor(MediumFemaleDts) { baseShape = "medium_female.dts"; sequence0 = "medium_female_root.dsq root"; sequence1 = "medium_female_forward.dsq run"; sequence2 = "medium_female_back.dsq back"; sequence3 = "medium_female_side.dsq side"; sequence4 = "medium_female_lookde.dsq look"; sequence5 = "medium_female_head.dsq head"; sequence6 = "medium_female_headside.dsq headside"; sequence7 = "medium_female_fall.dsq fall"; sequence8 = "medium_female_jet.dsq jet"; sequence9 = "medium_female_land.dsq land"; sequence10 = "medium_female_jump.dsq jump"; sequence11 = "medium_female_recoilde.dsq light_recoil"; sequence12 = "medium_female_looksn.dsq looksn"; sequence13 = "medium_female_lookms.dsq lookms"; sequence14 = "medium_female_sitting.dsq sitting"; sequence15 = "medium_female_idlepda.dsq pda"; sequence16 = "medium_female_diehead.dsq death1"; sequence17 = "medium_female_diechest.dsq death2"; sequence18 = "medium_female_dieback.dsq death3"; sequence19 = "medium_female_diesidelf.dsq death4"; sequence20 = "medium_female_diesidert.dsq death5"; sequence21 = "medium_female_dieleglf.dsq death6"; sequence22 = "medium_female_dielegrt.dsq death7"; sequence23 = "medium_female_dieslump.dsq death8"; sequence24 = "medium_female_dieknees.dsq death9"; sequence25 = "medium_female_dieforward.dsq death10"; sequence26 = "medium_female_diespin.dsq death11"; sequence27 = "medium_female_celsalute.dsq cel1"; sequence28 = "medium_female_celwave.dsq cel2"; sequence29 = "medium_female_tauntbest.dsq cel3"; sequence30 = "medium_female_tauntimp.dsq cel4"; sequence31 = "medium_female_celdisco.dsq cel5"; sequence32 = "medium_female_tauntkiss.dsq cel6"; sequence33 = "medium_female_tauntbutt.dsq cel7"; sequence34 = "medium_female_celbow.dsq cel8"; sequence35 = "medium_female_ski.dsq ski"; sequence36 = "medium_female_standjump.dsq standjump"; sequence37 = "medium_female_looknw.dsq looknw"; };PK !(Dxscripts/medium_male.cs datablock TSShapeConstructor(MediumMaleDts) { baseShape = "medium_male.dts"; sequence0 = "medium_male_root.dsq root"; sequence1 = "medium_male_forward.dsq run"; sequence2 = "medium_male_back.dsq back"; sequence3 = "medium_male_side.dsq side"; sequence4 = "medium_male_lookde.dsq look"; sequence5 = "medium_male_head.dsq head"; sequence6 = "medium_male_fall.dsq fall"; sequence7 = "medium_male_jet.dsq jet"; sequence8 = "medium_male_land.dsq land"; sequence9 = "medium_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 = "medium_male_sitting.dsq sitting"; sequence15 = "medium_male_diehead.dsq death1"; sequence16 = "medium_male_diechest.dsq death2"; sequence17 = "medium_male_dieback.dsq death3"; sequence18 = "medium_male_diesidelf.dsq death4"; sequence19 = "medium_male_diesidert.dsq death5"; sequence20 = "medium_male_dieleglf.dsq death6"; sequence21 = "medium_male_diechest.dsq death7"; // medium_male_dielegrt sequence22 = "medium_male_dieback.dsq death8"; sequence23 = "medium_male_dieknees.dsq death9"; sequence24 = "medium_male_dieforward.dsq death10"; sequence25 = "medium_male_diespin.dsq death11"; sequence26 = "medium_male_idlepda.dsq pda"; sequence27 = "medium_male_celsalute.dsq cel1"; sequence28 = "medium_male_celwave.dsq cel2"; sequence29 = "medium_male_tauntbest.dsq cel3"; sequence30 = "medium_male_tauntimp.dsq cel4"; sequence31 = "medium_male_celdance.dsq cel5"; sequence32 = "medium_male_celflex.dsq cel6"; sequence33 = "medium_male_celtaunt.dsq cel7"; sequence34 = "medium_male_celrocky.dsq cel8"; sequence35 = "medium_male_ski.dsq ski"; sequence36 = "medium_male_standjump.dsq standjump"; sequence37 = "medium_male_looknw.dsq looknw"; }; PK !(ty4y4scripts/message.cs$MaxMessageWavLength = 5200; function addMessageCallback(%msgType, %func) { for(%i = 0; (%afunc = $MSGCB[%msgType, %i]) !$= ""; %i++) { // only add each callback once if(%afunc $= %func) return; } $MSGCB[%msgType, %i] = %func; } function messagePump(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7 ,%a8, %a9, %a10) { clientCmdServerMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10); } function clientCmdServerMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10) { %tag = getWord(%msgType, 0); for(%i = 0; (%func = $MSGCB["", %i]) !$= ""; %i++) call(%func, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10); if(%tag !$= "") for(%i = 0; (%func = $MSGCB[%tag, %i]) !$= ""; %i++) call(%func, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10); } function defaultMessageCallback(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10) { if ( %msgString $= "" ) return; %message = detag( %msgString ); // search for wav tag marker %wavStart = strstr( %message, "~w" ); if ( %wavStart != -1 ) { %wav = getSubStr( %message, %wavStart + 2, 1000 ); %wavLengthMS = alxGetWaveLen( %wav ); if ( %wavLengthMS <= $MaxMessageWavLength ) { %handle = alxCreateSource( AudioChat, %wav ); alxPlay( %handle ); } else error( "WAV file \"" @ %wav @ "\" is too long! **" ); %message = getSubStr( %message, 0, %wavStart ); if ( %message !$= "" ) addMessageHudLine( %message ); } else addMessageHudLine( %message ); } //-------------------------------------------------------------------------- function handleClientJoin(%msgType, %msgString, %clientName, %clientId, %targetId, %isAI, %isAdmin, %isSuperAdmin, %isSmurf, %guid) { logEcho("got client join: " @ detag(%clientName) @ " : " @ %clientId); //create the player list group, and add it to the ClientConnectionGroup... if(!isObject("PlayerListGroup")) { %newGroup = new SimGroup("PlayerListGroup"); ClientConnectionGroup.add(%newGroup); } %player = new ScriptObject() { className = "PlayerRep"; name = detag(%clientName); guid = %guid; clientId = %clientId; targetId = %targetId; teamId = 0; // start unassigned score = 0; ping = 0; packetLoss = 0; chatMuted = false; canListen = false; voiceEnabled = false; isListening = false; isBot = %isAI; isAdmin = %isAdmin; isSuperAdmin = %isSuperAdmin; isSmurf = %isSmurf; }; PlayerListGroup.add(%player); $PlayerList[%clientId] = %player; if ( !%isAI ) getPlayerPrefs(%player); lobbyUpdatePlayer( %clientId ); } function handleClientDrop( %msgType, %msgString, %clientName, %clientId ) { logEcho("got client drop: " @ detag(%clientName) @ " : " @ %clientId); %player = $PlayerList[%clientId]; if( %player ) { %player.delete(); $PlayerList[%clientId] = ""; lobbyRemovePlayer( %clientId ); } } function handleClientJoinTeam( %msgType, %msgString, %clientName, %teamName, %clientId, %teamId ) { %player = $PlayerList[%clientId]; if( %player ) { %player.teamId = %teamId; lobbyUpdatePlayer( %clientId ); } } function handleClientNameChanged( %msgType, %msgString, %oldName, %newName, %clientId ) { %player = $PlayerList[%clientId]; if( %player ) { %player.name = detag( %newName ); lobbyUpdatePlayer( %clientId ); } } addMessageCallback("", defaultMessageCallback); addMessageCallback('MsgClientJoin', handleClientJoin); addMessageCallback('MsgClientDrop', handleClientDrop); addMessageCallback('MsgClientJoinTeam', handleClientJoinTeam); addMessageCallback('MsgClientNameChanged', handleClientNameChanged); //--------------------------------------------------------------------------- // Client chat'n //--------------------------------------------------------------------------- function isClientChatMuted(%client) { %player = $PlayerList[%client]; if(%player) return(%player.chatMuted ? true : false); return(true); } //--------------------------------------------------------------------------- function clientCmdChatMessage(%sender, %voice, %pitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10) { %message = detag( %msgString ); %voice = detag( %voice ); if ( ( %message $= "" ) || isClientChatMuted( %sender ) ) return; // search for wav tag marker %wavStart = strstr( %message, "~w" ); if ( %wavStart == -1 ) addMessageHudLine( %message ); else { %wav = getSubStr(%message, %wavStart + 2, 1000); if (%voice !$= "") %wavFile = "voice/" @ %voice @ "/" @ %wav @ ".wav"; else %wavFile = %wav; //only play voice files that are < 5000ms in length if (%pitch < 0.5 || %pitch > 2.0) %pitch = 1.0; %wavLengthMS = alxGetWaveLen(%wavFile) * %pitch; if (%wavLengthMS < $MaxMessageWavLength ) { if ( $ClientChatHandle[%sender] != 0 ) alxStop( $ClientChatHandle[%sender] ); $ClientChatHandle[%sender] = alxCreateSource( AudioChat, %wavFile ); //pitch the handle if (%pitch != 1.0) alxSourcef($ClientChatHandle[%sender], "AL_PITCH", %pitch); alxPlay( $ClientChatHandle[%sender] ); } else error( "** WAV file \"" @ %wavFile @ "\" is too long! **" ); %message = getSubStr(%message, 0, %wavStart); addMessageHudLine(%message); } } //--------------------------------------------------------------------------- function clientCmdCannedChatMessage( %sender, %msgString, %name, %string, %keys, %voiceTag, %pitch ) { %message = detag( %msgString ); %voice = detag( %voiceTag ); if ( $defaultVoiceBinds ) clientCmdChatMessage( %sender, %voice, %pitch, "[" @ %keys @ "]" SPC %message ); else clientCmdChatMessage( %sender, %voice, %pitch, %message ); } //--------------------------------------------------------------------------- // silly spam protection... $SPAM_PROTECTION_PERIOD = 10000; $SPAM_MESSAGE_THRESHOLD = 4; $SPAM_PENALTY_PERIOD = 10000; $SPAM_MESSAGE = '\c3FLOOD PROTECTION:\cr You must wait another %1 seconds.'; function GameConnection::spamMessageTimeout(%this) { if(%this.spamMessageCount > 0) %this.spamMessageCount--; } function GameConnection::spamReset(%this) { %this.isSpamming = false; } function spamAlert(%client) { if($Host::FloodProtectionEnabled != true) return(false); if(!%client.isSpamming && (%client.spamMessageCount >= $SPAM_MESSAGE_THRESHOLD)) { %client.spamProtectStart = getSimTime(); %client.isSpamming = true; %client.schedule($SPAM_PENALTY_PERIOD, spamReset); } if(%client.isSpamming) { %wait = mFloor(($SPAM_PENALTY_PERIOD - (getSimTime() - %client.spamProtectStart)) / 1000); messageClient(%client, "", $SPAM_MESSAGE, %wait); return(true); } %client.spamMessageCount++; %client.schedule($SPAM_PROTECTION_PERIOD, spamMessageTimeout); return(false); } function chatMessageClient( %client, %sender, %voiceTag, %voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ) { //see if the client has muted the sender if ( !%client.muted[%sender] ) commandToClient( %client, 'ChatMessage', %sender, %voiceTag, %voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ); } function cannedChatMessageClient( %client, %sender, %msgString, %name, %string, %keys ) { if ( !%client.muted[%sender] ) commandToClient( %client, 'CannedChatMessage', %sender, %msgString, %name, %string, %keys, %sender.voiceTag, %sender.voicePitch ); } function chatMessageTeam( %sender, %team, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ) { if ( ( %msgString $= "" ) || spamAlert( %sender ) ) return; %count = ClientGroup.getCount(); for ( %i = 0; %i < %count; %i++ ) { %obj = ClientGroup.getObject( %i ); if ( %obj.team == %sender.team ) chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ); } } function cannedChatMessageTeam( %sender, %team, %msgString, %name, %string, %keys ) { if ( ( %msgString $= "" ) || spamAlert( %sender ) ) return; %count = ClientGroup.getCount(); for ( %i = 0; %i < %count; %i++ ) { %obj = ClientGroup.getObject( %i ); if ( %obj.team == %sender.team ) cannedChatMessageClient( %obj, %sender, %msgString, %name, %string, %keys ); } } function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ) { if ( ( %msgString $= "" ) || spamAlert( %sender ) ) return; %count = ClientGroup.getCount(); for ( %i = 0; %i < %count; %i++ ) { %obj = ClientGroup.getObject( %i ); if(%sender.team != 0) chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ); else { // message sender is an observer -- only send message to other observers if(%obj.team == %sender.team || %obj.isAdmin || %obj.isSuperAdmin) chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ); } } } function cannedChatMessageAll( %sender, %msgString, %name, %string, %keys ) { if ( ( %msgString $= "" ) || spamAlert( %sender ) ) return; %count = ClientGroup.getCount(); for ( %i = 0; %i < %count; %i++ ) cannedChatMessageClient( ClientGroup.getObject(%i), %sender, %msgString, %name, %string, %keys ); } //--------------------------------------------------------------------------- function messageClient(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13) { commandToClient(%client, 'ServerMessage', %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13); } function messageTeam(%team, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13) { %count = ClientGroup.getCount(); for(%cl= 0; %cl < %count; %cl++) { %recipient = ClientGroup.getObject(%cl); if(%recipient.team == %team) messageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13); } } function messageTeamExcept(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13) { %team = %client.team; %count = ClientGroup.getCount(); for(%cl= 0; %cl < %count; %cl++) { %recipient = ClientGroup.getObject(%cl); if((%recipient.team == %team) && (%recipient != %client)) messageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13); } } function messageAll(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13) { %count = ClientGroup.getCount(); for(%cl = 0; %cl < %count; %cl++) { %client = ClientGroup.getObject(%cl); messageClient(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13); } } function messageAllExcept(%client, %team, %msgtype, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13) { //can exclude a client, a team or both. A -1 value in either field will ignore that exclusion, so //messageAllExcept(-1, -1, $Mesblah, 'Blah!'); will message everyone (since there shouldn't be a client -1 or client on team -1). %count = ClientGroup.getCount(); for(%cl= 0; %cl < %count; %cl++) { %recipient = ClientGroup.getObject(%cl); if((%recipient != %client) && (%recipient.team != %team)) messageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13); } } //--------------------------------------------------------------------------- // functions to support repair messaging //--------------------------------------------------------------------------- function clientCmdTeamRepairMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { if(!$pref::ignoreTeamRepairMessages) clientCmdServerMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6); } function teamRepairMessage(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %team = %client.team; %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %recipient = ClientGroup.getObject(%cl); if((%recipient.team == %team) && (%recipient != %client)) commandToClient(%recipient, 'TeamRepairMessage', %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6); } } PK !(B' scripts/navGraph.cs// // functions for ai nav graph // $OFFLINE_NAV_BUILD = false; function NavGraph::generateInterior() { %p = new FloorPlan(); %p.generate(); %p.upload(); %p.delete(); } //---------------------------------------------------------------------------- function NavGraph::exteriorInspect() { %eInspector = new GroundPlan(); %area = MissionArea.getArea(); %minx = getWord(%area, 0); %miny = getWord(%area, 1); %extentx = getWord(%area, 2); %extenty = getWord(%area, 3); %point = %minx @ " " @ %miny; %extents = %extentx @ " " @ %extenty; %eInspector.inspect(%point, %extents); // this does the upload as well %eInspector.delete(); } //---------------------------------------------------------------------------- function BuildNavigationGraph(%type) { exec("scripts/graphBuild.cs"); echo("Building Navigation Graph..."); // disable asserts $FP::DisableAsserts = true; $OFFLINE_NAV_BUILD = true; if(%type $= "nav") { makeJettableGraphOffline(Nav); doTablebuildOffline(); } else if(%type $= "spn") makeJettableGraphOffline(Spawn); else echo("unknown type for nav build!"); navGraph.saveGraph(); writeNavMetrics(); } function NavigationGraph::navBuildComplete() { echo( "Navigation Graph build complete." ); if( $OFFLINE_NAV_BUILD ) { quit(); } } // this will keep mod authors happy since they can create new // traversable shapes, and it will be handled by the navigation system function FloorPlan::staticShapeListConstruct(%this) { %group = nameToId("MissionGroup"); %group.findStaticShapes(%this); } function FloorPlan::gameBaseListConstruct(%this) { %group = nameToId("MissionGroup"); %group.findGameBaseItems(%this); } function SimGroup::findGameBaseItems(%this, %floorPlan) { for(%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).findGameBaseItems(%floorPlan); } function GameBase::findGameBaseItems(%this, %floorPlan) { %floorPlan.addHintPoint(%this.getWorldBoxCenter()); } function SimGroup::findStaticShapes(%this, %floorPlan) { for(%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).findStaticShapes(%floorPlan); } function GameBase::findStaticShapes(%this, %floorPlan) { %this.getDataBlock().findStaticShapes(%this, %floorPlan); } function StationInventory::findStaticShapes(%data, %object, %floorPlan) { %floorPlan.addStaticCenter(%object); } function StationVehiclePad::findStaticShapes(%data, %object, %floorPlan) { %floorPlan.addStaticGeom(%object); } function installNavThreats() { %group = nameToId("MissionGroup"); %group.findTurretThreats(); } function SimObject::findTurretThreats(%this) { //declared here } function SimGroup::findTurretThreats(%this) { for(%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).findTurretThreats(); } function GameBase::findTurretThreats(%this) { %this.getDataBlock().findTurretThreats(%this); } function TurretData::findTurretThreats(%data, %turret) { %attackRadius = %turret.getMountedImage(0).attackRadius; NavGraph.installThreat(%turret, %turret.team, %attackRadius); } function fpStart(%useSpecial) { $fp = new FloorPlan(); $fp::special = %useSpecial; $fp.generate(); } function fpEnd() { if($fp > 0) $fp.delete(); } function writeNavMetrics() { navGraph.dumpInfo2File(); }PK !(H֮scripts/objectiveHud.cs// Mission type-dependent objective HUDs // TR2 additions $TR2::Color::CarrierEnemy = "205 0 0 100"; $TR2::Color::CarrierFriendly = "0 205 0 100"; $TR2::Color::CarrierNeutral = "190 190 190 100"; $TR2::DebriefGuiLoaded = 0; addMessageCallback('MsgClientReady', setCameraSpeedState); function setCameraSpeedState(%msgType, %msgString, %gameType, %a2, %a3, %a4, %a5, %a6) { if( detag(%gameType) $= "TR2Game" ) { $_Camera::movementSpeed = $Camera::movementSpeed; $Camera::movementSpeed = 80; } else { %val = $_Camera::movementSpeed $= "" ? 40 : $_Camera::movementSpeed; $Camera::movementSpeed = %val; } } ///// -MISSION START- ////////////////////////////////////////////////////////////// addMessageCallback('MsgClientReady', clientReadyMSG); function clientReadyMSG(%msgType, %msgString, %gameType, %a2, %a3, %a4, %a5, %a6) { clearObjHudMSG(); setupObjHud(%gameType); } addMessageCallback('MsgClearObjHud', clearObjHudMSG); function clearObjHudMSG(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { // clear the separator lines objectiveHud.setSeparators(""); objectiveHud.disableHorzSeparator(); //remove everything in the objective Hud while (objectiveHud.getCount() > 0) objectiveHud.getObject(0).delete(); } // TR2 Message Callbacks - AO //----------------------- // 05-13 removed the team size window // 05-13 Removed syntax bug in hud (doh!) // Created separate message type/callback and serverside function for adjusting bonus value // Scores can now be updated independantly of bons value // // NEED TO ADD CODE TO MESSAGE CLIENT THE BONUS VALUE AND TEAM WHEN THEY JOIN!!! addMessageCallback('MsgTR2UpdateBonus', handleTR2UpdateBonus); addMessageCallback('MsgTR2ObjInit', TR2HudInit); function TR2HudInit(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9) { objectiveHud.teamName[1].setValue(detag(%a1)); objectiveHud.teamName[2].setValue(detag(%a2)); objectiveHud.teamScore[1].setValue(detag(%a3)); objectiveHud.teamScore[2].setValue(detag(%a4)); objectiveHud.carrierName.setValue(detag(%a5)); objectiveHud.carrierHealth.setValue(detag(%a6)); TR2BonusObject.doBonus(%a7, $TR2::NeutralColor); } addMessageCallback('MsgTR2SetScore', handleTR2SetScore); function handleTR2SetScore(%msgType, %msgString, %team, %score) { %team = detag(%team); objectiveHud.teamScore[%team].setValue( detag(%score) ); } // end TR2 message callbacks - AO // REPLACE profile definition in objectiveHud.cs new GuiControlProfile ("TR2CarrierHealth") { opaque = false; fillColor = "0 205 0 100"; border = true; borderColor = "190 190 190 100"; }; addMessageCallback('MsgTR2FlagStatus', handleTR2FlagStatus); function handleTR2FlagStatus(%msgType, %msgString, %location) { objectiveHud.carrierName.setValue(detag(%location)); } addMessageCallback('MsgTR2FlagTaken', handleTR2FlagTaken); function handleTR2FlagTaken(%msgType, %msgString, %client, %team, %flagteam, %clientnamebase) { objectiveHud.carrierName.setValue(detag(%client)); } addMessageCallback('MsgTR2FlagDropped', handleTR2FlagDropped); function handleTR2FlagDropped(%msgType, %msgString, %client, %team, %flagteam) { objectiveHud.carrierName.setValue("Dropped"); } addMessageCallback('MsgTR2CarrierHealth', handleTR2CarrierHealth); function handleTR2CarrierHealth(%msgType, %msgString, %amt, %team) { if( detag(%team) == 1 ) // carrier is on our team { objectiveHud.carrierHealth.profile.fillColor = $TR2::Color::CarrierFriendly; } else { objectiveHud.carrierHealth.profile.fillColor = $TR2::Color::CarrierEnemy; } objectiveHud.carrierHealth.setValue(detag(%amt)); } function setupObjHud(%gameType) { if(%gameType $= "PracticeCTFGame" || %gameType $= "CTFPlusGame") %gameType = "CTFGame"; objectiveHud.gameType = %gameType; // TR2 additions if( %gameType $= "TR2Game" ) { if( $TR2::DebriefGuiLoaded == 0 ) { if( isObject(DB_ChatDlg) ) DB_ChatDlg.delete(); if( isObject(DebriefGui) ) DebriefGui.delete(); exec("gui/TR2DebriefGui.gui"); $TR2::DebriefGuiLoaded = 1; } } else { if( $TR2::DebriefGuiLoaded == 1 ) { if( isObject(DB_ChatDlg) ) DB_ChatDlg.delete(); if( isObject(DebriefGui) ) DebriefGui.delete(); exec("gui/DebriefGui.gui"); $TR2::DebriefGuiLoaded = 0; } } switch$ (%gameType) { // Begin TR2 hud stuff - AO case TR2Game: // | | | < Carrier Name > // | | | // set separators objectiveHud.setSeparators("104 147"); objectiveHud.enableHorzSeparator(); // Team names objectiveHud.teamName[1] = new GuiTextCtrl() { profile = "GuiTextObjGoldLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "96 16"; visible = "1"; }; objectiveHud.teamName[2] = new GuiTextCtrl() { profile = "GuiTextObjSilverLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "96 16"; visible = "1"; }; // Team scores objectiveHud.teamScore[1] = new GuiTextCtrl() { profile = "GuiTextObjGoldCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "108 3"; extent = "35 16"; visible = "1"; }; objectiveHud.teamScore[2] = new GuiTextCtrl() { profile = "GuiTextObjSilverCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "108 19"; extent = "35 16"; visible = "1"; }; // Bonus objectiveHud.carrierName = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "151 3"; extent = "90 16"; visible = "1"; text = ""; }; objectiveHud.carrierHealth = new GuiProgressCtrl() { profile = "TR2CarrierHealth"; horizSizing = "right"; vertSizing = "bottom"; position = "159 22"; extent = "75 10"; minExtent = "8 8"; visible = "1"; hideCursor = "0"; bypassHideCursor = "0"; helpTag = "0"; }; for(%i = 1; %i <= 2; %i++) { objectiveHud.add(objectiveHud.teamScore[%i]); objectiveHud.add(objectiveHud.teamName[%i]); } objectiveHud.add(objectiveHud.carrierName); objectiveHud.add(objectiveHud.carrierHealth); // end TR2 Hud stuff - AO case BountyGame: // set separators objectiveHud.setSeparators("56 156"); objectiveHud.disableHorzSeparator(); // Your score label ("SCORE") objectiveHud.scoreLabel = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "50 16"; visible = "1"; text = "SCORE"; }; // Your score objectiveHud.yourScore = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "60 3"; extent = "90 16"; visible = "1"; }; // Target label ("TARGET") objectiveHud.targetLabel = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "50 16"; visible = "1"; text = "TARGET"; }; // your target's name objectiveHud.yourTarget = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "60 19"; extent = "90 16"; visible = "1"; }; objectiveHud.add(objectiveHud.scoreLabel); objectiveHud.add(objectiveHud.yourScore); objectiveHud.add(objectiveHud.targetLabel); objectiveHud.add(objectiveHud.yourTarget); case CnHGame: // set separators objectiveHud.setSeparators("96 162 202"); objectiveHud.enableHorzSeparator(); // Team names objectiveHud.teamName[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "90 16"; visible = "1"; }; objectiveHud.teamName[2] = new GuiTextCtrl() { profile = "GuiTextObjHudLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "90 16"; visible = "1"; }; // Team scores objectiveHud.teamScore[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "105 3"; extent = "50 16"; visible = "1"; }; objectiveHud.teamScore[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "105 19"; extent = "50 16"; visible = "1"; }; // Hold label ("HOLD") objectiveHud.holdLabel[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 3"; extent = "35 16"; visible = "1"; text = "HOLD"; }; objectiveHud.holdLabel[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "165 19"; extent = "35 16"; visible = "1"; text = "HOLD"; }; // number of points held objectiveHud.numHeld[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "205 3"; extent = "30 16"; visible = "1"; }; objectiveHud.numHeld[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "205 19"; extent = "30 16"; visible = "1"; }; for(%i = 1; %i <= 2; %i++) { objectiveHud.add(objectiveHud.teamName[%i]); objectiveHud.add(objectiveHud.teamScore[%i]); objectiveHud.add(objectiveHud.holdLabel[%i]); objectiveHud.add(objectiveHud.numHeld[%i]); } case CTFGame: // set separators objectiveHud.setSeparators("75 100 133"); objectiveHud.enableHorzSeparator(); // Team names objectiveHud.teamName[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "68 16"; visible = "1"; }; objectiveHud.teamName[2] = new GuiTextCtrl() { profile = "GuiTextObjHudLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "68 16"; visible = "1"; }; // Team scores objectiveHud.teamScore[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "78 3"; extent = "22 16"; visible = "1"; }; objectiveHud.teamScore[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "78 19"; extent = "22 16"; visible = "1"; }; // Flag label ("FLAG") objectiveHud.flagLabel[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "103 3"; extent = "30 16"; visible = "1"; text = "FLAG"; }; objectiveHud.flagLabel[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "103 19"; extent = "30 16"; visible = "1"; text = "FLAG"; }; // flag location (at base/in field/player carrying it) objectiveHud.flagLocation[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 3"; extent = "102 16"; visible = "1"; }; objectiveHud.flagLocation[2] = new GuiTextCtrl() { profile = "GuiTextObjHudLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "138 19"; extent = "102 16"; visible = "1"; }; for(%i = 1; %i <= 2; %i++) { objectiveHud.add(objectiveHud.teamName[%i]); objectiveHud.add(objectiveHud.teamScore[%i]); objectiveHud.add(objectiveHud.flagLabel[%i]); objectiveHud.add(objectiveHud.flagLocation[%i]); } case DMGame: // set separators objectiveHud.setSeparators("56 96 156"); objectiveHud.disableHorzSeparator(); // Your score label ("SCORE") objectiveHud.scoreLabel = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "50 16"; visible = "1"; text = "SCORE"; }; // Your score objectiveHud.yourScore = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "60 3"; extent = "30 16"; visible = "1"; }; // Your kills label ("KILLS") objectiveHud.killsLabel = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "50 16"; visible = "1"; text = "KILLS"; }; // Your kills objectiveHud.yourKills = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "60 19"; extent = "30 16"; visible = "1"; }; // Your deaths label ("DEATHS") objectiveHud.deathsLabel = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 19"; extent = "50 16"; visible = "1"; text = "DEATHS"; }; // Your deaths objectiveHud.yourDeaths = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "160 19"; extent = "30 16"; visible = "1"; }; objectiveHud.add(objectiveHud.scoreLabel); objectiveHud.add(objectiveHud.yourScore); objectiveHud.add(objectiveHud.killsLabel); objectiveHud.add(objectiveHud.yourKills); objectiveHud.add(objectiveHud.deathsLabel); objectiveHud.add(objectiveHud.yourDeaths); case HuntersGame: // set separators objectiveHud.setSeparators("96 132"); objectiveHud.disableHorzSeparator(); // Your score label ("SCORE") objectiveHud.scoreLabel = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "90 16"; visible = "1"; text = "SCORE"; }; // Your score objectiveHud.yourScore = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 3"; extent = "30 16"; visible = "1"; }; // flags label ("FLAGS") objectiveHud.flagLabel = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "90 16"; visible = "1"; text = "FLAGS"; }; // number of flags objectiveHud.yourFlags = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 19"; extent = "30 16"; visible = "1"; }; objectiveHud.add(objectiveHud.scoreLabel); objectiveHud.add(objectiveHud.yourScore); objectiveHud.add(objectiveHud.flagLabel); objectiveHud.add(objectiveHud.yourFlags); case RabbitGame: // set separators objectiveHud.setSeparators("56 156"); objectiveHud.disableHorzSeparator(); // Your score label ("SCORE") objectiveHud.scoreLabel = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "50 16"; visible = "1"; text = "SCORE"; }; // Your score objectiveHud.yourScore = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "60 3"; extent = "90 16"; visible = "1"; }; // Rabbit label ("RABBIT") objectiveHud.rabbitLabel = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "50 16"; visible = "1"; text = "RABBIT"; }; // rabbit name objectiveHud.rabbitName = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "60 19"; extent = "90 16"; visible = "1"; }; objectiveHud.add(objectiveHud.scoreLabel); objectiveHud.add(objectiveHud.yourScore); objectiveHud.add(objectiveHud.rabbitLabel); objectiveHud.add(objectiveHud.rabbitName); case SiegeGame: // set separators objectiveHud.setSeparators("96 122 177"); objectiveHud.enableHorzSeparator(); // Team names objectiveHud.teamName[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "90 16"; visible = "1"; }; objectiveHud.teamName[2] = new GuiTextCtrl() { profile = "GuiTextObjHudLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "90 16"; visible = "1"; }; // Team scores objectiveHud.teamScore[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 3"; extent = "20 16"; visible = "1"; }; objectiveHud.teamScore[2] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "100 19"; extent = "20 16"; visible = "1"; }; // Role label ("PROTECT" or "DESTROY") objectiveHud.roleLabel[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "125 3"; extent = "50 16"; visible = "1"; }; objectiveHud.roleLabel[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "125 19"; extent = "50 16"; visible = "1"; }; // number of objectives to protect/destroy objectiveHud.objectives[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "180 3"; extent = "60 16"; visible = "1"; }; objectiveHud.objectives[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "180 19"; extent = "60 16"; visible = "1"; }; for(%i = 1; %i <= 2; %i++) { objectiveHud.add(objectiveHud.teamName[%i]); objectiveHud.add(objectiveHud.teamScore[%i]); objectiveHud.add(objectiveHud.roleLabel[%i]); objectiveHud.add(objectiveHud.objectives[%i]); } case TeamHuntersGame: // set separators objectiveHud.setSeparators("57 83 197"); objectiveHud.enableHorzSeparator(); // flags label ("FLAGS") objectiveHud.flagLabel = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "50 16"; visible = "1"; text = "FLAGS"; }; // number of flags objectiveHud.yourFlags = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "60 3"; extent = "20 16"; visible = "1"; }; // team names objectiveHud.teamName[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "85 3"; extent = "110 16"; visible = "1"; }; objectiveHud.teamName[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "85 19"; extent = "110 16"; visible = "1"; }; // team scores objectiveHud.teamScore[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "200 3"; extent = "40 16"; visible = "1"; }; objectiveHud.teamScore[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "200 19"; extent = "40 16"; visible = "1"; }; objectiveHud.add(objectiveHud.flagLabel); objectiveHud.add(objectiveHud.yourFlags); for(%i = 1; %i <= 2; %i++) { objectiveHud.add(objectiveHud.teamName[%i]); objectiveHud.add(objectiveHud.teamScore[%i]); } case SinglePlayerGame: // no separator lines objectiveHud.setSeparators(""); objectiveHud.disableHorzSeparator(); // two lines to print objectives objectiveHud.spText[1] = new GuiTextCtrl() { profile = "GuiTextObjHudLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "235 16"; visible = "1"; }; objectiveHud.spText[2] = new GuiTextCtrl() { profile = "GuiTextObjHudLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "235 16"; visible = "1"; }; objectiveHud.add(objectiveHud.spText[1]); objectiveHud.add(objectiveHud.spText[2]); // z0dd - ZOD, 9/13/02. New gametype case JBGame: // set separators objectiveHud.setSeparators("64 114 152 202"); objectiveHud.enableHorzSeparator(); // Team names objectiveHud.teamName[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "60 16"; visible = "1"; }; objectiveHud.teamName[2] = new GuiTextCtrl() { profile = "GuiTextObjHudLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "60 16"; visible = "1"; }; // In Jail ("JAILED") objectiveHud.inJailLabel[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "68 3"; extent = "42 16"; visible = "1"; text = "JAILED"; }; objectiveHud.inJailLabel[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "68 19"; extent = "42 16"; visible = "1"; text = "JAILED"; }; // Players in Jail objectiveHud.playersJailed[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "118 3"; extent = "30 16"; visible = "1"; }; objectiveHud.playersJailed[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "118 19"; extent = "30 16"; visible = "1"; }; // Score label ("SCORE") objectiveHud.scoreLabel[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 3"; extent = "42 16"; visible = "1"; text = "SCORE"; }; objectiveHud.scoreLabel[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "156 19"; extent = "42 16"; visible = "1"; text = "SCORE"; }; // scores objectiveHud.teamScore[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "206 3"; extent = "30 16"; visible = "1"; }; objectiveHud.teamScore[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "206 19"; extent = "30 16"; visible = "1"; }; for(%i = 1; %i <= 2; %i++) { objectiveHud.add(objectiveHud.teamName[%i]); objectiveHud.add(objectiveHud.inJailLabel[%i]); objectiveHud.add(objectiveHud.playersJailed[%i]); objectiveHud.add(objectiveHud.scoreLabel[%i]); objectiveHud.add(objectiveHud.teamScore[%i]); } // z0dd - ZOD, 9/13/02. New gametype case DnDGame: // set separators objectiveHud.setSeparators("75 114 150 210"); objectiveHud.enableHorzSeparator(); // Team names objectiveHud.teamName[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 3"; extent = "68 16"; visible = "1"; }; objectiveHud.teamName[2] = new GuiTextCtrl() { profile = "GuiTextObjHudLeftProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "4 19"; extent = "68 16"; visible = "1"; }; // Label: Scores objectiveHud.scoreLabel[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "75 3"; extent = "42 16"; visible = "1"; text = "Score"; }; objectiveHud.scoreLabel[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "75 19"; extent = "42 16"; visible = "1"; text = "Score"; }; // Team scores objectiveHud.teamScore[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "118 3"; extent = "30 16"; visible = "1"; }; objectiveHud.teamScore[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "118 19"; extent = "30 16"; visible = "1"; }; // Label: Objectives objectiveHud.objectivesLabel[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "158 3"; extent = "44 16"; visible = "1"; text = "Objectives"; }; objectiveHud.objectivesLabel[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "158 19"; extent = "44 16"; visible = "1"; text = "Objectives"; }; // Team objectives objectiveHud.objectives[1] = new GuiTextCtrl() { profile = "GuiTextObjGreenCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "210 3"; extent = "30 16"; visible = "1"; }; objectiveHud.objectives[2] = new GuiTextCtrl() { profile = "GuiTextObjHudCenterProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "210 19"; extent = "30 16"; visible = "1"; }; for(%i = 1; %i <= 2; %i++) { objectiveHud.add(objectiveHud.teamName[%i]); objectiveHud.add(objectiveHud.scoreLabel[%i]); objectiveHud.add(objectiveHud.teamScore[%i]); objectiveHud.add(objectiveHud.objectivesLabel[%i]); objectiveHud.add(objectiveHud.objectives[%i]); } } chatPageDown.setVisible(false); } addMessageCallback('MsgCheckTeamLines', checkTeamLines); function checkTeamLines(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %team = detag(%a1); if(%team == 1) %other = 2; else if(%team == 2) %other = 1; else return; %tY = getWord(objectiveHud.teamName[%team].position, 1); %oY = getWord(objectiveHud.teamName[%other].position, 1); // if player's team is lower on objective hud than other team is, switch them if(%tY > %oY) swapTeamLines(); } function swapTeamLines() { // if player's team is on the bottom of the objective hud, swap them so that it's on top %bLeft = "GuiTextObjHudLeftProfile"; %bCenter = "GuiTextObjHudCenterProfile"; %gLeft = "GuiTextObjGreenLeftProfile"; %gCenter = "GuiTextObjGreenCenterProfile"; %teamOneY = getWord(objectiveHud.teamName[1].position, 1); %teamTwoY = getWord(objectiveHud.teamName[2].position, 1); // z0dd - ZOD, 9/13/02. Code streamlining %newTop = %teamOneY > %teamTwoY ? 1 : 2; %newBottom = %teamOneY > %teamTwoY ? 2 : 1; // these are present in every team-based mission type %nameX = firstWord(objectiveHud.teamName[1].position); objectiveHud.teamName[1].position = %nameX SPC %teamTwoY; objectiveHud.teamName[2].position = %nameX SPC %teamOneY; objectiveHud.teamName[%newTop].setProfile(%gLeft); objectiveHud.teamName[%newBottom].setProfile(%bLeft); %scoreX = firstWord(objectiveHud.teamScore[1].position); objectiveHud.teamScore[1].position = %scoreX SPC %teamTwoY; objectiveHud.teamScore[2].position = %scoreX SPC %teamOneY; objectiveHud.teamScore[%newTop].setProfile(%gCenter); objectiveHud.teamScore[%newBottom].setProfile(%bCenter); if(isObject(objectiveHud.flagLocation[1])) { // CTF %locatX = firstWord(objectiveHud.flagLocation[1].position); objectiveHud.flagLocation[1].position = %locatX SPC %teamTwoY; objectiveHud.flagLocation[2].position = %locatX SPC %teamOneY; // swap profiles so top line is green (don't bother with labels) objectiveHud.flagLocation[%newTop].setProfile(%gLeft); objectiveHud.flagLocation[%newBottom].setProfile(%bLeft); } if(isObject(objectiveHud.numHeld[1])) { // CnH %locatX = firstWord(objectiveHud.numHeld[1].position); objectiveHud.numHeld[1].position = %locatX SPC %teamTwoY; objectiveHud.numHeld[2].position = %locatX SPC %teamOneY; // swap profiles so top line is green (don't bother with labels) objectiveHud.numHeld[%newTop].setProfile(%gCenter); objectiveHud.numHeld[%newbottom].setProfile(%bCenter); } if(isObject(objectiveHud.objectives[1])) { // Siege %locX = firstWord(objectiveHud.roleLabel[1].position); objectiveHud.roleLabel[1].position = %locX SPC %teamTwoY; objectiveHud.roleLabel[2].position = %locX SPC %teamOneY; %locatX = firstWord(objectiveHud.objectives[1].position); objectiveHud.objectives[1].position = %locatX SPC %teamTwoY; objectiveHud.objectives[2].position = %locatX SPC %teamOneY; // swap profiles so top line is green (don't forget role label) objectiveHud.roleLabel[%newTop].setProfile(%gCenter); objectiveHud.roleLabel[%newbottom].setProfile(%bCenter); objectiveHud.objectives[%newTop].setProfile(%gCenter); objectiveHud.objectives[%newbottom].setProfile(%bCenter); } if(isObject(objectiveHud.playersJailed[1])) // z0dd - ZOD, 9/13/02. New Gametype { %jailedX = firstWord(objectiveHud.playersJailed[1].position); objectiveHud.playersJailed[1].position = %jailedX SPC %teamTwoY; objectiveHud.playersJailed[2].position = %jailedX SPC %teamOneY; objectiveHud.playersJailed[%newTop].setProfile(%gCenter); objectiveHud.playersJailed[%newbottom].setProfile(%bCenter); } if (isObject(objectiveHud.objectives[1])) // z0dd - ZOD, 9/13/02. New Gametype { %locatX = firstWord(objectiveHud.objectives[1].position); objectiveHud.objectives[1].position = %locatX SPC %teamTwoY; objectiveHud.objectives[2].position = %locatX SPC %teamOneY; objectiveHud.objectives[%newTop].setProfile(%gCenter); objectiveHud.objectives[%newBottom].setProfile(%bCenter); } } //----------------------------------------------------------------------------- //CLOCK HUD Callback addMessageCallback('MsgSystemClock', setSystemClock); function setSystemClock(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { $Hud::TimeLimit = detag(%a1); %timeLeftMS = detag(%a2); clockHud.setTime(%timeLeftMS / (60 * 1000)); } //----------------------------------------------------------------------------- //Generic msg callbacks... addMessageCallback('MsgYourScoreIs', YourScoreIs); function YourScoreIs(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { if ( isObject( objectiveHud.yourScore ) ) objectiveHud.yourScore.setValue( detag(%a1) ); } addMessageCallback('MsgTeamScoreIs', teamScoreIs); function teamScoreIs(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a1); %score = detag(%a2); if(%score $= "") %score = 0; objectiveHud.teamScore[%teamNum].setValue(%score); } addMessageCallback('MsgYourRankIs', yourRankIs); function yourRankIs(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { // the rank (+1) adjustment is taken care of server-side... %rank = detag(%a1); // no longer displayed in objective hud } ///////////////////////////////////////////////////////////////////////////////////////// // Bounty - Hud Messages ///////////////////////////////////////////////////////////////////////////////////////// addMessageCallback('msgBountyTargetIs', bountyTargetIs); function bountyTargetIs(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %hit = detag(%a1); if(%hit $= "") %hit = ""; objectiveHud.yourTarget.setValue(%hit); } addMessageCallback('msgBountyTargetDropped', bountyTargetDropped); addMessageCallback('msgBountyTargetEntObs', bountyTargetDropped); function bountyTargetDropped(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { objectiveHud.yourTarget.setValue(""); } //addMessageCallback('msgBountyObjRem', bountyObjRem); function bountyObjRem(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %objRem = detag(%a1); // this is no longer on the objective hud } ///////////////////////////////////////////////////////////////////////////////////////// // CnH - Hud Messages ///////////////////////////////////////////////////////////////////////////////////////// addMessageCallback('MsgCnHAddTeam', cnhAddTeam); function cnhAddTeam(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a1); %teamName = detag(%a2); %score = detag(%a3); if(%score $= "") %score = 0; %sLimit = detag(%a4); %held = detag(%a5); objectiveHud.teamName[%teamNum].setValue(%teamName); objectiveHud.teamScore[%teamNum].setValue(%score@"/"@%sLimit); objectiveHud.numHeld[%teamNum].setValue(%held); } addMessageCallback('MsgFlipFlopsHeld', hudFlipFlopsHeld); function hudFlipFlopsHeld(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a1); %held = detag(%a2); objectiveHud.numHeld[%teamNum].setValue(%held); } addMessageCallback('MsgCnHTeamCap', cnhTeamCap); function cnhTeamCap(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a4); %score = detag(%a5); %sLimit = detag(%a6); %string = %score @ "/" @ %sLimit; objectiveHud.teamScore[%teamNum].setValue(%string); } ///////////////////////////////////////////////////////////////////////////////////////// // CTF - Gui Hud Control ///////////////////////////////////////////////////////////////////////////////////////// addMessageCallback('MsgCTFAddTeam', ctfAddTeam); function ctfAddTeam(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a1); %teamName = detag(%a2); %flagStatus = detag(%a3); %score = detag(%a4); objectiveHud.teamName[%teamNum].setValue(%teamName); objectiveHud.teamScore[%teamNum].setValue(%score); objectiveHud.flagLocation[%teamNum].setValue(%flagStatus); } addMessageCallback('MsgCTFFlagTaken', ctfFlagTaken); function ctfFlagTaken(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %index = detag(%a3); %taker = detag(%a4); objectiveHud.flagLocation[%index].setValue(%taker); } addMessageCallback('MsgCTFFlagDropped', ctfFlagDropped); function ctfFlagDropped(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %index = detag(%a3); objectiveHud.flagLocation[%index].setValue(""); } addMessageCallback('MsgCTFFlagCapped', ctfFlagCapped); function ctfFlagCapped(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %index = detag(%a3); objectiveHud.flagLocation[%index].setValue(""); } addMessageCallback('MsgCTFFlagReturned', ctfFlagReturned); function ctfFlagReturned(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %index = detag(%a3); objectiveHud.flagLocation[%index].setValue(""); } ///////////////////////////////////////////////////////////////////////////////////////// // Deathmatch - Hud Messages ///////////////////////////////////////////////////////////////////////////////////////// addMessageCallback('MsgDMPlayerDies', dmPlayerDies); function dmPlayerDies(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %deaths = detag(%a1); objectiveHud.yourDeaths.setValue(%deaths); } addMessageCallback('MsgDMKill', dmKill); function dmKill(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %kills = detag(%a1); objectiveHud.yourKills.setValue(%kills); } ///////////////////////////////////////////////////////////////////////////////////////// // Hunters - Hud Messages ///////////////////////////////////////////////////////////////////////////////////////// addMessageCallback('MsgHuntAddTeam', huntAddTeam); function huntAddTeam(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a1); %teamName = detag(%a2); %score = detag(%a3); objectiveHud.teamName[%teamNum].setValue(%teamName); objectiveHud.teamScore[%teamNum].setValue(%score); } addMessageCallback('MsgHuntGreedStatus', huntGreedStatus); function huntGreedStatus(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %greedStatus = detag(%a1); %greedAmount = detag(%a2); // no longer displayed in objective hud } addMessageCallback('MsgHuntHoardStatus', hunthoardStatus); function huntHoardStatus(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { $Hud::HoardMode = detag(%a1); $HUD::TimeLimit = detag(%a2); %timeLeftMS = detag(%a3); $HUD::HoardStartTime = detag(%a4); $HUD::HoardDuration = detag(%a5); // no longer displayed in objective hud } function updateHoardStatusHUD(%timeLeftMS) { // no longer displayed in objective hud } addMessageCallback('MsgHuntYouHaveFlags', huntYouHaveFlags); function huntYouHaveFlags(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %numFlags = detag(%a1); objectiveHud.yourFlags.setValue(%numFlags); } ///////////////////////////////////////////////////////////////////////////////////////// // Rabbit - Hud Messages ///////////////////////////////////////////////////////////////////////////////////////// addMessageCallback('MsgRabbitFlagTaken', rabbitFlagTaken); function rabbitFlagTaken(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %bunny = detag(%a1); objectiveHud.rabbitName.setValue(%bunny); } addMessageCallback('MsgRabbitFlagDropped', rabbitFlagDropped); function rabbitFlagDropped(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { objectiveHud.rabbitName.setValue(""); } addMessageCallback('MsgRabbitFlagReturned', rabbitFlagReturned); function rabbitFlagReturned(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { objectiveHud.rabbitName.setValue(""); } addMessageCallback('MsgRabbitFlagStatus', rabbitFlagStatus); function rabbitFlagStatus(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %flagStatus = detag(%a1); objectiveHud.rabbitName.setValue(%flagStatus); }///////////////////////////////////////////////////////////////////////////////////////// // Siege - Hud Messages ///////////////////////////////////////////////////////////////////////////////////////// addMessageCallback('MsgSiegeAddTeam', siegeAddTeam); function siegeAddTeam(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a1); %teamName = detag(%a2); if(detag(%a3)) %role = "CAPTURE"; else %role = "PROTECT"; objectiveHud.teamName[%teamNum].setValue(%teamName); objectiveHud.roleLabel[%teamNum].setValue(%role); } addMessageCallback('MsgSiegeRolesSwitched', siegeRolesSwitched); function siegeRolesSwitched(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %newOff = detag(%a2); %newDef = %newOff == 1 ? 2: 1; objectiveHud.roleLabel[%newDef].setValue("PROTECT"); objectiveHud.roleLabel[%newOff].setValue("CAPTURE"); //objectiveHud.objectives[%newDef].setValue("1"); //objectiveHud.objectives[%newOff].setValue("0"); } ///////////////////////////////////////////////////////////////////////////////////////// // DnD - Hud Messages - z0dd - ZOD, 9/13/02. ///////////////////////////////////////////////////////////////////////////////////////// function dndAddTeam(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a1); %teamName = detag(%a2); %score = detag(%a3); if (%score $= "") %score = 0; %sLimit = detag(%a4); objectiveHud.teamName[%teamNum].setValue(%teamName); objectiveHud.objectives[%teamNum].setValue(%sLimit); objectiveHud.teamScore[%teamNum].setValue(%score); } function dndTeamScores(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a1); %teamName = detag(%a2); %score = detag(%a3); if(%score $= "") %score = 0; %sLimit = detag(%a4); objectiveHud.teamScore[%teamNum].setValue(%score); } addMessageCallback('MsgDnDAddTeam', dndAddTeam); addMessageCallback('MsgDnDTeamScores', dndTeamScores); ///////////////////////////////////////////////////////////////////////////////////////// // Single Player Game - Hud Messages ///////////////////////////////////////////////////////////////////////////////////////// //addMessageCallback('MsgSPYourRankIs', spYourRankIs); function spYourRankIs(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { //%rank = detag(%a1); //objectiveHud.data[1,1].setValue(%rank); } addMessageCallback('MsgSPCurrentObjective1', spCurrentObjective1); function spCurrentObjective1(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %obj = detag(%a1); objectiveHud.spText[1].setValue(%obj); } addMessageCallback('MsgSPCurrentObjective2', spCurrentObjective2); function spCurrentObjective2(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %obj = detag(%a1); objectiveHud.spText[2].setValue(%obj); } //addMessageCallback('MsgSPCurrentObjective3', spCurrentObjective3); //function spCurrentObjective3(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) //{ // %obj = detag(%a1); // objectiveHud.data[0,4].setValue(%obj); //} ///////////////////////////////////////////////////////////////////////////////////////// // JB - Hud Messages - z0dd - ZOD, 9/13/02. ///////////////////////////////////////////////////////////////////////////////////////// function jbAddTeam(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a1); %teamName = detag(%a2); %score = detag(%a3); if(%score $= "") %score = 0; %jailed = detag(%a4); if(%jailed $= "" || %jailed < 0) %jailed = 0; objectiveHud.teamName[%teamNum].setValue(%teamName); objectiveHud.playersJailed[%teamNum].setValue(%jailed); objectiveHud.teamScore[%teamNum].setValue(%score); } function jbRoundHeld(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a1); %score = detag(%a2); objectiveHud.teamScore[%teamNum].setValue(%score); } function jbJailed(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6) { %teamNum = detag(%a4); %jailed = detag(%a5); if(%jailed < 0) %jailed = 0; objectiveHud.playersJailed[%teamNum].setValue(%jailed); } addMessageCallback('MsgJBAddTeam', jbAddTeam); addMessageCallback('MsgJBRoundHeld', jbRoundHeld); addMessageCallback('MsgJBJailed', jbJailed);PK !(7ίC C scripts/pack.cs//---------------------------------------------------------------------------- datablock EffectProfile(TurretPackActivateEffect) { effectname = "packs/generic_deploy"; minDistance = 2.5; maxDistance = 2.5; }; datablock AudioProfile(TurretPackActivateSound) { filename = "fx/packs/turret_place.wav"; description = AudioClose3D; preload = true; effect = TurretPackActivateEffect; }; //---------------------------------------------------------------------------- function Pack::onCollision(%data, %obj, %col) { // Don't pick up a new pack if you have a satchel charge deployed: if ( %col.thrownChargeId > 0 ) return; ItemData::onCollision(%data, %obj, %col); } function Pack::onUse(%data,%obj) { if (%obj.getMountedImage($BackpackSlot) != %data.image.getId()) %obj.mountImage(%data.image,$BackpackSlot); else { // Toggle the image trigger. %obj.setImageTrigger($BackpackSlot, !%obj.getImageTrigger($BackpackSlot)); } } function Pack::onInventory(%data,%obj,%amount) { //only do this for players if(%obj.getClassName() !$= "Player") return; // Auto-mount the packs on players if((%oldPack = %obj.getMountedImage($BackpackSlot)) != 0) %obj.setInventory(%oldPack.item, 0); if (%amount && %obj.getDatablock().className $= Armor) { // if you picked up another pack after you placed a satchel charge but // before you detonated it, delete the charge if(%obj.thrownChargeId > 0) { %obj.thrownChargeId.delete(); %obj.thrownChargeId = 0; } %obj.mountImage(%data.image,$BackpackSlot); %obj.client.setBackpackHudItem(%data.getName(), 1); } if(%amount == 0 ) { if ( %data.getName() $= "SatchelCharge" ) %obj.client.setBackpackHudItem( "SatchelUnarmed", 1 ); else %obj.client.setBackpackHudItem(%data.getName(), 0); } ItemData::onInventory(%data,%obj,%amount); } //---------------------------------------------------------------------------- // --- Upgrade packs exec("scripts/packs/ammopack.cs"); exec("scripts/packs/cloakingpack.cs"); exec("scripts/packs/energypack.cs"); exec("scripts/packs/repairpack.cs"); exec("scripts/packs/shieldpack.cs"); exec("scripts/packs/satchelCharge.cs"); exec("scripts/packs/sensorjammerpack.cs"); // --- Turret barrel packs exec("scripts/packs/aabarrelpack.cs"); exec("scripts/packs/missilebarrelpack.cs"); exec("scripts/packs/mortarbarrelpack.cs"); exec("scripts/packs/plasmabarrelpack.cs"); exec("scripts/packs/ELFbarrelpack.cs"); PK !(ܝMscripts/particleDummies.cs//-------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------- datablock ParticleEmissionDummyData(defaultEmissionDummy) { timeMultiple = 1.0; }; datablock ParticleEmissionDummyData(halftimeEmissionDummy) { timeMultiple = 0.5; }; datablock ParticleEmissionDummyData(doubleTimeEmissionDummy) { timeMultiple = 2.0; }; PK !(ۑcscripts/particleEmitter.cs//-------------------------------------------------------------------------- // ParticleEmitter data: // A note about the phiReferenceVel, it will only be useful in cases in // which the axis of the emitter is not changed over the life of the emission // i.e., a linear projectile say, or an explosion that sits in one place. A // grenade, for instance, wouldn't necessarily give the desired result (though // it might in certain cases). // One more note: overrideAdvances should probably only be turned on for emitters // that are attached to explosions. It prevents the emitter from advancing a particle // to the boundary of the update it was created in. Its useful for explosion emitters, // which fake a 1000 ms update, and never update again, since we sometimes want those // particles to pop up with exactly the same position. On a projectile, it's likely // to cause non-random looking particle "clumps" if there's a low frame rate condition // on the client. // //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- //-------------------------------------- Particles // datablock ParticleData(DefaultParticle) { dragCoefficient = 0.0; // Not affected by drag gravityCoefficient = 0.0; // ...or gravity windCoefficient = 1.0; inheritedVelFactor = 0.0; // Do not inherit emitters velocity constantAcceleration = 0.0; // No constant accel along initial velocity lifetimeMS = 1000; // lasts 1 second lifetimeVarianceMS = 0; // ...exactly textureName = "particleTest"; colors[0] = "1 1 1 1"; // All white, no blending colors[1] = "1 1 1 1"; colors[2] = "1 1 1 1"; colors[3] = "1 1 1 1"; sizes[0] = 1; // One meter across sizes[1] = 1; sizes[2] = 1; sizes[3] = 1; times[0] = 0.0; // Linear blend from color[0] to color[1] times[1] = 1.0; // Note that times[0] is always 0 times[2] = 2.0; // even when set in the data block. times[3] = 2.0; }; datablock ParticleData(FallingParticleRed) { dragCoefficient = 1.5; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 1250; lifetimeVarianceMS = 0; textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 1.0"; colors[1] = "0.46 0.36 0.26 0.0"; sizes[0] = 0.35; sizes[1] = 0.30; }; //-------------------------------------------------------------------------- //-------------------------------------- Emitters // datablock ParticleEmitterData(DefaultEmitter) { ejectionPeriodMS = 100; // 10 Particles Per second periodVarianceMS = 0; // ...exactly ejectionVelocity = 2.0; // From 1.0 - 3.0 meters per sec velocityVariance = 1.0; ejectionOffset = 0.0; // Emit at the emitter origin thetaMin = 0.0; // All theta angles thetaMax = 90.0; phiReferenceVel = 0.0; // All phi angles phiVariance = 360.0; overrideAdvances = false; particles = "DefaultParticle"; }; datablock ParticleEmitterData(ReverseEmitter) { ejectionPeriodMS = 25; periodVarianceMS = 5; ejectionVelocity = 1.1; // From 1.0 - 3.0 meters per sec velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0.0; thetaMax = 10.0; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "FallingParticleRed"; };PK SG-oJ'EoEoscripts/player.cs//---------------------------------------------------------------------------- //---------------------------------------------------------------------------- $InvincibleTime = 6; // Load dts shapes and merge animations exec("scripts/light_male.cs"); exec("scripts/medium_male.cs"); exec("scripts/heavy_male.cs"); exec("scripts/light_female.cs"); exec("scripts/medium_female.cs"); exec("scripts/bioderm_light.cs"); exec("scripts/bioderm_medium.cs"); exec("scripts/bioderm_heavy.cs"); $CorpseTimeoutValue = 22 * 1000; //Damage Rate for entering Liquid $DamageLava = 0.0325; $DamageHotLava = 0.0325; $DamageCrustyLava = 0.0325; $PlayerDeathAnim::TorsoFrontFallForward = 1; $PlayerDeathAnim::TorsoFrontFallBack = 2; $PlayerDeathAnim::TorsoBackFallForward = 3; $PlayerDeathAnim::TorsoLeftSpinDeath = 4; $PlayerDeathAnim::TorsoRightSpinDeath = 5; $PlayerDeathAnim::LegsLeftGimp = 6; $PlayerDeathAnim::LegsRightGimp = 7; $PlayerDeathAnim::TorsoBackFallForward = 8; $PlayerDeathAnim::HeadFrontDirect = 9; $PlayerDeathAnim::HeadBackFallForward = 10; $PlayerDeathAnim::ExplosionBlowBack = 11; datablock SensorData(PlayerSensor) { detects = true; detectsUsingLOS = true; detectsPassiveJammed = true; detectRadius = 2000; detectionPings = false; detectsFOVOnly = true; detectFOVPercent = 1.3; useObjectFOV = true; }; //---------------------------------------------------------------------------- datablock EffectProfile(ArmorJetEffect) { effectname = "armor/thrust"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(ImpactSoftEffect) { effectname = "armor/light_land_soft"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(ImpactHardEffect) { effectname = "armor/light_land_hard"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(ImpactMetalEffect) { effectname = "armor/light_land_metal"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(ImpactSnowEffect) { effectname = "armor/light_land_snow"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(CorpseLootingEffect) { effectname = "weapons/generic_switch"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(MountVehicleEffect) { effectname = "vehicles/mount_dis"; minDistance = 5; maxDistance = 20; }; datablock EffectProfile(UnmountVehicleEffect) { effectname = "weapons/generic_switch"; minDistance = 5; maxDistance = 20; }; datablock EffectProfile(GenericPainEffect) { effectname = "misc/generic_pain"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(GenericDeathEffect) { effectname = "misc/generic_death"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ImpactHeavyWaterEasyEffect) { effectname = "armor/general_water_smallsplash"; minDistance = 5; maxDistance = 15; }; datablock EffectProfile(ImpactHeavyMediumWaterEffect) { effectname = "armor/general_water_medsplash"; minDistance = 5; maxDistance = 15; }; datablock EffectProfile(ImpactHeavyWaterHardEffect) { effectname = "armor/general_water_bigsplash"; minDistance = 5; maxDistance = 15; }; //---------------------------------------------------------------------------- //datablock AudioProfile( DeathCrySound ) //{ // fileName = ""; // description = AudioClose3d; // preload = true; //}; // //datablock AudioProfile( PainCrySound ) //{ // fileName = ""; // description = AudioClose3d; // preload = true; //}; datablock AudioProfile(ArmorJetSound) { filename = "fx/armor/thrust.wav"; description = CloseLooping3d; preload = true; effect = ArmorJetEffect; }; datablock AudioProfile(ArmorWetJetSound) { filename = "fx/armor/thrust_uw.wav"; description = CloseLooping3d; preload = true; effect = ArmorJetEffect; }; datablock AudioProfile(MountVehicleSound) { filename = "fx/vehicles/mount_dis.wav"; description = AudioClose3d; preload = true; effect = MountVehicleEffect; }; datablock AudioProfile(UnmountVehicleSound) { filename = "fx/vehicles/mount.wav"; description = AudioClose3d; preload = true; effect = UnmountVehicleEffect; }; datablock AudioProfile(CorpseLootingSound) { fileName = "fx/weapons/generic_switch.wav"; description = AudioClosest3d; preload = true; effect = CorpseLootingEffect; }; datablock AudioProfile(ArmorMoveBubblesSound) { filename = "fx/armor/bubbletrail2.wav"; description = CloseLooping3d; preload = true; }; datablock AudioProfile(WaterBreathMaleSound) { filename = "fx/armor/breath_uw.wav"; description = ClosestLooping3d; preload = true; }; datablock AudioProfile(WaterBreathFemaleSound) { filename = "fx/armor/breath_fem_uw.wav"; description = ClosestLooping3d; preload = true; }; datablock AudioProfile(waterBreathBiodermSound) { filename = "fx/armor/breath_bio_uw.wav"; description = ClosestLooping3d; preload = true; }; datablock AudioProfile(SkiAllSoftSound) { filename = "fx/armor/ski_soft.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(SkiAllHardSound) { filename = "fx/armor/ski_soft.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(SkiAllMetalSound) { filename = "fx/armor/ski_soft.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(SkiAllSnowSound) { filename = "fx/armor/ski_soft.wav"; description = AudioClosest3d; preload = true; }; //SOUNDS ----- LIGHT ARMOR-------- datablock AudioProfile(LFootLightSoftSound) { filename = "fx/armor/light_LF_soft.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(RFootLightSoftSound) { filename = "fx/armor/light_RF_soft.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(LFootLightHardSound) { filename = "fx/armor/light_LF_hard.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootLightHardSound) { filename = "fx/armor/light_RF_hard.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootLightMetalSound) { filename = "fx/armor/light_LF_metal.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootLightMetalSound) { filename = "fx/armor/light_RF_metal.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootLightSnowSound) { filename = "fx/armor/light_LF_snow.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(RFootLightSnowSound) { filename = "fx/armor/light_RF_snow.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(LFootLightShallowSplashSound) { filename = "fx/armor/light_LF_water.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootLightShallowSplashSound) { filename = "fx/armor/light_RF_water.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootLightWadingSound) { filename = "fx/armor/light_LF_wade.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootLightWadingSound) { filename = "fx/armor/light_RF_wade.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootLightUnderwaterSound) { filename = "fx/armor/light_LF_uw.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(RFootLightUnderwaterSound) { filename = "fx/armor/light_RF_uw.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(LFootLightBubblesSound) { filename = "fx/armor/light_LF_bubbles.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootLightBubblesSound) { filename = "fx/armor/light_RF_bubbles.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(ImpactLightSoftSound) { filename = "fx/armor/light_land_soft.wav"; description = AudioClose3d; preload = true; effect = ImpactSoftEffect; }; datablock AudioProfile(ImpactLightHardSound) { filename = "fx/armor/light_land_hard.wav"; description = AudioClose3d; preload = true; effect = ImpactHardEffect; }; datablock AudioProfile(ImpactLightMetalSound) { filename = "fx/armor/light_land_metal.wav"; description = AudioClose3d; preload = true; effect = ImpactMetalEffect; }; datablock AudioProfile(ImpactLightSnowSound) { filename = "fx/armor/light_land_snow.wav"; description = AudioClosest3d; preload = true; effect = ImpactSnowEffect; }; datablock AudioProfile(ImpactLightWaterEasySound) { filename = "fx/armor/general_water_smallsplash2.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(ImpactLightWaterMediumSound) { filename = "fx/armor/general_water_medsplash.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(ImpactLightWaterHardSound) { filename = "fx/armor/general_water_bigsplash.wav"; description = AudioDefault3d; preload = true; }; datablock AudioProfile(ExitingWaterLightSound) { filename = "fx/armor/general_water_exit2.wav"; description = AudioClose3d; preload = true; }; //SOUNDS ----- Medium ARMOR-------- datablock AudioProfile(LFootMediumSoftSound) { filename = "fx/armor/med_LF_soft.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(RFootMediumSoftSound) { filename = "fx/armor/med_RF_soft.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(LFootMediumHardSound) { filename = "fx/armor/med_LF_hard.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootMediumHardSound) { filename = "fx/armor/med_RF_hard.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootMediumMetalSound) { filename = "fx/armor/med_LF_metal.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootMediumMetalSound) { filename = "fx/armor/med_RF_metal.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootMediumSnowSound) { filename = "fx/armor/med_LF_snow.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(RFootMediumSnowSound) { filename = "fx/armor/med_RF_snow.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(LFootMediumShallowSplashSound) { filename = "fx/armor/med_LF_water.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootMediumShallowSplashSound) { filename = "fx/armor/med_RF_water.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootMediumWadingSound) { filename = "fx/armor/med_LF_uw.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootMediumWadingSound) { filename = "fx/armor/med_RF_uw.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootMediumUnderwaterSound) { filename = "fx/armor/med_LF_uw.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(RFootMediumUnderwaterSound) { filename = "fx/armor/med_RF_uw.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(LFootMediumBubblesSound) { filename = "fx/armor/light_LF_bubbles.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootMediumBubblesSound) { filename = "fx/armor/light_RF_bubbles.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(ImpactMediumSoftSound) { filename = "fx/armor/med_land_soft.wav"; description = AudioClosest3d; preload = true; effect = ImpactSoftEffect; }; datablock AudioProfile(ImpactMediumHardSound) { filename = "fx/armor/med_land_hard.wav"; description = AudioClose3d; preload = true; effect = ImpactHardEffect; }; datablock AudioProfile(ImpactMediumMetalSound) { filename = "fx/armor/med_land_metal.wav"; description = AudioClose3d; preload = true; effect = ImpactMetalEffect; }; datablock AudioProfile(ImpactMediumSnowSound) { filename = "fx/armor/med_land_snow.wav"; description = AudioClosest3d; preload = true; effect = ImpactSnowEffect; }; datablock AudioProfile(ImpactMediumWaterEasySound) { filename = "fx/armor/general_water_smallsplash.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(ImpactMediumWaterMediumSound) { filename = "fx/armor/general_water_medsplash.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(ImpactMediumWaterHardSound) { filename = "fx/armor/general_water_bigsplash.wav"; description = AudioDefault3d; preload = true; }; datablock AudioProfile(ExitingWaterMediumSound) { filename = "fx/armor/general_water_exit.wav"; description = AudioClose3d; preload = true; }; //SOUNDS ----- HEAVY ARMOR-------- datablock AudioProfile(LFootHeavySoftSound) { filename = "fx/armor/heavy_LF_soft.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(RFootHeavySoftSound) { filename = "fx/armor/heavy_RF_soft.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(LFootHeavyHardSound) { filename = "fx/armor/heavy_LF_hard.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootHeavyHardSound) { filename = "fx/armor/heavy_RF_hard.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootHeavyMetalSound) { filename = "fx/armor/heavy_LF_metal.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootHeavyMetalSound) { filename = "fx/armor/heavy_RF_metal.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootHeavySnowSound) { filename = "fx/armor/heavy_LF_snow.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(RFootHeavySnowSound) { filename = "fx/armor/heavy_RF_snow.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(LFootHeavyShallowSplashSound) { filename = "fx/armor/heavy_LF_water.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootHeavyShallowSplashSound) { filename = "fx/armor/heavy_RF_water.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootHeavyWadingSound) { filename = "fx/armor/heavy_LF_uw.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootHeavyWadingSound) { filename = "fx/armor/heavy_RF_uw.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(LFootHeavyUnderwaterSound) { filename = "fx/armor/heavy_LF_uw.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(RFootHeavyUnderwaterSound) { filename = "fx/armor/heavy_RF_uw.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(LFootHeavyBubblesSound) { filename = "fx/armor/light_LF_bubbles.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(RFootHeavyBubblesSound) { filename = "fx/armor/light_RF_bubbles.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(ImpactHeavySoftSound) { filename = "fx/armor/heavy_land_soft.wav"; description = AudioClose3d; preload = true; effect = ImpactSoftEffect; }; datablock AudioProfile(ImpactHeavyHardSound) { filename = "fx/armor/heavy_land_hard.wav"; description = AudioClose3d; preload = true; effect = ImpactHardEffect; }; datablock AudioProfile(ImpactHeavyMetalSound) { filename = "fx/armor/heavy_land_metal.wav"; description = AudioClose3d; preload = true; effect = ImpactMetalEffect; }; datablock AudioProfile(ImpactHeavySnowSound) { filename = "fx/armor/heavy_land_snow.wav"; description = AudioClosest3d; preload = true; effect = ImpactSnowEffect; }; datablock AudioProfile(ImpactHeavyWaterEasySound) { filename = "fx/armor/general_water_smallsplash.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(ImpactHeavyWaterMediumSound) { filename = "fx/armor/general_water_medsplash.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(ImpactHeavyWaterHardSound) { filename = "fx/armor/general_water_bigsplash.wav"; description = AudioDefault3d; preload = true; }; datablock AudioProfile(ExitingWaterHeavySound) { filename = "fx/armor/general_water_exit2.wav"; description = AudioClose3d; preload = true; }; //---------------------------------------------------------------------------- // Splash //---------------------------------------------------------------------------- datablock ParticleData(PlayerSplashMist) { dragCoefficient = 2.0; gravityCoefficient = -0.05; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 400; lifetimeVarianceMS = 100; useInvAlpha = false; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.8; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(PlayerSplashMistEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 3.0; velocityVariance = 2.0; ejectionOffset = 0.0; thetaMin = 85; thetaMax = 85; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; lifetimeMS = 250; particles = "PlayerSplashMist"; }; datablock ParticleData(PlayerBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.50; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 400; lifetimeVarianceMS = 100; useInvAlpha = false; textureName = "special/bubbles"; colors[0] = "0.7 0.8 1.0 0.4"; colors[1] = "0.7 0.8 1.0 0.4"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.1; sizes[1] = 0.3; sizes[2] = 0.3; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(PlayerBubbleEmitter) { ejectionPeriodMS = 1; periodVarianceMS = 0; ejectionVelocity = 2.0; ejectionOffset = 0.5; velocityVariance = 0.5; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "PlayerBubbleParticle"; }; datablock ParticleData(PlayerFoamParticle) { dragCoefficient = 2.0; gravityCoefficient = -0.05; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 400; lifetimeVarianceMS = 100; useInvAlpha = false; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.7 0.8 1.0 0.20"; colors[1] = "0.7 0.8 1.0 0.20"; colors[2] = "0.7 0.8 1.0 0.00"; sizes[0] = 0.2; sizes[1] = 0.4; sizes[2] = 1.6; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(PlayerFoamEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 3.0; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 85; thetaMax = 85; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "PlayerFoamParticle"; }; datablock ParticleData( PlayerFoamDropletsParticle ) { dragCoefficient = 1; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 0; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.8; sizes[1] = 0.3; sizes[2] = 0.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( PlayerFoamDropletsEmitter ) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 2; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 60; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; particles = "PlayerFoamDropletsParticle"; }; datablock ParticleData( PlayerSplashParticle ) { dragCoefficient = 1; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 0; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( PlayerSplashEmitter ) { ejectionPeriodMS = 1; periodVarianceMS = 0; ejectionVelocity = 3; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 60; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "PlayerSplashParticle"; }; datablock SplashData(PlayerSplash) { numSegments = 15; ejectionFreq = 15; ejectionAngle = 40; ringLifetime = 0.5; lifetimeMS = 300; velocity = 4.0; startRadius = 0.0; acceleration = -3.0; texWrap = 5.0; texture = "special/water2"; emitter[0] = PlayerSplashEmitter; emitter[1] = PlayerSplashMistEmitter; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 0.3"; colors[2] = "0.7 0.8 1.0 0.7"; colors[3] = "0.7 0.8 1.0 0.0"; times[0] = 0.0; times[1] = 0.4; times[2] = 0.8; times[3] = 1.0; }; //---------------------------------------------------------------------------- // Jet data //---------------------------------------------------------------------------- datablock ParticleData(HumanArmorJetParticle) { dragCoefficient = 0.0; gravityCoefficient = 0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 100; lifetimeVarianceMS = 0; textureName = "particleTest"; colors[0] = "0.32 0.47 0.47 1.0"; colors[1] = "0.32 0.47 0.47 0"; sizes[0] = 0.40; sizes[1] = 0.15; }; datablock ParticleEmitterData(HumanArmorJetEmitter) { ejectionPeriodMS = 3; periodVarianceMS = 0; ejectionVelocity = 3; velocityVariance = 2.9; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 5; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "HumanArmorJetParticle"; }; datablock JetEffectData(HumanArmorJetEffect) { texture = "special/jetExhaust02"; coolColor = "0.0 0.0 1.0 1.0"; hotColor = "0.2 0.4 0.7 1.0"; activateTime = 0.2; deactivateTime = 0.05; length = 0.75; width = 0.2; speed = -15; stretch = 2.0; yOffset = 0.2; }; datablock JetEffectData(HumanMediumArmorJetEffect) { texture = "special/jetExhaust02"; coolColor = "0.0 0.0 1.0 1.0"; hotColor = "0.2 0.4 0.7 1.0"; activateTime = 0.2; deactivateTime = 0.05; length = 0.75; width = 0.2; speed = -15; stretch = 2.0; yOffset = 0.4; }; datablock JetEffectData(HumanLightFemaleArmorJetEffect) { texture = "special/jetExhaust02"; coolColor = "0.0 0.0 1.0 1.0"; hotColor = "0.2 0.4 0.7 1.0"; activateTime = 0.2; deactivateTime = 0.05; length = 0.75; width = 0.2; speed = -15; stretch = 2.0; yOffset = 0.2; }; datablock JetEffectData(BiodermArmorJetEffect) { texture = "special/jetExhaust02"; coolColor = "0.0 0.0 1.0 1.0"; hotColor = "0.8 0.6 0.2 1.0"; activateTime = 0.2; deactivateTime = 0.05; length = 0.75; width = 0.2; speed = -15; stretch = 2.0; yOffset = 0.0; }; //---------------------------------------------------------------------------- // Foot puffs //---------------------------------------------------------------------------- datablock ParticleData(LightPuff) { dragCoefficient = 2.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 100; useInvAlpha = true; spinRandomMin = -35.0; spinRandomMax = 35.0; textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 0.4"; colors[1] = "0.46 0.46 0.36 0.0"; sizes[0] = 0.4; sizes[1] = 1.0; }; datablock ParticleEmitterData(LightPuffEmitter) { ejectionPeriodMS = 35; periodVarianceMS = 10; ejectionVelocity = 0.1; velocityVariance = 0.05; ejectionOffset = 0.0; thetaMin = 5; thetaMax = 20; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; useEmitterColors = true; particles = "LightPuff"; }; //---------------------------------------------------------------------------- // Liftoff dust //---------------------------------------------------------------------------- datablock ParticleData(LiftoffDust) { dragCoefficient = 1.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1000; lifetimeVarianceMS = 100; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 0.0"; colors[1] = "0.46 0.46 0.36 0.4"; colors[2] = "0.46 0.46 0.36 0.0"; sizes[0] = 0.2; sizes[1] = 0.6; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(LiftoffDustEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 2.0; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 90; thetaMax = 90; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; useEmitterColors = true; particles = "LiftoffDust"; }; //---------------------------------------------------------------------------- datablock ParticleData(BiodermArmorJetParticle) : HumanArmorJetParticle { colors[0] = "0.50 0.48 0.36 1.0"; colors[1] = "0.50 0.48 0.36 0"; }; datablock ParticleEmitterData(BiodermArmorJetEmitter) : HumanArmorJetEmitter { particles = "BiodermArmorJetParticle"; }; //---------------------------------------------------------------------------- datablock DecalData(LightMaleFootprint) { sizeX = 0.125; sizeY = 0.25; textureName = "special/footprints/L_male"; }; datablock DebrisData( PlayerDebris ) { explodeOnMaxBounce = false; elasticity = 0.35; friction = 0.5; lifetime = 4.0; lifetimeVariance = 0.0; minSpinSpeed = 60; maxSpinSpeed = 600; numBounces = 5; bounceVariance = 0; staticOnMaxBounce = true; gravModifier = 1.0; useRadiusMass = true; baseRadius = 1; velocity = 18.0; velocityVariance = 12.0; }; datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile { emap = true; className = Armor; shapeFile = "light_male.dts"; cameraMaxDist = 3; computeCRC = true; canObserve = true; cmdCategory = "Clients"; cmdIcon = CMDPlayerIcon; cmdMiniIconName = "commander/MiniIcons/com_player_grey"; hudImageNameFriendly[0] = "gui/hud_playertriangle"; hudImageNameEnemy[0] = "gui/hud_playertriangle_enemy"; hudRenderModulated[0] = true; hudImageNameFriendly[1] = "commander/MiniIcons/com_flag_grey"; hudImageNameEnemy[1] = "commander/MiniIcons/com_flag_grey"; hudRenderModulated[1] = true; hudRenderAlways[1] = true; hudRenderCenter[1] = true; hudRenderDistance[1] = true; hudImageNameFriendly[2] = "commander/MiniIcons/com_flag_grey"; hudImageNameEnemy[2] = "commander/MiniIcons/com_flag_grey"; hudRenderModulated[2] = true; hudRenderAlways[2] = true; hudRenderCenter[2] = true; hudRenderDistance[2] = true; cameraDefaultFov = 90.0; cameraMinFov = 5.0; cameraMaxFov = 120.0; debrisShapeName = "debris_player.dts"; debris = playerDebris; aiAvoidThis = true; minLookAngle = -1.5; maxLookAngle = 1.5; maxFreelookAngle = 3.0; mass = 90; drag = 0.275; maxdrag = 0.4; density = 10; maxDamage = 0.66; maxEnergy = 60; repairRate = 0.0033; energyPerDamagePoint = 75.0; // shield energy required to block one point of damage rechargeRate = 0.256; jetForce = 26.21 * 90; underwaterJetForce = 26.21 * 90 * 1.5; underwaterVertJetFactor = 1.5; jetEnergyDrain = 0.8; underwaterJetEnergyDrain = 0.6; minJetEnergy = 1; maxJetHorizontalPercentage = 0.8; runForce = 55.20 * 90; runEnergyDrain = 0; minRunEnergy = 0; maxForwardSpeed = 15; maxBackwardSpeed = 13; maxSideSpeed = 13; maxUnderwaterForwardSpeed = 11; maxUnderwaterBackwardSpeed = 10; maxUnderwaterSideSpeed = 10; jumpForce = 8.3 * 90; jumpEnergyDrain = 0; minJumpEnergy = 0; jumpDelay = 0; recoverDelay = 9; recoverRunForceScale = 1.2; minImpactSpeed = 45; speedDamageScale = 0.004; jetSound = ArmorJetSound; wetJetSound = ArmorJetSound; jetEmitter = HumanArmorJetEmitter; jetEffect = HumanArmorJetEffect; boundingBox = "1.2 1.2 2.3"; pickupRadius = 0.75; // damage location details boxNormalHeadPercentage = 0.83; boxNormalTorsoPercentage = 0.49; boxHeadLeftPercentage = 0; boxHeadRightPercentage = 1; boxHeadBackPercentage = 0; boxHeadFrontPercentage = 1; //Foot Prints decalData = LightMaleFootprint; decalOffset = 0.25; footPuffEmitter = LightPuffEmitter; footPuffNumParts = 15; footPuffRadius = 0.25; dustEmitter = LiftoffDustEmitter; splash = PlayerSplash; splashVelocity = 4.0; splashAngle = 67.0; splashFreqMod = 300.0; splashVelEpsilon = 0.60; bubbleEmitTime = 0.4; splashEmitter[0] = PlayerFoamDropletsEmitter; splashEmitter[1] = PlayerFoamEmitter; splashEmitter[2] = PlayerBubbleEmitter; mediumSplashSoundVelocity = 10.0; hardSplashSoundVelocity = 20.0; exitSplashSoundVelocity = 5.0; // Controls over slope of runnable/jumpable surfaces runSurfaceAngle = 70; jumpSurfaceAngle = 80; minJumpSpeed = 20; maxJumpSpeed = 30; horizMaxSpeed = 68; horizResistSpeed = 33; horizResistFactor = 0.35; maxJetForwardSpeed = 30; upMaxSpeed = 80; upResistSpeed = 25; upResistFactor = 0.3; // heat inc'ers and dec'ers heatDecayPerSec = 1.0 / 4.0; // takes 4 seconds to clear heat sig. heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig. footstepSplashHeight = 0.35; //Footstep Sounds LFootSoftSound = LFootLightSoftSound; RFootSoftSound = RFootLightSoftSound; LFootHardSound = LFootLightHardSound; RFootHardSound = RFootLightHardSound; LFootMetalSound = LFootLightMetalSound; RFootMetalSound = RFootLightMetalSound; LFootSnowSound = LFootLightSnowSound; RFootSnowSound = RFootLightSnowSound; LFootShallowSound = LFootLightShallowSplashSound; RFootShallowSound = RFootLightShallowSplashSound; LFootWadingSound = LFootLightWadingSound; RFootWadingSound = RFootLightWadingSound; LFootUnderwaterSound = LFootLightUnderwaterSound; RFootUnderwaterSound = RFootLightUnderwaterSound; LFootBubblesSound = LFootLightBubblesSound; RFootBubblesSound = RFootLightBubblesSound; movingBubblesSound = ArmorMoveBubblesSound; waterBreathSound = WaterBreathMaleSound; impactSoftSound = ImpactLightSoftSound; impactHardSound = ImpactLightHardSound; impactMetalSound = ImpactLightMetalSound; impactSnowSound = ImpactLightSnowSound; skiSoftSound = SkiAllSoftSound; skiHardSound = SkiAllHardSound; skiMetalSound = SkiAllMetalSound; skiSnowSound = SkiAllSnowSound; impactWaterEasy = ImpactLightWaterEasySound; impactWaterMedium = ImpactLightWaterMediumSound; impactWaterHard = ImpactLightWaterHardSound; groundImpactMinSpeed = 10.0; groundImpactShakeFreq = "4.0 4.0 4.0"; groundImpactShakeAmp = "1.0 1.0 1.0"; groundImpactShakeDuration = 0.8; groundImpactShakeFalloff = 10.0; exitingWater = ExitingWaterLightSound; maxWeapons = 3; // Max number of different weapons the player can have maxGrenades = 1; // Max number of different grenades the player can have maxMines = 1; // Max number of different mines the player can have // Inventory restrictions max[RepairKit] = 1; max[Mine] = 3; max[Grenade] = 5; max[Blaster] = 1; max[Plasma] = 1; max[PlasmaAmmo] = 20; max[Disc] = 1; max[DiscAmmo] = 15; max[SniperRifle] = 1; max[GrenadeLauncher] = 1; max[GrenadeLauncherAmmo]= 10; max[Mortar] = 0; max[MortarAmmo] = 0; max[MissileLauncher] = 0; max[MissileLauncherAmmo]= 0; max[Chaingun] = 1; max[ChaingunAmmo] = 100; max[RepairGun] = 1; max[CloakingPack] = 1; max[SensorJammerPack] = 1; max[EnergyPack] = 1; max[RepairPack] = 1; max[ShieldPack] = 1; max[AmmoPack] = 1; max[SatchelCharge] = 1; max[MortarBarrelPack] = 0; max[MissileBarrelPack] = 0; max[AABarrelPack] = 0; max[PlasmaBarrelPack] = 0; max[ELFBarrelPack] = 0; max[InventoryDeployable]= 0; max[MotionSensorDeployable] = 1; max[PulseSensorDeployable] = 1; max[TurretOutdoorDeployable] = 0; max[TurretIndoorDeployable] = 0; max[FlashGrenade] = 5; max[ConcussionGrenade] = 5; max[FlareGrenade] = 5; max[TargetingLaser] = 1; max[ELFGun] = 1; max[ShockLance] = 1; max[CameraGrenade] = 2; max[Beacon] = 3; observeParameters = "0.5 4.5 4.5"; shieldEffectScale = "0.7 0.7 1.0"; }; //---------------------------------------------------------------------------- datablock DecalData(MediumMaleFootprint) { sizeX = 0.125; sizeY = 0.25; textureName = "special/footprints/M_male"; }; datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile { emap = true; className = Armor; shapeFile = "medium_male.dts"; cameraMaxDist = 3; computeCRC = true; debrisShapeName = "debris_player.dts"; debris = playerDebris; canObserve = true; cmdCategory = "Clients"; cmdIcon = CMDPlayerIcon; cmdMiniIconName = "commander/MiniIcons/com_player_grey"; hudImageNameFriendly[0] = "gui/hud_playertriangle"; hudImageNameEnemy[0] = "gui/hud_playertriangle_enemy"; hudRenderModulated[0] = true; hudImageNameFriendly[1] = "commander/MiniIcons/com_flag_grey"; hudImageNameEnemy[1] = "commander/MiniIcons/com_flag_grey"; hudRenderModulated[1] = true; hudRenderAlways[1] = true; hudRenderCenter[1] = true; hudRenderDistance[1] = true; hudImageNameFriendly[2] = "commander/MiniIcons/com_flag_grey"; hudImageNameEnemy[2] = "commander/MiniIcons/com_flag_grey"; hudRenderModulated[2] = true; hudRenderAlways[2] = true; hudRenderCenter[2] = true; hudRenderDistance[2] = true; // z0dd - ZOD, 10/06/02. Was missing these parameters. cameraDefaultFov = 90.0; cameraMinFov = 5.0; cameraMaxFov = 120.0; aiAvoidThis = true; minLookAngle = -1.5; maxLookAngle = 1.5; maxFreelookAngle = 3.0; mass = 130; drag = 0.3; maxdrag = 0.5; density = 10; maxDamage = 1.1; maxEnergy = 80; repairRate = 0.0033; energyPerDamagePoint = 75.0; // shield energy required to block one point of damage rechargeRate = 0.256; jetForce = 25.22 * 130; underwaterJetForce = 25.22 * 130 * 1.5; underwaterVertJetFactor = 1.5; jetEnergyDrain = 1.0; underwaterJetEnergyDrain = 0.6; minJetEnergy = 1; maxJetHorizontalPercentage = 0.8; runForce = 46 * 130; runEnergyDrain = 0; minRunEnergy = 0; maxForwardSpeed = 12; maxBackwardSpeed = 10; maxSideSpeed = 10; maxUnderwaterForwardSpeed = 8.5; maxUnderwaterBackwardSpeed = 7.5; maxUnderwaterSideSpeed = 7.5; recoverDelay = 9; recoverRunForceScale = 1.2; // heat inc'ers and dec'ers heatDecayPerSec = 1.0 / 4.0; // takes 4 seconds to clear heat sig. heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig. jumpForce = 8.3 * 130; jumpEnergyDrain = 0; minJumpEnergy = 0; jumpSurfaceAngle = 75; jumpDelay = 0; // Controls over slope of runnable/jumpable surfaces runSurfaceAngle = 70; jumpSurfaceAngle = 80; minJumpSpeed = 15; maxJumpSpeed = 25; horizMaxSpeed = 60; horizResistSpeed = 28; horizResistFactor = 0.32; maxJetForwardSpeed = 22; upMaxSpeed = 70; upResistSpeed = 30; upResistFactor = 0.23; minImpactSpeed = 45; speedDamageScale = 0.004; jetSound = ArmorJetSound; wetJetSound = ArmorWetJetSound; jetEmitter = HumanArmorJetEmitter; jetEffect = HumanMediumArmorJetEffect; boundingBox = "1.45 1.45 2.4"; pickupRadius = 0.75; // damage location details boxNormalHeadPercentage = 0.83; boxNormalTorsoPercentage = 0.49; boxHeadLeftPercentage = 0; boxHeadRightPercentage = 1; boxHeadBackPercentage = 0; boxHeadFrontPercentage = 1; //Foot Prints decalData = MediumMaleFootprint; decalOffset = 0.35; footPuffEmitter = LightPuffEmitter; footPuffNumParts = 15; footPuffRadius = 0.25; dustEmitter = LiftoffDustEmitter; splash = PlayerSplash; splashVelocity = 4.0; splashAngle = 67.0; splashFreqMod = 300.0; splashVelEpsilon = 0.60; bubbleEmitTime = 0.4; splashEmitter[0] = PlayerFoamDropletsEmitter; splashEmitter[1] = PlayerFoamEmitter; splashEmitter[2] = PlayerBubbleEmitter; mediumSplashSoundVelocity = 10.0; hardSplashSoundVelocity = 20.0; exitSplashSoundVelocity = 5.0; footstepSplashHeight = 0.35; //Footstep Sounds LFootSoftSound = LFootMediumSoftSound; RFootSoftSound = RFootMediumSoftSound; LFootHardSound = LFootMediumHardSound; RFootHardSound = RFootMediumHardSound; LFootMetalSound = LFootMediumMetalSound; RFootMetalSound = RFootMediumMetalSound; LFootSnowSound = LFootMediumSnowSound; RFootSnowSound = RFootMediumSnowSound; LFootShallowSound = LFootMediumShallowSplashSound; RFootShallowSound = RFootMediumShallowSplashSound; LFootWadingSound = LFootMediumWadingSound; RFootWadingSound = RFootMediumWadingSound; LFootUnderwaterSound = LFootMediumUnderwaterSound; RFootUnderwaterSound = RFootMediumUnderwaterSound; LFootBubblesSound = LFootMediumBubblesSound; RFootBubblesSound = RFootMediumBubblesSound; movingBubblesSound = ArmorMoveBubblesSound; waterBreathSound = WaterBreathMaleSound; impactSoftSound = ImpactMediumSoftSound; impactHardSound = ImpactMediumHardSound; impactMetalSound = ImpactMediumMetalSound; impactSnowSound = ImpactMediumSnowSound; skiSoftSound = SkiAllSoftSound; skiHardSound = SkiAllHardSound; skiMetalSound = SkiAllMetalSound; skiSnowSound = SkiAllSnowSound; impactWaterEasy = ImpactMediumWaterEasySound; impactWaterMedium = ImpactMediumWaterMediumSound; impactWaterHard = ImpactMediumWaterHardSound; groundImpactMinSpeed = 10.0; groundImpactShakeFreq = "4.0 4.0 4.0"; groundImpactShakeAmp = "1.0 1.0 1.0"; groundImpactShakeDuration = 0.8; groundImpactShakeFalloff = 10.0; exitingWater = ExitingWaterMediumSound; maxWeapons = 4; // Max number of different weapons the player can have maxGrenades = 1; // Max number of different grenades the player can have maxMines = 1; // Max number of different mines the player can have // Inventory restrictions max[RepairKit] = 1; max[Mine] = 3; max[Grenade] = 6; max[Blaster] = 1; max[Plasma] = 1; max[PlasmaAmmo] = 40; max[Disc] = 1; max[DiscAmmo] = 15; max[SniperRifle] = 0; max[GrenadeLauncher] = 1; max[GrenadeLauncherAmmo]= 12; max[Mortar] = 0; max[MortarAmmo] = 0; max[MissileLauncher] = 1; max[MissileLauncherAmmo]= 4; max[Chaingun] = 1; max[ChaingunAmmo] = 150; max[RepairGun] = 1; max[CloakingPack] = 0; max[SensorJammerPack] = 1; max[EnergyPack] = 1; max[RepairPack] = 1; max[ShieldPack] = 1; max[AmmoPack] = 1; max[SatchelCharge] = 1; max[MortarBarrelPack] = 1; max[MissileBarrelPack] = 1; max[AABarrelPack] = 1; max[PlasmaBarrelPack] = 1; max[ELFBarrelPack] = 1; max[InventoryDeployable]= 1; max[MotionSensorDeployable] = 1; max[PulseSensorDeployable] = 1; max[TurretOutdoorDeployable] = 1; max[TurretIndoorDeployable] = 1; max[FlashGrenade] = 6; max[ConcussionGrenade] = 6; max[FlareGrenade] = 6; max[TargetingLaser] = 1; max[ELFGun] = 1; max[ShockLance] = 1; max[CameraGrenade] = 3; max[Beacon] = 3; observeParameters = "0.5 4.5 4.5"; shieldEffectScale = "0.7 0.7 1.0"; }; //---------------------------------------------------------------------------- datablock DecalData(HeavyMaleFootprint) { sizeX = 0.25; sizeY = 0.5; textureName = "special/footprints/H_male"; }; datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile { emap = true; className = Armor; shapeFile = "heavy_male.dts"; cameraMaxDist = 3; computeCRC = true; debrisShapeName = "debris_player.dts"; debris = playerDebris; canObserve = true; cmdCategory = "Clients"; cmdIcon = CMDPlayerIcon; cmdMiniIconName = "commander/MiniIcons/com_player_grey"; hudImageNameFriendly[0] = "gui/hud_playertriangle"; hudImageNameEnemy[0] = "gui/hud_playertriangle_enemy"; hudRenderModulated[0] = true; hudImageNameFriendly[1] = "commander/MiniIcons/com_flag_grey"; hudImageNameEnemy[1] = "commander/MiniIcons/com_flag_grey"; hudRenderModulated[1] = true; hudRenderAlways[1] = true; hudRenderCenter[1] = true; hudRenderDistance[1] = true; hudImageNameFriendly[2] = "commander/MiniIcons/com_flag_grey"; hudImageNameEnemy[2] = "commander/MiniIcons/com_flag_grey"; hudRenderModulated[2] = true; hudRenderAlways[2] = true; hudRenderCenter[2] = true; hudRenderDistance[2] = true; // z0dd - ZOD, 10/06/02. Was missing these parameters. cameraDefaultFov = 90.0; cameraMinFov = 5.0; cameraMaxFov = 120.0; aiAvoidThis = true; minLookAngle = -1.5; maxLookAngle = 1.5; maxFreelookAngle = 3.0; mass = 180; drag = 0.33; maxdrag = 0.6; density = 10; maxDamage = 1.32; maxEnergy = 110; repairRate = 0.0033; energyPerDamagePoint = 75.0; // shield energy required to block one point of damage rechargeRate = 0.256; jetForce = 22.47 * 180; underwaterJetForce = 22.47 * 180 * 1.5; underwaterVertJetFactor = 1.5; jetEnergyDrain = 1.1; underwaterJetEnergyDrain = 0.65; minJetEnergy = 1; maxJetHorizontalPercentage = 0.8; runForce = 40.25 * 180; runEnergyDrain = 0; minRunEnergy = 0; maxForwardSpeed = 7; maxBackwardSpeed = 5; maxSideSpeed = 5; maxUnderwaterForwardSpeed = 4.5; maxUnderwaterBackwardSpeed = 3; maxUnderwaterSideSpeed = 3; recoverDelay = 9; recoverRunForceScale = 1.2; jumpForce = 8.3 * 180; jumpEnergyDrain = 0; minJumpEnergy = 0; jumpDelay = 0; // heat inc'ers and dec'ers heatDecayPerSec = 1.0 / 4.0; // takes 4 seconds to clear heat sig. heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig. // Controls over slope of runnable/jumpable surfaces runSurfaceAngle = 70; jumpSurfaceAngle = 75; minJumpSpeed = 20; maxJumpSpeed = 30; horizMaxSpeed = 52; horizResistSpeed = 23; horizResistFactor = 0.29; maxJetForwardSpeed = 16; upMaxSpeed = 60; upResistSpeed = 35; upResistFactor = 0.18; minImpactSpeed = 45; speedDamageScale = 0.006; jetSound = ArmorJetSound; wetJetSound = ArmorJetSound; jetEmitter = HumanArmorJetEmitter; boundingBox = "1.63 1.63 2.6"; pickupRadius = 0.75; // damage location details boxNormalHeadPercentage = 0.83; boxNormalTorsoPercentage = 0.49; boxHeadLeftPercentage = 0; boxHeadRightPercentage = 1; boxHeadBackPercentage = 0; boxHeadFrontPercentage = 1; //Foot Prints decalData = HeavyMaleFootprint; decalOffset = 0.4; footPuffEmitter = LightPuffEmitter; footPuffNumParts = 15; footPuffRadius = 0.25; dustEmitter = LiftoffDustEmitter; splash = PlayerSplash; splashVelocity = 4.0; splashAngle = 67.0; splashFreqMod = 300.0; splashVelEpsilon = 0.60; bubbleEmitTime = 0.4; splashEmitter[0] = PlayerFoamDropletsEmitter; splashEmitter[1] = PlayerFoamEmitter; splashEmitter[2] = PlayerBubbleEmitter; mediumSplashSoundVelocity = 10.0; hardSplashSoundVelocity = 20.0; exitSplashSoundVelocity = 5.0; footstepSplashHeight = 0.35; //Footstep Sounds LFootSoftSound = LFootHeavySoftSound; RFootSoftSound = RFootHeavySoftSound; LFootHardSound = LFootHeavyHardSound; RFootHardSound = RFootHeavyHardSound; LFootMetalSound = LFootHeavyMetalSound; RFootMetalSound = RFootHeavyMetalSound; LFootSnowSound = LFootHeavySnowSound; RFootSnowSound = RFootHeavySnowSound; LFootShallowSound = LFootHeavyShallowSplashSound; RFootShallowSound = RFootHeavyShallowSplashSound; LFootWadingSound = LFootHeavyWadingSound; RFootWadingSound = RFootHeavyWadingSound; LFootUnderwaterSound = LFootHeavyUnderwaterSound; RFootUnderwaterSound = RFootHeavyUnderwaterSound; LFootBubblesSound = LFootHeavyBubblesSound; RFootBubblesSound = RFootHeavyBubblesSound; movingBubblesSound = ArmorMoveBubblesSound; waterBreathSound = WaterBreathMaleSound; impactSoftSound = ImpactHeavySoftSound; impactHardSound = ImpactHeavyHardSound; impactMetalSound = ImpactHeavyMetalSound; impactSnowSound = ImpactHeavySnowSound; skiSoftSound = SkiAllSoftSound; skiHardSound = SkiAllHardSound; skiMetalSound = SkiAllMetalSound; skiSnowSound = SkiAllSnowSound; impactWaterEasy = ImpactHeavyWaterEasySound; impactWaterMedium = ImpactHeavyWaterMediumSound; impactWaterHard = ImpactHeavyWaterHardSound; groundImpactMinSpeed = 10.0; groundImpactShakeFreq = "4.0 4.0 4.0"; groundImpactShakeAmp = "1.0 1.0 1.0"; groundImpactShakeDuration = 0.8; groundImpactShakeFalloff = 10.0; exitingWater = ExitingWaterHeavySound; maxWeapons = 5; // Max number of different weapons the player can have maxGrenades = 1; // Max number of different grenades the player can have maxMines = 1; // Max number of different mines the player can have // Inventory restrictions max[RepairKit] = 1; max[Mine] = 3; max[Grenade] = 8; max[Blaster] = 1; max[Plasma] = 1; max[PlasmaAmmo] = 50; max[Disc] = 1; max[DiscAmmo] = 15; max[SniperRifle] = 0; max[GrenadeLauncher] = 1; max[GrenadeLauncherAmmo]= 15; max[Mortar] = 1; max[MortarAmmo] = 10; max[MissileLauncher] = 1; max[MissileLauncherAmmo]= 8; max[Chaingun] = 1; max[ChaingunAmmo] = 200; max[RepairGun] = 1; max[CloakingPack] = 0; max[SensorJammerPack] = 1; max[EnergyPack] = 1; max[RepairPack] = 1; max[ShieldPack] = 1; max[AmmoPack] = 1; max[SatchelCharge] = 1; max[MortarBarrelPack] = 1; max[MissileBarrelPack] = 1; max[AABarrelPack] = 1; max[PlasmaBarrelPack] = 1; max[ELFBarrelPack] = 1; max[InventoryDeployable]= 1; max[MotionSensorDeployable] = 1; max[PulseSensorDeployable] = 1; max[TurretOutdoorDeployable] = 1; max[TurretIndoorDeployable] = 1; max[FlashGrenade] = 8; max[ConcussionGrenade] = 8; max[FlareGrenade] = 8; max[TargetingLaser] = 1; max[ELFGun] = 1; max[ShockLance] = 1; max[CameraGrenade] = 3; max[Beacon] = 3; observeParameters = "0.5 4.5 4.5"; shieldEffectScale = "0.7 0.7 1.0"; }; //---------------------------------------------------------------------------- datablock PlayerData(LightFemaleHumanArmor) : LightMaleHumanArmor { shapeFile = "light_female.dts"; waterBreathSound = WaterBreathFemaleSound; jetEffect = HumanMediumArmorJetEffect; }; //---------------------------------------------------------------------------- datablock PlayerData(MediumFemaleHumanArmor) : MediumMaleHumanArmor { shapeFile = "medium_female.dts"; waterBreathSound = WaterBreathFemaleSound; jetEffect = HumanArmorJetEffect; }; //---------------------------------------------------------------------------- datablock PlayerData(HeavyFemaleHumanArmor) : HeavyMaleHumanArmor { shapeFile = "heavy_male.dts"; waterBreathSound = WaterBreathFemaleSound; }; //---------------------------------------------------------------------------- datablock DecalData(LightBiodermFootprint) { sizeX = 0.25; sizeY = 0.25; textureName = "special/footprints/L_bioderm"; }; datablock PlayerData(LightMaleBiodermArmor) : LightMaleHumanArmor { shapeFile = "bioderm_light.dts"; jetEmitter = BiodermArmorJetEmitter; jetEffect = BiodermArmorJetEffect; debrisShapeName = "bio_player_debris.dts"; //Foot Prints decalData = LightBiodermFootprint; decalOffset = 0.3; waterBreathSound = WaterBreathBiodermSound; }; //---------------------------------------------------------------------------- datablock DecalData(MediumBiodermFootprint) { sizeX = 0.25; sizeY = 0.25; textureName = "special/footprints/M_bioderm"; }; datablock PlayerData(MediumMaleBiodermArmor) : MediumMaleHumanArmor { shapeFile = "bioderm_medium.dts"; jetEmitter = BiodermArmorJetEmitter; jetEffect = BiodermArmorJetEffect; debrisShapeName = "bio_player_debris.dts"; //Foot Prints decalData = MediumBiodermFootprint; decalOffset = 0.35; waterBreathSound = WaterBreathBiodermSound; }; //---------------------------------------------------------------------------- datablock DecalData(HeavyBiodermFootprint) { sizeX = 0.25; sizeY = 0.5; textureName = "special/footprints/H_bioderm"; }; datablock PlayerData(HeavyMaleBiodermArmor) : HeavyMaleHumanArmor { emap = false; shapeFile = "bioderm_heavy.dts"; jetEmitter = BiodermArmorJetEmitter; debrisShapeName = "bio_player_debris.dts"; //Foot Prints decalData = HeavyBiodermFootprint; decalOffset = 0.4; waterBreathSound = WaterBreathBiodermSound; }; //---------------------------------------------------------------------------- function Armor::onAdd(%data,%obj) { Parent::onAdd(%data, %obj); // Vehicle timeout %obj.mountVehicle = true; // Default dynamic armor stats %obj.setRechargeRate(%data.rechargeRate); %obj.setRepairRate(0); %obj.setSelfPowered(); } function Armor::onRemove(%this, %obj) { //Frohny asked me to remove this - all players are deleted now on mission cycle... //if(%obj.getState() !$= "Dead") //{ // error("ERROR PLAYER REMOVED WITHOUT DEATH - TRACE:"); // trace(1); // schedule(0,0,trace,0); //} if (%obj.client.player == %obj) %obj.client.player = 0; } function Armor::onNewDataBlock(%this,%obj) { } function Armor::onDisabled(%this,%obj,%state) { %fadeTime = 1000; %obj.startFade( %fadeTime, ($CorpseTimeoutValue) - %fadeTime, true ); %obj.schedule($CorpseTimeoutValue, "delete"); } function Armor::shouldApplyImpulse(%data, %obj) { return true; } $wasFirstPerson = true; function Armor::onMount(%this,%obj,%vehicle,%node) { if (%node == 0) { // Node 0 is the pilot's pos. %obj.setTransform("0 0 0 0 0 1 0"); %obj.setActionThread(%vehicle.getDatablock().mountPose[%node],true,true); if(!%obj.inStation) %obj.lastWeapon = (%obj.getMountedImage($WeaponSlot) == 0 ) ? "" : %obj.getMountedImage($WeaponSlot).getName().item; %obj.unmountImage($WeaponSlot); if(!%obj.client.isAIControlled()) { %obj.setControlObject(%vehicle); %obj.client.setObjectActiveImage(%vehicle, 2); } //E3 respawn... if(%obj == %obj.lastVehicle.lastPilot && %obj.lastVehicle != %vehicle) { schedule(15000, %obj.lastVehicle,"vehicleAbandonTimeOut", %obj.lastVehicle); %obj.lastVehicle.lastPilot = ""; } if(%vehicle.lastPilot !$= "" && %vehicle == %vehicle.lastPilot.lastVehicle) %vehicle.lastPilot.lastVehicle = ""; %vehicle.abandon = false; %vehicle.lastPilot = %obj; %obj.lastVehicle = %vehicle; // update the vehicle's team if((%vehicle.getTarget() != -1) && %vehicle.getDatablock().cantTeamSwitch $= "") { setTargetSensorGroup(%vehicle.getTarget(), %obj.client.getSensorGroup()); if( %vehicle.turretObject > 0 ) setTargetSensorGroup(%vehicle.turretObject.getTarget(), %obj.client.getSensorGroup()); } // Send a message to the client so they can decide if they want to change view or not: commandToClient( %obj.client, 'VehicleMount' ); } else { // tailgunner/passenger positions if(%vehicle.getDataBlock().mountPose[%node] !$= "") %obj.setActionThread(%vehicle.getDatablock().mountPose[%node]); else %obj.setActionThread("root", true); } // ------------------------------------------------------------------------- // z0dd - ZOD, 10/06/02. announce to any other passengers that you've boarded if(%vehicle.getDatablock().numMountPoints > 1) { %nodeName = findNodeName(%vehicle, %node); // function in vehicle.cs for(%i = 0; %i < %vehicle.getDatablock().numMountPoints; %i++) { if (%vehicle.getMountNodeObject(%i) > 0) { if(%vehicle.getMountNodeObject(%i).client != %obj.client) { %team = (%obj.team == %vehicle.getMountNodeObject(%i).client.team ? 'Teammate' : 'Enemy'); messageClient( %vehicle.getMountNodeObject(%i).client, 'MsgShowPassenger', '\c2%3: \c3%1\c2 has boarded in the \c3%2\c2 position.', %obj.client.name, %nodeName, %team ); } commandToClient( %vehicle.getMountNodeObject(%i).client, 'showPassenger', %node, true); } } } //make sure they don't have any packs active // if ( %obj.getImageState( $BackpackSlot ) $= "activate") // %obj.use("Backpack"); if ( %obj.getImageTrigger( $BackpackSlot ) ) %obj.setImageTrigger( $BackpackSlot, false ); //AI hooks %obj.client.vehicleMounted = %vehicle; AIVehicleMounted(%vehicle); if(%obj.client.isAIControlled()) %this.AIonMount(%obj, %vehicle, %node); } function Armor::onUnmount( %this, %obj, %vehicle, %node ) { if ( %node == 0 ) { commandToClient( %obj.client, 'VehicleDismount' ); commandToClient(%obj.client, 'removeReticle'); if(%obj.inv[%obj.lastWeapon]) %obj.use(%obj.lastWeapon); if(%obj.getMountedImage($WeaponSlot) == 0) %obj.selectWeaponSlot( 0 ); //Inform gunner position when pilot leaves... //if(%vehicle.getDataBlock().showPilotInfo !$= "") // if((%gunner = %vehicle.getMountNodeObject(1)) != 0) // commandToClient(%gunner.client, 'PilotInfo', "PILOT EJECTED", 6, 1); } // ---------------------------------------------------------------------- // z0dd - ZOD, 10/06/02. announce to any other passengers that you've left if(%vehicle.getDatablock().numMountPoints > 1) { %nodeName = findNodeName(%vehicle, %node); // function in vehicle.cs for(%i = 0; %i < %vehicle.getDatablock().numMountPoints; %i++) { if (%vehicle.getMountNodeObject(%i) > 0) { if(%vehicle.getMountNodeObject(%i).client != %obj.client) { %team = (%obj.team == %vehicle.getMountNodeObject(%i).client.team ? 'Teammate' : 'Enemy'); messageClient( %vehicle.getMountNodeObject(%i).client, 'MsgShowPassenger', '\c2%3: \c3%1\c2 has ejected from the \c3%2\c2 position.', %obj.client.name, %nodeName, %team ); } commandToClient( %vehicle.getMountNodeObject(%i).client, 'showPassenger', %node, false); } } } //AI hooks %obj.client.vehicleMounted = ""; if(%obj.client.isAIControlled()) %this.AIonUnMount(%obj, %vehicle, %node); } $ammoType[0] = "PlasmaAmmo"; $ammoType[1] = "DiscAmmo"; $ammoType[2] = "GrenadeLauncherAmmo"; $ammoType[3] = "MortarAmmo"; $ammoType[4] = "MissileLauncherAmmo"; $ammoType[5] = "ChaingunAmmo"; // z0dd - ZOD, 9/13/02. TR2 weapons $ammoType[6] = "TR2DiscAmmo"; $ammoType[7] = "TR2GrenadeLauncherAmmo"; $ammoType[8] = "TR2ChaingunAmmo"; $ammoType[9] = "TR2MortarAmmo"; function Armor::onCollision(%this,%obj,%col,%forceVehicleNode) { if (%obj.getState() $= "Dead") return; %dataBlock = %col.getDataBlock(); %className = %dataBlock.className; %client = %obj.client; // player collided with a vehicle %node = -1; if (%forceVehicleNode !$= "" || (%className $= WheeledVehicleData || %className $= FlyingVehicleData || %className $= HoverVehicleData) && %obj.mountVehicle && %obj.getState() $= "Move" && %col.mountable && !%obj.inStation && %col.getDamageState() !$= "Destroyed") { //if the player is an AI, he should snap to the mount points in node order, //to ensure they mount the turret before the passenger seat, regardless of where they collide... if (%obj.client.isAIControlled()) { %transform = %col.getTransform(); //either the AI is *required* to pilot, or they'll pick the first available passenger seat if (%client.pilotVehicle) { //make sure the bot is in light armor if (%client.player.getArmorSize() $= "Light") { //make sure the pilot seat is empty if (!%col.getMountNodeObject(0)) %node = 0; } } else %node = findAIEmptySeat(%col, %obj); } else %node = findEmptySeat(%col, %obj, %forceVehicleNode); //now mount the player in the vehicle if(%node >= 0) { // players can't be pilots, bombardiers or turreteers if they have // "large" packs -- stations, turrets, turret barrels if(hasLargePack(%obj)) { // check to see if attempting to enter a "sitting" node if(nodeIsSitting(%datablock, %node)) { // send the player a message -- can't sit here with large pack if(!%obj.noSitMessage) { %obj.noSitMessage = true; %obj.schedule(2000, "resetSitMessage"); messageClient(%obj.client, 'MsgCantSitHere', '\c2Pack too large, can\'t occupy this seat.~wfx/misc/misc.error.wav'); } return; } } if(%col.noEnemyControl && %obj.team != %col.team) return; commandToClient(%obj.client,'SetDefaultVehicleKeys', true); //If pilot or passenger then bind a few extra keys if(%node == 0) commandToClient(%obj.client,'SetPilotVehicleKeys', true); else commandToClient(%obj.client,'SetPassengerVehicleKeys', true); if(!%obj.inStation) %col.lastWeapon = ( %col.getMountedImage($WeaponSlot) == 0 ) ? "" : %col.getMountedImage($WeaponSlot).getName().item; else %col.lastWeapon = %obj.lastWeapon; %col.mountObject(%obj,%node); %col.playAudio(0, MountVehicleSound); %obj.mVehicle = %col; // if player is repairing something, stop it if(%obj.repairing) stopRepairing(%obj); //this will setup the huds as well... %dataBlock.playerMounted(%col,%obj, %node); } } else if (%className $= "Armor") { // player has collided with another player if(%col.getState() $= "Dead") { %gotSomething = false; // it's corpse-looting time! // weapons -- don't pick up more than you are allowed to carry! for(%i = 0; ( %obj.weaponCount < %obj.getDatablock().maxWeapons ) && $InvWeapon[%i] !$= ""; %i++) { %weap = $NameToInv[$InvWeapon[%i]]; if ( %col.hasInventory( %weap ) ) { if ( %obj.incInventory(%weap, 1) > 0 ) { %col.decInventory(%weap, 1); %gotSomething = true; messageClient(%obj.client, 'MsgItemPickup', '\c0You picked up %1.', %weap.pickUpName); } } } // targeting laser: if ( %col.hasInventory( "TargetingLaser" ) ) { if ( %obj.incInventory( "TargetingLaser", 1 ) > 0 ) { %col.decInventory( "TargetingLaser", 1 ); %gotSomething = true; messageClient( %obj.client, 'MsgItemPickup', '\c0You picked up a targeting laser.' ); } } // ammo for(%j = 0; $ammoType[%j] !$= ""; %j++) { %ammoAmt = %col.inv[$ammoType[%j]]; if(%ammoAmt) { // incInventory returns the amount of stuff successfully grabbed %grabAmt = %obj.incInventory($ammoType[%j], %ammoAmt); if(%grabAmt > 0) { %col.decInventory($ammoType[%j], %grabAmt); %gotSomething = true; messageClient(%obj.client, 'MsgItemPickup', '\c0You picked up %1.', $ammoType[%j].pickUpName); %obj.client.setWeaponsHudAmmo($ammoType[%j], %obj.getInventory($ammoType[%j])); } } } // figure out what type, if any, grenades the (live) player has %playerGrenType = "None"; for(%x = 0; $InvGrenade[%x] !$= ""; %x++) { %gren = $NameToInv[$InvGrenade[%x]]; %playerGrenAmt = %obj.inv[%gren]; if(%playerGrenAmt > 0) { %playerGrenType = %gren; break; } } // grenades for(%k = 0; $InvGrenade[%k] !$= ""; %k++) { %gren = $NameToInv[$InvGrenade[%k]]; %corpseGrenAmt = %col.inv[%gren]; // does the corpse hold any of this grenade type? if(%corpseGrenAmt) { // can the player pick up this grenade type? if((%playerGrenType $= "None") || (%playerGrenType $= %gren)) { %taken = %obj.incInventory(%gren, %corpseGrenAmt); if(%taken > 0) { %col.decInventory(%gren, %taken); %gotSomething = true; messageClient(%obj.client, 'MsgItemPickup', '\c0You picked up %1.', %gren.pickUpName); %obj.client.setInventoryHudAmount(%gren, %obj.getInventory(%gren)); } } break; } } // figure out what type, if any, mines the (live) player has %playerMineType = "None"; for(%y = 0; $InvMine[%y] !$= ""; %y++) { %mType = $NameToInv[$InvMine[%y]]; %playerMineAmt = %obj.inv[%mType]; if(%playerMineAmt > 0) { %playerMineType = %mType; break; } } // mines for(%l = 0; $InvMine[%l] !$= ""; %l++) { %mine = $NameToInv[$InvMine[%l]]; %mineAmt = %col.inv[%mine]; if(%mineAmt) { if((%playerMineType $= "None") || (%playerMineType $= %mine)) { %grabbed = %obj.incInventory(%mine, %mineAmt); if(%grabbed > 0) { %col.decInventory(%mine, %grabbed); %gotSomething = true; messageClient(%obj.client, 'MsgItemPickup', '\c0You picked up %1.', %mine.pickUpName); %obj.client.setInventoryHudAmount(%mine, %obj.getInventory(%mine)); } } break; } } // beacons %beacAmt = %col.inv[Beacon]; if(%beacAmt) { %bTaken = %obj.incInventory(Beacon, %beacAmt); if(%bTaken > 0) { %col.decInventory(Beacon, %bTaken); %gotSomething = true; messageClient(%obj.client, 'MsgItemPickup', '\c0You picked up %1.', Beacon.pickUpName); %obj.client.setInventoryHudAmount(Beacon, %obj.getInventory(Beacon)); } } // repair kit %rkAmt = %col.inv[RepairKit]; if(%rkAmt) { %rkTaken = %obj.incInventory(RepairKit, %rkAmt); if(%rkTaken > 0) { %col.decInventory(RepairKit, %rkTaken); %gotSomething = true; messageClient(%obj.client, 'MsgItemPickup', '\c0You picked up %1.', RepairKit.pickUpName); %obj.client.setInventoryHudAmount(RepairKit, %obj.getInventory(RepairKit)); } } } if(%gotSomething) %col.playAudio(0, CorpseLootingSound); } } function Player::resetSitMessage(%obj) { %obj.noSitMessage = false; } function Player::setInvincible(%this, %val) { %this.invincible = %val; } function Player::causedRecentDamage(%this, %val) { %this.causedRecentDamage = %val; } function hasLargePack(%player) { %pack = %player.getMountedImage($BackpackSlot); if(%pack.isLarge) return true; else return false; } function nodeIsSitting(%vehDBlock, %node) { // pilot == always a "sitting" node if(%node == 0) return true; else { switch$ (%vehDBlock.getName()) { // note: for assault tank -- both nodes are sitting // for any single-user vehicle -- pilot node is sitting case "BomberFlyer": // bombardier == sitting; tailgunner == not sitting if(%node == 1) return true; else return false; case "HAPCFlyer": // only the pilot node is sitting return false; default: return true; } } } //---------------------------------------------------------------------------- function Player::setMountVehicle(%this, %val) { %this.mountVehicle = %val; } function Armor::doDismount(%this, %obj, %forced) { // This function is called by player.cc when the jump trigger // is true while mounted if (!%obj.isMounted()) return; if(isObject(%obj.getObjectMount().shield)) %obj.getObjectMount().shield.delete(); commandToClient(%obj.client,'SetDefaultVehicleKeys', false); // Position above dismount point %pos = getWords(%obj.getTransform(), 0, 2); %oldPos = %pos; %vec[0] = " 0 0 1"; %vec[1] = " 0 0 1"; %vec[2] = " 0 0 -1"; %vec[3] = " 1 0 0"; %vec[4] = "-1 0 0"; %numAttempts = 5; %success = -1; %impulseVec = "0 0 0"; if (%obj.getObjectMount().getDatablock().hasDismountOverrides() == true) { %vec[0] = %obj.getObjectMount().getDatablock().getDismountOverride(%obj.getObjectMount(), %obj); %vec[0] = MatrixMulVector(%obj.getObjectMount().getTransform(), %vec[0]); } else { %vec[0] = MatrixMulVector( %obj.getTransform(), %vec[0]); } %pos = "0 0 0"; for (%i = 0; %i < %numAttempts; %i++) { %pos = VectorAdd(%oldPos, VectorScale(%vec[%i], 3)); if (%obj.checkDismountPoint(%oldPos, %pos)) { %success = %i; %impulseVec = %vec[%i]; break; } } if (%forced && %success == -1) { %pos = %oldPos; } // hide the dashboard HUD and delete elements based on node commandToClient(%obj.client, 'setHudMode', 'Standard', "", 0); // Unmount and control body if(%obj.vehicleTurret) %obj.vehicleTurret.getDataBlock().playerDismount(%obj.vehicleTurret); %obj.unmount(); if(%obj.mVehicle) %obj.mVehicle.getDataBlock().playerDismounted(%obj.mVehicle, %obj); // bots don't change their control objects when in vehicles if(!%obj.client.isAIControlled()) { %vehicle = %obj.getControlObject(); %obj.setControlObject(0); } %obj.mountVehicle = false; %obj.schedule(4000, "setMountVehicle", true); // Position above dismount point %obj.setTransform(%pos); %obj.playAudio(0, UnmountVehicleSound); %obj.applyImpulse(%pos, VectorScale(%impulseVec, %obj.getDataBlock().mass * 3)); %obj.setPilot(false); %obj.vehicleTurret = ""; } function resetObserveFollow( %client, %dismount ) { if( %dismount ) { if( !isObject( %client.player ) ) return; for( %i = 0; %i < %client.observeCount; %i++ ) { %client.observers[%i].camera.setOrbitMode( %client.player, %client.player.getTransform(), 0.5, 4.5, 4.5); } } else { if( !%client.player.isMounted() ) return; // grab the vehicle... %mount = %client.player.getObjectMount(); if( %mount.getDataBlock().observeParameters $= "" ) %params = %client.player.getTransform(); else %params = %mount.getDataBlock().observeParameters; for( %i = 0; %i < %client.observeCount; %i++ ) { %client.observers[%i].camera.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 )); } } } //---------------------------------------------------------------------------- function Player::scriptKill(%player, %damageType) { %player.scriptKilled = 1; %player.setInvincible(false); %player.damage(0, %player.getPosition(), 10000, %damageType); } function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC) { //error("Armor::damageObject( "@%data@", "@%targetObject@", "@%sourceObject@", "@%position@", "@%amount@", "@%damageType@", "@%momVec@" )"); if(%targetObject.invincible || %targetObject.getState() $= "Dead") return; //---------------------------------------------------------------- // z0dd - ZOD, 6/09/02. Check to see if this vehcile is destroyed, // if it is do no damage. Fixes vehicle ghosting bug. We do not // check for isObject here, destroyed objects fail it even though // they exist as objects, go figure. if(%damageType == $DamageType::Impact) if(%sourceObject.getDamageState() $= "Destroyed") return; if (%targetObject.isMounted() && %targetObject.scriptKilled $= "") { %mount = %targetObject.getObjectMount(); if(%mount.team == %targetObject.team) { %found = -1; for (%i = 0; %i < %mount.getDataBlock().numMountPoints; %i++) { if (%mount.getMountNodeObject(%i) == %targetObject) { %found = %i; break; } } if (%found != -1) { if (%mount.getDataBlock().isProtectedMountPoint[%found]) { %mount.getDataBlock().damageObject(%mount, %sourceObject, %position, %amount, %damageType); return; } } } } %targetClient = %targetObject.getOwnerClient(); if(isObject(%mineSC)) %sourceClient = %mineSC; else %sourceClient = isObject(%sourceObject) ? %sourceObject.getOwnerClient() : 0; %targetTeam = %targetClient.team; //if the source object is a player object, player's don't have sensor groups // if it's a turret, get the sensor group of the target // if its a vehicle (of any type) use the sensor group if (%sourceClient) %sourceTeam = %sourceClient.getSensorGroup(); else if(%damageType == $DamageType::Suicide) %sourceTeam = 0; //-------------------------------------------------------------------------------------------------------------------- // z0dd - ZOD, 5/8/02. Check to see if this turret has a valid owner, if not clear the owner varible. //else if(isObject(%sourceObject) && %sourceObject.getClassName() $= "Turret") // %sourceTeam = getTargetSensorGroup(%sourceObject.getTarget()); else if(isObject(%sourceObject) && %sourceObject.getClassName() $= "Turret") { %sourceTeam = getTargetSensorGroup(%sourceObject.getTarget()); if(%sourceObject.owner !$="" && (%sourceObject.owner.team != %sourceObject.team || !isObject(%sourceObject.owner))) %sourceObject.owner = ""; } // End z0dd - ZOD //-------------------------------------------------------------------------------------------------------------------- else if( isObject(%sourceObject) && ( %sourceObject.getClassName() $= "FlyingVehicle" || %sourceObject.getClassName() $= "WheeledVehicle" || %sourceObject.getClassName() $= "HoverVehicle")) %sourceTeam = getTargetSensorGroup(%sourceObject.getTarget()); else { if (isObject(%sourceObject) && %sourceObject.getTarget() >= 0 ) { %sourceTeam = getTargetSensorGroup(%sourceObject.getTarget()); } else { %sourceTeam = -1; } } // if teamdamage is off, and both parties are on the same team // (but are not the same person), apply no damage if(!$teamDamage && (%targetClient != %sourceClient) && (%targetTeam == %sourceTeam)) return; if(%targetObject.isShielded && %damageType != $DamageType::Blaster) %amount = %data.checkShields(%targetObject, %position, %amount, %damageType); if(%amount == 0) return; // Set the damage flash %damageScale = %data.damageScale[%damageType]; if(%damageScale !$= "") %amount *= %damageScale; %flash = %targetObject.getDamageFlash() + (%amount * 2); if (%flash > 0.75) %flash = 0.75; %previousDamage = %targetObject.getDamagePercent(); %targetObject.setDamageFlash(%flash); %targetObject.applyDamage(%amount); Game.onClientDamaged(%targetClient, %sourceClient, %damageType, %sourceObject); %targetClient.lastDamagedBy = %damagingClient; %targetClient.lastDamaged = getSimTime(); //now call the "onKilled" function if the client was... you know... if(%targetObject.getState() $= "Dead") { // where did this guy get it? %damLoc = %targetObject.getDamageLocation(%position); // should this guy be blown apart? if( %damageType == $DamageType::Explosion || %damageType == $DamageType::TankMortar || %damageType == $DamageType::Mortar || %damageType == $DamageType::MortarTurret || %damageType == $DamageType::BomberBombs || %damageType == $DamageType::SatchelCharge || %damageType == $DamageType::Missile ) { if( %previousDamage >= 0.35 ) // only if <= 35 percent damage remaining { %targetObject.setMomentumVector(%momVec); %targetObject.blowup(); } } // this should be funny... if( %damageType == $DamageType::VehicleSpawn ) { %targetObject.setMomentumVector("0 0 1"); %targetObject.blowup(); } // If we were killed, max out the flash %targetObject.setDamageFlash(0.75); %damLoc = %targetObject.getDamageLocation(%position); Game.onClientKilled(%targetClient, %sourceClient, %damageType, %sourceObject, %damLoc); } else if ( %amount > 0.1 ) { if( %targetObject.station $= "" && %targetObject.isCloaked() ) { %targetObject.setCloaked( false ); %targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true ); } playPain( %targetObject ); } } function Armor::onImpact(%data, %playerObject, %collidedObject, %vec, %vecLen) { %data.damageObject(%playerObject, 0, VectorAdd(%playerObject.getPosition(),%vec), %vecLen * %data.speedDamageScale, $DamageType::Ground); } function Armor::applyConcussion( %this, %dist, %radius, %sourceObject, %targetObject ) { %percentage = 1 - ( %dist / %radius ); %random = getRandom(); if( %sourceObject == %targetObject ) { %flagChance = 1.0; %itemChance = 1.0; } else { %flagChance = 0.7; %itemChance = 0.7; } %probabilityFlag = %flagChance * %percentage; %probabilityItem = %itemChance * %percentage; if( %random <= %probabilityFlag ) { Game.applyConcussion( %targetObject ); } if( %random <= %probabilityItem ) { %player = %targetObject; %numWeapons = 0; // blaster 0 // plasma 1 // chain 2 // disc 3 // grenade 4 // snipe 5 // elf 6 // mortar 7 //get our inventory if( %weaps[0] = %player.getInventory("Blaster") > 0 ) %numWeapons++; if( %weaps[1] = %player.getInventory("Plasma") > 0 ) %numWeapons++; if( %weaps[2] = %player.getInventory("Chaingun") > 0 ) %numWeapons++; if( %weaps[3] = %player.getInventory("Disc") > 0 ) %numWeapons++; if( %weaps[4] = %player.getInventory("GrenadeLauncher") > 0 ) %numWeapons++; if( %weaps[5] = %player.getInventory("SniperRifle") > 0 ) %numWeapons++; if( %weaps[6] = %player.getInventory("ELFGun") > 0 ) %numWeapons++; if( %weaps[7] = %player.getInventory("Mortar") > 0 ) %numWeapons++; %foundWeapon = false; %attempts = 0; if( %numWeapons > 0 ) { while( !%foundWeapon ) { %rand = mFloor( getRandom() * 8 ); if( %weaps[ %rand ] ) { %foundWeapon = true; switch ( %rand ) { case 0: %player.use("Blaster"); case 1: %player.use("Plasma"); case 2: %player.use("Chaingun"); case 3: %player.use("Disc"); case 4: %player.use("GrenadeLauncher"); case 5: %player.use("SniperRifle"); case 6: %player.use("ElfGun"); case 7: %player.use("Mortar"); } %image = %player.getMountedImage( $WeaponSlot ); %player.throw( %image.item ); %player.client.setWeaponsHudItem( %image.item, 0, 0 ); %player.throwPack(); } else { %attempts++; if( %attempts > 10 ) %foundWeapon = true; } } } else { %targetObject.throwPack(); %targetObject.throwWeapon(); } } } //---------------------------------------------------------------------------- $DeathCry[1] = 'avo.deathCry_01'; $DeathCry[2] = 'avo.deathCry_02'; $PainCry[1] = 'avo.grunt'; $PainCry[2] = 'avo.pain'; function playDeathCry( %obj ) { %client = %obj.client; %random = getRandom(1) + 1; %desc = AudioClosest3d; playTargetAudio( %client.target, $DeathCry[%random], %desc, false ); } function playPain( %obj ) { %client = %obj.client; %random = getRandom(1) + 1; %desc = AudioClosest3d; playTargetAudio( %client.target, $PainCry[%random], %desc, false); } //---------------------------------------------------------------------------- //$DefaultPlayerArmor = LightMaleHumanArmor; $DefaultPlayerArmor = Light; function Player::setArmor(%this,%size) { // Takes size as "Light","Medium", "Heavy" %client = %this.client; if (%client.race $= "Bioderm") // Only have male bioderms. %armor = %size @ "Male" @ %client.race @ Armor; else %armor = %size @ %client.sex @ %client.race @ Armor; //echo("Player::armor: " @ %armor); %this.setDataBlock(%armor); %client.armor = %size; } function getDamagePercent(%maxDmg, %dmgLvl) { return (%dmgLvl / %maxDmg); } function Player::getArmorSize(%this) { // return size as "Light","Medium", "Heavy" %dataBlock = %this.getDataBlock().getName(); if (getSubStr(%dataBlock, 0, 5) $= "Light") return "Light"; else if (getSubStr(%dataBlock, 0, 6) $= "Medium") return "Medium"; else if (getSubStr(%dataBlock, 0, 5) $= "Heavy") return "Heavy"; else return "Unknown"; } function Player::pickup(%this,%obj,%amount) { %data = %obj.getDataBlock(); // Don't pick up a pack if we already have one mounted if (%data.className $= Pack && %this.getMountedImage($BackpackSlot) != 0) return 0; // don't pick up a weapon (other than targeting laser) if player's at maxWeapons else if(%data.className $= Weapon && %data.getName() !$= "TargetingLaser" // Special case && %this.weaponCount >= %this.getDatablock().maxWeapons) return 0; // don't allow players to throw large packs at pilots (thanks Wizard) else if(%data.className $= Pack && %data.image.isLarge && %this.isPilot()) return 0; return ShapeBase::pickup(%this,%obj,%amount); } function Player::use( %this,%data ) { // If player is in a station then he can't use any items if(%this.station !$= "") return false; // Convert the word "Backpack" to whatever is in the backpack slot. if ( %data $= "Backpack" ) { if ( %this.inStation ) return false; if ( %this.isPilot() ) { messageClient( %this.client, 'MsgCantUsePack', '\c2You can\'t use your pack while piloting.~wfx/misc/misc.error.wav' ); return( false ); } else if ( %this.isWeaponOperator() ) { messageClient( %this.client, 'MsgCantUsePack', '\c2You can\'t use your pack while in a weaponry position.~wfx/misc/misc.error.wav' ); return( false ); } %image = %this.getMountedImage( $BackpackSlot ); if ( %image ) %data = %image.item; } // Can't use some items when piloting or your a weapon operator if ( %this.isPilot() || %this.isWeaponOperator() ) if ( %data.getName() !$= "RepairKit" ) return false; return ShapeBase::use( %this, %data ); } function Player::maxInventory(%this,%data) { %max = ShapeBase::maxInventory(%this,%data); if (%this.getInventory(AmmoPack)) %max += AmmoPack.max[%data.getName()]; return %max; } function Player::isPilot(%this) { %vehicle = %this.getObjectMount(); // There are two "if" statements to avoid a script warning. if (%vehicle) if (%vehicle.getMountNodeObject(0) == %this) return true; return false; } function Player::isWeaponOperator(%this) { %vehicle = %this.getObjectMount(); if ( %vehicle ) { %weaponNode = %vehicle.getDatablock().weaponNode; if ( %weaponNode > 0 && %vehicle.getMountNodeObject( %weaponNode ) == %this ) return( true ); } return( false ); } function Player::liquidDamage(%obj, %data, %damageAmount, %damageType) { if(%obj.getState() !$= "Dead") { %data.damageObject(%obj, 0, "0 0 0", %damageAmount, %damageType); %obj.lDamageSchedule = %obj.schedule(50, "liquidDamage", %data, %damageAmount, %damageType); } else %obj.lDamageSchedule = ""; } function Armor::onEnterLiquid(%data, %obj, %coverage, %type) { switch(%type) { case 0: //Water case 1: //Ocean Water case 2: //River Water case 3: //Stagnant Water case 4: //Lava %obj.liquidDamage(%data, $DamageLava, $DamageType::Lava); case 5: //Hot Lava %obj.liquidDamage(%data, $DamageHotLava, $DamageType::Lava); case 6: //Crusty Lava %obj.liquidDamage(%data, $DamageCrustyLava, $DamageType::Lava); case 7: //Quick Sand } } function Armor::onLeaveLiquid(%data, %obj, %type) { switch(%type) { case 0: //Water case 1: //Ocean Water case 2: //River Water case 3: //Stagnant Water case 4: //Lava case 5: //Hot Lava case 6: //Crusty Lava case 7: //Quick Sand } if(%obj.lDamageSchedule !$= "") { cancel(%obj.lDamageSchedule); %obj.lDamageSchedule = ""; } } function Armor::onTrigger(%data, %player, %triggerNum, %val) { if (%triggerNum == 4) { // Throw grenade if (%val == 1) { %player.grenTimer = 1; } else { if (%player.grenTimer == 0) { // Bad throw for some reason } else { %player.use(Grenade); %player.grenTimer = 0; } } } else if (%triggerNum == 5) { // Throw mine if (%val == 1) { %player.mineTimer = 1; } else { if (%player.mineTimer == 0) { // Bad throw for some reason } else { %player.use(Mine); %player.mineTimer = 0; } } } else if (%triggerNum == 3) { // val = 1 when jet key (LMB) first pressed down // val = 0 when jet key released // MES - do we need this at all any more? if(%val == 1) %player.isJetting = true; else %player.isJetting = false; } } function Player::setMoveState(%obj, %move) { %obj.disableMove(%move); } function Armor::onLeaveMissionArea(%data, %obj) { Game.leaveMissionArea(%data, %obj); } function Armor::onEnterMissionArea(%data, %obj) { Game.enterMissionArea(%data, %obj); } function Armor::animationDone(%data, %obj) { if(%obj.animResetWeapon !$= "") { if(%obj.getMountedImage($WeaponSlot) == 0) if(%obj.inv[%obj.lastWeapon]) %obj.use(%obj.lastWeapon); %obj.animSetWeapon = ""; } } function playDeathAnimation(%player, %damageLocation, %type) { %vertPos = firstWord(%damageLocation); %quadrant = getWord(%damageLocation, 1); //echo("vert Pos: " @ %vertPos); //echo("quad: " @ %quadrant); if( %type == $DamageType::Explosion || %type == $DamageType::Mortar || %type == $DamageType::Grenade) { if(%quadrant $= "front_left" || %quadrant $= "front_right") %curDie = $PlayerDeathAnim::ExplosionBlowBack; else %curDie = $PlayerDeathAnim::TorsoBackFallForward; } else if(%vertPos $= "head") { if(%quadrant $= "front_left" || %quadrant $= "front_right" ) %curDie = $PlayerDeathAnim::HeadFrontDirect; else %curDie = $PlayerDeathAnim::HeadBackFallForward; } else if(%vertPos $= "torso") { if(%quadrant $= "front_left" ) %curDie = $PlayerDeathAnim::TorsoLeftSpinDeath; else if(%quadrant $= "front_right") %curDie = $PlayerDeathAnim::TorsoRightSpinDeath; else if(%quadrant $= "back_left" ) %curDie = $PlayerDeathAnim::TorsoBackFallForward; else if(%quadrant $= "back_right") %curDie = $PlayerDeathAnim::TorsoBackFallForward; } else if (%vertPos $= "legs") { if(%quadrant $= "front_left" || %quadrant $= "back_left") %curDie = $PlayerDeathAnim::LegsLeftGimp; if(%quadrant $= "front_right" || %quadrant $= "back_right") %curDie = $PlayerDeathAnim::LegsRightGimp; } if(%curDie $= "" || %curDie < 1 || %curDie > 11) %curDie = 1; %player.setActionThread("Death" @ %curDie); } function Armor::onDamage(%data, %obj) { if(%obj.station !$= "" && %obj.getDamageLevel() == 0) %obj.station.getDataBlock().endRepairing(%obj.station); }PK !(( scripts/power.cs$PowerThread = 0; $AmbientThread = 1; $ActivateThread = 2; $DeployThread = 3; $HumSound = 0; $ActivateSound = 1; $DeploySound = 2; $PlaySound = 3; //****************************************************************************** //* Power -Audio- Data Blocks * //****************************************************************************** datablock AudioProfile(BasePowerOn) { filename = "fx/powered/base_power_on.wav"; description = Audio2D; preload = true; }; datablock AudioProfile(BasePowerOff) { filename = "fx/powered/base_power_off.wav"; description = Audio2D; preload = true; }; datablock AudioProfile(BasePowerHum) { filename = "fx/powered/base_power_loop.wav"; description = AudioLooping2D; preload = true; }; //****************************************************************************** //* Power - Functions * //****************************************************************************** function GameBase::clearPower(%this) { } function SimGroup::clearPower(%this) { %this.powerCount = 0; for (%i = 0; %i < %this.getCount(); %i++) { %obj = %this.getObject(%i); if(%obj.getType() & $TypeMasks::GameBaseObjectType) %obj.clearPower(); } } function SimObject::powerInit(%this, %powerCount) { //function declared to reduce console error msg spam } function SimGroup::powerInit(%this, %powerCount) { if(%this.providesPower) %powerCount++; %count = %this.getCount(); for (%i = 0; %i < %count; %i++) { %obj = %this.getObject(%i); if(%obj.getType() & $TypeMasks::GameBaseObjectType) { if(%obj.getDatablock().isPowering(%obj)) %powerCount++; } } %this.powerCount = %powerCount; for (%i = 0; %i < %this.getCount(); %i++) { %obj = %this.getObject(%i); %obj.powerInit(%powerCount); } } function GameBase::powerInit(%this, %powerCount) { if(%powerCount) %this.getDatablock().gainPower(%this); else %this.getDataBlock().losePower(%this); } function SimObject::isPowering(%data, %obj) { return false; } function Generator::isPowering(%data, %obj) { return !%obj.isDisabled(); } function SimObject::updatePowerCount() { } function SimObject::powerCheck() { } function SimGroup::updatePowerCount(%this, %value) { if(%this.powerCount > 0 || %value > 0) %this.powerCount += %value; for (%i = 0; %i < %this.getCount(); %i++) { %this.getObject(%i).updatePowerCount(%value); } for (%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).powerCheck(%this.powerCount); } function GameBaseData::gainPower(%data, %obj) { } function GameBaseData::losePower(%data, %obj) { } function InteriorInstance::powerCheck(%this, %powerCount) { if(%powerCount > 0) %mode = "Off"; else %mode = "On"; %this.setAlarmMode(%mode); } function GameBase::powerCheck(%this, %powerCount) { if(%powerCount || %this.selfPower) %this.getDatablock().gainPower(%this); else %this.getDatablock().losePower(%this); } function GameBase::incPowerCount(%this) { %this.getGroup().updatePowerCount(1); } function GameBase::decPowerCount(%this) { %this.getGroup().updatePowerCount(-1); } function GameBase::setSelfPowered(%this) { if(!%this.isPowered()) { %this.selfPower = true; if(%this.getDatablock().deployedObject) %this.initDeploy = true; %this.getDataBlock().gainPower(%this); } else %this.selfPower = true; } function GameBase::clearSelfPowered(%this) { %this.selfPower = ""; if(!%this.isPowered()) %this.getDataBlock().losePower(%this); } function GameBase::isPowered(%this) { return %this.selfPower || %this.getGroup().powerCount > 0; } PK !(iT@NNscripts/projectiles.cs//-------------------------------------------------------------------------- // Projectiles.cs: Note that the actual projectile blocks are stored with // with weapon that uses them in base/scripts/weapons/*.cs, // the blocks below are only to illustrate the default values // for each block type. Also, ProjectileData cannot be used // as a concrete datablock type. // Inheritance: // ProjectileData : GameBaseData // LinearProjectileData : ProjectileData // LinearFlareProjectileData : LinearProjectileData // GrenadeProjectileData : ProjectileData // SeekerProjectileData : ProjectileData // SniperProjectileData : ProjectileData // //-------------------------------------------------------------------------- //-------------------------------------- Default functions // function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal) { %targetObject.damage(%projectile.sourceObject, %position, %data.directDamage * %modifier, %data.directDamageType); } function SniperProjectileData::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal) { %damageAmount = %data.directDamage * %projectile.damageFactor; if(%targetObject.getDataBlock().getClassName() $= "PlayerData") { %damLoc = firstWord(%targetObject.getDamageLocation(%position)); if(%damLoc $= "head") { %targetObject.getOwnerClient().headShot = 1; %modifier = %data.rifleHeadMultiplier; } else { %modifier = 1; %targetObject.getOwnerClient().headShot = 0; } } %targetObject.damage(%projectile.sourceObject, %position, %modifier * %damageAmount, %data.directDamageType); } function ShapeBaseImageData::onFire(%data, %obj, %slot) { %data.lightStart = getSimTime(); if( %obj.station $= "" && %obj.isCloaked() ) { if( %obj.respawnCloakThread !$= "" ) { Cancel(%obj.respawnCloakThread); %obj.setCloaked( false ); %obj.respawnCloakThread = ""; } else { if( %obj.getEnergyLevel() > 20 ) { %obj.setCloaked( false ); %obj.reCloak = %obj.schedule( 500, "setCloaked", true ); } } } if( %obj.client > 0 ) { %obj.setInvincibleMode(0 ,0.00); %obj.setInvincible( false ); // fire your weapon and your invincibility goes away. } %vehicle = 0; if(%data.usesEnergy) { if(%data.useMountEnergy) { %useEnergyObj = %obj.getObjectMount(); if(!%useEnergyObj) %useEnergyObj = %obj; %energy = %useEnergyObj.getEnergyLevel(); %vehicle = %useEnergyObj; } else %energy = %obj.getEnergyLevel(); if(%data.useCapacitor && %data.usesEnergy) { if( %useEnergyObj.turretObject.getCapacitorLevel() < %data.minEnergy ) { return; } } else if(%energy < %data.minEnergy) return; } if(%data.projectileSpread) { %vector = %obj.getMuzzleVector(%slot); %x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread; %y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread; %z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread; %mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z); %vector = MatrixMulVector(%mat, %vector); %p = new (%data.projectileType)() { dataBlock = %data.projectile; initialDirection = %vector; initialPosition = %obj.getMuzzlePoint(%slot); sourceObject = %obj; sourceSlot = %slot; vehicleObject = %vehicle; }; } else { %p = new (%data.projectileType)() { dataBlock = %data.projectile; initialDirection = %obj.getMuzzleVector(%slot); initialPosition = %obj.getMuzzlePoint(%slot); sourceObject = %obj; sourceSlot = %slot; vehicleObject = %vehicle; }; } if (isObject(%obj.lastProjectile) && %obj.deleteLastProjectile) %obj.lastProjectile.delete(); %obj.lastProjectile = %p; %obj.deleteLastProjectile = %data.deleteLastProjectile; MissionCleanup.add(%p); // AI hook if(%obj.client) %obj.client.projectile = %p; if(%data.usesEnergy) { if(%data.useMountEnergy) { if( %data.useCapacitor ) { %vehicle.turretObject.setCapacitorLevel( %vehicle.turretObject.getCapacitorLevel() - %data.fireEnergy ); } else %useEnergyObj.setEnergyLevel(%energy - %data.fireEnergy); } else %obj.setEnergyLevel(%energy - %data.fireEnergy); } else %obj.decInventory(%data.ammo,1); return %p; } function ShapeBaseImageData::onUnmount(%data, %obj, %slot) { if (%data.deleteLastProjectile && isObject(%obj.lastProjectile)) { %obj.lastProjectile.delete(); %obj.lastProjectile = ""; } } function TurretImageData::deconstruct(%data, %obj, %slot) { if (%data.deleteLastProjectile && isObject(%obj.lastProjectile)) { %obj.lastProjectile.delete(); %obj.lastProjectile = ""; } } function ShapeBaseImageData::deconstruct(%data, %obj, %slot) { if (%data.deleteLastProjectile && isObject(%obj.lastProjectile)) { %obj.lastProjectile.delete(); %obj.lastProjectile = ""; } } function MissileLauncherImage::onFire(%data,%obj,%slot) { %p = Parent::onFire(%data, %obj, %slot); MissileSet.add(%p); %target = %obj.getLockedTarget(); if(%target) %p.setObjectTarget(%target); else if(%obj.isLocked()) %p.setPositionTarget(%obj.getLockedPosition()); else %p.setNoTarget(); } function MissileLauncherImage::onWetFire(%data, %obj, %slot) { %p = Parent::onFire(%data, %obj, %slot); MissileSet.add(%p); %p.setObjectTarget(0); } //-------------------------------------------------------------------------- function MissileBarrelLarge::onFire(%data,%obj,%slot) { %p = Parent::onFire(%data,%obj,%slot); if (%obj.getControllingClient()) { // a player is controlling the turret %target = %obj.getLockedTarget(); } else { // The ai is controlling the turret %target = %obj.getTargetObject(); } if(%target) %p.setObjectTarget(%target); else if(%obj.isLocked()) %p.setPositionTarget(%obj.getLockedPosition()); else %p.setNoTarget(); // set as unguided. Only happens when itchy trigger can't wait for lock tone. } //add mortars to the "grenade set" so the AI's can avoid them better... function MortarImage::onFire(%data,%obj,%slot) { %p = Parent::onFire(%data, %obj, %slot); AIGrenadeThrown(%p); } function SniperRifleImage::onFire(%data,%obj,%slot) { if(!%obj.hasEnergyPack) { // siddown Junior, you can't use it serverPlay3D(SniperRifleDryFireSound, %obj.getTransform()); return; } %pct = %obj.getEnergyLevel() / %obj.getDataBlock().maxEnergy; %p = new (%data.projectileType)() { dataBlock = %data.projectile; initialDirection = %obj.getMuzzleVector(%slot); initialPosition = %obj.getMuzzlePoint(%slot); sourceObject = %obj; damageFactor = %pct * %pct; sourceSlot = %slot; }; %p.setEnergyPercentage(%pct); %obj.lastProjectile = %p; MissionCleanup.add(%p); serverPlay3D(SniperRifleFireSound, %obj.getTransform()); // AI hook if(%obj.client) %obj.client.projectile = %p; %obj.setEnergyLevel(0); } function ElfGunImage::onFire(%data, %obj, %slot) { %p = Parent::onFire(%data, %obj, %slot); if(!%p.hasTarget()) %obj.playAudio(0, ELFFireWetSound); } function TargetingLaserImage::onFire(%data,%obj,%slot) { %p = Parent::onFire(%data, %obj, %slot); %p.setTarget(%obj.team); } function ShockLanceImage::onFire(%this, %obj, %slot) { if( %obj.isCloaked() ) { if( %obj.respawnCloakThread !$= "" ) { Cancel(%obj.respawnCloakThread); %obj.setCloaked( false ); } else { if( %obj.getEnergyLevel() > 20 ) { %obj.setCloaked( false ); %obj.reCloak = %obj.schedule( 500, "setCloaked", true ); } } } %muzzlePos = %obj.getMuzzlePoint(%slot); %muzzleVec = %obj.getMuzzleVector(%slot); %endPos = VectorAdd(%muzzlePos, VectorScale(%muzzleVec, %this.projectile.extension)); %damageMasks = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StationObjectType | $TypeMasks::GeneratorObjectType | $TypeMasks::SensorObjectType | $TypeMasks::TurretObjectType; %everythingElseMask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::StaticObjectType | $TypeMasks::MoveableObjectType | $TypeMasks::DamagableItemObjectType; // did I miss anything? players, vehicles, stations, gens, sensors, turrets %hit = ContainerRayCast(%muzzlePos, %endPos, %damageMasks | %everythingElseMask, %obj); %noDisplay = true; if (%hit !$= "0") { %obj.setEnergyLevel(%obj.getEnergyLevel() - %this.hitEnergy); %hitobj = getWord(%hit, 0); %hitpos = getWord(%hit, 1) @ " " @ getWord(%hit, 2) @ " " @ getWord(%hit, 3); if ( %hitObj.getType() & %damageMasks ) { %hitobj.applyImpulse(%hitpos, VectorScale(%muzzleVec, %this.projectile.impulse)); %obj.playAudio(0, ShockLanceHitSound); // This is truly lame, but we need the sourceobject property present... %p = new ShockLanceProjectile() { dataBlock = %this.projectile; initialDirection = %obj.getMuzzleVector(%slot); initialPosition = %obj.getMuzzlePoint(%slot); sourceObject = %obj; sourceSlot = %slot; targetId = %hit; }; MissionCleanup.add(%p); %damageMultiplier = 1.0; if(%hitObj.getDataBlock().getClassName() $= "PlayerData") { // Now we see if we hit from behind... %forwardVec = %hitobj.getForwardVector(); %objDir2D = getWord(%forwardVec, 0) @ " " @ getWord(%forwardVec,1) @ " " @ "0.0"; %objPos = %hitObj.getPosition(); %dif = VectorSub(%objPos, %muzzlePos); %dif = getWord(%dif, 0) @ " " @ getWord(%dif, 1) @ " 0"; %dif = VectorNormalize(%dif); %dot = VectorDot(%dif, %objDir2D); // 120 Deg angle test... // 1.05 == 60 degrees in radians if (%dot >= mCos(1.05)) { // Rear hit %damageMultiplier = 3.0; } } %totalDamage = %this.Projectile.DirectDamage * %damageMultiplier; %hitObj.getDataBlock().damageObject(%hitobj, %p.sourceObject, %hitpos, %totalDamage, $DamageType::ShockLance); %noDisplay = false; } } if( %noDisplay ) { // Miss %obj.setEnergyLevel(%obj.getEnergyLevel() - %this.missEnergy); %obj.playAudio(0, ShockLanceMissSound); %p = new ShockLanceProjectile() { dataBlock = %this.projectile; initialDirection = %obj.getMuzzleVector(%slot); initialPosition = %obj.getMuzzlePoint(%slot); sourceObject = %obj; sourceSlot = %slot; }; MissionCleanup.add(%p); } } $ELFZapSound = 2; $ELFFireSound = 3; function ELFProjectileData::zapTarget(%data, %projectile, %target, %targeter) { %oldERate = %target.getRechargeRate(); %target.teamDamageStateOnZap = $teamDamage; %teammates = %target.client.team == %targeter.client.team; if( %target.teamDamageStateOnZap || !%teammates ) %target.setRechargeRate(%oldERate - %data.drainEnergy); else %target.setRechargeRate(%oldERate); %projectile.checkELFStatus(%data, %target, %targeter); } function ELFProjectileData::unzapTarget(%data, %projectile, %target, %targeter) { cancel(%projectile.ELFrecur); %target.stopAudio($ELFZapSound); %targeter.stopAudio($ELFFireSound); %target.zapSound = false; %targeter.zappingSound = false; %teammates = %target.client.team == %targeter.client.team; if(!%target.isDestroyed()) { %oldERate = %target.getRechargeRate(); if( %target.teamDamageStateOnZap || !%teammates ) %target.setRechargeRate(%oldERate + %data.drainEnergy); else %target.setRechargeRate(%oldERate); } } function ELFProjectileData::targetDestroyedCancel(%data, %projectile, %target, %targeter) { cancel(%projectile.ELFrecur); %target.stopAudio($ELFZapSound); %targeter.stopAudio($ELFFireSound); %target.zapSound = false; %targeter.zappingSound = false; %projectile.delete(); } function ELFProjectile::checkELFStatus(%this, %data, %target, %targeter) { if(isObject(%target)) { if(%target.getDamageState() $= "Destroyed") { %data.targetDestroyedCancel(%this, %target, %targeter); return; } %enLevel = %target.getEnergyLevel(); if(%enLevel < 1.0) { %dataBlock = %target.getDataBlock(); %dataBlock.damageObject(%target, %this.sourceObject, %target.getPosition(), %data.drainHealth, %data.directDamageType); } else { %normal = "0.0 0.0 1.0"; %target.playShieldEffect( %normal ); } %this.ELFrecur = %this.schedule(32, checkELFStatus, %data, %target, %targeter); %targeter.playAudio($ELFFireSound, ELFGunFireSound); if(!%target.zapSound) { %target.playAudio($ELFZapSound, ELFHitTargetSound); %target.zapSound = true; %targeter.zappingSound = true; } } // ------------------------------------------------------- // z0dd - ZOD, 5/27/02. Stop firing if there is no target, // fixes continuous fire bug. //else if(%targeter.zappingSound) //{ // %targeter.stopAudio($ELFFireSound); // %targeter.zappingSound = false; //} else { if(%targeter.zappingSound) { %targeter.stopAudio($ELFFireSound); %targeter.zappingSound = false; } %data.targetDestroyedCancel(%this, %target, %targeter); return; } // End z0dd - ZOD // ------------------------------------------------------- } function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse, %sourceObject, %damageType) { InitContainerRadiusSearch(%position, %radius, $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::TurretObjectType | $TypeMasks::ItemObjectType); %numTargets = 0; while ((%targetObject = containerSearchNext()) != 0) { %dist = containerSearchCurrRadDamageDist(); if (%dist > %radius) continue; if (%targetObject.isMounted()) { %mount = %targetObject.getObjectMount(); %found = -1; for (%i = 0; %i < %mount.getDataBlock().numMountPoints; %i++) { if (%mount.getMountNodeObject(%i) == %targetObject) { %found = %i; break; } } if (%found != -1) { if (%mount.getDataBlock().isProtectedMountPoint[%found]) { continue; } } } %targets[%numTargets] = %targetObject; %targetDists[%numTargets] = %dist; %numTargets++; } for (%i = 0; %i < %numTargets; %i++) { %targetObject = %targets[%i]; %dist = %targetDists[%i]; %coverage = calcExplosionCoverage(%position, %targetObject, ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::VehicleObjectType)); if (%coverage == 0) continue; //if ( $splashTest ) %amount = (1.0 - ((%dist / %radius) * 0.88)) * %coverage * %damage; //else //%amount = (1.0 - (%dist / %radius)) * %coverage * %damage; //error( "damage: " @ %amount @ " at distance: " @ %dist @ " radius: " @ %radius @ " maxDamage: " @ %damage ); %data = %targetObject.getDataBlock(); %className = %data.className; if (%impulse && %data.shouldApplyImpulse(%targetObject)) { %p = %targetObject.getWorldBoxCenter(); %momVec = VectorSub(%p, %position); %momVec = VectorNormalize(%momVec); %impulseVec = VectorScale(%momVec, %impulse * (1.0 - (%dist / %radius))); %doImpulse = true; } // --------------------------------------------------------------------------- // z0dd - ZOD, 5/8/02. Removed Wheeled Vehicle to eliminate the flying MPB bug // caused by tossing concussion grenades under a deployed MPB. //else if( %className $= WheeledVehicleData || %className $= FlyingVehicleData || %className $= HoverVehicleData ) else if( %className $= FlyingVehicleData || %className $= HoverVehicleData ) { %p = %targetObject.getWorldBoxCenter(); %momVec = VectorSub(%p, %position); %momVec = VectorNormalize(%momVec); %impulseVec = VectorScale(%momVec, %impulse * (1.0 - (%dist / %radius))); if( getWord( %momVec, 2 ) < -0.5 ) %momVec = "0 0 1"; // Add obj's velocity into the momentum vector %velocity = %targetObject.getVelocity(); //%momVec = VectorNormalize( vectorAdd( %momVec, %velocity) ); %doImpulse = true; } else { %momVec = "0 0 1"; %doImpulse = false; } if(%amount > 0) %data.damageObject(%targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %explosionSource.theClient, %explosionSource); else if( %explosionSource.getDataBlock().getName() $= "ConcussionGrenadeThrown" && %data.getClassName() $= "PlayerData" ) { %data.applyConcussion( %dist, %radius, %sourceObject, %targetObject ); if(!$teamDamage && %sourceObject != %targetObject && %sourceObject.client.team == %targetObject.client.team) { messageClient(%targetObject.client, 'msgTeamConcussionGrenade', '\c1You were hit by %1\'s concussion grenade.', getTaggedString(%sourceObject.client.name)); } } if( %doImpulse ) %targetObject.applyImpulse(%position, %impulseVec); } } function ProjectileData::onExplode(%data, %proj, %pos, %mod) { if (%data.hasDamageRadius) RadiusExplosion(%proj, %pos, %data.damageRadius, %data.indirectDamage, %data.kickBackStrength, %proj.sourceObject, %data.radiusDamageType); } function Flag::shouldApplyImpulse(%data, %obj) { if(%obj.isHome) return false; else return true; } PK C-YVVscripts/recordings.csfunction RecordingsDlg::onWake(%gui) { %gui.fillRecordingsList(); updateRecordingButtons(); } function msToMinSec(%time) { %sec = mFloor(%time / 1000); %min = mFloor(%sec / 60); %sec -= %min * 60; // pad it if(%min < 10) %min = "0" @ %min; if(%sec < 10) %sec = "0" @ %sec; return(%min @ ":" @ %sec); } function RecordingsDlg::fillRecordingsList(%gui) { // setup the ctrl if(!%gui.initialized) { RecordingsDlgList.setSortColumn(0); RecordingsDlgList.setSortIncreasing(true); RecordingsDlgList.addStyle(1, $ShellFont, $ShellFontSize, "80 220 200", "30 255 225", "10 60 40" ); RecordingsDlgList.addStyle(2, $ShellFont, $ShellFontSize, "120 120 120", "120 120 120", "120 120 120" ); // add the columns RecordingsDlgList.addColumn(0, "Recording", 200, 100, 300); RecordingsDlgList.addColumn(1, "Time", 140, 60, 180, "filetime center"); RecordingsDlgList.addColumn(2, "Length (min:sec)", 40, 40, 80, "center"); %gui.initialized = true; } RecordingsDlgList.clear(); RecordingsDlgList.clearList(); // process all the recordings %search = "recordings/*.rec"; %ct = 0; %demoVersion = getDemoVersion(); for(%file = findFirstFile(%search); %file !$= ""; %file = findNextFile(%search)) { %fileName = fileBase(%file); // query the version/length of the recording %val = getDemoVersionLength(%file); %version = getField(%val, 0); // unknown version if(%version == -1) { %version = "???"; %length = "???"; } else %length = msToMinSec(getField(%val, 1)); %fileTime = getFileModifyTime(%file); RecordingsDlgList.addRow(%ct, %fileName TAB %fileTime TAB %length); RecordingsDlgList.setRowStyle(%ct, (%version == %demoVersion) ? 1 : 2); %ct++; } RecordingsDlgList.sort(0, true); RecordingsDlgList.setSelectedRow(0); } function updateRecordingButtons() { %active = RecordingsDlgList.rowCount() != 0; PR_StartDemoBtn.setActive(%active); PR_DeleteDemoBtn.setActive(%active); PR_RenameDemoBtn.setActive(%active); if(%active) PR_StartDemoBtn.makeFirstResponder(1); else PR_CancelBtn.makeFirstResponder(1); } //------------------------------------------------------------------------- // functions to handle the progress bar for loading demo function DemoLoadProgressDlg::onWake(%this) { DemoLoadProgressCtrl.setValue(0.0); } function demoUpdateDatablockProgress(%count, %total) { DemoLoadProgressCtrl.setValue(%count / %total); } //------------------------------------------------------------------------- // sequential variables named $DemoValue[?] will be stored in the demo stream // and accessable right after the demo has been loaded function saveDemoSettings() { $DemoValueIdx = 0; getState(MISC); // store the playergroup getState(PLAYERLIST); // get the states for all the gui's of interest getState(RETICLE); getState(BACKPACK); getState(WEAPON); getState(INVENTORY); getState(SCORE); getState(CLOCK); getState(CHAT); // KP: save gravity getState(GRAVITY); } function resetGameState() { $timeScale = 1; // reset some state HudMessageVector.clear(); if(isObject(PlayerListGroup)) PlayerListGroup.delete(); // stop all sound alxStopAll(); // clean up voting voteHud.voting = false; mainVoteHud.setvisible(0); // clear all print messages clientCmdclearBottomPrint(); clientCmdClearCenterPrint(); clientCmdResetCommandMap(); // clear the inventory and weapons hud weaponsHud.reset(); inventoryHud.reset(); // reset the objective hud objectiveHud.setSeparators(""); objectiveHud.disableHorzSeparator(); while(objectiveHud.getCount() > 0) objectiveHud.getObject(0).delete(); } function loadDemoSettings() { $DemoValueIdx = 0; setState(MISC); // restore the playergroup setState(PLAYERLIST); // set the states for all the gui's of interest setState(RETICLE); setState(BACKPACK); setState(WEAPON); setState(INVENTORY); setState(SCORE); setState(CLOCK); setState(CHAT); // KP: load gravity setState(GRAVITY); } function addDemoValue(%val) { // make sure variables get saved if(%val $= "") %val = ""; $DemoValue[$DemoValueIdx] = %val; $DemoValueIdx++; } function getDemoValue() { %val = $DemoValue[$DemoValueIdx]; $DemoValueIdx++; if(%val $= "") %val = ""; return(%val); } //------------------------------------------------------------------------- // get/setState // - strings max of 255 chars function getState(%type) { switch$(%type) { case MISC: addDemoValue( $HudMode TAB $HudModeType TAB $HudModeNode TAB voteHud.voting TAB isObject(passengerKeys) TAB musicPlayer.currentTrack ); case PLAYERLIST: %count = PlayerListGroup.getCount(); addDemoValue(%count); for(%i = 0; %i < %count; %i++) { %obj = PlayerListGroup.getObject(%i); addDemoValue( %obj.name TAB %obj.guid TAB %obj.clientId TAB %obj.targetId TAB %obj.teamId TAB %obj.score TAB %obj.ping TAB %obj.packetLoss TAB %obj.chatMuted TAB %obj.canListen TAB %obj.voiceEnabled TAB %obj.isListening TAB %obj.isBot TAB %obj.isAdmin TAB %obj.isSuperAdmin TAB %obj.isSmurf ); } case RETICLE: addDemoValue( reticleHud.bitmap TAB reticleHud.isVisible() TAB retCenterHud.isVisible() TAB ammoHud.isVisible() TAB ammoHud.getValue() TAB deploySensor.isVisible() TAB reticleFrameHud.isVisible() ); case BACKPACK: addDemoValue( backpackIcon.bitmap TAB backpackFrame.isVisible() TAB backpackText.getValue() TAB backpackText.isVisible TAB backpackFrame.pack ); case WEAPON: %count = weaponsHud.getNumItems(); %slotCount = weaponsHud.getNumSlots(); %active = weaponsHud.getActiveItem(); // visible/bitmaps(3)/count/slotcount/active addDemoValue( weaponsHud.isVisible() TAB weaponsHud.getBackgroundBitmap() TAB weaponsHud.getHighLightBitmap() TAB weaponsHud.getInfiniteBitmap() TAB %count TAB %slotCount TAB %active ); // images for(%i = 0; %i < %count; %i++) addDemoValue( $WeaponNames[%i] TAB weaponsHud.getItemBitmap(%i) ); // items for(%i = 0; %i < %slotCount; %i++) addDemoValue( weaponsHud.getSlotId(%i) TAB weaponsHud.getSlotCount(%i) ); case INVENTORY: // count/active %count = inventoryHud.getNumItems(); %slotCount = inventoryHud.getNumSlots(); %active = inventoryHud.getActiveItem(); // visible/bitmaps(3)/count/slotCount/active addDemoValue( inventoryHud.isVisible() TAB inventoryHud.getBackgroundBitmap() TAB inventoryHud.getHighLightBitmap() TAB inventoryHud.getInfiniteBitmap() TAB %count TAB %slotCount TAB %active ); // images for(%i = 0; %i < %count; %i++) addDemoValue( inventoryHud.getItemBitmap(%i) ); // items for(%i = 0; %i < %slotCount; %i++) addDemoValue( inventoryHud.getSlotId(%i) TAB inventoryHud.getSlotCount(%i) ); case SCORE: %objCount = objectiveHud.getCount(); // visible/gametype/numobjects addDemoValue( objectiveHud.isVisible() TAB objectiveHud.gameType TAB %objCount ); // only text ctrls exist in this thing.. so just dump the strings for(%i = 0; %i < %objCount; %i++) addDemoValue(objectiveHud.getObject(%i).getValue()); case CLOCK: addDemoValue( clockHud.isVisible() TAB clockHud.getTime() ); case CHAT: // store last 10 messages %numLines = HudMessageVector.getNumLines(); for(%i = (%numLines - 10); %i < %numLines; %i++) { if(%i < 0) addDemoValue(""); else addDemoValue(HudMessageVector.getLineText(%i)); } case GRAVITY: // KP + PanamaJack // Store the gravity setting regardless of what it is addDemoValue(getGravity()); } } function setState(%type) { switch$(%type) { case MISC: %val = getDemoValue(); $HudMode = getField(%val, 0); $HudModeType = getField(%val, 1); $HudModeNode = getField(%val, 2); voteHud.voting = getField(%val, 3); clientCmdSetDefaultVehicleKeys(getField(%val, 4)); clientCmdPlayMusic(getField(%val, 5)); ClientCmdDisplayHuds(); case PLAYERLIST: new SimGroup("PlayerListGroup"); %count = getDemoValue(); for(%i = 0; %i < %count; %i++) { %val = getDemoValue(); %player = new ScriptObject() { className = "PlayerRep"; name = getField(%val, 0); guid = getField(%val, 1); clientId = getField(%val, 2); targetId = getField(%val, 3); teamId = getField(%val, 4); score = getField(%val, 5); ping = getField(%val, 6); packetLoss = getField(%val, 7); chatMuted = getField(%val, 8); canListen = getField(%val, 9); voiceEnabled = getField(%val, 10); isListening = getField(%val, 11); isBot = getField(%val, 12); isAdmin = getField(%val, 13); isSuperAdmin = getField(%val, 14); isSmurf = getField(%val, 15); }; PlayerListGroup.add(%player); $PlayerList[%player.clientId] = %player; lobbyUpdatePlayer(%player.clientId); } case RETICLE: %val = getDemoValue(); reticleHud.setBitmap(getField(%val, 0)); reticleHud.setVisible(getField(%val, 1)); retCenterHud.setVisible(getField(%val, 2)); ammoHud.setVisible(getField(%val, 3)); ammoHud.setValue(getField(%val, 4)); deploySensor.setVisible(getField(%val, 5)); reticleFrameHud.setVisible(getField(%val, 6)); case BACKPACK: %val = getDemoValue(); backpackIcon.setBitmap(getField(%val, 0)); backpackFrame.setVisible(getField(%val, 1)); backpackText.setValue(getField(%val, 2)); backpackText.setVisible(getField(%val, 3)); backpackFrame.pack = getField(%val, 4); case WEAPON: %val = getDemoValue(); // visible weaponsHud.reset(); weaponsHud.setVisible(getField(%val, 0)); // bitmaps weaponsHud.setBackgroundBitmap(getField(%val, 1)); weaponsHud.setHighLightBitmap(getField(%val, 2)); weaponsHud.setInfiniteAmmoBitmap(getField(%val, 3)); // count/slotCount/active %count = getField(%val, 4); %slotCount = getField(%val, 5); %active = getField(%val, 6); // bitmaps for(%i = 0; %i < %count; %i++) { %val = getDemoValue(); $WeaponNames[%i] = getField(%val, 0); weaponsHud.setWeaponBitmap(%i, getField(%val, 1)); } // items for(%i = 0; %i < %slotCount; %i++) { %val = getDemoValue(); weaponsHud.addWeapon(getField(%val, 0), getField(%val, 1)); } // active weaponsHud.setActiveWeapon(%active); case INVENTORY: %val = getDemoValue(); // visible inventoryHud.reset(); inventoryHud.setVisible(getField(%val, 0)); // bitmaps inventoryHud.setBackgroundBitmap(getField(%val, 1)); inventoryHud.setHighLightBitmap(getField(%val, 2)); inventoryHud.setInfiniteAmountBitmap(getField(%val, 3)); // count/slotCount/active %count = getField(%val, 4); %slotCount = getField(%val, 5); %active = getField(%val, 6); // images for(%i = 0; %i < %count; %i++) { %val = getDemoValue(); inventoryHud.setInventoryBitmap(%i, %val); } // items for(%i = 0; %i < %slotCount; %i++) { %val = getDemoValue(); inventoryHud.addInventory(getField(%val, 0), getField(%val, 1)); } // active inventoryHud.setActiveInventory(%active); case SCORE: %val = getDemoValue(); objectiveHud.setVisible(getField(%val, 0)); setupObjHud(getField(%val, 1)); %objCount = getField(%val, 2); // must read in all values even if not used for(%i = 0; %i < %objCount; %i++) { %val = getDemoValue(); if(%i < objectiveHud.getCount()) objectiveHud.getObject(%i).setValue(%val); } case CLOCK: %val = getDemoValue(); clockHud.setVisible(getField(%val, 0)); clockHud.setTime(getField(%val, 1)); case CHAT: HudMessageVector.clear(); for(%i = 0; %i < 10; %i++) { %val = getDemoValue(); if(%val !$= "") HudMessageVector.pushBackLine(%val); } case GRAVITY: // KP // Try to get a gravity value, but don't set gravity unless it's valid. %gravity = getDemoValue(); if (%gravity !$= "") setGravity(%gravity); } } //------------------------------------------------------------------------- function doRecordingDelete(%file) { // delete it if(deleteFile("recordings/" @ %file @ ".rec")) { %sel = RecordingsDlgList.getSelectedId(); RecordingsDlgList.removeRowById(%sel); RecordingsDlgList.setSelectedRow(0); updateRecordingButtons(); } else messageBoxOK("Failed", "Failed to remove file '" @ %file @ "'."); } function DeleteSelectedDemo() { %sel = RecordingsDlgList.getSelectedId(); %file = getField(RecordingsDlgList.getRowTextById(%sel), 0); messageBoxOkCancel("Delete Recording?", "Are you sure you wish to delete recording file '" @ %file @ "'?", "doRecordingDelete(\"" @ %file @ "\");"); } function StartSelectedDemo() { // first unit is filename %sel = RecordingsDlgList.getSelectedId(); %rowText = RecordingsDlgList.getRowTextById(%sel); %file = "recordings/" @ getField(%rowText, 0) @ ".rec"; %verLen = getDemoVersionLength(%file); Canvas.pushDialog(DemoLoadProgressDlg); if(playDemo(%file)) { // do not allow new sources to have a force feedback effect alxEnableForceFeedback(false); resetGameState(); Canvas.popDialog(DemoLoadProgressDlg); Canvas.popDialog(RecordingsDlg); Canvas.setContent(PlayGui); loadDemoSettings(); $DemoPlaybackIndex = 5; $DemoPlaybackLastIndex = 5; // setup the global action map GlobalActionMap.bindCmd(keyboard, "escape", "", "stopDemoPlayback();"); GlobalActionMap.bindCmd(keyboard, "tab", "", "toggleDemoPlaybackHud();"); GlobalActionMap.bindCmd(keyboard, "space", "", "toggleDemoPause();"); GlobalActionMap.bindCmd(keyboard, "numpadadd", "", "stepDemoPlaybackSpeed(1);"); GlobalActionMap.bindCmd(keyboard, "numpadminus", "", "stepDemoPlaybackSpeed(-1);"); $globalActionMapOnly = true; $DemoPlaybackProgress = 0; $DemoPlaybackLength = getField(%verLen, 1); // playback length may be 0 if recording was not clean (just set to 1min) if($DemoPlaybackLength == 0) $DemoPlaybackLength = 60000; DemoPlayback_EndTime.setValue(msToMinSec($DemoPlaybackLength)); $DemoPlaybackIndex = 5; $DemoPlaybackLastIndex = 5; $DemoPlaybackProgress = 0; demoPlaybackUpdate(0); updateDemoPlaybackStatus(); } else MessageBoxOK("Playback Failed", "Demo playback failed for file '" @ %file @ "'."); Canvas.popDialog(DemoLoadProgressDlg); } function demoPlaybackComplete() { alxStopAll(); // allow new sources to have a force feedback effect alxEnableForceFeedback(true); // remove the playback dialog if(DemoPlaybackDlg.isAwake()) Canvas.popDialog(DemoPlaybackDlg); Canvas.setContent("LaunchGui"); Canvas.pushDialog(RecordingsDlg); // cleanup resetGameState(); purgeResources(); // clean the globalActionMap GlobalActionMap.unbind(keyboard, escape); GlobalActionMap.unbind(keyboard, tab); GlobalActionMap.unbind(keyboard, space); GlobalActionMap.unbind(keyboard, numpadadd); GlobalActionMap.unbind(keyboard, numpadminus); $globalActionMapOnly = false; } //------------------------------------------------------------------------- function doDemoFileRename() { // first unit is filename %sel = RecordingsDlgList.getSelectedId(); %file = getField(RecordingsDlgList.getRowTextById(%sel), 0); %newFile = DemoRenameFile_Edit.getValue(); if(%file $= %newFile) return; if(%newFile !$= "") { if(renameFile("recordings/" @ %file @ ".rec", "recordings/" @ %newFile @ ".rec")) { rebuildModPaths(); RecordingsDlg.fillRecordingsList(); return; } } MessageBoxOK("Rename Failed", "Failed to rename file '" @ %file @ "' to '" @ %newFile @ "'."); } function RenameSelectedDemo() { // first unit is filename %sel = RecordingsDlgList.getSelectedId(); %file = getField(RecordingsDlgList.getRowTextById(%sel), 0); DemoRenameFile_Edit.setValue(%file); Canvas.pushDialog(DemoRenameFileDlg); } //-------------------------------------------------------------------------- function beginDemoRecord() { if(isDemo()) return; // make sure that current recording stream is stopped stopDemoRecord(); for(%i = 0; %i < 1000; %i++) { %num = %i; if(%num < 10) %num = "0" @ %num; if(%num < 100) %num = "0" @ %num; %file = "recordings/demo" @ %num @ ".rec"; if(!isfile(%file)) break; } if(%i == 1000) return; $DemoFile = %file; addMessageHudLine( "\c4Recording to file [\c2" @ $DemoFile @ "\cr]."); saveDemoSettings(); startRecord(%file); // make sure start worked if(!isRecordingDemo()) { deleteFile("recordings/" @ $DemoFile @ ".rec"); addMessageHudLine( "\c3 *** Failed to record to file [\c2" @ $DemoFile @ "\cr]."); $DemoFile = ""; } } function stopDemoRecord() { if(isDemo()) return; // make sure we are recording (and have a valid file) if(isRecordingDemo()) stopRecord(); } function demoRecordComplete() { // tell the user if($DemoFile !$= "") { addMessageHudLine( "\c4Stopped recording to file [\c2" @ $DemoFile @ "\cr]."); $DemoFile = ""; } } //------------------------------------------------------------------------- function toggleDemoPlaybackHud() { if(DemoPlaybackDlg.isAwake()) Canvas.popDialog(DemoPlaybackDlg); else Canvas.pushDialog(DemoPlaybackDlg, 99); } $DemoPlaybackText[0] = "Paused"; $DemoPlaybackSpeed[0] = 0; $DemoPlaybackText[1] = "Play 1/16X"; $DemoPlaybackSpeed[1] = 0.0625; $DemoPlaybackText[2] = "Play 1/8X"; $DemoPlaybackSpeed[2] = 0.125; $DemoPlaybackText[3] = "Play 1/4X"; $DemoPlaybackSpeed[3] = 0.25; $DemoPlaybackText[4] = "Play 1/2X"; $DemoPlaybackSpeed[4] = 0.5; $DemoPlaybackText[5] = "Play 1X"; $DemoPlaybackSpeed[5] = 1; $DemoPlaybackText[6] = "Play 2X"; $DemoPlaybackSpeed[6] = 2; $DemoPlaybackText[7] = "Play 4X"; $DemoPlaybackSpeed[7] = 4; $DemoPlaybackText[8] = "Play 8X"; $DemoPlaybackSpeed[8] = 8; $DemoPlaybackText[9] = "Play 16X"; $DemoPlaybackSpeed[9] = 16; // called after each processTime function demoPlaybackUpdate(%curTime) { DemoPlayback_CurTime.setValue(msToMinSec(%curTime)); $DemoPlaybackProgress = %curTime / $DemoPlaybackLength; } function updateDemoPlaybackStatus() { // clamp the speed if($DemoPlaybackIndex < 0) $DemoPlaybackIndex = 0; if($DemoPlaybackIndex > 9) $DemoPlaybackIndex = 9; DemoPlayback_StatusText.setValue($DemoPlaybackText[$DemoPlaybackIndex]); $timeScale = $DemoPlaybackSpeed[$DemoPlaybackIndex]; } function toggleDemoPause() { // save the current index for unpause if($DemoPlaybackIndex == 0) $DemoPlaybackIndex = $DemoPlaybackLastIndex; else { $DemoPlaybackLastIndex = $DemoPlaybackIndex; $DemoPlaybackIndex = 0; } updateDemoPlaybackStatus(); } function stepDemoPlaybackSpeed(%step) { $DemoPlaybackIndex += %step; updateDemoPlaybackStatus(); } function DemoPlaybackDlg::onWake(%this) { updateDemoPlaybackStatus(); } PK !(Cdscripts/redbook.cs//------------------------------------------------------------------------------ function RedBookCallback(%type) { if(%type $= "PlayFinished") CDPlayer.playFinished(); } //------------------------------------------------------------------------------ function CDAudio::playFinished(%this) { if(%this.repeat == false) return; %this.play(); } function CDAudio::play(%this) { %numTracks = %this.getTrackCount(); if(%numTracks == 0) { error(redbookGetLastError()); return; } switch$(%this.playMode) { case "one_shot": %this.playTrack(%this.currentTrack); case "continuous": %this.currentTrack++; if(%this.currentTrack >= %numTracks) %this.currentTrack = 0; %this.playTrack(%this.currentTrack); case "random": %track = mFloor(getRandom() * (%numTracks + 1)); if(%track >= %numTracks) %track = %numTracks - 1; %this.playTrack(%track); } } function CDAudio::playTrack(%this, %track) { if(redbookPlay(%track) == false) { error(redbookGetLastError()); %this.repeat = false; return; } %this.currentTrack = %track; } function CDAudio::stop(%this) { redbookStop(); } function CDAudio::getTrackCount(%this) { return(redbookGetTrackCount()); } //------------------------------------------------------------------------------ new ScriptObject(CDPlayer) { class = CDAudio; currentTrack = 0; playMode = "one_shot"; repeat = true; }; if($pref::Audio::musicEnabled) { redbookOpen(); redbookSetVolume($pref::Audio::musicVolume); } //------------------------------------------------------------------------------ function clientCmdPlayCDTrack(%track) { if(%track $= "") { %numTracks = CDPlayer.getTrackCount(); if(%numTracks == 0) { error(redbookGetLastError()); return; } %track = mFloor(getRandom() * (%numTracks + 1)); if(%track >= %numTracks) %track = %numTracks - 1; } CDPlayer.playTrack(%track); } function clientCmdStopCD() { CDPlayer.stop(); } PK !(Ǩscripts/scoreList.cs//------------------------------------------------------------------------------ // // scoreList.cs // //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Server side functions: //------------------------------------------------------------------------------ $lastScoreUpdate = 0; function updateScores() { if ( !isObject( Game ) ) return; %numTeams = Game.numTeams; // Initialize the team counts: for ( %teamIndex = 0; %teamIndex <= %numTeams; %teamIndex++ ) Game.teamCount[%teamIndex] = 0; %count = ClientGroup.getCount(); for ( %clientIndex = 0; %clientIndex < %count; %clientIndex++ ) { %cl = ClientGroup.getObject( %clientIndex ); %team = %cl.getSensorGroup(); if ( %numTeams == 1 && %team != 0 ) %team = 1; Game.teamScores[%team, Game.teamCount[%team], 0] = %cl.name; if ( %cl.score $= "" ) Game.teamScores[%team, Game.teamCount[%team], 1] = 0; else Game.teamScores[%team, Game.teamCount[%team], 1] = %cl.score; Game.teamCount[%team]++; } } //------------------------------------------------------------------------------ function serverCmdGetScores( %client ) { // Client has requested the score list, so give it to 'em... if (isObject(Game)) { updateScores(); %teamCount = Game.numTeams; if (%teamCount > 1) { // Send team messages: for (%team = 1; %team <= %teamCount; %team++) messageClient(%client, 'MsgTeamScore', "", %team, $teamScore[%team]); //send the player scores in order of their team rank... for (%team = 1; %team <= %teamCount; %team++) { for (%i = 0; %i < $TeamRank[%team, count]; %i++) { %cl = $TeamRank[%team, %i]; messageClient( %client, 'MsgPlayerScore', "", %cl, %cl.score, %cl.getPing(), %cl.getPacketLoss()); } } } else { //send the player scores in order of their rank... for (%i = 0; %i < $TeamRank[0, count]; %i++) { %cl = $TeamRank[0, %i]; messageClient( %client, 'MsgPlayerScore', "", %cl, %cl.score, %cl.getPing(), %cl.getPacketLoss()); } } //now send the observers over %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.team <= 0) messageClient( %client, 'MsgPlayerScore', "", %cl, %cl.score, %cl.getPing(), %cl.getPacketLoss()); } } } //------------------------------------------------------------------------------ // Client side functions: //------------------------------------------------------------------------------ addMessageCallback( 'MsgTeamScore', handleTeamScore ); addMessageCallback( 'MsgPlayerScore', handlePlayerScore ); //------------------------------------------------------------------------------ // client team score list is called $clTeamScore // number of teams is $clTeamCount $clTeamCount = 0; function handleTeamScore( %msgType, %msgString, %team, %teamScore ) { if ( %teamScore $= "" ) %score = "0"; else %score = %teamScore; // Add the new entry: $clTeamScore[%team, 1] = %score; if ( %team > $clTeamCount ) $clTeamCount = %team; } //------------------------------------------------------------------------------ // Store the player score on the client-side player object: function handlePlayerScore( %msgType, %msgString, %clientId, %score, %ping, %packetLoss ) { %player = $PlayerList[%clientId]; if ( %player ) { %player.score = %score; %player.ping = %ping; %player.packetLoss = %packetLoss; lobbyUpdatePlayer( %clientId ); } else warn( "Received score for client that hasn't joined!" ); } PK !(F{K K scripts/scoreScreen.cs//------------------------------------------------------------------------------ function ScoreScreen::setupHud(%obj, %tag) { } //------------------------------------------------------------------------------ function ScoreScreen::loadHud(%obj, %tag) { $Hud[%tag] = ScoreScreen; $Hud[%tag].childGui = ScoreContent; $Hud[%tag].parent = ScoreParent; } //------------------------------------------------------------------------------ function ScoreScreen::onWake(%this) { if ( isObject( hudMap ) ) { hudMap.pop(); hudMap.delete(); } new ActionMap( hudMap ); hudMap.blockBind( moveMap, toggleInventoryHud ); hudMap.blockBind( moveMap, toggleCommanderMap ); hudMap.bindCmd( keyboard, escape, "", "toggleCursorHuds('scoreScreen');" ); hudMap.push(); } //------------------------------------------------------------------------------ function ScoreScreen::onSleep(%this) { hudMap.pop(); hudMap.delete(); //make sure the action maps are still pushed in the correct order... updateActionMaps(); } //------------------------------------------------------------------------------ function ScoreScreen::addLine(%obj, %tag, %lineNum, %name) { %yOffset = (%lineNum * 20) + 5; $Hud[%tag].count++; $Hud[%tag].childGui.resize( 3, 3, 586, %yOffset + 25 ); $Hud[%tag].data[%lineNum,0] = new GuiMLTextCtrl() { profile = "ScoreTextProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 " @ %yOffset; extent = "566 22"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; helpTag = "0"; text = ""; // command = "ScoreScreenOnMouseDown(" @ %lineNum @ ");"; }; return 1; } //------------------------------------------------------------------------------ addMessageCallback( 'SetScoreHudHeader', setScoreHudHeader ); addMessageCallback( 'SetScoreHudSubheader', setScoreHudSubheader ); function setScoreHudHeader( %msgType, %msgString, %a0 ) { %text = detag( %a0 ); ScoreHeaderText.setValue( %text ); if ( %text $= "" ) { ScoreHeaderField.setVisible( false ); ScoreField.resize( 23, 32, 594, 426 ); } else { ScoreHeaderField.setVisible( true ); ScoreField.resize( 23, 72, 594, 386 ); } } function setScoreHudSubheader( %msgType, %msgString, %a0 ) { ScoreSubheaderText.setValue( detag( %a0 ) ); } ///////////////////////////////////////////////////////////////////////////////// // Hunters Tracking requires this - if we put it back in, uncomment this section // function ScoreScreenOnMouseDown(%line) // { // if ($CurrentMissionType $= "Hunters") // commandToServer('huntersTrackPlayer', %line, firstWord($MLTextMousePoint)); // } ///////////////////////////////////////////////////////////////////////////////// PK UGW-bq`OOscripts/server.csif($Host::TimeLimit $= "") $Host::TimeLimit = 20; $SB::WODec = 0.004; // whiteout $SB::DFDec = 0.02; // damageFlash // z0dd - ZOD, 10/06/02. Set this as base default, // modders can change this value to match theirs. $DefaultGravity = -20; // ----------------------------------------------------- // z0dd - ZOD, 5/27/02. Addition. Tribes2.exe will call // this for competition mod to alert players on server // during tournament that a remote connection has been // established to the server. function onTelnetConnect(%ip, %access) { // Thou shall not spam } // z0dd - ZOD, 9/13/02. Anti spam function serverCMDpracticeHudInitialize(%client, %val) { // Thou shall not spam } function VerifyCDCheck(%func) { if (!cdFileCheck()) messageBoxOkCancel("TRIBES 2 CD CHECK", "You must have the Tribes 2 CD in the CD-ROM drive while playing Tribes 2. Please insert the CD.", "schedule(0, 0, VerifyCDCheck, " @ %func @ ");", "quit();"); else call(%func); } function logEcho(%msg) { if($LogEchoEnabled) echo("LOG: " @ %msg); } function CreateServer(%mission, %missionType) { DestroyServer(); // Load server data blocks exec("scripts/commanderMapIcons.cs"); exec("scripts/markers.cs"); exec("scripts/serverAudio.cs"); exec("scripts/damageTypes.cs"); exec("scripts/deathMessages.cs"); exec("scripts/inventory.cs"); exec("scripts/camera.cs"); exec("scripts/particleEmitter.cs"); // Must exist before item.cs and explosion.cs exec("scripts/particleDummies.cs"); exec("scripts/projectiles.cs"); // Must exits before item.cs exec("scripts/player.cs"); exec("scripts/gameBase.cs"); exec("scripts/staticShape.cs"); exec("scripts/weapons.cs"); exec("scripts/turret.cs"); exec("scripts/weapTurretCode.cs"); exec("scripts/pack.cs"); exec("scripts/vehicles/vehicle_spec_fx.cs"); // Must exist before other vehicle files or CRASH BOOM exec("scripts/vehicles/serverVehicleHud.cs"); exec("scripts/vehicles/vehicle_shrike.cs"); exec("scripts/vehicles/vehicle_bomber.cs"); exec("scripts/vehicles/vehicle_havoc.cs"); exec("scripts/vehicles/vehicle_wildcat.cs"); exec("scripts/vehicles/vehicle_tank.cs"); exec("scripts/vehicles/vehicle_mpb.cs"); exec("scripts/vehicles/vehicle.cs"); // Must be added after all other vehicle files or EVIL BAD THINGS exec("scripts/ai.cs"); exec("scripts/item.cs"); exec("scripts/station.cs"); exec("scripts/simGroup.cs"); exec("scripts/trigger.cs"); exec("scripts/forceField.cs"); exec("scripts/lightning.cs"); exec("scripts/weather.cs"); exec("scripts/deployables.cs"); exec("scripts/stationSetInv.cs"); exec("scripts/navGraph.cs"); exec("scripts/targetManager.cs"); exec("scripts/serverCommanderMap.cs"); exec("scripts/environmentals.cs"); exec("scripts/power.cs"); exec("scripts/serverTasks.cs"); exec("scripts/admin.cs"); exec("prefs/banlist.cs"); //automatically load any mission type that follows naming convention typeGame.name.cs if (!isDemo()) { %search = "scripts/*Game.cs"; for(%file = findFirstFile(%search); %file !$= ""; %file = findNextFile(%search)) { %type = fileBase(%file); // get the name of the script exec("scripts/" @ %type @ ".cs"); } } //the DEMO version only uses DefaultGame.cs and SinglePlayerGame.cs else { exec("scripts/DefaultGame.cs"); exec("scripts/SinglePlayerGame.cs"); exec("scripts/CTFGame.cs"); exec("scripts/HuntersGame.cs"); } $missionSequence = 0; $CurrentMissionType = %missionType; $HostGameBotCount = 0; $HostGamePlayerCount = 0; if ( $HostGameType !$= "SinglePlayer" ) allowConnections(true); $ServerGroup = new SimGroup (ServerGroup); if(%mission $= "") { %mission = $HostMissionFile[$HostMission[0,0]]; %missionType = $HostTypeName[0]; } if ( ( isDemo() && $HostGameType !$= "SinglePlayer" ) || ( $HostGameType $= "Online" && $pref::Net::DisplayOnMaster !$= "Never" ) ) schedule(0,0,startHeartbeat); // setup the bots for this server if( !isDemo() && $Host::BotsEnabled ) initGameBots( %mission, %missionType ); // load the mission... loadMission(%mission, %missionType, true); } function initGameBots( %mission, %mType ) { echo( "adding bots..." ); AISystemEnabled( false ); if ( $Host::BotCount > 0 && %mType !$= "SinglePlayer" ) { // Make sure this mission is bot enabled: for ( %idx = 0; %idx < $HostMissionCount; %idx++ ) { if ( $HostMissionFile[%idx] $= %mission ) break; } if ( $BotEnabled[%idx] ) { if ( $Host::BotCount > 16 ) $HostGameBotCount = 16; else $HostGameBotCount = $Host::BotCount; if ( $Host::BotCount > $Host::MaxPlayers - 1 ) $HostGameBotCount = $Host::MaxPlayers - 1; //set the objective reassessment timeslice var $AITimeSliceReassess = 0; aiConnectMultiple( $HostGameBotCount, $Host::MinBotDifficulty, $Host::MaxBotDifficulty, -1 ); } else { $HostGameBotCount = 0; } } } function findNextCycleMission() { %numPlayers = ClientGroup.getCount(); %tempMission = $CurrentMission; %failsafe = 0; while (1) { %nextMissionIndex = getNextMission(%tempMission, $CurrentMissionType); %nextPotentialMission = $HostMissionFile[%nextMissionIndex]; //just cycle to the next if we've gone all the way around... if (%nextPotentialMission $= $CurrentMission || %failsafe >= 1000) { %nextMissionIndex = getNextMission($CurrentMission, $CurrentMissionType); // z0dd - ZOD - Founder, 10/06/02. Was trying to load a mission name instead of file. //return $HostMissionName[%nextMissionIndex]; return $HostMissionFile[%nextMissionIndex]; } //get the player count limits for this mission %limits = $Host::MapPlayerLimits[%nextPotentialMission, $CurrentMissionType]; if (%limits $= "") return %nextPotentialMission; else { %minPlayers = getWord(%limits, 0); %maxPlayers = getWord(%limits, 1); if ((%minPlayers < 0 || %numPlayers >= %minPlayers) && (%maxPlayers < 0 || %numPlayers <= %maxPlayers)) return %nextPotentialMission; } //since we didn't return the mission, we must not have an acceptable number of players - check the next %tempMission = %nextPotentialMission; %failsafe++; } } function CycleMissions() { echo( "cycling mission. " @ ClientGroup.getCount() @ " clients in game." ); %nextMission = findNextCycleMission(); messageAll( 'MsgClient', 'Loading %1 (%2)...', %nextMission, $MissionTypeDisplayName ); loadMission( %nextMission, $CurrentMissionType ); } function DestroyServer() { $missionRunning = false; allowConnections(false); stopHeartbeat(); if ( isObject( MissionGroup ) ) MissionGroup.delete(); if ( isObject( MissionCleanup ) ) MissionCleanup.delete(); if(isObject(game)) { game.deactivatePackages(); game.delete(); } if(isObject($ServerGroup)) $ServerGroup.delete(); // delete all the connections: while(ClientGroup.getCount()) { %client = ClientGroup.getObject(0); if (%client.isAIControlled()) %client.drop(); else %client.delete(); } // delete all the data blocks... // this will cause problems if there are any connections deleteDataBlocks(); // reset the target manager resetTargetManager(); echo( "exporting server prefs..." ); export( "$Host::*", "prefs/ServerPrefs.cs", false ); purgeResources(); // TR2 // This is a failsafe way of ensuring that default gravity is always restored // if a game type (such as TR2) changes it. It is placed here so that listen // servers will work after opening and closing different gametypes. if ($DefaultGravity !$= "") setGravity($DefaultGravity); } function Disconnect() { if ( isObject( ServerConnection ) ) ServerConnection.delete(); DisconnectedCleanup(); DestroyServer(); } function DisconnectedCleanup() { $CurrentMissionType = ""; $CurrentMission = ""; // Make sure we're not still waiting for the loading info: cancelLoadInfoCheck(); // clear the chat hud message vector HudMessageVector.clear(); if ( isObject( PlayerListGroup ) ) PlayerListGroup.delete(); // terminate all playing sounds alxStopAll(); // clean up voting voteHud.voting = false; mainVoteHud.setvisible(0); // clear all print messages clientCmdclearBottomPrint(); clientCmdClearCenterPrint(); // clear the inventory and weapons hud weaponsHud.clearAll(); inventoryHud.clearAll(); // back to the launch screen Canvas.setContent(LaunchGui); if ( isObject( MusicPlayer ) ) MusicPlayer.stop(); clearTextureHolds(); purgeResources(); if ( $PlayingOnline ) { // Restart the email check: if ( !EmailGui.checkingEmail && EmailGui.checkSchedule $= "" ) CheckEmail( true ); IRCClient::onLeaveGame(); } } // we pass the guid as well, in case this guy leaves the server. function kick( %client, %admin, %guid ) { if(%admin) // z0dd - ZOD, 8/23/02. Let the player know who kicked him. messageAll( 'MsgAdminForce', '\c2%2 has kicked %1.', Game.kickClientName, %admin.name ); else messageAll( 'MsgVotePassed', '\c2%1 was kicked by vote.', Game.kickClientName ); messageClient(%client, 'onClientKicked', ""); messageAllExcept( %client, -1, 'MsgClientDrop', "", Game.kickClientName, %client ); if( %client.isAIControlled() ) { $HostGameBotCount--; %client.drop(); } else { if( $playingOnline ) // won games { %count = ClientGroup.getCount(); %found = false; for( %i = 0; %i < %count; %i++ ) // see if this guy is still here... { %cl = ClientGroup.getObject( %i ); if( %cl.guid == %guid ) { %found = true; // kill and delete this client, their done in this server. if( isObject( %cl.player ) ) %cl.player.scriptKill(0); if ( isObject( %cl ) ) { if(%admin) // z0dd - ZOD, 8/23/02. Let the player know who kicked him. %cl.setDisconnectReason( %admin.nameBase @ "has kicked you out of the game." ); else %cl.setDisconnectReason( "You have been kicked out of the game." ); %cl.schedule(700, "delete"); } BanList::add( %guid, "0", $Host::KickBanTime ); } } if( !%found ) BanList::add( %guid, "0", $Host::KickBanTime ); // keep this guy out for a while since he left. } else // lan games { // kill and delete this client if( isObject( %client.player ) ) %client.player.scriptKill(0); if ( isObject( %client ) ) { %client.setDisconnectReason( "You have been kicked out of the game." ); %client.schedule(700, "delete"); } BanList::add( 0, %client.getAddress(), $Host::KickBanTime ); } } } function ban( %client, %admin ) { if ( %admin ) // z0dd - ZOD, 8/23/02. Let the player know who kicked him. messageAll('MsgAdminForce', '\c2%2 has banned %1.', %client.name, %admin.name); else messageAll( 'MsgVotePassed', '\c2%1 was banned by vote.', %client.name ); messageClient(%client, 'onClientBanned', ""); messageAllExcept( %client, -1, 'MsgClientDrop', "", %client.name, %client ); // kill and delete this client if( isObject(%client.player) ) %client.player.scriptKill(0); if ( isObject( %client ) ) { if(%admin) // z0dd - ZOD, 8/23/02. Let the player know who kicked him. %client.setDisconnectReason( %admin.nameBase @ "has banned you from this server." ); else %client.setDisconnectReason( "You have been banned from this server." ); %client.schedule(700, "delete"); } BanList::add(%client.guid, %client.getAddress(), $Host::BanTime); } function getValidVoicePitch(%voice, %voicePitch) { if (%voicePitch < -1.0) %voicePitch = -1.0; else if (%voicePitch > 1.0) %voicePitch = 1.0; //Voice pitch range is from 0.5 to 2.0, however, we should tighten the range to //avoid players sounding like mickey mouse, etc... //see if we're pitching down - clamp the min pitch at 0.875 if (%voicePitch < 0) return (1.0 + (0.125 * %voicePitch)); //max voice pitch is 1.125 else if (%voicePitch > 0) return 1.0 + (0.125 * %voicePitch); else return 1.0; } $DemoNameCount = 0; function addDemoAlias( %name ) { $DemoName[$DemoNameCount] = %name; $DemoNameCount++; } if ( isDemo() ) { addDemoAlias( "Butterfingers" ); addDemoAlias( "Bullseye" ); addDemoAlias( "Casualty" ); addDemoAlias( "Dogfood" ); addDemoAlias( "Extinct" ); addDemoAlias( "Fodder" ); addDemoAlias( "Grunt" ); addDemoAlias( "Helpless" ); addDemoAlias( "Itchy" ); addDemoAlias( "Bait" ); addDemoAlias( "Kibble" ); addDemoAlias( "MonkeyBoy" ); addDemoAlias( "Meat" ); addDemoAlias( "Newbie" ); addDemoAlias( "Owned" ); addDemoAlias( "Poser" ); addDemoAlias( "Quaker" ); addDemoAlias( "Roadkill" ); addDemoAlias( "SkidMark" ); addDemoAlias( "EZTarget" ); addDemoAlias( "Underdog" ); addDemoAlias( "Vegetable" ); addDemoAlias( "Weakling" ); addDemoAlias( "Flatline" ); addDemoAlias( "Spud" ); addDemoAlias( "Zero" ); addDemoAlias( "WetNose" ); addDemoAlias( "Chowderhead" ); addDemoAlias( "Clown" ); addDemoAlias( "Dodo" ); addDemoAlias( "Endangered" ); addDemoAlias( "Feeble" ); addDemoAlias( "Gimp" ); addDemoAlias( "Inky" ); addDemoAlias( "Pinky" ); addDemoAlias( "Blinky" ); addDemoAlias( "Clyde" ); addDemoAlias( "Loopy" ); addDemoAlias( "Masochist" ); addDemoAlias( "Pancake" ); addDemoAlias( "Rubbish" ); addDemoAlias( "Sickly" ); addDemoAlias( "Terminal" ); addDemoAlias( "Ugly Duckling" ); addDemoAlias( "Sheepish" ); addDemoAlias( "Whiplash" ); addDemoAlias( "KickMe" ); addDemoAlias( "Yellow Belly" ); addDemoAlias( "Bits" ); addDemoAlias( "Doofus" ); addDemoAlias( "Fluffy Bunny" ); addDemoAlias( "Lollipop" ); addDemoAlias( "Troglodyte" ); addDemoAlias( "Carcass" ); addDemoAlias( "Noodle" ); addDemoAlias( "Spastic" ); addDemoAlias( "Wimpy" ); addDemoAlias( "Sweet Pea" ); addDemoAlias( "Abused" ); addDemoAlias( "Happy Camper" ); addDemoAlias( "FreakShow" ); addDemoAlias( "Bumpkin" ); addDemoAlias( "Mad Cow" ); addDemoAlias( "Cud" ); } function pickDemoName() { // Pick a unique name if possible: %idx = mFloor( getRandom() * $DemoNameCount ); for ( %i = 0; %i < $DemoNameCount; %i++ ) { %name = $DemoName[mMod( %idx + %i, $DemoNameCount )]; %isUnique = true; %count = ClientGroup.getCount(); for ( %ci = 0; %ci < %count; %ci++ ) { if ( strcmp( %name, detag( getTaggedString( ClientGroup.getObject( %ci ).name ) ) ) == 0 ) { %isUnique = false; break; } } if ( %isUnique ) break; } // Append a number to make the alias unique: if ( !%isUnique ) { %suffix = 1; while ( !%isUnique ) { %nameTry = %name @ "." @ %suffix; %isUnique = true; %count = ClientGroup.getCount(); for ( %i = 0; %i < %count; %i++ ) { if ( strcmp( %nameTry, detag( getTaggedString( ClientGroup.getObject( %i ).name ) ) ) == 0 ) { %isUnique = false; break; } } %suffix++; } // Success! %name = %nameTry; } return( %name ); } function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, %voicePitch ) { %client.setMissionCRC($missionCRC); sendLoadInfoToClient( %client ); //%client.setSimulatedNetParams(0.1, 30); if (isDemo() && $CurrentMissionType !$= "SinglePlayer") { %client.armor = "Light"; %client.sex = "Male"; %client.race = "Human"; %client.nameBase = pickDemoName(); %client.name = addTaggedString( %client.nameBase ); %client.voice = "Male1"; %client.voiceTag = addTaggedString( "Male1" ); if ( %client & 1 ) %client.skin = addTaggedString( "swolf" ); else %client.skin = addTaggedString( "beagle" ); } else { // if hosting this server, set this client to superAdmin if(%client.getAddress() $= "Local") { %client.isAdmin = true; %client.isSuperAdmin = true; } // Get the client's unique id: %authInfo = %client.getAuthInfo(); %client.guid = getField( %authInfo, 3 ); // check admin and super admin list, and set status accordingly if ( !%client.isSuperAdmin ) { if ( isOnSuperAdminList( %client ) ) { %client.isAdmin = true; %client.isSuperAdmin = true; } else if( isOnAdminList( %client ) ) { %client.isAdmin = true; } } // Sex/Race defaults switch$ ( %raceGender ) { case "Human Male": %client.sex = "Male"; %client.race = "Human"; case "Human Female": %client.sex = "Female"; %client.race = "Human"; case "Bioderm": %client.sex = "Male"; %client.race = "Bioderm"; default: error("Invalid race/gender combo passed: " @ %raceGender); %client.sex = "Male"; %client.race = "Human"; } %client.armor = "Light"; // Override the connect name if this server does not allow smurfs: %realName = getField( %authInfo, 0 ); if ( $PlayingOnline && $Host::NoSmurfs ) %name = %realName; if ( strcmp( %name, %realName ) == 0 ) { %client.isSmurf = false; //make sure the name is unique - that a smurf isn't using this name... %dup = -1; %count = ClientGroup.getCount(); for (%i = 0; %i < %count; %i++) { %test = ClientGroup.getObject( %i ); if (%test != %client) { %rawName = stripChars( detag( getTaggedString( %test.name ) ), "\cp\co\c6\c7\c8\c9" ); if (%realName $= %rawName) { %dup = %test; %dupName = %rawName; break; } } } //see if we found a duplicate name if (isObject(%dup)) { //change the name of the dup %isUnique = false; %suffixCount = 1; while (!%isUnique) { %found = false; %testName = %dupName @ "." @ %suffixCount; for (%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); %rawName = stripChars( detag( getTaggedString( %cl.name ) ), "\cp\co\c6\c7\c8\c9" ); if (%rawName $= %testName) { %found = true; break; } } if (%found) %suffixCount++; else %isUnique = true; } //%testName will now have the new unique name... %oldName = %dupName; %newName = %testName; MessageAll( 'MsgSmurfDupName', '\c2The real \"%1\" has joined the server.', %dupName ); MessageAll( 'MsgClientNameChanged', '\c2The smurf \"%1\" is now called \"%2\".', %oldName, %newName, %dup ); %dup.name = addTaggedString(%newName); setTargetName(%dup.target, %dup.name); } // Add the tribal tag: %tag = getField( %authInfo, 1 ); %append = getField( %authInfo, 2 ); if ( %append ) %name = "\cp\c6" @ %name @ "\c7" @ %tag @ "\co"; else %name = "\cp\c7" @ %tag @ "\c6" @ %name @ "\co"; %client.sendGuid = %client.guid; } else { %client.isSmurf = true; %client.sendGuid = 0; %name = stripTrailingSpaces( strToPlayerName( %name ) ); if ( strlen( %name ) < 3 ) %name = "Poser"; // Make sure the alias is unique: %isUnique = true; %count = ClientGroup.getCount(); for ( %i = 0; %i < %count; %i++ ) { %test = ClientGroup.getObject( %i ); %rawName = stripChars( detag( getTaggedString( %test.name ) ), "\cp\co\c6\c7\c8\c9" ); if ( strcmp( %name, %rawName ) == 0 ) { %isUnique = false; break; } } // Append a number to make the alias unique: if ( !%isUnique ) { %suffix = 1; while ( !%isUnique ) { %nameTry = %name @ "." @ %suffix; %isUnique = true; %count = ClientGroup.getCount(); for ( %i = 0; %i < %count; %i++ ) { %test = ClientGroup.getObject( %i ); %rawName = stripChars( detag( getTaggedString( %test.name ) ), "\cp\co\c6\c7\c8\c9" ); if ( strcmp( %nameTry, %rawName ) == 0 ) { %isUnique = false; break; } } %suffix++; } // Success! %name = %nameTry; } %smurfName = %name; // Tag the name with the "smurf" color: %name = "\cp\c8" @ %name @ "\co"; } %client.name = addTaggedString(%name); if(%client.isSmurf) %client.nameBase = %smurfName; else %client.nameBase = %realName; // Make sure that the connecting client is not trying to use a bot skin: %temp = detag( %skin ); if ( %temp $= "basebot" || %temp $= "basebbot" ) %client.skin = addTaggedString( "base" ); else %client.skin = addTaggedString( %skin ); %client.voice = %voice; %client.voiceTag = addtaggedString(%voice); //set the voice pitch based on a lookup table from their chosen voice %client.voicePitch = getValidVoicePitch(%voice, %voicePitch); } %client.justConnected = true; %client.isReady = false; // full reset of client target manager clientResetTargets(%client, false); %client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch); %client.score = 0; %client.team = 0; $instantGroup = ServerGroup; $instantGroup = MissionCleanup; echo("CADD: " @ %client @ " " @ %client.getAddress()); %count = ClientGroup.getCount(); for(%cl = 0; %cl < %count; %cl++) { %recipient = ClientGroup.getObject(%cl); if((%recipient != %client)) { // These should be "silent" versions of these messages... messageClient(%client, 'MsgClientJoin', "", %recipient.name, %recipient, %recipient.target, %recipient.isAIControlled(), %recipient.isAdmin, %recipient.isSuperAdmin, %recipient.isSmurf, %recipient.sendGuid); messageClient(%client, 'MsgClientJoinTeam', "", %recipient.name, $teamName[%recipient.team], %recipient, %recipient.team ); } } // commandToClient(%client, 'getManagerID', %client); commandToClient(%client, 'setBeaconNames', "Target Beacon", "Marker Beacon", "Bomb Target"); if ( $CurrentMissionType !$= "SinglePlayer" ) { if ( isDemo() ) { messageClient(%client, 'MsgClientJoin', '\c2Welcome to the Tribes 2 Demo!', %client.name, %client, %client.target, false, // isBot %client.isAdmin, %client.isSuperAdmin, %client.isSmurf, %client.sendGuid ); } else { messageClient(%client, 'MsgClientJoin', '\c2Welcome to Tribes2 %1.', %client.name, %client, %client.target, false, // isBot %client.isAdmin, %client.isSuperAdmin, %client.isSmurf, %client.sendGuid ); } messageAllExcept(%client, -1, 'MsgClientJoin', '\c1%1 joined the game.', %client.name, %client, %client.target, false, // isBot %client.isAdmin, %client.isSuperAdmin, %client.isSmurf, %client.sendGuid ); } else messageClient(%client, 'MsgClientJoin', "\c0Mission Insertion complete...", %client.name, %client, %client.target, false, // isBot false, // isAdmin false, // isSuperAdmin false, // isSmurf %client.sendGuid ); //Game.missionStart(%client); setDefaultInventory(%client); if($missionRunning) %client.startMission(); $HostGamePlayerCount++; %client.demoJustJoined = true; } function GameConnection::onDrop(%client, %reason) { if(isObject(Game)) Game.onClientLeaveGame(%client); // make sure that tagged string of player name is not used if ( $CurrentMissionType $= "SinglePlayer" ) messageAllExcept(%client, -1, 'MsgClientDrop', "", getTaggedString(%client.name), %client); else messageAllExcept(%client, -1, 'MsgClientDrop', '\c1%1 has left the game.', getTaggedString(%client.name), %client); if ( isObject( %client.camera ) ) %client.camera.delete(); removeTaggedString(%client.name); removeTaggedString(%client.voiceTag); removeTaggedString(%client.skin); freeClientTarget(%client); echo("CDROP: " @ %client @ " " @ %client.getAddress()); $HostGamePlayerCount--; // reset the server if everyone has left the game if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated && !$resettingServer && !$LoadingMission ) schedule(0, 0, "resetServerDefaults"); } function dismountPlayers() { // make sure all palyers are dismounted from vehicles and have normal huds %count = ClientGroup.getCount(); for(%cl = 0; %cl < %count; %cl++) { %client = ClientGroup.getObject(%cl); %player = %client.player; if(%player.isMounted()) { %player.unmount(); commandToClient(%client, 'setHudMode', 'Standard', "", 0); } } } function loadMission( %missionName, %missionType, %firstMission ) { //ensure the demo server is using appropriate missions if (isDemo() && %missionType !$= "SinglePlayer") { if (%missionName $= "Slapdash") %missionType = "CTF"; else if (%missionName $= "Rasp") %missionType = "Hunters"; else { %missionName = "Slapdash"; %missionType = "CTF"; } } // TR2 // TR2 is scaled, so we need to increase the camera speed. However, we also // need to set it back to the default for other game types. if( %missionType $= "TR2" ) { $_Camera::movementSpeed = $Camera::movementSpeed; $Camera::movementSpeed = 80; } else { %val = $_Camera::movementSpeed $= "" ? 40 : $_Camera::movementSpeed; $Camera::movementSpeed = %val; } $LoadingMission = true; disableCyclingConnections(true); if (!$pref::NoClearConsole) cls(); if ( isObject( LoadingGui ) ) LoadingGui.gotLoadInfo = ""; buildLoadInfo( %missionName, %missionType ); // reset all of these ClearCenterPrintAll(); ClearBottomPrintAll(); if( !isDemo() && $Host::TournamentMode ) resetTournamentPlayers(); // Send load info to all the connected clients: %count = ClientGroup.getCount(); for ( %cl = 0; %cl < %count; %cl++ ) { %client = ClientGroup.getObject( %cl ); if ( !%client.isAIControlled() ) sendLoadInfoToClient( %client ); } // allow load condition to exit out schedule(0,ServerGroup,loadMissionStage1,%missionName,%missionType,%firstMission); } function loadMissionStage1(%missionName, %missionType, %firstMission) { // if a mission group was there, delete prior mission stuff if(isObject(MissionGroup)) { // clear out the previous mission paths for(%clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++) { // clear ghosts and paths from all clients %cl = ClientGroup.getObject(%clientIndex); %cl.resetGhosting(); %cl.clearPaths(); %cl.isReady = ""; %cl.matchStartReady = false; } Game.endMission(); $lastMissionTeamCount = Game.numTeams; MissionGroup.delete(); MissionCleanup.delete(); Game.deactivatePackages(); Game.delete(); $ServerGroup.delete(); $ServerGroup = new SimGroup(ServerGroup); } $CurrentMission = %missionName; $CurrentMissionType = %missionType; createInvBanCount(); echo("LOADING MISSION: " @ %missionName); // increment the mission sequence (used for ghost sequencing) $missionSequence++; // if this isn't the first mission, allow some time for the server // to transmit information to the clients: // jff: $currentMission already being used for this purpose, used in 'finishLoadMission' $MissionName = %missionName; $missionRunning = false; if(!%firstMission) schedule(15000, ServerGroup, loadMissionStage2); else loadMissionStage2(); } function loadMissionStage2() { // create the mission group off the ServerGroup echo("Stage 2 load"); $instantGroup = ServerGroup; new SimGroup (MissionCleanup); if($CurrentMissionType $= "") { new ScriptObject(Game) { class = DefaultGame; }; } else { new ScriptObject(Game) { class = $CurrentMissionType @ "Game"; superClass = DefaultGame; }; } // allow the game to activate any packages. Game.activatePackages(); // reset the target manager resetTargetManager(); %file = "missions/" @ $missionName @ ".mis"; if(!isFile(%file)) return; // send the mission file crc to the clients (used for mission lighting) $missionCRC = getFileCRC(%file); %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %client = ClientGroup.getObject(%i); if(!%client.isAIControlled()) %client.setMissionCRC($missionCRC); } $countDownStarted = false; exec(%file); $instantGroup = MissionCleanup; // pre-game mission stuff if(!isObject(MissionGroup)) { error("No 'MissionGroup' found in mission \"" @ $missionName @ "\"."); schedule(3000, ServerGroup, CycleMissions); return; } MissionGroup.cleanNonType($CurrentMissionType); // construct paths pathOnMissionLoadDone(); $ReadyCount = 0; $MatchStarted = false; $CountdownStarted = false; AISystemEnabled( false ); // Set the team damage here so that the game type can override it: if ( isDemo() ) $TeamDamage = 0; else if ( $Host::TournamentMode ) $TeamDamage = 1; else $TeamDamage = $Host::TeamDamageOn; //the demo version always has team damage off if (isDemo()) $TeamDamage = 0; // z0dd - ZOD, 10/06/02. Reset $InvincibleTime to defaults. if(Game.class !$= TR2Game) $InvincibleTime = 6; Game.missionLoadDone(); // start all the clients in the mission $missionRunning = true; for(%clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++) ClientGroup.getObject(%clientIndex).startMission(); if(!$MatchStarted && $LaunchMode !$= "NavBuild" && $LaunchMode !$= "SpnBuild" ) { if( !isDemo() && $Host::TournamentMode ) checkTourneyMatchStart(); else if( $currentMissionType !$= "SinglePlayer" ) checkMissionStart(); } // offline graph builder... if( $LaunchMode $= "NavBuild" ) buildNavigationGraph( "Nav" ); if( $LaunchMode $= "SpnBuild" ) buildNavigationGraph( "Spn" ); purgeResources(); disableCyclingConnections(false); $LoadingMission = false; } function ShapeBase::cleanNonType(%this, %type) { if(%this.missionTypesList $= "") return; for(%i = 0; (%typei = getWord(%this.missionTypesList, %i)) !$= ""; %i++) if(%typei $= %type) return; // first 32 targets are team targets (never allocated/freed) // - must reallocate the target if unhiding if(%this.getTarget() >= 32) { freeTarget(%this.getTarget()); %this.setTarget(-1); } %this.hide(true); } function SimObject::cleanNonType(%this, %type) { } function SimGroup::cleanNonType(%this, %type) { for (%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).cleanNonType(%type); } function GameConnection::endMission(%this) { commandToClient(%this, 'MissionEnd', $missionSequence); } //-------------------------------------------------------------------------- // client start phases: // 0: start mission // 1: got phase1 done // 2: got datablocks done // 3: got phase2 done // 4: got phase3 done function GameConnection::startMission(%this) { // send over the information that will display the server info // when we learn it got there, we'll send the data blocks %this.currentPhase = 0; commandToClient(%this, 'MissionStartPhase1', $missionSequence, $MissionName, MissionGroup.musicTrack); } function serverCmdMissionStartPhase1Done(%client, %seq) { if(%seq != $missionSequence || !$MissionRunning) return; if(%client.currentPhase != 0) return; %client.currentPhase = 1; // when the datablocks are transmitted, we'll send the ghost always objects %client.transmitDataBlocks($missionSequence); } function GameConnection::dataBlocksDone( %client, %missionSequence ) { echo("GOT DATA BLOCKS DONE FOR: " @ %client); if(%missionSequence != $missionSequence) return; if(%client.currentPhase != 1) return; %client.currentPhase = 2; // only want to set this once... (targets will not be updated/sent until a // client has this flag set) if(!%client.getReceivedDataBlocks()) { %client.setReceivedDataBlocks(true); sendTargetsToClient(%client); } commandToClient(%client, 'MissionStartPhase2', $missionSequence); } function serverCmdMissionStartPhase2Done(%client, %seq) { if(%seq != $missionSequence || !$MissionRunning) return; if(%client.currentPhase != 2) return; %client.currentPhase = 3; // when all this good love is over, we'll know that the mission lighting is done %client.transmitPaths(); // setup the client team state if ( $CurrentMissionType !$= "SinglePlayer" ) serverSetClientTeamState( %client ); // start ghosting %client.activateGhosting(); %client.camera.scopeToClient(%client); // to the next phase... commandToClient(%client, 'MissionStartPhase3', $missionSequence, $CurrentMission); } function serverCmdMissionStartPhase3Done(%client, %seq) { if(%seq != $missionSequence || !$MissionRunning) return; if(%client.currentPhase != 3) return; %client.currentPhase = 4; %client.isReady = true; Game.clientMissionDropReady(%client); } function serverSetClientTeamState( %client ) { // set all player states prior to mission drop ready // create a new camera for this client %client.camera = new Camera() { dataBlock = Observer; }; if( isObject( %client.rescheduleVote ) ) Cancel( %client.rescheduleVote ); %client.canVote = true; %client.rescheduleVote = ""; MissionCleanup.add( %client.camera ); // we get automatic cleanup this way. %observer = false; if( isDemo() || !$Host::TournamentMode ) { if( %client.justConnected ) { %client.justConnected = false; %client.camera.getDataBlock().setMode( %client.camera, "justJoined" ); } else { // server just changed maps - this guy was here before if( %client.lastTeam !$= "" ) { // see if this guy was an observer from last game if(%client.lastTeam == 0) { %observer = true; %client.camera.getDataBlock().setMode( %client.camera, "ObserverFly" ); } else // let this player join the team he was on last game { if(Game.numTeams > 1 && %client.lastTeam <= Game.numTeams ) { Game.clientJoinTeam( %client, %client.lastTeam, false ); } else { Game.assignClientTeam( %client ); // spawn the player Game.spawnPlayer( %client, false ); } } } else { Game.assignClientTeam( %client ); // spawn the player Game.spawnPlayer( %client, false ); } if( !%observer ) { if(!$MatchStarted && !$CountdownStarted) %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); else if(!$MatchStarted && $CountdownStarted) %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); } } } else { // don't need to do anything. MissionDrop will handle things from here. } } //function serverCmdPreviewDropReady( %client ) //{ // $MatchStarted = true; // commandToClient( %client, 'SetMoveKeys', true); // %markerObj = "0 0 0"; // %client.camera.mode = "PreviewMode"; // %client.camera.setTransform( %markerObj ); // %client.camera.setFlyMode(); // // %client.setControlObject( %client.camera ); //} function HideHudHACK(%visible) { //compassHud.setVisible(%visible); //enerDamgHud.setVisible(%visible); retCenterHud.setVisible(%visible); reticleFrameHud.setVisible(%visible); //invPackHud.setVisible(%visible); weaponsHud.setVisible(%visible); outerChatHud.setVisible(%visible); objectiveHud.setVisible(%visible); chatHud.setVisible(%visible); navHud.setVisible(%visible); //watermarkHud.setVisible(%visible); hudClusterBack.setVisible(%visible); inventoryHud.setVisible(%visible); clockHUD.setVisible(%visible); } function ServerPlay2D(%profile) { for(%idx = 0; %idx < ClientGroup.getCount(); %idx++) ClientGroup.getObject(%idx).play2D(%profile); } function ServerPlay3D(%profile,%transform) { for(%idx = 0; %idx < ClientGroup.getCount(); %idx++) ClientGroup.getObject(%idx).play3D(%profile,%transform); } function clientCmdSetFirstPerson(%value) { $firstPerson = %value; if(%value) ammoHud.setVisible(true); else ammoHud.setVisible(false); } function clientCmdGetFirstPerson() { commandToServer('FirstPersonValue', $firstPerson); } function serverCmdFirstPersonValue(%client, %firstPerson) { %client.player.firstPerson = %firstPerson; } function clientCmdVehicleMount() { if ( $pref::toggleVehicleView ) { $wasFirstPerson = $firstPerson; $firstPerson = false; } } function clientCmdVehicleDismount() { if ( $pref::toggleVehicleView ) $firstPerson = $wasFirstPerson; } function serverCmdSAD( %client, %password ) { if( %password !$= "" && %password $= $Host::AdminPassword) { %client.isAdmin = true; %client.isSuperAdmin = true; %name = getTaggedString( %client.name ); MessageAll( 'MsgSuperAdminPlayer', '\c2%2 has become a Super Admin by force.', %client, %client.name ); } } function serverCmdSADSetPassword(%client, %password) { // ----------------------------------------------------- // z0dd - ZOD, 5/8/02. Addition. Have to export or it won't stick. //if(%client.isSuperAdmin) // $Host::AdminPassword = %password; if(%client.isSuperAdmin) { $Host::AdminPassword = %password; export( "$Host::*", "prefs/ServerPrefs.cs", false ); messageClient(%client, 'MsgAdmin', '\c2\"Super Admin\" PW changed to: \c3%1\c2.', %password); logEcho(getTaggedString(%client.name) @ " changed Super Admin password to: " @ %password); } } function serverCmdSuicide(%client) { // ------------------------------------- // z0dd - ZOD, 5/8/02. Addition. Console spam fix. if(!isObject(%client.player)) return; if( $MatchStarted ) %client.player.scriptKill($DamageType::Suicide); } function serverCmdToggleCamera(%client) { if ($testcheats || $CurrentMissionType $= "SinglePlayer") { %control = %client.getControlObject(); if (%control == %client.player) { %control = %client.camera; %control.mode = toggleCameraFly; %control.setFlyMode(); } else { %control = %client.player; %control.mode = observerFly; %control.setFlyMode(); } %client.setControlObject(%control); } } function serverCmdDropPlayerAtCamera(%client) { if ($testcheats) { %client.player.setTransform(%client.camera.getTransform()); %client.player.setVelocity("0 0 0"); %client.setControlObject(%client.player); } } function serverCmdDropCameraAtPlayer(%client) { if ($testcheats) { %client.camera.setTransform(%client.player.getTransform()); %client.camera.setVelocity("0 0 0"); %client.setControlObject(%client.camera); } } function serverCmdToggleRace(%client) { if ($testcheats) { if (%client.race $= "Human") %client.race = "Bioderm"; else %client.race = "Human"; %client.player.setArmor(%client.armor); } } function serverCmdToggleGender(%client) { if ($testcheats) { if (%client.sex $= "Male") %client.sex = "Female"; else %client.sex = "Male"; %client.player.setArmor(%client.armor); } } function serverCmdToggleArmor(%client) { if ($testcheats) { if (%client.armor $= "Light") %client.armor = "Medium"; else if (%client.armor $= "Medium") %client.armor = "Heavy"; else %client.armor = "Light"; %client.player.setArmor(%client.armor); } } function serverCmdPlayCel(%client,%anim) { if ($testcheats) { %anim = %client.player.celIdx; if (%anim++ > 8) %anim = 1; %client.player.setActionThread("cel"@%anim); %client.player.celIdx = %anim; } } // NOTENOTENOTE: Review function serverCmdPlayAnim(%client, %anim) { if( %anim $= "Death1" || %anim $= "Death2" || %anim $= "Death3" || %anim $= "Death4" || %anim $= "Death5" || %anim $= "Death6" || %anim $= "Death7" || %anim $= "Death8" || %anim $= "Death9" || %anim $= "Death10" || %anim $= "Death11" ) return; %player = %client.player; // don't play animations if player is in a vehicle // ------------------------------------------------------------------ // z0dd - ZOD, 5/8/02. Console spam fix, check for player object too. //if (%player.isMounted()) // return; if(%player.isMounted() || !isObject(%player)) return; %weapon = ( %player.getMountedImage($WeaponSlot) == 0 ) ? "" : %player.getMountedImage($WeaponSlot).getName().item; if(%weapon $= "MissileLauncher" || %weapon $= "SniperRifle") { %player.animResetWeapon = true; %player.lastWeapon = %weapon; %player.unmountImage($WeaponSlot); // ---------------------------------------------- // z0dd - ZOD, 5/8/02. %obj is the wrong varible. //%obj.setArmThread(look); %player.setArmThread(look); } %player.setActionThread(%anim); } function serverCmdPlayDeath(%client,%anim) { if ($testcheats) { %anim = %client.player.deathIdx; if (%anim++ > 11) %anim = 1; %client.player.setActionThread("death"@%anim,true); %client.player.deathIdx = %anim; } } // NOTENOTENOTE: Review these! //------------------------------------------------------------ // TODO - make this function specify a team to switch to... function serverCmdClientTeamChange( %client ) { // pass this to the game object to handle: if ( isObject( Game ) && Game.kickClient != %client) { %fromObs = %client.team == 0; if(%fromObs) clearBottomPrint(%client); Game.clientChangeTeam( %client, "", %fromObs ); } } function serverCanAddBot() { //find out how many bots are already playing %botCount = 0; %numClients = ClientGroup.getCount(); for (%i = 0; %i < %numClients; %i++) { %cl = ClientGroup.getObject(%i); if (%cl.isAIcontrolled()) %botCount++; } //add only if we have less bots than the bot count, and if there would still be room for a if ($HostGameBotCount > 0 && %botCount < $Host::botCount && %numClients < $Host::maxPlayers - 1) return true; else return false; } function serverCmdAddBot( %client ) { //only admins can add bots... if (%client.isAdmin) { if (serverCanAddBot()) aiConnectMultiple( 1, $Host::MinBotDifficulty, $Host::MaxBotDifficulty, -1 ); } } function serverCmdClientJoinTeam( %client, %team ) { if( %team == -1 ) { if( %client.team == 1 ) %team = 2; else %team = 1; } if ( isObject( Game ) && Game.kickClient != %client) { if(%client.team != %team) { %fromObs = %client.team == 0; if(%fromObs) clearBottomPrint(%client); if( %client.isAIControlled() ) Game.AIChangeTeam( %client, %team ); else Game.clientChangeTeam( %client, %team, %fromObs ); } } } // this should only happen in single team games function serverCmdClientAddToGame( %client, %targetClient ) { if ( isObject( Game ) ) Game.clientJoinTeam( %targetClient, 0, $matchstarted ); clearBottomPrint(%targetClient); if($matchstarted) { %targetClient.setControlObject( %targetClient.player ); commandToClient(%targetClient, 'setHudMode', 'Standard'); } else { %targetClient.notReady = true; %targetClient.camera.getDataBlock().setMode( %targetClient.camera, "pre-game", %targetClient.player ); %targetClient.setControlObject( %targetClient.camera ); } if( !isDemo() && $Host::TournamentMode && !$CountdownStarted) { %targetClient.notReady = true; centerprint( %targetClient, "\nPress FIRE when ready.", 0, 3 ); } } function serverCmdClientJoinGame( %client ) { if ( isObject( Game ) ) Game.clientJoinTeam( %client, 0, 1 ); %client.setControlObject( %client.player ); clearBottomPrint(%client); commandToClient(%client, 'setHudMode', 'Standard'); } function serverCmdClientMakeObserver( %client ) { if ( isObject( Game ) && Game.kickClient != %client ) Game.forceObserver( %client, "playerChoose" ); } function serverCmdChangePlayersTeam( %clientRequesting, %client, %team) { if( isObject( Game ) && %client != Game.kickClient && %clientRequesting.isAdmin) { serverCmdClientJoinTeam(%client, %team); if(!$MatchStarted) { %client.observerMode = "pregame"; %client.notReady = true; %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); %client.setControlObject( %client.camera ); if( !isDemo() && $Host::TournamentMode && !$CountdownStarted) { %client.notReady = true; centerprint( %client, "\nPress FIRE when ready.", 0, 3 ); } } else commandToClient(%client, 'setHudMode', 'Standard', "", 0); %multiTeam = (Game.numTeams > 1); if(%multiTeam) { messageClient( %client, 'MsgClient', '\c1The Admin has changed your team.'); messageAllExcept( %client, -1, 'MsgClient', '\c1The Admin forced %1 to join the %2 team.', %client.name, game.getTeamName(%client.team) ); } else { messageClient( %client, 'MsgClient', '\c1The Admin has added you to the game.'); messageAllExcept( %client, -1, 'MsgClient', '\c1The Admin added %1 to the game.', %client.name); } } } function serverCmdForcePlayerToObserver( %clientRequesting, %client ) { if( isObject( Game ) && %clientRequesting.isAdmin) Game.forceObserver( %client, "adminForce" ); } //-------------------------------------------------------------------------- function serverCmdTogglePlayerMute(%client, %who) { if (%client.muted[%who]) { %client.muted[%who] = false; messageClient(%client, 'MsgPlayerMuted', '%1 has been unmuted.', %who.name, %who, false); } else { %client.muted[%who] = true; messageClient(%client, 'MsgPlayerMuted', '%1 has been muted.', %who.name, %who, true); } } //-------------------------------------------------------------------------- // VOTE MENU FUNCTIONS: function serverCmdGetVoteMenu( %client, %key ) { if ( isObject( Game ) ) Game.sendGameVoteMenu( %client, %key ); } function serverCmdGetPlayerPopupMenu( %client, %targetClient, %key ) { if ( isObject( Game ) ) Game.sendGamePlayerPopupMenu( %client, %targetClient, %key ); } function serverCmdGetTeamList( %client, %key ) { if ( isObject( Game ) ) Game.sendGameTeamList( %client, %key ); } function serverCmdGetMissionTypes( %client, %key ) { for ( %type = 0; %type < $HostTypeCount; %type++ ) messageClient( %client, 'MsgVoteItem', "", %key, %type, "", $HostTypeDisplayName[%type], true ); } function serverCmdGetMissionList( %client, %key, %type ) { if ( %type < 0 || %type >= $HostTypeCount ) return; for ( %i = $HostMissionCount[%type] - 1; %i >= 0; %i-- ) { %idx = $HostMission[%type, %i]; // If we have bots, don't change to a mission that doesn't support bots: if ( $HostGameBotCount > 0 ) { if( !$BotEnabled[%idx] ) continue; } messageClient( %client, 'MsgVoteItem', "", %key, %idx, // mission index, will be stored in $clVoteCmd "", $HostMissionName[%idx], true ); } } function serverCmdGetTimeLimitList( %client, %key, %type ) { if ( isObject( Game ) ) Game.sendTimeLimitList( %client, %key ); } function serverCmdClientPickedTeam( %client, %option ) { // ------------------------------------------------------------------------------------ // z0dd - ZOD 5/8/02. Tourney mode bug fix provided by FSB-AO. // Bug description: In tournament mode, If a player is teamchanged by an admin before // they select a team, the server just changes their team and re-skins the player. They // are not moved from their initial spawn point, meaning they could spawn very close to // the other teams flag. This script kills the player if they are already teamed when // they select an option and spawns them on the correct side of the map. //if( %option == 1 || %option == 2 ) // Game.clientJoinTeam( %client, %option, false ); //else if( %option == 3) //{ // Game.assignClientTeam( %client, $MatchStarted ); // Game.spawnPlayer( %client, false ); //} //else //{ // Game.forceObserver( %client, "playerChoose" ); // %client.observerMode = "observer"; // %client.notReady = false; // return; //} switch(%option) { case 1: if ( isObject(%client.player) ) { %client.player.scriptKill(0); Game.clientChangeTeam(%client, %option, 0); } else Game.clientJoinTeam( %client, %option, false ); case 2: if ( isObject(%client.player) ) { %client.player.scriptKill(0); Game.clientChangeTeam(%client, %option, 0); } else Game.clientJoinTeam( %client, %option, false ); case 3: if( !isObject(%client.player) ) { Game.assignClientTeam( %client, $MatchStarted ); Game.spawnPlayer( %client, false ); } default: if( isObject(%client.player) ) { %client.player.scriptKill(0); ClearBottomPrint(%client); } Game.forceObserver( %client, "playerChoose" ); %client.observerMode = "observer"; %client.notReady = false; return; } // End z0dd - ZOD // ------------------------------------------------------------------------------------ ClearBottomPrint(%client); %client.observerMode = "pregame"; %client.notReady = true; %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); commandToClient(%client, 'setHudMode', 'Observer'); %client.setControlObject( %client.camera ); centerprint( %client, "\nPress FIRE when ready.", 0, 3 ); } function playerPickTeam( %client ) { %numTeams = Game.numTeams; if(%numTeams > 1) { %client.camera.mode = "PickingTeam"; schedule( 0, 0, "commandToClient", %client, 'pickTeamMenu', Game.getTeamName(1), Game.getTeamName(2)); } else { Game.clientJoinTeam(%client, 0, 0); %client.observerMode = "pregame"; %client.notReady = true; %client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player ); centerprint( %client, "\nPress FIRE when ready.", 0, 3 ); %client.setControlObject( %client.camera ); } } function serverCmdPlayContentSet( %client ) { if( !isDemo() && $Host::TournamentMode && !$CountdownStarted && !$MatchStarted ) playerPickTeam( %client ); } //-------------------------------------------------------------------------- // This will probably move elsewhere... function getServerStatusString() { return isObject(Game) ? Game.getServerStatusString() : "NoGame"; } function dumpGameString() { error( getServerStatusString() ); } function isOnAdminList(%client) { if( !%totalRecords = getFieldCount( $Host::AdminList ) ) { return false; } for(%i = 0; %i < %totalRecords; %i++) { %record = getField( getRecord( $Host::AdminList, 0 ), %i); if(%record == %client.guid) return true; } return false; } function isOnSuperAdminList(%client) { if( !%totalRecords = getFieldCount( $Host::superAdminList ) ) { return false; } for(%i = 0; %i < %totalRecords; %i++) { %record = getField( getRecord( $Host::superAdminList, 0 ), %i); if(%record == %client.guid) return true; } return false; } function ServerCmdAddToAdminList( %admin, %client ) { if( !%admin.isSuperAdmin ) return; %count = getFieldCount( $Host::AdminList ); for ( %i = 0; %i < %count; %i++ ) { %id = getField( $Host::AdminList, %i ); if ( %id == %client.guid ) { return; // They're already there! } } if( %count == 0 ) $Host::AdminList = %client.guid; else $Host::AdminList = $Host::AdminList TAB %client.guid; // --------------------------------------------------------------------------------------------------------------------------- // z0dd - ZOD, 5/8/02. Addition. Was not exporting to serverPrefs and did not message admin status. export( "$Host::*", "prefs/ServerPrefs.cs", false ); messageClient(%admin, 'MsgAdmin', '\c3\"%1\"\c2 added to Admin list: \c3%2\c2.', getTaggedString(%client.name), %client.guid); logEcho(getTaggedString(%admin.name) @ " added " @ getTaggedString(%client.name) @ " " @ %client.guid @ " to Admin list."); } function ServerCmdAddToSuperAdminList( %admin, %client ) { if( !%admin.isSuperAdmin ) return; %count = getFieldCount( $Host::SuperAdminList ); for ( %i = 0; %i < %count; %i++ ) { %id = getField( $Host::SuperAdminList, %i ); if ( %id == %client.guid ) return; // They're already there! } if( %count == 0 ) $Host::SuperAdminList = %client.guid; else $Host::SuperAdminList = $Host::SuperAdminList TAB %client.guid; // --------------------------------------------------------------------------------------------------------------------------------- // z0dd - ZOD, 5/8/02. Addition. Was not exporting to serverPrefs and did not message admin status. export( "$Host::*", "prefs/ServerPrefs.cs", false ); messageClient(%admin, 'MsgAdmin', '\c3\"%1\"\c2 added to Super Admin list: \c3%2\c2.', getTaggedString(%client.name), %client.guid); logEcho(getTaggedString(%admin.name) @ " added " @ getTaggedString(%client.name) @ " " @ %client.guid @ " to Super Admin list."); } function resetTournamentPlayers() { %count = ClientGroup.getCount(); for( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject(%i); %cl.notready = 1; %cl.notReadyCount = ""; } } function forceTourneyMatchStart() { %playerCount = 0; %count = ClientGroup.getCount(); for( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject(%i); if(%cl.camera.Mode $= "pre-game") %playerCount++; } // don't start the mission until we have players if(%playerCount == 0) { return false; } %count = ClientGroup.getCount(); for( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject(%i); if(%cl.camera.Mode $= "pickingTeam") { // throw these guys into observer mode if(Game.numTeams > 1) commandToClient( %cl, 'processPickTeam'); // clear the pickteam menu Game.forceObserver( %cl, "adminForce" ); } } return true; } function startTourneyCountdown() { %count = ClientGroup.getCount(); for( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject(%i); ClearCenterPrint(%cl); ClearBottomPrint(%cl); } // lets get it on! Countdown( 30 * 1000 ); } function checkTourneyMatchStart() { if( $CountdownStarted || $matchStarted ) return; // loop through all the clients and see if any are still notready %playerCount = 0; %notReadyCount = 0; %count = ClientGroup.getCount(); for( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject(%i); if(%cl.camera.mode $= "pickingTeam") { %notReady[%notReadyCount] = %cl; %notReadyCount++; } else if(%cl.camera.Mode $= "pre-game") { if(%cl.notready) { %notReady[%notReadyCount] = %cl; %notReadyCount++; } else { %playerCount++; } } else if(%cl.camera.Mode $= "observer") { // this guy is watching } } if(%notReadyCount) { if(%notReadyCount == 1) MessageAll( 'msgHoldingUp', '\c1%1 is holding things up!', %notReady[0].name); else if(%notReadyCount < 4) { for(%i = 0; %i < %notReadyCount - 2; %i++) %str = getTaggedString(%notReady[%i].name) @ ", " @ %str; %str = "\c2" @ %str @ getTaggedString(%notReady[%i].name) @ " and " @ getTaggedString(%notReady[%i+1].name) @ " are holding things up!"; MessageAll( 'msgHoldingUp', %str ); } return; } if(%playerCount != 0) { %count = ClientGroup.getCount(); for( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject(%i); %cl.notready = ""; %cl.notReadyCount = ""; ClearCenterPrint(%cl); ClearBottomPrint(%cl); } if ( Game.scheduleVote !$= "" && Game.voteType $= "VoteMatchStart") { messageAll('closeVoteHud', ""); cancel(Game.scheduleVote); Game.scheduleVote = ""; } Countdown(30 * 1000); } } function checkMissionStart() { %readyToStart = false; for(%clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++) { %client = ClientGroup.getObject(%clientIndex); if(%client.isReady) { %readyToStart = true; break; } } if(%readyToStart || ClientGroup.getCount() < 1) { if($Host::warmupTime > 0 && $CurrentMissionType !$= "SinglePlayer") countDown($Host::warmupTime * 1000); else Game.startMatch(); for(%x = 0; %x < $NumVehiclesDeploy; %x++) $VehiclesDeploy[%x].getDataBlock().schedule(%timeMS / 2, "vehicleDeploy", $VehiclesDeploy[%x], 0, 1); $NumVehiclesDeploy = 0; } else { schedule(2000, ServerGroup, "checkMissionStart"); } } function Countdown(%timeMS) { if($countdownStarted) return; echo("starting mission countdown..."); if(isObject(Game)) %game = Game.getId(); else return; $countdownStarted = true; Game.matchStart = Game.schedule( %timeMS, "StartMatch" ); if (%timeMS > 30000) notifyMatchStart(%timeMS); if(%timeMS >= 30000) Game.thirtyCount = schedule(%timeMS - 30000, Game, "notifyMatchStart", 30000); if(%timeMS >= 15000) Game.fifteenCount = schedule(%timeMS - 15000, Game, "notifyMatchStart", 15000); if(%timeMS >= 10000) Game.tenCount = schedule(%timeMS - 10000, Game, "notifyMatchStart", 10000); if(%timeMS >= 5000) Game.fiveCount = schedule(%timeMS - 5000, Game, "notifyMatchStart", 5000); if(%timeMS >= 4000) Game.fourCount = schedule(%timeMS - 4000, Game, "notifyMatchStart", 4000); if(%timeMS >= 3000) Game.threeCount = schedule(%timeMS - 3000, Game, "notifyMatchStart", 3000); if(%timeMS >= 2000) Game.twoCount = schedule(%timeMS - 2000, Game, "notifyMatchStart", 2000); if(%timeMS >= 1000) Game.oneCount = schedule(%timeMS - 1000, Game, "notifyMatchStart", 1000); } function EndCountdown(%timeMS) { echo("mission end countdown..."); if(isObject(Game)) %game = Game.getId(); else return; if(%timeMS >= 60000) Game.endsixtyCount = schedule(%timeMS - 60000, Game, "notifyMatchEnd", 60000); if(%timeMS >= 30000) Game.endthirtyCount = schedule(%timeMS - 30000, Game, "notifyMatchEnd", 30000); if(%timeMS >= 10000) Game.endtenCount = schedule(%timeMS - 10000, Game, "notifyMatchEnd", 10000); if(%timeMS >= 5000) Game.endfiveCount = schedule(%timeMS - 5000, Game, "notifyMatchEnd", 5000); if(%timeMS >= 4000) Game.endfourCount = schedule(%timeMS - 4000, Game, "notifyMatchEnd", 4000); if(%timeMS >= 3000) Game.endthreeCount = schedule(%timeMS - 3000, Game, "notifyMatchEnd", 3000); if(%timeMS >= 2000) Game.endtwoCount = schedule(%timeMS - 2000, Game, "notifyMatchEnd", 2000); if(%timeMS >= 1000) Game.endoneCount = schedule(%timeMS - 1000, Game, "notifyMatchEnd", 1000); } function CancelCountdown() { if(Game.sixtyCount !$= "") cancel(Game.sixtyCount); if(Game.thirtyCount !$= "") cancel(Game.thirtyCount); if(Game.fifteenCount !$= "") cancel(Game.fifteenCount); if(Game.tenCount !$= "") cancel(Game.tenCount); if(Game.fiveCount !$= "") cancel(Game.fiveCount); if(Game.fourCount !$= "") cancel(Game.fourCount); if(Game.threeCount !$= "") cancel(Game.threeCount); if(Game.twoCount !$= "") cancel(Game.twoCount); if(Game.oneCount !$= "") cancel(Game.oneCount); if(isObject(Game)) cancel(Game.matchStart); Game.matchStart = ""; Game.thirtyCount = ""; Game.fifteenCount = ""; Game.tenCount = ""; Game.fiveCount = ""; Game.fourCount = ""; Game.threeCount = ""; Game.twoCount = ""; Game.oneCount = ""; $countdownStarted = false; } function CancelEndCountdown() { //cancel the mission end countdown... if(Game.endsixtyCount !$= "") cancel(Game.endsixtyCount); if(Game.endthirtyCount !$= "") cancel(Game.endthirtyCount); if(Game.endtenCount !$= "") cancel(Game.endtenCount); if(Game.endfiveCount !$= "") cancel(Game.endfiveCount); if(Game.endfourCount !$= "") cancel(Game.endfourCount); if(Game.endthreeCount !$= "") cancel(Game.endthreeCount); if(Game.endtwoCount !$= "") cancel(Game.endtwoCount); if(Game.endoneCount !$= "") cancel(Game.endoneCount); Game.endmatchStart = ""; Game.endthirtyCount = ""; Game.endtenCount = ""; Game.endfiveCount = ""; Game.endfourCount = ""; Game.endthreeCount = ""; Game.endtwoCount = ""; Game.endoneCount = ""; } function resetServerDefaults() { $resettingServer = true; echo( "Resetting server defaults..." ); if( isObject( Game ) ) Game.gameOver(); // Override server defaults with prefs: exec( "scripts/ServerDefaults.cs" ); exec( $serverprefs ); if ( !isDemo() ) { //convert the team skin and name vars to tags... %index = 0; while ($Host::TeamSkin[%index] !$= "") { $TeamSkin[%index] = addTaggedString($Host::TeamSkin[%index]); %index++; } %index = 0; while ($Host::TeamName[%index] !$= "") { $TeamName[%index] = addTaggedString($Host::TeamName[%index]); %index++; } // Get the hologram names from the prefs... %index = 1; while ( $Host::holoName[%index] !$= "" ) { $holoName[%index] = $Host::holoName[%index]; %index++; } } // kick all bots... removeAllBots(); // add bots back if they were there before.. if( !isDemo() && $Host::botsEnabled ) initGameBots( $Host::Map, $Host::MissionType ); // load the missions loadMission( $Host::Map, $Host::MissionType ); $resettingServer = false; echo( "Server reset complete." ); } function removeAllBots() { while( ClientGroup.getCount() ) { %client = ClientGroup.getObject(0); if(%client.isAIControlled()) %client.drop(); else %client.delete(); } } //------------------------------------------------------------------------------ function getServerGUIDList() { %count = ClientGroup.getCount(); for ( %i = 0; %i < %count; %i++ ) { %cl = ClientGroup.getObject( %i ); if ( isObject( %cl ) && !%cl.isSmurf && !%cl.isAIControlled() ) { %guid = getField( %cl.getAuthInfo(), 3 ); if ( %guid != 0 ) { if ( %list $= "" ) %list = %guid; else %list = %list TAB %guid; } } } return( %list ); } //------------------------------------------------------------------------------ // will return the first admin found on the server function getAdmin() { %admin = 0; for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ ) { %cl = ClientGroup.getObject( %clientIndex ); if(%cl.isAdmin || %cl.isSuperAdmin) { %admin = %cl; break; } } return %admin; } function serverCmdSetPDAPose(%client, %val) { if(!isObject(%client.player)) return; // if client is in a vehicle, return if(%client.player.isMounted()) return; if(%val) { // play "PDA" animation thread on player %client.player.setActionThread("PDA", false); } else { // cancel PDA animation thread %client.player.setActionThread("root", true); } } function serverCmdProcessGameLink(%client, %arg1, %arg2, %arg3, %arg4, %arg5) { Game.processGameLink(%client, %arg1, %arg2, %arg3, %arg4, %arg5); } PK !(mĈ4 scripts/serverAudio.cs //-------------------------------------- // Audio Descriptions // datablock AudioDescription(ProjectileLooping3d) { volume = 1.0; isLooping= true; is3D = true; minDistance= 5.0; MaxDistance= 20.0; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(ClosestLooping3d) { volume = 1.0; isLooping= true; is3D = true; minDistance= 5.0; MaxDistance= 30.0; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(CloseLooping3d) { volume = 1.0; isLooping= true; is3D = true; minDistance= 10.0; MaxDistance= 50.0; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(AudioDefaultLooping3d) { volume = 1.0; isLooping= true; is3D = true; minDistance= 20.0; MaxDistance= 100.0; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(AudioClosest3d) { volume = 1.0; isLooping= false; is3D = true; minDistance= 5.0; MaxDistance= 30.0; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(AudioClose3d) { volume = 1.0; isLooping= false; is3D = true; minDistance= 10.0; MaxDistance= 60.0; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(AudioDefault3d) { volume = 1.0; isLooping= false; is3D = true; minDistance= 20.0; MaxDistance= 100.0; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(AudioExplosion3d) // Regular weapon explosions { volume = 1.0; isLooping= false; is3D = true; minDistance= 20.0; MaxDistance= 150.0; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(AudioBomb3d) // Bomber Bombs { volume = 1.0; isLooping= false; is3D = true; minDistance= 80.0; MaxDistance= 250.0; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(AudioBIGExplosion3d) // Big explosions like mortars, vehicles, and satchel charges { volume = 1.0; isLooping= false; is3D = true; minDistance= 50.0; MaxDistance= 250.0; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(AudioLooping2D) // Used for Looping Environmental Sounds { volume = 1.0; isLooping = true; is3D = false; type = $EffectAudioType; environmentLevel = 1.0; }; datablock AudioDescription(Audio2D) // Used for non-looping environmental sounds (like power on, power off) { volume = 1.0; isLooping = false; is3D = false; type = $EffectAudioType; environmentLevel = 1.0; }; // Audio Environment Settings --- Used for EAX and EAX2 sounds // datablock AudioEnvironment(Underwater) { useRoom = true; room = UNDERWATER; effectVolume = 0.6; }; datablock AudioEnvironment(BigRoom) { useRoom = true; room = AUDITORIUM; effectVolume = 0.4; }; datablock AudioEnvironment(SmallRoom) { useRoom = true; room = STONEROOM; effectVolume = 0.4; }; PK !(.RMMscripts/serverCommanderMap.cs//------------------------------------------------------------------------------ // Object control //------------------------------------------------------------------------------ function getControlObjectType(%obj) { // 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) { commandToClient(%client, 'ControlObjectResponse', false, "dead people cannot control objects."); return; } //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)); } //------------------------------------------------------------------------------ // 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); } 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 // -------------------------------------------------------- } 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); }PK !(>*scripts/serverDefaults.cs$Host::teamSkin[0] = "blank"; $Host::teamSkin[1] = "base"; $Host::teamSkin[2] = "baseb"; $Host::teamSkin[3] = "swolf"; $Host::teamSkin[4] = "dsword"; $Host::teamSkin[5] = "beagle"; $Host::teamSkin[6] = "cotp"; $Host::teamName[0] = "Unassigned"; $Host::teamName[1] = "Storm"; $Host::teamName[2] = "Inferno"; $Host::teamName[3] = "Starwolf"; $Host::teamName[4] = "Diamond Sword"; $Host::teamName[5] = "Blood Eagle"; $Host::teamName[6] = "Phoenix"; $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 = "Tribes 2 Server"; $Host::Info = "This is a Tribes 2 Server."; $Host::Map = "Katabatic"; $Host::MaxPlayers = 64; } $Host::AdminList = ""; // all players that will be automatically an admin upon joining server $Host::SuperAdminList = ""; // all players that will be automatically a super admin upon joining server $Host::BindAddress = ""; // set to an ip address if the server wants to specify which NIC/IP to use $Host::Port = 28000; $Host::Password = ""; $Host::AdminPassword = ""; $Host::PureServer = 1; $Host::Dedicated = 0; $Host::MissionType = "CTF"; $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 = 300; // 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 = 1; $Host::FloodProtectionEnabled = 1; $Host::MaxMessageLen = 120; $Host::VoteSpread = 20; $Host::TeamDamageOn = 0; $Host::Siege::Halftime = 20000; $Host::CRCTextures = 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"; PK !(TbTTscripts/serverTasks.cs// possible commands: //--------------------------------------------------------------------------- $TaskDescription['EscortPlayer'] = 'Escort player %1'; $TaskDescription['RepairPlayer'] = 'Repair player %1'; $TaskDescription['AttackPlayer'] = 'Attack enemy player %1'; $TaskDescription['DefendFlag'] = 'Defend the flag'; $TaskDescription['ReturnFlag'] = 'Return our flag'; $TaskDescription['CaptureFlag'] = 'Capture the enemy flag'; $TaskDescription['CaptureObjective'] = 'Capture the %1'; $TaskDescription['DefendObjective'] = 'Defend the %1'; $TaskDescription['DefendLocation'] = 'Defend location'; $TaskDescription['MeetLocation'] = 'Meet at location'; $TaskDescription['BombLocation'] = 'Bomb at location'; $TaskDescription['AttackLocation'] = 'Attack at location'; $TaskDescription['LazeTarget'] = 'Laze the target'; $TaskDescription['DeployTurretBarrel'] = 'Deploy turret barrels'; $TaskDescription['DeployTurret'] = 'Deploy turrets'; $TaskDescription['DeployEquipment'] = 'Deploy stations'; $TaskDescription['DeploySensor'] = 'Deploy sensors'; $TaskDescription['RepairObject'] = 'Repair the %1'; $TaskDescription['DefendObject'] = 'Defend the %1'; $TaskDescription['AttackObject'] = 'Attack the enemy %1'; $TaskDescription['MortarObject'] = 'Mortar the enemy %1'; $TaskDescription['LazeObject'] = 'Laze the enemy %1'; $TaskDescription['BombObject'] = 'Bomb the %1'; $TaskDescription['TakeFlag'] = 'Take flag from %1'; $TaskDescription['GiveFlag'] = 'Give flag to %1'; $TaskDescription['NeedRide'] = '%1 needs a ride.'; $TaskDescription['NeedPassenger'] = '%1 needs vehicle support.'; // AIObjectives for commands: //--------------------------------------------------------------------------- $ObjectiveTable['AttackLocation', type] = "AIOAttackLocation"; $ObjectiveTable['AttackLocation', weightLevel1] = 2500; $ObjectiveTable['AttackLocation', weightLevel2] = 1000; $ObjectiveTable['AttackLocation', weightLevel3] = 500; $ObjectiveTable['AttackLocation', weightLevel4] = 100; $ObjectiveTable['AttackLocation', equipment] = ""; $ObjectiveTable['AttackLocation', desiredEquipment] = "ShieldPack"; $ObjectiveTable['AttackLocation', buyEquipmentSet] = "LightShieldSet MediumShieldSet HeavyShieldSet"; $ObjectiveTable['AttackLocation', offense] = "true"; $ObjectiveTable['AttackLocation', defense] = "false"; $ObjectiveTable['AttackLocation', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['AttackLocation', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['DefendLocation', type] = "AIODefendLocation"; $ObjectiveTable['DefendLocation', weightLevel1] = 2500; $ObjectiveTable['DefendLocation', weightLevel2] = 1000; $ObjectiveTable['DefendLocation', weightLevel3] = 500; $ObjectiveTable['DefendLocation', weightLevel4] = 100; $ObjectiveTable['DefendLocation', equipment] = ""; $ObjectiveTable['DefendLocation', desiredEquipment] = "ShieldPack"; $ObjectiveTable['DefendLocation', buyEquipmentSet] = "MediumShieldSet LightShieldSet HeavyShieldSet"; $ObjectiveTable['DefendLocation', offense] = "false"; $ObjectiveTable['DefendLocation', defense] = "true"; $ObjectiveTable['DefendLocation', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['DefendLocation', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['MeetLocation', type] = "AIODefendLocation"; $ObjectiveTable['MeetLocation', weightLevel1] = 2500; $ObjectiveTable['MeetLocation', weightLevel2] = 1000; $ObjectiveTable['MeetLocation', weightLevel3] = 500; $ObjectiveTable['MeetLocation', weightLevel4] = 100; $ObjectiveTable['MeetLocation', equipment] = ""; $ObjectiveTable['MeetLocation', desiredEquipment] = ""; $ObjectiveTable['MeetLocation', buyEquipmentSet] = ""; $ObjectiveTable['MeetLocation', offense] = "false"; $ObjectiveTable['MeetLocation', defense] = "true"; $ObjectiveTable['MeetLocation', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['MeetLocation', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['DefendObjective', type] = "AIODefendLocation"; $ObjectiveTable['DefendObjective', weightLevel1] = 2500; $ObjectiveTable['DefendObjective', weightLevel2] = 1000; $ObjectiveTable['DefendObjective', weightLevel3] = 500; $ObjectiveTable['DefendObjective', weightLevel4] = 100; $ObjectiveTable['DefendObjective', equipment] = ""; $ObjectiveTable['DefendObjective', desiredEquipment] = "ShieldPack"; $ObjectiveTable['DefendObjective', buyEquipmentSet] = "MediumShieldSet LightShieldSet HeavyShieldSet"; $ObjectiveTable['DefendObjective', offense] = "false"; $ObjectiveTable['DefendObjective', defense] = "true"; $ObjectiveTable['DefendObjective', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['DefendObjective', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['DefendObject', type] = "AIODefendLocation"; $ObjectiveTable['DefendObject', weightLevel1] = 2500; $ObjectiveTable['DefendObject', weightLevel2] = 1000; $ObjectiveTable['DefendObject', weightLevel3] = 500; $ObjectiveTable['DefendObject', weightLevel4] = 100; $ObjectiveTable['DefendObject', equipment] = ""; $ObjectiveTable['DefendObject', desiredEquipment] = "ShieldPack"; $ObjectiveTable['DefendObject', buyEquipmentSet] = "MediumShieldSet LightShieldSet HeavyShieldSet"; $ObjectiveTable['DefendObject', offense] = "false"; $ObjectiveTable['DefendObject', defense] = "true"; $ObjectiveTable['DefendObject', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['DefendObject', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['AttackObject', type] = "AIOAttackObject"; $ObjectiveTable['AttackObject', weightLevel1] = 2500; $ObjectiveTable['AttackObject', weightLevel2] = 1000; $ObjectiveTable['AttackObject', weightLevel3] = 500; $ObjectiveTable['AttackObject', weightLevel4] = 100; $ObjectiveTable['AttackObject', equipment] = ""; $ObjectiveTable['AttackObject', desiredEquipment] = "ShieldPack Plasma PlasmaAmmo"; $ObjectiveTable['AttackObject', buyEquipmentSet] = "MediumShieldSet LightShieldSet HeavyShieldSet"; $ObjectiveTable['AttackObject', offense] = "false"; $ObjectiveTable['AttackObject', defense] = "true"; $ObjectiveTable['AttackObject', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['AttackObject', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['EscortPlayer', type] = "AIOEscortPlayer"; $ObjectiveTable['EscortPlayer', weightLevel1] = 2500; $ObjectiveTable['EscortPlayer', weightLevel2] = 1000; $ObjectiveTable['EscortPlayer', weightLevel3] = 500; $ObjectiveTable['EscortPlayer', weightLevel4] = 100; $ObjectiveTable['EscortPlayer', equipment] = ""; $ObjectiveTable['EscortPlayer', desiredEquipment] = "EnergyPack"; $ObjectiveTable['EscortPlayer', buyEquipmentSet] = "LightDefaultSet"; $ObjectiveTable['EscortPlayer', offense] = "true"; $ObjectiveTable['EscortPlayer', defense] = "true"; $ObjectiveTable['EscortPlayer', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['EscortPlayer', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['AttackPlayer', type] = "AIOAttackPlayer"; $ObjectiveTable['AttackPlayer', weightLevel1] = 2500; $ObjectiveTable['AttackPlayer', weightLevel2] = 1000; $ObjectiveTable['AttackPlayer', weightLevel3] = 500; $ObjectiveTable['AttackPlayer', weightLevel4] = 100; $ObjectiveTable['AttackPlayer', equipment] = ""; $ObjectiveTable['AttackPlayer', desiredEquipment] = "EnergyPack"; $ObjectiveTable['AttackPlayer', buyEquipmentSet] = "LightDefaultSet"; $ObjectiveTable['AttackPlayer', offense] = "true"; $ObjectiveTable['AttackPlayer', defense] = "true"; $ObjectiveTable['AttackPlayer', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['AttackPlayer', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['RepairPlayer', type] = "AIORepairObject"; $ObjectiveTable['RepairPlayer', weightLevel1] = 2500; $ObjectiveTable['RepairPlayer', weightLevel2] = 1000; $ObjectiveTable['RepairPlayer', weightLevel3] = 500; $ObjectiveTable['RepairPlayer', weightLevel4] = 100; $ObjectiveTable['RepairPlayer', equipment] = "RepairPack"; $ObjectiveTable['RepairPlayer', desiredEquipment] = "RepairPack"; $ObjectiveTable['RepairPlayer', buyEquipmentSet] = "LightRepairSet MediumRepairSet HeavyRepairSet"; $ObjectiveTable['RepairPlayer', offense] = "true"; $ObjectiveTable['RepairPlayer', defense] = "true"; $ObjectiveTable['RepairPlayer', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['RepairPlayer', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['RepairObject', type] = "AIORepairObject"; $ObjectiveTable['RepairObject', weightLevel1] = 2500; $ObjectiveTable['RepairObject', weightLevel2] = 1000; $ObjectiveTable['RepairObject', weightLevel3] = 500; $ObjectiveTable['RepairObject', weightLevel4] = 100; $ObjectiveTable['RepairObject', equipment] = "RepairPack"; $ObjectiveTable['RepairObject', desiredEquipment] = "RepairPack"; $ObjectiveTable['RepairObject', buyEquipmentSet] = "LightRepairSet MediumRepairSet HeavyRepairSet"; $ObjectiveTable['RepairObject', offense] = "true"; $ObjectiveTable['RepairObject', defense] = "true"; $ObjectiveTable['RepairObject', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['RepairObject', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['MortarObject', type] = "AIOMortarObject"; $ObjectiveTable['MortarObject', weightLevel1] = 2500; $ObjectiveTable['MortarObject', weightLevel2] = 1000; $ObjectiveTable['MortarObject', weightLevel3] = 500; $ObjectiveTable['MortarObject', weightLevel4] = 100; $ObjectiveTable['MortarObject', equipment] = "Mortar MortarAmmo"; $ObjectiveTable['MortarObject', desiredEquipment] = ""; $ObjectiveTable['MortarObject', buyEquipmentSet] = "HeavyAmmoSet"; $ObjectiveTable['MortarObject', offense] = "true"; $ObjectiveTable['MortarObject', defense] = "true"; $ObjectiveTable['MortarObject', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['MortarObject', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['LazeObject', type] = "AIOLazeObject"; $ObjectiveTable['LazeObject', weightLevel1] = 2500; $ObjectiveTable['LazeObject', weightLevel2] = 1000; $ObjectiveTable['LazeObject', weightLevel3] = 500; $ObjectiveTable['LazeObject', weightLevel4] = 100; $ObjectiveTable['LazeObject', equipment] = "TargetingLaser"; $ObjectiveTable['LazeObject', desiredEquipment] = ""; $ObjectiveTable['LazeObject', buyEquipmentSet] = "LightEnergyDefault"; $ObjectiveTable['LazeObject', offense] = "true"; $ObjectiveTable['LazeObject', defense] = "true"; $ObjectiveTable['LazeObject', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['LazeObject', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['BombObject', type] = "AIOBombLocation"; $ObjectiveTable['BombObject', weightLevel1] = 2500; $ObjectiveTable['BombObject', weightLevel2] = 2500; $ObjectiveTable['BombObject', weightLevel3] = 2500; $ObjectiveTable['BombObject', weightLevel4] = 2500; $ObjectiveTable['BombObject', equipment] = ""; $ObjectiveTable['BombObject', desiredEquipment] = ""; $ObjectiveTable['BombObject', buyEquipmentSet] = ""; $ObjectiveTable['BombObject', offense] = "false"; $ObjectiveTable['BombObject', defense] = "false"; $ObjectiveTable['BombObject', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['BombObject', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['DeployTurret', type] = "AIODeployEquipment"; $ObjectiveTable['DeployTurret', weightLevel1] = 2500; $ObjectiveTable['DeployTurret', weightLevel2] = 1000; $ObjectiveTable['DeployTurret', weightLevel3] = 500; $ObjectiveTable['DeployTurret', weightLevel4] = 100; $ObjectiveTable['DeployTurret', equipment] = "TurretOutdoorDeployable"; $ObjectiveTable['DeployTurret', desiredEquipment] = "TurretOutdoorDeployable"; $ObjectiveTable['DeployTurret', buyEquipmentSet] = "MediumOutdoorTurretSet"; $ObjectiveTable['DeployTurret', offense] = "false"; $ObjectiveTable['DeployTurret', defense] = "true"; $ObjectiveTable['DeployTurret', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['DeployTurret', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['DeployEquipment', type] = "AIODeployEquipment"; $ObjectiveTable['DeployEquipment', weightLevel1] = 2500; $ObjectiveTable['DeployEquipment', weightLevel2] = 1000; $ObjectiveTable['DeployEquipment', weightLevel3] = 500; $ObjectiveTable['DeployEquipment', weightLevel4] = 100; $ObjectiveTable['DeployEquipment', equipment] = "InventoryDeployable"; $ObjectiveTable['DeployEquipment', desiredEquipment] = "InventoryDeployable"; $ObjectiveTable['DeployEquipment', buyEquipmentSet] = "MediumInventorySet"; $ObjectiveTable['DeployEquipment', offense] = "false"; $ObjectiveTable['DeployEquipment', defense] = "true"; $ObjectiveTable['DeployEquipment', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['DeployEquipment', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['BombLocation', type] = "AIOBombLocation"; $ObjectiveTable['BombLocation', weightLevel1] = 2500; $ObjectiveTable['BombLocation', weightLevel2] = 2500; $ObjectiveTable['BombLocation', weightLevel3] = 2500; $ObjectiveTable['BombLocation', weightLevel4] = 2500; $ObjectiveTable['BombLocation', equipment] = ""; $ObjectiveTable['BombLocation', desiredEquipment] = ""; $ObjectiveTable['BombLocation', buyEquipmentSet] = ""; $ObjectiveTable['BombLocation', offense] = "false"; $ObjectiveTable['BombLocation', defense] = "false"; $ObjectiveTable['BombLocation', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['BombLocation', maxAssigned] = "2"; // not added if at least this many playrs have ack'd $ObjectiveTable['TakeFlag', type] = "AIOEscortPlayer"; $ObjectiveTable['TakeFlag', weightLevel1] = 2500; $ObjectiveTable['TakeFlag', weightLevel2] = 1000; $ObjectiveTable['TakeFlag', weightLevel3] = 500; $ObjectiveTable['TakeFlag', weightLevel4] = 100; $ObjectiveTable['TakeFlag', equipment] = ""; $ObjectiveTable['TakeFlag', desiredEquipment] = "EnergyPack"; $ObjectiveTable['TakeFlag', buyEquipmentSet] = "LightDefaultSet"; $ObjectiveTable['TakeFlag', offense] = "true"; $ObjectiveTable['TakeFlag', defense] = "true"; $ObjectiveTable['TakeFlag', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['TakeFlag', maxAssigned] = "0"; // not added if at least this many playrs have ack'd $ObjectiveTable['GiveFlag', type] = "AIOEscortPlayer"; $ObjectiveTable['GiveFlag', weightLevel1] = 2500; $ObjectiveTable['GiveFlag', weightLevel2] = 1000; $ObjectiveTable['GiveFlag', weightLevel3] = 500; $ObjectiveTable['GiveFlag', weightLevel4] = 100; $ObjectiveTable['GiveFlag', equipment] = ""; $ObjectiveTable['GiveFlag', desiredEquipment] = "EnergyPack"; $ObjectiveTable['GiveFlag', buyEquipmentSet] = "LightDefaultSet"; $ObjectiveTable['GiveFlag', offense] = "true"; $ObjectiveTable['GiveFlag', defense] = "true"; $ObjectiveTable['GiveFlag', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['GiveFlag', maxAssigned] = "0"; // not added if at least this many playrs have ack'd $ObjectiveTable['NeedRide', type] = "AIOEscortPlayer"; $ObjectiveTable['NeedRide', weightLevel1] = 2500; $ObjectiveTable['NeedRide', weightLevel2] = 1000; $ObjectiveTable['NeedRide', weightLevel3] = 500; $ObjectiveTable['NeedRide', weightLevel4] = 100; $ObjectiveTable['NeedRide', equipment] = ""; $ObjectiveTable['NeedRide', desiredEquipment] = "EnergyPack"; $ObjectiveTable['NeedRide', buyEquipmentSet] = "LightDefaultSet"; $ObjectiveTable['NeedRide', offense] = "true"; $ObjectiveTable['NeedRide', defense] = "true"; $ObjectiveTable['NeedRide', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['NeedRide', maxAssigned] = "0"; // not added if at least this many playrs have ack'd $ObjectiveTable['NeedPassenger', type] = "AIOEscortPlayer"; $ObjectiveTable['NeedPassenger', weightLevel1] = 2500; $ObjectiveTable['NeedPassenger', weightLevel2] = 1000; $ObjectiveTable['NeedPassenger', weightLevel3] = 500; $ObjectiveTable['NeedPassenger', weightLevel4] = 100; $ObjectiveTable['NeedPassenger', equipment] = ""; $ObjectiveTable['NeedPassenger', desiredEquipment] = ""; $ObjectiveTable['NeedPassenger', buyEquipmentSet] = ""; $ObjectiveTable['NeedPassenger', offense] = "true"; $ObjectiveTable['NeedPassenger', defense] = "true"; $ObjectiveTable['NeedPassenger', assignTimeout] = "5000"; // period allowed for humans to ack $ObjectiveTable['NeedPassenger', maxAssigned] = "2"; // not added if at least this many playrs have ack'd //--------------------------------------------------------------------------- // *** temp ai hooks... are in aiHumanTasks.cs //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- new SimSet("PendingAIObjectives"); $MAX_OBJECTIVE_ASSIGN_TIMEOUT = 30000; //--------------------------------------------------------------------------- function isAIActive(%team) { %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %client = ClientGroup.getObject(%i); if(%client.isAIControlled() && (%client.getSensorGroup() == %team)) return(true); } return(false); } function humanTeammatesExist(%client) { %team = %client.getSensorGroup(); %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); if(%cl != %client && !%cl.isAIControlled() && (%cl.getSensorGroup() == %team)) return(true); } return(false); } function AIObjective::assignObjective(%this) { PendingAIObjectives.remove(%this); %this.issuedByClientId.currentAIObjective = -1; aiAddHumanObjective(%this.issuedByClientId, %this, -1, false); } //--------------------------------------------------------------------------- function serverCmdBuildClientTask(%client, %task, %team) { %description = $TaskDescription[getWord(%task, 0)]; if(%description $= "") { %client.currentTaskDescription = ""; return; } // build an ai objective from this task %client.currentAIObjective = -1; if(isAIActive(%client.getSensorGroup())) { %objective = buildAIObjective(%client, %task); if(%objective > 0) { if((%objective.assignTimeout) < 0 || (%objective.assignTimeout > $MAX_OBJECTIVE_ASSIGN_TIMEOUT)) %objective.assignTimeout = $MAX_OBJECTIVE_ASSIGN_TIMEOUT; //add the acknowledge description on to the objective %targetId = %client.getTargetId(); if(%targetId < 0) %targetName = ""; else { %targetName = getTargetGameName(%targetId); if(%targetName $= "") return; } %objective.ackDescription = buildTaggedString(%description, %targetName); //override the assignTimeout if there are no human teammates if (!humanTeammatesExist(%client)) %objective.assignTimeout = 1; //only send the command to the AI if maxAssigned is > 0 if (%objective.maxAssigned > 0) { PendingAIObjectives.add(%objective); %client.currentAIObjective = %objective; %objective.assignThread = %objective.schedule(%objective.assignTimeout, assignObjective); } } } %client.currentTaskIsTeam = %team; %client.currentTaskDescription = %description; } function serverCmdSendTaskToClientTarget(%client, %clientTargetID) { %targetClient = $TargetToClient[%clientTargetID]; serverCmdSendTaskToClient(%client, %targetClient, true); } function serverCmdSendTaskToClient(%client, %targetClient, %fromCmdMap) { if(!isObject(%targetClient)) return; if(%client.getSensorGroup() != %targetClient.getSensorGroup()) return; if(%client.currentTaskDescription $= "") return; if(%client.currentTaskIsTeam) return; if(%targetClient.isAIControlled()) { if(%client.currentAIObjective != -1) { %objective = aiAddHumanObjective(%client, %client.currentAIObjective, %targetClient, %fromCmdMap); if(%objective == %client.currentAIObjective) { PendingAIObjectives.remove(%client.currentAIObjective); cancel(%client.currentAIObjective.assignThread); } if(%objective > 0) %client.currentAIObjective = -1; } } else { %targetId = %client.getTargetId(); if(%targetId < 0) %targetName = ""; else { %targetName = getTargetGameName(%targetId); if(%targetName $= "") return; } commandToClient(%targetClient, 'TaskInfo', %client, -1, false, %client.currentTaskDescription, %targetName); commandToClient(%targetClient, 'PotentialTask', %client.name, %client.currentTaskDescription, %targetName); %client.sendTargetTo(%targetClient, false); } } //--------------------------------------------------------------------------- function serverCmdSendTaskToTeam(%client) { if(%client.currentTaskDescription $= "") return; if(!%client.currentTaskIsTeam) return; %targetId = %client.getTargetId(); if(%targetId < 0) %targetName = ""; else { %targetName = getTargetGameName(%targetId); if(%targetName $= "") return; } %count = ClientGroup.getCount(); for(%i = 0; %i < %count; %i++) { %recipient = ClientGroup.getObject(%i); if(%recipient.getSensorGroup() == %client.getSensorGroup()) { if(!%recipient.isAIControlled()) { commandToClient(%recipient, 'TaskInfo', %client, %client.currentAIObjective, true, %client.currentTaskDescription, %targetName); commandToClient(%recipient, 'PotentialTeamTask', %client.currentTaskDescription, %targetName); %client.sendTargetTo(%recipient, false); } } } } //--------------------------------------------------------------------------- function serverCmdAcceptTask(%client, %issueClient, %AIObjective, %description) { if(%client.getSensorGroup() != %issueClient.getSensorGroup()) return; if(%description $= "") return; // handle an aiobjective: if(%AIObjective != -1) { %count = PendingAIObjectives.getCount(); for(%i = 0; %i < %count; %i++) { %obj = PendingAIObjectives.getObject(%i); if((%obj == %AIObjective) && (%obj.sensorGroup == %client.getSensorGroup)) { // inc the ack count and remove if past max %obj.ackCount++; if(%obj.ackCount >= %obj.maxAssigned) { if(%issueClient.currentAIObjective == %obj) %issueClient.currentAIObjective = -1; %obj.delete(); } } } } commandToClient(%issueClient, 'TaskAccepted', %client.name, %description); commandToClient(%client, 'TaskInfo', %issueClient, -1, %issueClient.name, %description); commandToClient(%client, 'AcceptedTask', %description); %client.sendTargetTo(%client, true); //audio feedback - if the client is not the issuer... if (%client != %issueClient) { %wavFile = "~wvoice/" @ %client.voice @ "/cmd.acknowledge.wav"; MessageClient(%issueClient, 'MsgTaskCompleted', addTaggedString(%wavFile)); } } function serverCmdDeclineTask(%client, %issueClient, %description, %teamCmd) { if(%client.getSensorGroup() != %issueClient.getSensorGroup()) return; if(%description $= "") return; //no need to be spammed by the entire team declining your team command if (%teamCmd) return; commandToClient(%issueClient, 'TaskDeclined', %client.name, %description); //audio feedback %wavFile = "~wvoice/" @ %client.voice @ "/cmd.decline.wav"; MessageClient(%issueClient, 'MsgTaskCompleted', addTaggedString(%wavFile)); } function serverCmdCompletedTask(%client, %issueClient, %description) { if(%client.getSensorGroup() != %issueClient.getSensorGroup()) return; if(%description $= "") return; commandToClient(%issueClient, 'TaskCompleted', %client.name, %description); //audio feedback %wavFile = "~wvoice/" @ %client.voice @ "/cmd.completed.wav"; MessageClient(%issueClient, 'MsgTaskCompleted', addTaggedString(%wavFile)); } //--------------------------------------------------------------------------- function buildAIObjective(%client, %command) { %targetId = %client.getTargetId(); %targetPos = %client.getTargetPos(); %targetObj = -1; if(%targetId != -1) %targetObj = getTargetObject(%targetId); // create a new objective %tableIndex = getWord(%command, 0); %objective = new AIObjective($ObjectiveTable[%tableIndex, type]) { dataBlock = "AIObjectiveMarker"; weightLevel1 = $ObjectiveTable[%tableIndex, weightLevel1]; weightLevel2 = $ObjectiveTable[%tableIndex, weightLevel2]; weightLevel3 = $ObjectiveTable[%tableIndex, weightLevel3]; weightLevel4 = $ObjectiveTable[%tableIndex, weightLevel4]; equipment = $ObjectiveTable[%tableIndex, equipment]; desiredEquipment = $ObjectiveTable[%tableIndex, desiredEquipment]; buyEquipmentSet = $ObjectiveTable[%tableIndex, buyEquipmentSet]; offense = $ObjectiveTable[%tableIndex, offense]; defense = $ObjectiveTable[%tableIndex, defense]; issuedByHuman = true; issuedByClientId = %client; targetObjectId = %targetObj; targetClientId = %targetObj.client; location = %targetPos; position = %targetPos; }; %objective.assignTimeout = $ObjectiveTable[%tableIndex, assignTimeout]; %objective.maxAssigned = $ObjectiveTable[%tableIndex, maxAssigned]; %objective.ackCount = 0; %objective.sensorGroup = %client.getSensorGroup(); MissionCleanup.add(%objective); return(%objective); } //----------------------------------------------------------------------------- //VOICE command hooks here... function findClientInView(%client, %maxDist) { //make sure the player is alive if (!AIClientIsAlive(%client)) return -1; //get various info about the player's eye %srcEyeTransform = %client.player.getEyeTransform(); %srcEyePoint = firstWord(%srcEyeTransform) @ " " @ getWord(%srcEyeTransform, 1) @ " " @ getWord(%srcEyeTransform, 2); %srcEyeVector = VectorNormalize(%client.player.getEyeVector()); //see if there's an enemy near our defense location... %clientCount = 0; %count = ClientGroup.getCount(); %viewedClient = -1; %clientDot = -1; for(%i = 0; %i < %count; %i++) { %cl = ClientGroup.getObject(%i); //make sure we find an AI who's alive and not the client if (%cl != %client && isObject(%cl.player) && %cl.team == %client.team) { //make sure the player is within range %clPos = %cl.player.getWorldBoxCenter(); %distance = VectorDist(%clPos, %srcEyePoint); if (%distance <= %maxDist) { //create the vector from the client to the client %clVector = VectorNormalize(VectorSub(%clPos, %srcEyePoint)); //see if the dot product is greater than our current, and greater than 0.6 %dot = VectorDot(%clVector, %srcEyeVector); if (%dot > 0.6 && %dot > %clientDot) { //make sure we're not looking through walls... %mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType; %losResult = containerRayCast(%srcEyePoint, %clPos, %mask); %losObject = GetWord(%losResult, 0); if (!isObject(%losObject)) { %viewedClient = %cl; %clientDot = %dot; } } } } } return %viewedClient; } function findTargetInView(%client, %maxDist) { if (!AIClientIsAlive(%client)) return -1; // look from player's eye position for objects %mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::GameBaseObjectType; %eyeVec = %client.player.getEyeVector(); %eyeTrans = %client.player.getEyeTransform(); %eyePos = posFromTransform(%eyeTrans); %nEyeVec = VectorNormalize(%eyeVec); %scEyeVec = VectorScale(%nEyeVec, %maxDist); %eyeStart = VectorAdd(%eyePos, VectorScale(%nEyeVec, 1)); %eyeEnd = VectorAdd(%eyePos, %scEyeVec); %losResult = containerRayCast(%eyeStart, %eyeEnd, %mask); %losObject = GetWord(%losResult, 0); if (!isObject(%losObject) || !(%losObject.getType() & $TypeMasks::GameBaseObjectType) || %losObject.getTarget() == -1) return -1; else return %losObject; } //----------------------------------------------------------------------------------------------------- //It would be nice to create server tasks for these voice commands // installChatItem( 'ChatCmdDefendCarrier', "Cover our flag carrier!", "def.carrier", true ); // installChatItem( 'ChatCmdAttackFlag', "Get the enemy flag!", "att.flag", true ); // installChatItem( 'ChatCmdAttackGenerator', "Destroy the enemy generator!", "att.generator", true ); // installChatItem( 'ChatCmdAttackVehicle', "Destroy the enemy vehicle!", "att.vehicle", true ); // // installChatItem( 'ChatCmdDefendCarrier', "Cover our flag carrier!", "def.carrier", true ); // installChatItem( 'ChatCmdDefendFlag', "Defend our flag!", "def.flag", true ); // installChatItem( 'ChatCmdDefendGenerator', "Protect the generator!", "def.generator", true ); // installChatItem( 'ChatCmdDefendSensors', "Defend our sensors!", "def.sensors", true ); // installChatItem( 'ChatCmdDefendTurrets', "Defend our turrets!", "def.turrets", true ); // installChatItem( 'ChatCmdDefendVehicle', "Defend our vehicle!", "def.vehicle", true ); // installChatItem( 'ChatCmdDefendNexus', "Defend the nexus!", "def.nexus", true ); // // installChatItem( 'ChatCmdGiveMeFlag', "Give me the flag!", "flg.give", true ); // installChatItem( 'ChatCmdReturnFlag', "Retrieve our flag!", "flg.retrieve", true ); // installChatItem( 'ChatCmdTakeFlag', "Take the flag from me!", "flg.take", true ); // installChatItem( 'ChatCmdHunterGiveFlags', "Give your flags to me!", "flg.huntergive", true ); // installChatItem( 'ChatCmdHunterTakeFlags', "Take my flags!", "flg.huntertake", true ); //----------------------------------------------------------------------------------------------------- $LookAtClientDistance = 35; $LookAtObjectDistance = 400; function CreateVoiceServerTask(%client, %cmdCode) { //switch on the different voice binds we can create a task for: %losObj = findTargetInView(%client, $LookAtObjectDistance); %targetClient = findClientInView(%client, $LookAtClientDistance); %cmdSent = false; switch$ (%cmdCode) { //these have an object as the target of the command case 'ChatRepairBase': if (isObject(%losObj) && %losObj.getDamagePercent() > 0 && isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'RepairObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } case 'ChatRepairGenerator': if (isObject(%losObj) && %losObj.getDamagePercent() > 0 && isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a generator if (%losObj.getDataBlock().getName() $= "GeneratorLarge" || %losObj.getDataBlock().getName() $= "SolarPanel") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'RepairObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatRepairSensors': if (isObject(%losObj) && %losObj.getDamagePercent() > 0 && isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a sensor if (%losObj.getDataBlock().getName() $= "SensorLargePulse" || %losObj.getDataBlock().getName() $= "SensorMediumPulse") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'RepairObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatRepairTurrets': if (isObject(%losObj) && %losObj.getDamagePercent() > 0 && isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a turret if (%losObj.getDataBlock().getName() $= "TurretBaseLarge" || %losObj.getDataBlock().getName() $= "TurretDeployedFloorIndoor" || %losObj.getDataBlock().getName() $= "TurretDeployedWallIndoor" || %losObj.getDataBlock().getName() $= "TurretDeployedCeilingIndoor" || %losObj.getDataBlock().getName() $= "TurretDeployedOutdoor" || %losObj.getDataBlock().getName() $= "SentryTurret") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'RepairObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatRepairVehicle': if (isObject(%losObj) && %losObj.getDamagePercent() > 0 && isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a vehicle station if (%losObj.getDataBlock().getName() $= "StationVehicle") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'RepairObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatCmdTargetBase' or 'ChatTargetNeed': if (isObject(%losObj) && %losObj.getDamagePercent() < 1 && !isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'LazeObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } case 'ChatCmdTargetTurret': if (isObject(%losObj) && %losObj.getDamagePercent() < 1 && !isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a turret if (%losObj.getDataBlock().getName() $= "TurretBaseLarge" || %losObj.getDataBlock().getName() $= "TurretDeployedFloorIndoor" || %losObj.getDataBlock().getName() $= "TurretDeployedWallIndoor" || %losObj.getDataBlock().getName() $= "TurretDeployedCeilingIndoor" || %losObj.getDataBlock().getName() $= "TurretDeployedOutdoor" || %losObj.getDataBlock().getName() $= "SentryTurret") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'LazeObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatCmdTargetSensors': if (isObject(%losObj) && %losObj.getDamagePercent() < 1 && !isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a sensor if (%losObj.getDataBlock().getName() $= "SensorLargePulse" || %losObj.getDataBlock().getName() $= "SensorMediumPulse") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'LazeObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatTargetFire': if (isObject(%losObj) && %losObj.getDamagePercent() < 1 && !isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'mortarObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } case 'ChatCmdAttackSensors': if (isObject(%losObj) && %losObj.getDamagePercent() < 1 && !isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a sensor if (%losObj.getDataBlock().getName() $= "SensorLargePulse" || %losObj.getDataBlock().getName() $= "SensorMediumPulse") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'mortarObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatCmdAttackTurrets': if (isObject(%losObj) && %losObj.getDamagePercent() < 1 && !isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a turret if (%losObj.getDataBlock().getName() $= "TurretBaseLarge") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'mortarObject', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatCmdDefendBase': if (isObject(%losObj) && isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'DefendLocation', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } case 'ChatCmdDefendGenerator': if (isObject(%losObj) && isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a generator if (%losObj.getDataBlock().getName() $= "GeneratorLarge" || %losObj.getDataBlock().getName() $= "SolarPanel") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'DefendLocation', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatCmdDefendSensors': if (isObject(%losObj) && isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a sensor if (%losObj.getDataBlock().getName() $= "SensorLargePulse" || %losObj.getDataBlock().getName() $= "SensorMediumPulse") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'DefendLocation', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatCmdDefendTurrets': if (isObject(%losObj) && isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a turret if (%losObj.getDataBlock().getName() $= "TurretBaseLarge" || %losObj.getDataBlock().getName() $= "TurretDeployedFloorIndoor" || %losObj.getDataBlock().getName() $= "TurretDeployedWallIndoor" || %losObj.getDataBlock().getName() $= "TurretDeployedCeilingIndoor" || %losObj.getDataBlock().getName() $= "TurretDeployedOutdoor" || %losObj.getDataBlock().getName() $= "SentryTurret") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'DefendLocation', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } case 'ChatCmdDefendVehicle': if (isObject(%losObj) && isTargetFriendly(%losObj.getTarget(), %client.getSensorGroup())) { //make sure the target actually is a vehicle station if (%losObj.getDataBlock().getName() $= "StationVehicle") { %client.setTargetId(%losObj.getTarget()); %client.setTargetPos(%losObj.position); serverCmdBuildClientTask(%client, 'DefendLocation', true); serverCmdSendTaskToTeam(%client); %cmdSent = true; } } //this one is special, it will create a task for the issuer instead of the person you're looking at... case 'ChatTaskCover': %cmdSent = true; if (AIClientIsAlive(%targetClient) && %targetClient.team == %client.team) { %client.setTargetId(%targetClient.player.getTarget()); %client.setTargetPos(%targetClient.player.position); //build and send the command to the target player serverCmdBuildClientTask(%client, 'EscortPlayer', false); serverCmdSendTaskToClient(%client, %client, false); serverCmdAcceptTask(%client, %client, -1, "Escort player" SPC getTaggedString(%targetClient.name)); } //These all have the speaker as the target of the command case 'ChatCmdDefendMe' or 'ChatHelp' or 'ChatNeedCover': %client.setTargetId(%client.player.getTarget()); %client.setTargetPos(%client.player.position); %cmdSent = true; if (AIClientIsAlive(%targetClient)) { //build and send the command to the target player serverCmdBuildClientTask(%client, 'EscortPlayer', false); serverCmdSendTaskToClient(%client, %targetClient, false); } else { serverCmdBuildClientTask(%client, 'EscortPlayer', true); serverCmdSendTaskToTeam(%client); } case 'ChatRepairMe': if (%client.player.getDamagePercent() > 0) { %client.setTargetId(%client.player.getTarget()); %client.setTargetPos(%client.player.position); %cmdSent = true; if (AIClientIsAlive(%targetClient)) { //build and send the command to the target player serverCmdBuildClientTask(%client, 'RepairPlayer', false); serverCmdSendTaskToClient(%client, %targetClient, false); } else { serverCmdBuildClientTask(%client, 'RepairPlayer', true); serverCmdSendTaskToTeam(%client); } } case 'ChatFlagGotIt': //send this only to the AI we're controlling... %cmdSent = true; if (aiHumanHasControl(%client, %client.controlAI)) { %client.setTargetId(%client.player.getTarget()); %client.setTargetPos(%client.player.position); serverCmdBuildClientTask(%client, 'EscortPlayer', false); serverCmdSendTaskToClient(%client, %client.controlAI, false); } case 'ChatCmdTakeFlag' or 'ChatCmdHunterTakeFlags': %client.setTargetId(%client.player.getTarget()); %client.setTargetPos(%client.player.position); %cmdSent = true; if (AIClientIsAlive(%targetClient)) { //build and send the command to the target player serverCmdBuildClientTask(%client, 'TakeFlag', false); serverCmdSendTaskToClient(%client, %targetClient, false); } else { serverCmdBuildClientTask(%client, 'TakeFlag', true); serverCmdSendTaskToTeam(%client); } case 'ChatCmdGiveMeFlag' or 'ChatCmdHunterGiveFlags': %client.setTargetId(%client.player.getTarget()); %client.setTargetPos(%client.player.position); %cmdSent = true; if (AIClientIsAlive(%targetClient)) { if (!%targetClient.isAIControlled()) { //build and send the command to the target player serverCmdBuildClientTask(%client, 'GiveFlag', false); serverCmdSendTaskToClient(%client, %targetClient, false); } else { //send the response to the ai... AIRespondToEvent(%client, %cmdCode, %targetClient); } } else { serverCmdBuildClientTask(%client, 'GiveFlag', true); serverCmdSendTaskToTeam(%client); } case 'ChatNeedDriver' or 'ChatNeedPilot' or 'ChatNeedRide' or 'ChatNeedHold': %client.setTargetId(%client.player.getTarget()); %client.setTargetPos(%client.player.position); %cmdSent = true; if (AIClientIsAlive(%targetClient) && !%targetClient.isAIControlled()) { //build and send the command to the target player serverCmdBuildClientTask(%client, 'NeedRide', false); serverCmdSendTaskToClient(%client, %targetClient, false); } else { serverCmdBuildClientTask(%client, 'NeedRide', true); serverCmdSendTaskToTeam(%client); } //vehicle passengers - these commands are for either air or ground case 'ChatNeedEscort' or 'ChatNeedPassengers' or 'ChatNeedBombardier' or 'ChatNeedSupport' or 'ChatNeedTailgunner': %client.setTargetId(%client.player.getTarget()); %client.setTargetPos(%client.player.position); %cmdSent = true; //find out if the client is in a ground vehicle or not... if (AIClientIsAlive(%targetClient) && !%targetClient.isAIControlled()) { //build and send the command to the target player serverCmdBuildClientTask(%client, 'NeedPassenger', false); serverCmdSendTaskToClient(%client, %targetClient, false); } else { serverCmdBuildClientTask(%client, 'NeedPassenger', true); serverCmdSendTaskToTeam(%client); } default: %cmdSent = true; if (AIClientIsAlive(%targetClient) && %targetClient.isAIControlled()) { //the bot should detect the client %targetClient.clientDetected(%client); //only respond if the client is on the same team AIRespondToEvent(%client, %cmdCode, %targetClient); } } //handle any rejected commands by the bots if (!%cmdSent && isObject(%targetClient) && %targetClient.isAIControlled()) { schedule(250, %client.player, "AIPlayAnimSound", %targetClient, %client.player.getWorldBoxCenter(), "cmd.decline", -1, -1, 0); schedule(2000, %client.player, "AIRespondToEvent", %client, 'ChatCmdWhat', %targetClient); } } PK !(wqqscripts/simGroup.cs//-------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------- function SimGroup::onTrigger(%this, %triggerId, %on) { // Just relay the trigger event to all sub objects... // for (%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).onTrigger(%triggerId, %on); } function SimGroup::onTriggerTick(%this, %triggerId) { // Just relay the trigger event to all sub objects... // for (%i = 0; %i < %this.getCount(); %i++) %this.getObject(%i).onTriggerTick(%triggerId); } PK !(ҭK_scripts/spdialog.csfunction createText(%who) { // The name all enemies have in the training missions $EnemyName = "Enemy"; //Mission Specific wavs, lines and evals //============================================================================= //Here are all the voice files for the missions // the wav variables are the file names for that line // text elements are text that appears on the screen // and the evals are functions that get called // ANY/Misc %who.text[ANY_healthKit, wav] ="voice/Training/Any/ANY.healthkit.wav"; %who.text[ANY_healthKit, text] ="Press " @ findTrainingControlButtons(useRepairKit) @ " to use your health kit."; %who.text[ANY_objComplete01, wav] ="voice/Training/Any/ANY.obj_complete_01.wav"; %who.text[ANY_objComplete02, wav] ="voice/Training/Any/ANY.obj_complete_02.wav"; %who.text[ANY_tipNow01, wav] ="voice/Training/Any/ANY.tip_now01.wav"; %who.text[ANY_tipNow02, wav] ="voice/Training/Any/ANY.tip_now02.wav"; %who.text[ANY_hunting, wav] ="voice/Training/Any/ANY.hunting.wav"; %who.text[ANY_kudo01, wav] ="voice/Training/Any/ANY.kudo01.wav"; %who.text[ANY_kudo02, wav] ="voice/Training/Any/ANY.kudo02.wav"; %who.text[ANY_kudo03, wav] ="voice/Training/Any/ANY.kudo03.wav"; %who.text[ANY_kudo04, wav] ="voice/Training/Any/ANY.kudo04.wav"; %who.text[ANY_waypoint01, wav] ="voice/Training/Any/ANY.waypoint01.wav"; %who.text[ANY_waypoint02, wav] ="voice/Training/Any/ANY.waypoint02.wav"; %who.text[ANY_waypoint02, wav] ="voice/Training/Any/ANY.waypoint02.wav"; %who.text[ANY_waypoint03, wav] ="voice/Training/Any/ANY.waypoint03.wav"; %who.text[ANY_prompt01, wav] ="voice/Training/Any/ANY.prompt01.wav"; %who.text[ANY_prompt02, wav] ="voice/Training/Any/ANY.prompt02.wav"; %who.text[ANY_prompt03, wav] ="=voice/Training/Any/ANY.prompt03.wav"; %who.text[ANY_prompt04, wav] ="voice/Training/Any/ANY.prompt04.wav"; %who.text[ANY_prompt05, wav] ="voice/Training/Any/ANY.prompt05.wav"; %who.text[ANY_prompt06, wav] ="voice/Training/Any/ANY.prompt06.wav"; %who.text[ANY_prompt07, wav] ="voice/Training/Any/ANY.prompt07.wav"; %who.text[ANY_warning01, wav] ="voice/Training/Any/ANY.warning01.wav"; %who.text[ANY_warning02, wav] ="voice/Training/Any/ANY.warning02.wav"; %who.text[ANY_warning03, wav] ="voice/Training/Any/ANY.warning03.wav"; %who.text[ANY_warning03, eval] ="singlePlayerPlayGuiCheck();"; %who.text[ANY_warning04, wav] ="voice/Training/Any/ANY.warning04.wav"; %who.text[ANY_warning05, wav] ="voice/Training/Any/ANY.warning05.wav"; %who.text[ANY_warning06, wav] ="voice/Training/Any/ANY.warning06.wav"; %who.text[ANY_alright, wav] ="voice/Training/Any/ANY.alright.wav"; %who.text[ANY_blowoff01, wav] ="voice/Training/Any/ANY.blowoff01.wav"; %who.text[ANY_blowoff02, wav] ="voice/Training/Any/ANY.blowoff02.wav"; %who.text[ANY_blowoff03, wav] ="voice/Training/Any/ANY.blowoff03.wav"; %who.text[ANY_blowoff04, wav] ="voice/Training/Any/ANY.blowoff04.wav"; %who.text[ANY_careful, wav] ="voice/Training/Any/ANY.careful.wav"; %who.text[ANY_good, wav] ="voice/Training/Any/ANY.good.wav"; %who.text[ANY_jingo01, wav] ="voice/Training/Any/ANY.jingo01.wav"; %who.text[ANY_jingo02, wav] ="voice/Training/Any/ANY.jingo02.wav"; %who.text[ANY_jingo03, wav] ="voice/Training/Any/ANY.jingo03.wav"; %who.text[ANY_check01, wav] ="voice/Training/Any/ANY.check01.wav"; %who.text[ANY_check02, wav] ="voice/Training/Any/ANY.check02.wav"; %who.text[ANY_abortwarn, wav] ="voice/Training/Any/ANY.abortwarn.wav"; %who.text[ANY_abortsoon, wav] ="voice/Training/Any/ANY.abortsoon.wav"; %who.text[ANY_abort, wav] ="voice/Training/Any/ANY.abort.wav"; %who.text[ANY_abort, eval] ="schedule(3000, 0, disconnect);"; %who.text[ANY_tipskiing, wav] ="voice/Training/Any/ANY.tip.skiing.wav"; %who.text[ANY_tipskiing, text] ="Hold down the Jump button ("@findTrainingControlButtons(jump)@") to ski."; %who.text[ANY_tipscavenge01, wav] ="voice/Training/Any/ANY.tip.scavenge01.wav"; %who.text[ANY_tipscavenge02, wav] ="voice/Training/Any/ANY.tip.scavenge02.wav"; %who.text[ANY_move, wav] ="voice/Training/Any/ANY.move.wav"; %who.text[ANY_practiceSki, wav] ="voice/Training/Any/ANY.practice.ski.wav"; %who.text[ANY_practiceJet, wav] ="voice/Training/Any/ANY.practice.jet.wav"; %who.text[ANY_offCourse, wav] ="voice/Training/Any/ANY.offCourse.wav"; // Mission 1 %who.text[T1_01, wav] ="voice/Training/Mission1/T1_01.wav"; %who.text[T1_01a, wav] ="voice/Training/Mission1/T1_01a.wav"; %who.text[T1_01b, wav] ="voice/Training/Mission1/T1_01b.wav"; %who.text[T1_01c, wav] ="voice/Training/Mission1/T1_01c.wav"; %who.text[T1_02, wav] ="voice/Training/Mission1/T1_02.wav"; %who.text[T1_02a, wav] ="voice/Training/Mission1/T1_02a.wav"; %who.text[T1_03, wav] ="voice/Training/Mission1/T1_03.wav"; //%who.text[T1_03, text] ="Press "@findTrainingControlButtons(toggleHelpGui)@" to toggle HUD help."; //%who.text[T1_03, eval] ="toggleHelpText();"; %who.text[T1_03a, wav] ="voice/Training/Mission1/T1_03a.wav"; %who.text[T1_03a, eval] = "lockArmorHack();autoToggleHelpHud(true);"; //%who.text[T1_download01, eval] = "serverPlay2d(DownloadingSound);"; %who.text[T1_download01, text] = "Armor data transfer initiated."; %who.text[T1_03b, wav] ="voice/Training/Mission1/T1_03b.wav"; %who.text[T1_03b, text] ="Use "@findTrainingControlButtons(pageMessageHudUp)@" and "@findTrainingControlButtons(pageMessageHudDown)@" to scroll through the message window."; %who.text[T1_03b, eval] ="flashMessage();"; %who.text[T1_03c, wav] ="voice/Training/Mission1/T1_03c.wav"; %who.text[T1_03c, eval] ="flashObjective();"; %who.text[T1_03c02, wav] ="voice/Training/Mission1/T1_03c-02.wav"; %who.text[T1_04, wav] ="voice/Training/Mission1/T1_04.wav"; %who.text[T1_04, eval] ="flashCompass();"; %who.text[T1_05, wav] ="voice/Training/Mission1/T1_05.wav"; %who.text[T1_05, eval] ="flashHealth();"; %who.text[T1_06, wav] ="voice/Training/Mission1/T1_06.wav"; %who.text[T1_06, eval] ="flashEnergy();"; %who.text[T1_tipenergy, wav] ="voice/Training/Mission1/T1.tip.energy.wav"; %who.text[T1_08, wav] ="voice/Training/Mission1/T1_08.wav"; %who.text[T1_08, eval] ="flashInventory();"; %who.text[T1_09, wav] ="voice/Training/Mission1/T1_09.wav"; %who.text[T1_09, eval] ="flashSensor();"; %who.text[T1_10, wav] ="voice/Training/Mission1/T1_10.wav"; %who.text[T1_10, text] ="Press "@findTrainingControlButtons(toggleHelpGui)@" to toggle HUD help."; %who.text[T1_10, eval] ="autoToggleHelpHud(false);"; %who.text[T1_10a, wav] ="voice/Training/Mission1/T1_10a.wav"; %who.text[T1_10a, eval] ="setWaypointAt(\"-287.5 393.1 76.2\", \"Health Patches\");movemap.push();$player.player.setMoveState(false);"; %who.text[T1_10b, wav] ="voice/Training/Mission1/T1_10b.wav"; %who.text[T1_10b, text] ="Run over freestanding Health Patches to repair your armor."; %who.text[T1_10b, eval] = "$player.hurryUp = schedule(40000, 0, hurryPlayerUp); endOpeningSpiel(); updateTrainingObjectiveHud(obj8);"; %who.text[T1_tipjets01, wav] ="voice/Training/Mission1/T1.tip.jets01.wav"; %who.text[T1_tipjets01, text] ="Press "@findTrainingControlButtons(Jump)@" to jump. "@findTrainingControlButtons(mouseJet)@" triggers the jets. Jump just before you jet to increase jetting distance."; %who.text[T1_11, wav] ="voice/Training/Mission1/T1_11.wav"; %who.text[T1_11, text] ="When necessary, press "@findTrainingControlButtons(useRepairKit)@" to trigger your armor's health kit for partial repairs."; %who.text[T1_12a, wav] ="voice/Training/Mission1/T1_12a.wav"; %who.text[T1_12b, wav] ="voice/Training/Mission1/T1_12b.wav"; %who.text[T1_tipIFF, wav] ="voice/Training/Mission1/T1.tip.IFF.wav"; %who.text[T1_13, wav] ="voice/Training/Mission1/T1_13.wav"; %who.text[T1_13, eval] ="updateTrainingObjectiveHud(obj7);"; %who.text[T1_14, wav] ="voice/Training/Mission1/T1_14.wav"; %who.text[T1_14, eval] ="flashWeapon(0);"; %who.text[T1_tipblaster01, wav] ="voice/Training/Mission1/T1.tip.blaster01.wav"; %who.text[T1_15, wav] ="voice/Training/Mission1/T1_15.wav"; %who.text[T1_15, eval] ="flashWeapon(2);"; %who.text[T1_tipchaingun, wav] ="voice/Training/Mission1/T1.tip.chaingun.wav"; %who.text[T1_16, wav] ="voice/Training/Mission1/T1_16.wav"; %who.text[T1_16, eval] ="flashWeapon(3); "; %who.text[T1_tipspinfusor, wav] ="voice/Training/Mission1/T1.tip.spinfusor.wav"; %who.text[T1_17, wav] ="voice/Training/Mission1/T1_17.wav"; %who.text[T1_17, eval] = "flashWeaponsHud();"; %who.text[T1_tipblaster02, wav] ="voice/Training/Mission1/T1.tip.blaster02.wav"; %who.text[T1_tipblaster02, eval] = "use(Blaster);"; %who.text[T1_tipjets02, wav] ="voice/Training/Mission1/T1.tip.jets02.wav"; %who.text[T1_18, wav] ="voice/Training/Mission1/T1_18.wav"; //%who.text[T1_18, text] ="Press "@findTrainingControlButtons(Jump)@" to jump. "@findTrainingControlButtons(mouseJet)@" triggers the jets. Jump just before you jet to increase jetting distance."; %who.text[T1_18, eval] = "queEnemySet(0); activatePackage(singlePlayerMissionAreaEnforce);"; %who.text[T1_18a, wav] ="voice/Training/Mission1/T1_18a.wav"; %who.text[T1_1802, wav] ="voice/Training/Mission1/T1_18-02.wav"; %who.text[T1_19, wav] ="voice/Training/Mission1/T1_19.wav"; %who.text[T1_20, wav] ="voice/Training/Mission1/T1_20.wav"; %who.text[T1_21, wav] ="voice/Training/Mission1/T1_21.wav"; %who.text[T1_22, wav] ="voice/Training/Mission1/T1_22.wav"; %who.text[T1_22, eval] ="setWaypointat(nameToId(Tower).position, \"BE Tower\"); updateTrainingObjectiveHud(obj4);"; %who.text[T1_22a, wav] ="voice/Training/Mission1/T1_22a.wav"; %who.text[T1_23, wav] ="voice/Training/Mission1/T1_23.wav"; %who.text[T1_23a, wav] ="voice/Training/Mission1/T1_23a.wav"; %who.text[T1_23b, wav] ="voice/Training/Mission1/T1_23b.wav"; %who.text[T1_24, wav] ="voice/Training/Mission1/T1_24.wav"; %who.text[T1_24, text] ="Press "@findTrainingControlButtons(throwWeapon)@" to drop your current weapon."; %who.text[T1_24a, wav] ="voice/Training/Mission1/T1_24a.wav"; %who.text[T1_tippack01, wav] ="voice/Training/Mission1/T1.tip.pack01.wav"; %who.text[T1_tippack01, eval] ="flashPack();"; %who.text[T1_tipsniper01, wav] ="voice/Training/Mission1/T1.tip.sniper01.wav"; %who.text[T1_tipsniper02, wav] ="voice/Training/Mission1/T1.tip.sniper02.wav"; %who.text[T1_tipsniper02, text] = "You must have an Energy Pack to fire the laser rifle."; %who.text[T1_tipsniper03, wav] ="voice/Training/Mission1/T1.tip.sniper03.wav"; %who.text[T1_tipsniper03, text] ="Hold down "@findTrainingControlButtons(toggleZoom)@" to trigger the zoom feature."; %who.text[T1_tipsniper04, wav] ="voice/Training/Mission1/T1.tip.sniper04.wav"; %who.text[T1_25, wav] ="voice/Training/Mission1/T1_25.wav"; %who.text[T1_25, eval] ="updateTrainingObjectiveHud(obj3);"; %who.text[T1_25a, wav] ="voice/Training/Mission1/T1_25a.wav"; %who.text[T1_tiptactics, wav] ="voice/Training/Mission1/T1.tip.tactics.wav"; %who.text[T1_tippack02, wav] ="voice/Training/Mission1/T1.tip.pack02.wav"; //%who.text[T1_tippack02, text] ="Press "@findTrainingControlButtons(useBackPack)@" to activate a pack."; %who.text[T1_tippack03, wav] ="voice/Training/Mission1/T1.tip.pack03.wav"; %who.text[T1_26, wav] ="voice/Training/Mission1/T1_26.wav"; %who.text[T1_27, wav] ="voice/Training/Mission1/T1_27.wav"; %who.text[T1_27, wav] ="voice/Training/Mission1/T1_27.wav"; %who.text[T1_27a, wav] ="voice/Training/Mission1/T1_27a.wav"; %who.text[T1_27b, wav] ="voice/Training/Mission1/T1_27b.wav"; %who.text[T1_28, wav] ="voice/Training/Mission1/T1_28.wav"; %who.text[T1_28, text] ="Jump into the vehicle to pilot it."; %who.text[T1_29, wav] ="voice/Training/Mission1/T1_29.wav"; %who.text[T1_29a, wav] ="voice/Training/Mission1/T1_29a.wav"; %who.text[T1_29a, text] ="Control vehicles the same way you control your armor. "@findTrainingControlButtons(mouseJet)@" triggers a turbo boost instead of jets."; %who.text[T1_tipskiing01, wav] ="voice/Training/Mission1/T1.tip.skiing01.wav"; %who.text[T1_tipskiing01, text] ="Hold down the Jump button ("@findTrainingControlButtons(jump)@") to ski."; %who.text[T1_tipskiing02, wav] ="voice/Training/Mission1/T1.tip.skiing02.wav"; %who.text[T1_tipskiing02a, wav] ="voice/Training/Mission1/T1.tip.skiing02a.wav"; %who.text[T1_tipskiing03, wav] ="voice/Training/Mission1/T1.tip.skiing03.wav"; %who.text[T1_30, wav] ="voice/Training/Mission1/T1_30.wav"; // Misssion 2 %who.text[T2_01, wav] ="voice/Training/Mission2/T2_01.wav"; %who.text[T2_01, eval] = "setWaypointAt(\"-8.82616 -131.779 119.756\", \"Control Switch\");"; %who.text[T2_01a, eval] = "setWaypointAt(nameToId(InitialPulseSensor).position, \"Sensor\");"; %who.text[T2_01a, wav] ="voice/Training/Mission2/T2_01a.wav"; %who.text[T2_01b, wav] ="voice/Training/Mission2/T2_01b.wav"; %who.text[T2_tipplasma, wav] ="voice/Training/Mission2/T2.tip.plasma.wav"; %who.text[T2_tipmissile, wav] ="voice/Training/Mission2/T2.tip.missile.wav"; %who.text[T2_tipmissile02, wav] ="voice/Training/Mission2/T2.tip.missile02.wav"; %who.text[T2_tipmissile03, wav] ="voice/Training/Mission2/T2.tip.missile03.wav"; %who.text[T2_tipevading, wav] ="voice/Training/Mission2/T2.tip.evading.wav"; %who.text[T2_tiptlaser, wav] ="voice/Training/Mission2/T2.tip.tlaser.wav"; %who.text[T2_tipelf, wav] ="voice/Training/Mission2/T2.tip.elf.wav"; %who.text[T2_02, wav] ="voice/Training/Mission2/T2_02.wav"; %who.text[T2_02, eval] = "setWaypointAt(\"-8.82616 -131.779 119.756\", \"Tower\");"; %who.text[T2_03, wav] ="voice/Training/Mission2/T2_03.wav"; %who.text[T2_03, eval] = "setWaypointAt(\"-8.82616 -131.779 119.756\", \"Tower\");"; %who.text[T2_04, wav] ="voice/Training/Mission2/T2_04.wav"; %who.text[T2_04a, wav] ="voice/Training/Mission2/T2_04a.wav"; %who.text[T2_05, wav] ="voice/Training/Mission2/T2_05.wav"; %who.text[T2_05a, wav] ="voice/Training/Mission2/T2_05a.wav"; %who.text[T2_05b, wav] ="voice/Training/Mission2/T2_05b.wav"; %who.text[T2_05c, wav] ="voice/Training/Mission2/T2_05c.wav"; %who.text[T2_tiprepair01, wav] ="voice/Training/Mission2/T2.tip.repair01.wav"; %who.text[T2_tiprepair01, text] ="Press "@findTrainingControlButtons(useBackPack)@" to ready the repair pack. Aim at damaged item and hold down ("@findTrainingControlButtons(mouseFire)@")."; %who.text[T2_tiprepair02, wav] ="voice/Training/Mission2/T2.tip.repair02.wav"; %who.text[T2_tiprepair03, wav] ="voice/Training/Mission2/T2.tip.repair03.wav"; %who.text[T2_tipgens01, wav] ="voice/Training/Mission2/T2.tip.gens01.wav"; %who.text[T2_tipdropit, wav] ="voice/Training/Mission2/T2.tip.dropit.wav"; %who.text[T2_tipdropit, text] ="Press "@findTrainingControlButtons(throwPack)@" to drop your pack."; %who.text[T2_07, wav] ="voice/Training/Mission2/T2_07.wav"; %who.text[T2_07, eval] ="setWaypointAt(\"380.262 -298.625 98.9719\", \"Tower\");"; %who.text[T2_tipscanned, wav] ="voice/Training/Mission2/T2.tip.scanned.wav"; %who.text[T2_08, wav] ="voice/Training/Mission2/T2_08.wav"; %who.text[T2_tipshieldpack, wav] ="voice/Training/Mission2/T2.tip.shieldpack.wav"; %who.text[T2_tipshieldpack, text] ="Press "@findTrainingControlButtons(useBackPack)@" to turn the shield pack on or off."; %who.text[T2_tipshieldpack02, wav] ="voice/Training/Mission2/T2.tip.shieldpack02.wav"; %who.text[T2_tipturret01, wav] ="voice/Training/Mission2/T2.tip.turret01.wav"; %who.text[T2_tipturret02, wav] ="voice/Training/Mission2/T2.tip.turret02.wav"; %who.text[T2_tipturret02, text] ="Press "@findTrainingControlButtons(useTargetingLaser)@" to arm the targeting laser."; %who.text[T2_cya01, wav] ="voice/Training/Mission2/T2.cya01.wav"; %who.text[T2_09, wav] ="voice/Training/Mission2/T2_09.wav"; %who.text[T2_09a, wav] ="voice/Training/Mission2/T2_09a.wav"; %who.text[T2_09b, wav] ="voice/Training/Mission2/T2_09b.wav"; %who.text[T2_10, wav] ="voice/Training/Mission2/T2_10.wav"; %who.text[T2_10a, wav] ="voice/Training/Mission2/T2_10a.wav"; %who.text[T2_11, wav] ="voice/Training/Mission2/T2_11.wav"; %who.text[T2_tipinventory, wav] ="voice/Training/Mission2/T2.tip.inventory.wav"; %who.text[T2_inventory01, wav] ="voice/Training/Mission2/T2.inventory01.wav"; %who.text[T2_tipinventory01, wav] ="voice/Training/Mission2/T2.tip.inventory01.wav"; %who.text[T2_tipinventory03, wav] ="voice/Training/Mission2/T2.tip.inventory03.wav"; %who.text[T2_tipinventory03, text] ="Press "@findTrainingControlButtons(toggleInventoryHud)@" to activate inventory control."; %who.text[T2_tipdefense01, wav] ="voice/Training/Mission2/T2.tip.defense01.wav"; %who.text[T2_tipdefense02, wav] ="voice/Training/Mission2/T2.tip.defense02.wav"; %who.text[T2_tipdefense03, wav] ="voice/Training/Mission2/T2.tip.defense03.wav"; %who.text[T2_tipdefense03, text] ="Press "@findTrainingControlButtons(placeMine)@" to deploy a mine. The longer you hold the key down before release, the farther the mine goes."; %who.text[T2_tipdefense05, wav] ="voice/Training/Mission2/T2.tip.defense05.wav"; %who.text[T2_tipdefense05a, wav] ="voice/Training/Mission2/T2.tip.defense05a.wav"; %who.text[T2_tipdefense06, wav] ="voice/Training/Mission2/T2.tip.defense06.wav"; %who.text[T2_tipdefense07, wav] ="voice/Training/Mission2/T2.tip.defense07.wav"; %who.text[T2_tipdefense08, wav] ="voice/Training/Mission2/T2.tip.defense08.wav"; %who.text[T2_12, wav] ="voice/Training/Mission2/T2_12.wav"; %who.text[T2_13, wav] ="voice/Training/Mission2/T2_13.wav"; %who.text[T2_repairPack, wav] ="voice/Training/Mission2/T2.repairPack.wav"; // mission 3 %who.text[T3_01, wav] ="voice/Training/Mission3/T3_01.wav"; %who.text[T3_02, wav] ="voice/Training/Mission3/T3_02.wav"; %who.text[T3_cloaking, wav] ="voice/Training/Mission3/T3.cloaking.wav"; %who.text[T3_cloaking, text] = findTrainingControlButtons(useBackPack)@" activates and deactivates the cloaking pack."; %who.text[T3_tipcloaking01, wav] ="voice/Training/Mission3/T3.tip.cloaking01.wav"; %who.text[T3_tipcloaking02, wav] ="voice/Training/Mission3/T3.tip.cloaking02.wav"; %who.text[T3_tipequipment01, wav] ="voice/Training/Mission3/T3.tip.equipment01.wav"; %who.text[T3_tipequipment02, wav] ="voice/Training/Mission3/T3.tip.equipment02.wav"; %who.text[T3_tippiloting01, wav] ="voice/Training/Mission3/T3.tip.piloting01.wav"; %who.text[T3_03, wav] ="voice/Training/Mission3/T3_03.wav"; %who.text[T3_player01, wav] ="voice/Training/Mission3/T3.player01.wav"; %who.text[T3_tippiloting02, wav] ="voice/Training/Mission3/T3.tip.piloting02.wav"; %who.text[T3_tippiloting03, wav] ="voice/Training/Mission3/T3.tip.piloting03.wav"; %who.text[T3_warning01, wav] ="voice/Training/Mission3/T3.warning01.wav"; %who.text[T3_warning02, wav] ="voice/Training/Mission3/T3.warning02.wav"; %who.text[T3_warning03, wav] ="voice/Training/Mission3/T3.warning03.wav"; %who.text[T3_04, wav] ="voice/Training/Mission3/T3_04.wav"; %who.text[T3_tippiloting04, wav] ="voice/Training/Mission3/T3.tip.piloting04.wav"; %who.text[T3_05, wav] ="voice/Training/Mission3/T3_05.wav"; %who.text[T3_tipfreelook, wav] ="voice/Training/Mission3/T3.tip.freelook.wav"; %who.text[T3_tipfreelook, text] = "Press and hold "@findTrainingControlButtons(toggleFreelook)@" to allow freelook."; %who.text[T3_tipunderwater01, wav] ="voice/Training/Mission3/T3.tip.underwater01.wav"; %who.text[T3_tipunderwater02, wav] ="voice/Training/Mission3/T3.tip.underwater02.wav"; %who.text[T3_06, wav] ="voice/Training/Mission3/T3_06.wav"; %who.text[T3_07, wav] ="voice/Training/Mission3/T3_07.wav"; %who.text[T3_07a, wav] ="voice/Training/Mission3/T3_07a.wav"; %who.text[T3_07b, wav] ="voice/Training/Mission3/T3_07b.wav"; %who.text[T3_07c, wav] ="voice/Training/Mission3/T3_07c.wav"; %who.text[T3_tipcloaking03, wav] ="voice/Training/Mission3/T3.tip.cloaking03.wav"; %who.text[T3_tipshocklance, wav] ="voice/Training/Mission3/T3.tip.shocklance.wav"; %who.text[T3_08, wav] ="voice/Training/Mission3/T3_08.wav"; %who.text[T3_08a, wav] ="voice/Training/Mission3/T3_08a.wav"; %who.text[T3_08b, wav] ="voice/Training/Mission3/T3_08b.wav"; %who.text[T3_09, wav] ="voice/Training/Mission3/T3_09.wav"; %who.text[T3_09a, wav] ="voice/Training/Mission3/T3_09a.wav"; %who.text[T3_player02, wav] ="voice/Training/Mission3/T3.player02.wav"; %who.text[T3_trainer10, wav] ="voice/Training/Mission3/T3_10.wav"; %who.text[T3_player03, wav] ="voice/Training/Mission3/T3.player03.wav"; %who.text[T3_10, wav] ="voice/Training/Mission3/T3_10.wav"; %who.text[T3_11, wav] ="voice/Training/Mission3/T3_11.wav"; %who.text[T3_12, wav] ="voice/Training/Mission3/T3_12.wav"; %who.text[T3_12a, wav] ="voice/Training/Mission3/T3_12a.wav"; %who.text[T3_13, wav] ="voice/Training/Mission3/T3_13.wav"; // Mission 4 %who.text[T4_01, wav] ="voice/Training/Mission4/T4_01.wav"; %who.text[T4_01, text] ="Repair the waypointed sensor."; %who.text[T4_01a, wav] ="voice/Training/Mission4/T4_01a.wav"; %who.text[T4_01b, wav] ="voice/Training/Mission4/T4_01b.wav"; %who.text[T4_01c, wav] ="voice/Training/Mission4/T4_01c.wav"; %who.text[T4_02, wav] ="voice/Training/Mission4/T4_02.wav"; %who.text[T4_02a, wav] ="voice/Training/Mission4/T4_02a.wav"; %who.text[T4_02b, wav] ="voice/Training/Mission4/T4_02b.wav"; %who.text[T4_03, wav] ="voice/Training/Mission4/T4_03.wav"; %who.text[T4_03, eval] ="firstPersonQuickPan();"; %who.text[T4_03a, wav] ="voice/Training/Mission4/T4_03a.wav"; %who.text[T4_03a, text] ="Press "@findTrainingControlButtons(toggleCommanderMap)@" to toggle your Command Circuit."; %who.text[T4_03a, eval] ="ThreeAEval();"; %who.text[T4_03b, wav] ="voice/Training/Mission4/T4_03b.wav"; %who.text[T4_03c, wav] ="voice/Training/Mission4/T4_03c.wav"; %who.text[T4_03d, wav] ="voice/Training/Mission4/T4_03d.wav"; %who.text[T4_03e, wav] ="voice/Training/Mission4/T4_03e.wav"; %who.text[T4_03f, wav] ="voice/Training/Mission4/T4_03f.wav"; %who.text[T4_03g, wav] ="voice/Training/Mission4/T4_03g.wav"; %who.text[T4_03h, wav] ="voice/Training/Mission4/T4_03h.wav"; %who.text[T4_03h, text] ="Click \"Support Assets\" to open list."; %who.text[T4_03h, eval] ="game.ExpectiongSupportButton = true;"; %who.text[T4_03i, wav] ="voice/Training/Mission4/T4_03i.wav"; %who.text[T4_03j, wav] ="voice/Training/Mission4/T4_03j.wav"; %who.text[T4_03j, text] ="Right click on the sensor tower to activate the Orders menu. Select Repair."; %who.text[T4_03j, eval] ="game.expectingRepairOrder = true;"; %who.text[T4_03k, wav] ="voice/Training/Mission4/T4_03k.wav"; %who.text[T4_03k, text] ="Arrow keys let you scroll around the map."; %who.text[T4_tipCamera01, wav] ="voice/Training/Mission4/T4.tip.Camera01.wav"; %who.text[T4_tipCamera01, text] ="Press "@findTrainingControlButtons(throwGrenade)@" to throw a grenade. The longer you press "@findTrainingControlButtons(throwGrenade)@", the farther the grenade goes."; %who.text[T4_tipCamera02, wav] ="voice/Training/Mission4/T4.tip.Camera02.wav"; //%who.text[T4_tipCamera02, text] ="Click the control box to the right of a camera name to control that camera."; %who.text[T4_tipCamera03, wav] ="voice/Training/Mission4/T4.tip.Camera03.wav"; %who.text[T4_tipCamera04, wav] ="voice/Training/Mission4/T4.tip.Camera04.wav"; %who.text[T4_controlTurret, wav] ="voice/Training/Mission4/T4_controlTurret.wav"; %who.text[T4_tipobjects, wav] ="voice/Training/Mission4/T4.tip.objects.wav"; %who.text[T4_CCend, wav] ="voice/Training/Mission4/T4_CCend.wav"; %who.text[T4_04, wav] ="voice/Training/Mission4/T4_04.wav"; %who.text[T4_04, eval] = "$random = getRandom(20,40);schedule($random, 0, doText, T4_TipDefense06);"; %who.text[T4_tipmortar, wav] ="voice/Training/Mission4/T4.tip.mortar.wav"; %who.text[T4_tipmortar02, wav] = "voice/Training/Mission4/T4.tip.mortar_02.wav"; %who.text[T4_tipgenerator01, wav] ="voice/Training/Mission4/T4.tip.generator01.wav"; %who.text[T4_tipgenerator01a, wav] ="voice/Training/Mission4/T4.tip.generator01a.wav"; %who.text[T4_tipgenerator01b, wav] ="voice/Training/Mission4/T4.tip.generator01b.wav"; %who.text[T4_tipgenerator02, wav] ="voice/Training/Mission4/T4.tip.generator02.wav"; %who.text[T4_ffGenDown01, wav] ="voice/Training/Mission4/T4.ff_genDown01.wav"; %who.text[T4_ffGenDown02, wav] ="voice/Training/Mission4/T4.ff_genDown02.wav"; %who.text[T4_fieldsUp01, wav] ="voice/Training/Mission4/T4.fieldsUp01.wav"; %who.text[T4_fieldsUp02, wav] ="voice/Training/Mission4/T4.fieldsUp02.wav"; %who.text[T4_forceFields01, wav] ="voice/Training/Mission4/T4.forceFields01.wav"; %who.text[T4_forceFields02, wav] ="voice/Training/Mission4/T4.forceFields02.wav"; %who.text[T4_trainer04a, wav] ="voice/Training/Mission4/T4_04a.wav"; %who.text[T4_trainer04b, wav] ="voice/Training/Mission4/T4_04b.wav"; %who.text[T4_tipdefense01, wav] ="voice/Training/Mission4/T4.defense01.wav"; %who.text[T4_05, wav] ="voice/Training/Mission4/T4_05.wav"; %who.text[T4_06, wav] ="voice/Training/Mission4/T4_06.wav"; %who.text[T4_tipdefense02, wav] ="voice/Training/Mission4/T4.tip.defense02.wav"; %who.text[T4_tipdefense03, wav] ="voice/Training/Mission4/T4.tip.defense03.wav"; %who.text[T4_tipdeploy, wav] ="voice/Training/Mission4/T4.tip.deploy.wav"; %who.text[T4_tipdeploy01, wav] ="voice/Training/Mission4/T4.tip.deploy01.wav"; %who.text[T4_tipdeploy02, wav] ="voice/Training/Mission4/T4.tip.deploy02.wav"; %who.text[T4_tipdepturret, wav] ="voice/Training/Mission4/T4.tip.depturret.wav"; %who.text[T4_07, wav] ="voice/Training/Mission4/T4_07.wav"; %who.text[T4_07a, wav] ="voice/Training/Mission4/T4_07a.wav"; %who.text[T4_warning01, wav] ="voice/Training/Mission4/T4.warning01.wav"; %who.text[T4_warning02, wav] ="voice/Training/Mission4/T4.warning02.wav"; %who.text[T4_genup, wav] ="voice/Training/Mission4/T4.genup.wav"; %who.text[T4_genup02, wav] ="voice/Training/Mission4/T4.genup02.wav"; %who.text[T4_genup02a, wav] ="voice/Training/Mission4/T4.genup02a.wav"; %who.text[T4_repgen, wav] ="voice/Training/Mission4/T4.repgen.wav"; %who.text[T4_08, wav] ="voice/Training/Mission4/T4_08.wav"; %who.text[T4_tipcommand05, wav] ="voice/Training/Mission4/T4.tip.command05.wav"; %who.text[T4_tipdefense04, wav] ="voice/Training/Mission4/T4.tip.defense04.wav"; %who.text[T4_tipdefense05, wav] ="voice/Training/Mission4/T4.tip.defense05.wav"; %who.text[T4_tipdefense06, wav] ="voice/Training/Mission4/T4.tip.defense06.wav"; %who.text[T4_tipdefense07, wav] ="voice/Training/Mission4/T4.tip.defense07.wav"; %who.text[T4_tipdefense08, wav] ="voice/Training/Mission4/T4.tip.defense08.wav"; %who.text[T4_tipdefense09, wav] ="voice/Training/Mission4/T4.tip.defense09.wav"; %who.text[T4_09, wav] ="voice/Training/Mission4/T4_09.wav"; %who.text[T4_10, wav] ="voice/Training/Mission4/T4_10.wav"; %who.text[T4_11, wav] ="voice/Training/Mission4/T4_11.wav"; // Mission 5 %who.text[T5_01, wav] ="voice/Training/Mission5/T5_01.wav"; %who.text[T5_02, wav] ="voice/Training/Mission5/T5_02.wav"; %who.text[T5_03, wav] ="voice/Training/Mission5/T5_03.wav"; %who.text[T5_04, wav] ="voice/Training/Mission5/T5_04.wav"; %who.text[T5_tipstations01, wav] ="voice/Training/Mission5/T5.tip.stations01.wav"; %who.text[T5_tipstations02, wav] ="voice/Training/Mission5/T5.tip.stations02.wav"; %who.text[T5_05, wav] ="voice/Training/Mission5/T5_05.wav"; %who.text[T5_05a, wav] ="voice/Training/Mission5/T5_05a.wav"; %who.text[T5_05b, wav] ="voice/Training/Mission5/T5_05b.wav"; %who.text[T5_tipsatchel01, wav] ="voice/Training/Mission5/T5.tip.satchel01.wav"; %who.text[T5_tipsatchel02, wav] ="voice/Training/Mission5/T5.tip.satchel02.wav"; %who.text[T5_06, wav] ="voice/Training/Mission5/T5_06.wav"; %who.text[T5_06a, wav] ="voice/Training/Mission5/T5_06a.wav"; %who.text[T5_06b, wav] ="voice/Training/Mission5/T5_06b.wav"; %who.text[T5_06b, eval] ="training5addSafeDistance();"; %who.text[T5_06c, wav] ="voice/Training/Mission5/T5_06c.wav"; %who.text[T5_06c, eval] ="training5addSafeDistance();"; %who.text[T5_06d, wav] ="voice/Training/Mission5/T5_06d.wav"; //%who.text[T5_06d, eval] ="training5addSafeDistance();"; %who.text[T5_07, wav] ="voice/Training/Mission5/T5_07.wav"; %who.text[T5_Failure01, wav] ="voice/Training/Mission5/T5.failure01.wav"; %who.text[T5_Failure02, wav] ="voice/Training/Mission5/T5.failure02.wav"; %who.text[T5_08, wav] ="voice/Training/Mission5/T5_08.wav"; %who.text[T5_08urgent, wav] ="voice/Training/Mission5/T5_08_urgent.wav"; %who.text[T5_09, wav] ="voice/Training/Mission5/T5_09.wav"; %who.text[T5_tipFirepower, wav] ="voice/Training/Mission5/T5.tip.firepower.wav"; //=========================================================================================== //these are the objective hud elements for single player // note: lines get clipped after 24 chars //format //%who.objHud[missionName, ObjectiveID, Line(1|2)] = "text...duh"; //mission1 //---------------------------------------------------------------------------- %who.objHud[training1, obj1, 1] = "Survey Hanakush Lowlands."; %who.objHud[training1, obj2, 1] = "Remain calm during remote scan."; %who.objHud[training1, obj2, 2] = "Immobilization is temporary."; %who.objHud[training1, obj3, 1] = "Eliminate incoming enemies."; %who.objHud[training1, obj4, 1] = "Investigate tower at waypoint."; %who.objHud[training1, obj5, 1] = "Leave area. Avoid the enemy."; %who.objHud[training1, obj5, 2] = "Meet rescue team at waypoint."; %who.objHud[training1, obj6, 1] = "Go to vehicle at waypoint."; %who.objHud[training1, obj7, 1] = "Wait. Remote systems check pending."; %who.objHud[training1, obj8, 1] = "Get health patches at waypoint."; //mission2 //---------------------------------------------------------------------------- %who.objHud[training2, obj1, 1] = "Capture tower at waypoint."; %who.objHud[training2, obj1, 2] = "Eliminate enemy units."; %who.objHud[training2, obj2, 1] = "Rearm and defend the tower."; %who.objHud[training2, obj2, 2] = "Eliminate incoming enemies."; %who.objHud[training2, obj3, 1] = "Capture tower at waypoint."; %who.objHud[training2, obj3, 2] = "Implant digital virus."; %who.objHud[training2, obj4, 1] = "Capture tower at waypoint."; %who.objHud[training2, obj4, 2] = "Eliminate enemies."; %who.objHud[training2, obj5, 1] = "Destroy enemy sensor."; %who.objHud[training2, obj6, 1] = "Eliminate enemies."; %who.objHud[training2, obj6, 2] = "Destroy enemy turrets."; //mission 3 //---------------------------------------------------------------------------- %who.objHud[training3, obj1, 1] = "Board the Shrike."; %who.objHud[training3, obj2, 1] = "Pilot Shrike to enemy base."; %who.objHud[training3, obj2, 2] = "Locate command switch."; %who.objHud[training3, obj3, 1] = "Fly to extraction point."; %who.objHud[training3, obj4, 1] = "Primary Objective Complete."; %who.objHud[training3, obj4, 2] = "Return to the Shrike."; %who.objHud[training3, obj5, 1] = "Destroy Forcefield Power"; %who.objHud[training3, obj5, 2] = "to disable Control Point shield."; %who.objHud[training3, obj6, 1] = "Implant digital virus"; %who.objHud[training3, obj6, 2] = "at Control Point."; //mission 4 //---------------------------------------------------------------------------- %who.objHud[training4, obj1, 1] = "Stay alert for enemy presence."; %who.objHud[training4, obj1, 2] = "Repair sensor at waypoint."; %who.objHud[training4, obj2, 1] = "Activate Command Circuit."; %who.objHud[training4, obj3, 1] = "Deploy camera."; %who.objHud[training4, obj3, 2] = "Use camera to survey area."; %who.objHud[training4, obj4, 1] = "Use Command Circuit"; %who.objHud[training4, obj4, 2] = "to control Base Turret."; %who.objHud[training4, obj4, 1] = "Use Command Circuit to"; %who.objHud[training4, obj4, 2] = "control Base Turret."; %who.objHud[training4, obj5, 1] = "URGENT! Base Generator cannot"; %who.objHud[training4, obj5, 2] = "be offline longer than 60 seconds."; %who.objHud[training4, obj6, 1] = "Issue order to repair sensor \'Tycho.\'"; %who.objHud[training4, obj7, 1] = "Remain still during remote"; %who.objHud[training4, obj7, 2] = "armor systems scan."; %who.objHud[training4, obj9, 1] = "Deploy turrets."; %who.objHud[training4, obj9, 2] = "Prepare for incoming enemies."; %who.objHud[training4, obj10, 1] = "Defend Base!"; %who.objHud[training4, obj10, 2] = "Keep main generator online."; //mission 5 //---------------------------------------------------------------------------- //%who.objHud[training5, obj1, 1] = "123456789A123456789B123456789C123456789"; %who.objHud[training5, obj1, 1] = "Capture tower at waypoint."; %who.objHud[training5, obj1, 2] = "Implant digital virus."; %who.objHud[training5, obj2, 1] = "Destroy critical gens"; %who.objHud[training5, obj2, 2] = "in the base at waypoint."; %who.objHud[training5, obj4, 1] = "Get out of there NOW!"; //================================================================================= // Misc Messages //Mission completion/failure %who.miscMsg[trainingGenericwin] = "Good Job."; %who.miscMsg[trainingGenericLoss] = "Tribal life can be nasty, brutish, and short. Do you want to try again?"; %who.miscMsg[trainingDeathLoss] = "You died. The Hordes use your gene plasm to make their reavers strong. Do you want to try again?"; %who.miscMsg[training1win] = "Welcome back! You evaded the BioDerm pursuit. Not many warriors return from being shot down. Strike Colonel Akanruth wants a full debriefing."; %who.miscMsg[training2win] = "You broke the back of Horde resistance in your area, and your prowess is noted. An army needs food to keep fighting, and now we have a secure supply."; %who.miscMsg[training3win] = "The data provides key insights into Derm psychology and internal organization. We can now refine our strategic approach to exploit these vulnerabilities."; %who.miscMsg[training3shrikeLoss] = "Without the Shrike, you are stranded too far from Pact territory. The BioDerms hunt you down like a dog and destroy you. Do you want to try again?"; %who.miscMsg[training4win] = "The BioDerm thrust at Nagakhun was shattered, thanks to you. The Derms fail to escape pursuing Pact warriors. Good work!"; %who.miscMsg[training4GenLoss] = "The main generator remained offline too long, and the BioDerms took the base. Your head now hangs on their Flaymaster's wall. Do you want to try again?"; %who.miscMsg[training5DistFail] = "You were too close to the blast. A Pact rescue team finds your broken remains and returns them for a hero's burial."; %who.miscMsg[training5win] = "Congratulations. With the base destroyed, the Pact overwhelmed Horde defenses. The war continues, but we have broken the back of the BioDerm invasion."; %who.miscMsg[training5loss] = "You completed your objective but failed to escape the blast. Too bad. Would you like to try again and find out if you can survive?"; %who.miscMsg[trainingOverEasy] = "You have mastered the basic skills. Consider further training in bot matches or a higher difficulty level."; %who.miscMsg[trainingOverMed] = "You are skilled enough to enter online play with confidence."; %who.miscMsg[trainingOverHard] = "You have God-like skills and should have your trigger finger bronzed."; // -these are here so that they can be edited without the game script being molested // -also for ease of localization (if necessary) //otherMessages %who.miscMsg[noScoreScreen] = "The Score screen is disabled in the training missions."; %who.miscMsg[noCC] = "You are not yet cleared for Command Circuit use."; %who.miscMsg[genAttackNoSatchel] = "You can only destroy the enemy generators by using a satchel charge. The chain reaction will not trigger otherwise."; %who.miscMsg[OOB] = "You have left the mission area."; %who.miscMsg[InBounds] = "You have returned to the mission area."; %who.miscMsg[OOBLoss] = "You were outside the mission area too long. Do you want to try again?"; %who.miscMsg[LeaveGame] = "Are you sure you want to abandon this game?"; %who.miscMsg[noTaskListDlg] = "You have not yet been granted access to the task list dialog."; %who.miscMsg[noInventoryHUD] = "You have not yet been granted access to the Inventory HUD."; } $EnemyNameList[1 ] = "Demon-Core"; $EnemyNameList[2 ] = "Blood-Drinker"; $EnemyNameList[3 ] = "Shargh-zhor"; $EnemyNameList[4 ] = "Azarok"; $EnemyNameList[5 ] = "Storm-of-Death"; $EnemyNameList[6 ] = "Gut Collar"; $EnemyNameList[7 ] = "Torment-the-Weak"; $EnemyNameList[8 ] = "Eats Only Heads"; $EnemyNameList[9 ] = "Koroz the Skull"; $EnemyNameList[10 ] = "Murkhofud"; $EnemyNameList[11 ] = "Broken Horn"; $EnemyNameList[12 ] = "Red Maw"; $EnemyNameList[13 ] = "Rragh Zhek"; $EnemyNameList[14 ] = "Yellowfang"; $EnemyNameList[15 ] = "Old Scarred One"; $EnemyNameList[16 ] = "Hrreshig"; $EnemyNameList[17 ] = "Marakh the Strong"; $EnemyNameList[18 ] = "Spits-Brains"; $EnemyNameList[19 ] = "Cracks-to-Bone"; $EnemyNameList[20 ] = "Gul-Khidor"; $EnemyNameList[21 ] = "Kolkhris"; $EnemyNameList[22 ] = "Render-of-Men"; $EnemyNameList[23 ] = "Ribshatter"; $EnemyNameList[24 ] = "Gerex Chol"; $EnemyNameList[25 ] = "Seregh-zhor"; $EnemyNameList[26 ] = "Lokh Bloodweb"; $EnemyNameList[27 ] = "Devours-All"; $EnemyNameList[28 ] = "The Dracorox"; $EnemyNameList[29 ] = "Tarh the Immortal"; $EnemyNameList[30 ] = "Suntalon"; $EnemyNameList[31 ] = "Omakhros"; $EnemyNameList[32 ] = "Horgoth the Mad"; $EnemyNameList[33 ] = "Spines-for-Spears"; $EnemyNameList[34 ] = "Terrible Claw"; $EnemyNameList[35 ] = "Crush the Humans!"; $EnemyNameList[36 ] = "Arhakhral"; $EnemyNameList[37 ] = "Talons-of-Stone"; $EnemyNameList[38 ] = "Burns-the-Monkeys"; $EnemyNameList[39 ] = "Chainbreaker"; $EnemyNameList[40 ] = "Breath-of-Fear"; $EnemyNameList[41 ] = "Stoneskin"; $EnemyNameList[42 ] = "Piths-the-Prey"; $EnemyNameList[43 ] = "Mercy to Carrion"; $EnemyNameList[44 ] = "Dark-Entrails"; $EnemyNameList[45 ] = "Flaymaster Zhor"; $EnemyNameList[46 ] = "Flaymaster Garakh"; $EnemyNameList[47 ] = "Flaymaster Khel"; $EnemyNameList[48 ] = "Flaymaster Morax"; $EnemyNameList[49 ] = "Flaymaster Khun"; $EnemyNameList[50 ] = "Mhor Chrak-Khor"; $EnemyNameList[51 ] = "Plague Dog!"; $EnemyNameList[52 ] = "Seg Mrazhurr"; $EnemyNameList[53 ] = "Skullcrusher"; $EnemyNameList[54 ] = "Boneboiler"; $EnemyNameList[55 ] = "Murder Beast"; $EnemyNameList[56 ] = "Zura Zorhak"; $EnemyNameList[57 ] = "Hearteater"; $EnemyNameList[58 ] = "Durakh Zon"; $EnemyNameList[59 ] = "Hide-of-Steel"; $EnemyNameList[60 ] = "All Snakes Die"; $EnemyNameList[61 ] = "Monkey Guts"; $EnemyNameList[62 ] = "Throat\'s Bane"; $EnemyNameList[63 ] = "Mukhrak Dar"; $EnemyNameList[64 ] = "Skins-the-Foe"; $EnemyNameList[65 ] = "Rogh the Fearslayer"; $EnemyNameList[66 ] = "Coat-of-Eyes"; $EnemyNameList[67 ] = "Mormoghast"; $EnemyNameList[68 ] = "Bringer-of-Pain"; $EnemyNameList[69 ] = "Devilclaw"; $EnemyNameList[70 ] = "Sows-Terror"; $EnemyNameList[71 ] = "Smiles-to-Kill"; $EnemyNameList[72 ] = "Scarred-by-Plasma"; $EnemyNameList[73 ] = "The Burned One"; $EnemyNameList[74 ] = "Charred Fangs"; $EnemyNameList[75 ] = "Kro Serexhar"; $EnemyNameList[76 ] = "Ku Annorkh"; $EnemyNameList[77 ] = "Gorog the Bull"; $EnemyNameList[78 ] = "Collar-of-Fingers"; $EnemyNameList[79 ] = "Nurog the Dire"; $EnemyNameList[80 ] = "Fharox the Cruel"; $EnemyNameList[81 ] = "Sixty Notches"; $EnemyNameList[82 ] = "Tribekiller"; $EnemyNameList[83 ] = "Bluefang"; $EnemyNameList[84 ] = "Torox Backbreaker"; $EnemyNameList[85 ] = "Dreadbite"; $EnemyNameList[86 ] = "Skarjett"; $EnemyNameList[87 ] = "Face of Thorns"; $EnemyNameList[88 ] = "Gorh Bloodcloud"; $EnemyNameList[89 ] = "Song-of-Carnage"; $EnemyNameList[90 ] = "Rrshak Grinds-All"; $EnemyNameList[91 ] = "Rage-of-Night"; $EnemyNameList[92 ] = "Irokhirr Zhor"; $EnemyNameList[93 ] = "Numankh Bloodcark"; $EnemyNameList[94 ] = "Stonefist Durok"; $EnemyNameList[95 ] = "Denier-of-Soup"; $EnemyNameList[96 ] = "Grendel\'s Kiss"; $EnemyNameList[97 ] = "Karghaz Jok"; $EnemyNameList[98 ] = "Liverthief"; $EnemyNameList[99 ] = "Tumoz Agarh"; $EnemyNameList[100] = "Thirsts-for-Vengeance"; $EnemyNameList[101] = "Malevolox"; $EnemyNameList[102] = "Splinters-Ribs"; $EnemyNameList[103] = "Taunts-the-Prey"; $EnemyNameList[104] = "Glory-in-Pain"; $EnemyNameList[105] = "Monkeykiller"; $EnemyNameList[106] = "Gir QIXOR"; $EnemyNameList[107] = "Rags-of-Flesh"; $EnemyNameList[108] = "Gerhrak Icerender"; $EnemyNameList[109] = "Mordhul Nom"; $EnemyNameList[110] = "Mother of Battles"; $EnemyNameList[111] = "Kill-the-Awkward"; $enemyNameCount = 111; //Blake, this number should be the same as the last name in the listPK !(J ծծscripts/staticShape.cs//****************************************************************************** //* Default StaticShape functions //****************************************************************************** function StaticShapeData::onGainPowerEnabled(%data, %obj) { if(%data.ambientThreadPowered) %obj.playThread($AmbientThread, "ambient"); // if it's a deployed object, schedule the power thread; else play it immediately if(%data.deployAmbientThread) %obj.schedule(750, "playThread", $PowerThread, "Power"); else %obj.playThread($PowerThread,"Power"); // deployable objects get their recharge rate set right away -- don't set it again unless // the object has just been re-enabled if(%obj.initDeploy) %obj.initDeploy = false; else { if(%obj.getRechargeRate() <= 0) { %oldERate = %obj.getRechargeRate(); %obj.setRechargeRate(%oldERate + %data.rechargeRate); } } if(%data.humSound !$= "") %obj.playAudio($HumSound, %data.humSound); %obj.setPoweredState(true); } function StaticShapeData::onLosePowerDisabled(%data, %obj) { %client = %obj.getControllingClient(); if(%client != 0) serverCmdResetControlObject(%client); if(%data.ambientThreadPowered) %obj.pauseThread($AmbientThread); if(!%data.alwaysAmbient) { %obj.stopThread($PowerThread); // MES -- drop shields and stop them from regenerating after power loss %obj.setRechargeRate(0.0); %obj.setEnergyLevel(0.0); } if(%data.humSound !$= "") %obj.stopAudio($HumSound); %obj.setPoweredState(false); } function StaticShapeData::gainPower(%data, %obj) { if(%obj.isEnabled()) %data.onGainPowerEnabled(%obj); Parent::gainPower(%data, %obj); } function StaticShapeData::losePower(%data, %obj) { if(%obj.isEnabled()) %data.onLosePowerDisabled(%obj); Parent::losePower(%data, %obj); } function ShapeBaseData::onEnabled() { } function ShapeBaseData::onDisabled() { } function StaticShapeData::onEnabled(%data, %obj, %prevState) { if(%obj.isPowered()) %data.onGainPowerEnabled(%obj); Parent::onEnabled(%data, %obj, %prevState); } function StaticShapeData::onDisabled(%data, %obj, %prevState) { if(%obj.isPowered() || (%data.className $= "Generator")) %data.onLosePowerDisabled(%obj); Parent::onDisabled(%data, %obj, %prevState); } function StaticShape::deploy(%this) { %this.playThread($DeployThread, "deploy"); } function StaticShapeData::onEndSequence(%data, %obj, %thread) { if(%thread == $DeployThread) %obj.setSelfPowered(); Parent::onEndSequence(%data, %obj, %thread); } function ShapeBaseData::onEndSequence() { } //****************************************************************************** //* Example explosion //****************************************************************************** datablock EffectProfile(ShapeExplosionEffect) { effectname = "explosions/explosion.xpl03"; minDistance = 10; maxDistance = 50; }; datablock AudioProfile(ShapeExplosionSound) { filename = "fx/explosions/explosion.xpl03.wav"; description = AudioExplosion3d; preload = true; effect = ShapeExplosionEffect; }; datablock ExplosionData(ShapeExplosion) { explosionShape = "disc_explosion.dts"; soundProfile = ShapeExplosionSound; faceViewer = true; }; //****************************************************************************** //* Player Armors - Data Blocks (live players are now StaticTSObjects) //****************************************************************************** datablock StaticShapeData(HeavyMaleHuman_Dead) { className = "deadArmor"; catagory = "Player Armors"; shapeFile = "heavy_male_dead.dts"; isInvincible = true; }; datablock StaticShapeData(MediumMaleHuman_Dead) { className = "deadArmor"; catagory = "Player Armors"; shapeFile = "medium_male_dead.dts"; isInvincible = true; }; datablock StaticShapeData(LightMaleHuman_Dead) { className = "deadArmor"; catagory = "Player Armors"; shapeFile = "light_male_dead.dts"; isInvincible = true; }; function deadArmor::onAdd(%data, %obj) { Parent::onAdd(%data, %obj); } //***************************************************************************** //* Flagstands - Data Blocks //***************************************************************************** datablock StaticShapeData(InteriorFlagStand) { className = "FlagIntStand"; catagory = "Objectives"; shapefile = "int_flagstand.dts"; isInvincible = true; needsNoPower = true; }; datablock StaticShapeData(ExteriorFlagStand) { className = "FlagIntStand"; catagory = "Objectives"; shapefile = "ext_flagstand.dts"; isInvincible = true; needsNoPower = true; }; /////////////////////////////////////////// //flagIntStand::onAdd(%this, %obj) //%this: objects datablock //%obj: the actual object being added /////////////////////////////////////////// function ExteriorFlagStand::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); %obj.playThread($ActivateThread, "activate"); } function ExteriorFlagStand::onFlagTaken(%this, %obj) { %obj.setThreadDir($ActivateThread, 0); } function ExteriorFlagStand::onFlagReturn(%this, %obj) { %obj.setThreadDir($ActivateThread, 1); } function ExteriorFlagStand::onCollision(%this, %obj, %colObj) { game.flagStandCollision(%this, %obj, %colObj); } function InteriorFlagStand::onCollision(%this, %obj, %colObj) { game.flagStandCollision(%this, %obj, %colObj); } /////////////////////////////////////////////// //end flag stand functions /////////////////////////////////////////////// datablock StaticShapeData(FlipFlop) { catagory = "Objectives"; shapefile = "switch.dts"; isInvincible = true; cmdCategory = "Objectives"; cmdIcon = "CMDSwitchIcon"; cmdMiniIconName = "commander/MiniIcons/com_switch_grey"; targetTypeTag = 'Switch'; alwaysAmbient = true; needsNoPower = true; emap = true; }; function FlipFlop::onCollision(%data,%obj,%col) { if (%col.getDataBlock().className $= Armor && %col.getState() !$= "Dead") %data.playerTouch(%obj, %col); } function FlipFlop::playerTouch(%data,%obj,%col) { messageAll('MsgPlayerTouchSwitch', 'Player %1 touched switch %2', %col, %obj); } //****************************************************************************** //* Organics - * //****************************************************************************** //function to add random Organics to mission pre-creation //(could be used to add other things...its cool with bioderm armors ;) ) function randomOrg(%organicName, %num, %radius) { %SPACING = 1.0; //meters between center of organic and another object //return help info if(%organicName $="" || !%num || !%radius) { echo("randomOrg(, , );"); return; } %organicIndex = -1; // -------------------------------------------------------- // z0dd - ZOD, 5/8/02. Typo fix. //for (%i = 0; %i < $NumAStaticTSObjects; %i++) { for (%i = 0; %i < $NumStaticTSObjects; %i++) { if (getWord($StaticTSObjects[%i], 1) $= %organicName) { %organicIndex = %i; break; } } if (%organicIndex == -1) { error("There is no static shape named" SPC %organicName); return; } %shapeFileName = getWord($StaticTSObjects[%organicIndex], 2); %maxSlope = getWord($StaticTSObjects[%organicIndex], 3); if (%maxSlope $= "") %maxSlope = 40; %zOffset = getWord($StaticTSObjects[%organicIndex], 4); if (%zOffset $= "") %zOffset = 0; %slopeWithTerrain = getWord($StaticTSObjects[%organicIndex], 5); if (%slopeWithTerrain $= "") %slopeWithTerrain = false; %minScale = getWord($StaticTSObjects[%organicIndex], 6); %maxScale = getWord($StaticTSObjects[%organicIndex], 7); //set up folders in mis file $RandomOrganicsAdded++; //to keep track of groups if(!isObject(RandomOrganics)) { %randomOrgGroup = new simGroup(RandomOrganics); MissionGroup.add(%randomOrgGroup); } %groupName = "Addition"@$RandomOrganicsAdded@%organicName; %group = new simGroup(%groupName); RandomOrganics.add(%group); %ctr = LocalClientConnection.camera.getPosition(); %areaX = getWord(%ctr, 0) - %radius; %areaY = getWord(%ctr, 1) - %radius; %orgCount = %num; while((%orgCount > 0) && (%retries < (15000 / %maxSlope))) //theoretically, a thorough number of retries { //find a tile %x = (getRandom(mFloor(%areaX / 8), mFloor((%areaX + (%radius * 2)) / 8)) * 8) + 4; //tile center %y = (getRandom(mFloor(%areaY / 8), mFloor((%areaY + (%radius * 2)) / 8)) * 8) + 4; %start = %x @ " " @ %y @ " 2000"; %end = %x @ " " @ %y @ " -1"; %ground = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0); %z = getWord(%ground, 3); %z += %zOffset; %position = %x @ " " @ %y @ " " @ %z; // get normal from both sides of the square %start = %x + 2 @ " " @ %y @ " 2000"; %end = %x + 2 @ " " @ %y @ " -1"; %hit1 = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0); %start = %x - 2 @ " " @ %y @ " 2000"; %end = %x - 2 @ " " @ %y @ " -1"; %hit2 = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0); %norm1 = getWord(%hit1, 4) @ " " @ getWord(%hit1, 5) @ " " @ getWord(%hit1, 6); %norm2 = getWord(%hit2, 4) @ " " @ getWord(%hit2, 5) @ " " @ getWord(%hit2, 6); //if either side of tile has greater slope than allowed, move on. %angNorm1 = getTerrainAngle(%norm1); %angNorm2 = getTerrainAngle(%norm2); if ((getTerrainAngle(%norm1) > %maxSlope) || (getTerrainAngle(%norm2) > %maxslope)) { %retries++; continue; } %terrainNormal = VectorAdd(%norm1, %norm2); %terrainNormal = VectorNormalize(%terrainNormal); //search surroundings for obstacles. If obstructed, move on. InitContainerRadiusSearch(%position, %spacing, $TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType | $TypeMasks::StaticShapeObjectType | // ----------------------------- // z0dd - ZOD, 5/8/02. Typo fix. //$TypeMasks::TSStaticShapeObjectType | $TypeMasks::StaticTSObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::TurretObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::ItemObjectType); %this = containerSearchNext(); if(%this) { %retries++; continue; } //rotate it if(%slopeWithTerrain) { %rotAxis = vectorCross(%terrainNormal, "0 0 1"); %rotAxis = vectorNormalize(%rotAxis); %rotation = %rotAxis @ " " @ getTerrainAngle(%terrainNormal); } else %rotation = "1 0 0 0"; %randomAngle = getRandom(360); %zrot = MatrixCreate("0 0 0", "0 0 1 " @ %randomAngle); %orient = MatrixCreate(%position, %rotation); %finalXForm = MatrixMultiply(%orient, %zrot); //scale it %scaleMin = 8; //default min %scaleMax = 14; //default max if(%minScale) %scaleMin = %minScale * 10; if(%maxScale) %scaleMax = %maxScale * 10; %scaleInt = getRandom(%scaleMin, %scaleMax); %scale = %scaleInt/10; %evenScale = %scale SPC %scale SPC %scale; //create it %position = %x SPC %y SPC (%z += %zoffset); %newOrganic = new TSStatic() { position = %position; rotation = %rotation; scale = %evenScale; shapeName = %shapeFileName; }; %group.add(%newOrganic); %newOrganic.setTransform(%finalXForm); %orgCount--; //dec number of shapes left to place %retries = 0; //reset retry counter } if (%orgCount > 0) { error("Unable to place all shapes, area saturated."); error("Looking for clear area " @ (%spacing * 2) @ " meters in diameter, with a max slope of " @ %maxSlope); } echo("Placed " @ %num - %orgCount @ " of " @ %num); } function getTerrainAngle(%point) { %up = "0 0 1"; %angleRad = mACos(vectorDot(%point, %up)); %angleDeg = mRadToDeg(%angleRad); //echo("angle is "@%angleDeg); return %angleDeg; } function randomGrove(%organicName, %num, %radius) { %minHeight = 0; %maxHeight = 1000; %SPACING = 1.5; //meters between center of organic and another object //return help info if(%organicName $="" || !%num || !%radius) { echo("randomOrg(, [, radius of grove desired]);"); return; } %organicIndex = -1; for (%i = 0; %i < $NumStaticTSObjects; %i++) { if (getWord($StaticTSObjects[%i], 1) $= %organicName) { %organicIndex = %i; break; } } if (%organicIndex == -1) { error("There is no static shape named" SPC %organicName); return; } %shapeFileName = getWord($StaticTSObjects[%organicIndex], 2); %maxSlope = getWord($StaticTSObjects[%organicIndex], 3); if (%maxSlope $= "") %maxSlope = 40; %zOffset = getWord($StaticTSObjects[%organicIndex], 4); if (%zOffset $= "") %zOffset = 0; %slopeWithTerrain = getWord($StaticTSObjects[%organicIndex], 5); if (%slopeWithTerrain $= "") %slopeWithTerrain = false; %minScale = getWord($StaticTSObjects[%organicIndex], 6); %maxScale = getWord($StaticTSObjects[%organicIndex], 7); //set up folders in mis file $RandomOrganicsAdded++; //to keep track of groups if(!isObject(RandomOrganics)) { %randomOrgGroup = new simGroup(RandomOrganics); MissionGroup.add(%randomOrgGroup); } %groupName = "Addition"@$RandomOrganicsAdded@%organicName; %group = new simGroup(%groupName); RandomOrganics.add(%group); %ctr = LocalClientConnection.camera.getPosition(); %areaX = getWord(%ctr, 0) - %radius; %areaY = getWord(%ctr, 1) - %radius; %orgCount = %num; while((%orgCount > 0) && (%retries < (15000 / %maxSlope))) //theoretically, a thorough number of retries { //find a tile %x = (getRandom(mFloor(%areaX / 8), mFloor((%areaX + (%radius * 2)) / 8)) * 8) + 4; //tile center %y = (getRandom(mFloor(%areaY / 8), mFloor((%areaY + (%radius * 2)) / 8)) * 8) + 4; %start = %x @ " " @ %y @ " 2000"; %end = %x @ " " @ %y @ " -1"; %ground = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0); %z = getWord(%ground, 3); // elevation test if ((%z < %minHeight) || (%z > %maxHeight)) { echo("Broke height range rules. Readjust allowable elevations."); %retries++; echo("Z is " @ %z); continue; } %z += %zOffset; %position = %x @ " " @ %y @ " " @ %z; // get normal from both sides of the square %start = %x + 2 @ " " @ %y @ " 2000"; %end = %x + 2 @ " " @ %y @ " -1"; %hit1 = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0); %start = %x - 2 @ " " @ %y @ " 2000"; %end = %x - 2 @ " " @ %y @ " -1"; %hit2 = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0); %norm1 = getWord(%hit1, 4) @ " " @ getWord(%hit1, 5) @ " " @ getWord(%hit1, 6); %norm2 = getWord(%hit2, 4) @ " " @ getWord(%hit2, 5) @ " " @ getWord(%hit2, 6); //if either side of tile has greater slope than allowed, move on. %angNorm1 = getTerrainAngle(%norm1); %angNorm2 = getTerrainAngle(%norm2); if ((getTerrainAngle(%norm1) > %maxSlope) || (getTerrainAngle(%norm2) > %maxslope)) { %retries++; continue; } %terrainNormal = VectorAdd(%norm1, %norm2); %terrainNormal = VectorNormalize(%terrainNormal); //search surroundings for obstacles. If obstructed, move on. InitContainerRadiusSearch(%position, %spacing, $TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType | $TypeMasks::StaticShapeObjectType | // ----------------------------- // z0dd - ZOD, 5/8/02. Typo fix. //$TypeMasks::TSStaticShapeObjectType | $TypeMasks::StaticTSObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::TurretObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::ItemObjectType); %this = containerSearchNext(); if(%this) { %retries++; continue; } //rotate it if(%slopeWithTerrain) { %rotAxis = vectorCross(%terrainNormal, "0 0 1"); %rotAxis = vectorNormalize(%rotAxis); %rotation = %rotAxis @ " " @ getTerrainAngle(%terrainNormal); } else %rotation = "1 0 0 0"; %randomAngle = getRandom(360); %zrot = MatrixCreate("0 0 0", "0 0 1 " @ %randomAngle); %orient = MatrixCreate(%position, %rotation); %finalXForm = MatrixMultiply(%orient, %zrot); //scale it %scaleMin = 8; //default min %scaleMax = 14; //default max if(%minScale) %scaleMin = %minScale * 10; if(%maxScale) %scaleMax = %maxScale * 10; %scaleInt = getRandom(%scaleMin, %scaleMax); %scale = %scaleInt/10; %evenScale = %scale SPC %scale SPC %scale; //create it %position = %x SPC %y SPC (%z += %zoffset); %newOrganic = new TSStatic() { position = %position; rotation = %rotation; scale = %evenScale; shapeName = %shapeFileName; }; %group.add(%newOrganic); %newOrganic.setTransform(%finalXForm); %orgCount--; //dec number of shapes left to place %retries = 0; //reset retry counter } if (%orgCount > 0) { error("Unable to place all shapes, area saturated."); error("Looking for clear area " @ (%spacing * 2) @ " meters in diameter, with a max slope of " @ %maxSlope); } echo("Placed " @ %num - %orgCount @ " of " @ %num); } function randomRock(%rock, %quantity, %radius, %maxElev) { if (!%radius || !%quantity || !%rock) { echo("randomRock(, , , [maximum elevation]"); return; } if (!%maxElev) %maxElev = 2000; %rotation[0] = "0 0 1 0"; %rotation[1] = "0.999378 -0.0145686 -0.0321219 194.406"; %rotation[2] = "0.496802 0.867682 0.0177913 176.44"; %rotation[3] = "0.991261 0.0933696 0.0931923 181.867"; %rotation[4] = "0.246801 0.360329 -0.899584 92.3648"; %rotation[5] = "1 0 0 82.59"; %rotation[6] = "0.0546955 -0.629383 0.55201 116.103"; %spacing = 4.0; //check 4 meters around object for collisions before placing %ctr = localClientConnection.camera.getPosition(); %areaX = getWord(%ctr, 0) - %radius; %areaY = getWord(%ctr, 1) - %radius; $RandomOrganicsAdded++; if(!isObject(RandomRocks)) { %randomOrgGroup = new simGroup(RandomRocks); MissionGroup.add(%randomOrgGroup); } %groupName = "Addition"@$RandomOrganicsAdded@%rock; %group = new simGroup(%groupName); RandomRocks.add(%group); %orgCount = %quantity; while((%orgCount > 0) && (%retries < (15000 / %maxSlope))) //theoretically, a thorough number of retries { //find a tile %x = %areaX + getRandom(%radius * 2); %y = %areaY + getRandom(%radius * 2); %start = %x @ " " @ %y @ " 2000"; %end = %x @ " " @ %y @ " -1"; %ground = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0); %position = getWord(%ground, 1) @ " " @ getWord(%ground, 2) @ " " @ getWord(%ground, 3); echo("position =*" @ %position @ "*"); %z = getWord(%position, 2); // elevation test if (%z > %maxElev) //65 meters and above only { %retries++; echo("Z is " @ %z); continue; } //search surroundings for obstacles. If obstructed, move on. InitContainerRadiusSearch(%position, %spacing, $TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType | $TypeMasks::StaticShapeObjectType | // ----------------------------- // z0dd - ZOD, 5/8/02. Typo fix. //$TypeMasks::TSStaticShapeObjectType | $TypeMasks::StaticTSObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::TurretObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::ItemObjectType); %this = containerSearchNext(); if(%this) { %retries++; continue; } %primaryRot = %rotation[getRandom(7)]; %randomAngle = mDegToRad(getRandom(360)); %zrot = MatrixCreate("0 0 0", "0 0 1 " @ %randomAngle); %orient = MatrixCreate(%position, %primaryRot); %scale = getRandom(3); %evenScale = %scale @ " " @ %scale @ " " @ %scale; %newRock = new InteriorInstance() { scale = %evenScale; interiorFile = %rock @ ".dif"; showTerrainInside = "0"; }; %group.add(%newRock); %transfrm = MatrixMultiply(%orient, %zrot); echo("Transform = *" @ %transfrm @ "*"); %newRock.setTransform(%transfrm); %orgCount--; //dec number of shapes left to place %retries = 0; //reset retry counter } if (%orgCount > 0) { error("Unable to place all shapes, area saturated."); error("Looking for clear area " @ (%spacing * 2) @ " meters in diameter, with a max slope of " @ %maxSlope); } echo("Placed " @ %num - %orgCount @ " of " @ %num); } //-------------------------------------------------------------------------- //-------------------------------------- Organics //-------------------------------------------------------------------------- //****************************************************************************** //* Pulse Sensor - Data Blocks * //****************************************************************************** datablock DebrisData( StaticShapeDebris ) { explodeOnMaxBounce = false; elasticity = 0.20; friction = 0.5; lifetime = 17.0; lifetimeVariance = 0.0; minSpinSpeed = 60; maxSpinSpeed = 600; numBounces = 10; bounceVariance = 0; staticOnMaxBounce = true; useRadiusMass = true; baseRadius = 0.4; velocity = 9.0; velocityVariance = 4.5; }; datablock DebrisData( SmallShapeDebris ) { explodeOnMaxBounce = false; elasticity = 0.20; friction = 0.5; lifetime = 17.0; lifetimeVariance = 0.0; minSpinSpeed = 60; maxSpinSpeed = 600; numBounces = 10; bounceVariance = 0; staticOnMaxBounce = true; useRadiusMass = true; baseRadius = 0.2; velocity = 5.0; velocityVariance = 2.5; }; datablock AudioProfile(SensorHumSound) { filename = "fx/powered/sensor_hum.wav"; description = CloseLooping3d; preload = true; }; datablock SensorData(SensorLgPulseObj) { detects = true; detectsUsingLOS = true; detectsPassiveJammed = false; detectsActiveJammed = false; detectsCloaked = false; detectionPings = true; detectRadius = 300; }; datablock StaticShapeData(SensorLargePulse) : StaticShapeDamageProfile { className = Sensor; catagory = "Sensors"; shapeFile = "sensor_pulse_large.dts"; maxDamage = 1.5; destroyedLevel = 1.5; disabledLevel = 0.85; explosion = ShapeExplosion; expDmgRadius = 10.0; expDamage = 0.5; expImpulse = 2000.0; dynamicType = $TypeMasks::SensorObjectType; isShielded = true; energyPerDamagePoint = 33; maxEnergy = 110; rechargeRate = 0.31; ambientThreadPowered = true; humSound = SensorHumSound; cmdCategory = "Support"; cmdIcon = CMDSensorIcon; cmdMiniIconName = "commander/MiniIcons/com_sensor_grey"; targetNameTag = 'Large'; targetTypeTag = 'Sensor'; sensorData = SensorLgPulseObj; sensorRadius = SensorLgPulseObj.detectRadius; sensorColor = "255 194 9"; debrisShapeName = "debris_generic.dts"; debris = StaticShapeDebris; }; datablock SensorData(SensorMedPulseObj) { detects = true; detectsUsingLOS = true; detectsPassiveJammed = false; detectsActiveJammed = false; detectsCloaked = false; detectionPings = true; detectRadius = 175; }; datablock StaticShapeData(SensorMediumPulse) : StaticShapeDamageProfile { className = Sensor; catagory = "Sensors"; shapeFile = "sensor_pulse_medium.dts"; maxDamage = 1.2; destroyedLevel = 1.2; disabledLevel = 0.68; explosion = ShapeExplosion; expDmgRadius = 7.0; expDamage = 0.4; expImpulse = 1500; dynamicType = $TypeMasks::SensorObjectType; isShielded = true; energyPerDamagePoint = 33; maxEnergy = 90; rechargeRate = 0.31; ambientThreadPowered = true; humSound = SensorHumSound; cmdCategory = "Support"; cmdIcon = CMDSensorIcon; cmdMiniIconName = "commander/MiniIcons/com_sensor_grey"; targetNameTag = 'Medium'; targetTypeTag = 'Sensor'; sensorData = SensorMedPulseObj; sensorRadius = SensorMedPulseObj.detectRadius; sensorColor = "255 194 9"; debrisShapeName = "debris_generic.dts"; debris = StaticShapeDebris; }; function Sensor::onGainPowerEnabled(%data, %obj) { setTargetSensorData(%obj.target, %data.sensorData); Parent::onGainPowerEnabled(%data, %obj); } function Sensor::onLosePowerDisabled(%data, %obj) { setTargetSensorData(%obj.target, 0); Parent::onLosePowerDisabled(%data, %obj); } //****************************************************************************** //* Generator - Data Blocks * //****************************************************************************** datablock AudioProfile(GeneratorHumSound) { filename = "fx/powered/generator_hum.wav"; description = CloseLooping3d; preload = true; }; datablock StaticShapeData(GeneratorLarge) : StaticShapeDamageProfile { className = Generator; catagory = "Generators"; shapeFile = "station_generator_large.dts"; explosion = ShapeExplosion; maxDamage = 1.50; destroyedLevel = 1.50; disabledLevel = 0.85; expDmgRadius = 10.0; expDamage = 0.5; expImpulse = 1500.0; noIndividualDamage = true; //flag to make these invulnerable for certain mission types dynamicType = $TypeMasks::GeneratorObjectType; isShielded = true; energyPerDamagePoint = 30; maxEnergy = 50; rechargeRate = 0.05; humSound = GeneratorHumSound; cmdCategory = "Support"; cmdIcon = "CMDGeneratorIcon"; cmdMiniIconName = "commander/MiniIcons/com_generator"; targetTypeTag = 'Generator'; debrisShapeName = "debris_generic.dts"; debris = StaticShapeDebris; }; datablock StaticShapeData(SolarPanel) : StaticShapeDamageProfile { className = Generator; catagory = "Generators"; shapeFile = "solarpanel.dts"; explosion = ShapeExplosion; maxDamage = 1.00; destroyedLevel = 1.00; disabledLevel = 0.55; expDmgRadius = 5.0; expDamage = 0.3; expImpulse = 1000.0; noIndividualDamage = true; //flag to make these invulnerable for certain mission types emap = true; isShielded = true; energyPerDamagePoint = 30; rechargeRate = 0.05; dynamicType = $TypeMasks::GeneratorObjectType; maxEnergy = 30; humSound = GeneratorHumSound; cmdCategory = "Support"; cmdIcon = CMDSolarGeneratorIcon; cmdMiniIconName = "commander/MiniIcons/com_solargen_grey"; targetTypeTag = 'Solar Panel'; debrisShapeName = "debris_generic.dts"; debris = StaticShapeDebris; }; function Generator::onDisabled(%data, %obj, %prevState) { %obj.decPowerCount(); Parent::onDisabled(%data, %obj, %prevState); } function Generator::onEnabled(%data, %obj, %prevState) { %obj.incPowerCount(); Parent::onEnabled(%data, %obj, %prevState); } //****************************************************************************** //Nexus Effect (Hunters) //****************************************************************************** datablock StaticShapeData(Nexus_Effect) { catagory = "Objectives"; shapefile = "nexus_effect.dts"; mass = 10; elasticity = 0.2; friction = 0.6; pickupRadius = 2; }; datablock StaticShapeData(NexusBase) { catagory = "Objectives"; shapefile = "Nexusbase.dts"; mass = 10; elasticity = 0.2; friction = 0.6; pickupRadius = 2; }; datablock StaticShapeData(NexusCap) { catagory = "Objectives"; shapefile = "Nexuscap.dts"; mass = 10; elasticity = 0.2; friction = 0.6; pickupRadius = 2; }; //****************************************************************************** //* Static Shape - Functions * //****************************************************************************** function StaticShapeData::create(%block) { %obj = new StaticShape() { dataBlock = %block; }; return(%obj); } function ShapeBase::damage(%this, %sourceObject, %position, %amount, %damageType) { %this.getDataBlock().damageObject(%this, %sourceObject, %position, %amount, %damageType); } function ShapeBaseData::damageObject(%data, %targetObject, %position, %sourceObject, %amount, %damageType) { } function ShapeBaseData::onDestroyed(%data, %obj, %prevState) { } function ShapeBaseData::checkShields(%data, %targetObject, %position, %amount, %damageType) { %energy = %targetObject.getEnergyLevel(); %strength = %energy / %data.energyPerDamagePoint; %shieldScale = %data.shieldDamageScale[%damageType]; if(%shieldScale $= "") %shieldScale = 1; if (%amount * %shieldScale <= %strength) { // Shield absorbs all %lost = %amount * %shieldScale * %data.energyPerDamagePoint; %energy -= %lost; %targetObject.setEnergyLevel(%energy); %normal = "0.0 0.0 1.0"; %targetObject.playShieldEffect( %normal ); return 0; } // Shield exhausted %targetObject.setEnergyLevel(0); return %amount - %strength / %shieldScale; } function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) { // if this is a non-team mission type and the object is "protected", don't damage it if(%data.noIndividualDamage && Game.allowsProtectedStatics()) return; // if this is a Siege mission and this object shouldn't take damage (e.g. vehicle stations) if(%data.noDamageInSiege && Game.class $= "SiegeGame") return; if(%sourceObject && %targetObject.isEnabled()) { if(%sourceObject.client) { %targetObject.lastDamagedBy = %sourceObject.client; %targetObject.lastDamagedByTeam = %sourceObject.client.team; %targetObject.damageTimeMS = GetSimTime(); } else { %targetObject.lastDamagedBy = %sourceObject; %targetObject.lastDamagedByTeam = %sourceObject.team; %targetObject.damageTimeMS = GetSimTime(); } } // Scale damage type & include shield calculations... if (%data.isShielded) %amount = %data.checkShields(%targetObject, %position, %amount, %damageType); %damageScale = %data.damageScale[%damageType]; if(%damageScale !$= "") %amount *= %damageScale; //if team damage is off, cap the amount of damage so as not to disable the object... if (!$TeamDamage && !%targetObject.getDataBlock().deployedObject) { // ------------------------------------- // z0dd - ZOD, 6/24/02. Console spam fix if(isObject(%sourceObject)) { //see if the object is being shot by a friendly if(%sourceObject.getDataBlock().catagory $= "Vehicles") %attackerTeam = getVehicleAttackerTeam(%sourceObject); else %attackerTeam = %sourceObject.team; } if ((%targetObject.getTarget() != -1) && isTargetFriendly(%targetObject.getTarget(), %attackerTeam)) { %curDamage = %targetObject.getDamageLevel(); %availableDamage = %targetObject.getDataBlock().disabledLevel - %curDamage - 0.05; if (%amount > %availableDamage) %amount = %availableDamage; } } // if there's still damage to apply if (%amount > 0) %targetObject.applyDamage(%amount); } // little special casing for the above function function getVehicleAttackerTeam(%vehicleId) { %name = %vehicleId.getDataBlock().getName(); if(%name $= "BomberFlyer" || %name $= "AssaultVehicle") %gunner = %vehicleId.getMountNodeObject(1); else %gunner = %vehicleId.getMountNodeObject(0); if(%gunner) return %gunner.team; return %vehicleId.team; } function StaticShapeData::onDamage(%this,%obj) { // Set damage state based on current damage level %damage = %obj.getDamageLevel(); if(%damage >= %this.destroyedLevel) { if(%obj.getDamageState() !$= "Destroyed") { %obj.setDamageState(Destroyed); // if object has an explosion damage radius associated with it, apply explosion damage if(%this.expDmgRadius) RadiusExplosion(%obj, %obj.getWorldBoxCenter(), %this.expDmgRadius, %this.expDamage, %this.expImpulse, %obj, $DamageType::Explosion); %obj.setDamageLevel(%this.maxDamage); } } else { if(%damage >= %this.disabledLevel) { if(%obj.getDamageState() !$= "Disabled") %obj.setDamageState(Disabled); } else { if(%obj.getDamageState() !$= "Enabled") %obj.setDamageState(Enabled); } } } // -------------------------------------------------------------------- // Team logos - only the logo projector should be placed in a mission datablock StaticShapeData(BaseLogo) //storm logo { className = Logo; shapeFile = "teamlogo_storm.dts"; alwaysAmbient = true; }; datablock StaticShapeData(BaseBLogo) //Inferno Logo { className = Logo; shapeFile = "teamlogo_inf.dts"; alwaysAmbient = true; }; datablock StaticShapeData(BiodermLogo) { className = Logo; shapeFile = "teamlogo_bd.dts"; alwaysAmbient = true; }; datablock StaticShapeData(BEagleLogo) { className = Logo; shapeFile = "teamlogo_be.dts"; alwaysAmbient = true; }; datablock StaticShapeData(DSwordLogo) { className = Logo; shapeFile = "teamlogo_ds.dts"; alwaysAmbient = true; }; datablock StaticShapeData(COTPLogo) { className = Logo; shapeFile = "teamlogo_hb.dts"; alwaysAmbient = true; }; datablock StaticShapeData(SwolfLogo) { className = Logo; shapeFile = "teamlogo_sw.dts"; alwaysAmbient = true; }; datablock StaticShapeData(LogoProjector) { className = Projector; catagory = "Objectives"; shapeFile = "teamlogo_projector.dts"; alwaysAmbient = true; isInvincible = true; }; function Projector::onAdd(%data, %obj) { Parent::onAdd(%data, %obj); %obj.holo = 0; } //////////////////////////////////////////// // Tapestries /////////////////////////////////////////// datablock StaticShapeData(Banner_Honor) { catagory = "Eyecandy"; shapefile = "banner_honor.dts"; }; datablock StaticShapeData(Banner_Strength) { catagory = "Eyecandy"; shapefile = "banner_strength.dts"; }; datablock StaticShapeData(Banner_Unity) { catagory = "Eyecandy"; shapefile = "banner_unity.dts"; }; //////////////////////////////////////////////////////////////////////////////// // //-------------------------------------------------------------------------- // Totally static objects // The format of these strings are: // 0: Catagory // 1: Name // 2: File // 3: MaxSlope [ only used with the randomOrg function ] // 4: ZOffset [ only used with the randomOrg function ] // 5: slopeWithTerrain [ only used with the randomOrg function ] // 6: minScale [ only used with the randomOrg function ] // 7: maxScale [ only used with the randomOrg function ] $StaticTSObjects[0] = "Organics BiodermPlant3 xorg3.dts"; $StaticTSObjects[1] = "Organics BiodermPlant4 xorg4.dts"; $StaticTSObjects[2] = "Organics BiodermPlant5 xorg5.dts"; $StaticTSObjects[3] = "Organics BiodermPlant20 xorg20.dts"; $StaticTSObjects[4] = "Organics BiodermPlant21 xorg21.dts"; $StaticTSObjects[5] = "Organics BiodermPlant22 xorg22.dts"; $StaticTSObjects[6] = "Organics BEPlant1 borg1.dts 40 0.35 1 0.5 2"; $StaticTSObjects[7] = "Organics BEPlant5 borg5.dts 40 0.0 1 1 1.5"; $StaticTSObjects[8] = "Organics BEPlant6 borg6.dts"; $StaticTSObjects[9] = "Organics BEPlant7 borg7.dts"; $StaticTSObjects[10] = "Organics BEPlant12 borg12.dts"; $StaticTSObjects[11] = "Organics BEPlant13 borg13.dts"; $StaticTSObjects[12] = "Organics BELgTree16 borg16.dts 20 -3.0 0 0.8 1.5"; $StaticTSObjects[13] = "Organics BESmTree17 borg17.dts 20 -3.0 1 0.8 1.5"; $StaticTSObjects[14] = "Organics BELgTree18 borg18.dts 20 -3.0 0 0.8 1.5"; $StaticTSObjects[15] = "Organics BELgTree19 borg19.dts 20 -3.0 0 0.8 1.5"; $StaticTSObjects[16] = "Organics BEPlant20 borg20.dts"; $StaticTSObjects[17] = "Organics BEPlant23 borg23.dts"; $StaticTSObjects[18] = "Organics BEPlant25 borg25.dts"; $StaticTSObjects[19] = "Organics BEPlant31 borg31.dts"; $StaticTSObjects[20] = "Organics BEPlant32 borg32.dts"; $StaticTSObjects[21] = "Organics BEPlant33 borg33.dts"; $StaticTSObjects[22] = "Organics BEPlant34 borg34.dts"; $StaticTSObjects[23] = "Organics PhoenixPlant1 porg1.dts"; $StaticTSObjects[24] = "Organics PhoenixPlant2 porg2.dts"; $StaticTSObjects[25] = "Organics PhoenixPlant3 porg3.dts"; $StaticTSObjects[26] = "Organics PhoenixPlant5 porg5.dts 25 -0.2 1 0.6 1.0"; $StaticTSObjects[27] = "Organics PhoenixPlant6 porg6.dts"; $StaticTSObjects[28] = "Organics PhoenixPlant20 porg20.dts"; $StaticTSObjects[29] = "Organics PhoenixPlant22 porg22.dts 25 0.1 1 0.8 1.4"; $StaticTSObjects[30] = "Organics SWTree20 sorg20.dts"; $StaticTSObjects[31] = "Organics SWShrub21 sorg21.dts"; $StaticTSObjects[32] = "Organics SWTree22 sorg22.dts"; $StaticTSObjects[33] = "Organics SWShrub23 sorg23.dts"; $StaticTSObjects[34] = "Organics SWShrub24 sorg24.dts"; $StaticTSObjects[35] = "Stackables Crate1 stackable1l.dts"; $StaticTSObjects[36] = "Stackables Crate2 stackable1m.dts"; $StaticTSObjects[37] = "Stackables Crate3 stackable1s.dts"; $StaticTSObjects[38] = "Stackables Crate4 stackable2l.dts"; $StaticTSObjects[39] = "Stackables Crate5 stackable2m.dts"; $StaticTSObjects[40] = "Stackables Crate6 stackable2s.dts"; $StaticTSObjects[41] = "Stackables Crate7 stackable3l.dts"; $StaticTSObjects[42] = "Stackables Crate8 stackable3m.dts"; $StaticTSObjects[43] = "Stackables Crate9 stackable3s.dts"; $StaticTSObjects[44] = "Stackables Crate10 stackable4l.dts"; $StaticTSObjects[45] = "Stackables Crate11 stackable4m.dts"; $StaticTSObjects[46] = "Stackables Crate12 stackable5l.dts"; $StaticTSObjects[47] = "Debris ScoutWreckageShape vehicle_air_scout_wreck.dts"; $StaticTSObjects[48] = "Debris TankWreckageShape vehicle_land_assault_wreck.dts"; $StaticTSObjects[49] = "Organics DSPlant16 dorg16.dts 20 -3.0 0 0.8 1.5"; $StaticTSObjects[50] = "Organics DSPlant17 dorg17.dts 20 -3.0 1 0.8 1.5"; $StaticTSObjects[51] = "Organics DSPlant18 dorg18.dts 20 -3.0 0 0.8 1.5"; $StaticTSObjects[52] = "Organics DSPlant19 dorg19.dts 20 -3.0 0 0.8 1.5"; $StaticTSObjects[53] = "PlayerArmors LightMaleHumanArmorImage light_male.dts"; $StaticTSObjects[54] = "PlayerArmors MediumMaleHumanArmorImage medium_male.dts"; $StaticTSObjects[55] = "PlayerArmors HeavyMaleHumanArmorImage heavy_male.dts"; $StaticTSObjects[56] = "PlayerArmors LightFemaleHumanArmorImage light_female.dts"; $StaticTSObjects[57] = "PlayerArmors MediumFemaleHumanArmorImage medium_female.dts"; $StaticTSObjects[58] = "PlayerArmors HeavyFemaleHumanArmorImage heavy_male.dts"; $StaticTSObjects[59] = "PlayerArmors LightMaleBiodermArmorImage bioderm_light.dts"; $StaticTSObjects[60] = "PlayerArmors MediumMaleBiodermArmorImage bioderm_medium.dts"; $StaticTSObjects[61] = "PlayerArmors HeavyMaleBiodermArmorImage bioderm_heavy.dts"; $StaticTSObjects[62] = "Organics BEGrass1 Borg6.dts"; $StaticTSObjects[63] = "Plugs bePlug bmiscf.dts"; $StaticTSObjects[64] = "Plugs dsPlug dmiscf.dts"; $StaticTSObjects[65] = "Plugs xPlug xmiscf.dts"; $StaticTSObjects[66] = "Plugs hPlug pmiscf.dts"; $StaticTSObjects[67] = "Plugs swPlug smiscf.dts"; $StaticTSObjects[68] = "Statues Base statue_base.dts"; $StaticTSObjects[69] = "Statues HeavyMaleStatue statue_hmale.dts"; $StaticTSObjects[70] = "Statues LightFemaleStatue statue_lfemale.dts"; $StaticTSObjects[71] = "Statues LightMaleStatue statue_lmale.dts"; $StaticTSObjects[72] = "Statues Plaque statue_plaque.dts"; $StaticTSObjects[73] = "Debris BomberDebris1 bdb1.dts"; $StaticTSObjects[74] = "Debris BomberDebris2 bdb2.dts"; $StaticTSObjects[75] = "Debris BomberDebris3 bdb3.dts"; $StaticTSObjects[76] = "Debris BomberDebris4 bdb4.dts"; $StaticTSObjects[77] = "Debris BomberDebris5 bdb5.dts"; $StaticTSObjects[78] = "Debris HavocDebris1 hdb1.dts"; $StaticTSObjects[79] = "Debris HavocDebris2 hdb2.dts"; $StaticTSObjects[80] = "Debris HavocDebris3 hdb3.dts"; $StaticTSObjects[81] = "Debris IDebris1 idb.dts"; $StaticTSObjects[82] = "Debris MPBDebris1 mpbdb1.dts"; $StaticTSObjects[83] = "Debris MPBDebris2 mpbdb2.dts"; $StaticTSObjects[84] = "Debris MPBDebris3 mpbdb3.dts"; $StaticTSObjects[85] = "Debris MPBDebris4 mpbdb4.dts"; $StaticTSObjects[86] = "Debris ScoutDebris1 sdb1.dts"; $StaticTSObjects[87] = "Debris TankDebris1 tdb1.dts"; $StaticTSObjects[88] = "Debris TankDebris2 tdb2.dts"; $StaticTSObjects[89] = "Debris TankDebris3 tdb3.dts"; $StaticTSObjects[90] = "Debris GraveMarker1 gravemarker1.dts"; $StaticTSObjects[91] = "Test Test1 test1.dts"; $StaticTSObjects[92] = "Test Test2 test2.dts"; $StaticTSObjects[93] = "Test Test3 test3.dts"; $StaticTSObjects[94] = "Test Test4 test4.dts"; $StaticTSObjects[95] = "Test Test5 test5.dts"; $NumStaticTSObjects = 96; function TSStatic::create(%shapeName) { //echo("Foo:" SPC %shapeName); %obj = new TSStatic() { shapeName = %shapeName; }; return(%obj); } function TSStatic::damage(%this) { // prevent console error spam } function stripFields(%this) { if(%this $= "") %this = MissionGroup; for (%i = 0; %i < %this.getCount(); %i++){ %obj = %this.getObject(%i); if (%obj.getClassName() $= SimGroup) { %obj.powerCount = ""; %obj.team = ""; stripFields(%obj); } else { %obj.threshold = ""; %obj.team = ""; %obj.powerCount = ""; %obj.trigger = ""; %obj.hidden = ""; %obj.locked = "true"; %obj.notReady = ""; %obj.inUse = ""; %obj.triggeredBy = ""; %obj.lastDamagedBy = ""; %obj.lastDamagedByTeam =""; %obj.isHome = ""; %obj.originalPosition = ""; %obj.objectiveCompleted = ""; %obj.number = ""; %obj.target = ""; %obj.lockCount = ""; %obj.homingCount = ""; %obj.projector = ""; %obj.holo = ""; %obj.waypoint = ""; %obj.scoreValue =""; %obj.damageTimeMS = ""; %obj.station = ""; %homingCount = ""; } } } PK !( scripts/station.cs//****************************************************************************** //* Station - Data Blocks * //****************************************************************************** datablock EffectProfile(StationInventoryActivateEffect) { effectname = "powered/inv_pad_on"; minDistance = 5.0; maxDistance = 7.5; }; datablock EffectProfile(StationVehicleAcitvateEffect) { effectname = "powered/vehicle_screen_on2"; minDistance = 3.0; maxDistance = 5.0; }; datablock EffectProfile(StationVehicleDeactivateEffect) { effectname = "powered/vehicle_screen_off"; minDistance = 3.0; maxDistance = 5.0; }; //datablock EffectProfile(MobileBaseInventoryActivateEffect) //{ // effectname = "misc/diagnostic_on"; // minDistance = 3.0; //}; datablock EffectProfile(StationAccessDeniedEffect) { effectname = "powered/station_denied"; minDistance = 3.0; maxDistance = 5.0; }; datablock AudioProfile(StationInventoryActivateSound) { filename = "fx/powered/inv_pad_on.wav"; description = AudioClose3d; preload = true; effect = StationInventoryActivateEffect; }; datablock AudioProfile(MobileBaseInventoryActivateSound) { filename = "fx/vehicles/mpb_inv_station.wav"; description = AudioClose3d; preload = true; effect = StationInventoryActivateEffect; }; datablock AudioProfile(DepInvActivateSound) { filename = "fx/powered/dep_inv_station.wav"; description = AudioClose3d; preload = true; effect = StationInventoryActivateEffect; }; datablock AudioProfile(StationVehicleAcitvateSound) { filename = "fx/powered/vehicle_screen_on2.wav"; description = AudioClosest3d; preload = true; effect = StationVehicleAcitvateEffect; }; datablock AudioProfile(StationVehicleDeactivateSound) { filename = "fx/powered/vehicle_screen_off.wav"; description = AudioClose3d; preload = true; effect = StationVehicleDeactivateEffect; }; datablock AudioProfile(StationAccessDeniedSound) { filename = "fx/powered/station_denied.wav"; description = AudioClosest3d; preload = true; effect = StationAccessDeniedEffect; }; datablock AudioProfile(StationVehicleHumSound) { filename = "fx/powered/station_hum.wav"; description = CloseLooping3d; preload = true; }; datablock AudioProfile(StationInventoryHumSound) { filename = "fx/powered/station_hum.wav"; description = CloseLooping3d; preload = true; }; datablock StationFXPersonalData( PersonalInvFX ) { delay = 0; fadeDelay = 0.5; lifetime = 1.2; height = 2.5; numArcSegments = 10.0; numDegrees = 180.0; trailFadeTime = 0.5; leftRadius = 1.85; rightRadius = 1.85; leftNodeName = "FX1"; rightNodeName = "FX2"; texture[0] = "special/stationLight"; }; datablock DebrisData( StationDebris ) { explodeOnMaxBounce = false; elasticity = 0.40; friction = 0.5; lifetime = 17.0; lifetimeVariance = 0.0; minSpinSpeed = 60; maxSpinSpeed = 600; numBounces = 10; bounceVariance = 0; staticOnMaxBounce = true; useRadiusMass = true; baseRadius = 0.4; velocity = 9.0; velocityVariance = 4.5; }; datablock StaticShapeData(StationInventory) : StaticShapeDamageProfile { className = Station; catagory = "Stations"; shapeFile = "station_inv_human.dts"; maxDamage = 1.00; destroyedLevel = 1.00; disabledLevel = 0.70; explosion = ShapeExplosion; expDmgRadius = 8.0; expDamage = 0.4; expImpulse = 1500.0; // don't allow this object to be damaged in non-team-based // mission types (DM, Rabbit, Bounty, Hunters) noIndividualDamage = true; dynamicType = $TypeMasks::StationObjectType; isShielded = true; energyPerDamagePoint = 75; maxEnergy = 50; rechargeRate = 0.35; doesRepair = true; humSound = StationInventoryHumSound; cmdCategory = "Support"; cmdIcon = CMDStationIcon; cmdMiniIconName = "commander/MiniIcons/com_inventory_grey"; targetNameTag = 'Inventory'; targetTypeTag = 'Station'; debrisShapeName = "debris_generic.dts"; debris = StationDebris; }; datablock StaticShapeData(StationAmmo) : StaticShapeDamageProfile { className = Station; catagory = "Stations"; // shapeFile = "station_ammo.dts"; shapeFile = "station_inv_human.dts"; maxDamage = 1.00; destroyedLevel = 1.00; disabledLevel = 0.70; explosion = ShapeExplosion; expDmgRadius = 8.0; expDamage = 0.4; expImpulse = 1500.0; // don't allow this object to be damaged in non-team-based // mission types (DM, Rabbit, Bounty, Hunters) noIndividualDamage = true; dynamicType = $TypeMasks::StationObjectType; isShielded = true; energyPerDamagePoint = 75; maxEnergy = 50; rechargeRate = 0.35; doesRepair = true; humSound = StationInventoryHumSound; cmdCategory = "Support"; cmdIcon = CMDStationIcon; cmdMiniIconName = "commander/MiniIcons/com_inventory_grey"; targetNameTag = 'Ammo'; targetTypeTag = 'Station'; debrisShapeName = "debris_generic.dts"; debris = StationDebris; }; datablock StaticShapeData(StationVehicle) : StaticShapeDamageProfile { className = Station; catagory = "Stations"; shapeFile = "vehicle_pad_station.dts"; maxDamage = 1.20; destroyedLevel = 1.20; disabledLevel = 0.84; explosion = ShapeExplosion; expDmgRadius = 10.0; expDamage = 0.4; expImpulse = 1500.0; dynamicType = $TypeMasks::StationObjectType; isShielded = true; energyPerDamagePoint = 33; maxEnergy = 250; rechargeRate = 0.31; humSound = StationVehicleHumSound; // don't let these be damaged in Siege missions noDamageInSiege = true; cmdCategory = "Support"; cmdIcon = CMDVehicleStationIcon; cmdMiniIconName = "commander/MiniIcons/com_vehicle_pad_inventory"; targetTypeTag = 'Vehicle Station'; debrisShapeName = "debris_generic.dts"; debris = StationDebris; }; datablock StaticShapeData(StationVehiclePad) { className = Station; catagory = "Stations"; shapeFile = "vehicle_pad.dts"; isInvincible = true; dynamicType = $TypeMasks::StaticObjectType; rechargeRate = 0.05; // ------------------------------------------ // z0dd - ZOD, 5/8/02. CC bug fix parameter. // Part of overall V-Station creation change. targetTypeTag = 'Vehicle Pad'; }; //datablock StaticShapeData(StationAmmo) //{ // className = Station; // catagory = "Stations"; // shapeFile = "station_ammo.dts"; // maxDamage = 1.0; // disabledLevel = 0.6; // destroyedLevel = 0.8; // icon = "CMDStationIcon"; // dynamicType = $TypeMasks::StationObjectType; //}; datablock StaticShapeData(MobileInvStation) { className = Station; catagory = "Stations"; shapeFile = "station_inv_mpb.dts"; icon = "CMDStationIcon"; // don't allow this object to be damaged in non-team-based // mission types (DM, Rabbit, Bounty, Hunters) noIndividualDamage = true; dynamicType = $TypeMasks::StationObjectType; rechargeRate = 0.256; doesRepair = true; }; //****************************************************************************** //* Station - Functions * //****************************************************************************** //////////////////////////////////////////////////////////////////////////////// /// -Inventory- //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// -Inventory- //////////////////////////////////////////////////////////////// //Function -- onAdd (%this, %obj) // %this = Object data block // %obj = Object being added //Decription -- Called when the object is added to the mission //////////////////////////////////////////////////////////////////////////////// function StationInventory::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); %obj.setRechargeRate(%obj.getDatablock().rechargeRate); %trigger = new Trigger() { dataBlock = stationTrigger; polyhedron = "-0.75 0.75 0.1 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.3"; }; MissionCleanup.add(%trigger); %trigger.setTransform(%obj.getTransform()); %trigger.station = %obj; %trigger.mainObj = %obj; %trigger.disableObj = %obj; %obj.trigger = %trigger; } /// -Inventory- //////////////////////////////////////////////////////////////// //Function -- stationReady(%data, %obj) // %data = Station Data Block // %obj = Station Object //Decription -- Called when station has been triggered and animation is // completed //////////////////////////////////////////////////////////////////////////////// function StationInventory::stationReady(%data, %obj) { //Display the Inventory Station GUI here %obj.notReady = 1; %obj.inUse = "Down"; %obj.schedule(500,"playThread",$ActivateThread,"activate1"); %player = %obj.triggeredBy; %energy = %player.getEnergyLevel(); // ------------------------------------------------- // z0dd - ZOD, 4/20/02. Addition. Inv energy bug fix %max = %player.getDatablock().maxEnergy; %player.setCloaked(true); %player.schedule(500, "setCloaked", false); if (!%player.client.isAIControlled()) buyFavorites(%player.client); // ------------------------------------------------- // z0dd - ZOD, 4/20/02. Addition. Inv energy bug fix //%player.setEnergyLevel(%energy); %player.setEnergyLevel(mFloor(%player.getDatablock().maxEnergy * %energy / %max)); %data.schedule( 500, "beginPersonalInvEffect", %obj ); } function StationInventory::beginPersonalInvEffect( %data, %obj ) { if (!%obj.isDisabled()) { %fx = new StationFXPersonal() { dataBlock = PersonalInvFX; stationObject = %obj; }; } } /// -Inventory- //////////////////////////////////////////////////////////////// //Function -- stationFinished(%data, %obj) // %data = Station Data Block // %obj = Station Object //Decription -- Called when player has left the station //////////////////////////////////////////////////////////////////////////////// function StationInventory::stationFinished(%data, %obj) { //Hide the Inventory Station GUI } /// -Inventory- //////////////////////////////////////////////////////////////// //Function -- getSound(%data, %forward) // %data = Station Data Block // %forward = direction the animation is playing //Decription -- This sound will be played at the same time as the activate // animation. //////////////////////////////////////////////////////////////////////////////// function StationInventory::getSound(%data, %forward) { if(%forward) return "StationInventoryActivateSound"; else return false; } /// -Inventory- //////////////////////////////////////////////////////////////// //Function -- setPlayerPosition(%data, %obj, %trigger, %colObj) // %data = Station Data Block // %obj = Station Object // %trigger = Stations trigger // %colObj = Object that is at the station //Decription -- Called when player enters the trigger. Used to set the player // in the center of the station. //////////////////////////////////////////////////////////////////////////////// function StationInventory::setPlayersPosition(%data, %obj, %trigger, %colObj) { %vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0"; if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj)) { %pos = %trigger.position; %colObj.setvelocity("0 0 0"); %rot = getWords(%colObj.getTransform(),3, 6); %colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) @ " " @ getWord(%pos,2) + 0.8 @ " " @ %rot);//center player on object %colObj.setMoveState(true); %colObj.schedule(1600,"setMoveState", false); %colObj.setvelocity("0 0 0"); return true; } return false; } /////////////////////////////////////////////////////////////////////////////// /// -Ammo- //////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// function StationAmmo::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); %obj.setRechargeRate(%obj.getDatablock().rechargeRate); %trigger = new Trigger() { dataBlock = stationTrigger; polyhedron = "-0.75 0.75 0.1 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.3"; }; MissionCleanup.add(%trigger); %trigger.setTransform(%obj.getTransform()); %trigger.station = %obj; %trigger.mainObj = %obj; %trigger.disableObj = %obj; %obj.trigger = %trigger; } //------------------------------------------------------------------------------- function StationAmmo::stationReady(%data, %obj) { //error("StationAmmo::stationReady"); %obj.notReady = 1; %obj.inUse = "Down"; %obj.setThreadDir($ActivateThread, true); %obj.schedule(100, "playThread", $ActivateThread, "activate1"); %player = %obj.triggeredBy; %energy = %player.getEnergyLevel(); //%player.setCloaked(true); //%player.schedule(500, "setCloaked", false); if (!%player.client.isAIControlled()) getAmmoStationLovin(%player.client); //%data.schedule( 500, "beginPersonalInvEffect", %obj ); } //------------------------------------------------------------------------------- function StationAmmo::onEndSequence(%data, %obj, %thread) { if(%thread == $ActivateThread) { %obj.setThreadDir($ActivateThread, false); %obj.playThread( $ActivateThread, "activate1"); if(%obj.inUse $= "Up") { %data.stationReady(%obj); %player = %obj.triggeredBy; if(%data.doesRepair && !%player.stationRepairing && %player.getDamageLevel() != 0) { %oldRate = %player.getRepairRate(); %player.setRepairRate(%oldRate + 0.00625); %player.stationRepairing = 1; } } } //Parent::onEndSequence(%data, %obj, %thread); } //------------------------------------------------------------------------------- function StationAmmo::stationFinished(%data, %obj) { //Hide the Inventory Station GUI } //------------------------------------------------------------------------------- function StationAmmo::getSound(%data, %forward) { if(%forward) return "StationInventoryActivateSound"; else return false; } //------------------------------------------------------------------------------- function StationAmmo::setPlayersPosition(%data, %obj, %trigger, %colObj) { %vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0"; if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj)) { %pos = %trigger.position; %colObj.setvelocity("0 0 0"); %rot = getWords(%colObj.getTransform(),3, 6); %colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) @ " " @ getWord(%pos,2) + 0.8 @ " " @ %rot);//center player on object %colObj.setMoveState(true); %colObj.schedule(1600,"setMoveState", false); %colObj.setvelocity("0 0 0"); return true; } return false; } //////////////////////////////////////////////////////////////////////////////// /// -Vehicle- ////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// -Vehicle- ////////////////////////////////////////////////////////////////// //Function -- onAdd (%this, %obj) // %this = Object data block // %obj = Object being added //Decription -- Called when the object is added to the mission //////////////////////////////////////////////////////////////////////////////// // ----------------------------------------------------------------------------- // z0dd - ZOD - Founder(founder@mechina.com), 5/8/02. Totall re-write of Vehicle // station creation. More stable, addresses some power related bugs. // Do not need this anymore. //function StationVehicle::onAdd(%this, %obj) //{ // Parent::onAdd(%this, %obj); // %obj.setRechargeRate(%obj.getDatablock().rechargeRate); // %trigger = new Trigger() // { // dataBlock = stationTrigger; // polyhedron = "-0.75 0.75 0.0 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.0"; // }; // MissionCleanup.add(%trigger); // %trigger.setTransform(%obj.getTransform()); // %trigger.station = %obj; // %obj.trigger = %trigger; //} // This now creates the vehicle station trigger. function StationVehicle::createTrigger(%this, %obj) { %trigger = new Trigger() { dataBlock = stationTrigger; polyhedron = "-0.75 0.75 0.0 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.0"; }; MissionCleanup.add(%trigger); %trigger.setTransform(%obj.getTransform()); %trigger.station = %obj; %obj.trigger = %trigger; } // End z0dd - ZOD - Founder // ----------------------------------------------------------------------------- /// -Vehicle- ////////////////////////////////////////////////////////////////// //Function -- stationReady(%data, %obj) // %data = Station Data Block // %obj = Station Object //Decription -- Called when station has been triggered and animation is // completed //////////////////////////////////////////////////////////////////////////////// function StationVehicle::stationReady(%data, %obj) { // Make sure none of the other popup huds are active: messageClient( %obj.triggeredBy.client, 'CloseHud', "", 'scoreScreen' ); messageClient( %obj.triggeredBy.client, 'CloseHud', "", 'inventoryScreen' ); //Display the Vehicle Station GUI commandToClient(%obj.triggeredBy.client, 'StationVehicleShowHud'); } /// -Vehicle- ////////////////////////////////////////////////////////////////// //Function -- stationFinished(%data, %obj) // %data = Station Data Block // %obj = Station Object //Decription -- Called when player has left the station //////////////////////////////////////////////////////////////////////////////// function StationVehicle::stationFinished(%data, %obj) { //Hide the Vehicle Station GUI if(!%obj.triggeredBy.isMounted()) commandToClient(%obj.triggeredBy.client, 'StationVehicleHideHud'); else commandToClient(%obj.triggeredBy.client, 'StationVehicleHideJustHud'); } /// -Vehicle- ////////////////////////////////////////////////////////////////// //Function -- getSound(%data, %forward) // %data = Station Data Block // %forward = direction the animation is playing //Decription -- This sound will be played at the same time as the activate // animation. //////////////////////////////////////////////////////////////////////////////// function StationVehicle::getSound(%data, %forward) { if(%forward) return "StationVehicleAcitvateSound"; else return "StationVehicleDeactivateSound"; } /// -Vehicle- ////////////////////////////////////////////////////////////////// //Function -- setPlayerPosition(%data, %obj, %trigger, %colObj) // %data = Station Data Block // %obj = Station Object // %trigger = Stations trigger // %colObj = Object that is at the station //Decription -- Called when player enters the trigger. Used to set the player // in the center of the station. //////////////////////////////////////////////////////////////////////////////// function StationVehicle::setPlayersPosition(%data, %obj, %trigger, %colObj) { %vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0"; if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj)) { %posXY = getWords(%trigger.getTransform(),0 ,1); %posZ = getWord(%trigger.getTransform(), 2); %rotZ = getWord(%obj.getTransform(), 5); %angle = getWord(%obj.getTransform(), 6); %angle += 3.141592654; if(%angle > 6.283185308) %angle = %angle - 6.283185308; %colObj.setvelocity("0 0 0"); %colObj.setTransform(%posXY @ " " @ %posZ + 0.2 @ " " @ "0 0 " @ %rotZ @ " " @ %angle );//center player on object return true; } return false; } // ----------------------------------------------------------------------------- // z0dd - ZOD - Founder(founder@mechina.com), 5/8/02. Totall re-write of Vehicle // station creation. More stable, addresses some power related bugs. function StationVehiclePad::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); %obj.ready = true; %obj.setRechargeRate(%obj.getDatablock().rechargeRate); //------------------------------------------------------------- // All of this moved to StationVehiclePad::createStationVehicle //%xform = %obj.getSlotTransform(0); //%pos = getWords(%xform, 0, 2); //%rot = getWords(%xform, 3, 5); //%angle = (getWord(%xform, 6) * 180) / 3.14159; //%sv = new StaticShape() { // scale = "1 1 1"; // dataBlock = StationVehicle; // lockCount = "0"; // homingCount = "0"; // team = %obj.team; // position = %pos; // rotation = %rot @ " " @ %angle; //}; //MissionCleanup.add(%sv); //%sv.getDataBlock().gainPower(%sv); //%sv.pad = %obj; //%obj.station = %sv; //%sv.trigger.mainObj = %obj; //%sv.trigger.disableObj = %sv; //Remove unwanted vehicles //if(%obj.scoutVehicle !$= "Removed") // %sv.vehicle[scoutvehicle] = true; //if(%obj.assaultVehicle !$= "Removed") // %sv.vehicle[assaultVehicle] = true; //if(%obj.mobileBaseVehicle !$= "Removed") //{ // %sv.vehicle[mobileBasevehicle] = true; //} //if(%obj.scoutFlyer !$= "Removed") // %sv.vehicle[scoutFlyer] = true; //if(%obj.bomberFlyer !$= "Removed") // %sv.vehicle[bomberFlyer] = true; //if(%obj.hapcFlyer !$= "Removed") // %sv.vehicle[hapcFlyer] = true; // z0dd - ZOD - Founder. Schedule the vehicle station creation. // Don't create the station if the pad is hidden by the current mission type. //error("CURRENT MISSION TYPE: " @ $CurrentMissionType @ ", ALLOWED TYPE: " @ %obj.missionTypesList); if($CurrentMissionType $= %obj.missionTypesList || %obj.missionTypesList $="") %this.schedule(0, "createStationVehicle", %obj); } function StationVehiclePad::createStationVehicle(%data, %obj) { // This code used to be called from StationVehiclePad::onAdd // This was changed so we can add the station to the mission group // so it gets powered properly and auto cleaned up at mission end. // Get the v-pads mission group so we can place the station in it. %group = %obj.getGroup(); // Set the default transform based on the vehicle pads slot %xform = %obj.getSlotTransform(0); %position = getWords(%xform, 0, 2); %rotation = getWords(%xform, 3, 5); %angle = (getWord(%xform, 6) * 180) / 3.14159; // Place these parameter's in the v-pad datablock located in mis file. // If the mapper doesn't move the station, use the default location. if(%obj.stationPos $= "" || %obj.stationRot $= "") { %pos = %position; %rot = %rotation @ " " @ %angle; } else { %pos = %obj.stationPos; %rot = %obj.stationRot; } %sv = new StaticShape() { scale = "1 1 1"; dataBlock = "StationVehicle"; lockCount = "0"; homingCount = "0"; team = %obj.team; position = %pos; rotation = %rot; }; // Add the station to the v-pads mission group for cleanup and power. %group.add(%sv); %sv.setPersistent(false); // set the station to not save. // Apparently called to early on mission load done, call it now. %sv.getDataBlock().gainPower(%sv); // Create the trigger %sv.getDataBlock().createTrigger(%sv); %sv.pad = %obj; %obj.station = %sv; %sv.trigger.mainObj = %obj; %sv.trigger.disableObj = %sv; // Set the sensor group. if(%sv.getTarget() != -1) setTargetSensorGroup(%sv.getTarget(), %obj.team); //Remove unwanted vehicles if(%obj.scoutVehicle !$= "Removed") %sv.vehicle[scoutvehicle] = true; if(%obj.assaultVehicle !$= "Removed") %sv.vehicle[assaultVehicle] = true; if(%obj.mobileBaseVehicle !$= "Removed") %sv.vehicle[mobileBasevehicle] = true; if(%obj.scoutFlyer !$= "Removed") %sv.vehicle[scoutFlyer] = true; if(%obj.bomberFlyer !$= "Removed") %sv.vehicle[bomberFlyer] = true; if(%obj.hapcFlyer !$= "Removed") %sv.vehicle[hapcFlyer] = true; } // End z0dd - ZOD - Founder // ----------------------------------------------------------------------------- function StationVehiclePad::onEndSequence(%data, %obj, %thread) { if(%thread == $ActivateThread) { %obj.ready = true; %obj.stopThread($ActivateThread); } Parent::onEndSequence(%data, %obj, %thread); } //////////////////////////////////////////////////////////////////////////////// /// -Mobile Base Inventory- //////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// -Mobile Base- ////////////////////////////////////////////////////////////// //Function -- onAdd (%this, %obj) // %this = Object data block // %obj = Object being added //Decription -- Called when the object is added to the mission //////////////////////////////////////////////////////////////////////////////// function MobileInvStation::onAdd(%this, %obj) { } function MobileInvStation::createTrigger(%this, %obj) { Parent::onAdd(%this, %obj); %obj.setRechargeRate(%obj.getDatablock().rechargeRate); %trigger = new Trigger() { dataBlock = stationTrigger; polyhedron = "-0.75 0.75 0.1 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.3"; }; MissionCleanup.add(%trigger); %trigger.setTransform(%obj.vehicle.getSlotTransform(2)); %trigger.station = %obj; %trigger.mainObj = %obj; %trigger.disableObj = %obj; %obj.trigger = %trigger; // createTarget(%obj, 'Inventory Station', "", "", 'Station', 0, 0); } /// -Mobile Base- ////////////////////////////////////////////////////////////// //Function -- stationReady(%data, %obj) // %data = Station Data Block // %obj = Station Object //Decription -- Called when station has been triggered and animation is // completed //////////////////////////////////////////////////////////////////////////////// function MobileInvStation::stationReady(%data, %obj) { //Display the Inventory Station GUI here %obj.notReady = 1; %obj.inUse = "Down"; %obj.schedule(200,"playThread",$ActivateThread,"activate1"); %obj.getObjectMount().playThread($ActivateThread,"Activate"); %player = %obj.triggeredBy; %energy = %player.getEnergyLevel(); %player.setCloaked(true); %player.schedule(900, "setCloaked", false); if (!%player.client.isAIControlled()) buyFavorites(%player.client); %player.setEnergyLevel(%energy); } /// -Mobile Base- ////////////////////////////////////////////////////////////// //Function -- stationFinished(%data, %obj) // %data = Station Data Block // %obj = Station Object //Decription -- Called when player has left the station //////////////////////////////////////////////////////////////////////////////// function MobileInvStation::stationFinished(%data, %obj) { //Hide the Inventory Station GUI } /// -Mobile Base- ////////////////////////////////////////////////////////////// //Function -- getSound(%data, %forward) // %data = Station Data Block // %forward = direction the animation is playing //Decription -- This sound will be played at the same time as the activate // animation. //////////////////////////////////////////////////////////////////////////////// function MobileInvStation::getSound(%data, %forward) { if(%forward) return "MobileBaseInventoryActivateSound"; else return false; } /// -Mobile Base- ////////////////////////////////////////////////////////////// //Function -- setPlayerPosition(%data, %obj, %trigger, %colObj) // %data = Station Data Block // %obj = Station Object // %trigger = Stations trigger // %colObj = Object that is at the station //Decription -- Called when player enters the trigger. Used to set the player // in the center of the station. //////////////////////////////////////////////////////////////////////////////// function MobileInvStation::setPlayersPosition(%data, %obj, %trigger, %colObj) { %vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0"; if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj)) { %pos = %trigger.position; %colObj.setvelocity("0 0 0"); %rot = getWords(%colObj.getTransform(),3, 6); // %colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) - 0.75 @ " " @ getWord(%pos,2)+0.7 @ " " @ %rot);//center player on object %colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) @ " " @ getWord(%pos,2)+0.8 @ " " @ %rot);//center player on object %colObj.setMoveState(true); %colObj.schedule(1600,"setMoveState", false); %colObj.setvelocity("0 0 0"); return true; } return false; } function MobileInvStation::onDamage() { } function MobileInvStation::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) { //If vehicle station is hit then apply damage to the vehicle %targetObject.getObjectMount().damage(%sourceObject, %position, %amount, %damageType); } //////////////////////////////////////////////////////////////////////////////// /// -Station Trigger- ////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// ////-Station Trigger-/////////////////////////////////////////////////////////// //Function -- onEnterTrigger (%data, %obj, %colObj) // %data = Trigger Data Block // %obj = Trigger Object // %colObj = Object that collided with the trigger //Decription -- Called when trigger has been triggered //////////////////////////////////////////////////////////////////////////////// function stationTrigger::onEnterTrigger(%data, %obj, %colObj) { //make sure it's a player object, and that that object is still alive if(%colObj.getDataBlock().className !$= "Armor" || %colObj.getState() $= "Dead") return; %colObj.inStation = true; commandToClient(%colObj.client,'setStationKeys', true); if(Game.stationOnEnterTrigger(%data, %obj, %colObj)) { //verify station.team is team associated and isn't on player's team if((%obj.mainObj.team != %colObj.client.team) && (%obj.mainObj.team != 0)) { //%obj.station.playAudio(2, StationAccessDeniedSound); messageClient(%colObj.client, 'msgStationDenied', '\c2Access Denied -- Wrong team.~wfx/powered/station_denied.wav'); } else if(%obj.disableObj.isDisabled()) { messageClient(%colObj.client, 'msgStationDisabled', '\c2Station is disabled.'); } else if(!%obj.mainObj.isPowered()) { messageClient(%colObj.client, 'msgStationNoPower', '\c2Station is not powered.'); } else if(%obj.station.notDeployed) { messageClient(%colObj.client, 'msgStationNotDeployed', '\c2Station is not deployed.'); } else if(%obj.station.triggeredBy $= "") { if(%obj.station.getDataBlock().setPlayersPosition(%obj.station, %obj, %colObj)) { messageClient(%colObj.client, 'CloseHud', "", 'inventoryScreen'); commandToClient(%colObj.client, 'TogglePlayHuds', true); %obj.station.triggeredBy = %colObj; %obj.station.getDataBlock().stationTriggered(%obj.station, 1); %colObj.station = %obj.station; %colObj.lastWeapon = ( %colObj.getMountedImage($WeaponSlot) == 0 ) ? "" : %colObj.getMountedImage($WeaponSlot).getName().item; %colObj.unmountImage($WeaponSlot); } } } } ////-Station Trigger-/////////////////////////////////////////////////////////// //Function -- onLeaveTrigger (%data, %obj, %colObj) // %data = Trigger Data Block // %obj = Trigger Object // %colObj = Object that collided with the trigger //Decription -- Called when trigger has been untriggered //////////////////////////////////////////////////////////////////////////////// function stationTrigger::onLeaveTrigger(%data, %obj, %colObj) { if(%colObj.getDataBlock().className !$= "Armor") return; %colObj.inStation = false; commandToClient(%colObj.client,'setStationKeys', false); if(%obj.station) { if(%obj.station.triggeredBy == %colObj) { %obj.station.getDataBlock().stationFinished(%obj.station); %obj.station.getDataBlock().endRepairing(%obj.station); %obj.station.triggeredBy = ""; %obj.station.getDataBlock().stationTriggered(%obj.station, 0); if(!%colObj.teleporting) %colObj.station = ""; if(%colObj.getMountedImage($WeaponSlot) == 0 && !%colObj.teleporting) { if(%colObj.inv[%colObj.lastWeapon]) %colObj.use(%colObj.lastWeapon); if(%colObj.getMountedImage($WeaponSlot) == 0) %colObj.selectWeaponSlot( 0 ); } } } } ////-Station Trigger-/////////////////////////////////////////////////////////// //Function -- stationTriggered(%data, %obj, %isTriggered) // %data = Station Data Block // %obj = Station Object // %isTriggered = 1 if triggered; 0 if status changed to // untriggered //Decription -- Called when a "station trigger" has been triggered or // untriggered //////////////////////////////////////////////////////////////////////////////// function Station::stationTriggered(%data, %obj, %isTriggered) { if(%isTriggered) { %obj.setThreadDir($ActivateThread, TRUE); %obj.playThread($ActivateThread,"activate"); %obj.playAudio($ActivateSound, %data.getSound(true)); %obj.inUse = "Up"; } else { if(%obj.getDataBlock().getName() !$= StationVehicle) { %obj.stopThread($ActivateThread); if(%obj.getObjectMount()) %obj.getObjectMount().stopThread($ActivateThread); %obj.inUse = "Down"; } else { %obj.setThreadDir($ActivateThread, FALSE); %obj.playThread($ActivateThread,"activate"); %obj.playAudio($ActivateSound, %data.getSound(false)); %obj.inUse = "Down"; } } } ////-Station-/////////////////////////////////////////////////////////////////// //Function -- onEndSequence(%data, %obj, %thread) // %data = Station Data Block // %obj = Station Object // %thread = Thread number that the animation is associated // with / running on. //Decription -- Called when an animation sequence is finished playing //////////////////////////////////////////////////////////////////////////////// function Station::onEndSequence(%data, %obj, %thread) { if(%thread == $ActivateThread) { if(%obj.inUse $= "Up") { %data.stationReady(%obj); %player = %obj.triggeredBy; if(%data.doesRepair && !%player.stationRepairing && %player.getDamageLevel() != 0) { %oldRate = %player.getRepairRate(); %player.setRepairRate(%oldRate + 0.00625); %player.stationRepairing = 1; } } else { if(%obj.getDataBlock().getName() !$= MobileInvStation) { %obj.stopThread($ActivateThread); %obj.inUse = "Down"; } } } Parent::onEndSequence(%data, %obj, %thread); } ////-Station-/////////////////////////////////////////////////////////////////// //Function -- onCollision(%data, %obj, %colObj) // %data = Station Data Block // %obj = Station Object // %colObj = Object that collided with the station //Decription -- Called when an object collides with a station //////////////////////////////////////////////////////////////////////////////// function Station::onCollision(%data, %obj, %colObj) { // Currently Not Needed } ////-Station-/////////////////////////////////////////////////////////////////// //Function -- endRepairing(%data, %obj) // %data = Station Data Block // %obj = Station Object //Decription -- Called to stop repairing the object //////////////////////////////////////////////////////////////////////////////// function Station::endRepairing(%data, %obj) { if(%obj.triggeredBy.stationRepairing) { %oldRate = %obj.triggeredBy.getRepairRate(); %obj.triggeredBy.setRepairRate(%oldRate - 0.00625); %obj.triggeredBy.stationRepairing = 0; } } ////-Station Trigger-/////////////////////////////////////////////////////////// //Function -- onTickTrigger(%data, %obj) // %data = Trigger Data Block // %obj = Trigger Object //Decription -- Called every tick if triggered //////////////////////////////////////////////////////////////////////////////// function stationTrigger::onTickTrigger(%data, %obj) { } //****************************************************************************** //* Station General - Functions * //****************************************************************************** //function Station::onGainPowerEnabled(%data, %obj) function Station::onLosePowerDisabled(%data, %obj) { Parent::onLosePowerDisabled(%data, %obj); // check to see if a player was using this station %occupied = %obj.triggeredBy; if(%occupied > 0) { if(%data.doesRepair) %data.endRepairing(%obj); // if it's a deployed station, stop "flashing panels" thread if(%data.getName() $= DeployedStationInventory) %obj.stopThread($ActivateThread); // reset some attributes %occupied.setCloaked(false); %occupied.station = ""; %occupied.inStation = false; %obj.triggeredBy = ""; // restore "toggle inventory hud" key commandToClient(%occupied.client,'setStationKeys', false); // re-mount last weapon or weapon slot 0 if(%occupied.getMountedImage($WeaponSlot) == 0) { // ---------------------------------------------- // z0dd - ZOD, 5/8/02. Optimized. //if(%occupied.inv[%occupied.lastWeapon]) // %occupied.use(%occupied.lastWeapon); //if(%occupied.getMountedImage($WeaponSlot) == 0) // %occupied.selectWeaponSlot( 0 ); if(%occupied.inv[%occupied.lastWeapon]) %occupied.use(%occupied.lastWeapon); else %occupied.selectWeaponSlot( 0 ); // End z0dd - ZOD // ---------------------------------------------- } } } // ----------------------------------------------------------------------------- // z0dd - ZOD - Founder(founder@mechina.com), 5/8/02. Totall re-write of Vehicle // station creation. More stable, addresses some power related bugs. // These are not needed anymore. //function StationVehiclePad::gainPower(%data, %obj) //{ // %obj.station.setSelfPowered(); // Parent::gainPower(%data, %obj); //} //function StationVehiclePad::losePower(%data, %obj) //{ // %obj.station.clearSelfPowered(); // Parent::losePower(%data, %obj); //} // End z0dd - ZOD - Founder // ----------------------------------------------------------------------------- //--------------------------------------------------------------------------- // DeployedStationInventory: //--------------------------------------------------------------------------- function DeployedStationInventory::stationReady(%data, %obj) { %obj.notReady = 1; %player = %obj.triggeredBy; %obj.playThread($ActivateThread,"activate1"); // function below found in inventoryHud.cs if (!%player.client.isAIControlled()) buyDeployableFavorites(%player.client); } function DeployedStationInventory::stationFinished(%data, %obj) { } function DeployedStationInventory::setPlayersPosition(%data, %obj, %trigger, %colObj) { %vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0"; if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj)) { // build offset for player position %rot = getWords(%obj.getTransform(), 3, 6); %colObj.setTransform( getWords(%colObj.getTransform(),0,2) @ " " @ %rot ); %colObj.setvelocity("0 0 0"); %colObj.setMoveState(true); %colObj.schedule(1600,"setMoveState", false); return true; } return false; } function DeployedStationInventory::onDestroyed(%data, %obj, %prevState) { %obj.trigger.delete(); // decrement team deployed count for this item $TeamDeployedCount[%obj.team, InventoryDeployable]--; // when a station is destroyed, we don't need its trigger any more %obj.schedule(700, "delete"); Parent::onDestroyed(%data, %obj, %prevState); } /// -Deployable Inventory- ////////////////////////////////////////////////////////////// //Function -- getSound(%data, %forward) // %data = Station Data Block // %forward = direction the animation is playing //Decription -- This sound will be played at the same time as the activate // animation. //////////////////////////////////////////////////////////////////////////////// function DeployedStationInventory::getSound(%data, %forward) { if(%forward) return "DepInvActivateSound"; else return false; } PK !(scripts/stationSetInv.csfunction LightMaleHumanArmor::stationSetInv(%data, %player) { %saveImage = %player.getMountedImage($WeaponSlot); %player.clearInventory(); %player.client.setWeaponsHudClearAll(); %player.setInventory(RepairKit,1); %player.setInventory(Mine,3); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(GrenadeLauncherAmmo, 25); %player.setInventory(PlasmaAmmo,20); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.use(%saveImage.Item); } function MediumMaleHumanArmor::stationSetInv(%data, %player) { %saveImage = %player.getMountedImage($WeaponSlot); %player.clearInventory(); %player.client.setWeaponsHudClearAll(); %player.setInventory(RepairKit,1); %player.setInventory(Mine,3); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(MissileLauncher, 1); %player.setInventory(MissileLauncherAmmo, 10); %player.setInventory(GrenadeLauncherAmmo, 25); %player.setInventory(PlasmaAmmo,20); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.use(%saveImage.Item); } function HeavyMaleHumanArmor::stationSetInv(%data, %player) { %saveImage = %player.getMountedImage($WeaponSlot); %player.clearInventory(); %player.client.setWeaponsHudClearAll(); %player.setInventory(RepairKit,1); %player.setInventory(Mine,3); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(Mortar, 1); %player.setInventory(MortarAmmo, 15); %player.setInventory(GrenadeLauncherAmmo, 25); %player.setInventory(PlasmaAmmo,20); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.use(%saveImage.Item); } function LightFemaleHumanArmor::stationSetInv(%data, %player) { %saveImage = %player.getMountedImage($WeaponSlot); %player.clearInventory(); %player.client.setWeaponsHudClearAll(); %player.setInventory(RepairKit,1); %player.setInventory(Mine,3); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(GrenadeLauncherAmmo, 25); %player.setInventory(PlasmaAmmo,20); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.use(%saveImage.Item); } function MediumFemaleHumanArmor::stationSetInv(%data, %player) { %saveImage = %player.getMountedImage($WeaponSlot); %player.clearInventory(); %player.client.setWeaponsHudClearAll(); %player.setInventory(RepairKit,1); %player.setInventory(Mine,3); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(MissileLauncher, 1); %player.setInventory(MissileLauncherAmmo, 10); %player.setInventory(GrenadeLauncherAmmo, 25); %player.setInventory(PlasmaAmmo,20); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.use(%saveImage.Item); } function HeavyFemaleHumanArmor::stationSetInv(%data, %player) { %saveImage = %player.getMountedImage($WeaponSlot); %player.clearInventory(); %player.client.setWeaponsHudClearAll(); %player.setInventory(RepairKit,1); %player.setInventory(Mine,3); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(Mortar, 1); %player.setInventory(MortarAmmo, 15); %player.setInventory(GrenadeLauncherAmmo, 25); %player.setInventory(PlasmaAmmo,20); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.use(%saveImage.Item); } function LightMaleBiodermArmor::stationSetInv(%data, %player) { %saveImage = %player.getMountedImage($WeaponSlot); %player.clearInventory(); %player.client.setWeaponsHudClearAll(); %player.setInventory(RepairKit,1); %player.setInventory(Mine,3); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(GrenadeLauncherAmmo, 25); %player.setInventory(PlasmaAmmo,20); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.use(%saveImage.Item); } function MediumMaleBiodermArmor::stationSetInv(%data, %player) { %saveImage = %player.getMountedImage($WeaponSlot); %player.clearInventory(); %player.client.setWeaponsHudClearAll(); %player.setInventory(RepairKit,1); %player.setInventory(Mine,3); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(MissileLauncher, 1); %player.setInventory(MissileLauncherAmmo, 10); %player.setInventory(GrenadeLauncherAmmo, 25); %player.setInventory(PlasmaAmmo,20); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.use(%saveImage.Item); } function HeavyMaleBiodermArmor::stationSetInv(%data, %player) { %saveImage = %player.getMountedImage($WeaponSlot); %player.clearInventory(); %player.client.setWeaponsHudClearAll(); %player.setInventory(RepairKit,1); %player.setInventory(Mine,3); %player.setInventory(Grenade,6); %player.setInventory(Blaster,1); %player.setInventory(Plasma,1); %player.setInventory(Disc,1); %player.setInventory(Chaingun, 1); %player.setInventory(GrenadeLauncher, 1); %player.setInventory(Mortar, 1); %player.setInventory(MortarAmmo, 15); %player.setInventory(GrenadeLauncherAmmo, 25); %player.setInventory(PlasmaAmmo,20); %player.setInventory(ChaingunAmmo, 100); %player.setInventory(DiscAmmo, 20); %player.use(%saveImage.Item); } PK !(i72rrscripts/targetManager.cs//-------------------------------------------------------------------------- // helper function for creating targets function createTarget(%obj, %nameTag, %skinTag, %voiceTag, %typeTag, %sensorGroup, %voicePitch) { if (%voicePitch $= "" || %voicePitch == 0) %voicePitch = 1.0; %data = (%obj.getType() & $TypeMasks::ShapeBaseObjectType) ? %obj.getDataBlock() : 0; %target = allocTarget(%nameTag, %skinTag, %voiceTag, %typeTag, %sensorGroup, %data, %voicePitch); %obj.setTarget(%target); return(%target); } //-------------------------------------------------------------------------- // useful for when a client switches teams or joins the game function clientResetTargets(%client, %tasksOnly) { if(%client.isAiControlled()) return; // remove just tasks or everything? resetClientTargets(%client, %tasksOnly); // notify the client to cleanup the gui... commandToClient(%client, 'ResetTaskList'); } //-------------------------------------------------------------------------- // useful at end of missions function resetTargetManager() { %count = ClientGroup.getCount(); // clear the lookup table for(%cl = 0; %cl < %count; %cl++) { %client = ClientGroup.getObject(%cl); $TargetToClient[%client.target] = ""; } // reset all the targets on all the connections resetTargets(); // create targets for all the clients for(%cl = 0; %cl < %count; %cl++) { %client = ClientGroup.getObject(%cl); if(!%client.isAiControlled()) commandToClient(%client, 'ResetTaskList'); // reset the clients target and update the lookup table %client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch); } } //-------------------------------------------------------------------------- // wrap the client targets to maintain a lookup table on the server function allocClientTarget(%client, %nameTag, %skinTag, %voiceTag, %typeTag, %sensorGroup, %datablock, %voicePitch) { if (%voicePitch $= "" || %voicePitch == 0) %voicePitch = 1.0; echo("allocating client target - skin = " @ getTaggedString(%skinTag)); %target = allocTarget(%nameTag, %skinTag, %voiceTag, %typeTag, %sensorGroup, %datablock, %voicePitch, %skinTag); // first bit is the triangle setTargetRenderMask(%target, (1 << $TargetInfo::HudRenderStart)); $TargetToClient[%target] = %client; return(%target); } function freeClientTarget(%client) { $TargetToClient[%client.target] = ""; freeTarget(%client.target); } //-------------------------------------------------------------------------- function ClientTarget::onAdd(%this, %type) { %this.client = TaskList.currentTaskClient; %this.AIObjective = TaskList.currentAIObjective; %this.team = TaskList.currentTaskIsTeam; %this.description = TaskList.currentTaskDescription; %player = $PlayerList[%this.client]; %this.clientName = %player ? %player.name : "[Unknown]"; switch$(%type) { case "AssignedTask": TaskList.currentTask = %this; %this.setText(%this.description); case "PotentialTask": // add to the task list and display a message TaskList.addTask(%this, %this.clientName, detag(%this.description)); %this.setText(%this.description); } } function ClientTarget::onDie(%this, %type) { // if this target is not removed from its current group then it will be // deleted on return of this call switch$(%type) { case "AssignedTask": // let it die TaskList.currentTask = -1; case "PotentialTask": TaskList.handleDyingTask(%this); } } //-------------------------------------------------------------------------- // debug: useless if not compiled debug //-------------------------------------------------------------------------- function displayTargetManagerInfo() { if(!isObject(TargetManagerInfoDlg)) { new GuiControl(TargetManagerInfoDlg) { profile = "GuiModelessDialogProfile"; open = false; new GuiWindowCtrl(TargetManagerInfoWindow) { profile = "GuiWindowProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "0 100"; extent = "600 300"; canMove = true; canClose = true; resizeWidth = true; resizeHeight = true; canMinimize = true; canMaximize = true; new GuiScrollCtrl() { profile = "GuiScrollCtrlProfile"; position = "4 20"; extent = "592 276"; hScrollBar = "alwaysOff"; vScrollBar = "alwaysOn"; horizSizing = "width"; vertSizing = "height"; new GuiScrollContentCtrl() { profile = "GuiScrollContentProfile"; position = "0 0"; extent = "576 276"; horizSizing = "width"; vertSizing = "height"; new GuiTargetManagerListCtrl(TargetManagerInfo) { profile = "GuiTextArrayProfile"; position = "0 0"; extent = "10 10"; horizSizing = "width"; vertSizing = "height"; clipColumnText = true; }; }; }; }; }; } toggleTheWindow(true); } function toggleTheWindow(%val) { if(!%val) return; if(TargetManagerInfoDlg.open) Canvas.popDialog(TargetManagerInfoDlg); else Canvas.pushDialog(TargetManagerInfoDlg, 98); } function toggleTheMouse(%val) { if(!%val) return; toggleMouse(); } function toggleTheClient(%val) { if(!%val) return; TargetManagerInfo.serverTargets = !TargetManagerInfo.serverTargets; TargetManagerInfoDlg.updateWindowText(); } function TargetManagerInfoDlg::updateWindowText() { if(TargetManagerInfo.serverTargets) TargetManagerInfoWindow.setText("Target Manager Info: "); else TargetManagerInfoWindow.setText("Target Manager Info: "); } function TargetManagerInfoDlg::onWake(%this) { %this.open = true; TargetManagerInfo.columns = "0 20 120 200 240 280 320 360 420 480 530 580 630 680"; GlobalActionMap.bind(keyboard, j, toggleTheWindow); GlobalActionMap.bind(keyboard, k, toggleTheMouse); GlobalActionMap.bind(keyboard, l, toggleTheClient); %this.updateWindowText(); } function TargetManagerInfoDlg::onSleep(%this) { %this.open = false; GlobalActionMap.unbind(keyboard, k); GlobalActionMap.unbind(keyboard, l); }PK !(@>scripts/trigger.cs//-------------------------------------------------------------------------- // Trigger functions and datablocks... // // //-------------------------------------------------------------------------- datablock TriggerData(defaultTrigger) { tickPeriodMS = 200; }; datablock TriggerData(hairTrigger) { tickPeriodMS = 30; }; datablock TriggerData(slowTrigger) { tickPeriodMS = 1000; }; datablock TriggerData(stationTrigger) { tickPeriodMS = 30; }; datablock TriggerData(gameTrigger) { tickPeriodMS = 50; }; datablock TriggerData(markerTrigger) { tickPeriodMS = 100000; }; //-------------------------------------------------------------------------- datablock TriggerData(defaultTeamTrigger) { tickPeriodMS = 200; }; function defaultTeamTrigger::onEnterTrigger(%this, %trigger, %triggeringObject) { %group = %trigger.getGroup(); if (!%group) return; for (%i = 0; %i < %group.getCount(); %i++) { %object = %group.getObject(%i); if (%triggeringObject.team == %trigger.team) %object.onTrigger(%trigger, 1); } } function defaultTeamTrigger::onLeaveTrigger(%this, %trigger, %triggeringObject) { %group = %trigger.getGroup(); if (!%group) return; for (%i = 0; %i < %group.getCount(); %i++) { %object = %group.getObject(%i); if (%triggeringObject.team == %trigger.team) %object.onTrigger(%trigger, 0); } } function defaultTeamTrigger::onTickTrigger(%this, %trigger) { %group = %trigger.getGroup(); if (!%group) return; %tick = false; for (%i = 0; %i < %trigger.getNumObjects(); %i++) { if (%trigger.getObject(%i).team == %trigger.team) { %tick = true; break; } } if (%tick == true) { for (%i = 0; %i < %group.getCount(); %i++) { %object = %group.getObject(%i); %object.onTriggerTick(%trigger); } } } //****************************************************************************** //* Game Trigger - Functions * //****************************************************************************** /// -Trigger- ////////////////////////////////////////////////////////////////// //Function -- onEnterTrigger (%data, %obj, %colObj) // %data = Trigger Data Block // %obj = Trigger Object // %colObj = Object that collided with the trigger //Decription -- Called when trigger has been triggered //////////////////////////////////////////////////////////////////////////////// function gameTrigger::onEnterTrigger(%data, %obj, %colObj) { Game.onEnterTrigger(%obj.name, %data, %obj, %colObj); } /// -Trigger- ////////////////////////////////////////////////////////////////// //Function -- onLeaveTrigger (%data, %obj, %colObj) // %data = Trigger Data Block // %obj = Trigger Object // %colObj = Object that collided with the trigger //Decription -- Called when trigger has been untriggered //////////////////////////////////////////////////////////////////////////////// function gameTrigger::onLeaveTrigger(%data, %obj, %colObj) { Game.onLeaveTrigger(%obj.name, %data, %obj, %colObj); } /// -Trigger- ////////////////////////////////////////////////////////////////// //Function -- onTickTrigger(%data, %obj) // %data = Trigger Data Block // %obj = Trigger Object //Decription -- Called every tick if triggered //////////////////////////////////////////////////////////////////////////////// function gameTrigger::onTickTrigger(%data, %obj) { Game.onTickTrigger(%obj.name, %data, %obj); }PK !(2%%%scripts/turret.cs// sounds and effects /////////////////////// datablock EffectProfile(DeployableExplosionEffect) { effectname = "explosions/explosion.xpl10"; minDistance = 10; maxDistance = 50; }; datablock AudioProfile(DeployablesExplosionSound) { filename = "fx/explosions/deployables_explosion.wav"; description = AudioExplosion3d; preload = true; effect = DeployableExplosionEffect; }; //-------------------------------------------------------------------------- // Shockwave //-------------------------------------------------------------------------- datablock ShockwaveData(TurretShockwave) { width = 6.0; numSegments = 20; numVertSegments = 2; velocity = 8; acceleration = 20.0; lifetimeMS = 1500; height = 1.0; verticalCurve = 0.5; mapToTerrain = false; renderBottom = true; texture[0] = "special/shockwave4"; texture[1] = "special/gradient"; texWrap = 6.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; colors[0] = "0.8 0.8 0.8 1.00"; colors[1] = "0.8 0.5 0.2 0.20"; colors[2] = "1.0 0.5 0.5 0.0"; }; //-------------------------------------------------------------------------- // Explosion //-------------------------------------------------------------------------- datablock ExplosionData(TurretExplosion) { explosionShape = "effect_plasma_explosion.dts"; soundProfile = ShapeExplosionSound; faceViewer = true; shockwave = TurretShockwave; }; datablock ExplosionData(SmallTurretExplosion) { soundProfile = DeployablesExplosionSound; faceViewer = true; explosionShape = "effect_plasma_explosion.dts"; sizes[0] = "0.3 0.3 0.3"; sizes[1] = "0.3 0.3 0.3"; times[0] = 0; times[1] = 1; }; //-------------------------------------------------------------------------- // Turret Debris //-------------------------------------------------------------------------- datablock DebrisData( TurretDebris ) { explodeOnMaxBounce = false; elasticity = 0.20; friction = 0.5; lifetime = 17.0; lifetimeVariance = 0.0; minSpinSpeed = 60; maxSpinSpeed = 600; numBounces = 10; bounceVariance = 0; staticOnMaxBounce = true; useRadiusMass = true; baseRadius = 0.4; velocity = 9.0; velocityVariance = 4.5; }; datablock DebrisData( TurretDebrisSmall ) { explodeOnMaxBounce = false; elasticity = 0.20; friction = 0.5; lifetime = 17.0; lifetimeVariance = 0.0; minSpinSpeed = 60; maxSpinSpeed = 600; numBounces = 10; bounceVariance = 0; staticOnMaxBounce = true; useRadiusMass = true; baseRadius = 0.2; velocity = 5.0; velocityVariance = 2.5; }; //-------------------------------------------------------------------------- // Turret base class functionality. Barrels are in scripts/weapons/*.cs // // //-------------------------------------------------------------------------- function TurretData::create(%block) { %obj = new Turret() { dataBlock = %block; }; return %obj; } datablock SensorData(TurretBaseSensorObj) { detects = true; detectsUsingLOS = true; detectsPassiveJammed = false; detectsActiveJammed = false; detectsCloaked = false; detectionPings = true; detectRadius = 80; }; datablock TurretData(TurretBaseLarge) : TurretDamageProfile { className = TurretBase; catagory = "Turrets"; shapeFile = "turret_base_large.dts"; preload = true; mass = 1.0; // Not really relevant maxDamage = 2.25; destroyedLevel = 2.25; disabledLevel = 1.35; explosion = TurretExplosion; expDmgRadius = 15.0; expDamage = 0.66; expImpulse = 2000.0; repairRate = 0; emap = true; thetaMin = 15; thetaMax = 140; isShielded = true; energyPerDamagePoint = 50; maxEnergy = 150; rechargeRate = 0.31; humSound = SensorHumSound; pausePowerThread = true; canControl = true; cmdCategory = "Tactical"; cmdIcon = CMDTurretIcon; cmdMiniIconName = "commander/MiniIcons/com_turretbase_grey"; targetNameTag = 'Base'; targetTypeTag = 'Turret'; sensorData = TurretBaseSensorObj; sensorRadius = TurretBaseSensorObj.detectRadius; sensorColor = "0 212 45"; firstPersonOnly = true; debrisShapeName = "debris_generic.dts"; debris = TurretDebris; }; function TurretData::onGainPowerEnabled(%data, %obj) { Parent::onGainPowerEnabled(%data, %obj); setTargetSensorData(%obj.target, %data.sensorData); } function TurretData::onLosePowerDisabled(%data, %obj) { // Must kick players out of turret Parent::onLosePowerDisabled(%data, %obj); %obj.clearTarget(); setTargetSensorData(%obj.target, 0); } function TurretData::selectTarget(%this, %turret) { %turretTarg = %turret.getTarget(); if(%turretTarg == -1) return; // if the turret isn't on a team, don't fire at anyone if(getTargetSensorGroup(%turretTarg) == 0) { %turret.clearTarget(); return; } // stop firing if turret is disabled or if it needs power and isn't powered if((!%turret.isPowered()) && (!%turret.needsNoPower)) { %turret.clearTarget(); return; } %TargetSearchMask = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType; InitContainerRadiusSearch(%turret.getMuzzlePoint(0), %turret.getMountedImage(0).attackRadius, %TargetSearchMask); while ((%potentialTarget = ContainerSearchNext()) != 0) { %potTargTarg = %potentialTarget.getTarget(); if (%turret.isValidTarget(%potentialTarget) && (getTargetSensorGroup(%turretTarg) != getTargetSensorGroup(%potTargTarg))) { %turret.setTargetObject(%potentialTarget); return; } } } function TurretData::replaceCallback(%this, %turret, %engineer) { // This is a valid replacement. First, let's see if the engineer // still has the correct pack in place... if (%engineer.getMountedImage($BackPackSlot) != 0) { %barrel = %engineer.getMountedImage($BackPackSlot).turretBarrel; if (%barrel !$= "") { // if there was a barrel there before, get rid of it %turret.unmountImage(0); // remove the turret barrel pack %engineer.setInventory(%engineer.getMountedImage($BackPackSlot).item, 0); // mount new barrel on base %turret.mountImage(%barrel, 0, false); } else { // Player doesn't have the correct pack on... } } else { // Player doesn't have any pack on... } } function TurretData::onDestroyed(%this, %turret, %prevState) { if( isObject( %turret.lastProjectile ) ) %turret.lastProjectile.delete(); Parent::onDestroyed(%this, %turret, %prevState); } function checkTurretMount(%data, %obj, %slot) { // search for a turret base in player's LOS %eyeVec = VectorNormalize(%obj.getEyeVector()); %srchRange = VectorScale(%eyeVec, 5.0); // look 5m for a turret base %plTm = %obj.getEyeTransform(); %plyrLoc = firstWord(%plTm) @ " " @ getWord(%plTm, 1) @ " " @ getWord(%plTm, 2); %srchEnd = VectorAdd(%plyrLoc, %srchRange); %potTurret = ContainerRayCast(%obj.getEyeTransform(), %srchEnd, $TypeMasks::TurretObjectType); if(%potTurret != 0) { %otherMountObj = "foo"; if(%potTurret.getDatablock().getName() $= "TurretBaseLarge" || %potTurret.getDatablock().getName() $= %otherMountObj) { // found a turret base, what team is it on? if(%potTurret.team == %obj.client.team) { if(%potTurret.getDamageState() !$= "Enabled") { // the base is destroyed messageClient(%obj.client, 'MsgBaseDestroyed', "\c2Turret base is disabled, cannot mount barrel."); %obj.setImageTrigger($BackpackSlot, false); } else { // it's a functional turret base on our team! stick the barrel on it messageClient(%obj.client, 'MsgTurretMount', "\c2Mounting barrel pack on turret base."); serverPlay3D(TurretPackActivateSound, %potTurret.getTransform()); %potTurret.initiateBarrelSwap(%obj); } } else { // whoops, wrong team messageClient(%obj.client, 'MsgTryEnemyTurretMount', "\c2Cannot mount a barrel on an enemy turret base!"); %obj.setImageTrigger($BackpackSlot, false); } } else { // tried to mount barrel on some other turret type messageClient(%obj.client, 'MsgNotTurretBase', "\c2Can only mount a barrel on a turret base."); %obj.setImageTrigger($BackpackSlot, false); } } else { // I don't see any turret messageClient(%obj.client, 'MsgNoTurretBase', "\c2No turret within range."); %obj.setImageTrigger($BackpackSlot, false); } } //-------------------------------------- Load Barrel Images // exec("scripts/turrets/mortarBarrelLarge.cs"); exec("scripts/turrets/aaBarrelLarge.cs"); exec("scripts/turrets/missileBarrelLarge.cs"); exec("scripts/turrets/plasmaBarrelLarge.cs"); exec("scripts/turrets/ELFBarrelLarge.cs"); exec("scripts/turrets/outdoorDeployableBarrel.cs"); exec("scripts/turrets/indoorDeployableBarrel.cs"); exec("scripts/turrets/sentryTurret.cs");PK !(\ $voiceLines) return; %openLine = -1; for(%i = 0; %i < $voiceLines; %i++) { if($voiceComm[%i] <= 0) { %openLine = %i; break; } } if(%openLine != -1) { $voiceComm[%openLine] = %client; if(%success) addGreenVoiceLine(%client, %openLine); else addRedVoiceLine(%client, %openLine); $numTalking++; resizeVoiceCommWindow(); if(!(voiceCommHud.isVisible())) voiceCommHud.setVisible(true); } } //------------------------------------------------------------------------------ function clientCmdPlayerStoppedTalking(%client, %success) { %doneLine = -1; for(%i = 0; %i < $voiceLines; %i++) { if($voiceComm[%i] == %client) { %doneLine = %i; break; } } if(%doneLine != -1) %rmSuccess = removeVoiceLine(%doneLine); } //------------------------------------------------------------------------------ function addGreenVoiceLine(%client, %line) { %name = "Unknown client"; %player = $PlayerList[%client]; if(%player) %name = %player.name; %speakLine = new GuiControl("VCH"@%line) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "2 " @ (%line + 1) * 15; extent = "160 15"; visible = true; new GuiBitmapCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; bitmap = "gui/hud_chat_button_on"; position = "0 0"; extent = "15 15"; visible = true; }; new GuiTextCtrl() { profile = "GuiVoiceGreenProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 0"; extent = "140 15"; text = %name; visible = true; }; }; voiceCommHud.add(%speakLine); schedule($voiceLineTimeout, 0, "removeVoiceLine", %line); } //------------------------------------------------------------------------------ function addRedVoiceLine(%client, %line) { %name = "Unknown client"; %player = $PlayerList[%client]; if(%player) %name = %player.name; %speakLine = new GuiControl("VCH"@%line) { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 " @ (%line + 1) * 15; extent = "150 15"; visible = true; new GuiBitmapCtrl() { profile = "GuiDefaultProfile"; horizSizing = "right"; vertSizing = "bottom"; bitmap = "gui/hud_chat_button_off"; position = "0 0"; extent = "15 15"; visible = true; }; new GuiTextCtrl() { profile = "GuiVoiceGreenProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "20 0"; extent = "125 15"; text = %name; visible = true; }; }; voiceCommHud.add(%speakLine); schedule($voiceLineTimeout, 0, "removeVoiceLine", %line); } //------------------------------------------------------------------------------ function removeVoiceLine(%line) { %killIt = nameToID("VCH" @ %line); $voiceComm[%line] = 0; if(%killIt == -1) { //error("Could not find control VCH" @ %line @ " !!!!"); return 0; } else { //error("Removing voice line " @ %line); %killIt.delete(); $voiceComm[%line] = 0; $numTalking--; if($numTalking < 1) voiceCommHud.setVisible(false); resizeVoiceCommWindow(); return 1; } } function resizeVoiceCommWindow() { %lastLine = -1; for(%i = 0; %i < $voiceLines; %i++) { if($voiceComm[%i] > 0) %lastLine = %i; } %yExt = ((%lastLine + 1) * 15) + 18; %xExt = firstWord(voiceCommHud.extent); voiceCommHud.extent = %xExt SPC %yExt; } //------------------------------------------------------------------------------ // SERVER command functions: //------------------------------------------------------------------------------ function serverCmdListenTo(%client, %who, %boolean) { if ( %client == %who ) return; %client.listenTo( %who, %boolean ); if ( %echo ) { if ( %boolean ) messageClient( %client, 'MsgVoiceEnable', 'You will now listen to %3.', %boolean, %who, %who.name ); else messageClient( %client, 'MsgVoiceEnable', 'You will no longer listen to %3.', %boolean, %who, %who.name ); } else messageClient( %client, 'MsgVoiceEnable', "", %boolean, %who ); messageClient( %who, 'MsgListenState', "", %boolean, %client ); } //------------------------------------------------------------------------------ function serverCmdListenToAll(%client) { %client.listenToAll(); for ( %i = 0; %i < ClientGroup.getCount(); %i++ ) { %cl = ClientGroup.getObject( %i ); if ( %cl && %cl != %client && !%cl.isAIControlled() ) messageClient( %client, 'MsgVoiceEnable', "", true, %cl ); } messageAllExcept( %client, 'MsgListenState', "", true, %client ); } //------------------------------------------------------------------------------ function serverCmdListenToNone(%client) { %client.listenToNone(); for ( %i = 0; %i < ClientGroup.getCount(); %i++ ) { %cl = ClientGroup.getObject( %i ); if ( %cl && %cl != %client && !%cl.isAIControlled() ) messageClient( %client, 'MsgVoiceEnable', "", false, %cl ); } messageAllExcept( %client, 'MsgListenState', "", false, %client ); } //------------------------------------------------------------------------------ // Client bind functions: //------------------------------------------------------------------------------ function voiceCapStart() { $voiceCaptureStarted = true; // client can send voice? (dont bother recording.. server will reject it anyway) if(($Audio::serverChannels == 0) || ($Audio::serverEncodingLevel < $pref::Audio::encodingLevel)) { if($Audio::serverChannels == 0) addMessageHudLine("\c2System:\cr server has disabled voice communication."); else { switch($Audio::serverEncodingLevel) { case 0: %level = "Codec .v12"; case 1: %level = "Codec .v24"; case 2: %level = "Codec .v29"; default: %level = "Codec GSM"; } addMessageHudLine("\c2System:\cr server has voice level capped at [\c1" @ %level @ "\cr]."); } $voiceCaptureStarted = false; return; } vcRecordingHud.setVisible(true); voiceCommHud.setVisible(true); resizeVoiceCommWindow(); alxCaptureStart(); } function voiceCapStop() { if(!$voiceCaptureStarted) return; vcRecordingHud.setVisible(false); if($numTalking < 1) voiceCommHud.setVisible(false); alxCaptureStop(); } //------------------------------------------------------------------------------ function serverCmdSetVoiceInfo(%client, %channels, %decodingMask, %encodingLevel) { %wasEnabled = %client.listenEnabled(); // server has voice comm turned off? if($Audio::maxVoiceChannels == 0) %decodingMask = 0; else %decodingMask &= (1 << ($Audio::maxEncodingLevel + 1)) - 1; if($Audio::maxEncodingLevel < %encodingLevel) %encodingLevel = $Audio::maxEncodingLevel; if($Audio::maxVoiceChannels < %channels) %channels = $Audio::maxVoiceChannels; %client.setVoiceChannels(%channels); %client.setVoiceDecodingMask(%decodingMask); %client.setVoiceEncodingLevel(%encodingLevel); commandToClient(%client, 'SetVoiceInfo', %channels, %decodingMask, %encodingLevel); if ( %wasEnabled != ( %channels > 0 ) ) updateCanListenState( %client ); } //------------------------------------------------------------------------------ // SERVER side update function: //------------------------------------------------------------------------------ function updateCanListenState( %client ) { // These can never listen, so they don't need to be updated: if ( %client.isAIControlled() || !%client.listenEnabled() ) return; for ( %i = 0; %i < ClientGroup.getCount(); %i++ ) { %cl = ClientGroup.getObject( %i ); if ( %cl && %cl != %client && !%cl.isAIControlled() ) { messageClient( %cl, 'MsgCanListen', "", %client.canListenTo( %cl ), %client ); messageClient( %client, 'MsgCanListen', "", %cl.canListenTo( %client ), %cl ); } } } //------------------------------------------------------------------------------ // CLIENT side handler functions: //------------------------------------------------------------------------------ addMessageCallback( 'MsgVoiceEnable', handleVoiceEnableMessage ); function handleVoiceEnableMessage( %msgType, %msgString, %enabled, %who ) { if ( isObject( $PlayerList[%who] ) ) { $PlayerList[%who].voiceEnabled = %enabled; lobbyUpdatePlayer( %who ); if ( $PlayingOnline && !$PlayerList[%who].isSmurf && $PlayerList[%who].guid > 0 ) setPlayerVoiceMuted( $PlayerList[%who].guid, !%enabled ); } } //------------------------------------------------------------------------------ addMessageCallback( 'MsgCanListen', handleCanListenMessage ); function handleCanListenMessage( %msgType, %msgString, %canListen, %who ) { if ( isObject( $PlayerList[%who] ) ) { $PlayerList[%who].canListen = %canListen; lobbyUpdatePlayer( %who ); } } //------------------------------------------------------------------------------ addMessageCallback( 'MsgListenState', handleListenStateMessage ); function handleListenStateMessage( %msgType, %msgString, %isListening, %who ) { if ( isObject( $PlayerList[%who] ) ) { $PlayerList[%who].isListening = %isListening; lobbyUpdatePlayer( %who ); } } PK !(yscripts/waveProfiles.cs//----------------------------------------------------------------------------- // Wave Profile Lists // new WaveProfile(calmSea) { }; new WaveProfile(chop) { }; new WaveProfile(bubblyLava) { }; new WaveProfile(coolingLava) { }; new WaveProfile(quicksand) { };PK !(j肕ooscripts/weapTurretCode.cs//-------------------------------------- Ammo functions function Ammo::onCollision(%data, %obj, %col) { // %data = datablock of object; %obj = object number // %col = thing that collided with object (hopefully a player) if (%col.getDataBlock().className $= Armor) { %ammoName = %data.getName(); %ammoStore = %col.inv[%ammoName]; // if player has ammo pack, increase max amount of ammo if(%col.getMountedImage($BackpackSlot) != 0) { if(%col.getMountedImage($BackpackSlot).getName() $= "AmmoPackImage") %aMax = (%col.getDataBlock().max[%ammoName]) + AmmoPack.max[%ammoName]; else %aMax = %col.getDataBlock().max[%ammoName]; } else %aMax = %col.getDataBlock().max[%ammoName]; if(%col.inv[%ammoName] < %aMax) { if( %obj.ammoStore $= "" ) %obj.ammoStore = $AmmoIncrement[ %ammoName ]; %col.incInventory(%ammoName, %obj.ammoStore); serverPlay3D(ItemPickupSound, %col.getTransform()); %obj.respawn(); if (%col.client > 0) messageClient(%col.client, 'MsgItemPickup', '\c0You picked up %1.', %data.pickUpName); } } } function GrenadeThrown::onCollision(%data, %obj, %col) { // nothing you can do now... } function HandInventory::onCollision(%data, %obj, %col) { // %data = datablock of object; %obj = object number // %col = thing that collided with object (hopefully a player) if (%col.getDataBlock().className $= Armor) { %ammoName = %data.getName(); %ammoStore = %col.inv[%ammoName]; // if player has ammo pack, increase max amount of ammo if(%col.getMountedImage($BackpackSlot) != 0) { if(%col.getMountedImage($BackpackSlot).getName() $= "AmmoPackImage") %aMax = (%col.getDataBlock().max[%ammoName]) + AmmoPack.max[%ammoName]; else %aMax = %col.getDataBlock().max[%ammoName]; } else %aMax = %col.getDataBlock().max[%ammoName]; if(%data.isGrenade) { // it's a grenade -- see if it matches the type the player is carrying %pgType = "None"; for(%x = 0; $InvGrenade[%x] !$= ""; %x++) { %gren = $NameToInv[$InvGrenade[%x]]; if(%col.inv[%gren] > 0) { %pgType = %gren; break; } } if((%pgType $= "None") || (%pgType $= %ammoName)) { // player either has no grenades or this type of grenades -- OK to pick up more %canPickup = true; } else { // player has a different kind of grenade -- don't pick this kind up %canPickup = false; } } else %canPickup = true; if(%canPickup) { if(%col.inv[%ammoName] < %aMax) { //------------------------------------------------------------------------------------------- // z0dd - ZOD, 5/8/02. Don't allow player to pickup full ammo if they tossed less than full. //%col.incInventory(%ammoName, $AmmoIncrement[%ammoName]); if( %obj.ammoStore $= "" ) %obj.ammoStore = $AmmoIncrement[ %ammoName ]; %col.incInventory(%ammoName, %obj.ammoStore); // End z0dd - ZOD //------------------------------------------------------------------------------------------- serverPlay3D(ItemPickupSound, %col.getTransform()); %obj.respawn(); if (%col.client > 0) messageClient(%col.client, 'MsgItemPickup', '\c0You picked up %1.', %data.pickUpName); } } } } //-------------------------------------- Specific turret functions function SentryTurret::onAdd(%data, %obj) { Parent::onAdd(%data, %obj); //error("error"); %obj.mountImage(%data.barrel, 0, true); } function TurretDeployedCamera::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); %obj.mountImage(DeployableCameraBarrel, 0, true); %obj.setRechargeRate(%this.rechargeRate); } function TurretDeployedCamera::onDestroyed(%this, %obj, %prevState) { Parent::onDestroyed(%this, %obj, %prevState); $TeamDeployedCount[%obj.team, DeployedCamera]--; // doesn't seem to delete itself, so... %obj.schedule(500, "delete"); } function ScoutFlyer::onTrigger(%data, %obj, %trigger, %state) { // data = ScoutFlyer datablock // obj = ScoutFlyer object number // trigger = 0 for "fire", 1 for "jump", 3 for "thrust" // state = 1 for firing, 0 for not firing if(%trigger == 0) { switch (%state) { case 0: %obj.fireWeapon = false; %obj.setImageTrigger(2, false); %obj.setImageTrigger(3, false); case 1: %obj.fireWeapon = true; if(%obj.nextWeaponFire == 2) { %obj.setImageTrigger(2, true); %obj.setImageTrigger(3, false); } else { %obj.setImageTrigger(2, false); %obj.setImageTrigger(3, true); } } } } function ScoutFlyer::playerDismounted(%data, %obj, %player) { %obj.fireWeapon = false; %obj.setImageTrigger(2, false); %obj.setImageTrigger(3, false); setTargetSensorGroup(%obj.getTarget(), %obj.team); if( %player.client.observeCount > 0 ) resetObserveFollow( %player.client, true ); } function ScoutChaingunImage::onFire(%data,%obj,%slot) { // obj = ScoutFlyer object number // slot = 2 Parent::onFire(%data,%obj,%slot); %obj.nextWeaponFire = 3; schedule(%data.fireTimeout, 0, "fireNextGun", %obj); } function ScoutChaingunPairImage::onFire(%data,%obj,%slot) { // obj = ScoutFlyer object number // slot = 3 Parent::onFire(%data,%obj,%slot); %obj.nextWeaponFire = 2; schedule(%data.fireTimeout, 0, "fireNextGun", %obj); } function fireNextGun(%obj) { if(%obj.fireWeapon) { if(%obj.nextWeaponFire == 2) { %obj.setImageTrigger(2, true); %obj.setImageTrigger(3, false); } else { %obj.setImageTrigger(2, false); %obj.setImageTrigger(3, true); } } else { %obj.setImageTrigger(2, false); %obj.setImageTrigger(3, false); } } function ScoutChaingunImage::onTriggerDown(%this, %obj, %slot) { } function ScoutChaingunImage::onTriggerUp(%this, %obj, %slot) { } function ScoutChaingunImage::onMount(%this, %obj, %slot) { // %obj.setImageAmmo(%slot,true); } function ScoutChaingunPairImage::onMount(%this, %obj, %slot) { // %obj.setImageAmmo(%slot,true); } function ScoutChaingunImage::onUnmount(%this,%obj,%slot) { } function ScoutChaingunPairImage::onUnmount(%this,%obj,%slot) { } function BomberTurret::onDamage(%data, %obj) { %newDamageVal = %obj.getDamageLevel(); if(%obj.lastDamageVal !$= "") if(isObject(%obj.getObjectMount()) && %obj.lastDamageVal > %newDamageVal) %obj.getObjectMount().setDamageLevel(%newDamageVal); %obj.lastDamageVal = %newDamageVal; } function BomberTurret::damageObject(%this, %targetObject, %sourceObject, %position, %amount, %damageType ,%vec, %client, %projectile) { //If vehicle turret is hit then apply damage to the vehicle %vehicle = %targetObject.getObjectMount(); if(%vehicle) %vehicle.getDataBlock().damageObject(%vehicle, %sourceObject, %position, %amount, %damageType, %vec, %client, %projectile); } function VehicleTurret::onEndSequence(%data, %obj, %thread) { if($DeployThread == %thread) %obj.stopThread($DeployThread); } function BomberTurret::onTrigger(%data, %obj, %trigger, %state) { //error("onTrigger: trigger = " @ %trigger @ ", state = " @ %state); //error("obj = " @ %obj @ ", class " @ %obj.getClassName()); switch (%trigger) { case 0: %obj.fireTrigger = %state; if(%obj.selectedWeapon == 1) { %obj.setImageTrigger(4, false); if(%obj.getImageTrigger(6)) { %obj.setImageTrigger(6, false); ShapeBaseImageData::deconstruct(%obj.getMountedImage(6), %obj); } if(%state) %obj.setImageTrigger(2, true); else %obj.setImageTrigger(2, false); } else if(%obj.selectedWeapon == 2) { %obj.setImageTrigger(2, false); if(%obj.getImageTrigger(6)) { %obj.setImageTrigger(6, false); ShapeBaseImageData::deconstruct(%obj.getMountedImage(6), %obj); } if(%state) %obj.setImageTrigger(4, true); else %obj.setImageTrigger(4, false); } else { %obj.setImageTrigger(2, false); %obj.setImageTrigger(4, false); if(%state) %obj.setImageTrigger(6, true); else { %obj.setImageTrigger(6, false); BomberTargetingImage::deconstruct(%obj.getMountedImage(6), %obj); } } case 2: if(%state) { %obj.getDataBlock().playerDismount(%obj); } } } function BomberTurret::playerDismount(%data, %obj) { //Passenger Exiting %obj.fireTrigger = 0; %obj.setImageTrigger(2, false); %obj.setImageTrigger(4, false); if(%obj.getImageTrigger(6)) { %obj.setImageTrigger(6, false); ShapeBaseImageData::deconstruct(%obj.getMountedImage(6), %obj); } %client = %obj.getControllingClient(); %client.player.isBomber = false; commandToClient(%client, 'endBomberSight'); // %client.player.setControlObject(%client.player); %client.player.mountVehicle = false; // %client.player.getDataBlock().doDismount(%client.player); if(%client.player.getState() !$= "Dead") %client.player.mountImage(%client.player.lastWeapon, $WeaponSlot); setTargetSensorGroup(%obj.getTarget(), 0); setTargetNeverVisMask(%obj.getTarget(), 0xffffffff); } //function BomberTurret::getHudNum(%data, %num) //{ // if(%num == 1) // return 0; // else // return 4; //} function AIAimingTurretBarrel::onFire(%this,%obj,%slot) { } function BomberBombImage::onUnmount(%this,%obj,%slot) { } function BomberBombPairImage::onUnmount(%this,%obj,%slot) { } function BomberTurretBarrel::firePair(%this, %obj, %slot) { %obj.setImageTrigger( 3, true); } function BomberTurretBarrelPair::stopFire(%this, %obj, %slot) { %obj.setImageTrigger( 3, false); } function BomberTurretBarrelPair::onMount(%this, %obj, %slot) { // %obj.setImageAmmo(%slot,true); } function BomberTurretBarrel::onMount(%this, %obj, %slot) { // %obj.setImageAmmo(%slot,true); } function BomberBombImage::firePair(%this, %obj, %slot) { %obj.setImageTrigger( 5, true); } function BomberBombPairImage::stopFire(%this, %obj, %slot) { %obj.setImageTrigger( 5, false); } function BomberBombPairImage::onMount(%this, %obj, %slot) { // %obj.setImageAmmo(%slot,true); } function BomberBombImage::onMount(%this, %obj, %slot) { } function BomberBombImage::onUnmount(%this,%obj,%slot) { } function BomberBombPairImage::onUnmount(%this,%obj,%slot) { } function MobileTurretBase::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); setTargetSensorGroup(%obj.target, %obj.team); //setTargetNeverVisMask(%obj.target, 0xffffffff); } function MobileTurretBase::onDamage(%data, %obj) { %newDamageVal = %obj.getDamageLevel(); if(%obj.lastDamageVal !$= "") if(isObject(%obj.getObjectMount()) && %obj.lastDamageVal > %newDamageVal) %obj.getObjectMount().setDamageLevel(%newDamageVal); %obj.lastDamageVal = %newDamageVal; } function MobileTurretBase::damageObject(%this, %targetObject, %sourceObject, %position, %amount, %damageType ,%vec, %client, %projectile) { //If vehicle turret is hit then apply damage to the vehicle %vehicle = %targetObject.getObjectMount(); if(%vehicle) %vehicle.getDataBlock().damageObject(%vehicle, %sourceObject, %position, %amount, %damageType, %vec, %client, %projectile); } function MobileTurretBase::onEndSequence(%data, %obj, %thread) { //Used so that the parent wont be called.. } function AssaultPlasmaTurret::onDamage(%data, %obj) { %newDamageVal = %obj.getDamageLevel(); if(%obj.lastDamageVal !$= "") if(isObject(%obj.getObjectMount()) && %obj.lastDamageVal > %newDamageVal) %obj.getObjectMount().setDamageLevel(%newDamageVal); %obj.lastDamageVal = %newDamageVal; } function AssaultPlasmaTurret::damageObject(%this, %targetObject, %sourceObject, %position, %amount, %damageType ,%vec, %client, %projectile) { //If vehicle turret is hit then apply damage to the vehicle %vehicle = %targetObject.getObjectMount(); if(%vehicle) %vehicle.getDataBlock().damageObject(%vehicle, %sourceObject, %position, %amount, %damageType, %vec, %client, %projectile); } function AssaultPlasmaTurret::onTrigger(%data, %obj, %trigger, %state) { switch (%trigger) { case 0: %obj.fireTrigger = %state; if(%obj.selectedWeapon == 1) { %obj.setImageTrigger(4, false); if(%state) %obj.setImageTrigger(2, true); else %obj.setImageTrigger(2, false); } else { %obj.setImageTrigger(2, false); if(%state) %obj.setImageTrigger(4, true); else %obj.setImageTrigger(4, false); } case 2: if(%state) { %obj.getDataBlock().playerDismount(%obj); } } } function AssaultPlasmaTurret::playerDismount(%data, %obj) { //Passenger Exiting %obj.fireTrigger = 0; %obj.setImageTrigger(2, false); %obj.setImageTrigger(4, false); %client = %obj.getControllingClient(); // %client.setControlObject(%client.player); %client.player.mountImage(%client.player.lastWeapon, $WeaponSlot); %client.player.mountVehicle = false; setTargetSensorGroup(%obj.getTarget(), 0); setTargetNeverVisMask(%obj.getTarget(), 0xffffffff); // %client.player.getDataBlock().doDismount(%client.player); } //function AssaultPlasmaTurret::getHudNum(%data, %num) //{ // if(%num == 1) // return 1; // else // return 3; //} // ------------------------------------------ // camera functions // ------------------------------------------ $CameraDeployTime = 1000; $CameraDeployCheckMax = 6; $CameraMinVelocity = 0.1; function CameraGrenadeThrown::onThrow(%this, %gren) { // schedule a check to see if the camera is at rest but not deployed %gren.checkCount = 0; %gren.velocCheck = %this.schedule($CameraDeployTime, "checkCameraDeploy", %gren); } function CameraGrenadeThrown::onStickyCollision(%data, %obj) { cancel(%obj.velocCheck); %pos = %obj.getLastStickyPos(); %norm = %obj.getLastStickyNormal(); %intAngle = getTerrainAngle(%norm); // staticShape.cs %rotAxis = vectorNormalize(vectorCross(%norm, "0 0 1")); if (getWord(%norm, 2) == 1 || getWord(%norm, 2) == -1) %rotAxis = vectorNormalize(vectorCross(%norm, "0 1 0")); %rotation = %rotAxis @ " " @ %intAngle; %dcSucc = activateCamera(%pos, %rotation, %obj.sourceObject, %obj.sourceObject.team); if(%dcSucc == 0) messageClient(%obj.sourceObject.client, 'MsgDeployFailed', '\c2Your team\'s control network has reached its capacity for this item.~wfx/misc/misc.error.wav'); %obj.schedule(50,"delete"); } function CameraGrenadeThrown::checkCameraDeploy(%this, %gren) { %gren.checkCount++; if(VectorLen(%gren.getVelocity()) < $CameraMinVelocity) { // camera has come to rest but not deployed -- probably on a staticshape (station, gen, etc) // no resolution, so get rid of it %gren.schedule(50, "delete"); } else if(%gren.checkCount >= $CameraDeployCheckMax) { // camera's still moving but it's been check several times -- it was thrown from too great // a height or off the edge of the world -- delete it %gren.schedule(50, "delete"); } else { // check back in a little while %gren.velocCheck = %this.schedule($CameraDeployTime, "checkCameraDeploy", %gren); } } function activateCamera(%position, %rotation, %sourceObj, %team) { if($TeamDeployedCount[%team, DeployedCamera] >= $TeamDeployableMax[DeployedCamera]) { // team has too many cameras deployed already, don't deploy this one return 0; } %dCam = new Turret() { dataBlock = "TurretDeployedCamera"; team = %team; needsNoPower = true; owner = %sourceObj.client; ownerHandle = %sourceObj.client.handle; position = %position; rotation = %rotation; }; addToDeployGroup(%dCam); if(%dCam.getTarget() != -1) setTargetSensorGroup(%dCam.getTarget(), %team); %dCam.playAudio($DeploySound, CameraGrenadeAttachSound); %dCam.deploy(); %dCam.playThread($AmbientThread, "ambient"); // increment team's deployed count for cameras $TeamDeployedCount[%team, DeployedCamera]++; return 1; } function FlareGrenade::onUse(%this, %obj) { // a stripped-down version of HandInventory::onUse from weapons.cs if(Game.handInvOnUse(%data, %obj)) { %obj.decInventory(%this, 1); %p = new FlareProjectile() { dataBlock = FlareGrenadeProj; initialDirection = %obj.getEyeVector(); initialPosition = getBoxCenter(%obj.getWorldBox()); sourceObject = %obj; sourceSlot = 0; }; FlareSet.add(%p); MissionCleanup.add(%p); serverPlay3D(GrenadeThrowSound, getBoxCenter(%obj.getWorldBox())); %p.schedule(6000, "delete"); // miscellaneous grenade-throwing cleanup stuff %obj.lastThrowTime[%data] = getSimTime(); %obj.throwStrength = 0; } } // uncomment when explosion type can be set from script (dont want underwater explosion here) //function grenadeOnEnterLiquid(%data, %obj, %coverage, %type, %flash) //{ // // 4: Lava // // 5: Hot Lava // // 6: Crusty Lava // if(%type >=4 && %type <= 6) // { // if(%obj.getDamageState() !$= "Destroyed") // { // cancel(%obj.detThread); // if(%flash) // detonateFlashGrenade(%obj); // else // detonateGrenade(%obj); // return(true); // } // } // // // flash grenades do not ignore quicksand // if((%type == 7) && !%flash) // return(true); // // return(false); //} function GrenadeThrown::onThrow(%this, %gren) { AIGrenadeThrown(%gren); %gren.detThread = schedule(1500, %gren, "detonateGrenade", %gren); } //function GrenadeThrown::onEnterLiquid(%data, %obj, %coverage, %type) //{ // if(!grenadeOnEnterLiquid(%data, %obj, %coverage, %type, false)) // Parent::onEnterLiquid(%data, %obj, %coverage, %type); //} function ConcussionGrenadeThrown::onThrow(%this, %gren) { AIGrenadeThrown(%gren); %gren.detThread = schedule(2000, %gren, "detonateGrenade", %gren); } //function ConcussionGrenadeThrown::onEnterLiquid(%data, %obj, %coverage, %type) //{ // if(!grenadeOnEnterLiquid(%data, %obj, %coverage, %type, false)) // Parent::onEnterLiquid(%data, %obj, %coverage, %type); //} function detonateGrenade(%obj) { %obj.setDamageState(Destroyed); %data = %obj.getDataBlock(); RadiusExplosion( %obj, %obj.getPosition(), %data.damageRadius, %data.indirectDamage, %data.kickBackStrength, %obj.sourceObject, %data.radiusDamageType); %obj.schedule(500,"delete"); } function FlashGrenadeThrown::onThrow(%this, %gren) { %gren.detThread = schedule(2000, %gren, "detonateFlashGrenade", %gren); } //function FlashGrenadeThrown::onEnterLiquid(%data, %obj, %coverage, %type) //{ // if(!grenadeOnEnterLiquid(%data, %obj, %coverage, %type, true)) // Parent::onEnterLiquid(%data, %obj, %coverage, %type); //} function detonateFlashGrenade(%hg) { %maxWhiteout = %hg.getDataBlock().maxWhiteout; %thrower = %hg.sourceObject.client; %hg.setDamageState(Destroyed); %hgt = %hg.getTransform(); %plX = firstword(%hgt); %plY = getWord(%hgt, 1); %plZ = getWord(%hgt, 2); %pos = %plX @ " " @ %plY @ " " @ %plZ; //all this stuff below ripped from projectiles.cs InitContainerRadiusSearch(%pos, 100.0, $TypeMasks::PlayerObjectType | $TypeMasks::TurretObjectType); while ((%damage = containerSearchNext()) != 0) { %dist = containerSearchCurrDist(); %eyeXF = %damage.getEyeTransform(); %epX = firstword(%eyeXF); %epY = getWord(%eyeXF, 1); %epZ = getWord(%eyeXF, 2); %eyePos = %epX @ " " @ %epY @ " " @ %epZ; %eyeVec = %damage.getEyeVector(); // Make sure we can see the thing... if (ContainerRayCast(%eyePos, %pos, $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticObjectType, %damage) !$= "0") { continue; } %distFactor = 1.0; if (%dist >= 100) %distFactor = 0.0; else if (%dist >= 20) { %distFactor = 1.0 - ((%dist - 20.0) / 80.0); } %dif = VectorNormalize(VectorSub(%pos, %eyePos)); %dot = VectorDot(%eyeVec, %dif); %difAcos = mRadToDeg(mAcos(%dot)); %dotFactor = 1.0; if (%difAcos > 60) %dotFactor = ((1.0 - ((%difAcos - 60.0) / 120.0)) * 0.2) + 0.3; else if (%difAcos > 45) %dotFactor = ((1.0 - ((%difAcos - 45.0) / 15.0)) * 0.5) + 0.5; %totalFactor = %dotFactor * %distFactor; %prevWhiteOut = %damage.getWhiteOut(); if(!%prevWhiteOut) if(!$teamDamage) { if(%damage.client != %thrower && %damage.client.team == %thrower.team) messageClient(%damage.client, 'teamWhiteOut', '\c1You were hit by %1\'s whiteout grenade.', getTaggedString(%thrower.name)); } %whiteoutVal = %prevWhiteOut + %totalFactor; if(%whiteoutVal > %maxWhiteout) { //error("whitout at max"); %whiteoutVal = %maxWhiteout; } %damage.setWhiteOut( %whiteoutVal ); } %hg.schedule( 500, "delete" ); } // ---------------------------------------------- // mine functions // ---------------------------------------------- function MineDeployed::onThrow(%this, %mine, %thrower) { %mine.armed = false; %mine.damaged = 0; %mine.detonated = false; %mine.depCount = 0; %mine.theClient = %thrower.client; schedule(1500, %mine, "deployMineCheck", %mine, %thrower); } function deployMineCheck(%mineObj, %player) { if(%mineObj.depCount > %mineObj.getDatablock().maxDepCount) explodeMine(%mineObj, true); // wait until the mine comes to rest if(%mineObj.getVelocity() $= "0 0 0") { // 2-second delay before mine is armed -- let deploy thread play out etc. schedule(%mineObj.getDatablock().armTime, %mineObj, "armDeployedMine", %mineObj); // check for other deployed mines in the vicinity InitContainerRadiusSearch(%mineObj.getWorldBoxCenter(), %mineObj.getDatablock().spacing, $TypeMasks::ItemObjectType); while((%itemObj = containerSearchNext()) != 0) { if(%itemObj == %mineObj) continue; %ioType = %itemObj.getDatablock().getName(); if(%ioType $= "MineDeployed") schedule(100, %mineObj, "explodeMine", %mineObj, true); else continue; } // play "deploy" thread %mineObj.playThread(0, "deploy"); serverPlay3D(MineDeploySound, %mineObj.getTransform()); %mineTeam = %mineObj.sourceObject.team; $TeamDeployedCount[%mineTeam, MineDeployed]++; if($TeamDeployedCount[%mineTeam, MineDeployed] > $TeamDeployableMax[MineDeployed]) { messageClient( %player.client, '', 'Maximum allowable mines deployed.' ); schedule(100, %mineObj, "explodeMine", %mineObj, true); } else { //start the thread that keeps checking for objects near the mine... mineCheckVicinity(%mineObj); //let the AI know *after* it's come to rest... AIDeployMine(%mineObj); //let the game know there's a deployed mine Game.notifyMineDeployed(%mineObj); } } else { //schedule this deploy check again a little later %mineObj.depCount++; schedule(500, %mineObj, "deployMineCheck", %mineObj, %player); } } function armDeployedMine(%mine) { %mine.armed = true; } function mineCheckVicinity(%mine) { // this function is called after the mine has been deployed. It will check the // immediate area around the mine (2.5 meters at present) for players or vehicles // passing by, and detonate if any are found. This is to extend the range of the // mine so players don't have to collide with them to set them off. // don't bother to check if mine isn't armed yet if(%mine.armed) // don't keep checking if mine is already detonating if(!%mine.boom) { // the actual check for objects in the area %mineLoc = %mine.getWorldBoxCenter(); %masks = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType; %detonateRange = %mine.getDatablock().proximity; InitContainerRadiusSearch(%mineLoc, %detonateRange, %masks); while((%tgt = containerSearchNext()) != 0) { %mine.detonated = true; schedule(50, %mine, "explodeMine", %mine, false); break; } } // if nothing set off the mine, schedule another check if(!%mine.detonated) schedule(300, %mine, "mineCheckVicinity", %mine); } function MineDeployed::onCollision(%data, %obj, %col) { // don't detonate if mine isn't armed yet if(!%obj.armed) return; // don't detonate if mine is already detonating if(%obj.boom) return; //check to see what it is that collided with the mine %struck = %col.getClassName(); if(%struck $= "Player" || %struck $= "WheeledVehicle" || %struck $= "FlyingVehicle") { //error("Mine detonated due to collision with #"@%col@" ("@%struck@"); armed = "@%obj.armed); explodeMine(%obj, false); } } function explodeMine(%mo, %noDamage) { %mo.noDamage = %noDamage; %mo.setDamageState(Destroyed); } function MineDeployed::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) { if(!%targetObject.armed) return; if(%targetObject.boom) return; %targetObject.damaged += %amount; if(%targetObject.damaged >= %data.maxDamage) { %targetObject.setDamageState(Destroyed); } } function MineDeployed::onDestroyed(%data, %obj, %lastState) { %obj.boom = true; %mineTeam = %obj.team; $TeamDeployedCount[%mineTeam, MineDeployed]--; // %noDamage is a boolean flag -- don't want to set off all other mines in // vicinity if there's a "mine overload", so apply no damage/impulse if true if(!%obj.noDamage) RadiusExplosion(%obj, %obj.getPosition(), %data.damageRadius, %data.indirectDamage, %data.kickBackStrength, %obj.sourceObject, %data.radiusDamageType); %obj.schedule(600, "delete"); }PK !(<$N00scripts/weapons.cs$HandInvThrowTimeout = 0.8 * 1000; // 1/2 second between throwing grenades or mines // z0dd - ZOD, 9/13/02. Added global array for serverside weapon reticles and "visible" $WeaponsHudData[0, bitmapName] = "gui/hud_blaster"; $WeaponsHudData[0, itemDataName] = "Blaster"; //$WeaponsHudData[0, ammoDataName] = ""; $WeaponsHudData[0, reticle] = "gui/ret_blaster"; $WeaponsHudData[0, visible] = "true"; $WeaponsHudData[1, bitmapName] = "gui/hud_plasma"; $WeaponsHudData[1, itemDataName] = "Plasma"; $WeaponsHudData[1, ammoDataName] = "PlasmaAmmo"; $WeaponsHudData[1, reticle] = "gui/ret_plasma"; $WeaponsHudData[1, visible] = "true"; $WeaponsHudData[2, bitmapName] = "gui/hud_chaingun"; $WeaponsHudData[2, itemDataName] = "Chaingun"; $WeaponsHudData[2, ammoDataName] = "ChaingunAmmo"; $WeaponsHudData[2, reticle] = "gui/ret_chaingun"; $WeaponsHudData[2, visible] = "true"; $WeaponsHudData[3, bitmapName] = "gui/hud_disc"; $WeaponsHudData[3, itemDataName] = "Disc"; $WeaponsHudData[3, ammoDataName] = "DiscAmmo"; $WeaponsHudData[3, reticle] = "gui/ret_disc"; $WeaponsHudData[3, visible] = "true"; $WeaponsHudData[4, bitmapName] = "gui/hud_grenlaunch"; $WeaponsHudData[4, itemDataName] = "GrenadeLauncher"; $WeaponsHudData[4, ammoDataName] = "GrenadeLauncherAmmo"; $WeaponsHudData[4, reticle] = "gui/ret_grenade"; $WeaponsHudData[4, visible] = "true"; $WeaponsHudData[5, bitmapName] = "gui/hud_sniper"; $WeaponsHudData[5, itemDataName] = "SniperRifle"; //$WeaponsHudData[5, ammoDataName] = ""; $WeaponsHudData[5, reticle] = "gui/hud_ret_sniper"; $WeaponsHudData[5, visible] = "false"; $WeaponsHudData[6, bitmapName] = "gui/hud_elfgun"; $WeaponsHudData[6, itemDataName] = "ELFGun"; //$WeaponsHudData[6, ammoDataName] = ""; $WeaponsHudData[6, reticle] = "gui/ret_elf"; $WeaponsHudData[6, visible] = "true"; $WeaponsHudData[7, bitmapName] = "gui/hud_mortor"; $WeaponsHudData[7, itemDataName] = "Mortar"; $WeaponsHudData[7, ammoDataName] = "MortarAmmo"; $WeaponsHudData[7, reticle] = "gui/ret_mortor"; $WeaponsHudData[7, visible] = "true"; $WeaponsHudData[8, bitmapName] = "gui/hud_missiles"; $WeaponsHudData[8, itemDataName] = "MissileLauncher"; $WeaponsHudData[8, ammoDataName] = "MissileLauncherAmmo"; $WeaponsHudData[8, reticle] = "gui/ret_missile"; $WeaponsHudData[8, visible] = "true"; // WARNING!!! If you change the weapon index of the targeting laser, // you must change the HudWeaponInvBase::addWeapon function to test // for the new value! $WeaponsHudData[9, bitmapName] = "gui/hud_targetlaser"; $WeaponsHudData[9, itemDataName] = "TargetingLaser"; //$WeaponsHudData[9, ammoDataName] = ""; $WeaponsHudData[9, reticle] = "gui/hud_ret_targlaser"; $WeaponsHudData[9, visible] = "false"; $WeaponsHudData[10, bitmapName] = "gui/hud_shocklance"; $WeaponsHudData[10, itemDataName] = "ShockLance"; //$WeaponsHudData[10, ammoDataName] = ""; $WeaponsHudData[10, reticle] = "gui/hud_ret_shocklance"; $WeaponsHudData[10, visible] = "false"; // TR2 weapons $WeaponsHudData[11, bitmapName] = "gui/hud_disc"; $WeaponsHudData[11, itemDataName] = "TR2Disc"; $WeaponsHudData[11, ammoDataName] = "TR2DiscAmmo"; $WeaponsHudData[11, reticle] = "gui/ret_disc"; $WeaponsHudData[11, visible] = "true"; $WeaponsHudData[12, bitmapName] = "gui/hud_grenlaunch"; $WeaponsHudData[12, itemDataName] = "TR2GrenadeLauncher"; $WeaponsHudData[12, ammoDataName] = "TR2GrenadeLauncherAmmo"; $WeaponsHudData[12, reticle] = "gui/ret_grenade"; $WeaponsHudData[12, visible] = "true"; $WeaponsHudData[13, bitmapName] = "gui/hud_chaingun"; $WeaponsHudData[13, itemDataName] = "TR2Chaingun"; $WeaponsHudData[13, ammoDataName] = "TR2ChaingunAmmo"; $WeaponsHudData[13, reticle] = "gui/ret_chaingun"; $WeaponsHudData[13, visible] = "true"; $WeaponsHudData[14, bitmapName] = "gui/hud_targetlaser"; $WeaponsHudData[14, itemDataName] = "TR2GoldTargetingLaser"; $WeaponsHudData[14, reticle] = "gui/hud_ret_targlaser"; $WeaponsHudData[14, visible] = "false"; $WeaponsHudData[15, bitmapName] = "gui/hud_targetlaser"; $WeaponsHudData[15, itemDataName] = "TR2SilverTargetingLaser"; $WeaponsHudData[15, reticle] = "gui/hud_ret_targlaser"; $WeaponsHudData[15, visible] = "false"; $WeaponsHudData[16, bitmapName] = "gui/hud_shocklance"; $WeaponsHudData[16, itemDataName] = "TR2ShockLance"; $WeaponsHudData[16, reticle] = "gui/hud_ret_shocklance"; $WeaponsHudData[16, visible] = "false"; $WeaponsHudData[17, bitmapName] = "gui/hud_mortor"; $WeaponsHudData[17, itemDataName] = "TR2Mortar"; $WeaponsHudData[17, ammoDataName] = "TR2MortarAmmo"; $WeaponsHudData[17, reticle] = "gui/ret_mortor"; $WeaponsHudData[17, visible] = "true"; $WeaponsHudCount = 18; $AmmoIncrement[TR2DiscAmmo] = 5; $AmmoIncrement[TR2GrenadeLauncherAmmo] = 5; $AmmoIncrement[TR2ChaingunAmmo] = 25; $AmmoIncrement[TR2MortarAmmo] = 5; $AmmoIncrement[TR2Grenade] = 5; $AmmoIncrement[PlasmaAmmo] = 10; $AmmoIncrement[ChaingunAmmo] = 25; $AmmoIncrement[DiscAmmo] = 5; $AmmoIncrement[GrenadeLauncherAmmo] = 5; $AmmoIncrement[MortarAmmo] = 5; $AmmoIncrement[MissileLauncherAmmo] = 2; $AmmoIncrement[Mine] = 3; $AmmoIncrement[Grenade] = 5; $AmmoIncrement[FlashGrenade] = 5; $AmmoIncrement[FlareGrenade] = 5; $AmmoIncrement[ConcussionGrenade] = 5; $AmmoIncrement[RepairKit] = 1; // ------------------------------------------------------------------- // z0dd - ZOD, 4/17/02. Addition. Ammo pickup fix, these were missing. $AmmoIncrement[CameraGrenade] = 2; $AmmoIncrement[Beacon] = 1; //---------------------------------------------------------------------------- // Weapons scripts //-------------------------------------- // --- Mounting weapons exec("scripts/weapons/blaster.cs"); exec("scripts/weapons/plasma.cs"); exec("scripts/weapons/chaingun.cs"); exec("scripts/weapons/disc.cs"); exec("scripts/weapons/grenadeLauncher.cs"); exec("scripts/weapons/sniperRifle.cs"); exec("scripts/weapons/ELFGun.cs"); exec("scripts/weapons/mortar.cs"); exec("scripts/weapons/missileLauncher.cs"); exec("scripts/weapons/targetingLaser.cs"); exec("scripts/weapons/shockLance.cs"); // --- Throwing weapons exec("scripts/weapons/mine.cs"); exec("scripts/weapons/grenade.cs"); exec("scripts/weapons/flashGrenade.cs"); exec("scripts/weapons/flareGrenade.cs"); exec("scripts/weapons/concussionGrenade.cs"); exec("scripts/weapons/cameraGrenade.cs"); //---------------------------------------------------------------------------- function Weapon::onUse(%data, %obj) { if(Game.weaponOnUse(%data, %obj)) if (%obj.getDataBlock().className $= Armor) %obj.mountImage(%data.image, $WeaponSlot); } function WeaponImage::onMount(%this,%obj,%slot) { //MES -- is call below useful at all? //Parent::onMount(%this, %obj, %slot); if(%obj.getClassName() !$= "Player") return; //messageClient(%obj.client, 'MsgWeaponMount', "", %this, %obj, %slot); // Looks arm position if (%this.armthread $= "") { %obj.setArmThread(look); } else { %obj.setArmThread(%this.armThread); } // Initial ammo state if(%obj.getMountedImage($WeaponSlot).ammo !$= "") if (%obj.getInventory(%this.ammo)) %obj.setImageAmmo(%slot,true); %obj.client.setWeaponsHudActive(%this.item); if(%obj.getMountedImage($WeaponSlot).ammo !$= "") %obj.client.setAmmoHudCount(%obj.getInventory(%this.ammo)); else %obj.client.setAmmoHudCount(-1); } function WeaponImage::onUnmount(%this,%obj,%slot) { %obj.client.setWeaponsHudActive(%this.item, 1); %obj.client.setAmmoHudCount(-1); commandToClient(%obj.client,'removeReticle'); // try to avoid running around with sniper/missile arm thread and no weapon %obj.setArmThread(look); Parent::onUnmount(%this, %obj, %slot); } function Ammo::onInventory(%this,%obj,%amount) { // Loop through and make sure the images using this ammo have // their ammo states set. for (%i = 0; %i < 8; %i++) { %image = %obj.getMountedImage(%i); if (%image > 0) { if (isObject(%image.ammo) && %image.ammo.getId() == %this.getId()) %obj.setImageAmmo(%i,%amount != 0); } } ItemData::onInventory(%this,%obj,%amount); // Uh, don't update the hud ammo counters if this is a corpse...that's bad. if ( %obj.getClassname() $= "Player" && %obj.getState() !$= "Dead" ) { %obj.client.setWeaponsHudAmmo(%this.getName(), %amount); if(%obj.getMountedImage($WeaponSlot).ammo $= %this.getName()) %obj.client.setAmmoHudCount(%amount); } } function Weapon::onInventory(%this,%obj,%amount) { if(Game.weaponOnInventory(%this, %obj, %amount)) { // Do not update the hud if this object is a corpse: if ( %obj.getState() !$= "Dead" ) %obj.client.setWeaponsHudItem(%this.getName(), 0, 1); ItemData::onInventory(%this,%obj,%amount); // if a player threw a weapon (which means that player isn't currently // holding a weapon), set armthread to "no weapon" // MES - taken out to avoid v-menu animation problems (bug #4749) //if((%amount == 0) && (%obj.getClassName() $= "Player")) // %obj.setArmThread(looknw); } } function Weapon::onPickup(%this, %obj, %shape, %amount) { // If player doesn't have a weapon in hand, use this one... if ( %shape.getClassName() $= "Player" && %shape.getMountedImage( $WeaponSlot ) == 0 ) %shape.use( %this.getName() ); } function HandInventory::onInventory(%this,%obj,%amount) { // prevent console errors when throwing ammo pack if(%obj.getClassName() $= "Player") %obj.client.setInventoryHudAmount(%this.getName(), %amount); ItemData::onInventory(%this,%obj,%amount); } function HandInventory::onUse(%data, %obj) { // %obj = player %data = datablock of what's being thrown if(Game.handInvOnUse(%data, %obj)) { //AI HOOK - If you change the %throwStren, tell Tinman!!! //Or edit aiInventory.cs and search for: use(%grenadeType); %tossTimeout = getSimTime() - %obj.lastThrowTime[%data]; if(%tossTimeout < $HandInvThrowTimeout) return; %throwStren = %obj.throwStrength; %obj.decInventory(%data, 1); %thrownItem = new Item() { dataBlock = %data.thrownItem; sourceObject = %obj; }; MissionCleanup.add(%thrownItem); // throw it %eye = %obj.getEyeVector(); %vec = vectorScale(%eye, (%throwStren * 20.0)); // add a vertical component to give it a better arc %dot = vectorDot("0 0 1", %eye); if(%dot < 0) %dot = -%dot; %vec = vectorAdd(%vec, vectorScale("0 0 4", 1 - %dot)); // add player's velocity %vec = vectorAdd(%vec, vectorScale(%obj.getVelocity(), 0.4)); %pos = getBoxCenter(%obj.getWorldBox()); %thrownItem.sourceObject = %obj; %thrownItem.team = %obj.team; %thrownItem.setTransform(%pos); %thrownItem.applyImpulse(%pos, %vec); %thrownItem.setCollisionTimeout(%obj); serverPlay3D(GrenadeThrowSound, %pos); %obj.lastThrowTime[%data] = getSimTime(); %thrownItem.getDataBlock().onThrow(%thrownItem, %obj); %obj.throwStrength = 0; } } function HandInventoryImage::onMount(%this,%obj,%slot) { messageClient(%col.client, 'MsgHandInventoryMount', "", %this, %obj, %slot); // Looks arm position if (%this.armthread $= "") %obj.setArmThread(look); else %obj.setArmThread(%this.armThread); // Initial ammo state if (%obj.getInventory(%this.ammo)) %obj.setImageAmmo(%slot,true); %obj.client.setWeaponsHudActive(%this.item); } function Weapon::incCatagory(%data, %obj) { // Don't count the targeting laser as a weapon slot: if ( %data.getName() !$= "TargetingLaser" ) %obj.weaponCount++; } function Weapon::decCatagory(%data, %obj) { // Don't count the targeting laser as a weapon slot: if ( %data.getName() !$= "TargetingLaser" ) %obj.weaponCount--; } function SimObject::damageObject(%data) { //function was added to reduce console err msg spam } PK !(䖔ت##scripts/weather.csdatablock AudioProfile(Universal_Rain_Light_1) { filename = "fx/environment/rain_light_1.wav"; description = AudioLooping2d; }; datablock PrecipitationData(Rain) { type = 0; soundProfile = "Universal_Rain_Light_1"; materialList = "raindrops.dml"; sizeX = 0.2; sizeY = 0.45; movingBoxPer = 0.35; divHeightVal = 1.5; sizeBigBox = 1; topBoxSpeed = 20; frontBoxSpeed = 30; topBoxDrawPer = 0.5; bottomDrawHeight = 40; skipIfPer = -0.3; bottomSpeedPer = 1.0; frontSpeedPer = 1.5; frontRadiusPer = 0.5; }; datablock PrecipitationData(Snow) { type = 1; materialList = "snowflakes.dml"; sizeX = 0.20; sizeY = 0.20; movingBoxPer = 0.35; divHeightVal = 1.5; sizeBigBox = 1; topBoxSpeed = 20; frontBoxSpeed = 30; topBoxDrawPer = 0.5; bottomDrawHeight = 40; skipIfPer = -0.3; bottomSpeedPer = 1.0; frontSpeedPer = 1.5; frontRadiusPer = 0.5; }; datablock PrecipitationData(Sand) { type = 2; maxSize = 2; movingBoxPer = 0.35; divHeightVal = 1.5; sizeBigBox = 1; topBoxSpeed = 20; frontBoxSpeed = 30; topBoxDrawPer = 0.5; bottomDrawHeight = 40; skipIfPer = -0.3; bottomSpeedPer = 1.0; frontSpeedPer = 1.5; frontRadiusPer = 0.5; }; function Sky::setStormClouds(%obj, %inStartT, %inLengthT, %outStartT, %outLengthT) { if(%inStartT < %outStartT) %obj.stormCloudsShow(false); else %obj.stormCloudsShow(true); %obj.schedule(%inStartT*1000, "stormClouds", 1, %inLengthT); %obj.schedule(%outStartT*1000, "stormClouds", 0, %outLengthT); } function Sky::setStormFog(%obj, %inStartT, %inLengthT, %inPer, %outStartT, %outLengthT, %outPer) { if(%inStartT < %outStartT) %obj.stormFogShow(false); else %obj.stormFogShow(true); %obj.schedule(%inStartT*1000, "stormFog", %inPer, %inLengthT); %obj.schedule(%outStartT*1000, "stormFog", %outPer, %outLengthT); } function Precipitation::setStorm(%obj, %inStartT, %inLengthT, %inPer, %outStartT, %outLengthT, %outPer) { if(%inStartT < %outStartT) %obj.stormShow(false); else %obj.stormShow(true); %obj.schedule(%inStartT*1000, "stormPrecipitation", %inPer, %inLengthT); %obj.schedule(%outStartT*1000, "stormPrecipitation", %outPer, %outLengthT); } function testStorm() { Sky.setStormClouds(0, 60, 70, 60); Sky.setStormFog(0, 60, 1, 70, 60, 0); Precipitation.setStorm(30, 30, 1, 70, 30, 0); } //-------------------------------------------------------------------------- // Fireball data //-------------------------------------------------------------------------- datablock ParticleData( FireballAtmosphereCrescentParticle ) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent3"; colors[0] = "1.0 0.75 0.2 1.0"; colors[1] = "1.0 0.75 0.2 0.5"; colors[2] = "1.0 0.75 0.2 0.0"; sizes[0] = 2.0; sizes[1] = 4.0; sizes[2] = 5.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( FireballAtmosphereCrescentEmitter ) { ejectionPeriodMS = 25; periodVarianceMS = 0; ejectionVelocity = 20; velocityVariance = 5.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "FireballAtmosphereCrescentParticle"; }; datablock ParticleData(FireballAtmosphereExplosionParticle) { dragCoefficient = 2; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 750; lifetimeVarianceMS = 150; textureName = "particleTest"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 0.0"; sizes[0] = 1; sizes[1] = 2; }; datablock ParticleEmitterData(FireballAtmosphereExplosionEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 12; velocityVariance = 1.75; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 60; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "FireballAtmosphereExplosionParticle"; }; datablock ExplosionData(FireballAtmosphereSubExplosion1) { explosionShape = "effect_plasma_explosion.dts"; faceViewer = true; delayMS = 50; offset = 3.0; playSpeed = 1.5; sizes[0] = "0.5 0.5 0.5"; sizes[1] = "0.5 0.5 0.5"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(FireballAtmosphereSubExplosion2) { explosionShape = "effect_plasma_explosion.dts"; faceViewer = true; delayMS = 100; offset = 3.5; playSpeed = 1.0; sizes[0] = "1.0 1.0 1.0"; sizes[1] = "1.0 1.0 1.0"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(FireballAtmosphereSubExplosion3) { explosionShape = "effect_plasma_explosion.dts"; faceViewer = true; delayMS = 0; offset = 0.0; playSpeed = 0.7; sizes[0] = "1.0 1.0 1.0"; sizes[1] = "2.0 2.0 2.0"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(FireballAtmosphereBoltExplosion) { soundProfile = PlasmaBarrelExpSound; particleEmitter = FireballAtmosphereExplosionEmitter; particleDensity = 250; particleRadius = 1.25; faceViewer = true; emitter[0] = FireballAtmosphereCrescentEmitter; subExplosion[0] = FireballAtmosphereSubExplosion1; subExplosion[1] = FireballAtmosphereSubExplosion2; subExplosion[2] = FireballAtmosphereSubExplosion3; shakeCamera = true; camShakeFreq = "10.0 9.0 9.0"; camShakeAmp = "70.0 70.0 70.0"; camShakeDuration = 1.3; camShakeRadius = 15.0; }; datablock ParticleData(FireballAtmosphereParticle) { dragCoeffiecient = 0.0; gravityCoefficient = -0.0; inheritedVelFactor = 0.85; lifetimeMS = 1600; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -100.0; spinRandomMax = 100.0; animateTexture = true; framesPerSec = 15; animTexName[00] = "special/Explosion/exp_0002"; animTexName[01] = "special/Explosion/exp_0004"; animTexName[02] = "special/Explosion/exp_0006"; animTexName[03] = "special/Explosion/exp_0008"; animTexName[04] = "special/Explosion/exp_0010"; animTexName[05] = "special/Explosion/exp_0012"; animTexName[06] = "special/Explosion/exp_0014"; animTexName[07] = "special/Explosion/exp_0016"; animTexName[08] = "special/Explosion/exp_0018"; animTexName[09] = "special/Explosion/exp_0020"; animTexName[10] = "special/Explosion/exp_0022"; animTexName[11] = "special/Explosion/exp_0024"; animTexName[12] = "special/Explosion/exp_0026"; animTexName[13] = "special/Explosion/exp_0028"; animTexName[14] = "special/Explosion/exp_0030"; animTexName[15] = "special/Explosion/exp_0032"; animTexName[16] = "special/Explosion/exp_0034"; animTexName[17] = "special/Explosion/exp_0036"; animTexName[18] = "special/Explosion/exp_0038"; animTexName[19] = "special/Explosion/exp_0040"; animTexName[20] = "special/Explosion/exp_0042"; animTexName[21] = "special/Explosion/exp_0044"; animTexName[22] = "special/Explosion/exp_0046"; animTexName[23] = "special/Explosion/exp_0048"; animTexName[24] = "special/Explosion/exp_0050"; animTexName[25] = "special/Explosion/exp_0052"; colors[0] = "1.0 0.7 0.5 1.0"; colors[1] = "1.0 0.5 0.2 1.0"; colors[2] = "1.0 0.25 0.1 0.0"; sizes[0] = 10.0; sizes[1] = 4.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.2; times[2] = 1.0; }; datablock ParticleEmitterData(FireballAtmosphereEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 0.25; velocityVariance = 0.0; thetaMin = 0.0; thetaMax = 30.0; particles = "FireballAtmosphereParticle"; }; datablock DebrisData( FireballAtmosphereDebris ) { emitters[0] = FireballAtmosphereEmitter; explosion = FireballAtmosphereBoltExplosion; explodeOnMaxBounce = true; elasticity = 0.0; friction = 1.0; lifetime = 100.0; lifetimeVariance = 0.0; numBounces = 0; bounceVariance = 0; ignoreWater = false; }; datablock FireballAtmosphereData(Fireball) { fireball = FireballAtmosphereDebris; }; PK !( scripts/webbrowser.cs//==-- FUNCTIONS ------------------------------------------------------------- //$strcheck = "14 : < > * ^ | ~ @ % & / \\ ` \""; //$strcheck = "13 : < > * ^ ~ @ % & / \\ ` \""; $strcheck = "7\t<\t>\t:\t%\t\\\t/\t\""; $strcheck2 = "5\t<\t>\t:\t%\t\\"; $playerGfx = "texticons/twb/twb_default.jpg"; $tribeGfx = "texticons/twb/twb_default.jpg"; //----------------------------------------------------------------------------- if(!isObject(TProfileHdr)) { new GuiControl(TProfileHdr); } //----------------------------------------------------------------------------- function BrowserSearchDone() { Canvas.popDialog(BrowserSearchDlg); %id = BrowserSearchMatchList.getSelectedId(); if(%id != -1) { if(BrowserSearchPane.query $= 4) TWBTabView.view(getField(BrowserSearchMatchList.getRowTextById(%id), 1), "Tribe"); else TWBTabView.view(getField(BrowserSearchMatchList.getRowTextById(%id), 0), "Warrior"); } } //----------------------------------------------------------------------------- function TextCheck2(%text,%handler) { %handler.textCheck = 0; for(%i=1;%i -1) { %handler.textCheck=1; break; } } } //----------------------------------------------------------------------------- function TextCheck(%text,%handler) { %handler.textCheck = 0; for(%i=1;%i -1) { %handler.textCheck=1; break; } } } //----------------------------------------------------------------------------- function BrowserStartSearch() { if(trim($BrowserSearchField) $="" || trim($BrowserSearchField) $="_") { MessageBoxOK("NOTICE","Blank/Underline searches are not allowed, enter one or more characters of text and try again.","Search_EditField.makeFirstResponder(1);"); } else { TextCheck($BrowserSearchField,BrowserSearchPane); if(!BrowserSearchPane.textCheck) { BrowserSearchPane.key = LaunchGui.key++; if(BrowserSearchPane.query==3) BrowserSearchPane.state = "warriorSearch"; else BrowserSearchPane.state = "tribeSearch"; BrowserSearchMatchList.clear(); canvas.SetCursor(ArrowWaitCursor); if(isEventPending(TribeAndWarriorBrowserGui.eid)) cancel(TribeAndWarriorBrowserGui.eid); TribeAndWarriorBrowserGui.eid = schedule(250,0,ExecuteSearch,0,BrowserSearchPane); } else { for(%x=0;%x 1) { TW_Admin.setVisible(1); TL_Invites.setVisible(1); } else { TW_Admin.setVisible(0); TL_Invites.setVisible(0); } } else { TProfileHdr.playerName = getField(%line,0); TProfileHdr.playerTag = getField(%line,1); TProfileHdr.appending = getField(%line,2); TProfileHdr.playerID = getField(%line,3); TProfileHdr.registered = getField(%line,4); TProfileHdr.onLine = getField(%line,5); TprofileHdr.playerURL = getField(%line,6); TProfileHdr.playerGFX = getField(%line,7); TProfileHdr.twa = 0; TProfileHdr.Desc = ""; if(getField(getRecord(WonGetAuthInfo(),0),3)==getField(%line,3)) TProfileHdr.twa = 1; for(%checkID=0;%checkID= 2) TProfileHdr.twa = 1; } W_Profile.setVisible(1); W_History.setVisible(1); W_Tribes.setVisible(1); %isMe = getField(getRecord(wonGetAuthInfo(),0),0)$=twbTitle.name; TProfileHdr.isMe = %isMe; // if(!TProfileHdr.twa) TProfileHdr.twa = TProfileHdr.isMe; if(TProfileHdr.twa) { W_BuddyList.setText("BUDDYLIST"); W_BuddyList.setVisible(1); W_BuddyList.command = "PlayerPane.ButtonClick(3);"; W_BuddyList.groupNum = 5; W_Admin.setVisible(1); } else { W_BuddyList.setText("OPTIONS"); W_BuddyList.setVisible(1); W_BuddyList.command = "PlayerPane.ButtonClick(4);"; W_BuddyList.groupNum = 4; W_Admin.setVisible(0); } } } //----------------------------------------------------------------------------- function getTribeLinkName(%text, %offset) { %name = getField(%text, %offset); %tag = getField(%text, %offset+1); return "" @ %name @ " - " @ %tag @ ""; } //----------------------------------------------------------------------------- function getTribeName(%text, %offset) { return getField(%text, %offset) @ " - " @ getField(%text, %offset + 1) TAB getField(%text, %offset); } //----------------------------------------------------------------------------- function SearchTribes() { if(BrowserSearchPane.query !$= 4) { // clear out the fields... $BrowserSearchField = ""; BrowserSearchMatchList.clear(); } Canvas.pushDialog(BrowserSearchDlg); Search_EditField.makeFirstResponder(1); BrowserSearchPane.setTitle("TRIBE SEARCH"); BrowserSearchPane.query = 4; } //----------------------------------------------------------------------------- function KillTribe(%tribe) { TWBTabView.closeCurrentPane(); Canvas.popDialog(TribePropertiesDlg); TribePane.key = LaunchGui.key++; TribePane.state = "killTribe"; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(18,%tribe,TribePane,TribePane.key); } //----------------------------------------------------------------------------- function LinkClearBuddylist(%owner,%handler) { %owner.key = LaunchGui.key++; %owner.state = %handler; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(26,"clearBuddy", %owner, %owner.key); } //----------------------------------------------------------------------------- function LinkRemoveBuddy(%player, %owner, %handler) { %owner.key = LaunchGui.key++; %owner.state = %handler; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(11, %player, %owner, %owner.key); } //----------------------------------------------------------------------------- function LinkAddBuddy(%player, %owner, %handler) { %owner.key = LaunchGui.key++; %owner.state = %handler; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(10, %player, %owner, %owner.key); } //----------------------------------------------------------------------------- function LinkBlockPlayer(%blockAddress,%owner,%state) { EMailBlockDlg.state = "setBlock"; EMailBlockDlg.key = LaunchGui.key++; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(9,%blockAddress,EmailBlockDlg,EMailBlockDlg.key); } //----------------------------------------------------------------------------- function LinkEditWarrior() { MessageBoxOK( "NOT YET", "This feature has not yet been implemented." ); } //----------------------------------------------------------------------------- function LinkEditWarriorDesc(%player, %handler) { Canvas.pushDialog(BrowserEditInfoDlg); EditDescriptionText.setValue(TProfileHdr.Desc); } //----------------------------------------------------------------------------- function LinkEditMember(%player, %tribe, %pv, %title,%owner) { // initialize buttons tb_onProbation.setVisible(true); tb_tribeMember.setVisible(false); tb_tribeAdmin.setVisible(false); tb_tribeController.setVisible(false); tb_sysAdmin.setVisible(false); tb_onProbation.setValue(false); tb_tribeMember.setValue(false); tb_tribeAdmin.setValue(false); tb_tribeController.setValue(false); tb_sysAdmin.setValue(false); %owner.vTribe = %tribe; %owner.vPlayer = %player; t_whois.setValue(%player); E_Title.setValue(%title); %ai = wonGetAuthInfo(); // Get callers rank in members tribe for(%i=0;%i1)) { %callerPv = getField(getRecord(%ai,2+%i),4); break; } } if(%callerPv > %pv) %rnk = %callerPv; else %rnk = %pv; %owner.vPerm = %rnk; if(getField(getRecord(%ai,0),0) $= getField(twbTitle.getValue(),0)) //if the caller is the member to be edited { switch( %pv ) { case 0: tb_onProbation.setValue(true); case 1: tb_tribeMember.setValue(true); tb_tribeMember.setVisible(true); case 2: tb_tribeMember.setVisible(true); tb_tribeAdmin.setVisible(true); tb_tribeAdmin.setValue(true); case 3: tb_tribeMember.setVisible(true); tb_tribeAdmin.setVisible(true); tb_tribeController.setVisible(true); tb_tribeController.setValue(true); case 4: tb_tribeMember.setVisible(true); tb_tribeAdmin.setVisible(true); tb_tribeController.setVisible(true); tb_sysAdmin.setVisible(true); tb_sysAdmin.setValue(true); } } else { switch( %rnk ) { case 1: tb_tribeMember.setVisible(true); case 2: tb_tribeMember.setVisible(true); tb_tribeAdmin.setVisible(true); case 3: tb_tribeMember.setVisible(true); tb_tribeAdmin.setVisible(true); tb_tribeController.setVisible(true); case 4: tb_tribeMember.setVisible(true); tb_tribeAdmin.setVisible(true); tb_tribeController.setVisible(true); tb_sysAdmin.setVisible(true); } switch( %pv ) { case 0: tb_onProbation.setValue(true); case 1: tb_tribeMember.setValue(true); case 2: tb_tribeAdmin.setValue(true); case 3: tb_tribeController.setValue(true); case 4: tb_sysAdmin.setValue(true); } } Canvas.pushDialog(%owner); } //----------------------------------------------------------------------------- function LinkLeaveTribe(%player,%handler) { %handler.key = LaunchGui.key++; %handler.state = "leaveTribe"; canvas.SetCursor(ArrowWaitCursor); %handler.leavingTribe = %player; DatabaseQuery(24,%player,%handler,%handler.key); } //----------------------------------------------------------------------------- function LinkKickMember(%player, %tribe, %owner) { %owner.warrior = %player; %owner.tribe = %tribe; TribePane.key = LaunchGui.key++; TribePane.state = "kickPlayer"; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(19,%player TAB %tribe TAB 0,TribePane,TribePane.key); } //----------------------------------------------------------------------------- function LinkMakePrimary(%action, %field, %owner) { %owner.key = LaunchGui.key++; %owner.state = %action; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(25,%field,%owner,%owner.key); } //----------------------------------------------------------------------------- function LinkTribeToggle(%action, %field, %owner, %handler) { TribePane.key = LaunchGui.key++; TribePane.state = "toggleTribe" @ %action; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(20,%action TAB %field,TribePane,TribePane.key); } //----------------------------------------------------------------------------- function LinkInvitePlayer(%tribe, %player, %owner, %handler) { %owner.key = LaunchGui.key++; %owner.state = %handler; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(27,%tribe TAB %player,%owner,%owner.key); } //----------------------------------------------------------------------------- function LinkTribeTag(%owner) { Canvas.pushDialog(%owner); } //----------------------------------------------------------------------------- function LinkBrowser(%player , %tabtype) { LaunchBrowser(%player , %tabtype); } //----------------------------------------------------------------------------- function LinkForum(%forum, %topic) { ForumsTopicsList.refreshFlag = true; LaunchForums( %forum, %topic ); } //----------------------------------------------------------------------------- function LinkWeb(%url) { gotoWebPage( %url ); } //----------------------------------------------------------------------------- function LinkInvitation(%action, %tribe, %player, %owner) { %owner.key = LaunchGui.key++; switch$(%action) { case "cancel": %owner.state = "cancelInvite"; case "accept": %owner.state = "acceptInvite"; case "reject": %owner.state = "rejectInvite"; } canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(28,%action TAB %tribe TAB %player,%owner,%owner.key); } //----------------------------------------------------------------------------- function LinkEMail(%MailTo) { Email_ToEdit.setText(%MailTo); Email_CCEdit.setText(""); $EmailSubject = ""; Canvas.pushDialog(EmailComposeDlg); EmailBodyText.setValue(""); Email_Subject.makeFirstResponder(1); } //----------------------------------------------------------------------------- function LinkEMailTribe(%MailTo) { // error("LEMT: " @ %MailTo); %toList = ""; %ccList = ""; %curLen = 0; %toggle = 0; for(%x = 0; %x < MemberList.rowCount(); %x++) { // %curLen = StrLen(%toList); %cWord = getField(MemberList.getRowText(%x),0); // if( (%curLen + StrLen(%cWord) + 1) <= 2000 ) if (%toggle == 0) { // error("ToList Adding: " @ %cWord TAB %curLen TAB %x); %toList = %toList @ %cWord @ ","; %toggle++; // Email_ToEdit.setText(Email_ToEdit.getValue() @ %cWord @ ","); } else { // error("CCList Adding: " @ %cWord TAB %curLen TAB %x); // Email_CCEdit.setText(Email_CCEdit.getValue() @ %cWord @ ","); %ccList = %ccList @ %cWord @ ","; %toggle = 0; } } // error("TOLIST: " @ strLen(%toList) NL %toList); //rror("CCList: " @ strLen(%ccList) NL %ccList); Email_ToEdit.setValue(getSubStr(%toList,0,Email_ToEdit.maxLength)); Email_CCEdit.setValue(getSubStr(%ccList,0,Email_CCEdit.maxLength)); $EmailSubject = ""; EmailBodyText.setValue(""); Canvas.pushDialog(EmailComposeDlg); Email_Subject.makeFirstResponder(1); } //----------------------------------------------------------------------------- function SearchWarriors() { if(BrowserSearchPane.query !$= 3) { // clear out the fields... $BrowserSearchField = ""; BrowserSearchMatchList.clear(); } Canvas.pushDialog(BrowserSearchDlg); BrowserSearchPane.setTitle("WARRIOR SEARCH"); BrowserSearchPane.query = 3; Search_EditField.makeFirstResponder(1); } //----------------------------------------------------------------------------- function SetMemberProfile() { if(strLen(trim(E_Title.getValue)) <= 0) { TextCheck(E_Title.getValue(),TribeAdminMemberDlg); if(TribeAdminMemberDlg.textCheck==0) { TribeAdminMemberDlg.key = LaunchGui.key++; TribeAdminMemberDlg.state = "setMemberProfile"; canvas.SetCursor(ArrowWaitCursor); %title = E_Title.getValue(); DatabaseQuery(21,TribeAdminMemberDlg.vTribe TAB TribeAdminMemberDlg.vPlayer TAB %title TAB TribeAdminMemberDlg.vPerm, TribeAdminMemberDlg, TribeAdminMemberDlg.key); Canvas.popDialog(TribeAdminMemberDlg); } else { MessageBoxOK("WARNING","Member Title contains illegal characters. Please correct and try again."); } } else MessageBoxOK("WARNING","Member Title cannot be blank...really."); } //----------------------------------------------------------------------------- function TAM_OnAction(%caller) { TribeAdminMemberDlg.vPerm = %caller; } //----------------------------------------------------------------------------- function updateTribeTagPreview() { %warrior = getField( WONGetAuthInfo(), 0 ); // Validate the tribe tag: %tag = CT_TagText.getValue(); %realTag = StripMLControlChars( %tag ); if ( %tag !$= %realTag ) CT_TagText.setValue( %realTag ); if ( $CreateTribeAppend ) CT_PreviewText.setValue( %warrior @ %realTag ); else CT_PreviewText.setValue( %realTag @ %warrior ); } //-- TribeAndWarriorBrowserGui ----------------------------------------------- function TribeAndWarriorBrowserGui::onWake(%this) { MemberList.ClearColumns(); W_MemberList.ClearColumns(); MemberList.Clear(); W_MemberList.clear(); Canvas.pushDialog(LaunchToolbarDlg); if ( TWBTabView.tabCount() == 0 ) { %info = WONGetAuthInfo(); // Open the player's page: %warrior = getField( %info, 0 ); TWBTabView.view( %warrior, "Warrior" ); w_profile.setValue(1); // Add tabs for the player's tribal pages: %tribeCount = getField( getRecord( %info, 1 ), 0 ); //%cert for ( %i = 0; %i < %tribeCount; %i++ ) { %tribe = getField( getRecord( %info, %i + 2 ), 0 ); //%cert TWBTabView.addTab( %i + 1, %tribe, 1 ); } } else if(PlayerPane.visible) PlayerPane.onWake(); else TribePane.onWake(); } //----------------------------------------------------------------------------- function TribeAndWarriorBrowserGui::setKey( %this, %key ) { } //----------------------------------------------------------------------------- function TribeAndWarriorBrowserGui::onClose( %this, %key ) { } //----------------------------------------------------------------------------- function TribeAndWarriorBrowserGui::connectionTerminated( %this, %key ) { if ( %key != %this.key ) return; } //----------------------------------------------------------------------------- function TribeAndWarriorBrowserGui::onSleep(%this) { if (TribeAndWarriorBrowserGui.WDialogOpen) WarriorPopupDlg.forceClose(); if (TribeAndWarriorBrowserGui.TDialogOpen) TribeMemberPopupDlg.forceClose(); Canvas.popDialog(LaunchToolbarDlg); } //==-- CreateTribeDlg ------------------------------------------------------- function CreateTribeDlg::onWake( %this ) { //rbAppendTab.setValue(1); updateTribeTagPreview(); } //----------------------------------------------------------------------------- function CreateTribeDlg::CreateTribe(%this) { CreateTribeProcess(); } //----------------------------------------------------------------------------- function CreateTribeDlg::Cancel(%this) { Canvas.PopDialog(CreateTribeDlg); $CreateTribeName = ""; $CreateTribeTag = ""; CreateTribeDlg.delete(); if(isObject(CreateTribeDlg)) CreateTribeDlg.delete(); } //----------------------------------------------------------------------------- function CreateTribeDlg::onDatabaseQueryResult(%this,%status,%resultString,%key) { if ( %this.key != %key ) return; // echo("RECV: " @ %status); if(getField(%status,0)==0) { switch$(%this.state) { case "createTribe": TWBTabView.view( $CreateTribeName, "Tribe" ); Canvas.popDialog(CreateTribeDlg); $CreateTribeName = ""; $CreateTribeTag = ""; if(isObject(CreateTribeDlg)) CreateTribeDlg.delete(); WonUpdateCertificate(); } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else { %this.state = "error"; MessageBoxOK("WARNING",getField(%status,1)); } Canvas.setCursor(defaultCursor); } //----------------------------------------------------------------------------- function CreateTribeDlg::onDatabaseRow(%this,%row,%isLastRow,%key) { if( %this.key != %key ) return; // echo("RECV: " @ %row); } //==-- TribeAdminMemberDlg --------------------------------------------------- function TribeAdminMemberDlg::onWake(%this) { } //----------------------------------------------------------------------------- function TribeAdminMemberDlg::onDatabaseQueryResult( %this, %status, %resultString, %key) { if ( %this.key != %key ) return; echo("RECV: " @ %status); if(getField(%status,0)==0) { switch$(%this.state) { case "setMemberProfile": %this.state = "done"; ForumsTopicsList.refreshFlag = true; if (getField(%status,3) == getField(getRecord(WonGetAuthInfo(),0),3)) messageBoxOK("COMPLETE","Member Profile has been updated","WonUpdateCertificate();TL_Profile.setValue(1);"); else messageBoxOK("COMPLETE",getField(%status,1)); } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else messageBoxOK("WARNING",getField(%status,1)); Canvas.setCursor(defaultCursor); } //----------------------------------------------------------------------------- function TribeAdminMemberDlg::onDatabaseRow(%this,%row,%isLastRow,%key) { if ( %this.key != %key ) return; // echo("RECV: " @ %row); } //----------------------------------------------------------------------------- function TribeAdminMemberDlg::connectionTerminated( %this, %key ) { if ( %this.key != %key ) return; if ( %this.errorState $= "OK" ) TWBTabView.refresh(); } //==-- BrowserSearchDlg ----------------------------------------------------- function BrowserSearchDlg::onWake( %this ) { if ( BrowserSearchMatchList.getSelectedId() == -1 ) BSearchOKBtn.setActive( false ); } //----------------------------------------------------------------------------- function BrowserSearchPane::GetOnlineStatus(%this) { %this.key = LaunchGui.key++; %this.status = "getOnline"; for(%oStat=0;%oStatRequest Invite") : "NO"); %Tdesc = %Tdesc @ "" NL ""; TWBText.setText(%TDesc); TProfileHdr.Desc = %resultString; if(trim(TProfileHdr.tribegfx) !$= "") TeamPix.setBitmap(TProfileHdr.tribegfx); else TeamPix.setBitmap($TribeGfx); TWBTitle.name = TPRofileHdr.tribeName; TWBTitle.setValue(TProfileHdr.tribeName TAB TProfileHdr.tribeTag); TWBText.SetText(TWBText.getText() NL TProfileHdr.Desc); if(memberlist.rowCount()==0) { %this.needRefresh = 0; TL_ROSTER.setValue(1); } case "getTribeRoster": //error("GTRoster Rows: " @ getField(%resultString,0)); %this.linecount--; %this.MList = ""; %this.trid = 0; if(isObject(memberListGroup)) memberListGroup.delete(); if(getField(%resultString,0)>0) { %this.state = "tribeRoster"; %this.rosterRowcount = getField(%resultString,0); } else { %this.state="done"; messageBoxOK("NOTICE","No Tribe Members Found."); } case "getTribeNews": TWBText.Clear(); %this.articleLines = 0; if(GetTribeMember(TProfileHdr.tribeName)) { TWBText.SetText("" @ TProfileHdr.tribeName @ " Options:" @ "\n\nTribal Forum\n" @ "Tribal Chat: Public\n" @ "Tribal Chat: Private"); } else { TWBText.SetText("" @ TProfileHdr.tribeName @ " Options:\n\n" @ "Enter " @ TProfileHdr.tribeName @ " Public Chat\n" ); } %this.state = "done"; // if(getField(%resultString,0)>0) // { // %this.state = "tribeNews"; // } // else // { // %this.state="done"; // messageBoxOK("NOTICE","No Tribe News."); // } case "getTribeInvites": if(getField(%resultString,0) > 0) { %this.state = "tribeInvites"; %this.tiid = 0; if(isObject(memberListGroup)) memberListGroup.delete(); } else { %this.NeedRefresh = 0; %this.state = "done"; } case "cancelInvite": %this.state = "done"; tl_invites.setValue(1); case "setTribeGfx": %this.state = "done"; messageBoxOK("NOTICE",getField(%status,1)); tl_profile.setValue(1); case "changeTribeTag": %this.state = "done"; messageBoxOK("NOTICE","Tribe Tag has been updated.","WonUpdateCertificate();"); case "requestInvite": %this.state = "done"; messageBoxOK("NOTICE",getField(%status,1)); } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else { %this.state = "done"; messageBoxOK("WARNING",getField(%status,1)); } canvas.setCursor(DefaultCursor); } //----------------------------------------------------------------------------- function TribePane::onDatabaseRow(%this, %row, %isLastRow, %key) { if ( %this.key != %key ) return; // echo("RECV: " @ %row); switch$(%this.state) { case "tribeRoster": %name = getField(%row, 0); %wid = getField(%row,3); %linkName = getLinkName(%row, 0); %adminLevel = getField(%row, 5); %title = getField(%row, 4); %date = getField(%row, 6); %editkick = getField(%row, 8); %onLine = getField(%row,9); if(%this.Admin $= "007") %this.Admin = %name; if(%name !$="") { MemberList.AddMember(%this.trid, %wid,%name,%adminLevel,%editkick,%row); MemberList.AddRow(%wid,%name TAB %title TAB %adminLevel TAB %this.trid); %this.trid++; //MemberList.setRowStylebyID( %wid, !%onLine ); } if(%isLastRow) { %this.MList = %this.MList @ %name; MemberList.GetOnlineStatus(); if(%this.needRefresh) { %this.needRefresh = 0; TL_ROSTER.setValue(1); } } else %this.MList = %this.MList @ %name @ ","; %this.linecount++; case "tribeNews": %this.articleID = getField(%row,0); %this.forumName = getField(%row,1); %authorQuad = getFields(%row,5,8); %this.articleAuthor = getLinkName(%authorQuad); %this.articleUpdate = getField(%row,9); %this.articleTitle = getField(%row,10); %text = "" @ "" @ %this.articleTitle @ ""NL " submitted by " @ %this.articleAuthor SPC "on" SPC %this.articleUpdate @ "\n"; %text = %text @ getFields(%row,11); TWBText.SetText(TWBText.GetText() @ %text @ "\n------------------------------------\n\n"); case "tribeInvites": %inviteId = getField(%row,0); %inviteDate = getField(%row,1); %invitorQuad = getField(getfields(%row,2,5),0); %invitedQuad = getField(getFields(%row,6,9),0); %isOwned = getField(%row,10); %onLine = getField(%row,11); MemberList.AddInvite(%this.tiID, %inviteID,%invitedQuad,%invitorQuad,%isOwned,%row); MemberList.AddRow(%inviteID, getField(%invitedQuad,0) TAB %inviteDate TAB %this.tiID); %this.tiID++; MemberList.setRowStylebyID( %inviteId, !%onLine ); if(%isLastRow) MemberList.GetOnlineStatus(); } } //----------------------------------------------------------------------------- function TribePane::connectionTerminated(%this,%key) { canvas.setCursor(DefaultCursor); if (%this.NeedRefresh==1) { %this.NeedRefresh = 0; TWBTitle.OldText = TWBTitle.name; TL_Roster.setValue(1); } } //----------------------------------------------------------------------------- function TribePane::RosterDblClick(%this) { LaunchBrowser( GetField(MemberList.getRowText(MemberList.getSelectedRow()),0), "Warrior" ); } //----------------------------------------------------------------------------- function TribePane::ButtonClick( %this, %senderid ) { canvas.SetCursor(ArrowWaitCursor); %this.tabstate = "TRIBE"; %this.state = "status"; %tribeName = TWBTabView.getSelectedText(); if(isEventPending(TribeAndWarriorBrowserGui.eid)) cancel(TribeAndWarriorBrowserGui.eid); switch(%senderid) { case 0: //PROFILE if(TWBTitle.OldText $= TWBTitle.name || MemberList.rowCount()==0) %this.NeedRefresh=0; else %this.NeedRefresh=1; %this.key = LaunchGui.key++; %this.state = "getTribeProfile"; TWBTitle.OldText = TWBTitle.name; TribeAndWarriorBrowserGui.eid = schedule(500,0,DatabaseQuery,22,%tribeName,%this,%this.key); case 1: //ROSTER MemberList.Clear(); MemberList.ClearColumns(); MemberList.clearList(); MemberList.CID = 0; %this.key = LaunchGui.key++; %this.state = "getTribeRoster"; %this.tstate = "ROSTER"; MemberList.addColumn( 0, "MEMBER", 92, 0, 100,"left"); MemberList.addColumn( 1, "TITLE", 90, 0, 100,"left"); MemberList.addColumn( 2, "RNK", 30, 0, 40, "numeric center" ); TribeAndWarriorBrowserGui.eid = schedule(500, 0, DatabaseQueryArray,6,0,%tribeName,%this,%this.key, true); case 2: //NEWS BUTTON %this.key = LaunchGui.key++; %this.state = "getTribeNews"; %this.tstate = "NEWS"; TribeAndWarriorBrowserGui.eid = schedule(500, 0, DatabaseQueryArray,10,20,%tribeName,%this,%this.key,true); case 3: //INVITE BUTTON MemberList.Clear(); MemberList.ClearColumns(); MemberList.clearList(); MemberList.CID = 1; %this.key = LaunchGui.key++; %this.state = "getTribeInvites"; %this.tstate = "INVITES"; MemberList.addColumn( 0, "PLAYER", 100, 0, 350,"left" ); MemberList.addColumn( 1, "INVITED", 112, 0, 300, "left" ); TribeAndWarriorBrowserGui.eid = schedule(500, 0, DatabaseQueryArray,11,0,%tribeName,%this,%this.key,true); case 4: //Admin Tribe if(trim(TWBText.getText()) !$= "") { TribePropertiesDlg.pendingChanges = ""; Canvas.PushDialog(TribePropertiesDlg); } else { tl_profile.setvalue(1); MessageBoxOk("ERROR","The Tribe Profile was not properly loaded, please wait a moment and try again"); } } } //----------------------------------------------------------------------------- //==-- PlayerPane ------------------------------------------------------------ //----------------------------------------------------------------------------- function PlayerPane::onAdd(%this) { // Add the popup menu: new GuiControl(WarriorPopupDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; new ShellPopupMenu( WarriorPopup ) { profile = "ShellPopupProfile"; position = "0 0"; extent = "0 0"; minExtent = "0 0"; visible = "1"; maxPopupHeight = "200"; noButtonStyle = "1"; }; }; } //----------------------------------------------------------------------------- function PlayerPane::onWake(%this) { w_admin.setVisible(getField(getRecord(wonGetAuthInfo(),0),0) $= TProfileHdr.PlayerName); if(trim(TProfileHdr.playerGfx)$="") PlayerPix.setBitmap($PlayerGfx); else PlayerPix.setBitmap(TProfileHdr.playergfx); w_profile.setValue(1); } //----------------------------------------------------------------------------- function PlayerPane::onDatabaseQueryResult(%this,%status,%resultString,%key) { if(%this.key != %key) return; // echo("RECV: " @ %status); if(getField(%status,0)==0) { switch$(%this.state) { case "getWarriorProfile": %isCaller = getField(getRecord(wonGetAuthInfo(),0),0) $= TWBTitle.name; TWBTitle.name = getField(%status,2); TWBTitle.SetValue(( getField(%status,4) ? getField(%status,2) @ getField(%status,3) : getField(%status,3) @ getField(%status,2))); GetProfileHdr(1,getFields(%status,2)); if(trim(TProfileHdr.playerGfx) !$= "") PlayerPix.setBitmap(TProfileHdr.playerGfx); else PlayerPix.setBitmap($PlayerGfx); %profileText = " \n"; %profileText = %profileText @ "Registered:" SPC TProfileHdr.registered @ "\n"; // %profileText = %profileText @ "Online: " SPC (TProfileHdr.onLine ? "YES":"NO") @ "\n"; if(trim(TProfileHdr.playerURL) !$= "") %profileText = %profileText @ "WebSite: " SPC ""@TProfileHdr.playerURL@"\n\n"; else %profileText = %profileText @ "WebSite: " SPC "www.tribes2.com\n\n"; %profileText = %profileText @ ""; W_Text.setText(%profileText @ %resultString); TProfileHdr.Desc = %resultString; if( w_memberlist.rowCount() ==0 ) { %this.needRefresh = 0; W_tribes.setValue(1); } case "getWarriorHistory": W_Text.setText("\nPLAYER HISTORY:\n\n"); W_Text.setText(W_Text.getText() @ ""); if(getField(%resultString,0)>0) %this.state = "warriorHistory"; else %this.state = "done"; case "getWarriorTribeList": %this.wtid = 0; if(isObject(w_memberListGroup)) w_memberListGroup.delete(); if(getField(%resultString,0)>0) %this.state = "warriorTribeList"; else %this.state = "done"; case "getWarriorBuddyList": %this.blid = 0; if(isObject(w_memberListGroup)) w_memberListGroup.delete(); if(getField(%resultString,0)>0) %this.state = "warriorBuddyList"; else %this.state = "done"; case "setNoPrimaryTribe": %this.state = "done"; messageBoxOK("NOTICE","You are now a free agent, primary tribe settings have been cleared"); case "setPrimaryTribe": %this.state = "done"; messageBoxOK("NOTICE",getField(%resultString,0) SPC "has been flagged as your primary tribe.","WonUpdateCertificate();"); case "removeBuddy": %this.state = "done"; w_buddylist.setvalue(1); case "inviteWarrior": %this.state = "done"; MessageBoxOK("NOTICE",getField(%status,1)); case "acceptInvite": %this.state = "done"; EMailMessageDelete(); MessageBoxOK("NOTICE","Your Invite Acceptance has been sent","WonUpdateCertificate();"); case "rejectInvite": %this.state = "done"; EMailMessagedelete(); MessageBoxOK("NOTICE","Your Invite Rejection has been sent","CheckEmail();"); case "leaveTribe": %this.state = "done"; WonUpdateCertificate(); for(%x=0;%xContact " @ TWBTitle.name @ "\n"; %newText = %newText @ "Add to Buddylist\n"; if(%callerTribes > 0) { for(%z=0;%z<%callerTribes;%z++) { %jtribe = getField(%callerTribeList,4*%z); %newText = %newText @ "Invite " @ TWBTitle.name @ " to join " @ %jtribe @ "\n"; } } else { if(getField(getRecord(wonGetAuthInfo(),1),0)>0) { for(%z=0;%zInvite " @ TWBTitle.name @ " to join " @ %jtribe @ "\n"; } } } } else { %newText = "OPTIONS:\n\n"; %newText = %newText @ "Edit Warrior Name\n"; %newText = %newText @ "Edit Description\n"; } W_Text.setText("" @ %newText @ "\n"); case "setPlayerGfx": %this.state = "done"; MessageBoxOK("CONFIRMED",getField(%status,1)); case "setPlayerUrl": %this.state = "done"; MessageBoxOK("CONFIRMED",getField(%status,1)); case "changePlayerName": %this.state = "done"; IRCClient::quit(); if(WonUpdateCertificate()) { TProfileHdr.playername = NewNameEdit.getValue(); wp_currentname.setText(NewNameEdit.getValue()); twbTabView.setTabText(twbTabView.getSelectedId(),NewNameEdit.getValue()); MessageBoxOK("CONFIRMED","Warrior name has been changed." NL "This will require you to close and restart the game to ensure proper function","WarriorPropertiesDlg.onWake();"); } case "clearWarriorDescription": %this.state = "done"; MessageBoxOK("CONFIRMED","Warrior Description Cleared"); } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else { %this.state = "error"; MessageBoxOK("WARNING",getField(%status,1)); } canvas.setCursor(DefaultCursor); } //----------------------------------------------------------------------------- function PlayerPane::onDatabaseRow(%this,%row,%isLastRow,%key) { if(%this.key != %key) return; // echo("RECV: " @ %row); switch$(%this.state) { case "warriorHistory": W_Text.setText(W_Text.getText() @ %row @ "\n"); if(%isLastRow) { %this.state = "done"; if( %this.needRefresh ) { %this.needRefresh = 0; W_tribes.setValue(1); } } case "warriorTribeList": %wid = getField(%row,2); %name = getField(%row,0); %title = getField(%row,5); %adminLevel = getField(%row,3); %editkick = getField(%row,4); W_MemberList.AddMember(%this.wtid, %wid,%name,%adminLevel,%editkick,%row); W_MemberList.AddRow(%wid,%name TAB %title TAB %adminLevel TAB %this.wtid); %this.wtid++; case "warriorBuddyList": W_MemberList.AddInvite(%this.blid, getField(%row,3),getFields(%row,0,3),getFields(%row,0,3),4,%row); W_MemberList.AddRow(getField(%row,3),getField(%row,0) TAB getField(%row,4) TAB %this.blid); %this.blid++; if(%isLastRow) W_MemberList.getOnlineStatus(); // W_MemberList.setRowStyleByID(getField(%row,3),!getField(%row,5)); } } //----------------------------------------------------------------------------- function PlayerPane::DblClick(%this) { if(w_buddylist.getValue()==1 && getField(GetRecord(wonGetAuthInfo(),0),0) $= TWBTabView.getTabText(TWBTabView.GetSelectedID())) %caller = "Warrior"; else if (w_tribes.getValue()==1) %caller = "Tribe"; else %caller = ""; if(trim(%caller) !$="") LaunchBrowser( GetField(W_MemberList.getRowText(W_MemberList.getSelectedRow()),0), %caller); } //----------------------------------------------------------------------------- function PlayerPane::ButtonClick( %this, %senderid ) { canvas.SetCursor(ArrowWaitCursor); %this.key = LaunchGui.key++; %this.tabstate = "WARRIOR"; if(isEventPending(TribeAndWarriorBrowserGui.eid)) cancel(TribeAndWarriorBrowserGui.eid); switch(%senderid) { case 0: //Player Profile w/ Description W_Text.setValue(""); %this.state = "getWarriorProfile"; %this.qrystatus = 0; %owner = getField(getRecord(WonGetAuthInfo(),0),0); %playerName = TWBTabView.getTabText(TWBTabView.GetSelectedID()); if(TWBTitle.OldText $= TWBTitle.name || w_memberlist.rowCount()==0) %this.NeedRefresh=0; else %this.NeedRefresh=1; TWBTitle.OldText = TWBTitle.name; if (%owner $= %PlayerName) %callId = 2; else %callId = 1; TribeAndWarriorBrowserGui.eid = schedule(500,0,DatabaseQuery,23,%playerName,%this,%this.key); case 1: //Player History W_Text.setValue(""); %this.state = "getWarriorHistory"; %this.qrystatus = 1; %playerName = TWBTabView.getTabText(TWBTabView.GetSelectedID()); %callId = 3; TribeAndWarriorBrowserGui.eid = schedule(500,0,DatabaseQueryArray,12,0,%playerName,%this,%this.key,true); case 2: //TribeList W_MemberList.Clear(); W_MemberList.ClearColumns(); W_MemberList.clearList(); W_MemberList.CID = 0; %this.wtid = 0; %this.state = "getWarriorTribeList"; W_MemberList.addColumn( 0, "TRIBE", 94, 0, 330 ); W_MemberList.addColumn( 1, "TITLE", 80, 0, 300 ); W_MemberList.addColumn( 2, "RNK", 38, 0, 50, "numeric center" ); %playerName = TWBTabView.getTabText(TWBTabView.GetSelectedID()); if(%playerName $= getField(getRecord(wonGetAuthInfo(),0),0)) { %ai = wonGetAuthInfo(); for(%ix=0;%ix= 2; W_MemberList.AddMember(%this.wtid, %wid,%name,%adminLevel,%editkick,%row); W_MemberList.AddRow(%wid,%name TAB %title TAB %adminLevel TAB %this.wtid); %this.wtid++; } } else TribeAndWarriorBrowserGui.eid = schedule(500,0,DatabaseQueryArray,13,0,%playerName,%this,%this.key,true); case 3: //Player Buddylist W_MemberList.Clear(); W_MemberList.ClearColumns(); W_MemberList.clearList(); W_MemberList.CID = 1; W_MemberList.addColumn( 0, "BUDDY", 100, 0, 250 ); W_MemberList.addColumn( 1, "SINCE", 112, 0, 250 ); %this.key = LaunchGui.key++; %this.state = "getWarriorBuddyList"; %playerName = TWBTabView.getTabText(TWBTabView.GetSelectedID()); TribeAndWarriorBrowserGui.eid = schedule(500,0,DatabaseQueryArray,5,0,%playerName,%this,%this.key,true); case 4: //Visitor Options W_Text.setValue(""); %this.state = "getVisitorOptions"; %owner = getField(getRecord(WonGetAuthInfo(),0),0); %playerName = TWBTabView.getTabText(TWBTabView.GetSelectedID()); TWBTitle.OldText = TWBTitle.name; TribeAndWarriorBrowserGui.eid = schedule(500,0,DatabaseQuery,23,%playerName,%this,%this.key,true); case 5: //Admin Options if(trim(w_text.getText()) !$= "") { WarriorPropertiesDlg.pendingChanges = ""; Canvas.PushDialog(WarriorPropertiesDlg); } else { w_profile.setValue(1); messageBoxOK("ERROR","Your Profile was not loaded properly, Please wait a moment and try again"); } } } //----------------------------------------------------------------------------- function W_MemberList::ClearList() { if(isObject(W_MemberListGroup)) W_MemberListGroup.Delete(); } //----------------------------------------------------------------------------- function W_MemberList::AddMember(%this,%mid, %id, %name, %access, %plevel, %vline) { if(!isObject(W_MemberListGroup)) new SimGroup(W_MemberListGroup); %player = new scriptObject() { className = "TMember"; rowID = %mid; name = %name; classId = %id; privLevel = %access; canAdmin = %plevel; rcvrec = %vline; }; W_MemberListGroup.Add(%player); } //----------------------------------------------------------------------------- function W_MemberList::AddInvite(%this, %rid, %id, %invited, %invitor, %plevel, %vline) { if(!isObject(W_MemberListGroup)) new SimGroup(W_MemberListGroup); %player = new ScriptObject() { className = "TBuddy"; rowID = %rid; classId = %id; name = %invited; privLevel = %plevel; iName = %invitor; rcvrec = %vline; }; W_MemberListGroup.add(%player); } //----------------------------------------------------------------------------- function W_MemberList::onRightMouseDown( %this, %column, %row, %mousePos ) { // Open the action menu: W_MemberList.setSelectedRow(%row); if(getField(GetRecord(WonGetAuthInfo(),0),0) $= TWBTabView.getTabText(TWBTabView.GetSelectedID())) //is it me? { if(w_tribes.getValue()) %ka = 3; else %ka = 2; warriorPopup.player = w_memberlistgroup.getObject(getField(W_MemberList.getRowText(W_MemberList.getSelectedRow()),%ka)); if ( WarriorPopup.player.name !$= "" ) { WarriorPopup.position = %mousePos; Canvas.pushDialog(WarriorPopupDlg); WarriorPopUpDlg.onWake(); WarriorPopup.forceOnAction(); } else error( "Member/Invite Locate Error!" ); } } //----------------------------------------------------------------------------- function w_MemberList::onAdd(%this) { W_MemberList.addStyle( 1, "Univers", 12 , "150 150 150", "200 200 200", "60 60 60" ); } //----------------------------------------------------------------------------- function W_MemberList::GetOnlineStatus(%this) { %this.key = LaunchGui.key++; %this.status = "getOnline"; for(%oStat=0;%oStat<%this.RowCount();%oStat++) { if(%oStat == 0) %roster = %this.getRowID(%oStat); else %roster = %roster TAB %this.getRowID(%oStat); } databaseQuery(69,%roster, %this,%this.key); } //----------------------------------------------------------------------------- function W_MemberList::onDatabaseQueryResult(%this,%status,%resultString,%key) { if(%key != %this.key) return; switch$(%this.status) { case "getOnline": if(getField(%status,0) == 0) for(%str=0;%str\n" @ %player @ "" @ %tribe @ "?", "LinkLeaveTribe(\"" @ %tribe @ "\",\"" @ PlayerPane @ "\");",""); case 3: // 3 Go To TribeForum %tribe = getField(WarriorPopup.player.name,0); switch$(%tribe) { case "T2 ADMINISTRATION": %tribe = "Game Feedback"; } ForumsThreadPane.setVisible(false); ForumsTopicsPane.setVisible(true); linkForum(%tribe,""); case 4: // 4 EMail Buddy %player = getField(WarriorPopup.player.name,0); LinkEMail(%player); case 5: // 5 Remove Buddy %player = getField(WarriorPopup.player.name,0); LinkRemoveBuddy(%player, PlayerPane, "removeBuddy"); case 6: // clear Buddylist; LinkClearBuddylist(PlayerPane,"removeBuddy"); case 7: // 7 EMail Buddylist for(%x=0;%x\n" @ %player @ " from " @ %tribe @ "?", "LinkKickMember(\"" @ %player @ "\",\"" @ %tribe @ "\"," @ %this @ ");", ""); case 1: // 1 Admin Member LinkEditMember(GetField(TribememberPopup.player.rcvrec,0) ,TWBTabView.GetTabText(TWBTabView.GetSelectedID()) ,GetField(TribeMemberPopup.player.rcvrec,5) ,GetField(TribeMemberPopup.player.rcvrec,4) ,TribeAdminMemberDlg); case 2: // 2 EMail Member LinkEMail(TribeMemberPopup.player.name); case 3: // 3 EMail Tribe LinkEMailTribe(MemberList.getSelectedID()); case 4: // 4 Add To Buddylist MessageBoxYesNo("CONFIRM","Add " @ TribeMemberPopup.player.name @ " to Buddy List?", "LinkAddBuddy(\"" @ TribeMemberPopup.player.name @ "\",TWBText,\"addBuddy\");",""); case 5: // 5 Add To Blocklist MessageBoxYesNo("CONFIRM","Block Email from " @ TribeMemberPopup.player.name @ "?", "LinkBlockPlayer(\"" @ TribeMemberPopup.player.name @ "\",EmailGui,\"setBlock\");",""); // -- 1-INVITE ---- case 6: // 6 Cancel Invite %player = TribeMemberPopup.player.name; %tribe = TWBTabView.GetTabText(TWBTabView.GetSelectedID()); MessageBoxYesNo("CONFIRM", "Are you sure you wish to cancel the invitation for " @ %player @ " to join " @ %tribe @ "?", "TribeMemberPopup.onSelect(12,\"call12\");",""); case 7: // 7 EMail Invited Player LinkEMail(TribeMemberPopup.player.name); case 8: // 8 INVITE TO CHAT MessageboxOK("NOTICE","This is a preview of coming functionality and is not yet available for use."); case 9: case 10: case 11: case 12: %player = TribeMemberPopup.player.name; %tribe = TWBTabView.GetTabText(TWBTabView.GetSelectedID()); LinkInvitation("cancel",%tribe,%player,TribePane); } canvas.popDialog(TribeMemberPopupDlg); } //----------------------------------------------------------------------------- function TribeMemberPopupDlg::onSleep(%this) { TribeWarriorBrowserGui.TDialogOpen = false; } //----------------------------------------------------------------------------- function TribePropertiesDlg::onWake(%this) { if(TProfileHdr.recruiting) TP_RecruitFlagBtn.setValue(1); else TP_RecruitFlagNoBtn.setValue(1); if(TProfileHdr.appending) TP_AppendFlagBtn.setValue(1); else TP_PrePendFlagBtn.setValue(1); TP_CurrentTag.setText(TProfileHdr.TribeTag); TP_NewTag.setText(TProfileHdr.TribeTag); TP_TribeDescription.setText(TProfileHdr.Desc); %this.RefreshTag(); %this.pendingChanges = ""; } //----------------------------------------------------------------------------- function TribePropertiesDlg::Close(%this) { if(%this.pendingChanges $="") { Canvas.popDialog(%this); GraphicsControl.setVisible(0); SecurityControl.setVisible(0); ProfileControl.setVisible(1); TL_Profile.setValue(1); } else MessageBoxYesNo("CONFIRM","Close without saving changes?", "Canvas.popDialog("@%this@");TL_Profile.setValue(1);",""); } //----------------------------------------------------------------------------- function TribePropertiesDlg::DisbandTribe(%this) { MessageBoxYesNo("CONFIRM","NOTE: Only the Tribe Owner will be able to disband the Tribe." NL " " NL "DISBAND " @ TProfileHdr.tribename @ "?", "KillTribe(\"" @ TProfileHdr.tribename @ "\");",""); } //----------------------------------------------------------------------------- function TribePropertiesDlg::ChangeRecruiting(%this) { if(TP_RecruitFlagBtn.getValue()) %recruiting = 1; else %recruiting = 0; if(TProfileHdr.recruiting != %recruiting) { LinkTribeToggle("Recruiting",TProfileHdr.TribeName TAB TP_RecruitFlagBtn.getValue(),TWBText,"togglerecruiting"); %this.pendingChanges=""; } } //----------------------------------------------------------------------------- function TribePropertiesDlg::ToggleAppending(%this) { if(TProfileHdr.appending != TP_AppendFlagBtn.getValue()) { LinkTribeToggle("Appending",TProfileHdr.TribeName TAB TP_AppendFlagBtn.getValue(),TWBText,"toggleappending"); %this.pendingChanges=""; } } //----------------------------------------------------------------------------- function TribePropertiesDlg::ChangeTag(%this) { if(TP_NewTag.getValue() !$= "") { TextCheck(TP_NewTag.getValue(),%this); if(%this.textCheck==1) { MessageBoxOK("WARNING","The requested Tribe Tag contains invalid characters, please change your tag and try again."); } else { TribePane.key = LaunchGui.key++; TribePane.state = "changeTribeTag"; DatabaseQuery(30,TProfileHdr.tribeID TAB TP_NewTag.getValue(),TribePane,TribePane.key); %this.pendingChanges=""; } } else { MessageBoxOK("WARNING","Tribe Tag cannot be blank","TP_NewTag.makeFirstResponder(1);"); } } //----------------------------------------------------------------------------- function TribePropertiesDlg::EditDescription(%this) { %this.pendingChanges = "EDITDESC"; %this.UpdateDescription(); } //----------------------------------------------------------------------------- function TribePropertiesDlg::ClearDescription(%this) { TribePane.key = LaunchGui.key++; TP_TribeDescription.setText(""); TProfileHdr.Desc = ""; TWBText.editType = "tribe"; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(15,TProfileHdr.tribename TAB getRecordCount(%desc) TAB %desc,TribePane,TribePane.key); } //----------------------------------------------------------------------------- function TribePropertiesDlg::UpdateDescription(%this) { TWBText.editType = "tribe"; LinkEditWarriorDesc(TProfileHdr.tribename,TWBText); } //----------------------------------------------------------------------------- function TribePropertiesDlg::RefreshTag(%this) { %this.pendingChanges = "YES"; %playerName = GetField( WonGetAuthInfo(), 0 ); // Validate the tribe tag: %ntag = TP_NewTag.getValue(); %realTag = StripMLControlChars( %ntag ); if ( %ntag !$= %realTag ) TP_NewTag.setValue( %realTag ); if ( TP_PrePendFlagBtn.getValue()==0 ) TP_PreviewTag.setValue( %playerName @ %realTag ); else TP_PreviewTag.setValue( %realTag @ %playerName ); } //----------------------------------------------------------------------------- function TribePropertiesDlg::LoadGfxPane(%this) { TribeGraphic.setBitmap(TProfileHdr.tribeGfx); %ctrl = TribeGraphicsList; %fileSpec = "*.jpg"; %ctrl.clearColumns(); %ctrl.clear(); %ctrl.addColumn( 0, "FILENAME", 100, 0, 200 ); %id = -1; %rowId = ""; for ( %file = findFirstFile( %fileSpec ); %file !$= ""; %file = findNextFile( %fileSpec ) ) { %currBmp = TeamPix.Bitmap; %match = "texticons/twb/" @ fileBase( %file ) @ ".jpg" $= %currBmp; if(getSubStr(fileBase(%file) @ ".jpg",0,3)$= "twb") %ctrl.addRow( %id++, fileBase( %file ) ); if(%match) %rowId = %id; } if(%rowID!$="") %ctrl.setSelectedRow(%rowID); } //----------------------------------------------------------------------------- function TribePropertiesDlg::setTribeGraphic(%this) { if(isEventPending(TribeAndWarriorBrowserGui.eid)) cancel(TribeAndWarriorBrowserGui.eid); TribePane.key = LaunchGui.key++; TribePane.state = "setTribeGfx"; TeamPix.setBitmap(TribeGraphic.bitmap); canvas.SetCursor(ArrowWaitCursor); TribeAndWarriorBrowserGui.eid = schedule(250,0,DatabaseQuery,29,TProfileHdr.tribename TAB TribeGraphic.bitmap,TribePane,TribePane.key); } //----------------------------------------------------------------------------- function TribeGraphicsList::onSelect(%this) { %jpg = "texticons/twb/" @ %this.getRowText(%this.getSelectedRow()) @ ".jpg"; TribeGraphic.setBitmap(%jpg); } //----------------------------------------------------------------------------- function TribePropertiesDlg::ConnectionTerminated(%this) { } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::onWake(%this) { %this.pendingChanges = ""; UrlEdit.setValue(TProfileHdr.playerURL); WP_CurrentName.setValue(TProfileHdr.playername); NewNameEdit.setValue(""); WP_WarriorDescription.setText(TProfileHdr.Desc); %this.LoadGfxPane(); } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::Close(%this) { if(%this.pendingChanges !$="") MessageBoxYesNo("CONFIRM","Close without saving changes?", "Canvas.popDialog("@%this@");W_Profile.setValue(1);",""); else { Canvas.popDialog(%this); w_GraphicsControl.setVisible(0); W_ProfilePane.setVisible(1); W_Profile.setValue(1); } } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::EditDescription(%this) { %this.pendingChanges = "EDITDESC"; TWBText.editType = "warrior"; LinkEditWarriorDesc(getField(TWBTitle.getValue(),0),TWBText); } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::ClearDescription(%this) { MessageBoxYesNo("CONFIRM","Clear your Players Description?","WarriorPropertiesDlg.doClearDescription();",""); } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::doClearDescription(%this) { PlayerPane.key = LaunchGui.key++; PlayerPane.state = "clearWarriorDescription"; TProfileHdr.Desc = "NONE"; TWBText.editType = "warrior"; canvas.SetCursor(ArrowWaitCursor); %this.pendingChanges = ""; EditDescriptionText.setText("No Description On File"); WP_WarriorDescription.setText(EditDescriptionText.getText()); DatabaseQuery(17,TProfileHdr.Desc,PlayerPane,PlayerPane.key); } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::LoadGfxPane(%this) { PlayerGraphic.setBitmap(PlayerPix.bitmap); %ctrl = WarriorGraphicsList; %width = getSubStr(%ctrl.getExtent(),0,3)-4; %fileSpec = "*.jpg"; %ctrl.clearColumns(); %ctrl.clear(); %ctrl.addColumn( 0, "FILENAME",%width, 0, 200 ); %id = -1; %rowId = ""; for ( %file = findFirstFile( %fileSpec ); %file !$= ""; %file = findNextFile( %fileSpec ) ) { %currBmp = PlayerPix.Bitmap; %match = "texticons/twb/" @ fileBase( %file ) @ ".jpg" $= %currBmp; if(getSubStr(fileBase(%file) @ ".jpg",0,3)$= "twb") %ctrl.addRow( %id++, fileBase( %file ) ); if(%match) %rowId = %id; } if(%rowID!$="") %ctrl.setSelectedRow(%rowID); } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::setPlayerGraphic(%this) { if(isEventPending(TribeAndWarriorBrowserGui.eid)) cancel(TribeAndWarriorBrowserGui.eid); PlayerPane.key = LaunchGui.key++; PlayerPane.state = "setPlayerGfx"; PlayerPix.setBitmap(PlayerGraphic.bitmap); canvas.SetCursor(ArrowWaitCursor); %this.pendingChanges = ""; TribeAndWarriorBrowserGui.eid = schedule(250,0,DatabaseQuery,31,PlayerGraphic.bitmap,PlayerPane,PlayerPane.key); } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::UpdateUrl(%this) { if(trim(UrlEdit.getValue()) $= "") { UrlEdit.setValue("www.tribes2.com"); MessageBoxYesNo("CONFIRM","Your URL is blank, by default www.tribes2.com will become your URL. Continue?","WarriorPropertiesDlg.setURL();","UrlEdit.setValue(\"\");"); } else WarriorPropertiesDlg.setURL(); } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::setURL(%this) { if(isEventPending(TribeAndWarriorBrowserGui.eid)) cancel(TribeAndWarriorBrowserGui.eid); PlayerPane.key = LaunchGui.key++; PlayerPane.state = "setPlayerUrl"; canvas.SetCursor(ArrowWaitCursor); %this.pendingChanges = ""; DatabaseQuery(32,UrlEdit.getValue(),PlayerPane,PlayerPane.key); } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::ChangePlayerName(%this) { MessageBoxYesNo("CONFIRM","Changing your name will require you to close the game and restart. Proceed?","WarriorPropertiesDlg.ProcessNameChange();","NewNameEdit.setValue(\"\");"); } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::ProcessNameChange(%this) { PlayerPane.key = LaunchGui.key++; PlayerPane.state = "changePlayerName"; canvas.SetCursor(ArrowWaitCursor); %this.pendingChanges = ""; DatabaseQuery(33,NewNameEdit.getValue(),PlayerPane,PlayerPane.key); } //----------------------------------------------------------------------------- function WarriorGraphicsList::onSelect(%this) { %jpg = "texticons/twb/" @ %this.getRowText(%this.getSelectedRow()) @ ".jpg"; PlayerGraphic.setBitmap(%jpg); } //----------------------------------------------------------------------------- function WarriorPropertiesDlg::ConnectionTerminated(%this) { } //----------------------------------------------------------------------------- PK !(scripts/webemail.cs//------------------------------------------ // Email code //------------------------------------------ // email format is: // id // From // read flag // send date // To // CC // Subject // message body //echo("Added email: " @ %tag SPC %text); $EmailCachePath = "webcache/" @ getField(getRecord(wonGetAuthInfo(),0),3) @ "/"; $EmailFileName = "email1"; $EmailColumnCount = 0; $EmailColumnName[0] = "Status"; $EmailColumnRange[0] = "50 75"; $EmailColumnCount++; $EmailColumnName[1] = "From"; $EmailColumnRange[1] = "50 300"; $EmailColumnCount++; $EmailColumnName[2] = "Subject"; $EmailColumnRange[2] = "50 300"; $EmailColumnCount++; $EmailColumnName[3] = "Received"; $EmailColumnRange[3] = "50 300"; $EmailColumnCount++; //----------------------------------------------------------------------------- if(!isObject(EmailMessageVector)) { new MessageVector(EmailMessageVector); $EmailNextSeq = 0; } //----------------------------------------------------------------------------- function LaunchEmail() { LaunchTabView.viewTab( "EMAIL", EmailGui, 0 ); EmailGui.checkSchedule = schedule(1000,0, CheckEmail, false); } //----------------------------------------------------------------------------- function EmailMessageNew() { Email_ToEdit.setText(""); Email_CCEdit.setText(""); $EmailSubject = ""; EmailBodyText.setValue(""); EMailComposeDlg.state = "sendMail"; Canvas.pushDialog(EmailComposeDlg); Email_ToEdit.makeFirstResponder(1); } //----------------------------------------------------------------------------- function EmailMessageReply() { EMailComposeDlg.state = "replyMail"; %text = EmailMessageVector.getLineTextByTag( EM_Browser.getSelectedId() ); Email_ToEdit.setText(getField(getRecord(%text, 1), 0)); Email_CCEdit.setText(""); $EmailSubject = "RE: " @ getRecord(%text, 6); %date = getRecord(%text, 3); Canvas.pushDialog(EmailComposeDlg); EmailBodyText.setValue("\n\n----------------------------------\n On " @ %date SPC Email_toEdit.getValue() @ " wrote:\n\n" @ EmailGetBody(%text) ); EmailBodyText.SetCursorPosition(0); EmailBodyText.makeFirstResponder(1); } //----------------------------------------------------------------------------- function EmailMessageForward() { %text = EmailMessageVector.getLineTextByTag( EM_Browser.getSelectedId() ); Email_ToEdit.setText(""); Email_CCEdit.setText(""); $EmailSubject = "FW: " @ getRecord(%text, 6); Canvas.pushDialog(EmailComposeDlg); EmailBodyText.setValue("\n\n\n--- Begin Forwarded Message ---\n\n" @ EmailGetTextDisplay(%text)); Email_toEdit.makeFirstResponder(1); EmailBodyText.SetCursorPosition(0); EMailComposeDlg.state = "forwardMail"; } //----------------------------------------------------------------------------- function EmailMessageReplyAll() { EMailComposeDlg.state = "replyAll"; %text = EmailMessageVector.getLineTextByTag( EM_Browser.getSelectedId() ); Email_ToEdit.setText(getField(getRecord(%text, 1), 0)); Email_CCEdit.setText(getRecord(%text, 4) @ getRecord(%text,5)); $EmailSubject = "RE: " @ getRecord(%text, 6); %date = getRecord(%text, 3); Canvas.pushDialog(EmailComposeDlg); EmailBodyText.setValue("\n\n===========================\n On " @ %date SPC Email_ToEdit.getValue() @ " wrote:\n\n" @ EmailGetBody(%text) ); EmailBodyText.makeFirstResponder(1); EmailBodyText.SetCursorPosition(0); } //----------------------------------------------------------------------------- function EmailMessageDelete() { %id = EM_Browser.getSelectedId(); if ( %id == -1 ) return; %row = EM_Browser.findById( %id ); EMailComposeDlg.key = LaunchGui.key++; // Make these buttons inactive until another message is selected: if(rbInbox.getValue()) { %nx = 6; EMailComposeDlg.state = "deleteMail"; DoEmailDelete(%nx,%id,EMailComposeDlg, EMailComposeDlg.key, %row); } else { %nx = 35; EMailComposeDlg.state = "removeMail"; MessageBoxYesNo("CONFIRM","Permanently Remove Selected EMail?","DoEmailDelete(" @ %nx @ "," @ %id @ "," @ EmailComposeDlg @ "," @ EmailComposeDlg.key @ "," @ %row @ ");"); } } //----------------------------------------------------------------------------- function DoEmailDelete(%qnx, %mid, %owner, %key, %row) { EM_ReplyBtn.setActive( false ); EM_ReplyToAllBtn.setActive( false ); EM_ForwardBtn.setActive( false ); EM_DeleteBtn.setActive( false ); EM_BlockBtn.setActive( false ); EM_Browser.removeRowByIndex( %row ); EmailMessageVector.deleteLine(EmailMessageVector.getLineIndexByTag(%mid)); if(%qnx==6) EmailGui.dumpCache(); if ( EM_Browser.rowCount() == 0 ) EMailInboxBodyText.setText(""); else EM_Browser.setSelectedRow(%row); DatabaseQuery(%qnx, %mid, %owner, %key); } //----------------------------------------------------------------------------- function EmailSend() { EMailComposeDlg.key = LaunchGui.key++; EMailComposeDlg.state = "sendMail"; CheckEmailNames(); %to = Email_ToEdit.getValue(); %cc = Email_CCEdit.getValue(); %subj = $EmailSubject; %text = EMailBodyText.getValue(); %lenny = strLen(%to @ %cc @ %subj); DatabaseQuery(5, %to TAB %cc TAB %subj TAB getSubStr(%text,0,4000-%lenny),EMailComposeDlg,EMailComposeDlg.key); Canvas.popDialog(EmailComposeDlg); } //----------------------------------------------------------------------------- function EmailMessageAddRow(%text, %tag) { EM_Browser.addRow( %tag, getField( getRecord( %text, 1 ) ,0 ), getRecord( %text, 6 ), getRecord( %text, 3 ), getRecord( %text, 2 )); } //----------------------------------------------------------------------------- function EmailGetBody(%text) { %msgText = ""; %rc = getRecordCount(%text); for(%i = 7; %i < %rc; %i++) %msgText = %msgText @ getRecord(%text, %i) @ "\n"; return %msgText; } //----------------------------------------------------------------------------- function getNameList(%line) { if(%line $= "") return ""; %ret = getField(getTextName(%line, 0), 0); %count = getFieldCount(%line) / 4; for(%i = 1; %i < %count; %i++) %ret = %ret @ ", " @ getField(getTextName(%line, %i * 4), 0); } //----------------------------------------------------------------------------- function getLinkNameOnly(%line) { if(%line $= "" || %line $= " ") return ""; %name = getField(%line,0); %str = "" @ %name; %ret = "" @ %str @ ""; return %ret; } //----------------------------------------------------------------------------- function getLinkNameList(%line) { if(%line $= "") return ""; %ret = getLinkName(%line, 0); %count = getFieldCount(%line) / 4; for(%i = 1; %i < %count; %i++) %ret = %ret @ ", " @ getLinkName(%line, %i * 4); } //----------------------------------------------------------------------------- function CheckEmailNames() { %EmailTOAddress = strUpr(trim(Email_ToEdit.getValue())); %EmailCCAddress = strUpr(trim(Email_CCEdit.getValue())); %toLength = strLen(%EmailTOAddress); %ccLength = strLen(%EmailCCAddress); %checkList = ""; if(%toLength > 0) { if(trim(getSubStr(%EmailTOAddress,%toLength-1,1)) !$= "," || trim(getSubStr(%EmailTOAddress,%toLength,1)) !$= ",") %EmailTOAddress = %EmailTOAddress @ ","; } else %EmailTOAddress = ","; if(%ccLength > 0) { if(trim(getSubStr(%EmailCCAddress,%ccLength-1,1)) !$= "," || trim(getSubStr(%EmailCCAddress,%ccLength,1)) !$= ",") %EmailCCAddress = %EmailCCAddress @ ","; } else %ccList = ","; for(%x=0;%x<2;%x++) { %pos = 0; %start = 0; if(%x == 0) %nList = %EmailTOAddress; else if(%x == 1) { %EmailTOAddress = %nList; %nList = %EmailCCAddress; } if(strLen(%nList)>1) { while((%pos = strPos(%nList,",",%start)) != -1 && %cx++ < 40) { %name = getSubStr(%nList,%start,%pos-%start); %nameLength = strLen(%name); %name = trim(%name); if((%checkStr = strStr(%checkList,%name)) != -1) { if(%checkStr == 0) %checkVal = ","; else %checkVal = getSubStr(%checkList,strStr(%checkList,%name)-1,1); if(%checkVal $= "," || %checkVal $= " ") { if(%pos-%nameLength == %start && %start == 0) { %nList = trim(getSubStr(%nList,%pos+1,strLen(%nList))); } else { %nList = trim(getSubStr(%nList,0,(%pos-%nameLength))) @ trim(getSubStr(%nList,%pos+1,strLen(%nList))); %start = %pos-%nameLength; } } else { if(strLen(%checkList)==0) %checkList = %name; else %checkList = %checkList @ "," @ %name; %start = %pos+1; } } else { if(strLen(%checkList)==0) %checkList = %name; else %checkList = %checkList @ "," @ %name; %start = %pos+1; } } } } %EmailCCAddress = %nList; Email_ToEdit.setText(%EMailToAddress); Email_CCEdit.setText(%EmailCCAddress); } //----------------------------------------------------------------------------- function EmailGetTextDisplay(%text) { %pos = 0; %strStart = 0; %curList = strupr(getRecord(%text,4)); %to = ""; if(strLen(%curList) > 1) { if(trim(getSubStr(%curList,strLen(%curList)-1,1)) !$= ",") %curList = %curList @ ","; } else %curList = ","; while((%pos = strpos(%curList, ",", %strStart)) != -1) { if(%strStart==0) %to = trim(getLinkNameOnly(getSubStr(%curList, %strStart, %pos-%strStart))); else %to = %to @ "," @ trim(getLinkNameOnly(getSubStr(%curList, %strStart, %pos-%strStart))); %strStart = %pos+1; } %pos = 0; %strStart = 0; %curList = strupr(getRecord(%text,5)); %ccLine = ""; if(strLen(%curList) > 1) { if(trim(getSubStr(%curList,strLen(%curList)-1,1)) !$= ",") %curList = %curList @ ","; } else %curList = ","; while((%pos = strpos(%curList, ",", %strStart)) != -1) { if(%strStart==0) %ccLine = getLinkNameOnly(getSubStr(%curList, %strStart, %pos-%strStart)); else %ccLine = %ccLine @ "," @ getLinkNameOnly(getSubStr(%curList, %strStart, %pos-%strStart)); %strStart = %pos+1; } %from = getLinkName(getRecord(%text, 1), 0); %msgtext = "From: " @ %from NL "To: " @ %to NL "CC: " @ %ccLine NL "Subject: " @ getRecord(%text, 6) NL "Date Sent: " @ getRecord(%text, 3) @ "\n\n" @ EmailGetBody(%text); } //----------------------------------------------------------------------------- function EmailNewMessageArrived(%message, %seq) { $EmailNextSeq = %seq; EmailMessageVector.pushBackLine(%message, %seq); EmailMessageAddRow(%message, %seq); } //----------------------------------------------------------------------------- function GetEMailBtnClick() { if(isEventPending(EMailGUI.checkSchedule)) cancel(EmailGui.checkSchedule); EMailGui.btnClicked = true; EMailGui.checkingEMail = false; EMailGui.checkSchedule = schedule(1000 * 2, 0, CheckEmail, false); canvas.SetCursor(ArrowWaitCursor); } //----------------------------------------------------------------------------- function CheckEmail(%calledFromSched) { if(EmailGui.checkingEmail) { // echo("Check In Progress"); return; } if(EmailGui.checkSchedule && !%calledFromSched) { // echo("Email Schedule " @ EmailGui.checkSchedule @ "Cancelled"); cancel(EmailGui.checkSchedule); // cancel schedule } EmailGui.checkSchedule = ""; EMailGui.key = LaunchGui.key++; EmailGui.state = "getMail"; EM_Browser.clear(); EmailGui.LoadCache(); DatabaseQueryArray(1,0,$EmailNextSeq, EMailGui, EMailGui.key); EmailGui.checkingEmail = true; } //----------------------------------------------------------------------------- function CancelEmailCheck() { if ( EmailGui.checkSchedule ) { error( ">> SCHEDULED EMAIL CHECK " @ EmailGui.checkSchedule @ " CANCELED <<" ); cancel( EmailGui.checkSchedule ); EmailGui.checkSchedule = ""; } } //----------------------------------------------------------------------------- function EmailEditBlocks() { Canvas.pushDialog(EmailBlockDlg); EmailBlockList.clear(); EMailBlockDlg.key = LaunchGui.key++; EmailBlockDlg.state = "getBlocklist"; DatabaseQueryArray(2,0,"",EMailBLockDlg,EMailBLockDlg.key); } //----------------------------------------------------------------------------- function EmailBlockSender() { %id = EM_Browser.getSelectedId(); if ( %id == -1 ) { MessageBoxOK("WARNING","You cannot block a non-existent sender."); return; } else { %text = EmailMessageVector.getLineTextByTag( EM_Browser.getSelectedId() ); %blockAddress = getField(getRecord(%text, 1), 0); if(trim(%blockAddress) !$= "") { EMailBlockDlg.state = "setBlock"; EMailBlockDlg.key = LaunchGui.key++; DatabaseQuery(9,%blockAddress,EmailBlockDlg,EMailBlockDlg.key); } } } //----------------------------------------------------------------------------- function EmailBlockRemove() { %rowId = EmailBlockList.getSelectedId(); if(%rowId == -1) { MessageBoxOK("WARNING","You cannot remove a non-existent block."); return; } else { %line = EmailBlockList.getRowTextById(%rowId); %name = getField(%line, 2); EMailBlockDlg.state = "removeBlock"; EMailBlockDlg.key = LaunchGui.key++; DatabaseQuery(8,%name,EMailBLockDlg,EMailBLockDlg.key); EmailBlockList.removeRowById(%rowId); } } //-- EMailComposeDlg ---------------------------------------------------------------- function EmailComposeDlg::onWake( %this ) { // Get the compose dialog position and size from the prefs: %res = getResolution(); %resW = firstWord( %res ); %resH = getWord( %res, 1 ); %w = firstWord( $pref::Email::ComposeWindowExtent ); if ( %w > %resW ) %w = %resW; %h = getWord( $pref::Email::ComposeWindowExtent, 1 ); if ( %h > %resH ) %h = %resH; %x = firstWord( $pref::Email::ComposeWindowPos ); if ( %x > %resW - %w ) %x = %resW - %w; %y = getWord( $pref::Email::ComposeWindowPos, 1 ); if ( %y > %resH - %h ) %y = %resH - %h; EmailComposeWindow.resize( %x, %y, %w, %h ); } //----------------------------------------------------------------------------- function EmailComposeDlg::onSleep( %this ) { $pref::Email::ComposeWindowPos = EmailComposeWindow.getPosition(); $pref::Email::ComposeWindowExtent = EmailComposeWindow.getExtent(); } //----------------------------------------------------------------------------- function EMailComposeDlg::onDatabaseQueryResult(%this, %status, %RowCount_Result, %key) { if(%this.key != %key) return; // echo("RECV: " @ %status TAB %RowCount_Result); if(getField(%status,0)==0) { switch$(%this.state) { case "deleteMail": %this.state = "done"; case "removeMail": %this.state = "done"; case "sendMail": %this.state = "done"; } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else MessageBoxOK("ERROR",getField(%status,1)); } //----------------------------------------------------------------------------- function EmailComposeDlg::Cancel(%this) { Canvas.PopDialog(EmailComposeDlg); } //----------------------------------------------------------------------------- function EmailComposeDlg::SendMail(%this) { %EmailToAddress = Email_ToEdit.getValue(); %EmailSubject = EMail_Subject.getValue(); // NEED TO CHECK FOR DUPLICATES if(trim(%EmailToAddress) $= "") MessageBoxOK("No Address","TO Address may not be left blank. Please enter a player name to send this message to."); else { if(trim(%EmailSubject) $= "") MessageBoxOK("No Subject","Please enter a Subject for your message."); else EMailSend(); } } //-- EMailBlockDlg ----------------------------------------------------------- function EMailBlockDlg::onDatabaseQueryResult(%this,%status,%ResultString,%key) { if(%this.key != %key) return; // echo("RECV: " @ %status TAB %ResultString); if(getField(%status,0)==0) { switch$(%this.state) { case "getBlocklist": %this.state = "names"; %this.blockCount = getField(%ResultString,0); case "removeBlock": MessageBoxOK("NOTICE",getField(%status,1)); case "setBlock": MessageBoxOK("NOTICE",getField(%status,1)); } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else { %this.state = "error"; MessageBoxOK("ERROR",getField(%status,1)); } } //----------------------------------------------------------------------------- function EMailBlockDlg::onDatabaseRow(%this,%row,%isLastRow,%key) { if(%this.key != %key) return; // echo("RECV: " @ %row TAB %isLastRow); switch$(%this.state) { case "names": %textName = getTextName(getFields(%row,0,4)); %id = getField(%row,3); %blockedCount = getField(%row,4); EmailBlockList.addRow(%id, getField(%textName,0) TAB %blockedCount TAB %row); } } //----------------------------------------------------------------------------- function CheckAllDuplicates(%player) { %lCount = LC_ToList.rowCount(); %cCount = LC_CCList.rowCount(); %vResult = 0; if(%lCount>0) { for(%l=0;%l<%lCount;%l++) { %lstr = LC_ToList.getRowText(%l); if(%lstr $= %player) %vResult++; } } if(%cCount>0) { for(%c=0;%c<%cCount;%c++) { %cstr = LC_CCList.getRowText(%c); if(%cstr $= %player) %vResult++; } } return %vResult; } //----------------------------------------------------------------------------- function LaunchAddressDlg() { Canvas.PushDialog("AddressDlg"); } //----------------------------------------------------------------------------- function ListToStr(%listName,%delim) { %str = ""; %rCount = %listName.rowCount(); if (%rCount > 0) { for(%r=0;%r<%rCount;%r++) { %str = %str @ %listName.getRowText(%r); if(%r < %rCount-1) { %str = %str @ %delim; } } return %str; } } //----------------------------------------------------------------------------- function StrToList(%listName, %str, %delim) { %listName.Clear(); %sCount = 0; %sSize = strlen(%str); if (%sSize > 0) { for(%l=0;%l<=%sSize;%l++) { %txt = getSubStr(%str,%l,1); if( %txt $= %delim || %l == %sSize ) { %listName.addRow(%sCount,trim(%sText)); %sText = ""; %sCount++; } else { %sText = %sText @ %txt; } } } } //----------------------------------------------------------------------------- function LC_BigList::GetOnlineStatus(%this) { %this.key = LaunchGui.key++; %this.status = "getOnline"; for(%oStat=0;%oStat<%this.RowCount();%oStat++) { if(%oStat == 0) %roster = %this.getRowID(%oStat); else %roster = %roster TAB %this.getRowID(%oStat); } databaseQuery(69,%roster, %this,%this.key); } //----------------------------------------------------------------------------- function AddressDlg::onDatabaseQueryResult(%this,%status,%resultString,%key) { if(%this.key != %key) return; // echo("RECV: " @ %status TAB %resultString); if(getField(%status,0)==0) { switch$(%this.state) { case "goSearch": if(getField(%resultString,0)<=0) { %this.state = "done"; MessageBoxOK("NOTICE","No Match Found."); } else { %this.state = "memberList"; %this.linecount = -1; LC_BigList.clear(); } case "getBuddyList": if(getField(%resultString,0)<=0) { %this.state = "done"; MessageBoxOK("NOTICE","You have no Buddies."); } else { %this.state = "buddyList"; %this.linecount = -1; LC_BigList.clear(); } case "getTribeMembers": if(getField(%resultString,0)<=0) { %this.state = "done"; MessageBoxOK("NOTICE","Cloak Packs are engaged, Tribe Mates could not be detected."); } else { %this.state = "tribeMembers"; %this.linecount = -1; LC_BigList.clear(); } case "addBuddy": MessageBoxOK("CONFIRMED",getField(%status,1)); case "dropBuddy": MessageBoxOK("CONFIRMED",getField(%status,1)); } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else { switch$(%this.state) { case "goSearch": %this.state = "error"; MessageBoxOk("ERROR",getField(%status,1)); } } } //----------------------------------------------------------------------------- function AddressDlg::onDatabaseRow(%this,%row,%isLastRow,%key) { if(%this.key != %key) return; // echo("RECV : " @ %row); switch$(%this.state) { case "memberList": LC_BigList.addRow(%this.linecount++,getField(%row,1)); case "buddyList": LC_BigList.addRow(%this.linecount++,getField(%row,0)); case "tribeMembers": LC_BigList.addRow(%this.linecount++,getField(%row,0)); } } //----------------------------------------------------------------------------- function AddressDlg::AddBuddylist(%this) { %this.key = LaunchGui.key++; %this.lbstate = "buddylist"; switch (%this.SrcList) { case 0: %addremove = LC_BuddyListBtn.direction; %player = LC_BigList.getValue(); %selRow = LC_BigList.getRownumByID(LC_BigList.GetSelectedID()); case 1: %addremove = 0; %player = LC_ToList.getValue(); case 2: %addremove = 0; %player = LC_CCList.getValue(); } if (%addremove==0) { %this.doRefresh = 1; %this.state = "addBuddy"; DatabaseQuery(10,%player,%this,%this.key); } else { %this.state = "dropBuddy"; DatabaseQuery(11,%player,%this,%this.key); LC_BigList.removeRowbyId(LC_BigList.getSelectedID()); if(%selRow>=LC_BigList.RowCount()) %selRow = LC_BigList.RowCount()-1; LC_BigList.setSelectedRow(%selRow); } } //----------------------------------------------------------------------------- function AddressDlg::AddCC(%this) { if(LC_CCListBtn.direction == 0) { %addName = LC_BigList.getRowText(LC_BigList.getSelectedID()); %hasDupes = CheckAllDuplicates(%addName); if(%hasDupes == 0) LC_CCList.addRow(LC_CCList.RowCount()+1, %addName); } else { %selRow = LC_CCList.getRownumByID(LC_CCList.GetSelectedID()); LC_CCList.removeRowbyID(LC_CCList.getSelectedID()); if(%selRow>=LC_CCList.RowCount()) %selRow = LC_CCList.RowCount()-1; LC_CCList.setSelectedRow(%selRow); } %this.DestList = 1; } //----------------------------------------------------------------------------- function AddressDlg::AddTo(%this) { if(LC_ToListBtn.direction == 0) { %addName = LC_BigList.getRowText(LC_BigList.getSelectedID()); %hasDupes = CheckAllDuplicates(%addName); if(%hasDupes == 0 ) LC_ToList.addRow(LC_ToList.RowCount()+1, %addName); } else { %selRow = LC_ToList.getRownumByID(LC_ToList.GetSelectedID()); LC_ToList.removeRowbyID(LC_ToList.getSelectedID()); if(%selRow>=LC_ToList.RowCount()) %selRow = LC_ToList.RowCount()-1; LC_ToList.SetSelectedRow(%selRow); } %this.DestList = 0; } //----------------------------------------------------------------------------- function AddressDlg::Cancel(%this) { LC_BigList.Clear(); Canvas.PopDialog("AddressDlg"); } //----------------------------------------------------------------------------- function AddressDlg::GoSearch(%this) { if(trim(LC_Search.getValue()) !$="") { %this.key = LaunchGui.key++; %this.state = "goSearch"; %this.lbstate = "errorcheck"; DatabaseQueryArray(3,100,trim(LC_Search.getValue()) TAB 0 TAB 100 TAB 1 ,%this, %this.key,true); LC_BuddyListBtn.direction = 0; LC_BuddyListBtn.text = "ADD TO BUDDYLIST"; LC_ListBox.setSelected(0); } else MessageBoxOK("WARNING","Null searches (blank) are not allowed. Please enter letter(s) to search for."); } //----------------------------------------------------------------------------- function AddressDlg::GoList(%this) { %this.key = LaunchGui.key++; %this.lbstate = "errorcheck"; if(LC_ListBox.getValue() $="Select List") { LC_BigList.clear(); } else if(LC_ListBox.getValue() $="Buddy List") { %this.state = "getBuddyList"; DatabaseQueryArray(5,0,"",%this,%this.key); LC_BuddyListBtn.direction = 1; LC_BuddyListBtn.text = "REMOVE FROM BUDDYLIST"; } else { %this.state = "getTribeMembers"; DatabaseQueryArray(6,0,LC_ListBox.getValue(),%this,%this.key,true); LC_BuddyListBtn.direction = 0; LC_BuddyListBtn.text = "ADD TO BUDDYLIST"; } } //----------------------------------------------------------------------------- function AddressDlg::OK(%this) { if (LC_ToList.rowCount() > 0) EMail_ToEdit.setValue(ListToStr(LC_ToList,",")); if (LC_CCList.rowCount() > 0) EMail_CCEdit.setValue(ListToStr(LC_CCList,",")); LC_BigList.Clear(); Canvas.PopDialog("AddressDlg"); } //----------------------------------------------------------------------------- function AddressDlg::onClick(%this, %sender) { switch$(%sender) { case "BIGLIST": LC_ToListBtn.text = "ADD"; LC_CCListBtn.text = "ADD"; LC_ToListBtn.direction = 0; LC_CCListBtn.direction = 0; LC_ToList.setSelectedRow(-1); LC_CCList.setSelectedRow(-1); %this.SrcList = 0; LC_BuddyListBtn.setVisible(1); if(LC_ListBox.getValue() $="Buddy List") { LC_BuddyListBtn.direction = 1; LC_BuddyListBtn.SetValue("REMOVE FROM BUDDYLIST"); } else { LC_BuddyListBtn.direction = 0; LC_BuddyListBtn.SetValue("ADD TO BUDDYLIST"); } case "TOLIST": LC_ToListBtn.text = "DEL"; LC_ToListBtn.direction = 1; LC_BigList.setSelectedRow(-1); LC_CCList.setSelectedRow(-1); %this.DestList = 0; %this.SrcList = 1; LC_BuddyListBtn.direction = 0; LC_BuddyListBtn.SetValue("ADD TO BUDDYLIST"); LC_BuddyListBtn.setVisible(1); case "CCLIST": LC_CCListBtn.text = "DEL"; LC_CCListBtn.direction = 1; LC_ToList.setSelectedRow(-1); LC_BigList.setSelectedRow(-1); %this.DestList = 1; %this.SrcList = 2; LC_BuddyListBtn.direction = 0; LC_BuddyListBtn.SetValue("ADD TO BUDDYLIST"); LC_BuddyListBtn.setVisible(1); case "LISTBOX": LC_ToList.setSelectedRow(-1); LC_BigList.setSelectedRow(-1); LC_CCList.setSelectedRow(-1); %this.SrcList = 0; LC_BuddyListBtn.setVisible(0); %this.GoList(); case "SEARCHBOX": LC_ToList.setSelectedRow(-1); LC_BigList.setSelectedRow(-1); LC_CCList.setSelectedRow(-1); %this.SrcList = 0; LC_BuddyListBtn.setVisible(0); } Canvas.repaint(); } //----------------------------------------------------------------------------- function AddressDlg::onDblClick(%this,%caller) { switch(%caller) { case 0: if(%this.DestList==0) %this.AddTo(); else %this.AddCC(); case 1: LC_ToList.removeRowbyID(LC_ToList.getSelectedID()); LC_ToList.SetSelectedRow(0); case 2: LC_CCList.removeRowbyID(LC_CCList.getSelectedID()); LC_CCList.SetSelectedRow(0); } } //----------------------------------------------------------------------------- function AddressDlg::onWake(%this) { %this.doRefresh = 0; %this.key = LaunchGui.key++; %this.state = "loadlistbox"; %this.lbstate = "errorcheck"; %this.DestList = 0; %this.SrcList = 0; LC_BuddyListBtn.setVisible(0); LC_ListBox.Clear(); LC_ListBox.Add("Select List",0); LC_ListBox.Add("Buddy List",1); LC_ListBox.setSelected(0); LC_Search.clear(); StrToList(LC_ToList,Email_ToEdit.getValue(),","); StrToList(LC_CCList,Email_CCEdit.getValue(),","); %info = WONGetAuthInfo(); %tribeCount = getField( getRecord( %info, 1 ), 0 ); //%cert for ( %i = 0; %i < %tribeCount; %i++ ) { %tribe = getField( getRecord( %info, %i + 2 ), 0 ); //%cert LC_ListBox.add(%tribe,%i); } } //-- EMailGui ---------------------------------------------------------------- function EmailGui::onWake(%this) { // Make these buttons inactive until a message is selected: EM_ReplyBtn.setActive( false ); EM_ReplyToAllBtn.setActive( false ); EM_ForwardBtn.setActive( false ); EM_DeleteBtn.setActive( false ); EM_BlockBtn.setActive( false ); %selId = EM_Browser.getSelectedId(); Canvas.pushDialog(LaunchToolbarDlg); if(!%this.cacheFile) { %this.cacheFile = $EmailFileName; EmailGui.getCache(); } if ( !EmailGui.cacheLoaded || EM_Browser.rowCount() == 0 ) { EmailGui.checkingEmail = false; if(!rbInbox.getValue()) rbInbox.setValue(1); else { EmailGui.GetCache(); EmailGui.OutputVector(); } } if ( EM_Browser.rowCount() > 0 ) { %row = EM_Browser.findById( %selId ); if ( %row == -1 ) EM_Browser.setSelectedRow( 0 ); else EM_Browser.setSelectedRow( %row ); } } //----------------------------------------------------------------------------- function EmailGui::ButtonClick(%this,%ord) { switch(%ord) { case 0: em_GetMailBtn.setVisible(1); GetEmailBtnClick(); case 1: em_GetMailBtn.setVisible(0); EM_Browser.clear(); EMailMessageVector.clear(); EmailInboxBodyText.setText(""); EMailGui.state = "getDeletedMail"; EmailGui.key = LaunchGui.key++; DatabaseQueryArray(14,100,EmailGui.state,EMailGui,EMailGui.key,true); } } //----------------------------------------------------------------------------- function EMailGui::onDatabaseQueryResult(%this, %status, %RowCount_Result, %key) { if(%this.key != %key) return; // echo("RECV: " @ %status); if(getField(%status,0)==0) { switch$(%this.state) { case "getMail": %this.soundPlayed = false; if(getField(%RowCount_Result,0)>0) { %this.messageCount = 0; %this.message = ""; %this.state = "NewMail"; %this.getCache(); } else { %this.state = "done"; EMailGui.getCache(); EMailGui.outputVector(); if(EMailGui.btnClicked) EmailGui.btnClicked = false; %this.checkingEmail = false; %this.checkSchedule = schedule(1000 * 60 * 5, 0, CheckEmail, true); } case "sendMail": %this.state = "done"; CheckEMail(); case "deleteMail": %this.state = "done"; CheckEMail(); case "forwardMail": %this.state = "done"; CheckEMail(); case "replyMail": %this.state = "done"; CheckEMail(); case "replyAllMail": %this.state = "done"; CheckEMail(); case "blockSender": %this.state = "done"; case "Refresh": %this.state = "done"; CheckEMail(); case "getDeletedMail": if(getField(%RowCount_Result,0)>0) { %this.messageCount = 0; %this.message = ""; %this.state = "DeletedMail"; } else { %this.state = "done"; MessageBoxOK("NOTICE",getField(%status,2)); } } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else { %this.state = "error"; MessageBoxOK("ERROR","Error Retrieving Messages"); } canvas.SetCursor(DefaultCursor); } //----------------------------------------------------------------------------- function EMailGui::onDatabaseRow(%this, %row,%isLastRow,%key) { if(%this.key != %key) return; // echo("RECV: " @ %row NL %isLastRow); switch$(%this.state) { case "DeletedMail": %ID = getField(%row,0); %senderQuad = getFields(%row,1,4); %recipientQuad = getFields(%row,5,8); %created = getField(%row,9); %isCC = getField(%row,10); %isDel = getField(%row,11); %isRead = getField(%row,12); %TList = getField(%row,13); %CCList = getField(%row,14); %subject = getField(%row,15); %bodyCount = getField(%row,16); %body = getFields(%row,17); %msg = %ID NL %senderQuad NL %isRead NL %created NL %TList NL %CCList NL %subject NL %body @ "\n"; %this.message = %msg; EmailMessageVector.pushBackLine(%this.message, getField(%this.message, 0)); if(%isLastRow) %this.outputVector(); case "NewMail": %this.checkingEmail = ""; %ID = getField(%row,0); %senderQuad = getFields(%row,1,4); %recipientQuad = getFields(%row,5,8); %created = getField(%row,9); %isCC = getField(%row,10); %isDel = getField(%row,11); %isRead = getField(%row,12); %TList = getField(%row,13); %CCList = getField(%row,14); %subject = getField(%row,15); %bodyCount = getField(%row,16); %body = getFields(%row,17); %msg = %ID NL %senderQuad NL %isRead NL %created NL %TList NL %CCList NL %subject NL %body @ "\n"; %this.message = %msg; EmailNewMessageArrived( %msg, %id ); // $EmailNextSeq = %ID; // EmailMessageVector.pushBackLine(%this.message, getField(%this.message, 0)); if(!%this.soundPlayed) { if(!getRecord(%this.message, 2))//are there any unread messages in this group? { %this.soundPlayed = true; alxPlay(sGotMail, 0, 0, 0); } } if(%isLastRow) { EmailGui.dumpCache(); EmailGui.loadCache(); %this.checkingEmail = false; %this.checkSchedule = schedule(1000 * 60 * 5, 0, CheckEmail, true); // echo("scheduling Email check " @ %this.checkSchedule @ " in 5 minutes"); } } } //----------------------------------------------------------------------------- function EmailGui::getCache(%this) { EM_Browser.clear(); EMailMessageVector.clear(); EmailInboxBodyText.setText(""); %fileName = $EmailCachePath @ $EmailFileName; %file = new FileObject(); if ( %this.cacheFile $= "" ) { if ( %file.openForRead( %fileName ) ) { %guid = %file.readLine(); if ( %guid $= getField( WonGetAuthInfo(), 3 ) ) { // This is the right one! %this.cacheFile = $EmailFileName; %this.messageCount = %file.readLine(); while( !%file.isEOF() ) { %line = %file.readLine(); %id = firstWord( %line ); %msg = collapseEscape( restWords( %line ) ); $EmailNextSeq = %id; EMailMessageVector.pushBackLine(%msg, %id); } %file.close(); } } } else if ( %file.openForRead( %fileName ) ) { %guid = %file.readLine(); %this.messageCount = %file.readLine(); while( !%file.isEOF() ) { %line = %file.readLine(); %id = firstWord( %line ); %msg = collapseEscape( restWords( %line ) ); $EmailNextSeq = %id; EMailMessageVector.pushBackLine(%msg, %id); } %file.close(); } %file.delete(); %this.cacheLoaded = true; } //----------------------------------------------------------------------------- function EmailGui::outputVector(%this) { for(%i = 0; %i < EmailMessageVector.getNumLines(); %i++) EmailMessageAddRow(EmailMessageVector.getLineText(%i), EmailMessageVector.getLineTag(%i)); EM_Browser.setSelectedRow( 0 ); } //----------------------------------------------------------------------------- function EmailGui::loadCache( %this ) { EM_Browser.clear(); EMailMessageVector.clear(); EMailInboxBodyText.setText(""); %fileName = $EmailCachePath @ $EmailFileName; %file = new FileObject(); if ( %this.cacheFile $= "" ) { if ( %file.openForRead( %fileName ) ) { %guid = %file.readLine(); if ( %guid $= getField( WonGetAuthInfo(), 3 ) ) { // This is the right one! %this.cacheFile = $EmailFileName; %this.messageCount = %file.readLine(); while( !%file.isEOF() ) { %line = %file.readLine(); %id = firstWord( %line ); %msg = collapseEscape( restWords( %line ) ); EmailNewMessageArrived( %msg, %id ); } %file.close(); } } } else if ( %file.openForRead( %fileName ) ) { %guid = %file.readLine(); %this.messageCount = %file.readLine(); while( !%file.isEOF() ) { %line = %file.readLine(); %id = firstWord( %line ); %msg = collapseEscape( restWords( %line ) ); EmailNewMessageArrived( %msg, %id ); } %file.close(); } %file.delete(); %this.cacheLoaded = true; } //----------------------------------------------------------------------------- function EmailGui::dumpCache( %this ) { %guid = getField( WONGetAuthInfo(), 3 ); if ( %this.cacheFile $= "" ) %this.cacheFile = $EmailFileName; EmailMessageVector.dump( $EmailCachePath @ %this.cacheFile, %guid ); } //----------------------------------------------------------------------------- function EmailGui::onSleep( %this ) { } //----------------------------------------------------------------------------- function EMailGui::getEmail(%this,%fromSchedule) { checkEmail(%fromSchedule); } //----------------------------------------------------------------------------- function EmailGui::setKey( %this, %key ) { } //----------------------------------------------------------------------------- function EmailGui::onClose( %this, %key ) { } //-- EM_Browser -------------------------------------------------------------- function EM_Browser::onAdd( %this ) { if ( !EMailGui.initialized ) { // Add the columns with widths from the prefs: for ( %i = 0; %i < $EmailColumnCount; %i++ ) EM_Browser.addColumn( %i, $EmailColumnName[%i], $pref::Email::Column[%i], firstWord( $EmailColumnRange[%i] ), getWord( $EmailColumnRange[%i], 1 ) ); EM_Browser.setSortColumn( $pref::Email::SortColumnKey ); EM_Browser.setSortIncreasing( $pref::Email::SortInc ); // Set the minimum extent of the frame panes: %minExtent = EM_BrowserPane.getMinExtent(); EM_Frame.frameMinExtent( 0, firstWord( %minExtent ), restWords( %minExtent ) ); %minExtent = EM_MessagePane.getMinExtent(); EM_Frame.frameMinExtent( 1, firstWord( %minExtent ), restWords( %minExtent ) ); EmailGui.initialized = true; } } //----------------------------------------------------------------------------- function EM_Browser::onSelect( %this, %id ) { %text = EmailMessageVector.getLineTextByTag(%id); if(rbinbox.getValue()) { if(!getRecord(%text, 2)) // read flag { %line = EmailMessageVector.getLineIndexByTag(%id); %text = setRecord(%text, 2, 1); DatabaseQuery(7, %id); // Update the GUI: %this.setRowFlags( %id, 1 ); EmailMessageVector.deleteLine(%line); EmailMessageVector.insertLine(%line, %text, %id); EmailGui.dumpCache(); } } EmailInboxBodyText.setValue(EmailGetTextDisplay(%text)); EM_ReplyBtn.setActive( true ); EM_ReplyToAllBtn.setActive( true ); EM_ForwardBtn.setActive( true ); EM_DeleteBtn.setActive( true ); EM_BlockBtn.setActive( true ); } //----------------------------------------------------------------------------- function EM_Browser::onSetSortKey( %this, %sortKey, %isIncreasing ) { $pref::Email::SortColumnKey = %sortKey; $pref::Email::SortInc = %isIncreasing; } //----------------------------------------------------------------------------- function EM_Browser::onColumnResize( %this, %column, %newSize ) { $pref::Email::Column[%column] = %newSize; } PK !(xTscripts/webforums.cs//------------------------------------------ // Forums code //------------------------------------------ $ForumCacheVersion = 9; //lucky seven...NOT! $ForumCachePath = "webcache/" @ getField(wonGetAuthInfo(),3) @ "/"; $currentForumPage = 0; $topicPageLength = 60; $ForumsConnecting = "CONNECTING"; $ForumsGetForums = "FETCHING FORUM LIST "; $ForumsGetTopics = "FETCHING TOPICS "; $ForumsTitle = "FORUMS"; $ForumsGetPosts = "FETCHING POSTS "; $TopicColumnCount = 0; $TopicColumnName[0] = "Topic"; $TopicColumnRange[0] = "50 1000"; $TopicColumnCount++; $TopicColumnName[1] = "Posts"; $TopicColumnRange[1] = "25 100"; $TopicColumnFlags[1] = "numeric center"; $TopicColumnCount++; $TopicColumnName[2] = "Last Poster"; $TopicColumnRange[2] = "50 500"; $TopicColumnCount++; $TopicColumnName[3] = "Last Post Date"; $TopicColumnRange[3] = "50 300"; $TopicColumnCount++; $ForumColumnCount = 0; $ForumColumnName[0] = "Message Tree"; $ForumColumnRange[0] = "50 800"; $ForumColumnCount++; $ForumColumnName[1] = "Posted By"; $ForumColumnRange[1] = "50 500"; $ForumColumnCount++; $ForumColumnName[2] = "Date Posted"; $ForumColumnRange[2] = "50 500"; $ForumColumnCount++; $GuidTribes = 0; // format of a forum post is: // Post ID // Parent Post ID // subject // Author // Post date // Text lines //Forums message vector post: // postId // parentId // Topic // Poster // Date // Message Line0 // MessageLine 1 // MessageLine 2 // Update is defined as: // PostId // UpdateId // parentId // poster // Date // topic // body lines if(!isObject(ForumsMessageVector)) { new MessageVector(ForumsMessageVector); } //----------------------------------------------------------------------------- function LaunchForums( %forum, %topic ) { ForumsGui.setVisible(false); ForumsGui.launchForum = %forum; ForumsGui.launchTopic = %topic; forumsList.clear(); if(trim(ForumsGui.launchTopic) $= "") { ForumsThreadPane.setVisible(false); ForumsTopicsPane.setVisible(true); } LaunchTabView.viewTab( "FORUMS", ForumsGui, 0 ); } //----------------------------------------------------------------------------- function isModerator() { if(!$GuidTribes) $GuidTribes = getRecords(WonGetAuthInfo(),1); %result = 0; for(%checkID=0;%checkID 1) %vCanAdmin = 1; } if(%selectedID == 1402) FO_AcceptBtn.setVisible(%vCanAdmin); } else { for(%checkID=0;%checkID 1) %vCanAdmin = 1; } } FO_EditBtn.setVisible(%vCanAdmin); FO_RejectBtn.setVisible(%vCanAdmin); canvas.repaint(); } //----------------------------------------------------------------------------- function DateStrCompare(%date1,%date2) { %d1 = getSubStr(%date1,0,2); %d2 = getSubStr(%date2,0,2); if(%d1 == %d2) { %d1 = getSubStr(%date1,3,2); %d2 = getSubStr(%date2,3,2); if(%d1 == %d2) { %d1 = getSubStr(%date1,6,4); %d2 = getSubStr(%date2,6,4); if(%d1 == %d2) { if(getSubStr(%date1,17,1)$="a") %d1 = getSubStr(%date1,11,2)+12; else %d1 = getSubStr(%date1,11,2); if(getSubStr(%date2,17,1)$="a") %d2 = getSubStr(%date2,11,2)+12; else %d2 = getSubStr(%date2,11,2); if(%d1 == %d2) { %d1 = getSubStr(%date1,14,2); %d2 = getSubStr(%date2,14,2); if(%d1 >= %d2) return true; else return false; } else if(%d1 > %d2) return true; else return false; } else if(%d1 > %d2) return true; else return false; } else if(%d1 > %d2) return true; else return false; } else if (%d1 > %d2) return true; else return false; } //----------------------------------------------------------------------------- function IsPostAuthor(%author) { // %ai = wonGetAuthInfo(); // %pid = getField(GetRecord(%ai,0), // for(%east=0;%east 0 ) %latest = %lineDate; } if(!ForumsMessageList.highestUpdate) ForumsMessageList.highestUpdate = 0; %newGroup = TopicsListGroup.getObject(ForumsTopicsList.getSelectedRow()); ForumsMessageList.lastID = %newGroup.updateid; %latest = GetField(ForumsTopicsList.getRowTextbyID(ForumsTopicsList.getSelectedID()),3); ForumsMessageVector.dump( $ForumCachePath @ "tpc" @ ForumsMessageVector.tid , ForumsMessageList.lastID TAB $ForumCacheVersion TAB %allRead TAB %latest); } //----------------------------------------------------------------------------- function ForumsAcceptPost() { %parentId = ForumsMessageList.getSelectedId(); %text = ForumsMessageVector.getLineTextByTag(%parentId); %index = ForumsMessageVector.getLineIndexByTag( %parentId ); %author = getRecord( %text, 4 ); %dev = getLinkName(%author); %date = getRecord(%text, 5); %body = getRecords(%text, 7); ForumsGui.ebstat = FO_EditBtn.Visible; ForumsGui.destat = FO_DeleteBtn.Visible; $NewsTitle = getRecord(%text, 3); ForumsMessageList.state = "newsAccept"; Canvas.pushDialog(NewsPostDlg); NewsPostBodyText.setValue("submitted by " @ %dev @ "\n\n" @ ForumsGetTextDisplay(%body)); NewsPostDlg.postID = -1; NewsPostDlg.action = "News"; NewsPostDlg.Findex = %index; NewsPostDlg.FromForums = true; } //----------------------------------------------------------------------------- function ForumsEditPost() { ForumsGui.ebstat = FO_EditBtn.Visible; ForumsGui.destat = FO_DeleteBtn.Visible; %text = ForumsMessageVector.getLineTextByTag(ForumsComposeDlg.parentPost); $ForumsSubject = getRecord(%text, 3); Canvas.pushDialog(ForumsComposeDlg); ForumsBodyText.setValue(ForumsGetTextDisplay(%text,7)); ForumsComposeDlg.post = ForumsComposeDlg.parentPost; ForumsComposeDlg.action = "Edit"; } //----------------------------------------------------------------------------- function ForumsGetTextDisplay(%text, %offSet) { %msgText = ""; %rc = getRecordCount(%text); for(%i = %offSet; %i < %rc; %i++) %msgText = %msgText @ getRecord(%text, %i) @ "\n"; return %msgText; } //----------------------------------------------------------------------------- function ForumsGoTopics(%direction) { ForumShell.setTitle($ForumsConnecting); ForumsThreadPane.setVisible(false); ForumsTopicsPane.setVisible(true); FO_RejectBtn.visible = false; FO_EditBtn.visible = false; FO_AcceptBtn.visible = false; if ( ForumsTopicsList.rowCount() == 0 || ForumsTopicsList.refreshFlag ) { FM_NewTopic.setActive(true); ForumShell.setTitle($ForumsConnecting); ForumsGui.eid = schedule(250,ForumsGui,GetTopicsList); } else ForumsTopicsList.updateReadStatus(); //looks at file if any posts have been added/edited/deleted... ForumShell.setTitle("FORUMS: " @ getField(ForumsList.getRowTextbyID(ForumsList.getSelectedID()),0)); } //----------------------------------------------------------------------------- function ForumsRefreshTopics() { ForumsTopicsList.refreshFlag = true; $currentForumPage = 0; updateTopicPageBtn(0,0); ForumsGui.eid = schedule(250,ForumsGui,GetTopicsList); } //----------------------------------------------------------------------------- function ForumsMessageAddRow(%text) { %rc = ForumsMessageList.rowCount(); %isRead = getRecord( %text, 0 ); %id = getRecord(%text, 1); %parentId = getRecord(%text, 2); %subject = getRecord(%text, 3); %author = getField(getTextName(getRecord(%text, 4), 0), 0); %authorName = getField(getRecord(%text,4),0); %date = getRecord(%text, 5); %ref = getRecord(%text, 6); %oldRow = ForumsMessageList.getRowNumById(%id); %selId = ForumsMessageList.getSelectedId(); if(!%selID) { %selID = ForumsGui.lastSelected; ForumsGui.lastSelected = ""; } if(%parentId) { for(%i = 0; %i < %rc; %i++) { // check for existing? if(ForumsMessageList.getRowId(%i) == %parentId) { %parentRow = ForumsMessageList.getRowText(%i); // echo("Found parent"); break; } } %indentLevel = getField(%parentRow, 3) + 1; %indentSpace = ""; for(%j = 0; %j < %indentLevel; %j++) %indentSpace = %indentSpace @ " "; } else %indentSpace = ""; %rowText = %indentSpace @ %subject TAB %author TAB %date TAB %indentLevel TAB %parentId TAB %ref TAB %authorName; if(%oldRow != -1) //if there's a rownumber - message exists { ForumsMessageList.removeRow(%oldRow); ForumsMessageList.addRow(%id, %rowText, %oldRow); } else if(!%parentId) //if a first post { ForumsMessageList.addRow(%id, %rowText, 0); } else //continue from %i { for(%i++; %i < %rc; %i++) { %row = ForumsMessageList.getRowText(%i); while(%row !$= "") { %rowParent = getField(%row, 4); if(%rowParent == %parentId) break; %row = ForumsMessageList.getRowTextById(%rowParent); if(%rowParent == %row) break; } if(%row $= "") break; } if(%i <= %rc) { ForumsMessageList.addRow(%id, %rowText, %i); } else { ForumsMessageList.addRow(%id, %rowText); } } ForumsMessageList.setRowStyleById( %id, !%isRead ); } //----------------------------------------------------------------------------- function ForumsNewTopic() { %fid = ForumsList.getSelectedID(); if( %fid == 105 || %fid == 35500 || %fid == 35501 || %fid == 35503 ||%fid == 35504) { messageBoxYesNo("CONFIRM", "Please do not submit bug reports without a tested solution, test posts or recruiting posts." NL " " NL "Continue with your submittal?", "StartPostNews();"); } else { $ForumsSubject = ""; Canvas.pushDialog( ForumsComposeDlg ); ForumsBodyText.setValue( "" ); ForumsComposeDlg.parentPost = 0; ForumsComposeDlg.action = "Post"; } } //----------------------------------------------------------------------------- function ForumsNext() { %Currow = ForumsMessageList.getSelectedRow(); if( %Currow < ForumsMessageList.rowCount() ) ForumsMessageList.setSelectedRow( %Currow + 1 ); } //----------------------------------------------------------------------------- function ForumsOpenThread(%tid) { ForumsGui.eid = schedule(250,ForumsGui,GetTopicPosts); } //----------------------------------------------------------------------------- function ForumsPost() { $ForumsSubject = FP_SubjectEdit.getValue(); if ( trim($ForumsSubject) $= "" ) { MessageBoxOK( "POST FAILED", "Your post cannot be accepted without text in the Subject line.", "FP_SubjectEdit.makeFirstResponder(1);"); return; } // the subject text could be too long (OCI strips out non-ascii. encoding method ensures normal chars still readable if(getExpandedStrlen($ForumsSubject) >= 80) { MessageBoxOK( "POST FAILED", "Subject text too long. Extended/international characters count as two letters.", "FP_SubjectEdit.makeFirstResponder(1);"); return; } TextCheck($ForumsSubject,ForumsGui); if(!ForumsGui.textCheck) { ForumsTopicsList.refreshFlag = 1; if(ForumsComposeDlg.parentPost == 0) //this is a new topic request { if(ForumsComposeDlg.action $= "Post") { %ord = 12; %proxy = ForumsGui; %proxy.state = "newTopic"; ForumsGui.LaunchTopic = $ForumsSubject; %fieldData = ForumsComposeDlg.forum TAB ForumsComposeDlg.topic TAB ForumsComposeDlg.parentPost TAB $ForumsSubject TAB ForumsBodyText.getValue(); } else if(ForumsComposeDlg.action $="News") { %ord = 14; %proxy.state = "postNews"; %fieldData = ForumsComposeDlg.post TAB $ForumsSubject TAB ForumsBodyText.getValue(); } } else if(ForumsComposeDlg.parentPost != 0) { if(ForumsComposeDlg.action $= "Reply") { %ord = 12; %proxy = ForumsMessageList; %proxy.state = "replyPost"; %fieldData = ForumsComposeDlg.forum TAB ForumsComposeDlg.topic TAB ForumsComposeDlg.parentPost TAB $ForumsSubject TAB ForumsBodyText.getValue(); } else if(ForumsComposeDlg.action $="Edit") { %ord = 13; %proxy = ForumsMessageList; %proxy.state = "editPost"; %fieldData = ForumsComposeDlg.parentPost TAB $ForumsSubject TAB ForumsBodyText.getValue(); } } %proxy.key = LaunchGui.key++; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(%ord,%fieldData,%proxy, %proxy.key); Canvas.popDialog(ForumsComposeDlg); } else { messageBoxOK("ERROR","Please remove any of the following characters contained in your subject line and resubmit" NL "" NL " : < > * ^ | ~ @ % & / \\ ` \""); FP_SubjectEdit.makeFirstResponder(1); } } //----------------------------------------------------------------------------- function ForumsPrevious() { %Currow = ForumsMessageList.getSelectedRow(); if( %Currow > 0 ) ForumsMessageList.setSelectedRow( %Currow - 1 ); } //----------------------------------------------------------------------------- function ForumsRejectPost() //forumsDeletePost() { ForumsGui.ebstat = FO_EditBtn.Visible; ForumsGui.destat = FO_DeleteBtn.Visible; ForumsMessageList.key = LaunchGui.key++; ForumsMessageList.state = "deletePost"; canvas.SetCursor(ArrowWaitCursor); MessageBoxYesNo("CONFIRM", "Are you sure you wish to remove the selected post?", "DatabaseQuery(14," @ ForumsComposeDlg.parentPost @ "," @ ForumsMessagelist @ "," @ ForumsMessagelist.key @ ");", "canvas.SetCursor(defaultCursor);"); } //----------------------------------------------------------------------------- function ForumsReply() { %text = ForumsMessageVector.getLineTextByTag(ForumsComposeDlg.parentPost); ForumsGui.ebstat = FO_EditBtn.Visible; ForumsGui.destat = FO_DeleteBtn.Visible; $ForumsSubject = getRecord(%text, 3); Canvas.pushDialog(ForumsComposeDlg); ForumsBodyText.setValue(""); QuoteBtn.setVisible(ForumsMessageVector.getNumLines() > 0); // MessageBoxYesNo("QUOTE?","Include Topic Post Text?","GetQuotedText();","ForumsBodyText.setValue(\"\");"); ForumsComposeDlg.action = "Reply"; } //----------------------------------------------------------------------------- function GetQuotedText() { if(ForumsComposeDlg.parentPost == 0) { ForumsBodyText.setValue(""); // ForumsBodyText.setValue("ALL YOUR BASE ARE BELONG TO US\n\n"); ForumsBodyText.MakeFirstResponder(1); ForumsBodyText.setCursorPosition(3600); } else { ForumsBodyText.setValue("\"" @ trim(ForumsText.getText()) @ "\"\n\n"); ForumsBodyText.MakeFirstResponder(1); ForumsBodyText.setCursorPosition(3600); } // ForumsBodyText.setCursorPosition(strLen(ForumsBodyTExt.getText())+5); } //----------------------------------------------------------------------------- function GetForumsList() { ForumsList.clear(); ForumsGui.onWake(); } //----------------------------------------------------------------------------- function GetTopicsList() { ForumShell.setTitle($ForumsGetTopics); canvas.SetCursor(ArrowWaitCursor); ForumsTopicsList.clear(); ForumsTopicsList.clearList(); ForumsTopicsList.refreshFlag = 0; ForumsGui.key = LaunchGui.key++; ForumsGui.state = "getTopicList"; DatabaseQueryArray(8,$currentForumPage,ForumsList.getSelectedID(),ForumsGui,ForumsGui.key,true); } //----------------------------------------------------------------------------- function GetTopicPosts() { ForumsThreadPane.setVisible(true); ForumsTopicsPane.setVisible(false); ForumShell.setTitle($ForumsGetPosts); canvas.SetCursor(ArrowWaitCursor); ForumsGui.key = LaunchGui.key++; ForumsGui.state = "getPostList"; ForumsText.setValue(""); FO_TopicText.setValue(strupr(getField(ForumsTopicsList.getRowTextByID(ForumsComposeDlg.Topic),0))); if(!ForumsComposeDlg.Topic) ForumsComposeDlg.topic = ForumsTopicsList.getSelectedID(); ForumsMessageList.clearList(); ForumsMessageList.loadCache(getField(ForumsList.getRowTextByID(ForumsList.getSelectedID()),1)); if(ForumsMessageList.lastID == 0) { ForumsMessageVector.clear(); ForumsMessageList.clear(); } DatabaseQueryArray(9,0,ForumsComposeDlg.Topic TAB ForumsMessageList.lastID,ForumsGui,ForumsGui.key,true); } //----------------------------------------------------------------------------- //-- ForumsGui --------------------------------------------------------------- //----------------------------------------------------------------------------- function ForumsGui::onAdd( %this ) { %this.initialized = false; if($GuidTribes == 0) { %ai = wonGetAuthInfo(); $GuidTribes = getRecords(%ai,1); } } //----------------------------------------------------------------------------- function ForumsGui::onWake(%this) { // First time only: if ( !%this.initialized ) { // Add the columns from the prefs:TopicsList for ( %i = 0; %i < $TopicColumnCount; %i++ ) { ForumsTopicsList.addColumn( %i, $TopicColumnName[%i], $pref::Topics::Column[%i], firstWord( $TopicColumnRange[%i] ), getWord( $TopicColumnRange[%i], 1 ), $TopicColumnFlags[%i] ); } ForumsTopicsList.setSortColumn( $pref::Topics::SortColumnKey ); ForumsTopicsList.setSortIncreasing( $pref::Topics::SortInc ); // Add columns from the prefs:MessageList for ( %i = 0; %i < $ForumColumnCount; %i++ ) ForumsMessageList.addColumn( %i, $ForumColumnName[%i], $pref::Forum::Column[%i], firstWord( $ForumColumnRange[%i] ), getWord( $ForumColumnRange[%i], 1 ) ); // We want no sorting done on this list -- leave them in the order that they are entered. FM_NewTopic.setActive(false); ForumsThreadPane.setVisible(false); ForumsTopicsPane.setVisible(true); ForumsMessageList.thread = ""; ForumsMessageList.lastId = ""; // Both panes should have the same minimum extents... %minExtent = FO_MessagePane.getMinExtent(); FO_Frame.frameMinExtent( 0, firstWord( %minExtent ), restWords( %minExtent ) ); FO_Frame.frameMinExtent( 1, firstWord( %minExtent ), restWords( %minExtent ) ); %this.initialized = true; } Canvas.pushDialog(LaunchToolbarDlg); if ( ForumsList.rowCount() == 0) { ForumsGui.key = LaunchGui.key++; ForumShell.setTitle($ForumsConnecting); ForumsGui.state = "getForumList"; canvas.SetCursor(ArrowWaitCursor); $currentForumPage = 0; DatabaseQueryArray(7,100,"",ForumsGui,ForumsGui.key); } // Make these buttons inactive until a message is selected: FTPrevBtn.setActive(false); FTNextBtn.setActive(false); FO_ReplyBtn.setActive( false ); FO_NextBtn.setActive( false ); FO_PreviousBtn.setActive( false ); } //----------------------------------------------------------------------------- function ForumsGui::onSleep(%this) { Canvas.popDialog(LaunchToolbarDlg); // Stop the scheduled refreshes: cancel( %this.messageRefresh ); } //----------------------------------------------------------------------------- function ForumsGui::setKey( %this, %key ) { } //----------------------------------------------------------------------------- function ForumsGui::onClose( %this, %key ) { } //----------------------------------------------------------------------------- function ForumsGui::onDatabaseQueryResult(%this,%status,%resultString,%key) { if(%this.key != %key) return; // echo("RECV: " @ %status NL "RS:" @ %resultString); if(getField(%status,0)==0) { switch$(%this.state) { case "getForumList": if(getField(%resultString,0)>0) { %this.forumCount = -1; ForumShell.setTitle($ForumsGetForums @ ": " @ getField(%resultString,0)); %this.state = "ForumList"; ForumsList.clear(); } else { %this.state = "done"; MessageBoxOK("NO DATA","No Forums found"); } case "getTopicList": if(getField(%resultString,0)>0) { %this.txid = 0; ForumShell.setTitle($ForumsGetTopics @ ": " @ getField(%resultString,0)); %this.state = "TopicList"; %recordCount = getField(%resultString,0); if(%recordCount > $topicPageLength) { if($currentForumPage == 0) updateTopicPageBtn(0,1); else if($currentForumPage > 0) updateTopicPageBtn(1,1); } else { if($currentForumPage == 0) updateTopicPageBtn(0,0); else if($currentForumPage > 0) updateTopicPageBtn(1,0); } } else { %this.state = "done"; ForumsTopicsList.updateReadStatus(); } case "getPostList": %statFlag = getField(%status,2); %forumFlag = getField(ForumsList.getRowTextbyId(ForumsList.getSelectedID()),1); %forumID = getField(ForumsList.getRowTextById(ForumsList.getSelectedID()),2); %forumTID = ForumsTopicsList.getSelectedID(); %this.bflag = %statFlag; if(getField(%resultString,0)>0) { ForumShell.setTitle($ForumsGetPosts @ ": " @ getField(%resultString,0)); %this.state = "PostList"; if(!ForumsGui.visible) ForumsGui.setVisible(true); } else { %this.state = "done"; ForumsMessageList.clearList(); ForumsMessageList.loadCache(%forumID); } case "postNews": %this.state = "done"; messageBoxOK("CONFIRMED","Your News Reply has been submitted"); case "newTopic": %this.state = "done"; ForumsRefreshTopics(); } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else { %this.state = "error"; MessageBoxOk("ERROR",getField(%status,1)); } ForumShell.setTitle("FORUMS: " @ getField(ForumsList.getRowTextbyID(ForumsList.getSelectedID()),0)); canvas.SetCursor(defaultCursor); } //----------------------------------------------------------------------------- function ForumsGui::onDatabaseRow(%this,%row,%isLastRow,%key) { if(%this.key != %key) return; // echo("RECV: " @ %row); %forumTID = getField(ForumsList.getRowTextbyId(ForumsList.getSelectedID()),2); switch$(%this.state) { case "ForumList": ForumsList.addRow(getField(%row,0),getField(%row,1) TAB getField(%row,2) TAB getField(%row,3)); if ( %isLastRow ) //is last line { %ai = wonGetAuthInfo(); for(%east=0;%east ForumsMessageList.highestUpdate ) ForumsMessageList.highestUpdate = %high; if(%parent == %postId) %parent = 0; %text = 0 NL %postId NL %parent NL %topic NL %poster NL %date NL %isAuthor NL %body; %li = ForumsMessageVector.getLineIndexByTag(%postId); if(%li != -1) ForumsMessageVector.deleteLine(%li); if(ForumsMessageList.allRead && DateStrCompare(ForumsMessageList.lastDate,%date)) %text = setRecord( %text, 0, "1" ); if(!%isDeleted) ForumsMessageVector.pushBackLine(%text, %postId); if(%isLastRow) { ForumsMessageVector.tid = ForumsTopicsList.getSelectedID(); ForumsTopicsList.thread = TopicsListGroup.getObject(ForumsTopicsList.getSelectedRow()); ForumsTopicsList.thread.updateID = %high; CacheForumTopic(); ForumsMessageList.loadCache(ForumsTopicsList.getSelectedID()); } } } //----------------------------------------------------------------------------- function ForumsGui::NextThreadPage() { if($currentForumPage >= 5) return; ForumsGui.key = LaunchGui.key++; ForumShell.setTitle($ForumsGetTopics); ForumsGui.state = "getTopicList"; ForumsTopicsList.clear(); canvas.SetCursor(ArrowWaitCursor); ForumsTopicsList.clearList(); $currentForumPage++; DatabaseQueryArray(8,$currentForumPage,ForumsList.getSelectedID(),ForumsGui,ForumsGui.key,true); ForumsTopicsList.refreshFlag = 0; } //----------------------------------------------------------------------------- function ForumsGui::PreviousThreadPage() { if($currentForumPage == 0) return; ForumsGui.key = LaunchGui.key++; ForumShell.setTitle($ForumsGetTopics); ForumsGui.state = "getTopicList"; ForumsTopicsList.clear(); canvas.SetCursor(ArrowWaitCursor); ForumsTopicsList.clearList(); $currentForumPage--; DatabaseQueryArray(8,80,ForumsList.getSelectedID(),ForumsGui,ForumsGui.key,true); ForumsTopicsList.refreshFlag = 0; } //----------------------------------------------------------------------------- //-- ForumsList -------------------------------------------------------------- //----------------------------------------------------------------------------- function ForumsList::onSelect(%this) { if(isEventPending(ForumsGUI.eid)) cancel(ForumsGui.eid); FM_NewTopic.setActive(true); ForumsComposeDlg.forum = ForumsList.getSelectedID(); ForumShell.setTitle("FORUMS: " @ getField(ForumsList.getRowTextbyID(ForumsList.getSelectedID()),0)); $currentForumPage = 0; ForumsGui.eid = schedule(250,ForumsGui,GetTopicsList); } //----------------------------------------------------------------------------- function ForumsList::connectionTerminated( %this, %key ) { ForumShell.setTitle("FORUMS: " @ getField(ForumsList.getRowTextbyID(ForumsList.getSelectedID()),0)); if ( %key != %this.key ) return; } //----------------------------------------------------------------------------- function ForumsList::selectForum( %this, %forum ) { %rowCount = %this.rowCount(); for ( %row = 0; %row < %rowCount; %row++ ) { if ( %forum $= getField( %this.getRowText( %row ), 0 ) ) { %this.setSelectedRow( %row ); break; } } if ( %row == %rowCount ) warn( "\"" @ %forum @ "\" forum not found!" ); } //----------------------------------------------------------------------------- //-- ForumsTopicsList -------------------------------------------------------- //----------------------------------------------------------------------------- function ForumsTopicsList::onAdd( %this ) { new GuiControl(TopicsPopupDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; new ShellPopupMenu( TopicsPopupMenu ) { profile = "ShellPopupProfile"; position = "0 0"; extent = "0 0"; minExtent = "0 0"; visible = "1"; maxPopupHeight = "200"; noButtonStyle = "1"; }; }; // Add the "Unread" style: %this.addStyle( 1, $ShellBoldFont, $ShellFontSize, "80 220 200", "30 255 225", "10 60 40" ); // Add the "Ignored" style: %this.addStyle( 2, $ShellFont, $ShellFontSize, "100 100 100", "100 100 000", "100 100 100" ); // Add the "LOCKED" style: %this.addStyle( 3, $ShellFont, $ShellFontSize, "200 50 50", "200 100 100", "200 50 50" ); } //----------------------------------------------------------------------------- function ForumsTopicsList::AddTopic(%this, %iRow, %id, %topicname, %date, %mid, %slevel, %vline) { if(!isObject(TopicsListGroup)) new SimGroup(TopicsListGroup); %topic = new scriptObject() { className = "TTopic"; rowID = %iRow; Id = %id; name = %topicname; date = %date; updateid = %mid; slevel = %slevel; rcvrec = %vline; }; TopicsListGroup.Add(%topic); } //----------------------------------------------------------------------------- function ForumsTopicsList::ClearList() { if(isObject(TopicsListGroup)) TopicsListGroup.Delete(); } //----------------------------------------------------------------------------- function ForumsTopicsList::onRightMouseDown( %this, %column, %row, %mousePos ) { ForumsTopicsList.setSelectedRow(%row); // for(%i=0;%i -1) getTopicPosts(); else if ( %row == %rowCount ) warn( "\"" @ %topic @ "\" Topic not found!" ); } //----------------------------------------------------------------------------- function ForumsTopicsList::updateReadStatus( %this ) { for ( %row = 0; %row < %this.rowCount(); %row++ ) { %style = 1; // unread %cacheFile = $ForumCachePath @ "tpc" @ %this.getRowId( %row ); %file = new FileObject(); if ( %file.openForRead( %cacheFile ) ) { %header = %file.readLine(); %topicDate = getField( %this.getRowText( %row ), 3 ); %updateID = getField(%header,0); if ( getField( %header, 1 ) == $ForumCacheVersion // Must have same cache version && getField( %header, 2 ) == 1 // "all read" flag must be set && strcmp( getField( %header, 3 ), %topicDate ) >= 0 && %updateID !$= "99999999" ) // date must be current %style = 0; // read else if (%updateID $= "99999999") %style = 2; //ignored else %style = 1; } %file.delete(); %this.setRowStyle( %row, %style ); } } //----------------------------------------------------------------------------- //-- ForumsMessageList ------------------------------------------------------- //----------------------------------------------------------------------------- function ForumsMessageList::onAdd( %this ) { new GuiControl(PostsPopupDlg) { profile = "GuiModelessDialogProfile"; horizSizing = "width"; vertSizing = "height"; position = "0 0"; extent = "640 480"; minExtent = "8 8"; visible = "1"; setFirstResponder = "0"; modal = "1"; new ShellPopupMenu( PostsPopupMenu ) { profile = "ShellPopupProfile"; position = "0 0"; extent = "0 0"; minExtent = "0 0"; visible = "1"; maxPopupHeight = "200"; noButtonStyle = "1"; }; }; // Add the "Unread" style: %this.addStyle( 1, $ShellBoldFont, $ShellFontSize, "80 220 200", "30 255 225", "0 0 0" ); } //----------------------------------------------------------------------------- function ForumsMessageList::AddPost(%this, %id, %postname, %authorID, %authorName, %date, %mid, %slevel, %vline) { if(!isObject(PostsListGroup)) new SimGroup(PostsListGroup); %post = new scriptObject() { className = "TPost"; Id = %id; name = %postname; author = %authorName; authorID = %authorID; date = %date; updateid = %mid; slevel = %slevel; rcvrec = %vline; }; PostsListGroup.Add(%post); } //----------------------------------------------------------------------------- function ForumsMessageList::ClearList() { if(isObject(PostsListGroup)) PostsListGroup.Delete(); } //----------------------------------------------------------------------------- function ForumsMessageList::onRightMouseDown( %this, %column, %row, %mousePos ) { ForumsMessageList.setSelectedRow(%row); PostsPopupMenu.post = PostsListGroup.getObject(%row); if ( trim(PostsPopupMenu.post.name) !$= "") { Canvas.pushDialog(PostsPopupDlg); PostsPopupMenu.position = %mousePos; PostsPopupDlg.onWake(); PostsPopupMenu.forceOnAction(); } else error( "Locate Error!" ); } //----------------------------------------------------------------------------- function PostsPopupDlg::onWake( %this ) { ForumsGui.TDialogOpen = true; PostsPopupMenu.clear(); PostsPopupMenu.add( strUpr(PostsPopupMenu.post.author),0); %line = "------------------------------------------------"; %line2 = "................................................"; PostsPopupMenu.add(%line,-1); PostsPopupMenu.add( "EMAIL", 1 ); PostsPopupMenu.add( "ADD To BUDDYLIST",2); // PostsPopupMenu.add( "INVITE TO CHAT",3); // PostsPopupMenu.add( "INSTANT MESSAGE",4); // PostsPopupMenu.add( "FOLLOW TO GAME (if playing)",5); if(isModerator()) { PostsPopupMenu.add(%line2,-1); PostsPopupMenu.add( getsubstr(PostsPopupMenu.post.name,0,20) SPC ": REQUEST ADMIN REVIEW",9); if(isT2Admin()) PostsPopupMenu.add( getsubstr(PostsPopupMenu.post.name,0,20) SPC ": REMOVE POST",10); } Canvas.rePaint(); } //----------------------------------------------------------------------------- function PostsPopupMenu::onSelect( %this, %id, %text ) { // echo("TPM RECV: " @ %id TAB %text); switch( %id ) { case 0: LinkBrowser( PostsPopupMenu.post.author , "Warrior"); case 1: // 0 EMAIL Post Author LinkEMail(PostsPopupMenu.post.author); // MessageBoxOK("NOTICE","Feature Not Yet Implemented"); case 2: // 1 ADD Post Author to your BuddyList MessageBoxYesNo("CONFIRM","Add " @ PostsPopupMenu.post.author @ " to Buddy List?", "LinkAddBuddy(\"" @ PostsPopupMenu.post.author @ "\",TWBText,\"addBuddy\");",""); // MessageBoxOK("NOTICE","Feature Not Yet Implemented"); case 3: // 2 INVITE Post Author To CHAT MessageBoxOK("NOTICE","Feature Not Yet Implemented"); case 4: // 3 IMSG Post Author MessageBoxOK("NOTICE","Feature Not Yet Implemented"); case 5: // 4 FOLLOW Post Author to game if is playing MessageBoxOK("NOTICE","Feature Not Yet Implemented"); case 9: //Request Admin Review // FORUMID.TOPICID.POSTID.AUTHORID PostsPopupDlg.key = LaunchGui.key++; PostsPopupDlg.state = "requestPostReview"; %fieldData = ForumsList.getSelectedID() TAB ForumsTopicsList.getSelectedID() TAB ForumsMessageList.getSelectedID() TAB PostsPopupMenu.post.authorID; MessageBoxYesNo("CONFIRM","Request Admin Review?","PostsPopupMenu.adminCall(61,\"" @ %fieldData @ "\");",""); case 10: //Remove Post PostsPopupDlg.key = LaunchGui.key++; PostsPopupDlg.state = "adminRemovePost"; %fieldData = ForumsMessageList.getSelectedID(); MessageBoxYesNo("CONFIRM","Remove Post?","PostsPopupMenu.adminCall(14,\"" @ %fieldData @ "\");",""); // %fieldData = 0 TAB ForumsList.getSelectedID() TAB ForumsTopicsList.getSelectedID() TAB ForumsMessageList.getSelectedID() TAB PostsPopupMenu.post.authorID; // MessageBoxYesNo("CONFIRM","Remove Post?","PostsPopupMenu.adminCall(63,\"" @ %fieldData @ "\");",""); } canvas.popDialog(PostsPopupDlg); } //----------------------------------------------------------------------------- function PostsPopupMenu::AdminCall(%this, %ord, %fields) { databaseQuery(%ord, %fields, PostsPopupDlg, PostsPopupDlg.key); } //----------------------------------------------------------------------------- function PostsPopupDlg::onSleep(%this) { ForumsGui.TDialogOpen = false; } //----------------------------------------------------------------------------- function PostsPopupDlg::onDatabaseQueryResult(%this,%status,%recordCount,%key) { if(%this.key != %key) return; if(getField(%status,0)==0) { %selRow = ForumsMessageList.getRowNumByID(PostsPopupMenu.post.id); if (%this.state $= "adminRemovePost") { MessageBoxOK("NOTICE",getField(%status,1)); ForumsMessageVector.deleteLine( %selRow ); ForumsMessageList.removeRow( %selRow ); ForumsMessageList.setSelectedRow( %selRow ); CacheForumTopic(); %this.State = "done"; } if (%this.state $= "adminRemovePostPlus") { MessageBoxOK("NOTICE",getField(%status,1)); ForumsMessageVector.deleteLine( %selRow ); ForumsMessageList.removeRow( %selRow ); ForumsMessageList.setSelectedRow( %selRow ); CacheForumTopic(); Email_ToEdit.setText(getField(%status,3)); Email_CCEdit.setText(""); switch(getField(%status,2)) { case 1: $EmailSubject = "Policy Violation Warning"; case 2: $EmailSubject = "Policy Violation Ban Notice : 24 hours"; case 3: $EmailSubject = "Policy Violation Ban Notice : 48 hours"; case 4: $EmailSubject = "Policy Violation Ban Notice : 72 hours"; case 5: $EmailSubject = "Policy Violation Ban Notice : 7 Days"; case 6: $EmailSubject = "Policy Violation Ban Notice : 30 Days"; case 7: $EmailSubject = "Policy Violation Ban Notice : Indefinite"; } EMailComposeDlg.state = "sendMail"; Canvas.pushDialog(EmailComposeDlg); EmailBodyText.setValue(""); Email_ToEdit.makeFirstResponder(1); } else if (%this.state $= "requestPostReview") { MessageBoxOK("NOTICE",getField(%status,1)); } else { ForumsMessageVector.deleteLine( %selRow ); ForumsMessageList.removeRow( %selRow ); ForumsMessageList.setSelectedRow( %selRow ); CacheForumTopic(); MessageBoxOK("NOTICE",getField(%status,1)); } } else messageBoxOK("ERROR",getField(%status,1)); } //----------------------------------------------------------------------------- function ForumsMessageList::connectionTerminated(%this, %key) { ForumShell.setTitle("FORUMS: " @ getField(ForumsList.getRowTextbyID(ForumsList.getSelectedID()),0)); } //----------------------------------------------------------------------------- function ForumsMessageList::loadCache( %this, %forumTID) { ForumsMessageVector.clear(); ForumsMessageList.clear(); ForumsMessageVector.tid = %forumTID; %this.lastId = 0; %this.highestUpdate = %this.lastID; %cacheFile = $ForumCachePath @ "tpc" @ ForumsComposeDlg.topic; %file = new FileObject(); if ( %file.openForRead( %cacheFile ) ) { if ( !%file.isEOF() ) { // First line is the update id: %line = %file.readLine(); if ( getField( %line, 1 ) == $ForumCacheVersion ) { %this.lastID = getField(%line,0); %this.highestUpdate = %this.lastID; %this.allRead = getField(%line,2); %this.lastDate = getField(%line,3); if ( !%file.isEOF() ) { // Second line is the message count: %line = %file.readLine(); %count = getField( %line, 0 ); // Now push all of the messages into the message vector: while ( !%file.isEOF() ) { %line = %file.readLine(); %postId = firstWord( %line ); %text = collapseEscape( restWords( %line ) ); %date = getRecord(%text,5); %isRead = getRecord(%text,0); // RESET THE FIELDS IF THE POST IS BEING VISITED BY THE AUTHOR. %ref = getRecord(%text,6); if(%this.allRead && DateStrCompare(%this.lastDate,%date)) %text = setRecord( %text, 0, "1" ); // echo( "** ADDING MESSAGE FROM CACHE - " @ %postId @ " **" ); ForumsMessageVector.pushBackLine( %text, %postId ); } } } } } %file.delete(); %numLines = ForumsMessageVector.getNumLines(); for(%x=0;%x<%numLines;%x++) { %lineText = ForumsMessageVector.getLineText( %x ); ForumsMessageAddRow( %lineText ); } if(ForumsMessageList.getSelectedId() == -1) ForumsMessageList.setSelectedRow(0); for(%x=0;%x<%numLines;%x++) { %lineText = ForumsMessageVector.getLineTextbyTag( ForumsMessageList.getRowID(%x) ); %ltID = getField(getRecord(%lineText,1),0); %ltSubject = getField(getRecord(%lineText,3),0); %ltAuthorID = getField(getRecord(%lineText,4),3); %ltAuthorName = getField(getRecord(%lineText,4),0); %ltDate = getField(getRecord(%lineText,5),0); %ltParentID = getField(getRecord(%lineText,2),0); if(%ltParentID == 0) %ltParentID = %ltID; %ltIsRead = getField(getRecord(%lineText,0),0); ForumsMessageList.addPost(%ltID, %ltSubject, %ltAuthorID, %ltAuthorName, %ltDate, %ltParentID, %ltIsRead, %lineText); } } //----------------------------------------------------------------------------- function ForumsMessageList::onColumnResize( %this, %column, %newSize ) { $pref::Forum::Column[%column] = %newSize; } //----------------------------------------------------------------------------- function ForumsMessageList::onSelect(%this, %id, %text) { if(!ForumsMessageList.getSelectedID()) %parentId = 0; else %parentId = ForumsMessageList.getSelectedId(); ForumsComposeDlg.parentPost = %parentId; %rawText = ForumsMessageVector.getLineTextByTag( ForumsComposeDlg.parentPost ); %offSet = 7; if ( getRecord( %rawText, 0 ) $= "0" ) { // Set the "read" flag: %this.setRowStyleById( %id, 0 ); %line = ForumsMessageVector.getLineIndexByTag( %parentId ); ForumsMessageVector.deleteLine( %line ); %rawText = setRecord( %rawText, 0, "1" ); ForumsMessageVector.pushBackLine( %rawText, %parentId ); CacheForumTopic(); } %text = ForumsGetTextDisplay( %rawText,%offSet ); ForumsText.setValue(%text); FO_ReplyBtn.setActive( true ); FO_NextBtn.setActive( true ); FO_PreviousBtn.setActive( true ); %ref = getRecord(%rawText,6); updatePostBtn(ForumsList.getSelectedID(),getField(getRecord(ForumsMessageVector.getLineTextbyTag(ForumsMessageList.getSelectedID()),4),3)); } //----------------------------------------------------------------------------- function ForumsMessagelist::onDatabaseQueryResult(%this,%status,%resultString,%key) { if(%this.key != %key) return; // echo("RECV: " @ %status TAB %resultString); if(getField(%status,0)==0) { MessageBoxOK("COMPLETE",getField( %status, 1)); switch$(%this.state) { case "replyPost": %this.state = "done"; ForumsOpenThread(); case "editPost": %this.state = "done"; %postId = getField( %status, 2 ); %index = ForumsMessageVector.getLineIndexByTag( %postId ); %text = ForumsMessageVector.getLineTextByTag( %postId ); %parent = getRecord( %text, 2 ); ForumsMessageVector.deleteLine( %index ); %text = setRecord(%text,0,"1"); ForumsMessageVector.pushBackLine(%text, %postID); CacheForumTopic(); GetTopicPosts(); case "deletePost": %this.state = "done"; %postId = getField( %status, 2 ); %index = ForumsMessageVector.getLineIndexByTag( %postId ); %text = ForumsMessageVector.getLineTextByTag( %postId ); %parent = getRecord( %text, 2 ); ForumsTopicsList.refreshFlag = true; ForumsMessageVector.deleteLine( %index ); CacheForumTopic(); if ( %parent != 0 ) { %row = ForumsMessageList.getRowNumById( %postId ); ForumsMessageList.removeRowById( %postId ); if ( %row < ForumsMessageList.rowCount() ) ForumsMessageList.setSelectedRow( %row ); else ForumsMessageList.setSelectedRow( %row - 1 ); %this.state = "done"; ForumsOpenThread(); } else { ForumsTopicsList.refreshFlag = true; ForumsGoTopics(0); } } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else { MessageBoxOK("ERROR",getFields(%status,1)); } canvas.SetCursor(DefaultCursor); } //----------------------------------------------------------------------------- function ForumsComposeDlg::onWake( %this ) { // Get the window pos and extent from prefs: %res = getResolution(); %resW = firstWord( %res ); %resH = getWord( %res, 1 ); %w = firstWord( $pref::Forum::PostWindowExtent ); if ( %w > %resW ) %w = %resW; %h = getWord( $pref::Forum::PostWindowExtent, 1 ); if ( %h > %resH ) %h = %resH; %x = firstWord( $pref::Forum::PostWindowPos ); if ( %x > %resW - %w ) %x = %resW - %w; %y = getWord( $pref::Forum::PostWindowPos, 1 ); if ( %y > %resH - %h ) %y = %resH - %h; FC_Window.resize( %x, %y, %w, %h ); } //----------------------------------------------------------------------------- function ForumsComposeDlg::onSleep( %this ) { $pref::Forum::PostWindowPos = FC_Window.getPosition(); $pref::Forum::PostWindowExtent = FC_Window.getExtent(); } PK !(0bbscripts/webnews.cs$WebLinkCount = 0; $currentPage = 0; $newsCacheVersion = 1; if (!isObject(NewsVector)) new MessageVector(NewsVector); function LaunchNews() { LaunchTabView.viewTab( "NEWS", NewsGui, 0 ); } //----------------------------------------------------------------------------- function updatePageBtn(%prev,%next) { NewsPrevBtn.setVisible( 0 ); NewsNextBtn.setVisible( 0 ); // NewsPrevBtn.setActive( %prev ); // NewsNextBtn.setActive( %next ); } //----------------------------------------------------------------------------- function NewsGui::onAdd(%this) { NewsGui.tabsLoaded = 0; if(!isDemo()) { if(!isObject(NCHGroup)) new SimGroup(NCHGroup); } } //----------------------------------------------------------------------------- function NewsGui::onWake(%this) { Canvas.pushDialog(LaunchToolbarDlg); %this.set = 1; // signifies the first (latest) set if ( isDemo() ) { if ( !%this.oneTimeOnly ) { %this.oneTimeOnly = 1; NewsPrevBtn.setVisible( false ); NewsNextBtn.setVisible( false ); NewsSubmitBtn.setVisible( false ); NewsMOTDText.setValue( "Welcome to the Tribes 2 Demo!" ); %this.addStaticArticle( "What's In This Demo?", "There are two training missions, and two multiplayer maps in this demo.\n\nIf you're new to the Tribes experience, you should consider trying out the training missions so you can become familiar with the basics of the game. Then, after you learn how to use your jets and weapons, jump into multiplayer on one of our Demo Servers to fight against other players like yourself." ); %this.addStaticArticle( "What Do I Do First?", "As a suggestion, you might consider checking out the on-line manual first. That manual is available at our 'Tribes 2 Central Download' website (www.tribes2centraldownload.com) in the 'T2 Manual' sub-folder. After you take a look at the manual, you should definitely try out the first two Training Missions. They'll give you most of the basics that you need to know in order to play competitively on-line. Of course, then you should go enter the mayhem known as Tribes and have a blast gaming against other players." ); %this.addStaticArticle( "Where are the Options?", "There is a LAUNCH button in the lower left of this screen. Click on it and choose the SETTINGS option. There you will find ways to modify your graphics, textures, network settings, key configurations and more.\n\nMost of these settings will be configured automatically based on your system's hardware, so try the game with the default settings for a while and see how it plays. Then, optimize your settings accordingly thereafter." ); %this.addStaticArticle( "What is Capture the Flag?", "Many of you have played versions of Capture the Flag (CTF) in real-life or in other computer games. Tribes 2's version is quite similar to what you're used to playing.\n\nThe object is to go grab the other team's flag and return it to your own base by taking it to your flag's position. Your team scores points for capturing the flag and some minor (tie-breaking) points for touching it.\n\nThe game has many roles and is definitely the most popular of the T2 games. You can play defense by setting up turret perimeters, deploying sensors and guarding the flag, or load three people into a bomber and make bombing runs over the enemy base, or many other things.\n\nTry them all out. There's certainly a role in there for you somewhere." ); %this.addStaticArticle( "What is Hunters?", "Unlike CTF, Hunters is an individual game rather than a team game. The object of the game is to destroy other players, thus causing them to drop all the flags they are carrying. Each person carries at least one flag at all times, but the players that gather the most flags are the biggest targets.\n\nWhen you have a bunch of flags, take them to the 'Nexus'. The Nexus is waypointed with a marker on your HUD and is a column of glowing light. You can't miss it. Run through that column and you'll score points for the flags you carry.\n\nThe scoring for flags is a curve, so the more flags you carry, the more points you will score. Large amounts of flags can create very high scores if you capture them all at once." ); %this.addStaticArticle( "What is the Full Version Like?", "There are six different game types, five different worlds, six vehicles, a whole slew of voices and tribe skins, all the weapons you saw in the demo, and 53 different maps. There's an on-line community with constantly updated News, Forums, Chat, Email, and a Player/Tribe Browser so that the whole community is at your fingertips. Also the Tribes player community is thriving. Player-created scripts, game mods, and maps are plentiful and high-quality. In short, it's much, much more than what you see in this demo." ); %this.addStaticArticle( "What Video Drivers Do I Use?", "Please check your video card company's website for the latest video driver information.\n\nWe advise against the use of beta drivers. They often cause problems for our current players and should be avoided." ); %this.addStaticArticle( "How to Tweak Framerate", "There are many graphic options in the game. If you are experiencing low framerate for some reason, there are two main areas you should try out.\n\nIf your CPU is relatively slow, then you should try turning down all the options associated with polygon count. These are listed in SETTINGS/GRAPHICS. You might also try a lower screen resolution, or even 16-bit color. 16-bit color has the side effect of using 16-bit z-buffering, which isn't as nice as 32-bit, but it's much faster.\n\nIf your video card doesn't have much VRAM, then you should consider turning down the options that use a lot of texture memory. These are found in SETTINGS/TEXTURES." ); %this.addStaticArticle( "A Small Disclaimer", "This NEWS page is static, unlike the one in the real game. In otherwords, don't expect the constant community updates and news items that you will get after you buy the full version. ;)" ); if ( WebLinksMenu.size() == 0 ) WebLinksMenu.defaultList(); } } else { Canvas.SetCursor(ArrowWaitCursor); if (NewsTabGroup.tabCount() == 0) { NewsGui.startup = 1; NewsTabGroup.addTab( 105, "FRONT PAGE", 1); NewsTabGroup.addTab( 35500, "EVENTS"); NewsTabGroup.addTab( 35501, "SPORTS"); NewsTabGroup.addTab( 35503, "TECH"); NewsTabGroup.addTab( 35504, "EDITORIAL"); NewsTabGroup.lastID = 0; // Fetch the News NewsTabGroup.setSelected( 105 ); // Select the tab by ID NewsTabGroup.onSelect(105,"FRONT PAGE"); // Fetch the message of the day: NewsMOTDText.key = LaunchGui.key++; NewsMOTDText.state = "isvalid"; DatabaseQuery(0,"",NewsMOTDText,NewsMOTDText.key); weblinksmenu.clear(); weblinksmenu.key = launchGui.key++; weblinksmenu.state = "fetchWeblink"; DatabaseQueryArray(15,0,"WEBLINK",weblinksmenu,weblinksmenu.key); for(%ch=0; %ch<5; %ch++) { // ID.NAME.UPDATEID.ALLREAD.ARTICLECOUNT.LASTUPDATED AddCatHeader(NewsTabGroup.getTabId(%ch), NewsTabGroup.getTabText(%ch), 0,0,""); } } } if (!NewsTabGroup.lastID) NewsTabGroup.lastID = 105; if (!NewsGui.startup) NewsGui.startup = 0; WebLinksMenu.setSelected( 0 ); NewsPrevBtn.setActive( false ); NewsNextBtn.setActive( false ); } //----------------------------------------------------------------------------- function NewsGui::onSleep(%this) { Canvas.popDialog(LaunchToolbarDlg); } //----------------------------------------------------------------------------- function NewsGui::setKey( %this, %key ) { } //----------------------------------------------------------------------------- function NewsGui::onClose( %this, %key ) { } //----------------------------------------------------------------------------- function NewsGui::rebuildText(%this) { NewsHeadlines.clear(); for(%i = 0; %i < %this.articleCount; %i++) { %article = %this.article[%i]; if ( isDemo() ) { %topic = getField( %article, 0 ); %body = getFields( %article, 1 ); %text = %text @ "" @ %topic @ "\n" NL %body @ "\n\n"; } else { %ai = wonGetAuthInfo(); %isMem = 0; for(%east=0;%east[edit] [delete] [comments ("@%postcount@")]"; } else %editText = "[comments ("@%postcount@"]"; for(%l = 0; %l < %rc; %l++) %atxt = %atxt @ getRecord(%body,%l) @ "\n"; %text = %text @ "" @ %topic @ " " @ %editText @ "\nPosted by: " @ %nameLink @ " on " @ %date NL "\n" @ %atxt @ "\n\n"; } NewsHeadlines.addRow( %i, %topic ); } NewsText.setValue(%text); NewsHeadlines.setSelectedRow(0); } //----------------------------------------------------------------------------- function NewsGui::onDatabaseQueryResult(%this, %status, %RowCount_Result, %key) { if(%key != %this.key) return; %this.maxDate = " "; %this.minDate = " "; if(getField(%status,0)==0) { switch$(%this.caller) { case "GETNEWS": // record count NewsText.setValue(""); NewsHeadlines.clear(); %this.articleCount = 0; %this.acl = getField(%status,3); %this.ttlRecords = getField( %status,2 ); %this.recordCount = getField( %RowCount_Result,0 ); if(%this.recordCount > 23) { if($currentPage == 0) updatePageBtn(0,1); else if($currentPage > 0) updatePageBtn(1,1); } else { if($currentPage == 0) updatePageBtn(0,0); else if($currentPage > 0) updatePageBtn(1,0); } default: // result string } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else { %this.state = "halt"; MessageBoxOK("NOTICE",getField(%status,1)); } Canvas.setCursor(DefaultCursor); } //----------------------------------------------------------------------------- function NewsGui::onDatabaseRow(%this, %row,%isLastRow,%key) { if ( %key != %this.key ) return; if ( %this.articleCount $= "" ) %this.articleCount = 0; %this.article[%this.articleCount] = %row; %this.recordSet--; if ( %this.articleCount == 0 ) { %this.maxDate = getField( %this.article[%this.articleCount],4); %this.Max = getField(%this.article[%this.articleCount],5); } if ( %this.recordSet == 0 ) { %this.minDate = getField( %this.article[%this.articleCount],4); %this.Min = getField(%this.article[%this.articleCount],5); } %this.recordCount--; %this.articleCount++; %this.rebuildText(); canvas.setCursor(DefaultCursor); return; } //----------------------------------------------------------------------------- function NewsGui::addStaticArticle( %this, %topic, %body ) { %tag = %this.articleCount $= "" ? 0 : %this.articleCount; %this.article[%tag] = %topic TAB %body; %this.articleCount++; %this.rebuildText(); } //----------------------------------------------------------------------------- function PostNews() { messageBoxYesNo("CONFIRM","Please do not submit bug reports without a tested solution, test posts or recruiting posts." NL " " NL "Continue with your submittal?","StartPostNews();"); } function StartPostNews() { $NewsCategory = ""; $NewsTitle = ""; Canvas.pushDialog(NewsPostDlg); NewsPostDlg.postId = -1; NewsPostBodyText.setValue(""); } //----------------------------------------------------------------------------- function NewsPostDlg::onWake( %this ) { // Get the window pos and extent from prefs: %res = getResolution(); %resW = firstWord( %res ); %resH = getWord( %res, 1 ); %w = firstWord( $pref::News::PostWindowExtent ); if ( %w > %resW ) %w = %resW; %h = getWord( $pref::News::PostWindowExtent, 1 ); if ( %h > %resH ) %h = %resH; %x = firstWord( $pref::News::PostWindowPos ); if ( %x > %resW - %w ) %x = %resW - %w; %y = getWord( $pref::News::PostWindowPos, 1 ); if ( %y > %resH - %h ) %y = %resH - %h; NP_Window.resize( %x, %y, %w, %h ); if (NewsCategoryMenu.getCount() == 0) { NewsCategoryMenu.clear(); NewsCategoryMenu.add( NewsTabGroup.getTabText(0), NewsTabGroup.getTabID(0)); NewsCategoryMenu.add( NewsTabGroup.getTabText(1), NewsTabGroup.getTabID(1)); NewsCategoryMenu.add( NewsTabGroup.getTabText(2), NewsTabGroup.getTabID(2)); NewsCategoryMenu.add( NewsTabGroup.getTabText(3), NewsTabGroup.getTabID(3)); NewsCategoryMenu.add( NewsTabGroup.getTabText(4), NewsTabGroup.getTabID(4)); NewsCategoryMenu.hasTabs = 1; } %cat = getField(NewsGui.article[NewsPostDlg.selectedIdx],12); if (!%cat || %cat == -1 || %cat == 35499) %cat = 105; error("Category: " @ %cat); NewsCategoryMenu.setSelected( %cat ); $NewsCategory = NewsCategoryMenu.getText(); } //----------------------------------------------------------------------------- function NewsCategoryMenu::onAdd(%this) { } //----------------------------------------------------------------------------- function NewsPostDlg::onSleep( %this ) { $pref::News::PostWindowPos = NP_Window.getPosition(); $pref::News::PostWindowExtent = NP_Window.getExtent(); } //----------------------------------------------------------------------------- function NewsCategoryMenu::onSelect( %this, %id, %text ) { $NewsCategory = %text; } //----------------------------------------------------------------------------- function PostNewsProcess() { NewsPostDlg.key = LaunchGui.key++; if ( NewsPostDlg.postId == -1 ) { NewsPostDlg.state = "post"; canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(1, NewsCategoryMenu.getSelected() TAB $NewsTitle TAB NewsPostBodyText.getValue(),NewsPostDlg,NewsPostDlg.key); } else { NewsPostDlg.state = "edit"; //tid.pid.aid.updid.cat.title.body canvas.SetCursor(ArrowWaitCursor); DatabaseQuery(2, NewsPostDlg.EditUrl TAB NewsCategoryMenu.getSelected() TAB $NewsTitle TAB NewsPostBodyText.getValue(),NewsPostDlg,NewsPostDlg.key); } Canvas.popDialog(NewsPostDlg); } //----------------------------------------------------------------------------- function NewsPostDlg::onDatabaseQueryResult(%this, %status, %RowCount_Result, %key) { if(%key != %this.key) return; if(getField(%status,0)==0) { switch$(%this.state) { case "post": if(%this.FromForums) { %this.FromForums = false; ForumsMessageVector.deleteLine( %this.FIndex ); ForumsTopicsList.refreshFlag = true; CacheForumTopic(); ForumsGoTopics(0); } %this.state = "OK"; MessageBoxOK("NOTICE","Your article has been submitted. You may need to refresh your Browser."); case "edit": %this.state = "OK"; MessageBoxOK("NOTICE","Article Updated. You may need to refresh your Browser."); case "delete": %this.state = "OK"; MessageBoxOK("NOTICE","Article Deleted. You may need to refresh your Browser."); } } else if (getSubStr(getField(%status,1),0,9) $= "ORA-04061") { %this.state = "error"; MessageBoxOK("ERROR","There was an error processing your request, please wait a few moments and try again."); } else { %this.state = "ERROR"; MessageBoxOK( "ERROR", getField(%status,1)); } if(%this.state $= "OK") NewsGui.onWake(); canvas.setCursor(DefaultCursor); } //----------------------------------------------------------------------------- function NewsText::onURL(%this, %url) { NewsPostDlg.selectedIdx = NewsHeadlines.getSelectedID(); canvas.SetCursor(ArrowWaitCursor); switch$(getField(%url,0)) { case "editnews": %txt = NewsGui.article[getField(%url,1)]; $NewsTitle = getField(%txt, 13); %body = getFields(%txt,14); %rc = getRecordCount(%body); for(%i = 0; %i < %rc; %i++) %rtxt = %rtxt @ getRecord(%body, %i) @ "\n"; NewsPostBodyText.setValue(%rtxt); NewsPostDlg.postId = getField(%url,3); NewsPostDlg.EditUrl = getFields(%url,2); //topicid.postid.authorid.updateid NewsPostDlg.selectedIdx = NewsHeadlines.getSelectedID(); Canvas.pushDialog( NewsPostDlg ); case "deletenews": MessageBoxYesNo("CONFIRM","Delete this Article?","NewsPostDlg.doNewsDelete(\"" @ getField(%url,3) TAB getField(%url,2) @ "\");","canvas.setCursor(DefaultCursor);"); // postid.topicid case "topiclink": %articleId = getField(%url,2); MessageBoxOK("COMMENTS","To Post comments for any news article, go to the Forums, select the News Forum and then select the Topic you want to comment on. This link will soon be live."); default: Parent::onURL(%this, %url); } } //----------------------------------------------------------------------------- function NewsPostDlg::doNewsDelete(%this,%fields) { %this.key = LaunchGui.key++; %this.state = "delete"; error("News Delete " @ %fields); DatabaseQuery(3,%fields, %this, %this.key); } //----------------------------------------------------------------------------- function NewsHeadlines::onSelect( %this, %id, %text ) { NewsText.scrollToTag( %id ); } //----------------------------------------------------------------------------- function NewsGui::getPreviousNewsItems( %this ) { // Fetch the next batch of newer news items: if($currentPage == 0) return; canvas.SetCursor(ArrowWaitCursor); NewsGui.key = LaunchGui.key++; %this.state = "status"; %this.articleCount = 0; $currentPage--; DatabaseQueryArray(0,$currentPage,"1" TAB getField(%this.setList[%this.set],1), NewsGui, NewsGui.key ); } //----------------------------------------------------------------------------- function NewsGui::getNextNewsItems( %this ) { // Fetch the next batch of older news items: canvas.SetCursor(ArrowWaitCursor); NewsGui.key = LaunchGui.key++; %this.state = "status"; %this.articleCount = 0; $currentPage++; DatabaseQueryArray(0,$currentPage,"1" TAB getField(%this.setList[%this.set],0), NewsGui, NewsGui.key ); } //----------------------------------------------------------------------------- function NewsMOTDText::onDatabaseQueryResult(%this, %status, %RowCount_Result, %key) { if(%key != %this.key) return; // echo("RECV: " @ %status); %ai = wonGetAuthInfo(); %isMem = 0; if(getField(%status,0)==0) { for(%east=0;%east" @ %tag; else %str = "" @ %tag @ "" @ %name; return "" @ %str @ ""; } function getTextName(%line, %offset) { if(%offset $= "") %offset = 0; %name = getField(%line, %offset); %tag = getField(%line, %offset + 1); %append = getField(%line, %offset + 2); %uid = getField(%line, %offset + 3); if(%append) return %name @ %tag TAB %uid; else return %tag @ %name TAB %uid; } function HTTPRequest(%script, %update, %destObject, %key) { error("Call to HTTP request depricated - trace:"); trace(1); schedule(0,0,trace,0); //%upd = new SecureHTTPObject(HTTPUpdate); //%upd.post($WebAddress, $WebPath @ %script @ ".php", "", %update); //%upd.key = %key; //%upd.destObject = %destObject; } function HTTPSecureRequest(%script, %update, %destObject, %key) { error("Call to HTTP secure request depricated - trace:"); trace(1); schedule(0,0,trace,0); //%upd = new SecureHTTPObject(HTTPUpdate); //%upd.setAuthenticated(); //%upd.post($WebAddress, $WebPath @ %script @ ".php", "", %update); //%upd.key = %key; //%upd.destObject = %destObject; } $DBNextQueryId = 0; $DBQueryCount = 0; if(!isObject(ProxyEchoTest)) { new ScriptObject(ProxyEchoTest) { class = ProxyEcho; }; } function ProxyEcho::onDatabaseQueryResult(%this, %status, %string, %key) { echo("Got database query result for key: " @ %key); echo("Status = " @ %status); echo("String/Rowcount = " @ %string); } function ProxyEcho::onDatabaseRow(%this, %row, %isLast, %key) { echo("Got Row - key = " @ %key @ " isLast = " @ %isLast); echo("Row Text = " @ %row); } function HandleDatabaseProxyResponse(%prefix, %params) { // error("HDPR - START:" TAB %prefix NL %params); %id = getWord(%params, 0); for(%qc = 0; %qc < $DBQueryCount; %qc++) if(getWord($DBQueries[%qc], 0) == %id) break; if(%qc == $DBQueryCount) { warn("Invalid database proxy message id: " @ %id); return; } %lastPacket = getWord(%params, 1); // error("HDPR - lastPacket" TAB %lastPacket); %start = strpos(%params, ":") + 1; if(!%start) { warn("Invalid database proxy message: " @ %params); return; } // convert all the escaped characters %newStr = getSubStr(%params, %start, 100000); %newStr = strreplace(%newStr, "\\n", "\n"); %newStr = strreplace(%newStr, "\\\\", "\\"); // concat it with any text from prior message(s) that hasn't been // processed yet. // error("HDPR - concat: " @ $DBQueryText[%qc] NL %newStr); %msg = $DBQueryText[%qc] @ %newStr; %proxyObject = getWord($DBQueries[%qc], 2); %proxyKey = getWord($DBQueries[%qc], 3); // error("HDPR - allrecs: " @ getWord($DBQueries[%qc],1)); if(getWord($DBQueries[%qc], 1) == 0) // we haven't receivd the first 2 recs yet { // error("HDPR - need first 2 recs: " @ strpos(%msg, "\\S")); // check if we have 2 records in %msg: %pos1 = strpos(%msg, "\\S"); // error("HDPR - POS1: " @ %pos1); if(%pos1 != -1) %pos2 = strpos(%msg, "\\S", %pos1 + 2); // error("HDPR - POS2: " @ %pos2); if(%pos1 != -1 && %pos2 != -1) { %resultStatus = getSubStr(%msg, 0, %pos1); %resultString = getSubStr(%msg, %pos1 + 2, %pos2 - (%pos1 + 2)); if(%proxyObject !$= "") %proxyObject.onDatabaseQueryResult(%resultStatus, %resultString, %proxyKey); $DBQueries[%qc] = setWord($DBQueries[%qc], 1, "1"); %msg = getSubStr(%msg, %pos2 + 2, 100000); } } // error("HDPR - DBQ_1: " @ getWord($DBQueries[%qc], 1)); if(getWord($DBQueries[%qc], 1) == 1) { // start spitting out rows: while((%pos = strpos(%msg, "\\S")) != -1) { %row = getSubStr(%msg, 0, %pos); %msg = getSubStr(%msg, %pos + 2, 100000); if(%proxyObject !$= "") %proxyObject.onDatabaseRow(%row, %msg $= "" && %lastPacket, %proxyKey); } } $DBQueryText[%qc] = %msg; // save off the last text... if(%lastPacket) { // erase the query from the array: // error("HDPR - ONLastPacket" TAB getWord($DBQueries[%qc], 1)); if(getWord($DBQueries[%qc], 1) == 0) warn("Error in database query response - not enough data."); for(%i = %qc; %i < $DBQueryCount; %i++) { $DBQueries[%i] = $DBQueries[%i+1]; $DBQueryText[%i] = $DBQueryText[%i+1]; } $DBQueries[%i] = ""; $DBQueryText[%i] = ""; $DBQueryCount--; } } // DBQuery is: id recCountRecvd proxyObject key function DatabaseQueryi(%astr, %args, %proxyObject, %key) { if ($IRCClient::state !$= IDIRC_CONNECTED) { IRCClient::connect(); if (%proxyObject !$= "") %proxyObject.onDatabaseQueryResult("1\tORA-04061", "", %key); return 0; } // maxRows will be empty $NextDatabaseQueryId++; %id = $NextDatabaseQueryId; $DBQueries[$DBQueryCount] = %id @ " 0 " @ %proxyObject SPC %key; $DBQueryText[$DBQueryCount] = ""; $DBQueryCount++; %strStart = 0; %args = strreplace(%args, "\r", ""); %args = strreplace(%args, "\\", "\\\\"); %args = strreplace(%args, "\n", "\\n"); %len = strlen(%args); %i = 0; while(%i+400 < %len) { %msg = getSubStr(%args, %i, 400); IRCClient::send("dbqa" SPC %id SPC ":" @ %msg); %i += 400; } %msg = getSubStr(%args, %i, 400); IRCClient::send("dbqax" SPC %id SPC %astr SPC ":" @ %msg); return %id; } function DatabaseQuery(%ordinal, %args, %proxyObject, %key) { return DatabaseQueryi(%ordinal SPC "0", %args, %proxyObject, %key); } function DatabaseQueryArray(%ordinal, %maxRows, %args, %proxyObject, %key) { return DatabaseQueryi("C" @ %ordinal SPC %maxRows, %args, %proxyObject, %key); } function DatabaseQueryCancel(%id) { for(%qc = 0; %qc < $DBQueryCount; %qc++) if(getWord($DBQueries[%qc], 0) == %id) break; if(%qc == $DBQueryCount) return; IRCClient::send("dbqc " @ %id); for(%i = %qc; %i < $DBQueryCount; %i++) { $DBQueries[%i] = $DBQueries[%i+1]; $DBQueryText[%i] = $DBQueryText[%i+1]; } $DBQueries[%i] = ""; $DBQueryText[%i] = ""; $DBQueryCount--; } function WONUpdateCertificateDone(%errCode, %errStr) { IRCClient::reconnect(); }PK !('::scripts/webtest.cs function HTTPTest_onLine(%line) { echo("HTTPLine: " @ %line); if($HTTPTest_notifyObject !$= "") $HTTPTest_notifyObject.onLine(%line, $HTTPTest_notifyKey); } function HTTPTest(%script, %query, %notifyObject, %notifyKey) { echo("HTTPQuery: " @ %script); %query = "\n" @ %query; $HTTPTest_notifyObject = %notifyObject; $HTTPTest_notifyKey = %notifyKey; call("HTTPTest_" @ %script, %query); if($HTTPTest_notifyObject !$= "") $HTTPTest_notifyObject.connectionTerminated($HTTPTest_notifyKey); echo("HTTPQueryDone"); } function HTTPTest_update_CreatePublicForum(%query) { if($pref::forumCount $= "") $pref::forumCount = 0; $pref::ForumName[$pref::forumCount] = getRecord(%query, 1); $pref::forumCount++; HTTPTest_onLine("OK"); } function HTTPTest_update_DeletePublicForum(%query) { for(%i = 0; %i < $pref::forumCount; %i++) { if($pref::ForumName[%i] $= getRecord(%query, 1)) { $pref::forumCount--; $pref::forumName[%i] = $pref::forumName[$pref::forumCount]; HTTPTest_onLine("OK"); return; } } HTTPTest_onLine("InvalidForum"); } function HTTPTest_query_GetForumList(%query) { if($pref::forumCount $= "") $pref::forumCount = 0; HTTPTest_onLine($pref::forumCount); for(%i = 0; %i < $pref::forumCount; %i++) HTTPTest_onLine($pref::forumName[%i]); } // post is: // threadId // PostEdit // postid // updateid // parentid // poster // date // topic // body line 1 // body line 2 // ... function HTTPTest_update_postforumentry(%query) { %forum = getRecord(%query, 1); %parent = getRecord(%query, 2); %topic = getRecord(%query, 3); %body = getRecord(%query, 4); echo(%forum); echo(%parent); echo(%topic); echo(%body); for(%i = 5; %i < getRecordCount(%query); %i++) %body = %body @ "\n" @ getRecord(%query, %i); if(%parent == 0) // create a new thread for this one: { if($pref::forumThreadCount $= "") $pref::forumThreadCount = 0; %threadid = $pref::forumThreadCount; $pref::forumThread[$pref::forumThreadCount] = %forum @ "\n"@ "SuperD00D" TAB "[BSF]" TAB 1 TAB 4 TAB %topic TAB "Today" TAB %threadid TAB 0; $pref::forumThreadCount++; } else { %parentpost = $pref::forumPost[%parent]; %threadId = getRecord(%parentpost, 0); echo(%threadId); } $pref::forumPostCount++; $pref::forumUpdateId++; $pref::forumPost[$pref::forumPostCount] = %threadId @ "\n" @ "PostEdit" @ "\n" @ $pref::forumPostCount @ "\n" @ $pref::forumUpdateId @ "\n" @ %parent @ "\n" @ "SuperD00D" @ "\n" @ "Today" @ "\n" @ %topic @ "\n" @ %body; if(%notifyObject) { %notifyObject.onLine("OK"); %notifyObject.connectionTerminated(); } } function HTTPTest_query_GetForumTopics(%query) { %count = 0; %list = ""; %forum = getRecord(%query, 1); %start = getRecord(%query, 2); %maxCount = getRecord(%query, 3); %maxCount += %start; if(%maxCount > $pref::forumThreadCount) %maxCount = $pref::forumThreadCount; for(%i = %start; %i < %maxCount; %i++) { %thread = $pref::forumThread[%i]; if(getRecord(%thread, 0) $= %forum) { %line[%count] = getRecord(%thread, 1); %count++; } } HTTPTest_onLine(%count); for(%i = 0; %i < %count; %i++) HTTPTest_onLine(%line[%i]); } // post is: // threadId // PostEdit // postid // updateid // parentid // poster // date // topic // body line 1 // body line 2 // ... function HTTPTest_query_GetForumUpdates(%query) { %threadId = getRecord(%query, 1); %updateId = getRecord(%query, 2); %output = ""; %updateCount = 0; for(%i = 1; %i <= $pref::forumPostCount; %i++) { %post = $pref::forumPost[%i]; if(%threadId == getRecord(%post, 0) && %updateId < getRecord(%post, 3)) %updateCount++; } HTTPTest_onLine(%updateCount); for(%i = 1; %i <= $pref::forumPostCount; %i++) { %post = $pref::forumPost[%i]; if(%threadId == getRecord(%post, 0) && %updateId < getRecord(%post, 3)) { %rc = getRecordCount(%post); HTTPTest_onLine(%rc - 1); for(%j = 1; %j < %rc; %j++) HTTPTest_onLine(getRecord(%post, %j)); } } } function HTTPTest_update_editforumentry(%query) { echo("Updating forum entry"); %postId = getRecord(%query, 1); %post = $pref::forumPost[%postId]; $pref::forumUpdateId++; %post = setRecord(%post, 3, $pref::forumUpdateId); %rc = getRecordCount(%query); for(%i = 2; %i < %rc; %i++) %post = setRecord(%post, 5 + %i, getRecord(%query, %i)); %post = setRecord(%post, 5 + %i, "[Edited by blah blah blah]"); %rc = getRecordCount(%post); for(%p = 0; %p < %rc; %p++) echo(getRecord(%post, %p)); for(%j = 0; %j <= 5 + %i; %j++) %newpost = setRecord(%newpost, %j, getRecord(%post, %j)); $pref::forumPostCount++; $pref::forumPost[$pref::forumPostCount] = %newpost; echo("New post: "); %rc = getRecordCount(%newpost); for(%p = 0; %p < %rc; %p++) echo(getRecord(%newpost, %p)); HTTPTest_onLine("OK"); } function HTTPTest_query_playerinfo(%query) { HTTPTest_onLine("OK"); HTTPTest_onLine("SuperD00D\t[BSF]\t1\t4"); HTTPTest_onLine("1"); HTTPTest_onLine("2"); HTTPTest_onLine("Big Sucka Fishes"); HTTPTest_onLine("Sofa Kings"); HTTPTest_onLine("3"); HTTPTest_onLine("Big Sucka Fishes\t[BSF]\t1\t1"); HTTPTest_onLine("Sucka Fishes\t[SF]\t1\t1"); HTTPTest_onLine("Sofa Kings\t[SOFAKING]\t1\t1"); HTTPTest_onLine("4\t1"); HTTPTest_onLine("I am SuperD00D Master of the Big Sucka Fishes"); HTTPTest_onLine("I am SuperD00D I R00LZ AT TRYB3S!"); HTTPTest_onLine("I am SuperD00D I think I should insert some links and stuff"); HTTPTest_onLine("I am SuperD00D I think I should insert some links and stuff"); HTTPTest_onLine("2"); HTTPTest_onLine("Created Tribe Big Sucka Fishes"); HTTPTest_onLine("Created Tribe Sucka Fishes"); } function HTTPTest_query_gettribeinformation(%query) { HTTPTest_onLine("OK"); HTTPTest_onLine("Big Sucka Fishes\t[BSF]\t1"); HTTPTest_onLine("1\t1"); HTTPTest_onLine("4\t1"); HTTPTest_onLine("We are the BIG SUCKA FISHES. We R00LZ 0V3R u. We R R33T."); HTTPTest_onLine("We 0WNZ T3H TRYB3S 2 Scene."); HTTPTest_onLine("The OGL is our collective bitch."); HTTPTest_onLine("Dave Georgeson is a big mo mo."); HTTPTest_onLine("5"); HTTPTest_onLine("SuperD00D\t[BSF]\t1\t4\t2\tSupreme Leader\tWhenever\t1"); HTTPTest_onLine("QIX\t[BSF]\t1\t5\t2\tGroupie\tWhenever\t0"); HTTPTest_onLine("RatedZ\t[BSF]\t1\t7\t2\tFrench Teacher\tWhenever\t1"); HTTPTest_onLine("Uberb0b\t[BSF]\t1\t8\t2\tWater Boy\tWhenever\t0"); HTTPTest_onLine("Funkymonkey\t[BSF]\t1\t9\t2\tMascot\tWhenever\t1"); HTTPTest_onLine("3"); HTTPTest_onLine("Invitee1\t[DORK]\t1\t10\tSuperD00D\t[BSF]\t1\t4\t0"); HTTPTest_onLine("Invitee2\t[DORK]\t1\t10\tSuperD00D\t[BSF]\t1\t4\t1"); HTTPTest_onLine("Invitee3\t[DORK]\t1\t10\tSuperD00D\t[BSF]\t1\t4\t0"); }PK !(}]TTscripts/autoexec/scripts.txtAny scripts (.cs files) placed in this folder will be loaded (exec'd) automatically.PK !(bٖscripts/packs/ELFbarrelPack.cs//-------------------------------------------------------------------------- // // ELF barrel pack // //-------------------------------------------------------------------------- datablock ShapeBaseImageData(ELFBarrelPackImage) { mass = 15; shapeFile = "pack_barrel_elf.dts"; item = ELFBarrelPack; mountPoint = 1; offset = "0 0 0"; turretBarrel = "ELFBarrelLarge"; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeOut[2] = "Idle"; isLarge = true; }; datablock ItemData(ELFBarrelPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_barrel_elf.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "ELFBarrelPackImage"; pickUpName = "an ELF barrel pack"; computeCRC = true; }; function ELFBarrelPackImage::onActivate(%data, %obj, %slot) { checkTurretMount(%data, %obj, %slot); } function ELFBarrelPackImage::onDeactivate(%data, %obj, %slot) { %obj.setImageTrigger($BackpackSlot, false); } function ELFBarrelPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors }PK !( =scripts/packs/aabarrelPack.cs//-------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------- datablock ShapeBaseImageData(AABarrelPackImage) { mass = 15; shapeFile = "pack_barrel_aa.dts"; item = AABarrelPack; mountPoint = 1; offset = "0 0 0"; turretBarrel = "AABarrelLarge"; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeOut[2] = "Idle"; isLarge = true; }; datablock ItemData(AABarrelPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_barrel_aa.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "AABarrelPackImage"; pickUpName = "an anti-aircraft barrel pack"; computeCRC = true; }; //AABarrelPackImage.turretBarrel = "AABarrelLarge"; function AABarrelPackImage::onActivate(%data, %obj, %slot) { checkTurretMount(%data, %obj, %slot); } function AABarrelPackImage::onDeactivate(%data, %obj, %slot) { %obj.setImageTrigger($BackpackSlot, false); } function AABarrelPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors }PK !(ԑ!!scripts/packs/ammopack.cs// ------------------------------------------------------------------ // AMMO PACK // can be used by any armor type // uses no energy, does not have to be activated // increases the max amount of non-energy ammo carried // put vars here for ammo max counts with ammo pack $AmmoItem[0] = PlasmaAmmo; $AmmoItem[1] = ChaingunAmmo; $AmmoItem[2] = DiscAmmo; $AmmoItem[3] = GrenadeLauncherAmmo; $AmmoItem[4] = MortarAmmo; $AmmoItem[5] = MissileLauncherAmmo; $AmmoItem[6] = RepairKit; $numAmmoItems = 7; $grenAmmoType[0] = Grenade; $grenAmmoType[1] = ConcussionGrenade; $grenAmmoType[2] = FlashGrenade; $grenAmmoType[3] = FlareGrenade; $numGrenTypes = 4; datablock ShapeBaseImageData(AmmoPackImage) { shapeFile = "pack_upgrade_ammo.dts"; item = AmmoPack; mountPoint = 1; offset = "0 0 0"; }; datablock ItemData(AmmoPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_upgrade_ammo.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "AmmoPackImage"; pickUpName = "an ammo pack"; computeCRC = true; // lightType = "PulsingLight"; // lightColor = "0.2 0.4 0.0 1.0"; // lightTime = "1200"; // lightRadius = "1.0"; max[PlasmaAmmo] = 30; max[ChaingunAmmo] = 150; max[DiscAmmo] = 15; max[GrenadeLauncherAmmo] = 15; max[MortarAmmo] = 10; max[MissileLauncherAmmo] = 4; max[Grenade] = 10; max[ConcussionGrenade] = 10; max[FlashGrenade] = 10; max[FlareGrenade] = 10; max[CameraGrenade] = 0; max[Mine] = 5; max[RepairKit] = 1; }; function AmmoPack::onPickup(%this,%pack,%player,%amount) { // %this = AmmoPack datablock // %pack = AmmoPack object number // %player = player // %amount = 1 for (%idx = 0; %idx < $numAmmoItems; %idx++) { %ammo = $AmmoItem[%idx]; if (%pack.inv[%ammo] > 0) { %amount = %pack.getInventory(%ammo); %player.incInventory(%ammo,%amount); %pack.setInventory(%ammo,0); } else if(%pack.inv[%ammo] == -1) { // this particular type of ammo has already been exhausted for this pack; // don't give the player any } else { // Assume it's full if no inventory has been assigned %player.incInventory(%ammo,%this.max[%ammo]); } } // now check what type grenades (if any) player is carrying %gFound = false; for (%i = 0; %i < $numGrenTypes; %i++) { %gType = $grenAmmoType[%i]; if(%player.inv[%gType] > 0) { %gFound = true; %playerGrenType = %gType; break; } } // if player doesn't have any grenades at all, give 'em whatever the ammo pack has if(!%gFound) { %given = false; for(%j = 0; %j < $numGrenTypes; %j++) { %packGren = $grenAmmoType[%j]; if(%pack.inv[%packGren] > 0) { // pack has some of these grenades %player.incInventory(%packGren, %pack.getInventory(%packGren)); %pack.setInventory(%packGren, 0); %given = true; break; } else if(%pack.inv[%packGren] == -1) { // the pack doesn't have any of this type of grenades } else { // pack has full complement of this grenade type %player.incInventory(%packGren, %this.max[%packGren]); %given = true; } if(%given) break; } } else { // player had some amount of grenades before picking up pack if(%pack.inv[%playerGrenType] > 0) { // pack has 1 or more of this type of grenade %player.incInventory(%playerGrenType, %pack.getInventory(%playerGrenType)); %pack.setInventory(%playerGrenType, 0); } else if(%pack.inv[%playerGrenType] == -1) { // sorry Chester, the pack is out of these grenades. } else { // pack is uninitialized for this grenade type -- meaning it has full count %player.incInventory(%playerGrenType, %this.max[%playerGrenType]); } } // now see if player had mines selected and if they're allowed in this mission type %mineFav = %player.client.favorites[getField(%player.client.mineIndex, 0)]; if ( ( $InvBanList[$CurrentMissionType, "Mine"] !$= "1" ) && !( ( %mineFav $= "EMPTY" ) || ( %mineFav $= "INVALID" ) ) ) { // player has selected mines, and they are legal in this mission type if(%pack.inv[Mine] > 0) { // and the pack has some mines in it! bonus! %player.incInventory(Mine, %pack.getInventory(Mine)); %pack.setInventory(Mine, 0); } else if(%pack.inv[Mine] == -1) { // no mines left in the pack. do nothing. } else { // assume it's full of mines if no inventory has been assigned %player.incInventory(Mine,%this.max[Mine]); } } } function AmmoPack::onThrow(%this,%pack,%player) { // %this = AmmoPack datablock // %pack = AmmoPack object number // %player = player %player.throwAmmoPack = 1; dropAmmoPack(%pack, %player); // do the normal ItemData::onThrow stuff -- sound and schedule deletion serverPlay3D(ItemThrowSound, %player.getTransform()); %pack.schedulePop(); } function AmmoPack::onInventory(%this,%player,%value) { // %this = AmmoPack // %player = player // %value = 1 if gaining a pack, 0 if losing a pack // the below test is necessary because this function is called everytime the ammo // pack gains or loses an item if(%player.getClassName() $= "Player") { if(!%value) if(%player.throwAmmoPack == 1) { %player.throwAmmoPack = 0; // ammo stuff already handled by AmmoPack::onThrow } else { // ammo pack was sold at inventory station -- no need to worry about // setting the ammo in the pack object (it doesn't exist any more) dropAmmoPack(-1, %player); } } Pack::onInventory(%this,%player,%value); } function dropAmmoPack(%packObj, %player) { // %packObj = Ammo Pack object number if pack is being thrown, -1 if sold at inv station // %player = player object for(%i = 0; %i < $numAmmoItems; %i++) { %ammo = $AmmoItem[%i]; // %pAmmo == how much of this ammo type the player has %pAmmo = %player.getInventory(%ammo); // %pMax == how much of this ammo type the player's datablock says can be carried %pMax = %player.getDatablock().max[%ammo]; if(%pAmmo > %pMax) { // if player has more of this ammo type than datablock's max... if(%packObj > 0) { // put ammo that player can't carry anymore in pack %packObj.setInventory(%ammo, %pAmmo - %pMax); } // set player to max for this ammo type %player.setInventory(%ammo, %pMax); } else { if(%packObj > 0) { // the pack gets -1 of this ammo type -- else it'll assume it's full // can't use setInventory() because it won't allow values less than 1 %packObj.inv[%ammo] = -1; } } } // and, of course, a pass for the grenades. Whee. %gotGren = false; // check to see what kind of grenades the player has. for(%j = 0; %j < $numGrenTypes; %j++) { %gType = $grenAmmoType[%j]; if(%player.inv[%gType] > 0) { %gotGren = true; %playerGren = %gType; break; } else { // ammo pack only carries type of grenades that player who bought it (or picked // it up) had at the time -- all else are zeroed out (value of -1) if(%packObj > 0) %packObj.inv[%gType] = -1; } } if(%gotGren) { %pAmmo = %player.getInventory(%playerGren); %pMax = %player.getDatablock().max[%playerGren]; if(%pAmmo > %pMax) { if(%packObj > 0) %packObj.setInventory(%playerGren, %pAmmo - %pMax); %player.setInventory(%playerGren, %pMax); } else if(%packObj > 0) %packObj.inv[%playerGren] = -1; } else { // player doesn't have any grenades at all. nothing needs to be done here. } // crap. forgot the mines. if(%player.getInventory(Mine) > %player.getDatablock().max[Mine]) { // if player has more mines than datablock's max... if(%packObj > 0) { // put mines that player can't carry anymore in pack %packObj.setInventory(Mine, %player.getInventory(Mine) - %player.getDatablock().max[Mine]); } // set player to max mines %player.setInventory(Mine, %player.getDatablock().max[Mine]); } else { if(%packObj > 0) { // the pack gets -1 for mines -- else it'll assume it's full // can't use setInventory() because it won't allow values less than 1 %packObj.inv[Mine] = -1; } } }PK !(scripts/packs/cloakingpack.cs// ------------------------------------------------------------------ // CLOAKING PACK // // When activated, this pack cloaks the user from all visual detection // by other players and cameras. This is a local effect only (someone standing // next to the cloaked player will still be visible). Motion sensors will // still detect a (moving) cloaked player. // // When not activated, the pack creates a localized passive sensor dampening // field. The user will not be visible to any non-motion-detecting sensor. // //Only light armors may equip with this item. datablock EffectProfile(CloakingPackActivateEffect) { effectname = "packs/cloak_on"; minDistance = 2.5; maxDistance = 2.5; }; datablock AudioProfile(CloakingPackActivateSound) { filename = "fx/packs/cloak_on.wav"; description = CloseLooping3d; preload = true; effect = CloakingPackActivateEffect; }; datablock ShapeBaseImageData(CloakingPackImage) { shapeFile = "pack_upgrade_cloaking.dts"; item = CloakingPack; mountPoint = 1; offset = "0 0 0"; usesEnergy = true; minEnergy = 3; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateSequence[1] = "fire"; stateSound[1] = CloakingPackActivateSound; stateEnergyDrain[1] = 12; stateTransitionOnTriggerUp[1] = "Deactivate"; stateTransitionOnNoAmmo[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeout[2] = "Idle"; }; datablock ItemData(CloakingPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_upgrade_cloaking.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "CloakingPackImage"; pickUpName = "a cloaking pack"; computeCRC = true; }; function CloakingPackImage::onMount(%data, %obj, %node) { // player is sensor-invisible while wearing pack (except to motion sensors) %obj.setPassiveJammed(true); } function CloakingPackImage::onUnmount(%data, %obj, %node) { %obj.setPassiveJammed(false); %obj.setCloaked(false); %obj.setImageTrigger(%node, false); } // make player completely invisible to all players/sensors (except motion) function CloakingPackImage::onActivate(%data, %obj, %slot) { if(%obj.reCloak !$= "") { Cancel(%obj.reCloak); %obj.reCloak = ""; } if(%obj.client.armor $= "Light") { // can the player currently cloak (function returns "true" or reason for failure)? if(%obj.canCloak() $= "true") { messageClient(%obj.client, 'MsgCloakingPackOn', '\c2Cloaking pack on.'); %obj.setCloaked(true); if ( !isDemo() ) commandToClient( %obj.client, 'setCloakIconOn' ); } else { // notify player that they cannot cloak messageClient(%obj.client, 'MsgCloakingPackFailed', '\c2Jamming field prevents cloaking.'); %obj.setImageTrigger(%slot, false); } } else { // hopefully avoid some loopholes messageClient(%obj.client, 'MsgCloakingPackInvalid', '\c2Cloaking available for light armors only.'); %obj.setImageTrigger(%slot, false); } } function CloakingPackImage::onDeactivate(%data, %obj, %slot) { if(%obj.reCloak !$= "") { Cancel(%obj.reCloak); %obj.reCloak = ""; } // if pack is not on then dont bother... if(%obj.getImageState($BackpackSlot) $= "activate") messageClient(%obj.client, 'MsgCloakingPackOff', '\c2Cloaking pack off.'); %obj.setCloaked(false); %obj.setImageTrigger(%slot, false); if ( !isDemo() ) commandToClient( %obj.client, 'setCloakIconOff' ); } function CloakingPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors } function ShapeBaseData::onForceUncloak(%this, %obj, %reason) { // dummy } function Armor::onForceUncloak(%this, %obj, %reason) { %pack = %obj.getMountedImage($BackpackSlot); if((%pack <= 0) || (%pack.item !$= "CloakingPack")) return; if(%obj.getImageState($BackpackSlot) $= "activate") { // cancel recloak thread if(%obj.reCloak !$= "") { Cancel(%obj.reCloak); %obj.reCloak = ""; } messageClient(%obj.client, 'MsgCloakingPackOff', '\c2Cloaking pack off. Jammed.'); %obj.setCloaked(false); %obj.setImageTrigger($BackpackSlot, false); } }PK !(scripts/packs/energypack.cs// ------------------------------------------------------------------ // ENERGY PACK // can be used by any armor type // does not have to be activated // increases the user's energy recharge rate datablock ShapeBaseImageData(EnergyPackImage) { shapeFile = "pack_upgrade_energy.dts"; item = EnergyPack; mountPoint = 1; offset = "0 0 0"; rechargeRateBoost = 0.15; stateName[0] = "default"; stateSequence[0] = "activation"; }; datablock ItemData(EnergyPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_upgrade_energy.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "EnergyPackImage"; pickUpName = "an energy pack"; computeCRC = true; }; function EnergyPackImage::onMount(%data, %obj, %node) { %obj.setRechargeRate(%obj.getRechargeRate() + %data.rechargeRateBoost); %obj.hasEnergyPack = true; // set for sniper check } function EnergyPackImage::onUnmount(%data, %obj, %node) { %obj.setRechargeRate(%obj.getRechargeRate() - %data.rechargeRateBoost); %obj.hasEnergyPack = ""; } function EnergyPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors }PK !(,"scripts/packs/missilebarrelPack.cs//-------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------- datablock ShapeBaseImageData(MissileBarrelPackImage) { mass = 15; className = TurretPack; shapeFile = "pack_barrel_missile.dts"; item = MissileBarrelPack; mountPoint = 1; offset = "0 0 0"; turretBarrel = "MissileBarrelLarge"; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeOut[2] = "Idle"; isLarge = true; }; datablock ItemData(MissileBarrelPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_barrel_missile.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "MissileBarrelPackImage"; pickUpName = "a missile barrel pack"; computeCRC = true; }; //MissileBarrelPackImage.turretBarrel = "MissileBarrelLarge"; function MissileBarrelPackImage::onActivate(%data, %obj, %slot) { checkTurretMount(%data, %obj, %slot); } function MissileBarrelPackImage::onDeactivate(%data, %obj, %slot) { %obj.setImageTrigger($BackpackSlot, false); } function MissileBarrelPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors }PK !(*s!scripts/packs/mortarBarrelPack.cs//-------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------- datablock ShapeBaseImageData(MortarBarrelPackImage) { mass = 15; className = TurretPack; shapeFile = "pack_barrel_mortar.dts"; item = MortarBarrelPack; mountPoint = 1; offset = "0 0 0"; turretBarrel = "MortarBarrelLarge"; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeOut[2] = "Idle"; isLarge = true; }; datablock ItemData(MortarBarrelPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_barrel_mortar.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "MortarBarrelPackImage"; pickUpName = "a mortar barrel pack"; computeCRC = true; }; function MortarBarrelPackImage::onActivate(%data, %obj, %slot) { checkTurretMount(%data, %obj, %slot); } function MortarBarrelPackImage::onDeactivate(%data, %obj, %slot) { %obj.setImageTrigger($BackpackSlot, false); } function MortarBarrelPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors }PK !(.!scripts/packs/plasmabarrelPack.cs//-------------------------------------------------------------------------- // // Plasma barrel pack // //-------------------------------------------------------------------------- datablock ShapeBaseImageData(PlasmaBarrelPackImage) { mass = 15; shapeFile = "pack_barrel_fusion.dts"; item = PlasmaBarrelPack; mountPoint = 1; offset = "0 0 0"; turretBarrel = "PlasmaBarrelLarge"; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeOut[2] = "Idle"; isLarge = true; }; datablock ItemData(PlasmaBarrelPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_barrel_fusion.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "PlasmaBarrelPackImage"; pickUpName = "a plasma barrel pack"; computeCRC = true; }; function PlasmaBarrelPackImage::onActivate(%data, %obj, %slot) { checkTurretMount(%data, %obj, %slot); } function PlasmaBarrelPackImage::onDeactivate(%data, %obj, %slot) { %obj.setImageTrigger($BackpackSlot, false); } function PlasmaBarrelPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors }PK !(kMWMWscripts/packs/repairpack.cs//-------------------------------------------------------------------------- // Repair Pack // can be used by any armor type // when activated, gives user a "repair gun" that can be used to // repair a damaged object or player. If there is no target in // range for the repair gun, the user is repaired. //-------------------------------------------------------------------------- // Sounds & feedback effects datablock EffectProfile(RepairPackActivateEffect) { effectname = "packs/packs.repairPackOn"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(RepairPackFireEffect) { effectname = "packs/repair_use"; minDistance = 2.5; maxDistance = 5.0; }; datablock AudioProfile(RepairPackActivateSound) { filename = "fx/packs/packs.repairPackOn.wav"; description = AudioClosest3d; preload = true; effect = RepairPackActivateEffect; }; datablock AudioProfile(RepairPackFireSound) { filename = "fx/packs/repair_use.wav"; description = CloseLooping3d; preload = true; effect = RepairPackFireEffect; }; //-------------------------------------------------------------------------- // Projectile datablock RepairProjectileData(DefaultRepairBeam) { sound = RepairPackFireSound; beamRange = 10; beamWidth = 0.15; numSegments = 20; texRepeat = 0.20; blurFreq = 10.0; blurLifetime = 1.0; cutoffAngle = 25.0; textures[0] = "special/redbump2"; textures[1] = "special/redflare"; }; //------------------------------------------------------------------------- // shapebase datablocks datablock ShapeBaseImageData(RepairPackImage) { shapeFile = "pack_upgrade_repair.dts"; item = RepairPack; mountPoint = 1; offset = "0 0 0"; emap = true; gun = RepairGunImage; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateSequence[1] = "fire"; stateSound[1] = RepairPackActivateSound; stateTransitionOnTriggerUp[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeout[2] = "Idle"; }; datablock ItemData(RepairPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_upgrade_repair.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "RepairPackImage"; pickUpName = "a repair pack"; lightOnlyStatic = true; lightType = "PulsingLight"; lightColor = "1 0 0 1"; lightTime = 1200; lightRadius = 4; computeCRC = true; emap = true; }; //-------------------------------------------------------------------------- // Repair Gun datablock ShapeBaseImageData(RepairGunImage) { shapeFile = "weapon_repair.dts"; offset = "0 0 0"; usesEnergy = true; minEnergy = 3; cutOffEnergy = 3.1; emap = true; repairFactorPlayer = 0.002; // <--- attention DaveG! repairFactorObject = 0.004; // <--- attention DaveG! stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "ActivateReady"; stateTimeoutValue[0] = 0.25; stateName[1] = "ActivateReady"; stateScript[1] = "onActivateReady"; stateSpinThread[1] = Stop; stateTransitionOnAmmo[1] = "Ready"; stateTransitionOnNoAmmo[1] = "ActivateReady"; stateName[2] = "Ready"; stateSpinThread[2] = Stop; stateTransitionOnNoAmmo[2] = "Deactivate"; stateTransitionOnTriggerDown[2] = "Validate"; stateName[3] = "Validate"; stateTransitionOnTimeout[3] = "Validate"; stateTimeoutValue[3] = 0.2; stateEnergyDrain[3] = 3; stateSpinThread[3] = SpinUp; stateScript[3] = "onValidate"; stateIgnoreLoadedForReady[3] = true; stateTransitionOnLoaded[3] = "Repair"; stateTransitionOnNoAmmo[3] = "Deactivate"; stateTransitionOnTriggerUp[3] = "Deactivate"; stateName[4] = "Repair"; stateSound[4] = RepairPackFireSound; stateScript[4] = "onRepair"; stateSpinThread[4] = FullSpeed; stateAllowImageChange[4] = false; stateSequence[4] = "activate"; stateFire[4] = true; stateEnergyDrain[4] = 9; stateTimeoutValue[4] = 0.2; stateTransitionOnTimeOut[4] = "Repair"; stateTransitionOnNoAmmo[4] = "Deactivate"; stateTransitionOnTriggerUp[4] = "Deactivate"; stateTransitionOnNotLoaded[4] = "Validate"; stateName[5] = "Deactivate"; stateScript[5] = "onDeactivate"; stateSpinThread[5] = SpinDown; stateSequence[5] = "activate"; stateDirection[5] = false; stateTimeoutValue[5] = 0.2; stateTransitionOnTimeout[5] = "ActivateReady"; }; function RepairPackImage::onUnmount(%data, %obj, %node) { // dismount the repair gun if the player had it mounted // need the extra "if" statement to avoid a console error message if(%obj.getMountedImage($WeaponSlot)) if(%obj.getMountedImage($WeaponSlot).getName() $= "RepairGunImage") %obj.unmountImage($WeaponSlot); // if the player was repairing something when the pack was thrown, stop repairing it if(%obj.repairing != 0) stopRepairing(%obj); } function RepairPackImage::onActivate(%data, %obj, %slot) { // don't activate the pack if player is piloting a vehicle if(%obj.isPilot()) { %obj.setImageTrigger(%slot, false); return; } if(!isObject(%obj.getMountedImage($WeaponSlot)) || %obj.getMountedImage($WeaponSlot).getName() !$= "RepairGunImage") { messageClient(%obj.client, 'MsgRepairPackOn', '\c2Repair pack activated.'); // make sure player's arm thread is "look" %obj.setArmThread(look); // mount the repair gun %obj.mountImage(RepairGunImage, $WeaponSlot); // clientCmdsetRepairReticle found in hud.cs commandToClient(%obj.client, 'setRepairReticle'); } } function RepairPackImage::onDeactivate(%data, %obj, %slot) { //called when the player hits the "pack" key again (toggle) %obj.setImageTrigger(%slot, false); // if repair gun was mounted, unmount it if(%obj.getMountedImage($WeaponSlot).getName() $= "RepairGunImage") %obj.unmountImage($WeaponSlot); } function RepairGunImage::onMount(%this,%obj,%slot) { %obj.setImageAmmo(%slot,true); if ( !isDemo() ) commandToClient( %obj.client, 'setRepairPackIconOn' ); } function RepairGunImage::onUnmount(%this,%obj,%slot) { // called when player switches to another weapon // stop repairing whatever player was repairing if(%obj.repairing) stopRepairing(%obj); %obj.setImageTrigger(%slot, false); // "turn off" the repair pack -- player needs to hit the "pack" key to // activate the repair gun again %obj.setImageTrigger($BackpackSlot, false); if ( !isDemo() ) commandToClient( %obj.client, 'setRepairPackIconOff' ); } function RepairGunImage::onActivateReady(%this,%obj,%slot) { %obj.errMsgSent = false; %obj.selfRepairing = false; %obj.repairing = 0; %obj.setImageLoaded(%slot, false); } function RepairGunImage::onValidate(%this,%obj,%slot) { // this = repairgunimage datablock // obj = player wielding the repair gun // slot = weapon slot if(%obj.getEnergyLevel() <= %this.cutOffEnergy) { stopRepairing(%obj); return; } %repGun = %obj.getMountedImage(%slot); // muzVec is the vector coming from the repair gun's "muzzle" %muzVec = %obj.getMuzzleVector(%slot); // muzNVec = normalized muzVec %muzNVec = VectorNormalize(%muzVec); %repairRange = DefaultRepairBeam.beamRange; // scale muzNVec to the range the repair beam can reach %muzScaled = VectorScale(%muzNVec, %repairRange); // muzPoint = the actual point of the gun's "muzzle" %muzPoint = %obj.getMuzzlePoint(%slot); // rangeEnd = muzzle point + length of beam %rangeEnd = VectorAdd(%muzPoint, %muzScaled); // search for just about anything that can be damaged as well as interiors %searchMasks = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::TurretObjectType | $TypeMasks::InteriorObjectType; // search for objects within the beam's range that fit the masks above %scanTarg = ContainerRayCast(%muzPoint, %rangeEnd, %searchMasks, %obj); // screen out interiors if(%scanTarg && !(%scanTarg.getType() & $TypeMasks::InteriorObjectType)) { // a target in range was found %repTgt = firstWord(%scanTarg); // is the prospective target damaged? if(%repTgt.notRepairable) { // this is an object that cant be repaired at all // -- mission specific flag set on the object if(!%obj.errMsgSent) { messageClient(%obj.client, 'MsgRepairPackIrrepairable', '\c2Target is not repairable.', %repTgt); %obj.errMsgSent = true; } // if player was repairing something, stop the repairs -- we're done if(%obj.repairing) stopRepairing(%obj); } else if(%repTgt.getDamageLevel()) { // yes, it's damaged if(%repTgt != %obj.repairing) { if(isObject(%obj.repairing)) stopRepairing(%obj); %obj.repairing = %repTgt; } // setting imageLoaded to true sends us to repair state (function onRepair) %obj.setImageLoaded(%slot, true); } else { // there is a target in range, but it's not damaged if(!%obj.errMsgSent) { // if the target isn't damaged, send a message to that effect only once messageClient(%obj.client, 'MsgRepairPackNotDamaged', '\c2Target is not damaged.', %repTgt); %obj.errMsgSent = true; } // if player was repairing something, stop the repairs -- we're done if(%obj.repairing) stopRepairing(%obj); } } //AI hack - too many things influence the aiming, so I'm going to force the repair object for bots only else if (%obj.client.isAIControlled() && isObject(%obj.client.repairObject)) { %repTgt = %obj.client.repairObject; %repPoint = %repTgt.getAIRepairPoint(); if (%repPoint $= "0 0 0") %repPoint = %repTgt.getWorldBoxCenter(); %repTgtVector = VectorNormalize(VectorSub(%muzPoint, %repPoint)); %aimVector = VectorNormalize(VectorSub(%muzPoint, %rangeEnd)); //if the dot product is very close (ie. we're aiming in the right direction) if (VectorDot(%repTgtVector, %aimVector) > 0.85) { //do an LOS to make sure nothing is in the way... %scanTarg = ContainerRayCast(%muzPoint, %repPoint, %searchMasks, %obj); if (firstWord(%scanTarg) == %repTgt) { // yes, it's damaged if(isObject(%obj.repairing)) stopRepairing(%obj); %obj.repairing = %repTgt; // setting imageLoaded to true sends us to repair state (function onRepair) %obj.setImageLoaded(%slot, true); } } } else if(%obj.getDamageLevel()) { // there is no target in range, but the player is damaged // check to see if we were repairing something before -- if so, stop repairing old target if(%obj.repairing != 0) if(%obj.repairing != %obj) stopRepairing(%obj); if(isObject(%obj.repairing)) stopRepairing(%obj); %obj.repairing = %obj; // quick, to onRepair! %obj.setImageLoaded(%slot, true); } else { // there is no target in range, and the player isn't damaged if(!%obj.errMsgSent) { // send an error message only once messageClient(%obj.client, 'MsgRepairPackNoTarget', '\c2No target to repair.'); %obj.errMsgSent = true; } stopRepairing(%obj); } } function RepairGunImage::onRepair(%this,%obj,%slot) { // this = repairgunimage datablock // obj = player wielding the repair gun // slot = weapon slot if(%obj.getEnergyLevel() <= %this.cutOffEnergy) { stopRepairing(%obj); return; } // reset the flag that indicates an error message has been sent %obj.errMsgSent = false; %target = %obj.repairing; if(!%target) { // no target -- whoops! never mind stopRepairing(%obj); } else { %target.repairedBy = %obj.client; //keep track of who last repaired this item if(%obj.repairing == %obj) { // player is self-repairing if(%obj.getDamageLevel()) { if(!%obj.selfRepairing) { // no need for a projectile, just send a message and up the repair rate messageClient(%obj.client, 'MsgRepairPackPlayerSelfRepair', '\c2Repairing self.'); %obj.selfRepairing = true; startRepairing(%obj, true); } } else { messageClient(%obj.client, 'MsgRepairPackSelfDone', '\c2Repairs completed on self.'); stopRepairing(%obj); %obj.errMsgSent = true; } } else { // make sure we still have a target -- more vector fun!!! %muzVec = %obj.getMuzzleVector(%slot); %muzNVec = VectorNormalize(%muzVec); %repairRange = DefaultRepairBeam.beamRange; %muzScaled = VectorScale(%muzNVec, %repairRange); %muzPoint = %obj.getMuzzlePoint(%slot); %rangeEnd = VectorAdd(%muzPoint, %muzScaled); %searchMasks = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::TurretObjectType; //AI hack to help "fudge" the repairing stuff... if (%obj.client.isAIControlled() && isObject(%obj.client.repairObject) && %obj.client.repairObject == %obj.repairing) { %repTgt = %obj.client.repairObject; %repPoint = %repTgt.getAIRepairPoint(); if (%repPoint $= "0 0 0") %repPoint = %repTgt.getWorldBoxCenter(); %repTgtVector = VectorNormalize(VectorSub(%muzPoint, %repPoint)); %aimVector = VectorNormalize(VectorSub(%muzPoint, %rangeEnd)); //if the dot product is very close (ie. we're aiming in the right direction) if (VectorDot(%repTgtVector, %aimVector) > 0.85) %scanTarg = ContainerRayCast(%muzPoint, %repPoint, %searchMasks, %obj); } else %scanTarg = ContainerRayCast(%muzPoint, %rangeEnd, %searchMasks, %obj); if (%scanTarg) { %pos = getWords(%scanTarg, 1, 3); %obstructMask = $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType; %obstruction = ContainerRayCast(%muzPoint, %pos, %obstructMask, %obj); if (%obstruction) %scanTarg = "0"; } if(%scanTarg) { // there's still a target out there %repTgt = firstWord(%scanTarg); // is the target damaged? if(%repTgt.getDamageLevel()) { if(%repTgt != %obj.repairing) { // the target is not the same as the one we were just repairing // stop repairing old target, start repairing new target stopRepairing(%obj); if(isObject(%obj.repairing)) stopRepairing(%obj); %obj.repairing = %repTgt; // extract the name of what player is repairing based on what it is // if it's a player, it's the player's name (duh) // if it's an object, look for a nametag // if object has no nametag, just say what it is (e.g. generatorLarge) if(%repTgt.getClassName() $= Player) %tgtName = getTaggedString(%repTgt.client.name); else if(%repTgt.getGameName() !$= "") %tgtName = %repTgt.getGameName(); else %tgtName = %repTgt.getDatablock().getName(); messageClient(%obj.client, 'MsgRepairPackRepairingObj', '\c2Repairing %1.', %tgtName, %repTgt); startRepairing(%obj, false); } else { // it's the same target as last time // changed to fix "2 players can't repair same object" bug if(%obj.repairProjectile == 0) { if(%repTgt.getClassName() $= Player) %tgtName = getTaggedString(%repTgt.client.name); else if(%repTgt.getGameName() !$= "") %tgtName = %repTgt.getGameName(); else %tgtName = %repTgt.getDatablock().getName(); messageClient(%obj.client, 'MsgRepairPackRepairingObj', '\c2Repairing %1.', %tgtName, %repTgt); startRepairing(%obj, false); } } } else { %rateOfRepair = %this.repairFactorObject; if(%repTgt.getClassName() $= Player) { %tgtName = getTaggedString(%repTgt.client.name); %rateOfRepair = %this.repairFactorPlayer; } else if(%repTgt.getGameName() !$= "") %tgtName = %repTgt.getGameName(); else %tgtName = %repTgt.getDatablock().getName(); if(%repTgt != %obj.repairing) { // it isn't the same object we were repairing previously messageClient(%obj.client, 'MsgRepairPackNotDamaged', '\c2%1 is not damaged.', %tgtName); } else { // same target, but not damaged -- we must be done messageClient(%obj.client, 'MsgRepairPackDone', '\c2Repairs completed.'); Game.objectRepaired(%repTgt, %tgtName); } %obj.errMsgSent = true; stopRepairing(%obj); } } else { // whoops, we lost our target messageClient(%obj.client, 'MsgRepairPackLostTarget', '\c2Repair target no longer in range.'); stopRepairing(%obj); } } } } function RepairGunImage::onDeactivate(%this,%obj,%slot) { stopRepairing(%obj); } function stopRepairing(%player) { // %player = the player who was using the repair pack if(%player.selfRepairing) { // there is no projectile for self-repairing %player.setRepairRate(%player.getRepairRate() - %player.repairingRate); %player.selfRepairing = false; } else if(%player.repairing > 0) { // player was repairing something else //if(%player.repairing.beingRepaired > 0) //{ // don't decrement this stuff if it's already at 0 -- though it shouldn't be //%player.repairing.beingRepaired--; %player.repairing.setRepairRate(%player.repairing.getRepairRate() - %player.repairingRate); //} if(%player.repairProjectile > 0) { // is there a repair projectile? delete it %player.repairProjectile.delete(); %player.repairProjectile = 0; } } %player.repairing = 0; %player.repairingRate = 0; %player.setImageTrigger($WeaponSlot, false); %player.setImageLoaded($WeaponSlot, false); } function startRepairing(%player, %self) { // %player = the player who was using the repair pack // %self = boolean -- is player repairing him/herself? if(%self) { // one repair, hold the projectile %player.setRepairRate(%player.getRepairRate() + RepairGunImage.repairFactorPlayer); %player.selfRepairing = true; %player.repairingRate = RepairGunImage.repairFactorPlayer; } else { //if(%player.repairing.beingRepaired $= "") // %player.repairing.beingRepaired = 1; //else // %player.repairing.beingRepaired++; //AI hack... if (%player.client.isAIControlled() && %player.client.repairObject == %player.repairing) { %initialPosition = %player.getMuzzlePoint($WeaponSlot); %initialDirection = VectorSub(%initialPosition, %player.repairing.getWorldBoxCenter()); } else { %initialDirection = %player.getMuzzleVector($WeaponSlot); %initialPosition = %player.getMuzzlePoint($WeaponSlot); } if(%player.repairing.getClassName() $= Player) %repRate = RepairGunImage.repairFactorPlayer; else %repRate = RepairGunImage.repairFactorObject; %player.repairing.setRepairRate(%player.repairing.getRepairRate() + %repRate); %player.repairingRate = %repRate; %player.repairProjectile = new RepairProjectile() { dataBlock = DefaultRepairBeam; initialDirection = %initialDirection; initialPosition = %initialPosition; sourceObject = %player; sourceSlot = $WeaponSlot; targetObject = %player.repairing; }; // ---------------------------------------------------- // z0dd - ZOD, 5/27/02. Fix lingering projectile bug if(isObject(%player.lastProjectile)) %player.lastProjectile.delete(); %player.lastProjectile = %player.repairProjectile; // End z0dd - ZOD // ---------------------------------------------------- MissionCleanup.add(%player.repairProjectile); } } function RepairPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors }PK !(l IIscripts/packs/satchelCharge.cs//-------------------------------------------------------------------------- // Satchel Charge pack // can be used by any armor type // when activated, throws the pack -- when activated again (before // picking up another pack), detonates with a BIG explosion. //-------------------------------------------------------------------------- // Sounds datablock EffectProfile(SatchelChargeActivateEffect) { effectname = "packs/satchel_pack_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(SatchelChargeExplosionEffect) { effectname = "packs/satchel_pack_detonate"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(SatchelChargePreExplosionEffect) { effectname = "explosions/explosion.xpl03"; minDistance = 10.0; maxDistance = 30.0; }; datablock AudioProfile(SatchelChargeActivateSound) { filename = "fx/packs/satchel_pack_activate.wav"; description = AudioClose3d; preload = true; effect = SatchelChargeActivateEffect; }; datablock AudioProfile(SatchelChargeExplosionSound) { filename = "fx/packs/satchel_pack_detonate.wav"; description = AudioBIGExplosion3d; preload = true; effect = SatchelChargeExplosionEffect; }; datablock AudioProfile(SatchelChargePreExplosionSound) { filename = "fx/explosions/explosion.xpl03.wav"; description = AudioBIGExplosion3d; preload = true; effect = SatchelChargePreExplosionEffect; }; datablock AudioProfile(UnderwaterSatchelChargeExplosionSound) { filename = "fx/weapons/mortar_explode_UW.wav"; description = AudioBIGExplosion3d; preload = true; effect = SatchelChargeExplosionEffect; }; //---------------------------------------------------------------------------- // Satchel Debris //---------------------------------------------------------------------------- datablock ParticleData( SDebrisSmokeParticle ) { dragCoeffiecient = 1.0; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; lifetimeMS = 1000; lifetimeVarianceMS = 100; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -60.0; spinRandomMax = 60.0; colors[0] = "0.4 0.4 0.4 1.0"; colors[1] = "0.3 0.3 0.3 0.5"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 0.0; sizes[1] = 2.0; sizes[2] = 3.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( SDebrisSmokeEmitter ) { ejectionPeriodMS = 7; periodVarianceMS = 1; ejectionVelocity = 1.0; // A little oomph at the back end velocityVariance = 0.2; thetaMin = 0.0; thetaMax = 40.0; particles = "SDebrisSmokeParticle"; }; datablock DebrisData( SatchelDebris ) { emitters[0] = SDebrisSmokeEmitter; explodeOnMaxBounce = true; elasticity = 0.4; friction = 0.2; lifetime = 0.3; lifetimeVariance = 0.02; }; //---------------------------------------------------------------------------- // Bubbles //---------------------------------------------------------------------------- datablock ParticleData(SatchelBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.25; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1500; lifetimeVarianceMS = 600; useInvAlpha = false; textureName = "special/bubbles"; spinRandomMin = -100.0; spinRandomMax = 100.0; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 0.4"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 2.0; sizes[1] = 2.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.8; times[2] = 1.0; }; datablock ParticleEmitterData(SatchelBubbleEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 1.0; ejectionOffset = 7.0; velocityVariance = 0.5; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "MortarExplosionBubbleParticle"; }; //-------------------------------------------------------------------------- // Satchel Explosion Particle effects //-------------------------------------- datablock ParticleData(SatchelExplosionSmoke) { dragCoeffiecient = 0.4; gravityCoefficient = -0.0; // rises slowly inheritedVelFactor = 0.025; lifetimeMS = 2000; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "1.0 0.7 0.0 1.0"; colors[1] = "0.2 0.2 0.2 0.5"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 7.0; sizes[1] = 17.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.4; times[2] = 1.0; }; datablock ParticleEmitterData(SatchelExplosionSmokeEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 14.25; velocityVariance = 2.25; thetaMin = 0.0; thetaMax = 180.0; lifetimeMS = 200; particles = "SatchelExplosionSmoke"; }; datablock ParticleData(UnderwaterSatchelExplosionSmoke) { dragCoeffiecient = 105.0; gravityCoefficient = -0.0; inheritedVelFactor = 0.025; constantAcceleration = -1.0; lifetimeMS = 1500; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "0.4 0.4 1.0 1.0"; colors[1] = "0.4 0.4 1.0 0.5"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 7.0; sizes[1] = 17.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.2; times[2] = 1.0; }; datablock ParticleEmitterData(UnderwaterSatchelExplosionSmokeEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 14.25; velocityVariance = 2.25; thetaMin = 0.0; thetaMax = 180.0; lifetimeMS = 200; particles = "UnderwaterSatchelExplosionSmoke"; }; datablock ParticleData(SatchelSparks) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 150; textureName = "special/bigSpark"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 1.0"; colors[2] = "1.0 0.36 0.26 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.75; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(SatchelSparksEmitter) { ejectionPeriodMS = 1; periodVarianceMS = 0; ejectionVelocity = 40; velocityVariance = 20.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 180; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "SatchelSparks"; }; datablock ParticleData(UnderwaterSatchelSparks) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 350; textureName = "special/underwaterSpark"; colors[0] = "0.6 0.6 1.0 1.0"; colors[1] = "0.6 0.6 1.0 1.0"; colors[2] = "0.6 0.6 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.75; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(UnderwaterSatchelSparksEmitter) { ejectionPeriodMS = 2; periodVarianceMS = 0; ejectionVelocity = 30; velocityVariance = 5.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 70; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "UnderwaterSatchelSparks"; }; //--------------------------------------------------------------------------- // Explosion //--------------------------------------------------------------------------- datablock ExplosionData(SatchelSubExplosion) { explosionShape = "disc_explosion.dts"; faceViewer = true; explosionScale = "0.5 0.5 0.5"; debris = SatchelDebris; debrisThetaMin = 10; debrisThetaMax = 80; debrisNum = 8; debrisVelocity = 60.0; debrisVelocityVariance = 15.0; lifetimeMS = 1000; delayMS = 0; emitter[0] = SatchelExplosionSmokeEmitter; emitter[1] = SatchelSparksEmitter; offset = 0.0; playSpeed = 1.5; sizes[0] = "1.5 1.5 1.5"; sizes[1] = "3.0 3.0 3.0"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(SatchelSubExplosion2) { explosionShape = "disc_explosion.dts"; faceViewer = true; explosionScale = "0.7 0.7 0.7"; debris = SatchelDebris; debrisThetaMin = 10; debrisThetaMax = 170; debrisNum = 8; debrisVelocity = 60.0; debrisVelocityVariance = 15.0; lifetimeMS = 1000; delayMS = 50; emitter[0] = SatchelExplosionSmokeEmitter; emitter[1] = SatchelSparksEmitter; offset = 9.0; playSpeed = 1.5; sizes[0] = "1.5 1.5 1.5"; sizes[1] = "1.5 1.5 1.5"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(SatchelSubExplosion3) { explosionShape = "disc_explosion.dts"; faceViewer = true; explosionScale = "1.0 1.0 1.0"; debris = SatchelDebris; debrisThetaMin = 10; debrisThetaMax = 170; debrisNum = 8; debrisVelocity = 60.0; debrisVelocityVariance = 15.0; lifetimeMS = 2000; delayMS = 100; emitter[0] = SatchelExplosionSmokeEmitter; emitter[1] = SatchelSparksEmitter; offset = 9.0; playSpeed = 2.5; sizes[0] = "1.0 1.0 1.0"; sizes[1] = "1.0 1.0 1.0"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(SatchelMainExplosion) { soundProfile = SatchelChargePreExplosionSound; subExplosion[0] = SatchelSubExplosion; subExplosion[1] = SatchelSubExplosion2; subExplosion[2] = SatchelSubExplosion3; }; //--------------------------------------------------------------------------- // Underwater Explosion //--------------------------------------------------------------------------- datablock ExplosionData(UnderwaterSatchelSubExplosion) { explosionShape = "disc_explosion.dts"; faceViewer = true; explosionScale = "0.5 0.5 0.5"; lifetimeMS = 1000; delayMS = 0; emitter[0] = UnderwaterSatchelExplosionSmokeEmitter; emitter[1] = UnderwaterSatchelSparksEmitter; emitter[2] = SatchelBubbleEmitter; offset = 0.0; playSpeed = 0.75; sizes[0] = "1.5 1.5 1.5"; sizes[1] = "2.5 2.5 2.5"; sizes[2] = "2.0 2.0 2.0"; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ExplosionData(UnderwaterSatchelSubExplosion2) { explosionShape = "disc_explosion.dts"; faceViewer = true; explosionScale = "0.7 0.7 0.7"; lifetimeMS = 1000; delayMS = 50; emitter[0] = UnderwaterSatchelExplosionSmokeEmitter; emitter[1] = UnderwaterSatchelSparksEmitter; emitter[2] = SatchelBubbleEmitter; offset = 9.0; playSpeed = 0.75; sizes[0] = "1.5 1.5 1.5"; sizes[1] = "1.0 1.0 1.0"; sizes[2] = "0.75 0.75 0.75"; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ExplosionData(UnderwaterSatchelSubExplosion3) { explosionShape = "disc_explosion.dts"; faceViewer = true; explosionScale = "1.0 1.0 1.0"; lifetimeMS = 2000; delayMS = 100; emitter[0] = UnderwaterSatchelExplosionSmokeEmitter; emitter[1] = UnderwaterSatchelSparksEmitter; emitter[2] = SatchelBubbleEmitter; offset = 9.0; playSpeed = 1.25; sizes[0] = "1.0 1.0 1.0"; sizes[1] = "1.0 1.0 1.0"; sizes[2] = "0.5 0.5 0.5"; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ExplosionData(UnderwaterSatchelMainExplosion) { soundProfile = UnderwaterSatchelChargeExplosionSound; subExplosion[0] = UnderwaterSatchelSubExplosion; subExplosion[1] = UnderwaterSatchelSubExplosion2; subExplosion[2] = UnderwaterSatchelSubExplosion3; }; //-------------------------------------------------------------------------- // Projectile //------------------------------------------------------------------------- // shapebase datablocks datablock ShapeBaseImageData(SatchelChargeImage) { shapeFile = "pack_upgrade_satchel.dts"; item = SatchelCharge; mountPoint = 1; offset = "0 0 0"; emap = true; }; datablock ItemData(SatchelCharge) { className = Pack; catagory = "Packs"; image = SatchelChargeImage; shapeFile = "pack_upgrade_satchel.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; pickUpName = "a satchel charge pack"; computeCRC = true; }; datablock ItemData(SatchelChargeThrown) { shapeFile = "pack_upgrade_satchel.dts"; explosion = SatchelMainExplosion; underwaterExplosion = UnderwaterSatchelMainExplosion; mass = 1.2; elasticity = 0.1; friction = 0.9; rotate = false; pickupRadius = 0; noTimeout = true; armDelay = 3000; maxDamage = 0.6; kickBackStrength = 4000; computeCRC = true; }; //-------------------------------------------------------------------------- function SatchelCharge::onUse(%this, %obj) { %item = new Item() { dataBlock = SatchelChargeThrown; rotation = "0 0 1 " @ (getRandom() * 360); }; MissionCleanup.add(%item); // take pack out of inventory and unmount image %obj.decInventory(SatchelCharge, 1); %obj.throwObject(%item); //error("throwing satchel charge #" @ %item); %obj.thrownChargeId = %item; %item.sourceObject = %obj; %item.armed = false; %item.damaged = 0.0; %item.thwart = false; // arm itself 3 seconds after being thrown schedule(%item.getDatablock().armDelay, %item, "initArmSatchelCharge", %item); messageClient(%obj.client, 'MsgSatchelChargePlaced', "\c2Satchel charge deployed."); } function initArmSatchelCharge(%satchel) { // "deet deet deet" sound %satchel.playAudio(1, SatchelChargeActivateSound); // also need to play "antenna extending" animation %satchel.playThread(0, "deploy"); %satchel.playThread(1, "activate"); // delay the actual arming until after sound is done playing schedule( 2200, 0, "armSatchelCharge", %satchel ); } function armSatchelCharge(%satchel) { %satchel.armed = true; commandToClient( %satchel.sourceObject.client, 'setSatchelArmed' ); } function detonateSatchelCharge(%player) { %satchelCharge = %player.thrownChargeId; // can't detonate the satchel charge if it isn't armed if(!%satchelCharge.armed) return; //error("Detonating satchel charge #" @ %satchelCharge @ " for player #" @ %player); if(%satchelCharge.getDamageState() !$= Destroyed) { %satchelCharge.setDamageState(Destroyed); %satchelCharge.blowup(); } if(isObject(%player)) %player.thrownChargeId = 0; // Clear the player's HUD: %player.client.clearBackpackIcon(); } function SatchelChargeThrown::onEnterLiquid(%data, %obj, %coverage, %type) { // lava types if(%type >=4 && %type <= 6) { if(%obj.getDamageState() !$= "Destroyed") { %obj.armed = true; detonateSatchelCharge(%obj.sourceObject); return; } } // quickSand if(%type == 7) if(isObject(%obj.sourceObject)) %obj.sourceObject.thrownChargeId = 0; Parent::onEnterLiquid(%data, %obj, %coverage, %type); } function SatchelChargeImage::onMount(%data, %obj, %node) { %obj.thrownChargeId = 0; } function SatchelChargeImage::onUnmount(%data, %obj, %node) { } function SatchelChargeThrown::onDestroyed(%this, %object, %lastState) { if(%object.kaboom) return; else { %object.kaboom = true; // the "thwart" flag is set if the charge is destroyed with weapons rather // than detonated. A less damaging explosion, but visually the same scale. if(%object.thwart) { messageClient(%object.sourceObject.client, 'msgSatchelChargeDetonate', "\c2Satchel charge destroyed."); %dmgRadius = 10; %dmgMod = 0.3; %expImpulse = 1000; %dmgType = $DamageType::Explosion; } else { messageClient(%object.sourceObject.client, 'msgSatchelChargeDetonate', "\c2Satchel charge detonated!"); %dmgRadius = 20; %dmgMod = 1.0; %expImpulse = 2500; %dmgType = $DamageType::SatchelCharge; } %object.blowingUp = true; RadiusExplosion(%object, %object.getPosition(), %dmgRadius, %dmgMod, %expImpulse, %object.sourceObject, %dmgType); %object.schedule(1000, "delete"); } // ------------------------------------------------------------------- // z0dd - ZOD, 5/8/02. Addition. Satchel bug fix. Prior to fix, // clients couldn't pick up packs when satchel was destroyed from dmg. if(isObject(%object.sourceObject)) %object.sourceObject.thrownChargeId = 0; } function SatchelChargeThrown::onCollision(%data,%obj,%col) { // Do nothing... } function SatchelChargeThrown::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) { if (!%object.blowingUp) { %targetObject.damaged += %amount; if(%targetObject.damaged >= %targetObject.getDataBlock().maxDamage && %targetObject.getDamageState() !$= Destroyed) { %targetObject.thwart = true; %targetObject.setDamageState(Destroyed); %targetObject.blowup(); // clear the player's HUD: %targetObject.sourceObject.client.clearBackPackIcon(); } } } function SatchelCharge::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors }PK !(p((!scripts/packs/sensorjammerpack.cs// ------------------------------------------------------------------ // SENSOR JAMMER PACK // // When activated, the sensor jammer pack emits a sensor-jamming field of // 20m radius. Any players within this field are completely invisible to // all sensors, turrets and cameras. // // When not activated, the pack has no effect. // datablock EffectProfile(SensorJammerPackActivateEffect) { effectname = "packs/cloak_on"; minDistance = 2.5; maxDistance = 2.5; }; datablock AudioProfile(SensorJammerActivateSound) { filename = "fx/packs/sensorjammerpack_on.wav"; description = ClosestLooping3d; preload = true; effect = SensorJammerPackActivateEffect; }; datablock ShapeBaseImageData(SensorJammerPackImage) { shapeFile = "pack_upgrade_sensorjammer.dts"; item = SensorJammerPack; mountPoint = 1; offset = "0 0 0"; usesEnergy = true; minEnergy = 3; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateSequence[1] = "fire"; stateSound[1] = SensorJammerActivateSound; stateEnergyDrain[1] = 10.5; stateTransitionOnTriggerUp[1] = "Deactivate"; stateTransitionOnNoAmmo[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeout[2] = "Idle"; }; datablock ItemData(SensorJammerPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_upgrade_sensorjammer.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "SensorJammerPackImage"; pickUpName = "a sensor jammer pack"; computeCRC = true; }; // datablock SensorData(JammerSensorObjectPassive) // { // // same detection info as 'PlayerObject' sensorData // detects = true; // detectsUsingLOS = true; // detectsPassiveJammed = true; // detectRadius = 2000; // detectionPings = false; // detectsFOVOnly = true; // detectFOVPercent = 1.3; // useObjectFOV = true; // // jams = true; // jamsOnlyGroup = true; // jamsUsingLOS = true; // jamRadius = 0; // }; datablock SensorData(JammerSensorObjectActive) { // same detection info as 'PlayerObject' sensorData detects = true; detectsUsingLOS = true; detectsPassiveJammed = true; detectRadius = 2000; detectionPings = false; detectsFOVOnly = true; detectFOVPercent = 1.3; useObjectFOV = true; jams = true; jamsOnlyGroup = true; jamsUsingLOS = true; jamRadius = 30; }; function SensorJammerPackImage::onUnmount(%data, %obj, %slot) { setTargetSensorData(%obj.client.target, PlayerSensor); %obj.setImageTrigger(%slot, false); } function SensorJammerPackImage::onActivate(%data, %obj, %slot) { messageClient(%obj.client, 'MsgSensorJammerPackOn', '\c2Sensor jammer pack on.'); setTargetSensorData(%obj.client.target, JammerSensorObjectActive); if ( !isDemo() ) commandToClient( %obj.client, 'setSenJamIconOn' ); %obj.setJammerFX( true ); } function SensorJammerPackImage::onDeactivate(%data, %obj, %slot) { messageClient(%obj.client, 'MsgSensorJammerPackOff', '\c2Sensor jammer pack off.'); %obj.setImageTrigger(%slot, false); setTargetSensorData(%obj.client.target, PlayerSensor); if ( !isDemo() ) commandToClient( %obj.client, 'setSenJamIconOff' ); %obj.setJammerFX( false ); } function SensorJammerPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors } PK !(E#  scripts/packs/shieldpack.cs// ------------------------------------------------------------------ // SHIELD PACK // can be used by any armor type // while activated, absorbs damage at cost of energy datablock EffectProfile(ShieldPackActivateEffect) { effectname = "packs/shield_on"; minDistance = 2.5; maxDistance = 2.5; }; datablock AudioProfile(ShieldPackActivateSound) { filename = "fx/packs/shield_on.wav"; description = ClosestLooping3d; preload = true; effect = ShieldPackActivateEffect; }; datablock ShapeBaseImageData(ShieldPackImage) { shapeFile = "pack_upgrade_shield.dts"; item = ShieldPack; mountPoint = 1; offset = "0 0 0"; usesEnergy = true; minEnergy = 3; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateSequence[1] = "fire"; stateSound[1] = ShieldPackActivateSound; stateEnergyDrain[1] = 9; stateTransitionOnTriggerUp[1] = "Deactivate"; stateTransitionOnNoAmmo[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeout[2] = "Idle"; }; datablock ItemData(ShieldPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_upgrade_shield.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "ShieldPackImage"; pickUpName = "a shield pack"; computeCRC = true; }; function ShieldPackImage::onMount(%data, %obj, %node) { } function ShieldPackImage::onUnmount(%data, %obj, %node) { %obj.setImageTrigger(%node, false); %obj.isShielded = ""; } function ShieldPackImage::onActivate(%data, %obj, %slot) { messageClient(%obj.client, 'MsgShieldPackOn', '\c2Shield pack on.'); %obj.isShielded = true; if ( !isDemo() ) commandToClient( %obj.client, 'setShieldIconOn' ); } function ShieldPackImage::onDeactivate(%data, %obj, %slot) { messageClient(%obj.client, 'MsgShieldPackOff', '\c2Shield pack off.'); %obj.setImageTrigger(%slot,false); %obj.isShielded = ""; if ( !isDemo() ) commandToClient( %obj.client, 'setShieldIconOff' ); } function ShieldPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors } PK !(;C!scripts/turrets/ELFBarrelLarge.cs//-------------------------------------------------------------------------- // ELF Turret barrel //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- // Sounds //-------------------------------------------------------------------------- datablock EffectProfile(EBLSwitchEffect) { effectname = "powered/turret_light_activate"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(EBLFireEffect) { effectname = "weapons/ELF_fire"; minDistance = 2.5; maxDistance = 5.0; }; datablock AudioProfile(EBLSwitchSound) { filename = "fx/powered/turret_light_activate.wav"; description = AudioClose3d; preload = true; effect = EBLSwitchEffect; }; datablock AudioProfile(EBLFireSound) { filename = "fx/weapons/ELF_fire.wav"; description = AudioDefaultLooping3d; preload = true; effect = EBLFireEffect; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock ELFProjectileData(ELFTurretBolt) { beamRange = 75; numControlPoints = 8; restorativeFactor = 3.75; dragFactor = 4.5; endFactor = 2.25; randForceFactor = 2; randForceTime = 0.125; drainEnergy = 1.0; drainHealth = 0.0015; directDamageType = $DamageType::ELFTurret; mainBeamWidth = 0.1; // width of blue wave beam mainBeamSpeed = 9.0; // speed that the beam travels forward mainBeamRepeat = 0.25; // number of times the texture repeats lightningWidth = 0.1; lightningDist = 0.15; // distance of lightning from main beam fireSound = EBLFireSound; textures[0] = "special/ELFBeam"; textures[1] = "special/ELFLightning"; textures[2] = "special/BlueImpact"; // -------------------------------------------------------------------- // z0dd - ZOD, 5/27/02. Was missing this parameter, (console spam fix). emitter = ELFSparksEmitter; }; //-------------------------------------------------------------------------- // ELF Turret Image //-------------------------------------------------------------------------- datablock TurretImageData(ELFBarrelLarge) { shapeFile = "turret_elf_large.dts"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //item = ELFBarrelLargePack; item = ELFBarrelPack; projectile = ELFTurretBolt; projectileType = ELFProjectile; deleteLastProjectile = true; usesEnergy = true; fireEnergy = 0.0; minEnergy = 0.0; // Turret parameters activationMS = 500; deactivateDelayMS = 100; thinkTimeMS = 100; degPerSecTheta = 580; degPerSecPhi = 960; attackRadius = 75; yawVariance = 30.0; // these will smooth out the elf tracking code. pitchVariance = 30.0; // more or less just tolerances // State transiltions stateName[0] = "Activate"; stateTransitionOnNotLoaded[0] = "Dead"; stateTransitionOnLoaded[0] = "ActivateReady"; stateName[1] = "ActivateReady"; stateSequence[1] = "Activate"; stateSound[1] = EBLSwitchSound; 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"; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateSound[3] = EBLFireSound; stateScript[3] = "onFire"; stateTransitionOnTriggerUp[3] = "Deconstruction"; stateTransitionOnNoAmmo[3] = "Deconstruction"; stateName[4] = "Reload"; stateTimeoutValue[4] = 0.01; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateTransitionOnTimeout[4] = "Ready"; stateTransitionOnNotLoaded[4] = "Deactivate"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateName[5] = "Deactivate"; stateSequence[5] = "Activate"; 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"; stateName[8] = "Deconstruction"; stateScript[8] = "deconstruct"; stateTransitionOnNoAmmo[8] = "NoAmmo"; stateTransitionOnTimeout[8] = "Reload"; stateTimeoutValue[8] = 0.1; }; PK !(vE scripts/turrets/aaBarrelLarge.cs//-------------------------------------- // Default blaster //-------------------------------------- //-------------------------------------------------------------------------- // Sounds and feedback effects //-------------------------------------- datablock EffectProfile(AASwitchEffect) { effectname = "powered/turret_light_activate"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(AAFireEffect) { effectname = "powered/turret_aa_fire"; minDistance = 2.5; maxDistance = 5.0; }; datablock AudioProfile(AASwitchSound) { filename = "fx/powered/turret_aa_activate.wav"; description = AudioClose3d; preload = true; effect = AASwitchEffect; }; datablock AudioProfile(AAFireSound) { filename = "fx/powered/turret_aa_fire.wav"; description = AudioDefault3d; preload = true; effect = AAFireEffect; }; //-------------------------------------------------------------------------- // Particle effects //-------------------------------------- //-------------------------------------------------------------------------- // Explosion //-------------------------------------- datablock ParticleData(AABulletExplosionParticle1) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent4"; colors[0] = "0.57 0.41 1.0 1.0"; colors[1] = "0.57 0.41 1.0 1.0"; colors[2] = "0.57 0.41 0.0 0.0"; sizes[0] = 0.25; sizes[1] = 0.5; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(AABulletExplosionEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 2; velocityVariance = 1.5; ejectionOffset = 0.0; thetaMin = 70; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "AABulletExplosionParticle1"; }; datablock ParticleData(AABulletExplosionParticle2) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/blasterHit"; colors[0] = "0.57 0.41 1.0 0.6"; colors[1] = "0.57 0.41 1.0 0.6"; colors[2] = "0.57 0.41 0.0 0.0"; sizes[0] = 0.3; sizes[1] = 0.90; sizes[2] = 1.50; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(AABulletExplosionEmitter2) { ejectionPeriodMS = 30; periodVarianceMS = 0; ejectionVelocity = 1; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = false; lifetimeMS = 200; particles = "AABulletExplosionParticle2"; }; datablock ExplosionData(AABulletExplosion) { soundProfile = blasterExpSound; emitter[0] = AABulletExplosionEmitter; emitter[1] = AABulletExplosionEmitter2; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock TracerProjectileData(AABullet) { doDynamicClientHits = true; projectileShapeName = "energy_bolt.dts"; directDamage = 0.25; directDamageType = $DamageType::AATurret; explosion = "AABulletExplosion"; splash = ChaingunSplash; dryVelocity = 150.0; wetVelocity = 100.0; velInheritFactor = 1.0; fizzleTimeMS = 3000; lifetimeMS = 3000; explodeOnDeath = false; reflectOnWaterImpactAngle = 0.0; explodeOnWaterImpact = false; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = 3000; tracerLength = 20; tracerAlpha = false; tracerMinPixels = 3; tracerColor = "1 1 1 1"; tracerTex[0] = "special/shrikeBolt"; tracerTex[1] = "special/shrikeBoltCross"; tracerWidth = 0.55; crossSize = 0.99; crossViewAng = 0.990; renderCross = true; emap = true; }; //-------------------------------------------------------------------------- // Weapon //-------------------------------------- datablock TurretImageData(AABarrelLarge) { shapeFile = "turret_aa_large.dts"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //item = AABarrelLargePack; item = AABarrelPack; projectileType = TracerProjectile; projectile = AABullet; usesEnergy = true; fireEnergy = 4.0; minEnergy = 4.0; emap = true; isSeeker = true; seekRadius = 200; maxSeekAngle = 6; seekTime = 1.0; minSeekHeat = 0.6; useTargetAudio = false; // Turret parameters activationMS = 250; deactivateDelayMS = 500; thinkTimeMS = 200; degPerSecTheta = 600; degPerSecPhi = 1080; attackRadius = 200; // State transitions stateName[0] = "Activate"; stateTransitionOnNotLoaded[0] = "Dead"; stateTransitionOnLoaded[0] = "ActivateReady"; stateName[1] = "ActivateReady"; stateSequence[1] = "Activate"; stateSound[1] = AASwitchSound; stateTimeoutValue[1] = 1.0; stateTransitionOnTimeout[1] = "Ready"; stateTransitionOnNotLoaded[1] = "Deactivate"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateScript[1] = "AAActivateReady"; stateName[2] = "Ready"; stateTransitionOnNotLoaded[2] = "Deactivate"; stateTransitionOnTriggerDown[2] = "Fire1"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateScript[2] = "AAReady"; stateName[3] = "Fire1"; stateTransitionOnTimeout[3] = "Reload1"; stateTimeoutValue[3] = 0.15; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire1"; stateSound[3] = AAFireSound; stateScript[3] = "onFire"; stateName[4] = "Reload1"; stateTimeoutValue[4] = 0.2; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateTransitionOnTimeout[4] = "Fire2"; stateTransitionOnNotLoaded[4] = "Deactivate"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateName[5] = "Fire2"; stateTransitionOnTimeout[5] = "Reload2"; stateTimeoutValue[5] = 0.15; stateFire[5] = true; stateRecoil[5] = LightRecoil; stateAllowImageChange[5] = false; stateSequence[5] = "Fire2"; stateSound[5] = AAFireSound; stateScript[5] = "onFire"; stateName[6] = "Reload2"; stateTimeoutValue[6] = 0.2; stateAllowImageChange[6] = false; stateSequence[6] = "Reload"; stateTransitionOnTimeout[6] = "Ready"; stateTransitionOnNotLoaded[6] = "Deactivate"; stateTransitionOnNoAmmo[6] = "NoAmmo"; stateName[7] = "Deactivate"; stateSequence[7] = "Activate"; stateDirection[7] = false; stateTimeoutValue[7] = 1.0; stateTransitionOnLoaded[7] = "ActivateReady"; stateTransitionOnTimeout[7] = "Dead"; stateName[8] = "Dead"; stateTransitionOnLoaded[8] = "ActivateReady"; stateName[9] = "NoAmmo"; stateTransitionOnAmmo[9] = "Reload2"; stateSequence[9] = "NoAmmo"; }; PK !(+!!)scripts/turrets/indoorDeployableBarrel.csdatablock EffectProfile(IBLSwitchEffect) { effectname = "powered/turret_light_activate"; minDistance = 5.0; maxDistance = 5.0; }; datablock EffectProfile(IBLFireEffect) { effectname = "powered/turret_indoor_fire"; minDistance = 2.5; maxDistance = 5.0; }; datablock AudioProfile(IBLSwitchSound) { filename = "fx/powered/turret_light_activate.wav"; description = AudioClose3d; preload = true; effect = IBLSwitchEffect; }; datablock AudioProfile(IBLFireSound) { filename = "fx/powered/turret_indoor_fire.wav"; description = AudioDefault3d; preload = true; effect = IBLFireEffect; }; datablock SensorData(DeployedIndoorTurretSensor) { detects = true; detectsUsingLOS = true; detectsPassiveJammed = false; detectsActiveJammed = false; detectsCloaked = false; detectionPings = true; detectRadius = 40; }; datablock ShockwaveData(IndoorTurretMuzzleFlash) { width = 0.5; numSegments = 13; numVertSegments = 1; velocity = 2.0; acceleration = -1.0; lifetimeMS = 300; height = 0.1; verticalCurve = 0.5; mapToTerrain = false; renderBottom = false; orientToNormal = true; renderSquare = true; texture[0] = "special/blasterHit"; texture[1] = "special/gradient"; texWrap = 3.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; colors[0] = "1.0 0.3 0.3 1.0"; colors[1] = "1.0 0.3 0.3 1.0"; colors[2] = "1.0 0.3 0.3 0.0"; }; datablock TurretData(TurretDeployedFloorIndoor) : TurretDamageProfile { className = DeployedTurret; shapeFile = "turret_indoor_deployf.dts"; mass = 5.0; maxDamage = 0.5; destroyedLevel = 0.5; disabledLevel = 0.21; explosion = SmallTurretExplosion; expDmgRadius = 5.0; expDamage = 0.25; expImpulse = 500.0; repairRate = 0; heatSignature = 0.0; deployedObject = true; thetaMin = 5; thetaMax = 145; thetaNull = 90; primaryAxis = zaxis; isShielded = true; energyPerDamagePoint = 110; maxEnergy = 30; rechargeRate = 0.10; barrel = DeployableIndoorBarrel; canControl = true; cmdCategory = "DTactical"; cmdIcon = CMDTurretIcon; cmdMiniIconName = "commander/MiniIcons/com_turret_grey"; targetNameTag = 'Spider Clamp'; targetTypeTag = 'Turret'; sensorData = DeployedIndoorTurretSensor; sensorRadius = DeployedIndoorTurretSensor.detectRadius; sensorColor = "191 0 226"; firstPersonOnly = true; renderWhenDestroyed = false; debrisShapeName = "debris_generic_small.dts"; debris = TurretDebrisSmall; }; datablock TurretData(TurretDeployedWallIndoor) : TurretDamageProfile { className = DeployedTurret; shapeFile = "turret_indoor_deployw.dts"; mass = 5.0; maxDamage = 0.5; destroyedLevel = 0.5; disabledLevel = 0.21; explosion = SmallTurretExplosion; expDmgRadius = 5.0; expDamage = 0.25; expImpulse = 500.0; repairRate = 0; heatSignature = 0.0; thetaMin = 5; thetaMax = 145; thetaNull = 90; deployedObject = true; primaryAxis = yaxis; isShielded = true; energyPerDamagePoint = 110; maxEnergy = 30; rechargeRate = 0.10; barrel = DeployableIndoorBarrel; canControl = true; cmdCategory = "DTactical"; cmdIcon = CMDTurretIcon; cmdMiniIconName = "commander/MiniIcons/com_turret_grey"; targetNameTag = 'Spider Clamp'; targetTypeTag = 'Turret'; sensorData = DeployedIndoorTurretSensor; sensorRadius = DeployedIndoorTurretSensor.detectRadius; sensorColor = "191 0 226"; firstPersonOnly = true; renderWhenDestroyed = false; debrisShapeName = "debris_generic_small.dts"; debris = TurretDebrisSmall; }; datablock TurretData(TurretDeployedCeilingIndoor) : TurretDamageProfile { className = DeployedTurret; shapeFile = "turret_indoor_deployc.dts"; mass = 5.0; maxDamage = 0.5; destroyedLevel = 0.5; disabledLevel = 0.21; explosion = SmallTurretExplosion; expDmgRadius = 5.0; expDamage = 0.25; expImpulse = 500.0; repairRate = 0; explosion = SmallTurretExplosion; //thetaMin = 5; //thetaMax = 145; thetaMin = 35; thetaMax = 175; thetaNull = 90; heatSignature = 0.0; deployedObject = true; primaryAxis = revzaxis; isShielded = true; energyPerDamagePoint = 110; maxEnergy = 30; rechargeRate = 0.10; barrel = DeployableIndoorBarrel; canControl = true; cmdCategory = "DTactical"; cmdIcon = CMDTurretIcon; cmdMiniIconName = "commander/MiniIcons/com_turret_grey"; targetNameTag = 'Spider Clamp'; targetTypeTag = 'Turret'; sensorData = DeployedIndoorTurretSensor; sensorRadius = DeployedIndoorTurretSensor.detectRadius; sensorColor = "191 0 226"; firstPersonOnly = true; renderWhenDestroyed = false; debrisShapeName = "debris_generic_small.dts"; debris = TurretDebrisSmall; }; datablock LinearFlareProjectileData(IndoorTurretBolt) { directDamage = 0.14; directDamageType = $DamageType::IndoorDepTurret; explosion = "BlasterExplosion"; kickBackStrength = 0.0; dryVelocity = 120.0; wetVelocity = 40.0; velInheritFactor = 0.5; fizzleTimeMS = 2000; lifetimeMS = 3000; explodeOnDeath = false; reflectOnWaterImpactAngle = 0.0; explodeOnWaterImpact = false; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = 3000; numFlares = 20; size = 0.45; flareColor = "1 0.35 0.35"; flareModTexture = "flaremod"; flareBaseTexture = "flarebase"; sound = BlasterProjectileSound; hasLight = true; lightRadius = 3.0; lightColor = "1 0.35 0.35"; }; datablock TurretImageData(DeployableIndoorBarrel) { shapeFile = "turret_muzzlepoint.dts"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //item = IndoorTurretBarrel; item = TurretIndoorDeployable; projectile = IndoorTurretBolt; projectileType = LinearFlareProjectile; usesEnergy = true; fireEnergy = 4.5; minEnergy = 4.5; lightType = "WeaponFireLight"; lightColor = "0.25 0.15 0.15 1.0"; lightTime = "1000"; lightRadius = "2"; muzzleFlash = IndoorTurretMuzzleFlash; // Turret parameters activationMS = 150; deactivateDelayMS = 300; thinkTimeMS = 150; degPerSecTheta = 580; degPerSecPhi = 960; attackRadius = 60; // State transitions stateName[0] = "Activate"; stateTransitionOnNotLoaded[0] = "Dead"; stateTransitionOnLoaded[0] = "ActivateReady"; stateName[1] = "ActivateReady"; stateSequence[1] = "Activate"; stateSound[1] = IBLSwitchSound; 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"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.3; stateFire[3] = true; stateShockwave[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateSound[3] = IBLFireSound; stateScript[3] = "onFire"; stateName[4] = "Reload"; stateTimeoutValue[4] = 0.8; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateTransitionOnTimeout[4] = "Ready"; stateTransitionOnNotLoaded[4] = "Deactivate"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateName[5] = "Deactivate"; stateSequence[5] = "Activate"; 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"; }; PK !(%scripts/turrets/missileBarrelLarge.cs//-------------------------------------------------------------------------- // Large Missile Turret // // //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- // Sounds // // z0dd - ZOD, 5/8/02. Labels for sound // datablocks were conflicting with // Mortar barrel. Relabled to fix. //-------------------------------------- //datablock EffectProfile(MBLSwitchEffect) datablock EffectProfile(MILSwitchEffect) { effectname = "powered/turret_heavy_activate"; minDistance = 2.5; maxDistance = 5.0; }; //datablock EffectProfile(MBLFireEffect) datablock EffectProfile(MILFireEffect) { effectname = "powered/turret_missile_fire"; minDistance = 2.5; maxDistance = 5.0; }; //datablock AudioProfile(MBLSwitchSound) datablock AudioProfile(MILSwitchSound) { filename = "fx/powered/turret_missile_activate.wav"; description = AudioClose3d; preload = true; // ------------------------------------------- // z0dd - ZOD, 3/27/02. Changed for sound fix. //effect = MBLSwitchEffect; effect = MILSwitchEffect; }; //datablock AudioProfile(MBLFireSound) datablock AudioProfile(MILFireSound) { filename = "fx/powered/turret_missile_fire.wav"; description = AudioDefault3d; preload = true; // ------------------------------------------- // z0dd - ZOD, 3/27/02. Changed for sound fix. //effect = MBLFireEffect; effect = MILFireEffect; }; //-------------------------------------------------------------------------- // Particle effects: Note that we pull the below datablocks from // scripts/weapons/missileLauncher.cs //-------------------------------------- //datablock ParticleData(MissileSmokeParticle) //datablock ParticleEmitterData(MissileSmokeEmitter) //-------------------------------------------------------------------------- // Explosion: from scripts/weapons/disc.cs //-------------------------------------- //dataBlock ExplosionData(DiscExplosion) //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock SeekerProjectileData(TurretMissile) { casingShapeName = "weapon_missile_casement.dts"; projectileShapeName = "weapon_missile_projectile.dts"; hasDamageRadius = true; indirectDamage = 1.0; damageRadius = 4.0; radiusDamageType = $DamageType::MissileTurret; kickBackStrength = 2500; flareDistance = 200; flareAngle = 30; minSeekHeat = 0.6; explosion = "MissileExplosion"; velInheritFactor = 0.2; splash = MissileSplash; baseEmitter = MissileSmokeEmitter; delayEmitter = MissileFireEmitter; puffEmitter = MissilePuffEmitter; lifetimeMS = 20000; muzzleVelocity = 80.0; turningSpeed = 90.0; proximityRadius = 4; terrainAvoidanceSpeed = 180; terrainScanAhead = 25; terrainHeightFail = 12; terrainAvoidanceRadius = 100; useFlechette = true; flechetteDelayMs = 550; casingDeb = FlechetteDebris; }; //-------------------------------------------------------------------------- //-------------------------------------- Fusion Turret Image // datablock TurretImageData(MissileBarrelLarge) { shapeFile = "turret_missile_large.dts"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //item = MissileBarrelLargePack; item = MissileBarrelPack; projectile = TurretMissile; projectileType = SeekerProjectile; usesEnergy = true; fireEnergy = 60.0; minEnergy = 60.0; isSeeker = true; seekRadius = 300; maxSeekAngle = 30; seekTime = 1.0; minSeekHeat = 0.6; emap = true; minTargetingDistance = 40; // Turret parameters activationMS = 250; deactivateDelayMS = 500; thinkTimeMS = 200; degPerSecTheta = 580; degPerSecPhi = 1080; attackRadius = 250; // State transitions stateName[0] = "Activate"; stateTransitionOnNotLoaded[0] = "Dead"; stateTransitionOnLoaded[0] = "ActivateReady"; stateName[1] = "ActivateReady"; stateSequence[1] = "Activate"; // ---------------------------------------------- // z0dd - ZOD, 3/27/02. Changed for sound fix. //stateSound[1] = MBLSwitchSound; stateSound[1] = MILSwitchSound; stateTimeoutValue[1] = 2; stateTransitionOnTimeout[1] = "Ready"; stateTransitionOnNotLoaded[1] = "Deactivate"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNotLoaded[2] = "Deactivate"; stateTransitionOnTriggerDown[2] = "Fire"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateName[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.3; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; // ---------------------------------------------- // z0dd - ZOD, 3/27/02. Changed for sound fix. //stateSound[3] = MBLFireSound; stateSound[3] = MILFireSound; stateScript[3] = "onFire"; stateName[4] = "Reload"; stateTimeoutValue[4] = 3.5; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateTransitionOnTimeout[4] = "Ready"; stateTransitionOnNotLoaded[4] = "Deactivate"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateName[5] = "Deactivate"; stateSequence[5] = "Activate"; stateDirection[5] = false; stateTimeoutValue[5] = 2; stateTransitionOnLoaded[5] = "ActivateReady"; stateTransitionOnTimeout[5] = "Dead"; stateName[6] = "Dead"; stateTransitionOnLoaded[6] = "ActivateReady"; stateName[7] = "NoAmmo"; stateTransitionOnAmmo[7] = "Reload"; stateSequence[7] = "NoAmmo"; }; PK !(B66$scripts/turrets/mortarBarrelLarge.cs//-------------------------------------------------------------------------- // Large Mortar Turret // // //-------------------------------------------------------------------------- //-------------------------------------------------------------------------- // Sounds //-------------------------------------- datablock EffectProfile(MBLSwitchEffect) { effectname = "powered/turret_heavy_activate"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(MBLFireEffect) { effectname = "powered/turret_mortar_fire"; minDistance = 2.5; maxDistance = 5.0; }; datablock AudioProfile(MBLSwitchSound) { filename = "fx/powered/turret_heavy_activate.wav"; description = AudioClose3d; preload = true; effect = MBLSwitchEffect; }; datablock AudioProfile(MBLFireSound) { filename = "fx/powered/turret_mortar_fire.wav"; description = AudioDefault3d; preload = true; effect = MBLFireEffect; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock AudioProfile(MortarTurretProjectileSound) { filename = "fx/weapons/mortar_projectile.wav"; description = ProjectileLooping3d; preload = true; }; datablock GrenadeProjectileData(MortarTurretShot) { projectileShapeName = "mortar_projectile.dts"; emitterDelay = -1; directDamage = 0.0; hasDamageRadius = true; indirectDamage = 1.32; damageRadius = 30.0; radiusDamageType = $DamageType::MortarTurret; kickBackStrength = 3000; explosion = "MortarExplosion"; velInheritFactor = 0.5; splash = MortarSplash; baseEmitter = MortarSmokeEmitter; bubbleEmitter = MortarBubbleEmitter; grenadeElasticity = 0.25; grenadeFriction = 0.4; armingDelayMS = 2000; muzzleVelocity = 43.7; drag = 0.1; sound = MortarTurretProjectileSound; hasLight = true; lightRadius = 3; lightColor = "0.05 0.2 0.05"; }; //-------------------------------------------------------------------------- //-------------------------------------- Fusion Turret Image // datablock TurretImageData(MortarBarrelLarge) { shapeFile = "turret_mortar_large.dts"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //item = MortarBarrelLargePack; item = MortarBarrelPack; projectile = MortarTurretShot; projectileType = GrenadeProjectile; usesEnergy = true; fireEnergy = 30; minEnergy = 30; emap = true; // don't let a mortar turret blow itself up dontFireInsideDamageRadius = true; damageRadius = 40; // Turret parameters activationMS = 1000; deactivateDelayMS = 1500; thinkTimeMS = 200; degPerSecTheta = 580; degPerSecPhi = 960; attackRadius = 160; // State transitions stateName[0] = "Activate"; stateTransitionOnNotLoaded[0] = "Dead"; stateTransitionOnLoaded[0] = "ActivateReady"; stateName[1] = "ActivateReady"; stateSequence[1] = "Activate"; stateSound[1] = MBLSwitchSound; 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"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.3; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateSound[3] = MBLFireSound; stateScript[3] = "onFire"; stateName[4] = "Reload"; stateTimeoutValue[4] = 1.5; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateTransitionOnTimeout[4] = "Ready"; stateTransitionOnNotLoaded[4] = "Deactivate"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateName[5] = "Deactivate"; stateSequence[5] = "Activate"; 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"; }; PK !( 0 ); } //------------------------------------------------------------------------------ function VehicleHud::addLine( %this, %tag, %lineNum, %name, %count ) { %yOffset = ( %lineNum * 30 ) + 11; $Hud[%tag].count++; $Hud[%tag].data[%lineNum, 0] = new ShellTabButton() { profile = "ShellTabProfile"; horizSizing = "right"; vertSizing = "bottom"; position = "3 " @ %yOffset; extent = "206 38"; minExtent = "8 8"; visible = "1"; helpTag = "0"; command = "VehicleHud.onTabSelect(" @ %lineNum @ "," @ %name @ "," @ %count @ ");"; text = ""; vName = %name; vCount = %count; }; // If nothing is selected, select something: if ( %this.selId $= "" ) { $Hud[%tag].data[%lineNum, 0].setValue( true ); VehicleHud.onTabSelect( %lineNum, %name, %count ); } return 1; } //------------------------------------------------------------------------------ function clientCmdStationVehicleShowHud() { if ( Canvas.getContent() != PlayGui.getId() ) return; showHud( 'vehicleHud' ); clientCmdTogglePlayHuds(false); } //------------------------------------------------------------------------------ function clientCmdStationVehicleHideHud() { hideHud( 'vehicleHud' ); clientCmdTogglePlayHuds(true); } function clientCmdStationVehicleHideJustHud() { hideHud( 'vehicleHud' ); }PK !( x++$scripts/vehicles/serverVehicleHud.cs//------------------------------------------------------------------------------ datablock EffectProfile(VehicleAppearEffect) { effectname = "vehicles/inventory_pad_appear"; minDistance = 5; maxDistance = 10; }; datablock EffectProfile(ActivateVehiclePadEffect) { effectname = "powered/vehicle_pad_on"; minDistance = 20; maxDistance = 30; }; datablock AudioProfile(VehicleAppearSound) { filename = "fx/vehicles/inventory_pad_appear.wav"; description = AudioClosest3d; preload = true; effect = VehicleAppearEffect; }; datablock AudioProfile(ActivateVehiclePadSound) { filename = "fx/powered/vehicle_pad_on.wav"; description = AudioClose3d; preload = true; effect = ActivateVehiclePadEffect; }; datablock StationFXVehicleData( VehicleInvFX ) { lifetime = 6.0; glowTopHeight = 1.5; glowBottomHeight = 0.1; glowTopRadius = 12.5; glowBottomRadius = 12.0; numGlowSegments = 26; glowFadeTime = 3.25; armLightDelay = 2.3; armLightLifetime = 3.0; armLightFadeTime = 1.5; numArcSegments = 10.0; sphereColor = "0.1 0.1 0.5"; spherePhiSegments = 13; sphereThetaSegments = 8; sphereRadius = 12.0; sphereScale = "1.05 1.05 0.85"; glowNodeName = "GLOWFX"; leftNodeName[0] = "LFX1"; leftNodeName[1] = "LFX2"; leftNodeName[2] = "LFX3"; leftNodeName[3] = "LFX4"; rightNodeName[0] = "RFX1"; rightNodeName[1] = "RFX2"; rightNodeName[2] = "RFX3"; rightNodeName[3] = "RFX4"; texture[0] = "special/stationGlow"; texture[1] = "special/stationLight2"; }; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ function serverCmdBuyVehicle(%client, %blockName) { %team = %client.getSensorGroup(); if(vehicleCheck(%blockName, %team)) { %station = %client.player.station.pad; if( (%station.ready) && (%station.station.vehicle[%blockName]) ) { %trans = %station.getTransform(); %pos = getWords(%trans, 0, 2); %matrix = VectorOrthoBasis(getWords(%trans, 3, 6)); %yrot = getWords(%matrix, 3, 5); %p = vectorAdd(%pos,vectorScale(%yrot, -3)); %p = getWords(%p,0, 1) @ " " @ getWord(%p,2) + 4; // error(%blockName); // error(%blockName.spawnOffset); %p = vectorAdd(%p, %blockName.spawnOffset); %rot = getWords(%trans, 3, 5); %angle = getWord(%trans, 6) + 3.14; %mask = $TypeMasks::VehicleObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::StationObjectType | $TypeMasks::TurretObjectType; InitContainerRadiusSearch(%p, %blockName.checkRadius, %mask); %clear = 1; for (%x = 0; (%obj = containerSearchNext()) != 0; %x++) { if((%obj.getType() & $TypeMasks::VehicleObjectType) && (%obj.getDataBlock().checkIfPlayersMounted(%obj))) { %clear = 0; break; } else %removeObjects[%x] = %obj; } if(%clear) { %fadeTime = 0; for(%i = 0; %i < %x; %i++) { if(%removeObjects[%i].getType() & $TypeMasks::PlayerObjectType) { %pData = %removeObjects[%i].getDataBlock(); %pData.damageObject(%removeObjects[%i], 0, "0 0 0", 1000, $DamageType::VehicleSpawn); } else { %removeObjects[%i].mountable = 0; %removeObjects[%i].startFade( 1000, 0, true ); %removeObjects[%i].schedule(1001, "delete"); %fadeTime = 1500; } } schedule(%fadeTime, 0, "createVehicle", %client, %station, %blockName, %team , %p, %rot, %angle); } else MessageClient(%client, "", 'Can\'t create vehicle. A player is on the creation pad.'); } } } function createVehicle(%client, %station, %blockName, %team , %pos, %rot, %angle) { %obj = %blockName.create(%team); if(%obj) { %station.ready = false; %obj.team = %team; %obj.useCreateHeight(true); %obj.schedule(5500, "useCreateHeight", false); %obj.getDataBlock().isMountable(%obj, false); %obj.getDataBlock().schedule(6500, "isMountable", %obj, true); %station.playThread($ActivateThread,"activate2"); %station.playAudio($ActivateSound, ActivateVehiclePadSound); vehicleListAdd(%blockName, %obj); MissionCleanup.add(%obj); %turret = %obj.getMountNodeObject(10); if(%turret > 0) { %turret.setCloaked(true); %turret.schedule(4800, "setCloaked", false); } %obj.setCloaked(true); %obj.setTransform(%pos @ " " @ %rot @ " " @ %angle); %obj.schedule(3700, "playAudio", 0, VehicleAppearSound); %obj.schedule(4800, "setCloaked", false); if(%client.player.lastVehicle) { %client.player.lastVehicle.lastPilot = ""; vehicleAbandonTimeOut(%client.player.lastVehicle); %client.player.lastVehicle = ""; } %client.player.lastVehicle = %obj; %obj.lastPilot = %client.player; // play the FX %fx = new StationFXVehicle() { dataBlock = VehicleInvFX; stationObject = %station; }; if ( %client.isVehicleTeleportEnabled() ) %obj.getDataBlock().schedule(5000, "mountDriver", %obj, %client.player); } if(%obj.getTarget() != -1) setTargetSensorGroup(%obj.getTarget(), %client.getSensorGroup()); // We are now closing the vehicle hud when you buy a vehicle, making the following call // unnecessary (and it breaks stuff, too!) //VehicleHud.updateHud(%client, 'vehicleHud'); } //------------------------------------------------------------------------------ function VehicleData::mountDriver(%data, %obj, %player) { if(isObject(%obj) && %obj.getDamageState() !$= "Destroyed") { %player.startFade(1000, 0, true); schedule(1000, 0, "testVehicleForMount", %player, %obj); %player.schedule(1500,"startFade",1000, 0, false); } } function testVehicleForMount(%player, %obj) { if(isObject(%obj) && %obj.getDamageState() !$= "Destroyed") %player.getDataBlock().onCollision(%player, %obj, 0); } //------------------------------------------------------------------------------ function VehicleData::checkIfPlayersMounted(%data, %obj) { for(%i = 0; %i < %obj.getDatablock().numMountPoints; %i++) if (%obj.getMountNodeObject(%i)) return true; return false; } //------------------------------------------------------------------------------ function VehicleData::isMountable(%data, %obj, %val) { %obj.mountable = %val; } //------------------------------------------------------------------------------ function vehicleCheck(%blockName, %team) { if(($VehicleMax[%blockName] - $VehicleTotalCount[%team, %blockName]) > 0) return true; // else // { // for(%i = 0; %i < $VehicleMax[%blockName]; %i++) // { // %obj = $VehicleInField[%blockName, %i]; // if(%obj.abandon) // { // vehicleListRemove(%blockName, %obj); // %obj.delete(); // return true; // } // } // } return false; } //------------------------------------------------------------------------------ function VehicleHud::updateHud( %obj, %client, %tag ) { %station = %client.player.station; // Not sure if we need to clear the huds... They'll always have the same num rows... //if ( %station.lastCount !$= "" ) // VehicleHud::clearHud( %client, %tag, %station.lastCount ); %team = %client.getSensorGroup(); %count = 0; if ( %station.vehicle[scoutVehicle] ) { messageClient( %client, 'SetLineHud', "", %tag, %count, "GRAV CYCLE", "", ScoutVehicle, $VehicleMax[ScoutVehicle] - $VehicleTotalCount[%team, ScoutVehicle] ); //new messageClient( %client, 'SetLineHud', "", %tag, %count, 'ScoutVehicle', $VehicleMax[ScoutVehicle] - $VehicleTotalCount[%team, ScoutVehicle], '', "GRAV CYCLE" ); %count++; } if ( %station.vehicle[AssaultVehicle] ) { messageClient( %client, 'SetLineHud', "", %tag, %count, "ASSAULT TANK", "", AssaultVehicle, $VehicleMax[AssaultVehicle] - $VehicleTotalCount[%team, AssaultVehicle] ); //new messageClient( %client, 'SetLineHud', "", %tag, %count, 'AssaultVehicle', $VehicleMax[AssaultVehicle] - $VehicleTotalCount[%team, AssaultVehicle], '', "ASSAULT TANK"); %count++; } if ( %station.vehicle[mobileBaseVehicle] ) { messageClient( %client, 'SetLineHud', "", %tag, %count, "MOBILE POINT BASE", "", MobileBaseVehicle, $VehicleMax[MobileBaseVehicle] - $VehicleTotalCount[%team, MobileBaseVehicle] ); //new messageClient( %client, 'SetLineHud', "", %tag, %count, 'MobileBaseVehicle', $VehicleMax[MobileBaseVehicle] - $VehicleTotalCount[%team, MobileBaseVehicle], '', "MOBILE POINT BASE" ); %count++; } if ( %station.vehicle[scoutFlyer] ) { messageClient( %client, 'SetLineHud', "", %tag, %count, "SCOUT FLIER", "", ScoutFlyer, $VehicleMax[ScoutFlyer] - $VehicleTotalCount[%team, ScoutFlyer] ); //new messageClient( %client, 'SetLineHud', "", %tag, %count, 'ScoutFlyer', $VehicleMax[ScoutFlyer] - $VehicleTotalCount[%team, ScoutFlyer], '', "SCOUT FLIER"); %count++; } if ( %station.vehicle[bomberFlyer] ) { messageClient( %client, 'SetLineHud', "", %tag, %count, "BOMBER", "", BomberFlyer, $VehicleMax[BomberFlyer] - $VehicleTotalCount[%team, BomberFlyer] ); //new messageClient( %client, 'SetLineHud', "", %tag, %count, 'BomberFlyer', $VehicleMax[BomberFlyer] - $VehicleTotalCount[%team, BomberFlyer], '', "BOMBER"); %count++; } if ( %station.vehicle[hapcFlyer] ) { messageClient( %client, 'SetLineHud', "", %tag, %count, "TRANSPORT", "", HAPCFlyer, $VehicleMax[HAPCFlyer] - $VehicleTotalCount[%team, HAPCFlyer] ); //new messageClient( %client, 'SetLineHud', "", %tag, %count, 'HAPCFlyer', $VehicleMax[HAPCFlyer] - $VehicleTotalCount[%team, HAPCFlyer], '', "TRANSPORT"); %count++; } %station.lastCount = %count; } //------------------------------------------------------------------------------ function VehicleHud::clearHud( %obj, %client, %tag, %count ) { for ( %i = 0; %i < %count; %i++ ) messageClient( %client, 'RemoveLineHud', "", %tag, %i ); } //------------------------------------------------------------------------------ function serverCmdEnableVehicleTeleport( %client, %enabled ) { %client.setVehicleTeleportEnabled( %enabled ); } PK !(_yrrscripts/vehicles/vehicle.cs// Notes: // - respawning vehicles with turrets (bomber/tank) will not setup the turret properly //Damage Rate for entering Liquid $VehicleDamageLava = 0.0325; $VehicleDamageHotLava = 0.0325; $VehicleDamageCrustyLava = 0.0325; $NumVehiclesDeploy = 0; //************************************************************** //* GENERAL PURPOSE FUNCTIONS //************************************************************** function VehicleData::onAdd(%data, %obj) { Parent::onAdd(%data, %obj); if((%data.sensorData !$= "") && (%obj.getTarget() != -1)) setTargetSensorData(%obj.getTarget(), %data.sensorData); %obj.setRechargeRate(%data.rechargeRate); // set full energy %obj.setEnergyLevel(%data.MaxEnergy); if(%obj.disableMove) %obj.immobilized = true; if(%obj.deployed) { if($countDownStarted) %data.schedule(($Host::WarmupTime * 1000) / 2, "vehicleDeploy", %obj, 0, 1); else { $VehiclesDeploy[$NumVehiclesDeploy] = %obj; $NumVehiclesDeploy++; } } if(%obj.mountable || %obj.mountable $= "") %data.isMountable(%obj, true); else %data.isMountable(%obj, false); %obj.setSelfPowered(); // %data.canObserve = true; } function VehicleData::onRemove(%this, %obj) { // if there are passengers/driver, kick them out %this.deleteAllMounted(%obj); for(%i = 0; %i < %obj.getDatablock().numMountPoints; %i++) if (%obj.getMountNodeObject(%i)) { %passenger = %obj.getMountNodeObject(%i); %passenger.unmount(); } vehicleListRemove(%obj.getDataBlock(), %obj); if(%obj.lastPilot.lastVehicle == %obj) %obj.lastPilot.lastVehicle = ""; Parent::onRemove(%this, %obj); } function VehicleData::onDamage(%this,%obj) { %damage = %obj.getDamageLevel(); if (%damage >= %this.destroyedLevel) { if(%obj.getDamageState() !$= "Destroyed") { if(%obj.respawnTime !$= "") %obj.marker.schedule = %obj.marker.data.schedule(%obj.respawnTime, "respawn", %obj.marker); %obj.setDamageState(Destroyed); } } else { if(%obj.getDamageState() !$= "Enabled") %obj.setDamageState(Enabled); } } function VehicleData::playerDismounted(%data, %obj, %player) { if( %player.client.observeCount > 0 ) resetObserveFollow( %player.client, true ); setTargetSensorGroup(%obj.getTarget(), %obj.team); // if there is a turret, set its team as well. if( %obj.turretObject > 0 ) setTargetSensorGroup(%obj.turretObject.getTarget(), %obj.team); } function HoverVehicle::useCreateHeight() { //this function is declared to prevent console error msg spam... } function WheeledVehicle::useCreateHeight() { //this function is declared to prevent console error msg spam... } function AssaultVehicle::onDamage(%this, %obj) { if(isObject(%obj.getMountNodeObject(10))) (%obj.getMountNodeObject(10)).setDamagelevel(%obj.getDamageLevel()); Parent::onDamage(%this, %obj); } function BomberFlyer::onDamage(%this, %obj) { if(isObject(%obj.getMountNodeObject(10))) (%obj.getMountNodeObject(10)).setDamagelevel(%obj.getDamageLevel()); Parent::onDamage(%this, %obj); } function MobileBaseVehicle::onDamage(%this, %obj) { if(isObject(%obj.getMountNodeObject(1))) (%obj.getMountNodeObject(1)).setDamagelevel(%obj.getDamageLevel()); Parent::onDamage(%this, %obj); } function VehicleData::onEnterLiquid(%data, %obj, %coverage, %type) { switch(%type) { case 0: //Water %obj.setHeat(0.0); case 1: //Ocean Water %obj.setHeat(0.0); case 2: //River Water %obj.setHeat(0.0); case 3: //Stagnant Water %obj.setHeat(0.0); case 4: //Lava %obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava); case 5: //Hot Lava %obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava); case 6: //Crusty Lava %obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava); case 7: //Quick Sand } } function FlyingVehicle::liquidDamage(%obj, %data, %damageAmount, %damageType) { if(%obj.getDamageState() !$= "Destroyed") { %data.damageObject(%obj, 0, "0 0 0", %damageAmount, %damageType); %obj.lDamageSchedule = %obj.schedule(50, "liquidDamage", %data, %damageAmount, %damageType); passengerLiquidDamage(%obj, %damageAmount, %damageType); } else %obj.lDamageSchedule = ""; } function WheeledVehicle::liquidDamage(%obj, %data, %damageAmount, %damageType) { if(%obj.getDamageState() !$= "Destroyed") { %data.damageObject(%obj, 0, "0 0 0", %damageAmount, %damageType); %obj.lDamageSchedule = %obj.schedule(50, "liquidDamage", %data, %damageAmount, %damageType); passengerLiquidDamage(%obj, %damageAmount, %damageType); } else %obj.lDamageSchedule = ""; } function HoverVehicle::liquidDamage(%obj, %data, %damageAmount, %damageType) { if(%obj.getDamageState() !$= "Destroyed") { %data.damageObject(%obj, 0, "0 0 0", %damageAmount, %damageType); %obj.lDamageSchedule = %obj.schedule(50, "liquidDamage", %data, %damageAmount, %damageType); passengerLiquidDamage(%obj, %damageAmount, %damageType); } else %obj.lDamageSchedule = ""; } function passengerLiquidDamage(%obj, %damageAmount, %damageType) { for(%i = %num; %i < %obj.getDataBlock().numMountPoints; %i++) if (%p = %obj.getMountNodeObject(%i)) %p.liquidDamage(%p.getDatablock(), $DamageLava, $DamageType::Lava); } function VehicleData::onLeaveLiquid(%data, %obj, %type) { switch(%type) { case 0: //Water %obj.setHeat(1.0); case 1: //Ocean Water %obj.setHeat(1.0); case 2: //River Water %obj.setHeat(1.0); case 3: //Stagnant Water %obj.setHeat(1.0); case 4: //Lava case 5: //Hot Lava case 6: //Crusty Lava case 7: //Quick Sand } if(%obj.lDamageSchedule !$= "") { cancel(%obj.lDamageSchedule); %obj.lDamageSchedule = ""; } } function VehicleData::onDestroyed(%data, %obj, %prevState) { if(%obj.lastDamagedBy) { %destroyer = %obj.lastDamagedBy; game.vehicleDestroyed(%obj, %destroyer); //error("vehicleDestroyed( "@ %obj @", "@ %destroyer @")"); } radiusVehicleExplosion(%data, %obj); if(%obj.turretObject) if(%obj.turretObject.getControllingClient()) %obj.turretObject.getDataBlock().playerDismount(%obj.turretObject); for(%i = 0; %i < %obj.getDatablock().numMountPoints; %i++) { if (%obj.getMountNodeObject(%i)) { %flingee = %obj.getMountNodeObject(%i); %flingee.getDataBlock().doDismount(%flingee, true); %xVel = 250.0 - (getRandom() * 500.0); %yVel = 250.0 - (getRandom() * 500.0); %zVel = (getRandom() * 100.0) + 50.0; %flingVel = %xVel @ " " @ %yVel @ " " @ %zVel; %flingee.applyImpulse(%flingee.getTransform(), %flingVel); echo("got player..." @ %flingee.getClassName()); %flingee.damage(0, %obj.getPosition(), 0.4, $DamageType::Crash); } } %data.deleteAllMounted(%obj); // --------------------------------------------------------------------------------- // z0dd - ZOD - Czar, 6/24/02. Move this vehicle out of the way so nothing collides // with it. if(%data.getName() $= "BomberFlyer" || %data.getName() $= "MobileBaseVehicle" || %data.getName() $= "AssaultVehicle") { %obj.setFrozenState(true); %obj.schedule(2000, "delete"); %data.schedule(500, 'onAvoidCollisions', %obj); } else { %obj.setFrozenState(true); %obj.schedule(500, "delete"); } // --------------------------------------------------------------------------------- } // ---------------------------------------------------------------------------------- // z0dd - ZOD, 6/13/02. Move this vehicle out of the way so nothing collides with it. function VehicleData::onAvoidCollisions(%data, %obj) { // Get the current location of the vehicle and send it to the moon! %transform = posFromTransform(%obj.getTransform()); %position = getWord(%transform, 0) SPC getWord(%transform, 1) SPC (getWord(%transform, 2)+2000); %rotation = getWord(%transform, 3) SPC getWord(%transform, 4) SPC getWord(%transform, 5) SPC getWord(%transform, 6); %obj.setTransform(%position SPC %rotation); } // ---------------------------------------------------------------------------------- function radiusVehicleExplosion(%data, %vehicle) { // this is a modified version of RadiusExplosion() from projectiles.cs %position = %vehicle.getPosition(); InitContainerRadiusSearch(%position, %data.explosionRadius, $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::TurretObjectType | $TypeMasks::ItemObjectType); %numTargets = 0; while ((%targetObject = containerSearchNext()) != 0) { if(%targetObject == %vehicle) continue; %dist = containerSearchCurrRadDamageDist(); if (%dist > %data.explosionRadius) continue; if (%targetObject.isMounted()) { %mount = %targetObject.getObjectMount(); if(%mount == %vehicle) continue; %found = -1; for (%i = 0; %i < %mount.getDataBlock().numMountPoints; %i++) { if (%mount.getMountNodeObject(%i) == %targetObject) { %found = %i; break; } } if (%found != -1) { if (%mount.getDataBlock().isProtectedMountPoint[%found] && (%mount != %vehicle)) continue; } } %targets[%numTargets] = %targetObject; %targetDists[%numTargets] = %dist; %numTargets++; } for (%i = 0; %i < %numTargets; %i++) { %targetObject = %targets[%i]; %dist = %targetDists[%i]; %coverage = calcExplosionCoverage(%position, %targetObject, ($TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::ForceFieldObjectType)); if (%coverage == 0) continue; %amount = (1.0 - (%dist / %data.explosionRadius)) * %coverage * %data.explosionDamage; %targetData = %targetObject.getDataBlock(); %momVec = "0 0 1"; if(%amount > 0) %targetData.damageObject(%targetObject, %sourceObject, %position, %amount, $DamageType::Explosion, %momVec); } } function VehicleData::deleteAllMounted() { } //************************************************************** //* VEHICLE CREATION //************************************************************** // (NOTE: No entry for Wildcat Grav Cycle is here. -- DG) //---------------------------- // SHRIKE SCOUT FLIER //---------------------------- function ScoutFlyer::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); %obj.mountImage(ScoutChaingunParam, 0); %obj.mountImage(ScoutChaingunImage, 2); %obj.mountImage(ScoutChaingunPairImage, 3); %obj.nextWeaponFire = 2; %obj.schedule(5500, "playThread", $ActivateThread, "activate"); } //---------------------------- // THUNDERSWORD BOMBER //---------------------------- function BomberFlyer::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); %turret = TurretData::create(BomberTurret); MissionCleanup.add(%turret); %turret.team = %obj.teamBought; %turret.selectedWeapon = 1; %turret.setSelfPowered(); %obj.mountObject(%turret, 10); %turret.mountImage(BomberTurretBarrel,2); %turret.mountImage(BomberTurretBarrelPair,3); %turret.mountImage(BomberBombImage, 4); %turret.mountImage(BomberBombPairImage, 5); %turret.mountImage(BomberTargetingImage, 6); %obj.turretObject = %turret; %turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate ); %turret.vehicleMounted = %obj; //vehicle turrets should not auto fire at targets %turret.setAutoFire(false); //for this particular weapon - a non-firing datablock used only so the AI can aim the turret //Also needed so we can set the turret parameters.. %turret.mountImage(AIAimingTurretBarrel, 0); // setup the turret's target info setTargetSensorGroup(%turret.getTarget(), %turret.team); setTargetNeverVisMask(%turret.getTarget(), 0xffffffff); } //---------------------------- // HAVOC TRANSPORT FLIER //---------------------------- function HAPCFlyer::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); %obj.schedule(6000, "playThread", $ActivateThread, "activate"); } //---------------------------- // BEOWULF ASSAULT VEHICLE //---------------------------- function AssaultVehicle::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); %turret = TurretData::create(AssaultPlasmaTurret); %turret.selectedWeapon = 1; MissionCleanup.add(%turret); %turret.team = %obj.teamBought; %turret.setSelfPowered(); %obj.mountObject(%turret, 10); %turret.mountImage(AssaultPlasmaTurretBarrel, 2); %turret.mountImage(AssaultMortarTurretBarrel, 4); %turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate ); %obj.turretObject = %turret; //vehicle turrets should not auto fire at targets %turret.setAutoFire(false); //Needed so we can set the turret parameters.. %turret.mountImage(AssaultTurretParam, 0); %obj.schedule(6000, "playThread", $ActivateThread, "activate"); // set the turret's target info setTargetSensorGroup(%turret.getTarget(), %turret.team); setTargetNeverVisMask(%turret.getTarget(), 0xffffffff); } //---------------------------- // JERICHO FORWARD BASE (Mobile Point Base) //---------------------------- function MobileBaseVehicle::onAdd(%this, %obj) { Parent::onAdd(%this, %obj); %obj.station = ""; %obj.turret = ""; %obj.beacon = ""; %obj.schedule(5000, "playThread", $AmbientThread, "ambient"); } //************************************************************** //* MULTI-CREW VEHICLE DELETION //************************************************************** //---------------------------- //BEOWULF ASSAULT VEHICLE //---------------------------- function AssaultVehicle::deleteAllMounted(%data, %obj) { %turret = %obj.getMountNodeObject(10); if(!%turret) return; if(%client = %turret.getControllingClient()) { %client.player.setControlObject(%client.player); %client.player.mountImage(%client.player.lastWeapon, $WeaponSlot); %client.player.mountVehicle = false; } %turret.schedule(2000, delete); } //---------------------------- // THUNDERSWORD BOMBER //---------------------------- function BomberFlyer::deleteAllMounted(%data, %obj) { if(isObject(%obj.beacon)) %obj.beacon.schedule(50, delete); %turret = %obj.getMountNodeObject(10); if(!%turret) return; %turret.altTrigger = 0; %turret.fireTrigger = 0; if(%client = %turret.getControllingClient()) { commandToClient(%client, 'endBomberSight'); %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(2000, delete); } //---------------------------- // JERICHO FORWARD BASE //---------------------------- function MobileBaseVehicle::deleteAllMounted(%data, %obj) { if(%obj.station !$= "") { %obj.station.getDataBlock().onLosePowerDisabled(%obj.station); %obj.unmountObject(%obj.station); %obj.station.trigger.schedule(2000, delete); %obj.station.schedule(2000, delete); } if(%obj.turret !$= "") { %obj.turret.getDataBlock().onLosePowerDisabled(%obj.turret); %obj.unmountObject(%obj.turret); %obj.turret.schedule(2000, delete); } if(isObject(%obj.shield)) %obj.shield.schedule(2000, delete); if(isObject(%obj.beacon)) { %obj.beacon.schedule(0, delete); } } //************************************************************** //* WEAPON MOUNTING ON VEHICLES //************************************************************** //---------------------------- // SHRIKE SCOUT FLIER //---------------------------- function ScoutFlyer::playerMounted(%data, %obj, %player, %node) { // scout flyer == SUV (single-user vehicle) commandToClient(%player.client, 'setHudMode', 'Pilot', "Shrike", %node); $numVWeapons = 1; // update observers who are following this guy... if( %player.client.observeCount > 0 ) resetObserveFollow( %player.client, false ); } //---------------------------- // THUNDERSWORD BOMBER //---------------------------- function BomberFlyer::playerMounted(%data, %obj, %player, %node) { if(%node == 0) { // pilot position %player.setPilot(true); commandToClient(%player.client, 'setHudMode', 'Pilot', "Bomber", %node); } else if(%node == 1) { // bombardier position %turret = %obj.getMountNodeObject(10); %player.vehicleTurret = %turret; %player.setTransform("0 0 0 0 0 1 0"); %player.lastWeapon = %player.getMountedImage($WeaponSlot); %player.unmountImage($WeaponSlot); if(!%player.client.isAIControlled()) { %player.setControlObject(%turret); %player.client.setObjectActiveImage(%turret, 2); } commandToClient(%player.client, 'startBomberSight'); %turret.bomber = %player; $bWeaponActive = 0; %obj.getMountNodeObject(10).selectedWeapon = 1; commandToClient(%player.client,'SetWeaponryVehicleKeys', true); commandToClient(%player.client, 'setHudMode', 'Pilot', "Bomber", %node); %player.isBomber = true; } else { // tail gunner position commandToClient(%player.client, 'setHudMode', 'Passenger', "Bomber", %node); } // build a space-separated string representing passengers // 0 = no passenger; 1 = passenger (e.g. "1 0 0 ") %passString = buildPassengerString(%obj); // send the string of passengers to all mounted players for(%i = 0; %i < %data.numMountPoints; %i++) if(%obj.getMountNodeObject(%i) > 0) commandToClient(%obj.getMountNodeObject(%i).client, 'checkPassengers', %passString); // update observers who are following this guy... if( %player.client.observeCount > 0 ) resetObserveFollow( %player.client, false ); } //---------------------------- // HAVOC TRANSPORT FLIER //---------------------------- function HAPCFlyer::playerMounted(%data, %obj, %player, %node) { if(%node == 0) { // pilot position commandToClient(%player.client, 'setHudMode', 'Pilot', "HAPC", %node); } else { // all others commandToClient(%player.client, 'setHudMode', 'Passenger', "HAPC", %node); } // build a space-separated string representing passengers // 0 = no passenger; 1 = passenger (e.g. "1 0 0 1 1 0 ") %passString = buildPassengerString(%obj); // send the string of passengers to all mounted players for(%i = 0; %i < %data.numMountPoints; %i++) if(%obj.getMountNodeObject(%i) > 0) commandToClient(%obj.getMountNodeObject(%i).client, 'checkPassengers', %passString); // update observers who are following this guy... if( %player.client.observeCount > 0 ) resetObserveFollow( %player.client, false ); } //---------------------------- // WILDCAT GRAV CYCLE //---------------------------- function ScoutVehicle::playerMounted(%data, %obj, %player, %node) { // scout vehicle == SUV (single-user vehicle) commandToClient(%player.client, 'setHudMode', 'Pilot', "Hoverbike", %node); // update observers who are following this guy... if( %player.client.observeCount > 0 ) resetObserveFollow( %player.client, false ); } //---------------------------- // BEOWULF ASSAULT VEHICLE //---------------------------- function AssaultVehicle::playerMounted(%data, %obj, %player, %node) { if(%node == 0) { // driver position // is there someone manning the turret? //%turreteer = %obj.getMountedNodeObject(1); commandToClient(%player.client, 'setHudMode', 'Pilot', "Assault", %node); } else if(%node == 1) { // turreteer position %turret = %obj.getMountNodeObject(10); %player.vehicleTurret = %turret; %player.setTransform("0 0 0 0 0 1 0"); %player.lastWeapon = %player.getMountedImage($WeaponSlot); %player.unmountImage($WeaponSlot); if(!%player.client.isAIControlled()) { %player.setControlObject(%turret); %player.client.setObjectActiveImage(%turret, 2); } %turret.turreteer = %player; // if the player is the turreteer, show vehicle's weapon icons //commandToClient(%player.client, 'showVehicleWeapons', %data.getName()); //%player.client.setVWeaponsHudActive(1); // plasma turret icon (default) $aWeaponActive = 0; commandToClient(%player.client,'SetWeaponryVehicleKeys', true); %obj.getMountNodeObject(10).selectedWeapon = 1; commandToClient(%player.client, 'setHudMode', 'Pilot', "Assault", %node); } // update observers who are following this guy... if( %player.client.observeCount > 0 ) resetObserveFollow( %player.client, false ); // build a space-separated string representing passengers // 0 = no passenger; 1 = passenger (e.g. "1 0 ") %passString = buildPassengerString(%obj); // send the string of passengers to all mounted players for(%i = 0; %i < %data.numMountPoints; %i++) if(%obj.getMountNodeObject(%i) > 0) commandToClient(%obj.getMountNodeObject(%i).client, 'checkPassengers', %passString); } //---------------------------- // JERICHO FORWARD BASE //---------------------------- function MobileBaseVehicle::playerMounted(%data, %obj, %player, %node) { // MPB vehicle == SUV (single-user vehicle) commandToClient(%player.client, 'setHudMode', 'Pilot', "MPB", %node); if(%obj.deploySchedule) { %obj.deploySchedule.clear(); %obj.deploySchedule = ""; } if(%obj.deployed !$= "" && %obj.deployed == 1) { %obj.setThreadDir($DeployThread, false); %obj.playThread($DeployThread,"deploy"); %obj.playAudio($DeploySound, MobileBaseUndeploySound); %obj.station.setThreadDir($DeployThread, false); %obj.station.getDataBlock().onLosePowerDisabled(%obj.station); %obj.station.clearSelfPowered(); %obj.station.goingOut=false; %obj.station.notDeployed = 1; %obj.station.playAudio($DeploySound, MobileBaseStationUndeploySound); if((%turretClient = %obj.turret.getControllingClient()) !$= "") { CommandToServer( 'resetControlObject', %turretClient ); } %obj.turret.setThreadDir($DeployThread, false); %obj.turret.clearTarget(); %obj.turret.setTargetObject(-1); %obj.turret.playAudio($DeploySound, MobileBaseTurretUndeploySound); %obj.shield.open(); %obj.shield.schedule(1000,"delete"); %obj.deploySchedule = ""; %obj.fullyDeployed = 0; %obj.noEnemyControl = 0; } %obj.deployed = 0; // update observers who are following this guy... if( %player.client.observeCount > 0 ) resetObserveFollow( %player.client, false ); } function buildPassengerString(%vehicle) { %passStr = ""; for(%i = 0; %i < %vehicle.getDatablock().numMountPoints; %i++) { if(%vehicle.getMountNodeObject(%i) > 0) %passStr = %passStr @ "1 "; else %passStr = %passStr @ "0 "; } return %passStr; } function MobileBaseVehicle::playerDismounted(%data, %obj, %player) { %obj.schedule(500, "deployVehicle", %data, %player); Parent::playerDismounted( %data, %obj, %player ); } function WheeledVehicle::deployVehicle(%obj, %data, %player) { if (!%data.vehicleDeploy(%obj, %player)) %obj.schedule(500, "deployVehicle", %data, %player); } //************************************************************** //* JERICHO DEPLOYMENT and UNDEPLOYMENT //************************************************************** function MobileBaseVehicle::vehicleDeploy(%data, %obj, %player, %force) { if(VectorLen(%obj.getVelocity()) <= 0.1 || %force) { %deployMessage = ""; if( (%deployMessage = %data.checkTurretDistance(%obj)) $= "" || %force) { if(%obj.station $= "") { if( (%deployMessage = %data.checkDeploy(%obj)) $= "" || %force) { %obj.station = new StaticShape() { scale = "1 1 1"; dataBlock = "MobileInvStation"; lockCount = "0"; homingCount = "0"; team = %obj.team; vehicle = %obj; }; %obj.station.startFade(0,0,true); %obj.mountObject(%obj.station, 2); %obj.station.getDataBlock().createTrigger(%obj.station); %obj.station.setSelfPowered(); %obj.station.playThread($PowerThread,"Power"); %obj.station.playAudio($HumSound,StationHumSound); %obj.station.vehicle = %obj; %obj.turret = new turret() { scale = "1 1 1"; dataBlock = "MobileTurretBase"; lockCount = "0"; homingCount = "0"; team = %obj.team; }; %obj.turret.setDamageLevel(%obj.getDamageLevel()); %obj.mountObject(%obj.turret, 1); %obj.turret.setSelfPowered(); %obj.turret.playThread($PowerThread,"Power"); %obj.turret.mountImage(MissileBarrelLarge, 0 ,false); %obj.beacon = new BeaconObject() { dataBlock = "DeployedBeacon"; position = %obj.position; rotation = %obj.rotation; team = %obj.team; }; %obj.beacon.setBeaconType(friend); %obj.beacon.setTarget(%obj.team); // --------------------------------- // z0dd - ZOD, 5/8/02. Invalid call. //checkSpawnPos(%obj, 20); } } else { %obj.station.setSelfPowered(); %obj.station.playThread($PowerThread,"Power"); %obj.turret.setSelfPowered(); %obj.turret.playThread($PowerThread,"Power"); } if(%deployMessage $= "" || %force) { if(%obj.turret.getTarget() == -1) { %obj.turret.setTarget(%obj.turret.target); } %obj.turret.setThreadDir($DeployThread, true); %obj.turret.playThread($DeployThread,"deploy"); %obj.turret.playAudio($DeploySound, MobileBaseTurretDeploySound); %obj.station.notDeployed = 1; %obj.setThreadDir($DeployThread, true); %obj.playThread($DeployThread,"deploy"); %obj.playAudio($DeploySound, MobileBaseDeploySound); %obj.deployed = 1; %obj.deploySchedule = ""; %obj.disableMove = true; %obj.setFrozenState(true); if(isObject(%obj.shield)) %obj.shield.delete(); %obj.shield = new forceFieldBare() { scale = "1.22 1.8 1.1"; dataBlock = "defaultTeamSlowFieldBare"; team = %obj.team; }; %obj.shield.open(); setTargetSensorData(%obj.getTarget(), MPBDeployedSensor); } } if(%deployMessage !$= "") messageClient(%player.client, '', %deployMessage); return true; } else { return false; } } function MobileBaseVehicle::onEndSequence(%data, %obj, %thread) { if(%thread == $DeployThread && !%obj.deployed) { %obj.unmountObject(%obj.station); %obj.station.trigger.delete(); %obj.station.delete(); %obj.station = ""; %obj.beacon.delete(); %obj.unmountObject(%obj.turret); %obj.turret.delete(); %obj.turret = ""; if(!%obj.immobilized) { %obj.disableMove = false; %obj.setFrozenState(false); } setTargetSensorData(%obj.getTarget(), %data.sensorData); } else { %obj.station.startFade(0,0,false); %obj.station.setThreadDir($DeployThread, true); %obj.station.playThread($DeployThread,"deploy"); %obj.station.playAudio($DeploySound, MobileBaseStationDeploySound); %obj.station.goingOut = true; %obj.shield.setTransform(%obj.getSlotTransform(3)); %obj.shield.close(); %obj.isDeployed = true; %obj.noEnemyControl = 1; } Parent::onEndSequence(%data, %obj, %thread); } function MobileInvStation::onEndSequence(%data, %obj, %thread) { if(!%obj.goingOut) %obj.startFade(0,0,true); else { %obj.notDeployed = 0; %obj.vehicle.fullyDeployed = 1; } Parent::onEndSequence(%data, %obj, %thread); } function MobileBaseVehicle::checkDeploy(%data, %obj) { %mask = $TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::ItemObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::TurretObjectType | //$TypeMasks::StaticTSObjectType | $TypeMasks::InteriorObjectType; //%slot 1 = turret %slot 2 = station %height[1] = 0; %height[2] = 0; %radius[1] = 2.4; %radius[2] = 2.4; %stationFailed = false; %turretFailed = false; for(%x = 1; %x < 3; %x++) { %posXY = getWords(%obj.getSlotTransform(%x), 0, 1); %posZ = (getWord(%obj.getSlotTransform(%x), 2) + %height[%x]); InitContainerRadiusSearch(%posXY @ " " @ %posZ, %radius[%x], %mask); while ((%objFound = ContainerSearchNext()) != 0) { if(%objFound != %obj) { if(%x == 1) %turretFailed = true; else %stationFailed = true; break; } } } //If turret, station or both fail the send back the error message... if(%turretFailed && %stationFailed) return "Both Turret and Station are blocked and unable to deploy."; if(%turretFailed) return "Turret is blocked and unable to deploy."; if(%stationFailed) return "Station is blocked and unable to deploy."; //Check the station for collision with the Terrain %mat = %obj.getTransform(); for(%x = 1; %x < 7; %x+=2) { %startPos = MatrixMulPoint(%mat, %data.stationPoints[%x]); %endPos = MatrixMulPoint(%mat, %data.stationPoints[%x+1]); %rayCastObj = containerRayCast(%startPos, %endPos, $TypeMasks::TerrainObjectType, 0); if(%rayCastObj) return "Station is blocked by terrain and unable to deploy."; } return ""; } function MobileBaseVehicle::checkTurretDistance(%data, %obj) { %pos = getWords(%obj.getTransform(), 0, 2); InitContainerRadiusSearch(%pos, 100, $TypeMasks::TurretObjectType | $TypeMasks::InteriorObjectType); while ((%objFound = ContainerSearchNext()) != 0) { if(%objFound.getType() & $TypeMasks::TurretObjectType) { if(%objFound.getDataBlock().ClassName $= "TurretBase") return "Turret Base is in the area. Unable to deploy."; } else { %subStr = getSubStr(%objFound.interiorFile, 1, 4); if(%subStr !$= "rock" && %subStr !$= "spir" && %subStr !$= "misc") return "Building is in the area. Unable to deploy."; } } return ""; } //************************************************************** //* VEHICLE INVENTORY MANAGEMENT //************************************************************** //-------------------------------------------------------------- // NUMBER OF PURCHASEABLE VEHICLES PER TEAM //-------------------------------------------------------------- $VehicleRespawnTime = 15000; $Vehiclemax[ScoutVehicle] = 4; $VehicleMax[AssaultVehicle] = 3; $VehicleMax[MobileBaseVehicle] = 1; $VehicleMax[ScoutFlyer] = 4; $VehicleMax[BomberFlyer] = 2; $VehicleMax[HAPCFlyer] = 2; function vehicleListRemove(%data, %obj) { %blockName = %data.getName(); for($i = 0; %i < $VehicleMax[%blockName]; %i++) if($VehicleInField[%obj.team, %blockName, %i] == %obj) { $VehicleInField[%obj.team, %blockName, %i] = 0; $VehicleTotalCount[%obj.team, %blockName]--; break; } } function vehicleListAdd(%blockName, %obj) { for($i = 0; %i < $VehicleMax[%blockName]; %i++) { if($VehicleInField[%obj.team, %blockName, %i] $= "" || $VehicleInField[%obj.team, %blockName, %i] == 0) { $VehicleInField[%obj.team, %blockName, %i] = %obj; $VehicleTotalCount[%obj.team, %blockName]++; break; } } } function clearVehicleCount(%team) { $VehicleTotalCount[%team, ScoutVehicle] = 0; $VehicleTotalCount[%team, AssaultVehicle] = 0; $VehicleTotalCount[%team, MobileBaseVehicle] = 0; $VehicleTotalCount[%team, ScoutFlyer] = 0; $VehicleTotalCount[%team, BomberFlyer] = 0; $VehicleTotalCount[%team, HAPCFlyer] = 0; } //************************************************************** //* VEHICLE HUD SEAT INDICATOR LIGHTS //************************************************************** // --------------------------------------------------------- // z0dd - ZOD, 6/18/02. Get the name of the vehicle node and // pass to Armor::onMount and Armor::onDismount in player.cs function findNodeName(%vehicle, %node) { %vName = %vehicle.getDataBlock().getName(); if(%vName !$= "HAPCFlyer") { if(%node == 0) return 'pilot'; else if(%node == 1) return 'gunner'; else return 'tailgunner'; } else { if(%node == 0) return 'pilot'; else if(%node == 1) return 'tailgunner'; else return 'passenger'; } } // End z0dd - ZOD // --------------------------------------------------------- function findAIEmptySeat(%vehicle, %player) { %dataBlock = %vehicle.getDataBlock(); if (%dataBlock.getName() $= "BomberFlyer") %num = 2; else %num = 1; %node = -1; for(%i = %num; %i < %dataBlock.numMountPoints; %i++) { if (!%vehicle.getMountNodeObject(%i)) { //cheap hack - for now, AI's will mount the next available node regardless of where they collided %node = %i; break; } } //return the empty seat return %node; } function findEmptySeat(%vehicle, %player, %forceNode) { %minNode = 1; %node = -1; %dataBlock = %vehicle.getDataBlock(); %dis = %dataBlock.minMountDist; %playerPos = getWords(%player.getTransform(), 0, 2); %message = ""; if(%dataBlock.lightOnly) { if(%player.client.armor $= "Light") %minNode = 0; else %message = '\c2Only Scout Armors can pilot this vehicle.~wfx/misc/misc.error.wav'; } else if(%player.client.armor $= "Light" || %player.client.armor $= "Medium") %minNode = 0; else %minNode = findFirstHeavyNode(%dataBlock); if(%forceNode !$= "") %node = %forceNode; else { for(%i = 0; %i < %dataBlock.numMountPoints; %i++) if(!%vehicle.getMountNodeObject(%i)) { %seatPos = getWords(%vehicle.getSlotTransform(%i), 0, 2); %disTemp = VectorLen(VectorSub(%seatPos, %playerPos)); if(%disTemp <= %dis) { %node = %i; %dis = %disTemp; } } } if(%node != -1 && %node < %minNode) { if(%message $= "") { if(%node == 0) %message = '\c2Only Scout or Assault Armors can pilot this vehicle.~wfx/misc/misc.error.wav'; else %message = '\c2Only Scout or Assault Armors can use that position.~wfx/misc/misc.error.wav'; } if(!%player.noSitMessage) { %player.noSitMessage = true; %player.schedule(2000, "resetSitMessage"); messageClient(%player.client, 'MsgArmorCantMountVehicle', %message); } %node = -1; } return %node; } function findFirstHeavyNode(%data) { for(%i = 0; %i < %data.numMountPoints; %i++) if(%data.mountPose[%i] $= "") return %i; return %data.numMountPoints; } //************************************************************** //* DAMAGE FUNCTIONS //************************************************************** function VehicleData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %theClient, %proj) { if(%proj !$= "") { if(%amount > 0 && %targetObject.lastDamageProj !$= %proj) { %targetObject.lastDamageProj = %proj; %targetObject.lastDamageAmount = %amount; } else if(%targetObject.lastDamageAmount < %amount) %amount = %amount - %targetObject.lastDamageAmount; else return; } // check for team damage %sourceClient = %sourceObject ? %sourceObject.getOwnerClient() : 0; %targetTeam = getTargetSensorGroup(%targetObject.getTarget()); if(%sourceClient) %sourceTeam = %sourceClient.getSensorGroup(); else if(isObject(%sourceObject) && %sourceObject.getClassName() $= "Turret") %sourceTeam = getTargetSensorGroup(%sourceObject.getTarget()); else %sourceTeam = %sourceObject ? getTargetSensorGroup(%sourceObject.getTarget()) : -1; // vehicles no longer obey team damage -JR // if(!$teamDamage && (%targetTeam == %sourceTeam) && %targetObject.getDamagePercent() > 0.5) // return; //but we do want to track the destroyer if(%sourceObject) { %targetObject.lastDamagedBy = %sourceObject; %targetObject.lastDamageType = %damageType; } else %targetObject.lastDamagedBy = 0; // Scale damage type & include shield calculations... if (%data.isShielded) %amount = %data.checkShields(%targetObject, %position, %amount, %damageType); %damageScale = %data.damageScale[%damageType]; if(%damageScale !$= "") %amount *= %damageScale; if(%amount != 0) %targetObject.applyDamage(%amount); if(%targetObject.getDamageState() $= "Destroyed" ) { if( %momVec !$= "") %targetObject.setMomentumVector(%momVec); } } function VehicleData::onImpact(%data, %vehicleObject, %collidedObject, %vec, %vecLen) { if(%vecLen > %data.minImpactSpeed) %data.damageObject(%vehicleObject, 0, VectorAdd(%vec, %vehicleObject.getPosition()), %vecLen * %data.speedDamageScale, $DamageType::Ground); // associated "crash" sounds if(%vecLen > %vDataBlock.hardImpactSpeed) %vehicleObject.playAudio(0, %vDataBlock.hardImpactSound); else if(%vecLen > %vDataBlock.softImpactSpeed) %vehicleObject.playAudio(0, %vDataBlock.softImpactSound); } //************************************************************** //* VEHICLE TIMEOUTS //************************************************************** function vehicleAbandonTimeOut(%vehicle) { if(%vehicle.getDatablock().cantAbandon $= "" && %vehicle.lastPilot $= "") { for(%i = 0; %i < %vehicle.getDatablock().numMountPoints; %i++) if (%vehicle.getMountNodeObject(%i)) { %passenger = %vehicle.getMountNodeObject(%i); if(%passenger.lastVehicle !$= "") schedule(15000, %passenger.lastVehicle,"vehicleAbandonTimeOut", %passenger.lastVehicle); %passenger.lastVehicle = %vehicle; %vehicle.lastPilot = %passenger; return; } if(%vehicle.respawnTime !$= "") %vehicle.marker.schedule = %vehicle.marker.data.schedule(%vehicle.respawnTime, "respawn", %vehicle.marker); %vehicle.mountable = 0; %vehicle.startFade(1000, 0, true); %vehicle.schedule(1001, "delete"); } } //------------------------------------------------------------------------------ function HoverVehicleData::create(%block, %team, %oldObj) { if(%oldObj $= "") { %obj = new HoverVehicle() { dataBlock = %block; respawn = "0"; teamBought = %team; team = %team; }; } else { %obj = new HoverVehicle() { dataBlock = %data; respawn = "0"; teamBought = %team; team = %team; mountable = %oldObj.mountable; disableMove = %oldObj.disableMove; resetPos = %oldObj.resetPos; respawnTime = %oldObj.respawnTime; marker = %oldObj; }; } return(%obj); } function WheeledVehicleData::create(%data, %team, %oldObj) { if(%oldObj $= "") { %obj = new WheeledVehicle() { dataBlock = %data; respawn = "0"; teamBought = %team; team = %team; }; } else { %obj = new WheeledVehicle() { dataBlock = %data; respawn = "0"; teamBought = %team; team = %team; mountable = %oldObj.mountable; disableMove = %oldObj.disableMove; resetPos = %oldObj.resetPos; deployed = %oldObj.deployed; respawnTime = %oldObj.respawnTime; marker = %oldObj; }; } return(%obj); } function FlyingVehicleData::create(%data, %team, %oldObj) { if(%oldObj $= "") { %obj = new FlyingVehicle() { dataBlock = %data; respawn = "0"; teamBought = %team; team = %team; }; } else { %obj = new FlyingVehicle() { dataBlock = %data; teamBought = %team; team = %team; mountable = %oldObj.mountable; disableMove = %oldObj.disableMove; resetPos = %oldObj.resetPos; respawnTime = %oldObj.respawnTime; marker = %oldObj; }; } return(%obj); } function FlyingVehicleData::switchSidesSetPos(%data, %oldObj) { %team = %oldObj.curTeam == 1 ? 2 : 1; %oldObj.curTeam = %team; %obj = new FlyingVehicle() { dataBlock = %data; teamBought = %team; team = %team; mountable = %oldObj.mountable; disableMove = %oldObj.disableMove; resetPos = %oldObj.resetPos; respawnTime = %oldObj.respawnTime; marker = %oldObj; }; %obj.setTransform(%oldObj.getTransform()); return(%obj); } function WheeledVehicleData::switchSidesSetPos(%data, %oldObj) { %team = %oldObj.curTeam == 1 ? 2 : 1; %oldObj.curTeam = %team; %obj = new WheeledVehicle() { dataBlock = %data; respawn = "0"; teamBought = %team; team = %team; mountable = %oldObj.mountable; disableMove = %oldObj.disableMove; resetPos = %oldObj.resetPos; deployed = %oldObj.deployed; respawnTime = %oldObj.respawnTime; marker = %oldObj; }; %obj.setTransform(%oldObj.getTransform()); return(%obj); } function HoverVehicleData::switchSides(%data, %oldObj) { %team = %oldObj.curTeam == 1 ? 2 : 1; %oldObj.curTeam = %team; %obj = new HoverVehicle() { dataBlock = %data; respawn = "0"; teamBought = %team; team = %team; mountable = %oldObj.mountable; disableMove = %oldObj.disableMove; resetPos = %oldObj.resetPos; respawnTime = %oldObj.respawnTime; marker = %oldObj; }; %obj.setTransform(%oldObj.getTransform()); return(%obj); } function resetNonStaticObjPositions() { MissionGroup.setupPositionMarkers(false); MissionCleanup.positionReset(); } function next(%team) { ResetObjsPositions(%team); } function SimGroup::positionReset(%group) { for(%i = %group.getCount() - 1; %i >=0 ; %i--) { %obj = %group.getObject(%i); if(%obj.resetPos && %obj.getName() !$= PosMarker) %obj.delete(); else %obj.positionReset(); } for(%i = 0; %i < %group.getCount(); %i++) { %obj = %group.getObject(%i); if(%obj.getName() $= PosMarker) { cancel(%obj.schedule); %newObj = %obj.data.switchSidesSetPos(%obj); MissionCleanup.add(%newObj); setTargetSensorGroup(%newObj.target, %newObj.team); } else %obj.positionReset(); } } function VehicleData::respawn(%data, %marker) { %mask = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::TurretObjectType; InitContainerRadiusSearch(%marker.getWorldBoxCenter(), %data.checkRadius, %mask); if(containerSearchNext() == 0) { %newObj = %data.create(%marker.curTeam, %marker); %newObj.startFade(1000, 0, false); %newObj.setTransform(%marker.getTransform()); setTargetSensorGroup(%newObj.target, %newObj.team); MissionCleanup.add(%newObj); } else { %marker.schedule = %data.schedule(3000, "respawn", %marker); } } function SimObject::positionReset(%group, %team) { //Used to avoid warnings } function Terraformer::positionReset(%group, %team) { //Used to avoid warnings } function SimGroup::setupPositionMarkers(%group, %create) { for(%i = %group.getCount() - 1; %i >= 0; %i--) { %obj = %group.getObject(%i); if(%obj.resetPos || %obj.respawnTime !$= "") { if(%create) { %marker = %obj.getDataBlock().createPositionMarker(%obj); MissionCleanup.add(%marker); %obj.marker = %marker; } else { %obj.delete(); } } else %obj.setupPositionMarkers(%create); } } function SimObject::setupPositionMarkers(%group, %create) { //Used to avoid warnings } function VehicleData::createPositionMarker(%data, %obj) { %marker = new Trigger(PosMarker) { dataBlock = markerTrigger; mountable = %obj.mountable; disableMove = %obj.disableMove; resetPos = %obj.resetPos; data = %obj.getDataBlock().getName(); deployed = %obj.deployed; curTeam = %obj.team; respawnTime = %obj.respawnTime; }; %marker.setTransform(%obj.getTransform()); return %marker; } function VehicleData::hasDismountOverrides(%data, %obj) { return false; } PK !(j~~"scripts/vehicles/vehicle_bomber.cs//************************************************************** // THUNDERSWORD BOMBER //************************************************************** //************************************************************** // SOUNDS //************************************************************** datablock EffectProfile(BomberFlyerEngineEffect) { effectname = "vehicles/bomber_engine"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(BomberFlyerThrustEffect) { effectname = "vehicles/bomber_boost"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(BomberTurretFireEffect) { effectname = "vehicles/bomber_turret_fire"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(BomberTurretActivateEffect) { effectname = "vehicles/bomber_turret_activate"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(BomberTurretReloadEffect) { effectname = "vehicles/bomber_turret_reload"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(BomberTurretDryFireEffect) { effectname = "vehicles/bomber_turret_dryfire"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(BomberBombReloadEffect) { effectname = "vehicles/bomber_bomb_reload"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(BomberBombDryFireEffect) { effectname = "vehicles/bomber_bomb_dryfire"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(BomberBombFireEffect) { effectname = "weapons/generic_throw"; minDistance = 10.0; maxDistance = 20.0; }; datablock AudioProfile(BomberFlyerEngineSound) { filename = "fx/vehicles/bomber_engine.wav"; description = AudioDefaultLooping3d; preload = true; effect = BomberFlyerEngineEffect; }; datablock AudioProfile(BomberFlyerThrustSound) { filename = "fx/vehicles/bomber_boost.wav"; description = AudioDefaultLooping3d; preload = true; effect = BomberFlyerThrustEffect; }; datablock AudioProfile(FusionExpSound) // Sound played when mortar impacts on target { filename = "fx/powered/turret_mortar_explode.wav"; description = "AudioBIGExplosion3d"; preload = true; }; datablock AudioProfile(BomberTurretFireSound) { filename = "fx/vehicles/bomber_turret_fire.wav"; description = AudioClose3d; preload = true; effect = BomberTurretFireEffect; }; datablock AudioProfile(BomberTurretActivateSound) { filename = "fx/vehicles/bomber_turret_activate.wav"; description = AudioClose3d; preload = true; effect = BomberTurretActivateEffect; }; datablock AudioProfile(BomberTurretReloadSound) { filename = "fx/vehicles/bomber_turret_reload.wav"; description = AudioClose3d; preload = true; effect = BomberTurretReloadEffect; }; datablock AudioProfile(BomberTurretIdleSound) { filename = "fx/misc/diagnostic_on.wav"; description = ClosestLooping3d; preload = true; }; datablock AudioProfile(BomberTurretDryFireSound) { filename = "fx/vehicles/bomber_turret_dryfire.wav"; description = AudioClose3d; preload = true; effect = BomberTurretDryFireEffect; }; datablock AudioProfile(BomberBombReloadSound) { filename = "fx/vehicles/bomber_bomb_reload.wav"; description = AudioClose3d; preload = true; effect = BomberBombReloadEffect; }; datablock AudioProfile(BomberBombProjectileSound) { filename = "fx/vehicles/bomber_bomb_projectile.wav"; description = AudioDefaultLooping3d; preload = true; effect = BomberBombFireEffect; }; datablock AudioProfile(BomberBombDryFireSound) { filename = "fx/vehicles/bomber_bomb_dryfire.wav"; description = AudioClose3d; preload = true; effect = BomberBombDryFireEffect; }; datablock AudioProfile(BomberBombFireSound) { filename = "fx/vehicles/bomber_bomb_reload.wav"; description = AudioClose3d; preload = true; effect = BomberBombFireEffect; }; datablock AudioProfile(BomberBombIdleSound) { filename = "fx/misc/diagnostic_on.wav"; description = ClosestLooping3d; preload = true; }; //************************************************************** // VEHICLE CHARACTERISTICS //************************************************************** datablock FlyingVehicleData(BomberFlyer) : BomberDamageProfile { spawnOffset = "0 0 2"; catagory = "Vehicles"; shapeFile = "vehicle_air_bomber.dts"; multipassenger = true; computeCRC = true; weaponNode = 1; debrisShapeName = "vehicle_air_bomber_debris.dts"; debris = ShapeDebris; renderWhenDestroyed = false; drag = 0.2; density = 1.0; mountPose[0] = sitting; mountPose[1] = sitting; numMountPoints = 3; isProtectedMountPoint[0] = true; isProtectedMountPoint[1] = true; isProtectedMountPoint[2] = true; cameraDefaultFov = 90.0; cameraMinFov = 5.0; cameraMaxFov = 120.0; cameraMaxDist = 22; cameraOffset = 5; cameraLag = 1.0; explosion = LargeAirVehicleExplosion; explosionDamage = 0.5; explosionRadius = 5.0; maxDamage = 2.80; // Total health destroyedLevel = 2.80; // Damage textures show up at this health level isShielded = true; energyPerDamagePoint = 150; maxEnergy = 400; // Afterburner and any energy weapon pool minDrag = 60; // Linear Drag (eventually slows you down when not thrusting...constant drag) rotationalDrag = 1800; // Angular Drag (dampens the drift after you stop moving the mouse...also tumble drag) rechargeRate = 0.8; // Auto stabilize speed maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed. (meters/second) autoAngularForce = 1500; // Angular stabilizer force (this force levels you out when autostabilizer kicks in) autoLinearForce = 300; // Linear stabilzer force (this slows you down when autostabilizer kicks in) autoInputDamping = 0.95; // Dampen control input so you don't whack out at very slow speeds // Maneuvering maxSteeringAngle = 5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable. horizontalSurfaceForce = 5; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning) verticalSurfaceForce = 8; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.) maneuveringForce = 4700; // Horizontal jets (W,S,D,A key thrust) steeringForce = 1100; // Steering jets (force applied when you move the mouse) steeringRollForce = 300; // Steering jets (how much you heel over when you turn) rollForce = 8; // Auto-roll (self-correction to right you after you roll/invert) hoverHeight = 5; // Height off the ground at rest createHoverHeight = 3; // Height off the ground when created maxForwardSpeed = 85; // speed in which forward thrust force is no longer applied (meters/second) // Turbo Jet jetForce = 3000; // Afterburner thrust (this is in addition to normal thrust) minJetEnergy = 40.0; // Afterburner can't be used if below this threshhold. jetEnergyDrain = 3.0; // Energy use of the afterburners (low number is less drain...can be fractional) vertThrustMultiple = 3.0; dustEmitter = LargeVehicleLiftoffDustEmitter; triggerDustHeight = 4.0; dustHeight = 2.0; damageEmitter[0] = LightDamageSmoke; damageEmitter[1] = HeavyDamageSmoke; damageEmitter[2] = DamageBubbles; damageEmitterOffset[0] = "3.0 -3.0 0.0 "; damageEmitterOffset[1] = "-3.0 -3.0 0.0 "; damageLevelTolerance[0] = 0.3; damageLevelTolerance[1] = 0.7; numDmgEmitterAreas = 2; // Rigid body mass = 350; // Mass of the vehicle bodyFriction = 0; // Don't mess with this. bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1) minRollSpeed = 0; // Don't mess with this. softImpactSpeed = 20; // Sound hooks. This is the soft hit. hardImpactSpeed = 25; // Sound hooks. This is the hard hit. // Ground Impact Damage (uses DamageType::Ground) minImpactSpeed = 20; // If hit ground at speed above this then it's an impact. Meters/second speedDamageScale = 0.060; // Object Impact Damage (uses DamageType::Impact) collDamageThresholdVel = 25; collDamageMultiplier = 0.020; // minTrailSpeed = 15; // The speed your contrail shows up at. trailEmitter = ContrailEmitter; forwardJetEmitter = FlyerJetEmitter; downJetEmitter = FlyerJetEmitter; // jetSound = BomberFlyerThrustSound; engineSound = BomberFlyerEngineSound; softImpactSound = SoftImpactSound; hardImpactSound = HardImpactSound; //wheelImpactSound = WheelImpactSound; // softSplashSoundVelocity = 15.0; mediumSplashSoundVelocity = 20.0; hardSplashSoundVelocity = 30.0; exitSplashSoundVelocity = 10.0; exitingWater = VehicleExitWaterHardSound; impactWaterEasy = VehicleImpactWaterSoftSound; impactWaterMedium = VehicleImpactWaterMediumSound; impactWaterHard = VehicleImpactWaterHardSound; waterWakeSound = VehicleWakeHardSplashSound; minMountDist = 4; splashEmitter[0] = VehicleFoamDropletsEmitter; splashEmitter[1] = VehicleFoamEmitter; shieldImpact = VehicleShieldImpact; cmdCategory = "Tactical"; cmdIcon = CMDFlyingBomberIcon; cmdMiniIconName = "commander/MiniIcons/com_bomber_grey"; targetNameTag = 'Thundersword'; targetTypeTag = 'Bomber'; sensorData = VehiclePulseSensor; checkRadius = 7.1895; observeParameters = "1 10 10"; shieldEffectScale = "0.75 0.975 0.375"; showPilotInfo = 1; }; //************************************************************** // WEAPONS //************************************************************** //------------------------------------- // BOMBER BELLY TURRET GUN (projectile) //------------------------------------- datablock ShockwaveData(BomberFusionShockwave) { width = 0.5; numSegments = 13; numVertSegments = 1; velocity = 0.5; acceleration = 2.0; lifetimeMS = 900; height = 0.1; verticalCurve = 0.5; mapToTerrain = false; renderBottom = false; orientToNormal = true; texture[0] = "special/shockwave5"; texture[1] = "special/gradient"; texWrap = 3.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; colors[0] = "0.6 0.6 1.0 1.0"; colors[1] = "0.6 0.3 1.0 0.5"; colors[2] = "0.0 0.0 1.0 0.0"; }; datablock ParticleData(BomberFusionExplosionParticle1) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent4"; colors[0] = "0.6 0.6 1.0 1.0"; colors[1] = "0.6 0.3 1.0 1.0"; colors[2] = "0.0 0.0 1.0 0.0"; sizes[0] = 0.25; sizes[1] = 0.5; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(BomberFusionExplosionEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 2; velocityVariance = 1.5; ejectionOffset = 0.0; thetaMin = 80; thetaMax = 90; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "BomberFusionExplosionParticle1"; }; datablock ExplosionData(BomberFusionBoltExplosion) { soundProfile = blasterExpSound; shockwave = BomberFusionShockwave; emitter[0] = BomberFusionExplosionEmitter; }; datablock LinearFlareProjectileData(BomberFusionBolt) { projectileShapeName = ""; directDamage = 0.35; directDamageType = $DamageType::BellyTurret; hasDamageRadius = false; explosion = BomberFusionBoltExplosion; sound = BlasterProjectileSound; dryVelocity = 200.0; wetVelocity = 200.0; velInheritFactor = 1.0; fizzleTimeMS = 2000; lifetimeMS = 3000; explodeOnDeath = false; reflectOnWaterImpactAngle = 0.0; explodeOnWaterImpact = true; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = -1; activateDelayMS = 100; numFlares = 0; size = 0.15; flareColor = "0.7 0.3 1.0"; flareModTexture = "flaremod"; flareBaseTexture = "flarebase"; }; //------------------------------------- // BOMBER BELLY TURRET CHARACTERISTICS //------------------------------------- datablock TurretData(BomberTurret) : TurretDamageProfile { className = VehicleTurret; catagory = "Turrets"; shapeFile = "turret_belly_base.dts"; preload = true; mass = 1.0; // Not really relevant repairRate = 0; maxDamage = BomberFlyer.maxDamage; destroyedLevel = BomberFlyer.destroyedLevel; thetaMin = 90; thetaMax = 180; // capacitor maxCapacitorEnergy = 250; capacitorRechargeRate = 0.8; inheritEnergyFromMount = true; firstPersonOnly = true; useEyePoint = true; numWeapons = 3; targetNameTag = 'Thundersword Belly'; targetTypeTag = 'Turret'; }; datablock TurretImageData(BomberTurretBarrel) { shapeFile = "turret_belly_barrell.dts"; mountPoint = 0; projectile = BomberFusionBolt; projectileType = LinearFlareProjectile; usesEnergy = true; useCapacitor = true; useMountEnergy = true; fireEnergy = 16.0; minEnergy = 16.0; // Turret parameters activationMS = 1000; deactivateDelayMS = 1500; thinkTimeMS = 200; degPerSecTheta = 360; degPerSecPhi = 360; attackRadius = 75; // State transitions stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "WaitFire1"; stateTimeoutValue[0] = 0.5; stateSequence[0] = "Activate"; stateSound[0] = BomberTurretActivateSound; stateName[1] = "WaitFire1"; stateTransitionOnTriggerDown[1] = "Fire1"; stateTransitionOnNoAmmo[1] = "NoAmmo1"; stateName[2] = "Fire1"; stateTransitionOnTimeout[2] = "Reload1"; stateTimeoutValue[2] = 0.13; stateFire[2] = true; stateRecoil[2] = LightRecoil; stateAllowImageChange[2] = false; stateSequence[2] = "Fire"; stateScript[2] = "onFire"; stateSound[2] = BomberTurretFireSound; stateName[3] = "Reload1"; stateSequence[3] = "Reload"; stateTimeoutValue[3] = 0.1; stateAllowImageChange[3] = false; stateTransitionOnTimeout[3] = "WaitFire2"; stateTransitionOnNoAmmo[3] = "NoAmmo1"; stateName[4] = "NoAmmo1"; stateTransitionOnAmmo[4] = "Reload1"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //stateSequence[4] = "NoAmmo"; stateSequence[4] = "NoAmmo1"; stateTransitionOnTriggerDown[4] = "DryFire1"; stateName[5] = "DryFire1"; stateSound[5] = BomberTurretDryFireSound; stateTimeoutValue[5] = 0.5; stateTransitionOnTimeout[5] = "NoAmmo1"; stateName[6] = "WaitFire2"; stateTransitionOnTriggerDown[6] = "Fire2"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //stateTransitionOnNoAmmo[6] = "NoAmmo"; stateTransitionOnNoAmmo[6] = "NoAmmo2"; stateName[7] = "Fire2"; stateTransitionOnTimeout[7] = "Reload2"; stateTimeoutValue[7] = 0.13; stateScript[7] = "FirePair"; stateName[8] = "Reload2"; stateSequence[8] = "Reload"; stateTimeoutValue[8] = 0.1; stateAllowImageChange[8] = false; stateTransitionOnTimeout[8] = "WaitFire1"; stateTransitionOnNoAmmo[8] = "NoAmmo2"; stateName[9] = "NoAmmo2"; stateTransitionOnAmmo[9] = "Reload2"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //stateSequence[9] = "NoAmmo"; stateSequence[9] = "NoAmmo2"; stateTransitionOnTriggerDown[9] = "DryFire2"; stateName[10] = "DryFire2"; stateSound[10] = BomberTurretDryFireSound; stateTimeoutValue[10] = 0.5; stateTransitionOnTimeout[10] = "NoAmmo2"; }; datablock TurretImageData(BomberTurretBarrelPair) { shapeFile = "turret_belly_barrelr.dts"; mountPoint = 1; projectile = BomberFusionBolt; projectileType = LinearFlareProjectile; usesEnergy = true; useCapacitor = true; useMountEnergy = true; fireEnergy = 16.0; minEnergy = 16.0; // Turret parameters activationMS = 1000; deactivateDelayMS = 1500; thinkTimeMS = 200; degPerSecTheta = 360; degPerSecPhi = 360; attackRadius = 75; stateName[0] = "WaitFire"; stateTransitionOnTriggerDown[0] = "Fire"; stateName[1] = "Fire"; stateTransitionOnTimeout[1] = "StopFire"; stateTimeoutValue[1] = 0.13; stateFire[1] = true; stateRecoil[1] = LightRecoil; stateAllowImageChange[1] = false; stateSequence[1] = "Fire"; stateScript[1] = "onFire"; stateSound[1] = BomberTurretFireSound; stateName[2] = "StopFire"; stateTimeoutValue[2] = 0.1; stateTransitionOnTimeout[2] = "WaitFire"; stateScript[2] = "stopFire"; }; datablock TurretImageData(AIAimingTurretBarrel) { shapeFile = "turret_muzzlepoint.dts"; mountPoint = 3; projectile = BomberFusionBolt; // Turret parameters activationMS = 1000; deactivateDelayMS = 1500; thinkTimeMS = 200; degPerSecTheta = 500; degPerSecPhi = 800; attackRadius = 75; }; //------------------------------------- // BOMBER BOMB PROJECTILE //------------------------------------- datablock BombProjectileData(BomberBomb) { projectileShapeName = "bomb.dts"; emitterDelay = -1; directDamage = 0.0; hasDamageRadius = true; indirectDamage = 1.1; damageRadius = 30; radiusDamageType = $DamageType::BomberBombs; kickBackStrength = 2500; explosion = "VehicleBombExplosion"; velInheritFactor = 1.0; grenadeElasticity = 0.25; grenadeFriction = 0.4; armingDelayMS = 2000; muzzleVelocity = 0.1; drag = 0.3; minRotSpeed = "60.0 0.0 0.0"; maxRotSpeed = "80.0 0.0 0.0"; scale = "1.0 1.0 1.0"; sound = BomberBombProjectileSound; }; //------------------------------------- // BOMBER BOMB CHARACTERISTICS //------------------------------------- datablock ItemData(BombAmmo) { className = Ammo; catagory = "Ammo"; shapeFile = "repair_kit.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 1; computeCRC = true; }; datablock StaticShapeData(DropBombs) { catagory = "Turrets"; shapeFile = "bombers_eye.dts"; maxDamage = 1.0; disabledLevel = 0.6; destroyedLevel = 0.8; }; datablock TurretImageData(BomberBombImage) { shapeFile = "turret_muzzlepoint.dts"; offset = "2 -4 -0.5"; mountPoint = 10; projectile = BomberBomb; projectileType = BombProjectile; usesEnergy = true; useMountEnergy = true; useCapacitor = true; fireEnergy = 53.0; minEnergy = 53.0; stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "WaitFire1"; stateTimeoutValue[0] = 0.5; stateSequence[0] = "Activate"; stateName[1] = "WaitFire1"; stateTransitionOnTriggerDown[1] = "Fire1"; stateTransitionOnNoAmmo[1] = "NoAmmo1"; stateName[2] = "Fire1"; stateTransitionOnTimeout[2] = "Reload1"; stateTimeoutValue[2] = 0.32; stateFire[2] = true; stateAllowImageChange[2] = false; stateSequence[2] = "Fire"; stateScript[2] = "onFire"; stateSound[2] = BomberBombFireSound; stateName[3] = "Reload1"; stateSequence[3] = "Reload"; stateTimeoutValue[3] = 0.1; stateAllowImageChange[3] = false; stateTransitionOnTimeout[3] = "WaitFire2"; stateTransitionOnNoAmmo[3] = "NoAmmo1"; stateName[4] = "NoAmmo1"; stateTransitionOnAmmo[4] = "Reload1"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //stateSequence[4] = "NoAmmo"; stateSequence[4] = "NoAmmo1"; stateTransitionOnTriggerDown[4] = "DryFire1"; stateName[5] = "DryFire1"; stateSound[5] = BomberBombDryFireSound; stateTimeoutValue[5] = 0.5; stateTransitionOnTimeout[5] = "NoAmmo1"; stateName[6] = "WaitFire2"; stateTransitionOnTriggerDown[6] = "Fire2"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //stateTransitionOnNoAmmo[6] = "NoAmmo"; stateTransitionOnNoAmmo[6] = "NoAmmo2"; stateName[7] = "Fire2"; stateTransitionOnTimeout[7] = "Reload2"; stateTimeoutValue[7] = 0.32; stateScript[7] = "FirePair"; stateName[8] = "Reload2"; stateSequence[8] = "Reload"; stateTimeoutValue[8] = 0.1; stateAllowImageChange[8] = false; stateTransitionOnTimeout[8] = "WaitFire1"; stateTransitionOnNoAmmo[8] = "NoAmmo2"; stateName[9] = "NoAmmo2"; stateTransitionOnAmmo[9] = "Reload2"; // --------------------------------------------- // z0dd - ZOD, 5/8/02. Incorrect parameter value //stateSequence[9] = "NoAmmo"; stateSequence[9] = "NoAmmo2"; stateTransitionOnTriggerDown[9] = "DryFire2"; stateName[10] = "DryFire2"; stateSound[10] = BomberBombDryFireSound; stateTimeoutValue[10] = 0.5; stateTransitionOnTimeout[10] = "NoAmmo2"; }; datablock TurretImageData(BomberBombPairImage) { shapeFile = "turret_muzzlepoint.dts"; offset = "-2 -4 -0.5"; mountPoint = 10; projectile = BomberBomb; projectileType = BombProjectile; usesEnergy = true; useMountEnergy = true; useCapacitor = true; fireEnergy = 53.0; minEnergy = 53.0; stateName[0] = "WaitFire"; stateTransitionOnTriggerDown[0] = "Fire"; stateName[1] = "Fire"; stateTransitionOnTimeout[1] = "StopFire"; stateTimeoutValue[1] = 0.13; stateFire[1] = true; stateAllowImageChange[1] = false; stateSequence[1] = "Fire"; stateScript[1] = "onFire"; stateSound[1] = BomberBombFireSound; stateName[2] = "StopFire"; stateTimeoutValue[2] = 0.1; stateTransitionOnTimeout[2] = "WaitFire"; stateScript[2] = "stopFire"; }; //************************************************************** // WEAPONS SPECIAL EFFECTS //************************************************************** //------------------------------------- // BOMBER BELLY TURRET GUN (explosion) //------------------------------------- datablock ParticleData(FusionExplosionParticle) { dragCoefficient = 2; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 750; lifetimeVarianceMS = 150; textureName = "particleTest"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 0.0"; sizes[0] = 1; sizes[1] = 2; }; datablock ParticleEmitterData(FusionExplosionEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 12; velocityVariance = 1.75; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 60; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "FusionExplosionParticle"; }; datablock ExplosionData(FusionBoltExplosion) { explosionShape = "effect_plasma_explosion.dts"; soundProfile = FusionExpSound; particleEmitter = FusionExplosionEmitter; particleDensity = 250; particleRadius = 1.25; faceViewer = true; }; //-------------------------------------------------------------------------- // BOMBER TARGETING LASER //-------------------------------------------------------------------------- datablock AudioProfile(BomberTargetingSwitchSound) { filename = "fx/weapons/generic_switch.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(BomberTargetingPaintSound) { filename = "fx/weapons/targetinglaser_paint.wav"; description = CloseLooping3d; preload = true; }; //-------------------------------------- // BOMBER TARGETING PROJECTILE //-------------------------------------- datablock TargetProjectileData(BomberTargeter) { directDamage = 0.0; hasDamageRadius = false; indirectDamage = 0.0; damageRadius = 0.0; velInheritFactor = 1.0; maxRifleRange = 1000; beamColor = "0.1 1.0 0.1"; startBeamWidth = 0.20; pulseBeamWidth = 0.15; beamFlareAngle = 3.0; minFlareSize = 0.0; maxFlareSize = 400.0; pulseSpeed = 6.0; pulseLength = 0.150; textureName[0] = "special/nonlingradient"; textureName[1] = "special/flare"; textureName[2] = "special/pulse"; textureName[3] = "special/expFlare"; }; //------------------------------------- // BOMBER TARGETING CHARACTERISTICS //------------------------------------- datablock ShapeBaseImageData(BomberTargetingImage) { className = WeaponImage; shapeFile = "turret_muzzlepoint.dts"; offset = "0 -0.04 -0.01"; mountPoint = 2; projectile = BomberTargeter; projectileType = TargetProjectile; deleteLastProjectile = true; usesEnergy = true; minEnergy = 3; stateName[0] = "Activate"; stateSequence[0] = "Activate"; stateSound[0] = BomberTargetingSwitchSound; stateTimeoutValue[0] = 0.5; stateTransitionOnTimeout[0] = "ActivateReady"; stateName[1] = "ActivateReady"; stateTransitionOnAmmo[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "Fire"; stateName[3] = "Fire"; stateEnergyDrain[3] = 3; stateFire[3] = true; stateAllowImageChange[3] = false; stateScript[3] = "onFire"; stateTransitionOnTriggerUp[3] = "Deconstruction"; stateTransitionOnNoAmmo[3] = "Deconstruction"; stateSound[3] = BomberTargetingPaintSound; stateName[4] = "NoAmmo"; stateTransitionOnAmmo[4] = "Ready"; stateName[5] = "Deconstruction"; stateTransitionOnTimeout[5] = "ActivateReady"; stateTimeoutValue[5] = 0.05; }; function BomberTargetingImage::onFire(%data,%obj,%slot) { %bomber = %obj.getObjectMount(); if(%bomber.beacon) { %bomber.beacon.delete(); %bomber.beacon = ""; } %p = Parent::onFire(%data, %obj, %slot); %p.setTarget(%obj.team); } function BomberTargetingImage::deconstruct(%data, %obj, %slot) { %pos = %obj.lastProjectile.getTargetPoint(); %bomber = %obj.getObjectMount(); if(%bomber.beacon) { %bomber.beacon.delete(); %bomber.beacon = ""; } %bomber.beacon = new BeaconObject() { dataBlock = "BomberBeacon"; beaconType = "vehicle"; position = %pos; }; %bomber.beacon.playThread($AmbientThread, "ambient"); %bomber.beacon.team = %bomber.team; %bomber.beacon.sourceObject = %bomber; // give it a team target %bomber.beacon.setTarget(%bomber.team); MissionCleanup.add(%bomber.beacon); Parent::deconstruct(%data, %obj, %slot); } //------------------------------------- // BOMBER BEACON //------------------------------------- datablock StaticShapeData(BomberBeacon) { shapeFile = "turret_muzzlepoint.dts"; targetNameTag = 'beacon'; isInvincible = true; dynamicType = $TypeMasks::SensorObjectType; }; PK !(ǹ!scripts/vehicles/vehicle_havoc.cs//************************************************************** // HAVOC HEAVY TRANSPORT FLIER //************************************************************** //************************************************************** // SOUNDS //************************************************************** datablock EffectProfile(HAPCFlyerEngineEffect) { effectname = "vehicles/htransport_thrust"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(HAPCFlyerThrustEffect) { effectname = "vehicles/htransport_boost"; minDistance = 5.0; maxDistance = 10.0; }; datablock AudioProfile(HAPCFlyerEngineSound) { filename = "fx/vehicles/htransport_thrust.wav"; description = AudioDefaultLooping3d; effect = HAPCFlyerEngineEffect; }; datablock AudioProfile(HAPCFlyerThrustSound) { filename = "fx/vehicles/htransport_boost.wav"; description = AudioDefaultLooping3d; effect = HAPCFlyerThrustEffect; }; //************************************************************** // VEHICLE CHARACTERISTICS //************************************************************** datablock FlyingVehicleData(HAPCFlyer) : HavocDamageProfile { spawnOffset = "0 0 6"; renderWhenDestroyed = false; catagory = "Vehicles"; shapeFile = "vehicle_air_hapc.dts"; multipassenger = true; computeCRC = true; debrisShapeName = "vehicle_air_hapc_debris.dts"; debris = ShapeDebris; drag = 0.2; density = 1.0; mountPose[0] = sitting; // mountPose[1] = sitting; numMountPoints = 6; isProtectedMountPoint[0] = true; isProtectedMountPoint[1] = true; isProtectedMountPoint[2] = true; isProtectedMountPoint[3] = true; isProtectedMountPoint[4] = true; isProtectedMountPoint[5] = true; cameraMaxDist = 17; cameraOffset = 2; cameraLag = 8.5; explosion = LargeAirVehicleExplosion; explosionDamage = 0.5; explosionRadius = 5.0; maxDamage = 3.50; destroyedLevel = 3.50; isShielded = true; rechargeRate = 0.8; energyPerDamagePoint = 200; maxEnergy = 550; minDrag = 100; // Linear Drag rotationalDrag = 2700; // Anguler Drag // Auto stabilize speed maxAutoSpeed = 10; autoAngularForce = 3000; // Angular stabilizer force autoLinearForce = 450; // Linear stabilzer force autoInputDamping = 0.95; // // Maneuvering maxSteeringAngle = 8; horizontalSurfaceForce = 10; // Horizontal center "wing" verticalSurfaceForce = 10; // Vertical center "wing" maneuveringForce = 6000; // Horizontal jets steeringForce = 1000; // Steering jets steeringRollForce = 400; // Steering jets rollForce = 12; // Auto-roll hoverHeight = 8; // Height off the ground at rest createHoverHeight = 6; // Height off the ground when created maxForwardSpeed = 71; // speed in which forward thrust force is no longer applied (meters/second) // Turbo Jet jetForce = 5000; minJetEnergy = 55; jetEnergyDrain = 3.6; vertThrustMultiple = 3.0; dustEmitter = LargeVehicleLiftoffDustEmitter; triggerDustHeight = 4.0; dustHeight = 2.0; damageEmitter[0] = LightDamageSmoke; damageEmitter[1] = HeavyDamageSmoke; damageEmitter[2] = DamageBubbles; damageEmitterOffset[0] = "3.0 -3.0 0.0 "; damageEmitterOffset[1] = "-3.0 -3.0 0.0 "; damageLevelTolerance[0] = 0.3; damageLevelTolerance[1] = 0.7; numDmgEmitterAreas = 2; // Rigid body mass = 550; bodyFriction = 0; bodyRestitution = 0.3; minRollSpeed = 0; softImpactSpeed = 12; // Sound hooks. This is the soft hit. hardImpactSpeed = 15; // Sound hooks. This is the hard hit. // Ground Impact Damage (uses DamageType::Ground) minImpactSpeed = 25; // If hit ground at speed above this then it's an impact. Meters/second speedDamageScale = 0.060; // Object Impact Damage (uses DamageType::Impact) collDamageThresholdVel = 28; collDamageMultiplier = 0.020; // minTrailSpeed = 15; trailEmitter = ContrailEmitter; forwardJetEmitter = FlyerJetEmitter; downJetEmitter = FlyerJetEmitter; // jetSound = HAPCFlyerThrustSound; engineSound = HAPCFlyerEngineSound; softImpactSound = SoftImpactSound; hardImpactSound = HardImpactSound; //wheelImpactSound = WheelImpactSound; // softSplashSoundVelocity = 5.0; mediumSplashSoundVelocity = 8.0; hardSplashSoundVelocity = 12.0; exitSplashSoundVelocity = 8.0; exitingWater = VehicleExitWaterHardSound; impactWaterEasy = VehicleImpactWaterSoftSound; impactWaterMedium = VehicleImpactWaterMediumSound; impactWaterHard = VehicleImpactWaterHardSound; waterWakeSound = VehicleWakeHardSplashSound; minMountDist = 4; splashEmitter[0] = VehicleFoamDropletsEmitter; splashEmitter[1] = VehicleFoamEmitter; shieldImpact = VehicleShieldImpact; cmdCategory = "Tactical"; cmdIcon = CMDFlyingHAPCIcon; cmdMiniIconName = "commander/MiniIcons/com_hapc_grey"; targetNameTag = 'Havoc'; targetTypeTag = 'Heavy Transport'; sensorData = VehiclePulseSensor; checkRadius = 7.8115; observeParameters = "1 15 15"; stuckTimerTicks = 32; // If the hapc spends more than 1 sec in contact with something stuckTimerAngle = 80; // with a > 80 deg. pitch, BOOM! shieldEffectScale = "1.0 0.9375 0.45"; }; function HAPCFlyer::hasDismountOverrides(%data, %obj) { return true; } function HAPCFlyer::getDismountOverride(%data, %obj, %mounted) { %node = -1; for (%i = 0; %i < %data.numMountPoints; %i++) { if (%obj.getMountNodeObject(%i) == %mounted) { %node = %i; break; } } if (%node == -1) { warning("Couldn't find object mount point"); return "0 0 1"; } if (%node == 3 || %node == 2) { return "-1 0 1"; } else if (%node == 5 || %node == 4) { return "1 0 1"; } else { return "0 0 1"; } } //************************************************************** // WEAPONS //************************************************************** PK !(L<2scripts/vehicles/vehicle_mpb.cs//************************************************************** // JERICHO FORWARD BASE (Mobile Point Base) //************************************************************** //************************************************************** // SOUNDS //************************************************************** datablock EffectProfile(MPBEngineEffect) { effectname = "vehicles/mpb_thrust"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(MPBThrustEffect) { effectname = "vehicles/mpb_boost"; minDistance = 5.0; maxDistance = 10.0; }; datablock AudioProfile(MPBEngineSound) { filename = "fx/vehicles/mpb_thrust.wav"; description = AudioDefaultLooping3d; preload = true; effect = MPBEngineEffect; }; datablock AudioProfile(MPBThrustSound) { filename = "fx/vehicles/mpb_boost.wav"; description = AudioDefaultLooping3d; preload = true; effect = MPBThrustEffect; }; datablock AudioProfile(MobileBaseDeploySound) { filename = "fx/vehicles/MPB_deploy.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(MobileBaseUndeploySound) { filename = "fx/vehicles/MPB_undeploy_turret.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(MobileBaseTurretDeploySound) { filename = "fx/vehicles/MPB_deploy_turret.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(MobileBaseTurretUndeploySound) { filename = "fx/vehicles/MPB_undeploy_turret.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(MobileBaseStationDeploySound) { filename = "fx/vehicles/MPB_deploy_station.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(MobileBaseStationUndeploySound) { filename = "fx/vehicles/MPB_close_lid.wav"; description = AudioClose3d; preload = true; }; //************************************************************** // LIGHTS //************************************************************** datablock RunningLightData(MPBLight1) { pointSize = 3.0; pointColor = "1.0 1.0 1.0 0.3"; pointNodeName = "Headlight_node01"; texture = "special/expFlare"; }; datablock RunningLightData(MPBLight2) { pointSize = 3.0; pointColor = "1.0 1.0 1.0 0.3"; pointNodeName = "Headlight_node02"; texture = "special/expFlare"; }; //************************************************************** // VEHICLE CHARACTERISTICS //************************************************************** datablock SensorData(MPBDeployedSensor) : VehiclePulseSensor { jams = true; jamsOnlyGroup = true; jamsUsingLOS = false; jamRadius = 50; }; datablock WheeledVehicleData(MobileBaseVehicle) : MPBDamageProfile { spawnOffset = "0 0 1.0"; renderWhenDestroyed = false; catagory = "Vehicles"; shapeFile = "vehicle_land_mpbase.dts"; multipassenger = false; computeCRC = true; debrisShapeName = "vehicle_land_mpbase_debris.dts"; debris = ShapeDebris; drag = 0.0; density = 20.0; mountPose[0] = sitting; numMountPoints = 1; isProtectedMountPoint[0] = true; cantAbandon = 1; cantTeamSwitch = 1; cameraMaxDist = 20; cameraOffset = 6; cameraLag = 1.5; explosion = LargeGroundVehicleExplosion; explosionDamage = 0.5; explosionRadius = 5.0; maxSteeringAngle = 0.3; // 20 deg. // Used to test if the station can deploy stationPoints[1] = "-2.3 -7.38703 -0.65"; stationPoints[2] = "-2.3 -11.8 -0.65"; stationPoints[3] = "0 -7.38703 -0.65"; stationPoints[4] = "0 -11.8 -0.65"; stationPoints[5] = "2.3 -7.38703 -0.65"; stationPoints[6] = "2.3 -11.8 -0.65"; // Rigid Body mass = 2000; bodyFriction = 0.8; bodyRestitution = 0.5; minRollSpeed = 3; gyroForce = 400; gyroDamping = 0.3; stabilizerForce = 10; minDrag = 10; softImpactSpeed = 15; // Play SoftImpact Sound hardImpactSpeed = 25; // Play HardImpact Sound // Ground Impact Damage (uses DamageType::Ground) minImpactSpeed = 12; speedDamageScale = 0.060; // Object Impact Damage (uses DamageType::Impact) collDamageThresholdVel = 18; collDamageMultiplier = 0.070; // Engine engineTorque = 7.0 * 745; breakTorque = 7.0 * 745; maxWheelSpeed = 20; // Springs springForce = 8000; springDamping = 1300; antiSwayForce = 6000; staticLoadScale = 2; // Tires tireRadius = 1.6; tireFriction = 10.0; tireRestitution = 0.5; tireLateralForce = 3000; tireLateralDamping = 400; tireLateralRelaxation = 1; tireLongitudinalForce = 12000; tireLongitudinalDamping = 600; tireLongitudinalRelaxation = 1; tireEmitter = TireEmitter; // maxDamage = 3.85; destroyedLevel = 3.85; isShielded = true; energyPerDamagePoint = 125; maxEnergy = 600; jetForce = 2800; minJetEnergy = 60; jetEnergyDrain = 2.75; rechargeRate = 1.0; jetSound = MPBThrustSound; engineSound = MPBEngineSound; squeelSound = AssaultVehicleSkid; softImpactSound = GravSoftImpactSound; hardImpactSound = HardImpactSound; //wheelImpactSound = WheelImpactSound; // softSplashSoundVelocity = 5.0; mediumSplashSoundVelocity = 8.0; hardSplashSoundVelocity = 12.0; exitSplashSoundVelocity = 8.0; exitingWater = VehicleExitWaterSoftSound; impactWaterEasy = VehicleImpactWaterSoftSound; impactWaterMedium = VehicleImpactWaterMediumSound; impactWaterHard = VehicleImpactWaterHardSound; waterWakeSound = VehicleWakeMediumSplashSound; minMountDist = 3; damageEmitter[0] = LightDamageSmoke; damageEmitter[1] = HeavyDamageSmoke; damageEmitter[2] = DamageBubbles; damageEmitterOffset[0] = "3.0 0.5 0.0 "; damageEmitterOffset[1] = "-3.0 0.5 0.0 "; damageLevelTolerance[0] = 0.3; damageLevelTolerance[1] = 0.7; numDmgEmitterAreas = 2; splashEmitter[0] = VehicleFoamDropletsEmitter; splashEmitter[1] = VehicleFoamEmitter; shieldImpact = VehicleShieldImpact; cmdCategory = "Tactical"; cmdIcon = CMDGroundMPBIcon; cmdMiniIconName = "commander/MiniIcons/com_mpb_grey"; targetNameTag = 'Jericho'; targetTypeTag = 'MPB'; sensorData = VehiclePulseSensor; checkRadius = 7.5225; observeParameters = "1 12 12"; runningLight[0] = MPBLight1; runningLight[1] = MPBLight2; shieldEffectScale = "0.85 1.2 0.7"; }; //************************************************************** // WEAPONS //************************************************************** datablock SensorData(MPBTurretMissileSensor) { detects = true; detectsUsingLOS = true; detectsPassiveJammed = false; detectsActiveJammed = false; detectsCloaked = false; detectionPings = true; detectRadius = 200; }; datablock TurretData(MobileTurretBase) { className = VehicleTurret; catagory = "Turrets"; shapeFile = "turret_base_mpb.dts"; preload = true; mass = 1.0; // Not really relevant maxDamage = MobileBaseVehicle.maxDamage; destroyedLevel = MobileBaseVehicle.destroyedLevel; thetaMin = 15; thetaMax = 140; energyPerDamagePoint = 33; inheritEnergyFromMount = true; firstPersonOnly = true; sensorColor = "0 212 45"; sensorData = MPBTurretMissileSensor; sensorRadius = MPBTurretMissileSensor.detectRadius; cmdCategory = "Tactical"; cmdMiniIconName = "commander/MiniIcons/com_turret_grey"; targetNameTag = 'Jericho'; targetTypeTag = 'Turret'; canControl = true; }; PK !($z.."scripts/vehicles/vehicle_shrike.cs//************************************************************** // SHRIKE SCOUT FLIER //************************************************************** //************************************************************** // SOUNDS //************************************************************** datablock EffectProfile(ScoutFlyerThrustEffect) { effectname = "vehicles/shrike_boost"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(ScoutFlyerEngineEffect) { effectname = "vehicles/shrike_engine"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(ShrikeBlasterFireEffect) { effectname = "vehicles/shrike_blaster"; minDistance = 5.0; maxDistance = 10.0; }; datablock AudioProfile(ScoutFlyerThrustSound) { filename = "fx/vehicles/shrike_boost.wav"; description = AudioDefaultLooping3d; preload = true; effect = ScoutFlyerThrustEffect; }; datablock AudioProfile(ScoutFlyerEngineSound) { filename = "fx/vehicles/shrike_engine.wav"; description = AudioDefaultLooping3d; preload = true; }; datablock AudioProfile(ShrikeBlasterFire) { filename = "fx/vehicles/shrike_blaster.wav"; description = AudioDefault3d; preload = true; effect = ScoutFlyerEngineEffect; }; datablock AudioProfile(ShrikeBlasterProjectile) { filename = "fx/weapons/shrike_blaster_projectile.wav"; description = ProjectileLooping3d; preload = true; effect = ShrikeBlasterFireEffect; }; datablock AudioProfile(ShrikeBlasterDryFireSound) { filename = "fx/weapons/chaingun_dryfire.wav"; description = AudioClose3d; preload = true; }; //************************************************************** // LIGHTS //************************************************************** datablock RunningLightData(ShrikeLight1) { type = 1; radius = 2.0; length = 3.0; color = "1.0 1.0 1.0 1.0"; direction = "0.0 1.0 -1.0 "; offset = "0.0 0.0 -0.5"; texture = "special/lightcone04"; }; datablock RunningLightData(ShrikeLight2) { radius = 1.5; color = "1.0 1.0 1.0 0.3"; direction = "0.0 0.0 -1.0"; offset = "0.0 0.8 -1.2"; texture = "special/headlight4"; }; //************************************************************** // VEHICLE CHARACTERISTICS //************************************************************** datablock FlyingVehicleData(ScoutFlyer) : ShrikeDamageProfile { spawnOffset = "0 0 2"; catagory = "Vehicles"; shapeFile = "vehicle_air_scout.dts"; multipassenger = false; computeCRC = true; debrisShapeName = "vehicle_air_scout_debris.dts"; debris = ShapeDebris; renderWhenDestroyed = false; drag = 0.15; density = 1.0; mountPose[0] = sitting; numMountPoints = 1; isProtectedMountPoint[0] = true; cameraMaxDist = 15; cameraOffset = 2.5; cameraLag = 0.9; explosion = VehicleExplosion; explosionDamage = 0.5; explosionRadius = 5.0; maxDamage = 1.40; destroyedLevel = 1.40; isShielded = true; energyPerDamagePoint = 160; maxEnergy = 280; // Afterburner and any energy weapon pool rechargeRate = 0.8; minDrag = 30; // Linear Drag (eventually slows you down when not thrusting...constant drag) rotationalDrag = 900; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag) maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed. (meters/second) autoAngularForce = 400; // Angular stabilizer force (this force levels you out when autostabilizer kicks in) autoLinearForce = 300; // Linear stabilzer force (this slows you down when autostabilizer kicks in) autoInputDamping = 0.95; // Dampen control input so you don't` whack out at very slow speeds // Maneuvering maxSteeringAngle = 5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable. horizontalSurfaceForce = 6; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning) verticalSurfaceForce = 4; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.) maneuveringForce = 3000; // Horizontal jets (W,S,D,A key thrust) steeringForce = 1200; // Steering jets (force applied when you move the mouse) steeringRollForce = 400; // Steering jets (how much you heel over when you turn) rollForce = 4; // Auto-roll (self-correction to right you after you roll/invert) hoverHeight = 5; // Height off the ground at rest createHoverHeight = 3; // Height off the ground when created maxForwardSpeed = 100; // speed in which forward thrust force is no longer applied (meters/second) // Turbo Jet jetForce = 2000; // Afterburner thrust (this is in addition to normal thrust) minJetEnergy = 28; // Afterburner can't be used if below this threshhold. jetEnergyDrain = 2.8; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed vertThrustMultiple = 3.0; // Rigid body mass = 150; // Mass of the vehicle bodyFriction = 0; // Don't mess with this. bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1) minRollSpeed = 0; // Don't mess with this. softImpactSpeed = 14; // Sound hooks. This is the soft hit. hardImpactSpeed = 25; // Sound hooks. This is the hard hit. // Ground Impact Damage (uses DamageType::Ground) minImpactSpeed = 10; // If hit ground at speed above this then it's an impact. Meters/second speedDamageScale = 0.06; // Object Impact Damage (uses DamageType::Impact) collDamageThresholdVel = 23.0; collDamageMultiplier = 0.02; // minTrailSpeed = 15; // The speed your contrail shows up at. trailEmitter = ContrailEmitter; forwardJetEmitter = FlyerJetEmitter; downJetEmitter = FlyerJetEmitter; // jetSound = ScoutFlyerThrustSound; engineSound = ScoutFlyerEngineSound; softImpactSound = SoftImpactSound; hardImpactSound = HardImpactSound; //wheelImpactSound = WheelImpactSound; // softSplashSoundVelocity = 10.0; mediumSplashSoundVelocity = 15.0; hardSplashSoundVelocity = 20.0; exitSplashSoundVelocity = 10.0; exitingWater = VehicleExitWaterMediumSound; impactWaterEasy = VehicleImpactWaterSoftSound; impactWaterMedium = VehicleImpactWaterMediumSound; impactWaterHard = VehicleImpactWaterMediumSound; waterWakeSound = VehicleWakeMediumSplashSound; dustEmitter = VehicleLiftoffDustEmitter; triggerDustHeight = 4.0; dustHeight = 1.0; damageEmitter[0] = LightDamageSmoke; damageEmitter[1] = HeavyDamageSmoke; damageEmitter[2] = DamageBubbles; damageEmitterOffset[0] = "0.0 -3.0 0.0 "; damageLevelTolerance[0] = 0.3; damageLevelTolerance[1] = 0.7; numDmgEmitterAreas = 1; // max[chaingunAmmo] = 1000; minMountDist = 4; splashEmitter[0] = VehicleFoamDropletsEmitter; splashEmitter[1] = VehicleFoamEmitter; shieldImpact = VehicleShieldImpact; cmdCategory = "Tactical"; cmdIcon = CMDFlyingScoutIcon; cmdMiniIconName = "commander/MiniIcons/com_scout_grey"; targetNameTag = 'Shrike'; targetTypeTag = 'Turbograv'; sensorData = AWACPulseSensor; sensorRadius = AWACPulseSensor.detectRadius; sensorColor = "255 194 9"; checkRadius = 5.5; observeParameters = "1 10 10"; runningLight[0] = ShrikeLight1; // runningLight[1] = ShrikeLight2; shieldEffectScale = "0.937 1.125 0.60"; }; //************************************************************** // WEAPONS //************************************************************** datablock ShapeBaseImageData(ScoutChaingunPairImage) { className = WeaponImage; shapeFile = "weapon_energy_vehicle.dts"; item = Chaingun; ammo = ChaingunAmmo; projectile = ScoutChaingunBullet; projectileType = TracerProjectile; mountPoint = 10; //**original** offset = ".73 0 0"; offset = "1.93 -0.52 0.044"; projectileSpread = 1.0 / 1000.0; usesEnergy = true; useMountEnergy = true; // DAVEG -- balancing numbers below! minEnergy = 5; fireEnergy = 5; fireTimeout = 125; //-------------------------------------- stateName[0] = "Activate"; stateSequence[0] = "Activate"; stateAllowImageChange[0] = false; stateTimeoutValue[0] = 0.05; stateTransitionOnTimeout[0] = "Ready"; stateTransitionOnNoAmmo[0] = "NoAmmo"; //-------------------------------------- stateName[1] = "Ready"; stateSpinThread[1] = Stop; stateTransitionOnTriggerDown[1] = "Spinup"; stateTransitionOnNoAmmo[1] = "NoAmmo"; //-------------------------------------- stateName[2] = "NoAmmo"; stateTransitionOnAmmo[2] = "Ready"; stateSpinThread[2] = Stop; stateTransitionOnTriggerDown[2] = "DryFire"; //-------------------------------------- stateName[3] = "Spinup"; stateSpinThread[3] = SpinUp; stateTimeoutValue[3] = 0.01; stateWaitForTimeout[3] = false; stateTransitionOnTimeout[3] = "Fire"; stateTransitionOnTriggerUp[3] = "Spindown"; //-------------------------------------- stateName[4] = "Fire"; stateSpinThread[4] = FullSpeed; stateRecoil[4] = LightRecoil; stateAllowImageChange[4] = false; stateScript[4] = "onFire"; stateFire[4] = true; stateSound[4] = ShrikeBlasterFire; // IMPORTANT! The stateTimeoutValue below has been replaced by fireTimeOut // above. stateTimeoutValue[4] = 0.25; stateTransitionOnTimeout[4] = "checkState"; //-------------------------------------- stateName[5] = "Spindown"; stateSpinThread[5] = SpinDown; stateTimeoutValue[5] = 0.01; stateWaitForTimeout[5] = false; stateTransitionOnTimeout[5] = "Ready"; stateTransitionOnTriggerDown[5] = "Spinup"; //-------------------------------------- stateName[6] = "EmptySpindown"; // stateSound[6] = ChaingunSpindownSound; stateSpinThread[6] = SpinDown; stateTransitionOnAmmo[6] = "Ready"; stateTimeoutValue[6] = 0.01; stateTransitionOnTimeout[6] = "NoAmmo"; //-------------------------------------- stateName[7] = "DryFire"; stateSound[7] = ShrikeBlasterDryFireSound; stateTransitionOnTriggerUp[7] = "NoAmmo"; stateTimeoutValue[7] = 0.25; stateTransitionOnTimeout[7] = "NoAmmo"; stateName[8] = "checkState"; stateTransitionOnTriggerUp[8] = "Spindown"; stateTransitionOnNoAmmo[8] = "EmptySpindown"; stateTimeoutValue[8] = 0.01; stateTransitionOnTimeout[8] = "ready"; }; datablock ShapeBaseImageData(ScoutChaingunImage) : ScoutChaingunPairImage { //**original** offset = "-.73 0 0"; offset = "-1.93 -0.52 0.044"; stateScript[3] = "onTriggerDown"; stateScript[5] = "onTriggerUp"; stateScript[6] = "onTriggerUp"; }; datablock ShapeBaseImageData(ScoutChaingunParam) { mountPoint = 2; shapeFile = "turret_muzzlepoint.dts"; projectile = ScoutChaingunBullet; projectileType = TracerProjectile; }; PK !( bb#scripts/vehicles/vehicle_spec_fx.cs//============================================================== // MISCELLANEOUS VEHICLE SOUNDS AND EFFECTS // // - Sounds // - Water Splash Effects // - Tire Dust Particles // - Lift-Off Particles // - Small Heavy Damage Smoke // - Heavy Damage Smoke // - Light Heavy Damage Smoke // - Vehicle Smoke Spike (for debris) // - Vehicle Medium Explosion Smoke // - Vehicle Large Ground Explosion Smoke // - Debris Fire Particles // - Debris Smoke Particles // - Debris (pieces) // - Explosions (including Shield Impacts) // - Vehicle Sensors // - Flier Contrails // - Bomb Explosions // //============================================================== //-------------------------------------------------------------- // SOUNDS //-------------------------------------------------------------- datablock EffectProfile(SoftImpactEffect) { effectname = "vehicles/crash_soft"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(HardImpactEffect) { effectname = "vehicles/crash_hard"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(GravSoftImpactEffect) { effectname = "vehicles/crash_ground_vehicle"; minDistance = 5.0; maxDistance = 10.0; }; datablock AudioProfile(SoftImpactSound) { filename = "fx/vehicles/crash_soft.wav"; description = AudioClose3d; preload = true; effect = SoftImpactEffect; }; datablock AudioProfile(HardImpactSound) { filename = "fx/vehicles/crash_hard.wav"; description = AudioExplosion3d; preload = true; effect = HardImpactEffect; }; datablock AudioProfile(GravSoftImpactSound) { filename = "fx/vehicles/crash_grav_soft.wav"; description = AudioClose3d; preload = true; effect = GravSoftImpactEffect; }; datablock AudioProfile(BombExplosionSound) { filename = "fx/vehicles/bomber_bomb_impact.wav"; description = AudioBomb3d; preload = true; }; //-------------------------------------------------------------- // WATER SPLASH EFFECTS //-------------------------------------------------------------- datablock ParticleData(VehicleFoamParticle) { dragCoefficient = 2.0; gravityCoefficient = -0.05; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1200; lifetimeVarianceMS = 400; useInvAlpha = false; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 2; sizes[1] = 4; sizes[2] = 6; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(VehicleFoamEmitter) { ejectionPeriodMS = 40; periodVarianceMS = 0; ejectionVelocity = 10.0; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 85; thetaMax = 85; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "VehicleFoamParticle"; }; datablock ParticleData( VehicleFoamDropletsParticle ) { dragCoefficient = 1; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 800; lifetimeVarianceMS = 300; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 8; sizes[1] = 3; sizes[2] = 0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( VehicleFoamDropletsEmitter ) { ejectionPeriodMS = 34; periodVarianceMS = 0; ejectionVelocity = 10; velocityVariance = 5.0; ejectionOffset = 0.0; thetaMin = 60; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; particles = "VehicleFoamDropletsParticle"; }; //-------------------------------------------------------------- // TIRE DUST PARTICLES //-------------------------------------------------------------- datablock ParticleData(TireParticle) { dragCoefficient = 2.0; gravityCoefficient = -0.1; inheritedVelFactor = 0.1; constantAcceleration = 0.0; lifetimeMS = 6000; lifetimeVarianceMS = 1000; useInvAlpha = true; spinRandomMin = -45.0; spinRandomMax = 45.0; textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 0.6"; colors[1] = "0.46 0.46 0.36 0.0"; sizes[0] = 1.5; sizes[1] = 7.00; }; datablock ParticleEmitterData(TireEmitter) { ejectionPeriodMS = 160; periodVarianceMS = 20; ejectionVelocity = 2; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 20; thetaMax = 90; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; useEmitterColors = true; particles = "TireParticle"; }; //-------------------------------------------------------------- // LIFTOFF PARTICLES //-------------------------------------------------------------- datablock ParticleData(TankDust) { dragCoefficient = 1.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 2000; lifetimeVarianceMS = 200; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 0.0"; colors[1] = "0.46 0.46 0.36 0.4"; colors[2] = "0.46 0.46 0.36 0.0"; sizes[0] = 3.2; sizes[1] = 4.6; sizes[2] = 7.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(TankDustEmitter) { ejectionPeriodMS = 12; periodVarianceMS = 0; ejectionVelocity = 20.0; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 90; thetaMax = 90; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; useEmitterColors = true; particles = "TankDust"; }; datablock ParticleData(LargeVehicleLiftoffDust) { dragCoefficient = 1.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1000; lifetimeVarianceMS = 100; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 0.0"; colors[1] = "0.46 0.46 0.36 0.4"; colors[2] = "0.46 0.46 0.36 0.0"; sizes[0] = 3.2; sizes[1] = 4.6; sizes[2] = 7.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(LargeVehicleLiftoffDustEmitter) { ejectionPeriodMS = 15; periodVarianceMS = 0; ejectionVelocity = 15.0; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 90; thetaMax = 90; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; useEmitterColors = true; particles = "LargeVehicleLiftoffDust"; }; datablock ParticleData(VehicleLiftoffDust) { dragCoefficient = 1.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1000; lifetimeVarianceMS = 100; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 0.0"; colors[1] = "0.46 0.46 0.36 0.4"; colors[2] = "0.46 0.46 0.36 0.0"; sizes[0] = 1.2; sizes[1] = 2.6; sizes[2] = 3.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(VehicleLiftoffDustEmitter) { ejectionPeriodMS = 15; periodVarianceMS = 0; ejectionVelocity = 10.0; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 90; thetaMax = 90; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; useEmitterColors = true; particles = "VehicleLiftoffDust"; }; //-------------------------------------------------------------- // Damage bubbles //-------------------------------------------------------------- datablock ParticleData(DamageBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.04; inheritedVelFactor = 0.5; constantAcceleration = 0.0; lifetimeMS = 2000; lifetimeVarianceMS = 200; useInvAlpha = false; spinRandomMin = -90.0; spinRandomMax = 90.0; textureName = "special/bubbles"; colors[0] = "0.7 0.7 0.7 0.0"; colors[1] = "0.3 0.3 0.3 1.0"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 0.2; sizes[1] = 0.8; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(DamageBubbles) { ejectionPeriodMS = 15; periodVarianceMS = 0; ejectionVelocity = 3.0; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 35; overrideAdvances = false; particles = "DamageBubbleParticle"; }; //-------------------------------------------------------------- // SMALL HEAVY DAMAGE SMOKE //-------------------------------------------------------------- datablock ParticleData(SmallHeavyDamageSmokeParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.5; constantAcceleration = 0.0; lifetimeMS = 1000; lifetimeVarianceMS = 200; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 90.0; textureName = "particleTest"; colors[0] = "0.7 0.7 0.7 0.0"; colors[1] = "0.3 0.3 0.3 1.0"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 0.2; sizes[1] = 0.8; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(SmallHeavyDamageSmoke) { ejectionPeriodMS = 25; periodVarianceMS = 0; ejectionVelocity = 3.0; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 35; overrideAdvances = false; particles = "SmallHeavyDamageSmokeParticle"; }; //-------------------------------------------------------------- // HEAVY DAMAGE SMOKE //-------------------------------------------------------------- datablock ParticleData(HeavyDamageSmokeParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.5; constantAcceleration = 0.0; lifetimeMS = 2000; lifetimeVarianceMS = 200; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 90.0; textureName = "particleTest"; colors[0] = "0.7 0.7 0.7 0.0"; colors[1] = "0.3 0.3 0.3 0.7"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 1.2; sizes[1] = 2.6; sizes[2] = 4.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(HeavyDamageSmoke) { ejectionPeriodMS = 20; periodVarianceMS = 6; ejectionVelocity = 4.0; velocityVariance = 0.5; ejectionOffset = 1.5; thetaMin = 0; thetaMax = 35; overrideAdvances = false; particles = "HeavyDamageSmokeParticle"; }; //-------------------------------------------------------------- // SMALL LIGHT DAMAGE SMOKE //-------------------------------------------------------------- datablock ParticleData(SmallLightDamageSmokeParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.5; constantAcceleration = 0.0; lifetimeMS = 1000; lifetimeVarianceMS = 200; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 90.0; textureName = "particleTest"; colors[0] = "0.7 0.7 0.7 0.0"; colors[1] = "0.5 0.5 0.5 0.4"; colors[2] = "0.3 0.3 0.3 0.0"; sizes[0] = 0.8; sizes[1] = 1.6; sizes[2] = 3.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(SmallLightDamageSmoke) { ejectionPeriodMS = 40; periodVarianceMS = 0; ejectionVelocity = 3.0; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 35; overrideAdvances = false; particles = "SmallLightDamageSmokeParticle"; }; //-------------------------------------------------------------- // LIGHT DAMAGE SMOKE //-------------------------------------------------------------- datablock ParticleData(LightDamageSmokeParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.5; constantAcceleration = 0.0; lifetimeMS = 1500; lifetimeVarianceMS = 200; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 90.0; textureName = "particleTest"; colors[0] = "0.7 0.7 0.7 0.0"; colors[1] = "0.5 0.5 0.5 0.7"; colors[2] = "0.3 0.3 0.3 0.0"; sizes[0] = 1.2; sizes[1] = 2.6; sizes[2] = 4.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(LightDamageSmoke) { ejectionPeriodMS = 30; periodVarianceMS = 6; ejectionVelocity = 4.0; velocityVariance = 0.5; ejectionOffset = 1.5; thetaMin = 0; thetaMax = 35; overrideAdvances = false; particles = "LightDamageSmokeParticle"; }; //-------------------------------------------------------------- // VEHICLE SMOKE SPIKE (for debris) //-------------------------------------------------------------- datablock ParticleData( VSmokeSpike ) { dragCoeffiecient = 1.0; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; lifetimeMS = 1000; lifetimeVarianceMS = 100; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -60.0; spinRandomMax = 60.0; colors[0] = "0.4 0.4 0.4 1.0"; colors[1] = "0.3 0.3 0.3 0.5"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 0.0; sizes[1] = 1.0; sizes[2] = 0.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( VSmokeSpikeEmitter ) { ejectionPeriodMS = 7; periodVarianceMS = 1; ejectionVelocity = 1.0; // A little oomph at the back end velocityVariance = 0.2; thetaMin = 0.0; thetaMax = 40.0; particles = "VSmokeSpike"; }; //-------------------------------------------------------------- // VEHICLE MEDIUM EXPLOSION SMOKE //-------------------------------------------------------------- datablock ParticleData(VehicleMESmoke) { dragCoeffiecient = 0.4; gravityCoefficient = -0.5; // rises slowly inheritedVelFactor = 0.025; lifetimeMS = 1250; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "1.0 0.7 0.5 1.0"; colors[1] = "0.3 0.3 0.3 1.0"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 2.0; sizes[1] = 6.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.3; times[2] = 1.0; }; datablock ParticleEmitterData(VehicleMESmokeEMitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 6.25; velocityVariance = 0.25; thetaMin = 0.0; thetaMax = 180.0; lifetimeMS = 250; particles = "VehicleMESmoke"; }; //-------------------------------------------------------------- // VEHICLE LARGE GROUND EXPLOSION SMOKE //-------------------------------------------------------------- datablock ParticleData(VehicleLGESmoke) { dragCoeffiecient = 0.3; gravityCoefficient = -0.5; // rises slowly inheritedVelFactor = 0.025; lifetimeMS = 1250; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "1.0 0.7 0.5 0.5"; colors[1] = "0.3 0.3 0.3 1.0"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 6.0; sizes[1] = 6.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.3; times[2] = 1.0; }; datablock ParticleEmitterData(VehicleLGESmokeEMitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 7.25; velocityVariance = 0.25; ejectionOffset = 5.0; thetaMin = 0.0; thetaMax = 80.0; lifetimeMS = 350; particles = "VehicleLGESmoke"; }; //-------------------------------------------------------------- // DEBRIS FIRE PARTICLES //-------------------------------------------------------------- datablock ParticleData(DebrisFireParticle) { dragCoeffiecient = 0.0; gravityCoefficient = -0.2; inheritedVelFactor = 0.0; lifetimeMS = 350; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -160.0; spinRandomMax = 160.0; animateTexture = true; framesPerSec = 15; animTexName[0] = "special/Explosion/exp_0016"; animTexName[1] = "special/Explosion/exp_0018"; animTexName[2] = "special/Explosion/exp_0020"; animTexName[3] = "special/Explosion/exp_0022"; animTexName[4] = "special/Explosion/exp_0024"; animTexName[5] = "special/Explosion/exp_0026"; animTexName[6] = "special/Explosion/exp_0028"; animTexName[7] = "special/Explosion/exp_0030"; animTexName[8] = "special/Explosion/exp_0032"; colors[0] = "1.0 0.7 0.5 1.0"; colors[1] = "1.0 0.5 0.2 1.0"; colors[2] = "1.0 0.25 0.1 0.0"; sizes[0] = 0.5; sizes[1] = 2.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.2; times[2] = 1.0; }; datablock ParticleEmitterData(DebrisFireEmitter) { ejectionPeriodMS = 20; periodVarianceMS = 1; ejectionVelocity = 0.25; velocityVariance = 0.0; thetaMin = 0.0; thetaMax = 30.0; particles = "DebrisFireParticle"; }; //-------------------------------------------------------------- // DEBRIS SMOKE PARTICLES //-------------------------------------------------------------- datablock ParticleData( DebrisSmokeParticle ) { dragCoeffiecient = 4.0; gravityCoefficient = -0.00; // rises slowly inheritedVelFactor = 0.2; lifetimeMS = 1000; lifetimeVarianceMS = 100; // ...more or less textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -50.0; spinRandomMax = 50.0; colors[0] = "0.3 0.3 0.3 0.0"; colors[1] = "0.3 0.3 0.3 1.0"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 2; sizes[1] = 3; sizes[2] = 5; times[0] = 0.0; times[1] = 0.7; times[2] = 1.0; }; datablock ParticleEmitterData( DebrisSmokeEmitter ) { ejectionPeriodMS = 25; periodVarianceMS = 5; ejectionVelocity = 1.0; // A little oomph at the back end velocityVariance = 0.5; thetaMin = 10.0; thetaMax = 30.0; useEmitterSizes = true; particles = "DebrisSmokeParticle"; }; //-------------------------------------------------------------- // DEBRIS (pieces) //-------------------------------------------------------------- datablock EffectProfile(VehicleExplosionEffect) { effectname = "explosions/vehicle_explosion"; minDistance = 10; maxDistance = 40; }; datablock AudioProfile(VehicleExplosionSound) { filename = "fx/explosions/vehicle_explosion.wav"; description = AudioBIGExplosion3d; preload = true; effect = VehicleExplosionEffect; }; datablock ExplosionData(DebrisExplosion) { explosionShape = "effect_plasma_explosion.dts"; soundProfile = plasmaExpSound; faceViewer = true; explosionScale = "0.4 0.4 0.4"; }; datablock DebrisData( VehicleFireballDebris ) { emitters[0] = DebrisSmokeEmitter; emitters[1] = DebrisFireEmitter; explosion = DebrisExplosion; explodeOnMaxBounce = true; elasticity = 0.4; friction = 0.2; lifetime = 100.0; lifetimeVariance = 30.0; numBounces = 0; bounceVariance = 0; }; datablock DebrisData( VSpikeDebris ) { emitters[0] = VSmokeSpikeEmitter; explodeOnMaxBounce = true; elasticity = 0.4; friction = 0.2; lifetime = 0.3; lifetimeVariance = 0.02; }; datablock DebrisData( ShapeDebris ) { explodeOnMaxBounce = false; elasticity = 0.40; friction = 0.5; lifetime = 25.0; lifetimeVariance = 0.0; minSpinSpeed = 60; maxSpinSpeed = 600; numBounces = 10; bounceVariance = 0; staticOnMaxBounce = true; useRadiusMass = true; baseRadius = 1.0; velocity = 17.0; velocityVariance = 7.0; }; //************************************************************** // EXPLOSIONS //************************************************************** datablock ExplosionData(VSpikeExplosion) { debris = VSpikeDebris; debrisThetaMin = 10; debrisThetaMax = 170; debrisNum = 15; debrisNumVariance = 6; debrisVelocity = 30.0; debrisVelocityVariance = 7.0; }; datablock ExplosionData(VehicleExplosion) { explosionShape = "disc_explosion.dts"; playSpeed = 1.5; soundProfile = VehicleExplosionSound; faceViewer = true; emitter[0] = VehicleMESmokeEmitter; debris = VehicleFireballDebris; debrisThetaMin = 10; debrisThetaMax = 80; debrisNum = 3; debrisNumVariance = 1; debrisVelocity = 20.0; debrisVelocityVariance = 5.0; subExplosion = VSpikeExplosion; shakeCamera = true; camShakeFreq = "11.0 13.0 9.0"; camShakeAmp = "40.0 40.0 40.0"; camShakeDuration = 0.7; camShakeRadius = 25.0; }; datablock ExplosionData(VLSpikeExplosion) { debris = VSpikeDebris; debrisThetaMin = 10; debrisThetaMax = 170; debrisNum = 10; debrisNumVariance = 6; debrisVelocity = 50.0; debrisVelocityVariance = 10.0; }; datablock ExplosionData(VLGSpikeExplosion) { debris = VSpikeDebris; debrisThetaMin = 10; debrisThetaMax = 70; debrisNum = 10; debrisNumVariance = 6; debrisVelocity = 50.0; debrisVelocityVariance = 10.0; }; datablock ExplosionData(LargeGroundVehicleExplosion) { explosionShape = "disc_explosion.dts"; playSpeed = 1.5; soundProfile = VehicleExplosionSound; faceViewer = true; emitter[0] = VehicleLGESmokeEMitter; debris = VehicleFireballDebris; debrisThetaMin = 10; debrisThetaMax = 60; debrisNum = 3; debrisNumVariance = 1; debrisVelocity = 20.0; debrisVelocityVariance = 5.0; subExplosion = VLGSpikeExplosion; shakeCamera = true; camShakeFreq = "8.0 9.0 7.0"; camShakeAmp = "140.0 140.0 140.0"; camShakeDuration = 1.3; camShakeRadius = 30.0; }; datablock ExplosionData(LargeAirVehicleExplosion) { explosionShape = "disc_explosion.dts"; playSpeed = 1.5; soundProfile = VehicleExplosionSound; faceViewer = true; emitter[0] = VehicleLGESmokeEMitter; debris = VehicleFireballDebris; debrisThetaMin = 10; debrisThetaMax = 80; debrisNum = 3; debrisNumVariance = 1; debrisVelocity = 20.0; debrisVelocityVariance = 5.0; subExplosion = VLSpikeExplosion; shakeCamera = true; camShakeFreq = "8.0 9.0 7.0"; camShakeAmp = "140.0 140.0 140.0"; camShakeDuration = 1.3; camShakeRadius = 30.0; }; //-------------------------------------------------------------- // BOMB EXPLOSION //-------------------------------------------------------------- datablock ParticleData(VehicleBombExplosionParticle) { dragCoefficient = 2; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 900; lifetimeVarianceMS = 225; textureName = "particleTest"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 0.0"; sizes[0] = 3; sizes[1] = 5; }; datablock ParticleEmitterData(VehicleBombExplosionEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 32; velocityVariance = 10; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 60; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "VehicleBombExplosionParticle"; }; datablock ShockwaveData(VehicleBombShockwave) { width = 6.0; numSegments = 32; numVertSegments = 6; velocity = 16.0; acceleration = 40.0; lifetimeMS = 650; height = 1.0; verticalCurve = 0.5; is2D = false; texture[0] = "special/shockwave4"; texture[1] = "special/gradient"; texWrap = 6.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; colors[0] = "1.0 0.8 0.4 0.50"; colors[1] = "1.0 0.6 0.3 0.25"; colors[2] = "1.0 0.4 0.2 0.0"; mapToTerrain = true; orientToNormal = false; renderBottom = false; }; datablock ExplosionData(VehicleBombSubExplosion1) { explosionShape = "effect_plasma_explosion.dts"; faceViewer = true; delayMS = 50; offset = 5.0; playSpeed = 1.5; sizes[0] = "1.5 1.5 1.5"; sizes[1] = "3.0 3.0 3.0"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(VehicleBombSubExplosion2) { explosionShape = "effect_plasma_explosion.dts"; faceViewer = true; delayMS = 100; offset = 7.0; playSpeed = 1.1; sizes[0] = "5.0 5.0 5.0"; sizes[1] = "8.0 8.0 8.0"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(VehicleBombSubExplosion3) { explosionShape = "effect_plasma_explosion.dts"; faceViewer = true; delayMS = 0; offset = 0.0; playSpeed = 0.9; sizes[0] = "7.0 7.0 7.0"; sizes[1] = "10.0 10.0 10.0"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(VehicleBombExplosion) { soundProfile = BombExplosionSound; particleEmitter = VehicleBombExplosionEmitter; particleDensity = 250; particleRadius = 1.25; faceViewer = true; shockwave = VehicleBombShockwave; shockwaveOnTerrain = true; subExplosion[0] = VehicleBombSubExplosion1; subExplosion[1] = VehicleBombSubExplosion2; subExplosion[2] = VehicleBombSubExplosion3; shakeCamera = true; camShakeFreq = "5.0 7.0 5.0"; camShakeAmp = "80.0 80.0 80.0"; camShakeDuration = 1.0; camShakeRadius = 30.0; }; ////-------------------------------------------------------------- //// VEHICLE SHIELD IMPACT DATA ////-------------------------------------------------------------- //datablock ShieldImpactData( VehicleShieldImpact ) //{ // lifetimeMS = 300; // startScale = 1.0; // endScale = 1.1; //}; //-------------------------------------------------------------- // VEHICLE SENSORS //-------------------------------------------------------------- datablock SensorData(VehiclePulseSensor) { detects = true; detectsUsingLOS = true; detectsPassiveJammed = false; detectsActiveJammed = false; detectsCloaked = false; detectionPings = true; detectRadius = 20; }; datablock SensorData(AWACPulseSensor) { detects = true; detectsUsingLOS = true; detectsPassiveJammed = false; detectsActiveJammed = false; detectsCloaked = false; detectionPings = true; detectRadius = 300; }; //-------------------------------------------------------------- // FLIER CONTRAILS //-------------------------------------------------------------- datablock ParticleData(ContrailParticle) { dragCoefficient = 1.5; gravityCoefficient = 0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 3000; lifetimeVarianceMS = 0; textureName = "particleTest"; colors[0] = "0.6 0.6 0.6 0.5"; colors[1] = "0.2 0.2 0.2 0"; sizes[0] = 0.6; sizes[1] = 5; }; datablock ParticleEmitterData(ContrailEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 1; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 10; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "ContrailParticle"; }; datablock ParticleData(FlyerJetParticle) { dragCoefficient = 1.5; gravityCoefficient = 0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 200; lifetimeVarianceMS = 0; textureName = "particleTest"; colors[0] = "0.9 0.7 0.3 0.6"; colors[1] = "0.3 0.3 0.5 0"; sizes[0] = 2; sizes[1] = 6; }; datablock ParticleEmitterData(FlyerJetEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 20; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 10; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "FlyerJetParticle"; }; //-------------------------------------------------------------- // Hover Jet Emitters //-------------------------------------------------------------- datablock ParticleData(TankJetParticle) { dragCoefficient = 1.5; gravityCoefficient = 0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 200; lifetimeVarianceMS = 0; textureName = "particleTest"; colors[0] = "0.9 0.7 0.3 0.6"; colors[1] = "0.3 0.3 0.5 0"; sizes[0] = 2; sizes[1] = 6; }; datablock ParticleEmitterData(TankJetEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 20; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 10; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "TankJetParticle"; }; datablock ParticleData(WildcatJetParticle) { dragCoefficient = 1.5; gravityCoefficient = 0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 100; lifetimeVarianceMS = 0; textureName = "particleTest"; colors[0] = "0.9 0.7 0.3 0.6"; colors[1] = "0.3 0.3 0.5 0"; sizes[0] = 0.5; sizes[1] = 1.5; }; datablock ParticleEmitterData(WildcatJetEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 20; velocityVariance = 1.0; ejectionOffset = 0; thetaMin = 0; thetaMax = 10; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "WildcatJetParticle"; }; //-------------------------------------------------------------- // Vehicle Splash Sounds //-------------------------------------------------------------- //EXIT WATER datablock AudioProfile(VehicleExitWaterSoftSound) { filename = "fx/armor/general_water_exit2.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(VehicleExitWaterMediumSound) { filename = "fx/armor/general_water_exit2.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(VehicleExitWaterHardSound) { filename = "fx/armor/general_water_exit2.wav"; description = AudioClose3d; preload = true; }; //IMPACT WATER datablock AudioProfile(VehicleImpactWaterSoftSound) { filename = "fx/armor/general_water_smallsplash2.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(VehicleImpactWaterMediumSound) { filename = "fx/armor/general_water_medsplash.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(VehicleImpactWaterHardSound) { filename = "fx/armor/general_water_bigsplash.wav"; description = AudioDefault3d; preload = true; }; //WATER WAKE datablock AudioProfile(VehicleWakeSoftSplashSound) { filename = "fx/vehicles/wake_wildcat.wav"; description = AudioDefaultLooping3d; preload = true; }; datablock AudioProfile(VehicleWakeMediumSplashSound) { filename = "fx/vehicles/wake_shrike_n_tank.wav"; description = AudioDefaultLooping3d; preload = true; }; datablock AudioProfile(VehicleWakeHardSplashSound) { filename = "fx/vehicles/wake_shrike_n_tank.wav"; description = AudioDefaultLooping3d; preload = true; }; PK !(BULL scripts/vehicles/vehicle_tank.cs//************************************************************** // BEOWULF ASSAULT VEHICLE //************************************************************** //************************************************************** // SOUNDS //************************************************************** datablock EffectProfile(AssaultVehicleEngineEffect) { effectname = "vehicles/tank_engine"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(AssaultVehicleThrustEffect) { effectname = "vehicles/tank_boost"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(AssaultTurretActivateEffect) { effectname = "vehicles/tank_activate"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(AssaultMortarDryFireEffect) { effectname = "weapons/mortar_dryfire"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(AssaultMortarFireEffect) { effectname = "vehicles/tank_mortar_fire"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(AssaultMortarReloadEffect) { effectname = "weapons/mortar_reload"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(AssaultChaingunFireEffect) { effectname = "weapons/chaingun_fire"; minDistance = 5.0; maxDistance = 10.0; }; datablock AudioProfile(AssaultVehicleSkid) { filename = "fx/vehicles/tank_skid.wav"; description = ClosestLooping3d; preload = true; }; datablock AudioProfile(AssaultVehicleEngineSound) { filename = "fx/vehicles/tank_engine.wav"; description = AudioDefaultLooping3d; preload = true; effect = AssaultVehicleEngineEffect; }; datablock AudioProfile(AssaultVehicleThrustSound) { filename = "fx/vehicles/tank_boost.wav"; description = AudioDefaultLooping3d; preload = true; effect = AssaultVehicleThrustEffect; }; datablock AudioProfile(AssaultChaingunFireSound) { filename = "fx/vehicles/tank_chaingun.wav"; description = AudioDefaultLooping3d; preload = true; effect = AssaultChaingunFireEffect; }; datablock AudioProfile(AssaultChaingunReloadSound) { filename = "fx/weapons/chaingun_dryfire.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(TankChaingunProjectile) { filename = "fx/weapons/chaingun_projectile.wav"; description = ProjectileLooping3d; preload = true; }; datablock AudioProfile(AssaultTurretActivateSound) { filename = "fx/vehicles/tank_activate.wav"; description = AudioClose3d; preload = true; effect = AssaultTurretActivateEffect; }; datablock AudioProfile(AssaultChaingunDryFireSound) { filename = "fx/weapons/chaingun_dryfire.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(AssaultChaingunIdleSound) { filename = "fx/misc/diagnostic_on.wav"; description = ClosestLooping3d; preload = true; }; datablock AudioProfile(AssaultMortarDryFireSound) { filename = "fx/weapons/mortar_dryfire.wav"; description = AudioClose3d; preload = true; effect = AssaultMortarDryFireEffect; }; datablock AudioProfile(AssaultMortarFireSound) { filename = "fx/vehicles/tank_mortar_fire.wav"; description = AudioClose3d; preload = true; effect = AssaultMortarFireEffect; }; datablock AudioProfile(AssaultMortarReloadSound) { filename = "fx/weapons/mortar_reload.wav"; description = AudioClose3d; preload = true; effect = AssaultMortarReloadEffect; }; datablock AudioProfile(AssaultMortarIdleSound) { filename = "fx/misc/diagnostic_on.wav"; description = ClosestLooping3d; preload = true; }; //************************************************************** // LIGHTS //************************************************************** datablock RunningLightData(TankLight1) { radius = 1.5; color = "1.0 1.0 1.0 0.2"; nodeName = "Headlight_node01"; direction = "0.0 1.0 0.0"; texture = "special/headlight4"; }; datablock RunningLightData(TankLight2) { radius = 1.5; color = "1.0 1.0 1.0 0.2"; nodeName = "Headlight_node02"; direction = "0.0 1.0 0.0"; texture = "special/headlight4"; }; datablock RunningLightData(TankLight3) { radius = 1.5; color = "1.0 1.0 1.0 0.2"; nodeName = "Headlight_node03"; direction = "0.0 1.0 0.0"; texture = "special/headlight4"; }; datablock RunningLightData(TankLight4) { radius = 1.5; color = "1.0 1.0 1.0 0.2"; nodeName = "Headlight_node04"; direction = "0.0 1.0 0.0"; texture = "special/headlight4"; }; //************************************************************** // VEHICLE CHARACTERISTICS //************************************************************** datablock HoverVehicleData(AssaultVehicle) : TankDamageProfile { spawnOffset = "0 0 4"; floatingGravMag = 4.5; catagory = "Vehicles"; shapeFile = "vehicle_grav_tank.dts"; multipassenger = true; computeCRC = true; renderWhenDestroyed = false; weaponNode = 1; debrisShapeName = "vehicle_land_assault_debris.dts"; debris = ShapeDebris; drag = 0.0; density = 0.9; mountPose[0] = sitting; mountPose[1] = sitting; numMountPoints = 2; isProtectedMountPoint[0] = true; isProtectedMountPoint[1] = true; cameraMaxDist = 20; cameraOffset = 3; cameraLag = 1.5; explosion = LargeGroundVehicleExplosion; explosionDamage = 0.5; explosionRadius = 5.0; maxSteeringAngle = 0.5; // 20 deg. maxDamage = 3.15; destroyedLevel = 3.15; isShielded = true; rechargeRate = 1.0; energyPerDamagePoint = 135; maxEnergy = 400; minJetEnergy = 15; jetEnergyDrain = 2.0; // Rigid Body mass = 1500; bodyFriction = 0.8; bodyRestitution = 0.5; minRollSpeed = 3; gyroForce = 400; gyroDamping = 0.3; stabilizerForce = 20; minDrag = 10; softImpactSpeed = 15; // Play SoftImpact Sound hardImpactSpeed = 18; // Play HardImpact Sound // Ground Impact Damage (uses DamageType::Ground) minImpactSpeed = 17; speedDamageScale = 0.060; // Object Impact Damage (uses DamageType::Impact) collDamageThresholdVel = 18; collDamageMultiplier = 0.045; dragForce = 40 / 20; vertFactor = 0.0; floatingThrustFactor = 0.15; mainThrustForce = 50; reverseThrustForce = 40; strafeThrustForce = 40; turboFactor = 1.7; brakingForce = 25; brakingActivationSpeed = 4; stabLenMin = 3.25; stabLenMax = 4; stabSpringConstant = 50; stabDampingConstant = 20; gyroDrag = 20; normalForce = 20; restorativeForce = 10; steeringForce = 15; rollForce = 5; pitchForce = 3; dustEmitter = TankDustEmitter; triggerDustHeight = 3.5; dustHeight = 1.0; dustTrailEmitter = TireEmitter; dustTrailOffset = "0.0 -1.0 0.5"; triggerTrailHeight = 3.6; dustTrailFreqMod = 15.0; jetSound = AssaultVehicleThrustSound; engineSound = AssaultVehicleEngineSound; floatSound = AssaultVehicleSkid; softImpactSound = GravSoftImpactSound; hardImpactSound = HardImpactSound; wheelImpactSound = WheelImpactSound; forwardJetEmitter = TankJetEmitter; // softSplashSoundVelocity = 5.0; mediumSplashSoundVelocity = 10.0; hardSplashSoundVelocity = 15.0; exitSplashSoundVelocity = 10.0; exitingWater = VehicleExitWaterMediumSound; impactWaterEasy = VehicleImpactWaterSoftSound; impactWaterMedium = VehicleImpactWaterMediumSound; impactWaterHard = VehicleImpactWaterMediumSound; waterWakeSound = VehicleWakeMediumSplashSound; minMountDist = 4; damageEmitter[0] = SmallLightDamageSmoke; damageEmitter[1] = SmallHeavyDamageSmoke; damageEmitter[2] = DamageBubbles; damageEmitterOffset[0] = "0.0 -1.5 3.5 "; damageLevelTolerance[0] = 0.3; damageLevelTolerance[1] = 0.7; numDmgEmitterAreas = 1; splashEmitter[0] = VehicleFoamDropletsEmitter; splashEmitter[1] = VehicleFoamEmitter; shieldImpact = VehicleShieldImpact; cmdCategory = "Tactical"; cmdIcon = CMDGroundTankIcon; cmdMiniIconName = "commander/MiniIcons/com_tank_grey"; targetNameTag = 'Beowulf'; targetTypeTag = 'Assault Tank'; sensorData = VehiclePulseSensor; checkRadius = 5.5535; observeParameters = "1 10 10"; runningLight[0] = TankLight1; runningLight[1] = TankLight2; runningLight[2] = TankLight3; runningLight[3] = TankLight4; shieldEffectScale = "0.9 1.0 0.6"; showPilotInfo = 1; }; //************************************************************** // WEAPONS //************************************************************** //------------------------------------- // ASSAULT CHAINGUN (projectile) //------------------------------------- datablock TracerProjectileData(AssaultChaingunBullet) { doDynamicClientHits = true; projectileShapeName = ""; directDamage = 0.16; directDamageType = $DamageType::TankChaingun; hasDamageRadius = false; splash = ChaingunSplash; kickbackstrength = 0.0; sound = TankChaingunProjectile; dryVelocity = 425.0; wetVelocity = 100.0; velInheritFactor = 1.0; fizzleTimeMS = 3000; lifetimeMS = 3000; explodeOnDeath = false; reflectOnWaterImpactAngle = 0.0; explodeOnWaterImpact = false; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = 3000; tracerLength = 15.0; tracerAlpha = false; tracerMinPixels = 6; tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75"; tracerTex[0] = "special/tracer00"; tracerTex[1] = "special/tracercross"; tracerWidth = 0.10; crossSize = 0.20; crossViewAng = 0.990; renderCross = true; decalData[0] = ChaingunDecal1; decalData[1] = ChaingunDecal2; decalData[2] = ChaingunDecal3; decalData[3] = ChaingunDecal4; decalData[4] = ChaingunDecal5; decalData[5] = ChaingunDecal6; activateDelayMS = 100; explosion = ChaingunExplosion; }; //------------------------------------- // ASSAULT CHAINGUN CHARACTERISTICS //------------------------------------- datablock TurretData(AssaultPlasmaTurret) : TurretDamageProfile { className = VehicleTurret; catagory = "Turrets"; shapeFile = "Turret_tank_base.dts"; preload = true; mass = 1.0; // Not really relevant maxEnergy = 1; maxDamage = AssaultVehicle.maxDamage; destroyedLevel = AssaultVehicle.destroyedLevel; repairRate = 0; // capacitor maxCapacitorEnergy = 250; capacitorRechargeRate = 1.0; thetaMin = 0; thetaMax = 100; inheritEnergyFromMount = true; firstPersonOnly = true; useEyePoint = true; numWeapons = 2; cameraDefaultFov = 90.0; cameraMinFov = 5.0; cameraMaxFov = 120.0; targetNameTag = 'Beowulf Chaingun'; targetTypeTag = 'Turret'; }; datablock TurretImageData(AssaultPlasmaTurretBarrel) { shapeFile = "turret_tank_barrelchain.dts"; mountPoint = 1; projectile = AssaultChaingunBullet; projectileType = TracerProjectile; casing = ShellDebris; shellExitDir = "1.0 0.3 1.0"; shellExitOffset = "0.15 -0.56 -0.1"; shellExitVariance = 15.0; shellVelocity = 3.0; projectileSpread = 12.0 / 1000.0; useCapacitor = true; usesEnergy = true; useMountEnergy = true; fireEnergy = 7.5; minEnergy = 15.0; // Turret parameters activationMS = 4000; deactivateDelayMS = 500; thinkTimeMS = 200; degPerSecTheta = 360; degPerSecPhi = 360; attackRadius = 75; // State transitions stateName[0] = "Activate"; stateTransitionOnNotLoaded[0] = "Dead"; stateTransitionOnLoaded[0] = "ActivateReady"; stateSound[0] = AssaultTurretActivateSound; stateName[1] = "ActivateReady"; stateSequence[1] = "Activate"; stateSound[1] = AssaultTurretActivateSound; stateTimeoutValue[1] = 1; stateTransitionOnTimeout[1] = "Ready"; stateTransitionOnNotLoaded[1] = "Deactivate"; stateName[2] = "Ready"; stateTransitionOnNotLoaded[2] = "Deactivate"; stateTransitionOnTriggerDown[2] = "Fire"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateName[3] = "Fire"; stateSequence[3] = "Fire"; stateSequenceRandomFlash[3] = true; stateFire[3] = true; stateAllowImageChange[3] = false; stateSound[3] = AssaultChaingunFireSound; stateScript[3] = "onFire"; stateTimeoutValue[3] = 0.1; stateTransitionOnTimeout[3] = "Fire"; stateTransitionOnTriggerUp[3] = "Reload"; stateTransitionOnNoAmmo[3] = "noAmmo"; stateName[4] = "Reload"; stateSequence[4] = "Reload"; stateTimeoutValue[4] = 0.1; stateAllowImageChange[4] = false; stateTransitionOnTimeout[4] = "Ready"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateWaitForTimeout[4] = true; stateName[5] = "Deactivate"; stateSequence[5] = "Activate"; stateDirection[5] = false; stateTimeoutValue[5] = 30; stateTransitionOnTimeout[5] = "ActivateReady"; stateName[6] = "Dead"; stateTransitionOnLoaded[6] = "ActivateReady"; stateTransitionOnTriggerDown[6] = "DryFire"; stateName[7] = "DryFire"; stateSound[7] = AssaultChaingunDryFireSound; stateTimeoutValue[7] = 0.5; stateTransitionOnTimeout[7] = "NoAmmo"; stateName[8] = "NoAmmo"; stateTransitionOnAmmo[8] = "Reload"; stateSequence[8] = "NoAmmo"; stateTransitionOnTriggerDown[8] = "DryFire"; }; //------------------------------------- // ASSAULT MORTAR (projectile) //------------------------------------- datablock ItemData(AssaultMortarAmmo) { className = Ammo; catagory = "Ammo"; shapeFile = "repair_kit.dts"; mass = 1; elasticity = 0.5; friction = 0.6; pickupRadius = 1; computeCRC = true; }; datablock GrenadeProjectileData(AssaultMortar) { projectileShapeName = "mortar_projectile.dts"; emitterDelay = -1; directDamage = 0.0; hasDamageRadius = true; indirectDamage = 1.0; damageRadius = 25.0; radiusDamageType = $DamageType::TankMortar; kickBackStrength = 2500; sound = MortarProjectileSound; explosion = "MortarExplosion"; velInheritFactor = 1.0; baseEmitter = MortarSmokeEmitter; grenadeElasticity = 0.0; grenadeFriction = 0.4; armingDelayMS = 250; muzzleVelocity = 65; drag = 0.1; hasLight = true; lightRadius = 4; lightColor = "0.1 0.4 0.1"; }; //------------------------------------- // ASSAULT MORTAR CHARACTERISTICS //------------------------------------- datablock TurretImageData(AssaultMortarTurretBarrel) { shapeFile = "turret_tank_barrelmortar.dts"; mountPoint = 0; // ammo = AssaultMortarAmmo; projectile = AssaultMortar; projectileType = GrenadeProjectile; usesEnergy = true; useMountEnergy = true; fireEnergy = 77.00; minEnergy = 77.00; useCapacitor = true; // Turret parameters activationMS = 4000; deactivateDelayMS = 1500; thinkTimeMS = 200; degPerSecTheta = 360; degPerSecPhi = 360; attackRadius = 75; // State transitions stateName[0] = "Activate"; stateTransitionOnNotLoaded[0] = "Dead"; stateTransitionOnLoaded[0] = "ActivateReady"; stateName[1] = "ActivateReady"; stateSequence[1] = "Activate"; stateSound[1] = AssaultTurretActivateSound; stateTimeoutValue[1] = 1.0; stateTransitionOnTimeout[1] = "Ready"; stateTransitionOnNotLoaded[1] = "Deactivate"; stateName[2] = "Ready"; stateTransitionOnNotLoaded[2] = "Deactivate"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "Fire"; stateName[3] = "Fire"; stateSequence[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 1.0; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSound[3] = AssaultMortarFireSound; stateScript[3] = "onFire"; stateName[4] = "Reload"; stateSequence[4] = "Reload"; stateTimeoutValue[4] = 1.0; stateAllowImageChange[4] = false; stateTransitionOnTimeout[4] = "Ready"; //stateTransitionOnNoAmmo[4] = "NoAmmo"; stateWaitForTimeout[4] = true; stateName[5] = "Deactivate"; stateDirection[5] = false; stateSequence[5] = "Activate"; stateTimeoutValue[5] = 1.0; stateTransitionOnLoaded[5] = "ActivateReady"; stateTransitionOnTimeout[5] = "Dead"; stateName[6] = "Dead"; stateTransitionOnLoaded[6] = "ActivateReady"; stateTransitionOnTriggerDown[6] = "DryFire"; stateName[7] = "DryFire"; stateSound[7] = AssaultMortarDryFireSound; stateTimeoutValue[7] = 1.0; stateTransitionOnTimeout[7] = "NoAmmo"; stateName[8] = "NoAmmo"; stateSequence[8] = "NoAmmo"; stateTransitionOnAmmo[8] = "Reload"; stateTransitionOnTriggerDown[8] = "DryFire"; }; datablock TurretImageData(AssaultTurretParam) { mountPoint = 2; shapeFile = "turret_muzzlepoint.dts"; projectile = AssaultChaingunBullet; projectileType = TracerProjectile; useCapacitor = true; usesEnergy = true; // Turret parameters activationMS = 1000; deactivateDelayMS = 1500; thinkTimeMS = 200; degPerSecTheta = 500; degPerSecPhi = 500; attackRadius = 75; }; PK !(7%s#scripts/vehicles/vehicle_wildcat.cs//************************************************************** // WILDCAT GRAV CYCLE //************************************************************** //************************************************************** // SOUNDS //************************************************************** datablock EffectProfile(ScoutEngineEffect) { effectname = "vehicles/outrider_engine"; minDistance = 5.0; maxDistance = 10.0; }; datablock EffectProfile(ScoutThrustEffect) { effectname = "vehicles/outrider_boost"; minDistance = 5.0; maxDistance = 10.0; }; datablock AudioProfile(ScoutSqueelSound) { filename = "fx/vehicles/outrider_skid.wav"; description = ClosestLooping3d; preload = true; }; // Scout datablock AudioProfile(ScoutEngineSound) { filename = "fx/vehicles/outrider_engine.wav"; description = AudioDefaultLooping3d; preload = true; effect = ScoutEngineEffect; }; datablock AudioProfile(ScoutThrustSound) { filename = "fx/vehicles/outrider_boost.wav"; description = AudioDefaultLooping3d; preload = true; effect = ScoutThrustEffect; }; //************************************************************** // LIGHTS //************************************************************** datablock RunningLightData(WildcatLight1) { radius = 1.0; color = "1.0 1.0 1.0 0.3"; nodeName = "Headlight_node01"; direction = "-1.0 1.0 0.0"; texture = "special/headlight4"; }; datablock RunningLightData(WildcatLight2) { radius = 1.0; color = "1.0 1.0 1.0 0.3"; nodeName = "Headlight_node02"; direction = "1.0 1.0 0.0"; texture = "special/headlight4"; }; datablock RunningLightData(WildcatLight3) { type = 2; radius = 100.0; color = "1.0 1.0 1.0 1.0"; offset = "0.0 0.0 0.0"; direction = "0.0 1.0 0.0"; texture = "special/projheadlight"; }; //************************************************************** // VEHICLE CHARACTERISTICS //************************************************************** datablock HoverVehicleData(ScoutVehicle) : WildcatDamageProfile { spawnOffset = "0 0 1"; floatingGravMag = 3.5; catagory = "Vehicles"; shapeFile = "vehicle_grav_scout.dts"; computeCRC = true; debrisShapeName = "vehicle_grav_scout_debris.dts"; debris = ShapeDebris; renderWhenDestroyed = false; drag = 0.0; density = 0.9; mountPose[0] = scoutRoot; cameraMaxDist = 5.0; cameraOffset = 0.7; cameraLag = 0.5; numMountPoints = 1; isProtectedMountPoint[0] = true; explosion = VehicleExplosion; explosionDamage = 0.5; explosionRadius = 5.0; lightOnly = 1; maxDamage = 0.60; destroyedLevel = 0.60; isShielded = true; rechargeRate = 0.7; energyPerDamagePoint = 75; maxEnergy = 150; minJetEnergy = 15; jetEnergyDrain = 1.3; // Rigid Body mass = 400; bodyFriction = 0.1; bodyRestitution = 0.5; softImpactSpeed = 20; // Play SoftImpact Sound hardImpactSpeed = 28; // Play HardImpact Sound // Ground Impact Damage (uses DamageType::Ground) minImpactSpeed = 29; speedDamageScale = 0.010; // Object Impact Damage (uses DamageType::Impact) collDamageThresholdVel = 23; collDamageMultiplier = 0.030; dragForce = 25 / 45.0; vertFactor = 0.0; floatingThrustFactor = 0.35; mainThrustForce = 30; reverseThrustForce = 10; strafeThrustForce = 8; turboFactor = 1.5; brakingForce = 25; brakingActivationSpeed = 4; stabLenMin = 2.25; stabLenMax = 3.75; stabSpringConstant = 30; stabDampingConstant = 16; gyroDrag = 16; normalForce = 30; restorativeForce = 20; steeringForce = 30; rollForce = 15; pitchForce = 7; dustEmitter = VehicleLiftoffDustEmitter; triggerDustHeight = 2.5; dustHeight = 1.0; dustTrailEmitter = TireEmitter; dustTrailOffset = "0.0 -1.0 0.5"; triggerTrailHeight = 3.6; dustTrailFreqMod = 15.0; jetSound = ScoutSqueelSound; engineSound = ScoutEngineSound; floatSound = ScoutThrustSound; softImpactSound = GravSoftImpactSound; hardImpactSound = HardImpactSound; //wheelImpactSound = WheelImpactSound; // softSplashSoundVelocity = 10.0; mediumSplashSoundVelocity = 20.0; hardSplashSoundVelocity = 30.0; exitSplashSoundVelocity = 10.0; exitingWater = VehicleExitWaterSoftSound; impactWaterEasy = VehicleImpactWaterSoftSound; impactWaterMedium = VehicleImpactWaterSoftSound; impactWaterHard = VehicleImpactWaterMediumSound; waterWakeSound = VehicleWakeSoftSplashSound; minMountDist = 4; damageEmitter[0] = SmallLightDamageSmoke; damageEmitter[1] = SmallHeavyDamageSmoke; damageEmitter[2] = DamageBubbles; damageEmitterOffset[0] = "0.0 -1.5 0.5 "; damageLevelTolerance[0] = 0.3; damageLevelTolerance[1] = 0.7; numDmgEmitterAreas = 1; splashEmitter[0] = VehicleFoamDropletsEmitter; splashEmitter[1] = VehicleFoamEmitter; shieldImpact = VehicleShieldImpact; forwardJetEmitter = WildcatJetEmitter; cmdCategory = Tactical; cmdIcon = CMDHoverScoutIcon; cmdMiniIconName = "commander/MiniIcons/com_landscout_grey"; targetNameTag = 'WildCat'; targetTypeTag = 'Grav Cycle'; sensorData = VehiclePulseSensor; checkRadius = 1.7785; observeParameters = "1 10 10"; runningLight[0] = WildcatLight1; runningLight[1] = WildcatLight2; runningLight[2] = WildcatLight3; shieldEffectScale = "0.9375 1.125 0.6"; }; //************************************************************** // WEAPONS //************************************************************** PK !(Gzzscripts/weapons/ELFGun.cs//-------------------------------------------------------------------------- // ELF Gun //-------------------------------------------------------------------------- datablock EffectProfile(ELFGunSwitchEffect) { effectname = "weapons/generic_switch"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ELFGunFireEffect) { effectname = "weapons/ELF_fire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ELFGunFireWetEffect) { effectname = "weapons/ELF_underwater"; minDistance = 2.5; maxDistance = 2.5; }; datablock AudioProfile(ELFGunSwitchSound) { filename = "fx/weapons/generic_switch.wav"; description = AudioClosest3d; preload = true; effect = ELFGunSwitchEffect; }; datablock AudioProfile(ELFGunFireSound) { filename = "fx/weapons/ELF_fire.wav"; description = CloseLooping3d; preload = true; effect = ELFGunFireEffect; }; datablock AudioProfile(ElfFireWetSound) { filename = "fx/weapons/ELF_underwater.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(ELFHitTargetSound) { filename = "fx/weapons/ELF_hit.wav"; description = CloseLooping3d; preload = true; effect = ELFGunFireEffect; }; //-------------------------------------- // Sparks //-------------------------------------- datablock ParticleData(ELFSparks) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 200; lifetimeVarianceMS = 0; textureName = "special/blueSpark"; colors[0] = "0.8 0.8 1.0 1.0"; colors[1] = "0.8 0.8 1.0 1.0"; colors[2] = "0.8 0.8 1.0 0.0"; sizes[0] = 0.35; sizes[1] = 0.15; sizes[2] = 0.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(ELFSparksEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 4; velocityVariance = 2; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 180; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; // lifetimeMS = 100; particles = "ELFSparks"; }; //-------------------------------------- // Projectile //-------------------------------------- datablock ELFProjectileData(BasicELF) { beamRange = 30; numControlPoints = 8; restorativeFactor = 3.75; dragFactor = 4.5; endFactor = 2.25; randForceFactor = 2; randForceTime = 0.125; drainEnergy = 1.0; drainHealth = 0.0; directDamageType = $DamageType::ELF; mainBeamWidth = 0.1; // width of blue wave beam mainBeamSpeed = 9.0; // speed that the beam travels forward mainBeamRepeat = 0.25; // number of times the texture repeats lightningWidth = 0.1; lightningDist = 0.15; // distance of lightning from main beam fireSound = ElfGunFireSound; wetFireSound = ElfFireWetSound; textures[0] = "special/ELFBeam"; textures[1] = "special/ELFLightning"; textures[2] = "special/BlueImpact"; emitter = ELFSparksEmitter; }; //-------------------------------------- // Rifle and item... //-------------------------------------- datablock ItemData(ELFGun) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_elf.dts"; image = ELFGunImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "an ELF gun"; computeCRC = true; emap = true; }; datablock ShapeBaseImageData(ELFGunImage) { className = WeaponImage; shapeFile = "weapon_elf.dts"; item = ELFGun; offset = "0 0 0"; projectile = BasicELF; projectileType = ELFProjectile; deleteLastProjectile = true; emap = true; usesEnergy = true; minEnergy = 3; stateName[0] = "Activate"; stateSequence[0] = "Activate"; stateSound[0] = ELFGunSwitchSound; stateTimeoutValue[0] = 0.5; stateTransitionOnTimeout[0] = "ActivateReady"; stateName[1] = "ActivateReady"; stateTransitionOnAmmo[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "CheckWet"; stateName[3] = "Fire"; stateEnergyDrain[3] = 5; stateFire[3] = true; stateAllowImageChange[3] = false; stateScript[3] = "onFire"; stateTransitionOnTriggerUp[3] = "Deconstruction"; stateTransitionOnNoAmmo[3] = "Deconstruction"; //stateSound[3] = ElfFireWetSound; stateName[4] = "NoAmmo"; stateTransitionOnAmmo[4] = "Ready"; stateName[5] = "Deconstruction"; stateScript[5] = "deconstruct"; stateTransitionOnTimeout[5] = "Ready"; stateTransitionOnNoAmmo[6] = "NoAmmo"; stateName[6] = "DryFire"; stateSound[6] = ElfFireWetSound; stateTimeoutValue[6] = 0.5; stateTransitionOnTimeout[6] = "Ready"; stateName[7] = "CheckWet"; stateTransitionOnWet[7] = "DryFire"; stateTransitionOnNotWet[7] = "Fire"; }; PK !($L-""scripts/weapons/blaster.cs//-------------------------------------- // Default blaster //-------------------------------------- //-------------------------------------------------------------------------- // Force-Feedback Effects //-------------------------------------- datablock EffectProfile(BlasterSwitchEffect) { effectname = "weapons/blaster_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(BlasterFireEffect) { effectname = "weapons/blaster_fire"; minDistance = 2.5; maxDistance = 2.5; }; //-------------------------------------------------------------------------- // Sounds //-------------------------------------- datablock AudioProfile(BlasterSwitchSound) { filename = "fx/weapons/blaster_activate.wav"; description = AudioClosest3d; preload = true; effect = BlasterSwitchEffect; }; datablock AudioProfile(BlasterFireSound) { filename = "fx/weapons/blaster_fire.WAV"; description = AudioDefault3d; preload = true; effect = BlasterFireEffect; }; datablock AudioProfile(BlasterProjectileSound) { filename = "fx/weapons/blaster_projectile.WAV"; description = ProjectileLooping3d; preload = true; }; datablock AudioProfile(blasterExpSound) { filename = "fx/weapons/blaster_impact.WAV"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(BlasterDryFireSound) { filename = "fx/weapons/chaingun_dryfire.wav"; description = AudioClose3d; preload = true; }; //-------------------------------------------------------------------------- // Splash //-------------------------------------------------------------------------- datablock ParticleData( BlasterSplashParticle ) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -1.4; lifetimeMS = 300; lifetimeVarianceMS = 0; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.05; sizes[1] = 0.2; sizes[2] = 0.2; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( BlasterSplashEmitter ) { ejectionPeriodMS = 4; periodVarianceMS = 0; ejectionVelocity = 4; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 50; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "BlasterSplashParticle"; }; datablock SplashData(BlasterSplash) { numSegments = 15; ejectionFreq = 15; ejectionAngle = 40; ringLifetime = 0.35; lifetimeMS = 300; velocity = 3.0; startRadius = 0.0; acceleration = -3.0; texWrap = 5.0; texture = "special/water2"; emitter[0] = BlasterSplashEmitter; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 1.0"; colors[2] = "0.7 0.8 1.0 0.0"; colors[3] = "0.7 0.8 1.0 0.0"; times[0] = 0.0; times[1] = 0.4; times[2] = 0.8; times[3] = 1.0; }; //-------------------------------------------------------------------------- // Explosion //-------------------------------------- datablock ParticleData(BlasterExplosionParticle1) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent4"; colors[0] = "1.0 0.8 0.2 1.0"; colors[1] = "1.0 0.4 0.2 1.0"; colors[2] = "1.0 0.0 0.0 0.0"; sizes[0] = 0.25; sizes[1] = 0.5; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(BlasterExplosionEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 2; velocityVariance = 1.5; ejectionOffset = 0.0; thetaMin = 70; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "BlasterExplosionParticle1"; }; datablock ParticleData(BlasterExplosionParticle2) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/blasterHit"; colors[0] = "1.0 0.2 0.2 1.0"; colors[1] = "1.0 0.2 0.2 0.5"; colors[2] = "1.0 0.0 0.0 0.0"; sizes[0] = 0.3; sizes[1] = 0.90; sizes[2] = 1.50; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(BlasterExplosionEmitter2) { ejectionPeriodMS = 30; periodVarianceMS = 0; ejectionVelocity = 1; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = false; lifetimeMS = 200; particles = "BlasterExplosionParticle2"; }; datablock ExplosionData(BlasterExplosion) { soundProfile = blasterExpSound; emitter[0] = BlasterExplosionEmitter; emitter[1] = BlasterExplosionEmitter2; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock EnergyProjectileData(EnergyBolt) { emitterDelay = -1; directDamage = 0.15; directDamageType = $DamageType::Blaster; kickBackStrength = 0.0; bubbleEmitTime = 1.0; sound = BlasterProjectileSound; velInheritFactor = 0.5; explosion = "BlasterExplosion"; splash = BlasterSplash; grenadeElasticity = 0.998; grenadeFriction = 0.0; armingDelayMS = 500; muzzleVelocity = 90.0; drag = 0.05; gravityMod = 0.0; dryVelocity = 200.0; wetVelocity = 150.0; reflectOnWaterImpactAngle = 0.0; explodeOnWaterImpact = false; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = 3000; hasLight = true; lightRadius = 3.0; lightColor = "0.5 0.175 0.175"; scale = "0.25 20.0 1.0"; crossViewAng = 0.99; crossSize = 0.55; lifetimeMS = 3000; blurLifetime = 0.2; blurWidth = 0.25; blurColor = "0.4 0.0 0.0 1.0"; texture[0] = "special/blasterBolt"; texture[1] = "special/blasterBoltCross"; }; //-------------------------------------------------------------------------- // Weapon //-------------------------------------- datablock ShapeBaseImageData(BlasterImage) { className = WeaponImage; shapeFile = "weapon_energy.dts"; item = Blaster; projectile = EnergyBolt; projectileType = EnergyProjectile; usesEnergy = true; fireEnergy = 4; minEnergy = 4; stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "ActivateReady"; stateTimeoutValue[0] = 0.5; stateSequence[0] = "Activate"; stateSound[0] = BlasterSwitchSound; stateName[1] = "ActivateReady"; stateTransitionOnLoaded[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "Fire"; stateName[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.3; stateFire[3] = true; stateRecoil[3] = NoRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateSound[3] = BlasterFireSound; stateScript[3] = "onFire"; stateName[4] = "Reload"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateTransitionOnTimeout[4] = "Ready"; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateName[5] = "NoAmmo"; stateTransitionOnAmmo[5] = "Reload"; stateSequence[5] = "NoAmmo"; stateTransitionOnTriggerDown[5] = "DryFire"; stateName[6] = "DryFire"; stateTimeoutValue[6] = 0.3; stateSound[6] = BlasterDryFireSound; stateTransitionOnTimeout[6] = "Ready"; }; datablock ItemData(Blaster) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_energy.dts"; image = BlasterImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a blaster"; }; PK !(u scripts/weapons/cameraGrenade.cs// ------------------------------------------------------------------ // Deployable camera script // // Cameras will occupy grenade slots vice backpack slots. The player // will "throw" them like grenades, and they should stick to (and // deploy on) interior surfaces and terrain. // ------------------------------------------------------------------ $TeamDeployableMax[DeployedCamera] = 15; // ------------------------------------------ // force-feedback effect datablocks // ------------------------------------------ datablock EffectProfile(CameraGrenadeActivateEffect) { effectname = "weapons/grenade_camera_activate"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(CameraGrenadeAttachEffect) { effectname = "weapons/grenade_camera_activate"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(CameraGrenadeExplosionEffect) { effectname = "explosions/explosion.xpl10"; minDistance = 10; maxDistance = 30; }; // ------------------------------------------ // sound datablocks // ------------------------------------------ datablock AudioProfile(CameraGrenadeActivateSound) { filename = "fx/weapons/grenade_camera_activate.wav"; description = AudioClosest3d; preload = true; effect = CameraGrenadeActivateEffect; }; datablock AudioProfile(CameraGrenadeAttachSound) { filename = "fx/weapons/grenade_camera_attach.wav"; description = AudioClosest3d; preload = true; effect = CameraGrenadeAttachEffect; }; datablock AudioProfile(CameraGrenadeExplosionSound) { filename = "fx/explosions/explosion.xpl10.wav"; description = AudioExplosion3d; preload = true; effect = CameraGrenadeExplosionEffect; }; //-------------------------------------------------------------------------- // Camera explosion particle effects //-------------------------------------------------------------------------- datablock ExplosionData(CameraGrenadeExplosion) { soundProfile = CameraGrenadeExplosionSound; faceViewer = true; explosionShape = "effect_plasma_explosion.dts"; playSpeed = 1.0; sizes[0] = "0.2 0.2 0.2"; sizes[1] = "0.3 0.3 0.3"; }; // ------------------------------------------ // other datablocks // ------------------------------------------ datablock ItemData(CameraGrenadeThrown) { shapeFile = "camera.dts"; mass = 0.7; elasticity = 0.2; friction = 1; pickupRadius = 2; maxDamage = 0.8; sticky = true; emap = true; }; datablock ItemData(CameraGrenade) { className = HandInventory; catagory = "Handheld"; shapeFile = "camera.dts"; mass = 0.7; elasticity = 0.2; friction = 1; pickupRadius = 2; thrownItem = CameraGrenadeThrown; pickUpName = "a deployable camera"; computeCRC = true; emap = true; }; datablock SensorData(CameraSensorObject) { detects = true; detectsUsingLOS = true; detectionPings = false; detectsPassiveJammed = true; detectsActiveJammed = false; detectRadius = 40; detectsFOVOnly = true; useObjectFOV = true; }; datablock TurretData(TurretDeployedCamera) : TurretDamageProfile { className = CameraTurret; shapeFile = "camera.dts"; mass = 0.7; maxDamage = 0.2; destroyedLevel = 0.2; disabledLevel = 0.2; repairRate = 0; explosion = CameraGrenadeExplosion; thetaMin = 0; thetaMax = 180; //thetaNull = 90; deployedObject = true; isShielded = false; energyPerDamagePoint = 40; maxEnergy = 30; renderWhenDestroyed = false; rechargeRate = 0.05; cameraDefaultFov = 150; cameraMinFov = 150; cameraMaxFov = 150; neverUpdateControl = true; canControl = true; canObserve = true; observeThroughObject = true; cmdCategory = "DSupport"; cmdIcon = CMDCameraIcon; cmdMiniIconName = "commander/MiniIcons/com_camera_grey"; targetNameTag = 'Deployed'; targetTypeTag = 'Camera'; sensorData = CameraSensorObject; sensorRadius = CameraSensorObject.detectRadius; firstPersonOnly = true; observeParameters = "0.5 4.5 4.5"; debrisShapeName = "debris_generic_small.dts"; debris = SmallShapeDebris; }; datablock TurretImageData(DeployableCameraBarrel) { shapeFile = "turret_muzzlepoint.dts"; usesEnergy = false; // Turret parameters activationMS = 100; deactivateDelayMS = 100; thinkTimeMS = 100; degPerSecTheta = 180; degPerSecPhi = 360; }; //------------------------------------------------------------------------------ // Functions: //------------------------------------------------------------------------------ function CameraGrenadeThrown::onCollision( %data, %obj, %col ) { // Do nothing... } PK !(2vEEscripts/weapons/chaingun.cs//-------------------------------------- // Chaingun //-------------------------------------- //-------------------------------------------------------------------------- // Force-Feedback Effects //-------------------------------------- datablock EffectProfile(ChaingunSwitchEffect) { effectname = "weapons/chaingun_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ChaingunFireEffect) { effectname = "weapons/chaingun_fire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ChaingunSpinUpEffect) { effectname = "weapons/chaingun_spinup"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ChaingunSpinDownEffect) { effectname = "weapons/chaingun_spindown"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ChaingunDryFire) { effectname = "weapons/chaingun_dryfire"; minDistance = 2.5; maxDistance = 2.5; }; //-------------------------------------------------------------------------- // Sounds //-------------------------------------- datablock AudioProfile(ChaingunSwitchSound) { filename = "fx/weapons/chaingun_activate.wav"; description = AudioClosest3d; preload = true; effect = ChaingunSwitchEffect; }; datablock AudioProfile(ChaingunFireSound) { filename = "fx/weapons/chaingun_fire.wav"; description = AudioDefaultLooping3d; preload = true; effect = ChaingunFireEffect; }; datablock AudioProfile(ChaingunProjectile) { filename = "fx/weapons/chaingun_projectile.wav"; description = ProjectileLooping3d; preload = true; }; datablock AudioProfile(ChaingunImpact) { filename = "fx/weapons/chaingun_impact.WAV"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(ChaingunSpinDownSound) { filename = "fx/weapons/chaingun_spindown.wav"; description = AudioClosest3d; preload = true; effect = ChaingunSpinDownEffect; }; datablock AudioProfile(ChaingunSpinUpSound) { filename = "fx/weapons/chaingun_spinup.wav"; description = AudioClosest3d; preload = true; effect = ChaingunSpinUpEffect; }; datablock AudioProfile(ChaingunDryFireSound) { filename = "fx/weapons/chaingun_dryfire.wav"; description = AudioClose3d; preload = true; effect = ChaingunDryFire; }; datablock AudioProfile(ShrikeBlasterProjectileSound) { filename = "fx/vehicles/shrike_blaster_projectile.wav"; description = ProjectileLooping3d; preload = true; }; //-------------------------------------------------------------------------- // Splash //-------------------------------------------------------------------------- datablock ParticleData( ChaingunSplashParticle ) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -1.4; lifetimeMS = 300; lifetimeVarianceMS = 0; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.05; sizes[1] = 0.2; sizes[2] = 0.2; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( ChaingunSplashEmitter ) { ejectionPeriodMS = 4; periodVarianceMS = 0; ejectionVelocity = 3; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 50; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "ChaingunSplashParticle"; }; datablock SplashData(ChaingunSplash) { numSegments = 10; ejectionFreq = 10; ejectionAngle = 20; ringLifetime = 0.4; lifetimeMS = 400; velocity = 3.0; startRadius = 0.0; acceleration = -3.0; texWrap = 5.0; texture = "special/water2"; emitter[0] = ChaingunSplashEmitter; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 1.0"; colors[2] = "0.7 0.8 1.0 0.0"; colors[3] = "0.7 0.8 1.0 0.0"; times[0] = 0.0; times[1] = 0.4; times[2] = 0.8; times[3] = 1.0; }; //-------------------------------------------------------------------------- // Particle Effects //-------------------------------------- datablock ParticleData(ChaingunFireParticle) { dragCoefficient = 2.75; gravityCoefficient = 0.1; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 550; lifetimeVarianceMS = 0; textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 1.0"; colors[1] = "0.46 0.36 0.26 0.0"; sizes[0] = 0.25; sizes[1] = 0.20; }; datablock ParticleEmitterData(ChaingunFireEmitter) { ejectionPeriodMS = 6; periodVarianceMS = 0; ejectionVelocity = 10; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 12; phiReferenceVel = 0; phiVariance = 360; overrideAdvance = true; particles = "ChaingunFireParticle"; }; //-------------------------------------------------------------------------- // Explosions //-------------------------------------- datablock ParticleData(ChaingunExplosionParticle1) { dragCoefficient = 0.65; gravityCoefficient = 0.3; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 150; textureName = "particleTest"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 0.0"; sizes[0] = 0.0625; sizes[1] = 0.2; }; datablock ParticleEmitterData(ChaingunExplosionEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 0.75; velocityVariance = 0.25; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 60; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "ChaingunExplosionParticle1"; }; datablock ParticleData(ChaingunImpactSmokeParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.2; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1000; lifetimeVarianceMS = 200; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 90.0; textureName = "particleTest"; colors[0] = "0.7 0.7 0.7 0.0"; colors[1] = "0.7 0.7 0.7 0.4"; colors[2] = "0.7 0.7 0.7 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(ChaingunImpactSmoke) { ejectionPeriodMS = 8; periodVarianceMS = 1; ejectionVelocity = 1.0; velocityVariance = 0.5; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 35; overrideAdvances = false; particles = "ChaingunImpactSmokeParticle"; lifetimeMS = 50; }; datablock ParticleData(ChaingunSparks) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 300; lifetimeVarianceMS = 0; textureName = "special/spark00"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 1.0"; colors[2] = "1.0 0.36 0.26 0.0"; sizes[0] = 0.6; sizes[1] = 0.2; sizes[2] = 0.05; times[0] = 0.0; times[1] = 0.2; times[2] = 1.0; }; datablock ParticleEmitterData(ChaingunSparkEmitter) { ejectionPeriodMS = 4; periodVarianceMS = 0; ejectionVelocity = 4; velocityVariance = 2.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 50; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "ChaingunSparks"; }; datablock ExplosionData(ChaingunExplosion) { soundProfile = ChaingunImpact; emitter[0] = ChaingunImpactSmoke; emitter[1] = ChaingunSparkEmitter; faceViewer = false; }; datablock ShockwaveData(ScoutChaingunHit) { width = 0.5; numSegments = 13; numVertSegments = 1; velocity = 0.5; acceleration = 2.0; lifetimeMS = 900; height = 0.1; verticalCurve = 0.5; mapToTerrain = false; renderBottom = false; orientToNormal = true; texture[0] = "special/shockwave5"; texture[1] = "special/gradient"; texWrap = 3.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; colors[0] = "0.6 0.6 1.0 1.0"; colors[1] = "0.6 0.3 1.0 0.5"; colors[2] = "0.0 0.0 1.0 0.0"; }; datablock ParticleData(ScoutChaingunExplosionParticle1) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent4"; colors[0] = "0.6 0.6 1.0 1.0"; colors[1] = "0.6 0.3 1.0 1.0"; colors[2] = "0.0 0.0 1.0 0.0"; sizes[0] = 0.25; sizes[1] = 0.5; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(ScoutChaingunExplosionEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 2; velocityVariance = 1.5; ejectionOffset = 0.0; thetaMin = 80; thetaMax = 90; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "ScoutChaingunExplosionParticle1"; }; datablock ExplosionData(ScoutChaingunExplosion) { soundProfile = blasterExpSound; shockwave = ScoutChaingunHit; emitter[0] = ScoutChaingunExplosionEmitter; }; //-------------------------------------------------------------------------- // Particle effects //-------------------------------------- datablock DebrisData( ShellDebris ) { shapeName = "weapon_chaingun_ammocasing.dts"; lifetime = 3.0; minSpinSpeed = 300.0; maxSpinSpeed = 400.0; elasticity = 0.5; friction = 0.2; numBounces = 3; fade = true; staticOnMaxBounce = true; snapOnMaxBounce = true; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock DecalData(ChaingunDecal1) { sizeX = 0.05; sizeY = 0.05; textureName = "special/bullethole1"; }; datablock DecalData(ChaingunDecal2) : ChaingunDecal1 { textureName = "special/bullethole2"; }; datablock DecalData(ChaingunDecal3) : ChaingunDecal1 { textureName = "special/bullethole3"; }; datablock DecalData(ChaingunDecal4) : ChaingunDecal1 { textureName = "special/bullethole4"; }; datablock DecalData(ChaingunDecal5) : ChaingunDecal1 { textureName = "special/bullethole5"; }; datablock DecalData(ChaingunDecal6) : ChaingunDecal1 { textureName = "special/bullethole6"; }; datablock TracerProjectileData(ChaingunBullet) { doDynamicClientHits = true; directDamage = 0.0825; directDamageType = $DamageType::Bullet; explosion = "ChaingunExplosion"; splash = ChaingunSplash; kickBackStrength = 0.0; sound = ChaingunProjectile; dryVelocity = 425.0; wetVelocity = 100.0; velInheritFactor = 1.0; fizzleTimeMS = 3000; lifetimeMS = 3000; explodeOnDeath = false; reflectOnWaterImpactAngle = 0.0; explodeOnWaterImpact = false; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = 3000; tracerLength = 15.0; tracerAlpha = false; tracerMinPixels = 6; tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75"; tracerTex[0] = "special/tracer00"; tracerTex[1] = "special/tracercross"; tracerWidth = 0.10; crossSize = 0.20; crossViewAng = 0.990; renderCross = true; decalData[0] = ChaingunDecal1; decalData[1] = ChaingunDecal2; decalData[2] = ChaingunDecal3; decalData[3] = ChaingunDecal4; decalData[4] = ChaingunDecal5; decalData[5] = ChaingunDecal6; }; //-------------------------------------------------------------------------- // Scout Projectile //-------------------------------------- datablock TracerProjectileData(ScoutChaingunBullet) { doDynamicClientHits = true; directDamage = 0.125; explosion = "ScoutChaingunExplosion"; splash = ChaingunSplash; directDamageType = $DamageType::ShrikeBlaster; kickBackStrength = 0.0; sound = ShrikeBlasterProjectileSound; dryVelocity = 425.0; wetVelocity = 100.0; velInheritFactor = 1.0; fizzleTimeMS = 1000; lifetimeMS = 1000; explodeOnDeath = false; reflectOnWaterImpactAngle = 0.0; explodeOnWaterImpact = false; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = 3000; tracerLength = 45.0; tracerAlpha = false; tracerMinPixels = 6; tracerColor = "1.0 1.0 1.0 1.0"; tracerTex[0] = "special/shrikeBolt"; tracerTex[1] = "special/shrikeBoltCross"; tracerWidth = 0.55; crossSize = 0.99; crossViewAng = 0.990; renderCross = true; }; //-------------------------------------------------------------------------- // Ammo //-------------------------------------- datablock ItemData(ChaingunAmmo) { className = Ammo; catagory = "Ammo"; shapeFile = "ammo_chaingun.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "some chaingun ammo"; computeCRC = true; }; //-------------------------------------------------------------------------- // Weapon //-------------------------------------- datablock ShapeBaseImageData(ChaingunImage) { className = WeaponImage; shapeFile = "weapon_chaingun.dts"; item = Chaingun; ammo = ChaingunAmmo; projectile = ChaingunBullet; projectileType = TracerProjectile; emap = true; casing = ShellDebris; shellExitDir = "1.0 0.3 1.0"; shellExitOffset = "0.15 -0.56 -0.1"; shellExitVariance = 15.0; shellVelocity = 3.0; projectileSpread = 8.0 / 1000.0; //-------------------------------------- stateName[0] = "Activate"; stateSequence[0] = "Activate"; stateSound[0] = ChaingunSwitchSound; stateAllowImageChange[0] = false; // stateTimeoutValue[0] = 0.5; stateTransitionOnTimeout[0] = "Ready"; stateTransitionOnNoAmmo[0] = "NoAmmo"; //-------------------------------------- stateName[1] = "Ready"; stateSpinThread[1] = Stop; // stateTransitionOnTriggerDown[1] = "Spinup"; stateTransitionOnNoAmmo[1] = "NoAmmo"; //-------------------------------------- stateName[2] = "NoAmmo"; stateTransitionOnAmmo[2] = "Ready"; stateSpinThread[2] = Stop; stateTransitionOnTriggerDown[2] = "DryFire"; //-------------------------------------- stateName[3] = "Spinup"; stateSpinThread[3] = SpinUp; stateSound[3] = ChaingunSpinupSound; // stateTimeoutValue[3] = 0.5; stateWaitForTimeout[3] = false; stateTransitionOnTimeout[3] = "Fire"; stateTransitionOnTriggerUp[3] = "Spindown"; //-------------------------------------- stateName[4] = "Fire"; stateSequence[4] = "Fire"; stateSequenceRandomFlash[4] = true; stateSpinThread[4] = FullSpeed; stateSound[4] = ChaingunFireSound; //stateRecoil[4] = LightRecoil; stateAllowImageChange[4] = false; stateScript[4] = "onFire"; stateFire[4] = true; stateEjectShell[4] = true; // stateTimeoutValue[4] = 0.15; stateTransitionOnTimeout[4] = "Fire"; stateTransitionOnTriggerUp[4] = "Spindown"; stateTransitionOnNoAmmo[4] = "EmptySpindown"; //-------------------------------------- stateName[5] = "Spindown"; stateSound[5] = ChaingunSpinDownSound; stateSpinThread[5] = SpinDown; // stateTimeoutValue[5] = 1.0; stateWaitForTimeout[5] = true; stateTransitionOnTimeout[5] = "Ready"; stateTransitionOnTriggerDown[5] = "Spinup"; //-------------------------------------- stateName[6] = "EmptySpindown"; stateSound[6] = ChaingunSpinDownSound; stateSpinThread[6] = SpinDown; // stateTimeoutValue[6] = 0.5; stateTransitionOnTimeout[6] = "NoAmmo"; //-------------------------------------- stateName[7] = "DryFire"; stateSound[7] = ChaingunDryFireSound; stateTimeoutValue[7] = 0.5; stateTransitionOnTimeout[7] = "NoAmmo"; }; datablock ItemData(Chaingun) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_chaingun.dts"; image = ChaingunImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a chaingun"; computeCRC = true; emap = true; }; PK !($scripts/weapons/concussionGrenade.cs// grenade (thrown by hand) script // ------------------------------------------------------------------------ datablock EffectProfile(ConcussionGrenadeThrowEffect) { effectname = "weapons/grenade_throw"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ConcussionGrenadeSwitchEffect) { effectname = "weapons/generic_switch"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ConcussionGrenadeExplosionEffect) { effectname = "explosions/grenade_explode"; minDistance = 10; maxDistance = 50; }; datablock AudioProfile(ConcussionGrenadeExplosionSound) { filename = "fx/weapons/grenade_explode.wav"; description = AudioExplosion3d; preload = true; effect = ConcussionGrenadeExplosionEffect; }; // ------------------------------------------------------ // z0dd - ZOD, 5/8/02. Duplicate datablock, waste of mem. //datablock AudioProfile(ConcussionGrenadeExplosionSound) //{ // filename = "fx/weapons/grenade_explode.wav"; // description = AudioExplosion3d; // preload = true; // effect = ConcussionGrenadeExplosionEffect; //}; // ------------------------------------------------------ //-------------------------------------------------------------------------- // Sparks //-------------------------------------------------------------------------- datablock ParticleData(ConcussionGrenadeSparks) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 350; textureName = "special/bigSpark"; colors[0] = "0.56 0.36 1.0 1.0"; colors[1] = "0.56 0.36 1.0 1.0"; colors[2] = "1.0 0.36 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.25; sizes[2] = 0.25; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(ConcussionGrenadeSparkEmitter) { ejectionPeriodMS = 1; periodVarianceMS = 0; ejectionVelocity = 12; velocityVariance = 6.75; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 180; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "ConcussionGrenadeSparks"; }; datablock ParticleData( ConcussionGrenadeCrescentParticle ) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent3"; colors[0] = "0.8 0.8 1.0 1.00"; colors[1] = "0.8 0.5 1.0 0.20"; colors[2] = "0.2 0.8 1.0 0.0"; sizes[0] = 2.0; sizes[1] = 4.0; sizes[2] = 5.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( ConcussionGrenadeCrescentEmitter ) { ejectionPeriodMS = 15; periodVarianceMS = 0; ejectionVelocity = 20; velocityVariance = 10.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "ConcussionGrenadeCrescentParticle"; }; //-------------------------------------------------------------------------- // Shockwave //-------------------------------------------------------------------------- datablock ShockwaveData(ConcussionGrenadeShockwave) { width = 4.0; numSegments = 20; numVertSegments = 2; velocity = 5; acceleration = 10.0; lifetimeMS = 1000; height = 1.0; is2D = true; texture[0] = "special/shockwave4"; texture[1] = "special/gradient"; texWrap = 6.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; colors[0] = "0.8 0.8 1.0 1.00"; colors[1] = "0.8 0.5 1.0 0.20"; colors[2] = "0.2 0.8 1.0 0.0"; }; //-------------------------------------------------------------------------- // Explosion //-------------------------------------------------------------------------- datablock ExplosionData(ConcussionGrenadeExplosion) { soundProfile = ConcussionGrenadeExplosionSound; shockwave = ConcussionGrenadeShockwave; emitter[0] = ConcussionGrenadeSparkEmitter; emitter[1] = ConcussionGrenadeCrescentEmitter; shakeCamera = true; camShakeFreq = "4.0 5.0 4.5"; camShakeAmp = "140.0 140.0 140.0"; camShakeDuration = 1.0; camShakeRadius = 15.0; }; //-------------------------------------------------------------------------- // Item Data //-------------------------------------------------------------------------- datablock ItemData(ConcussionGrenadeThrown) { shapeFile = "grenade.dts"; mass = 0.7; elasticity = 0.2; friction = 1; pickupRadius = 2; maxDamage = 0.5; explosion = ConcussionGrenadeExplosion; damageRadius = 15.0; radiusDamageType = $DamageType::Grenade; kickBackStrength = 3500; computeCRC = true; }; datablock ItemData(ConcussionGrenade) { className = HandInventory; catagory = "Handheld"; shapeFile = "grenade.dts"; mass = 0.7; elasticity = 0.2; friction = 1; pickupRadius = 2; thrownItem = ConcussionGrenadeThrown; pickUpName = "some concussion grenades"; isGrenade = true; }; //-------------------------------------------------------------------------- // Functions: //-------------------------------------------------------------------------- function ConcussionGrenadeThrown::onCollision( %data, %obj, %col ) { // Do nothing... } PK !(ﭭz1z1scripts/weapons/disc.cs//-------------------------------------- // Disc launcher //-------------------------------------- //-------------------------------------------------------------------------- // Force-Feedback Effects //-------------------------------------- datablock EffectProfile(DiscFireEffect) { effectname = "weapons/spinfusor_fire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(DiscSwitchEffect) { effectname = "weapons/spinfusor_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(DiscDryFireEffect) { effectname = "weapons/spinfusor_dryfire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(DiscIdleEffect) { effectname = "weapons/spinfusor_idle"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(DiscReloadEffect) { effectname = "weapons/spinfusor_reload"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(DiscExpEffect) { effectname = "explosions/grenade_explode"; minDistance = 5; maxDistance = 20; }; //-------------------------------------------------------------------------- // Sounds //-------------------------------------- datablock AudioProfile(DiscSwitchSound) { filename = "fx/weapons/blaster_activate.wav"; description = AudioClosest3d; preload = true; effect = DiscSwitchEffect; }; datablock AudioProfile(DiscLoopSound) { filename = "fx/weapons/spinfusor_idle.wav"; description = ClosestLooping3d; effect = DiscIdleEffect; }; datablock AudioProfile(DiscFireSound) { filename = "fx/weapons/spinfusor_fire.wav"; description = AudioDefault3d; preload = true; effect = DiscFireEffect; }; datablock AudioProfile(DiscReloadSound) { filename = "fx/weapons/spinfusor_reload.wav"; description = AudioClosest3d; preload = true; effect = DiscReloadEffect; }; datablock AudioProfile(discExpSound) { filename = "fx/weapons/spinfusor_impact.wav"; description = AudioExplosion3d; preload = true; effect = DiscExpEffect; }; datablock AudioProfile(underwaterDiscExpSound) { filename = "fx/weapons/spinfusor_impact_UW.wav"; description = AudioExplosion3d; preload = true; effect = DiscExpEffect; }; datablock AudioProfile(discProjectileSound) { filename = "fx/weapons/spinfusor_projectile.wav"; description = ProjectileLooping3d; preload = true; }; datablock AudioProfile(DiscDryFireSound) { filename = "fx/weapons/spinfusor_dryfire.wav"; description = AudioClose3d; preload = true; effect = DiscDryFireEffect; }; //-------------------------------------------------------------------------- // Explosion //-------------------------------------- datablock ParticleData(DiscExplosionBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.25; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 2000; lifetimeVarianceMS = 750; useInvAlpha = false; textureName = "special/bubbles"; spinRandomMin = -100.0; spinRandomMax = 100.0; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 0.4"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 1.0; sizes[1] = 1.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.3; times[2] = 1.0; }; datablock ParticleEmitterData(DiscExplosionBubbleEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 1.0; ejectionOffset = 3.0; velocityVariance = 0.5; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "DiscExplosionBubbleParticle"; }; datablock ExplosionData(UnderwaterDiscExplosion) { explosionShape = "disc_explosion.dts"; soundProfile = underwaterDiscExpSound; faceViewer = true; sizes[0] = "1.3 1.3 1.3"; sizes[1] = "0.75 0.75 0.75"; sizes[2] = "0.4 0.4 0.4"; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; emitter[0] = "DiscExplosionBubbleEmitter"; shakeCamera = true; camShakeFreq = "10.0 11.0 10.0"; camShakeAmp = "20.0 20.0 20.0"; camShakeDuration = 0.5; camShakeRadius = 10.0; }; datablock ExplosionData(DiscExplosion) { explosionShape = "disc_explosion.dts"; soundProfile = discExpSound; faceViewer = true; explosionScale = "1 1 1"; shakeCamera = true; camShakeFreq = "10.0 11.0 10.0"; camShakeAmp = "20.0 20.0 20.0"; camShakeDuration = 0.5; camShakeRadius = 10.0; sizes[0] = "1.0 1.0 1.0"; sizes[1] = "1.0 1.0 1.0"; times[0] = 0.0; times[1] = 1.0; }; //-------------------------------------------------------------------------- // Splash //-------------------------------------------------------------------------- datablock ParticleData(DiscMist) { dragCoefficient = 2.0; gravityCoefficient = -0.05; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 400; lifetimeVarianceMS = 100; useInvAlpha = false; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.8; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(DiscMistEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 3.0; velocityVariance = 2.0; ejectionOffset = 0.0; thetaMin = 85; thetaMax = 85; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; lifetimeMS = 250; particles = "DiscMist"; }; datablock ParticleData( DiscSplashParticle2 ) { dragCoeffiecient = 0.4; gravityCoefficient = -0.03; // rises slowly inheritedVelFactor = 0.025; lifetimeMS = 600; lifetimeVarianceMS = 300; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -200.0; spinRandomMax = 200.0; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 1.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( DiscSplashEmitter2 ) { ejectionPeriodMS = 25; ejectionOffset = 0.2; periodVarianceMS = 0; ejectionVelocity = 2.25; velocityVariance = 0.50; thetaMin = 0.0; thetaMax = 30.0; lifetimeMS = 250; particles = "DiscSplashParticle2"; }; datablock ParticleData( DiscSplashParticle ) { dragCoefficient = 1; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 0; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( DiscSplashEmitter ) { ejectionPeriodMS = 1; periodVarianceMS = 0; ejectionVelocity = 3; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 60; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "DiscSplashParticle"; }; datablock SplashData(DiscSplash) { numSegments = 15; ejectionFreq = 0.0001; ejectionAngle = 45; ringLifetime = 0.5; lifetimeMS = 400; velocity = 5.0; startRadius = 0.0; acceleration = -3.0; texWrap = 5.0; texture = "special/water2"; emitter[0] = DiscSplashEmitter; emitter[1] = DiscMistEmitter; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 1.0"; colors[2] = "0.7 0.8 1.0 0.0"; colors[3] = "0.7 0.8 1.0 0.0"; times[0] = 0.0; times[1] = 0.4; times[2] = 0.8; times[3] = 1.0; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock LinearProjectileData(DiscProjectile) { projectileShapeName = "disc.dts"; emitterDelay = -1; directDamage = 0.0; hasDamageRadius = true; indirectDamage = 0.50; damageRadius = 7.5; radiusDamageType = $DamageType::Disc; kickBackStrength = 1750; sound = discProjectileSound; explosion = "DiscExplosion"; underwaterExplosion = "UnderwaterDiscExplosion"; splash = DiscSplash; dryVelocity = 90; wetVelocity = 50; velInheritFactor = 0.5; fizzleTimeMS = 5000; lifetimeMS = 5000; explodeOnDeath = true; reflectOnWaterImpactAngle = 15.0; explodeOnWaterImpact = true; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = 5000; activateDelayMS = 200; hasLight = true; lightRadius = 6.0; lightColor = "0.175 0.175 0.5"; }; //-------------------------------------------------------------------------- // Ammo //-------------------------------------- datablock ItemData(DiscAmmo) { className = Ammo; catagory = "Ammo"; shapeFile = "ammo_disc.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "some spinfusor discs"; }; //-------------------------------------------------------------------------- // Weapon //-------------------------------------- datablock ShapeBaseImageData(DiscImage) { className = WeaponImage; shapeFile = "weapon_disc.dts"; item = Disc; ammo = DiscAmmo; offset = "0 0 0"; emap = true; projectileSpread = 0; projectile = DiscProjectile; projectileType = LinearProjectile; // State Data stateName[0] = "Preactivate"; stateTransitionOnLoaded[0] = "Activate"; stateTransitionOnNoAmmo[0] = "NoAmmo"; stateName[1] = "Activate"; stateTransitionOnTimeout[1] = "Ready"; stateTimeoutValue[1] = 0.5; stateSequence[1] = "Activated"; stateSound[1] = DiscSwitchSound; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "Fire"; stateSequence[2] = "DiscSpin"; stateSound[2] = DiscLoopSound; stateName[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 1.25; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateScript[3] = "onFire"; stateSound[3] = DiscFireSound; stateName[4] = "Reload"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateTransitionOnTimeout[4] = "Ready"; stateTimeoutValue[4] = 0.5; // 0.25 load, 0.25 spinup stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateSound[4] = DiscReloadSound; stateName[5] = "NoAmmo"; stateTransitionOnAmmo[5] = "Reload"; stateSequence[5] = "NoAmmo"; stateTransitionOnTriggerDown[5] = "DryFire"; stateName[6] = "DryFire"; stateSound[6] = DiscDryFireSound; stateTimeoutValue[6] = 1.0; stateTransitionOnTimeout[6] = "NoAmmo"; }; datablock ItemData(Disc) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_disc.dts"; image = DiscImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a spinfusor"; emap = true; }; PK !(j$ scripts/weapons/flareGrenade.cs// grenade (thrown by hand) script // ------------------------------------------------------------------------ datablock AudioProfile(FlareGrenadeBurnSound) { filename = "fx/weapons/grenade_flare_burn.wav"; description = CloseLooping3d; preload = true; }; datablock AudioProfile(FlareGrenadeExplosionSound) { filename = "fx/weapons/grenade_flare_burn.wav"; description = CloseLooping3d; preload = true; }; //-------------------------------------------------------------------------- // Particle effects //-------------------------------------- datablock ParticleData(FlareParticle) { dragCoeffiecient = 0.0; gravityCoefficient = 0.15; inheritedVelFactor = 0.5; lifetimeMS = 1800; lifetimeVarianceMS = 200; textureName = "special/flareSpark"; colors[0] = "1.0 1.0 1.0 1.0"; colors[1] = "1.0 1.0 1.0 1.0"; colors[2] = "1.0 1.0 1.0 0.0"; sizes[0] = 0.6; sizes[1] = 0.3; sizes[2] = 0.1; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(FlareEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 1.0; velocityVariance = 0.0; thetaMin = 0.0; thetaMax = 90.0; orientParticles = true; orientOnVelocity = false; particles = "FlareParticle"; }; //-------------------------------------------------------------------------- // Explosion - Flare Grenade //-------------------------------------- datablock ExplosionData(FlareGrenadeExplosion) { explosionShape = "energy_explosion.dts"; soundProfile = FlareGrenadeExplosionSound; faceViewer = true; explosionScale = "0.1 0.1 0.1"; }; //-------------------------------------------------------------------------- // Projectile - Flare Grenade //-------------------------------------- datablock FlareProjectileData(FlareGrenadeProj) { projectileShapeName = "grenade_projectile.dts"; emitterDelay = -1; directDamage = 0.0; hasDamageRadius = false; kickBackStrength = 1500; useLensFlare = false; sound = FlareGrenadeBurnSound; explosion = FlareGrenadeExplosion; velInheritFactor = 0.5; texture[0] = "special/flare3"; texture[1] = "special/LensFlare/flare00"; size = 4.0; baseEmitter = FlareEmitter; grenadeElasticity = 0.35; grenadeFriction = 0.2; armingDelayMS = 6000; muzzleVelocity = 15.0; drag = 0.1; gravityMod = 0.15; }; datablock ItemData(FlareGrenadeThrown) { shapeFile = "grenade.dts"; mass = 0.7; elasticity = 0.2; friction = 1; pickupRadius = 2; maxDamage = 0.4; sticky = false; gravityMod = 0.15; maxVelocity = 10; computeCRC = true; }; datablock ItemData(FlareGrenade) { className = HandInventory; catagory = "Handheld"; shapeFile = "grenade.dts"; mass = 0.7; elasticity = 0.2; friction = 1; pickupRadius = 2; thrownItem = FlareGrenadeThrown; pickUpName = "some flare grenades"; isGrenade = true; computeCRC = true; }; //------------------------------------------------------------------------------ // Functions: //------------------------------------------------------------------------------ function FlareGrenadeThrown::onCollision( %data, %obj, %col ) { // Do nothing... } PK !( CBscripts/weapons/flashGrenade.cs// grenade (thrown by hand) script // ------------------------------------------------------------------------ datablock EffectProfile(FlashGrenadeExplosionEffect) { effectname = "explosions/grenade_flash_explode"; minDistance = 10; maxDistance = 30; }; datablock AudioProfile(FlashGrenadeExplosionSound) { filename = "fx/explosions/grenade_flash_explode.wav"; description = AudioExplosion3d; preload = true; effect = FlashGrenadeExplosionEffect; }; datablock ExplosionData(FlashGrenadeExplosion) { explosionShape = "disc_explosion.dts"; soundProfile = FlashGrenadeExplosionSound; faceViewer = true; }; datablock ItemData(FlashGrenadeThrown) { shapeFile = "grenade.dts"; mass = 0.7; elasticity = 0.2; friction = 1; pickupRadius = 2; maxDamage = 0.4; explosion = FlashGrenadeExplosion; indirectDamage = 0.5; damageRadius = 10.0; radiusDamageType = $DamageType::Grenade; kickBackStrength = 1000; computeCRC = true; maxWhiteout = 1.2; }; datablock ItemData(FlashGrenade) { className = HandInventory; catagory = "Handheld"; shapeFile = "grenade.dts"; mass = 0.7; elasticity = 0.2; friction = 1; pickupRadius = 2; thrownItem = FlashGrenadeThrown; pickUpName = "some flash grenades"; isGrenade = true; computeCRC = true; }; //-------------------------------------------------------------------------- // Functions: //-------------------------------------------------------------------------- function FlashGrenadeThrown::onCollision( %data, %obj, %col ) { // Do nothing... } PK !(DG % %scripts/weapons/grenade.cs// ------------------------------------------------------------------------ // grenade (thrown by hand) script // ------------------------------------------------------------------------ datablock EffectProfile(GrenadeThrowEffect) { effectname = "weapons/grenade_throw"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(GrenadeSwitchEffect) { effectname = "weapons/generic_switch"; minDistance = 2.5; maxDistance = 2.5; }; datablock AudioProfile(GrenadeThrowSound) { filename = "fx/weapons/throw_grenade.wav"; description = AudioClose3D; preload = true; effect = GrenadeThrowEffect; }; datablock AudioProfile(GrenadeSwitchSound) { filename = "fx/weapons/generic_switch.wav"; description = AudioClosest3D; preload = true; effect = GrenadeSwitchEffect; }; //************************************************************************** // Hand Grenade underwater fx //************************************************************************** //-------------------------------------------------------------------------- // Underwater Hand Grenade Particle effects //-------------------------------------------------------------------------- datablock ParticleData(HandGrenadeExplosionBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.25; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 2000; lifetimeVarianceMS = 750; useInvAlpha = false; textureName = "special/bubbles"; spinRandomMin = -100.0; spinRandomMax = 100.0; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 0.4"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.75; sizes[1] = 0.75; sizes[2] = 0.75; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(HandGrenadeExplosionBubbleEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 1.0; ejectionOffset = 2.0; velocityVariance = 0.5; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "HandGrenadeExplosionBubbleParticle"; }; datablock ParticleData(UnderwaterHandGrenadeExplosionSmoke) { dragCoeffiecient = 105.0; gravityCoefficient = -0.0; // rises slowly inheritedVelFactor = 0.025; constantAcceleration = -1.0; lifetimeMS = 1250; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "0.4 0.4 1.0 1.0"; colors[1] = "0.4 0.4 1.0 0.5"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 1.0; sizes[1] = 3.0; sizes[2] = 5.0; times[0] = 0.0; times[1] = 0.2; times[2] = 1.0; }; datablock ParticleEmitterData(UnderwaterHandGrenadeExplosionSmokeEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 5.25; velocityVariance = 0.25; thetaMin = 0.0; thetaMax = 180.0; lifetimeMS = 250; particles = "UnderwaterHandGrenadeExplosionSmoke"; }; datablock ParticleData(UnderwaterHandGrenadeSparks) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 350; textureName = "special/droplet"; colors[0] = "0.6 0.6 1.0 1.0"; colors[1] = "0.6 0.6 1.0 1.0"; colors[2] = "0.6 0.6 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.25; sizes[2] = 0.25; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(UnderwaterHandGrenadeSparkEmitter) { ejectionPeriodMS = 3; periodVarianceMS = 0; ejectionVelocity = 10; velocityVariance = 6.75; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 180; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "UnderwaterHandGrenadeSparks"; }; datablock ExplosionData(UnderwaterHandGrenadeSubExplosion1) { offset = 1.0; emitter[0] = UnderwaterHandGrenadeExplosionSmokeEmitter; emitter[1] = UnderwaterHandGrenadeSparkEmitter; }; datablock ExplosionData(UnderwaterHandGrenadeSubExplosion2) { offset = 1.0; emitter[0] = UnderwaterHandGrenadeExplosionSmokeEmitter; emitter[1] = UnderwaterHandGrenadeSparkEmitter; }; datablock ExplosionData(UnderwaterHandGrenadeExplosion) { soundProfile = GrenadeExplosionSound; emitter[0] = UnderwaterHandGrenadeExplosionSmokeEmitter; emitter[1] = UnderwaterHandGrenadeSparkEmitter; emitter[2] = HandGrenadeExplosionBubbleEmitter; subExplosion[0] = UnderwaterHandGrenadeSubExplosion1; subExplosion[1] = UnderwaterHandGrenadeSubExplosion2; shakeCamera = true; camShakeFreq = "12.0 13.0 11.0"; camShakeAmp = "35.0 35.0 35.0"; camShakeDuration = 1.0; camShakeRadius = 15.0; }; //************************************************************************** // Hand Grenade effects //************************************************************************** //-------------------------------------------------------------------------- // Grenade Particle effects //-------------------------------------------------------------------------- datablock ParticleData(HandGrenadeExplosionSmoke) { dragCoeffiecient = 105.0; gravityCoefficient = -0.0; // rises slowly inheritedVelFactor = 0.025; constantAcceleration = -0.80; lifetimeMS = 1250; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "1.0 0.7 0.0 1.0"; colors[1] = "0.2 0.2 0.2 1.0"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 1.0; sizes[1] = 3.0; sizes[2] = 5.0; times[0] = 0.0; times[1] = 0.2; times[2] = 1.0; }; datablock ParticleEmitterData(HandGrenadeExplosionSmokeEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 10.25; velocityVariance = 0.25; thetaMin = 0.0; thetaMax = 180.0; lifetimeMS = 250; particles = "HandGrenadeExplosionSmoke"; }; datablock ParticleData(HandGrenadeSparks) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 350; textureName = "special/bigSpark"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 1.0"; colors[2] = "1.0 0.36 0.26 0.0"; sizes[0] = 0.5; sizes[1] = 0.25; sizes[2] = 0.25; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(HandGrenadeSparkEmitter) { ejectionPeriodMS = 3; periodVarianceMS = 0; ejectionVelocity = 18; velocityVariance = 6.75; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 180; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "HandGrenadeSparks"; }; //---------------------------------------------------- // Explosion //---------------------------------------------------- datablock ExplosionData(HandGrenadeSubExplosion1) { offset = 2.0; emitter[0] = HandGrenadeExplosionSmokeEmitter; emitter[1] = HandGrenadeSparkEmitter; }; datablock ExplosionData(HandGrenadeSubExplosion2) { offset = 2.0; emitter[0] = HandGrenadeExplosionSmokeEmitter; emitter[1] = HandGrenadeSparkEmitter; }; datablock ExplosionData(HandGrenadeExplosion) { soundProfile = GrenadeExplosionSound; emitter[0] = HandGrenadeExplosionSmokeEmitter; emitter[1] = HandGrenadeSparkEmitter; subExplosion[0] = HandGrenadeSubExplosion1; subExplosion[1] = HandGrenadeSubExplosion2; shakeCamera = true; camShakeFreq = "12.0 13.0 11.0"; camShakeAmp = "35.0 35.0 35.0"; camShakeDuration = 1.0; camShakeRadius = 15.0; }; datablock ItemData(GrenadeThrown) { className = Weapon; shapeFile = "grenade.dts"; mass = 0.7; elasticity = 0.2; friction = 1; pickupRadius = 2; maxDamage = 0.5; explosion = HandGrenadeExplosion; underwaterExplosion = UnderwaterHandGrenadeExplosion; indirectDamage = 0.4; damageRadius = 10.0; radiusDamageType = $DamageType::Grenade; kickBackStrength = 2000; computeCRC = true; }; datablock ItemData(Grenade) { className = HandInventory; catagory = "Handheld"; shapeFile = "grenade.dts"; mass = 0.7; elasticity = 0.2; friction = 1; pickupRadius = 2; thrownItem = GrenadeThrown; pickUpName = "some grenades"; isGrenade = true; computeCRC = true; }; PK !(gNgN"scripts/weapons/grenadeLauncher.cs//-------------------------------------- // Grenade launcher //-------------------------------------- //-------------------------------------------------------------------------- // Force-Feedback Effects //-------------------------------------- datablock EffectProfile(GrenadeSwitchEffect) { effectname = "weapons/generic_switch"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(GrenadeFireEffect) { effectname = "weapons/grenadelauncher_fire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(GrenadeDryFireEffect) { effectname = "weapons/grenadelauncher_dryfire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(GrenadeReloadEffect) { effectname = "weapons/generic_switch"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(GrenadeExplosionEffect) { effectname = "explosions/grenade_explode"; minDistance = 10; maxDistance = 35; }; //-------------------------------------------------------------------------- // Sounds //-------------------------------------- datablock AudioProfile(GrenadeSwitchSound) { filename = "fx/weapons/generic_switch.wav"; description = AudioClosest3d; preload = true; effect = GrenadeSwitchEffect; }; datablock AudioProfile(GrenadeFireSound) { filename = "fx/weapons/grenadelauncher_fire.wav"; description = AudioDefault3d; preload = true; effect = GrenadeFireEffect; }; datablock AudioProfile(GrenadeProjectileSound) { filename = "fx/weapons/grenadelauncher_projectile.wav"; description = ProjectileLooping3d; preload = true; }; datablock AudioProfile(GrenadeReloadSound) { filename = "fx/weapons/generic_switch.wav"; description = AudioClosest3d; preload = true; effect = GrenadeReloadEffect; }; datablock AudioProfile(GrenadeExplosionSound) { filename = "fx/weapons/grenade_explode.wav"; description = AudioExplosion3d; preload = true; effect = GrenadeExplosionEffect; }; datablock AudioProfile(UnderwaterGrenadeExplosionSound) { filename = "fx/weapons/grenade_explode_UW.wav"; description = AudioExplosion3d; preload = true; effect = GrenadeExplosionEffect; }; datablock AudioProfile(GrenadeDryFireSound) { filename = "fx/weapons/grenadelauncher_dryfire.wav"; description = AudioClose3d; preload = true; effect = GrenadeDryFireEffect; }; //---------------------------------------------------------------------------- // Underwater fx //---------------------------------------------------------------------------- datablock ParticleData(GrenadeExplosionBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.25; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1500; lifetimeVarianceMS = 600; useInvAlpha = false; textureName = "special/bubbles"; spinRandomMin = -100.0; spinRandomMax = 100.0; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 0.4"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 1.0; sizes[1] = 1.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(GrenadeExplosionBubbleEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 1.0; ejectionOffset = 3.0; velocityVariance = 0.5; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "GrenadeExplosionBubbleParticle"; }; datablock ParticleData(UnderwaterGrenadeDust) { dragCoefficient = 1.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.0; constantAcceleration = -1.1; lifetimeMS = 1000; lifetimeVarianceMS = 100; useInvAlpha = false; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.6 0.6 1.0 0.5"; colors[1] = "0.6 0.6 1.0 0.5"; colors[2] = "0.6 0.6 1.0 0.0"; sizes[0] = 3.0; sizes[1] = 3.0; sizes[2] = 3.0; times[0] = 0.0; times[1] = 0.7; times[2] = 1.0; }; datablock ParticleEmitterData(UnderwaterGrenadeDustEmitter) { ejectionPeriodMS = 15; periodVarianceMS = 0; ejectionVelocity = 15.0; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 70; thetaMax = 70; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; lifetimeMS = 250; particles = "UnderwaterGrenadeDust"; }; datablock ParticleData(UnderwaterGrenadeExplosionSmoke) { dragCoeffiecient = 0.4; gravityCoefficient = -0.25; // rises slowly inheritedVelFactor = 0.025; constantAcceleration = -1.1; lifetimeMS = 1250; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "0.1 0.1 1.0 1.0"; colors[1] = "0.4 0.4 1.0 1.0"; colors[2] = "0.4 0.4 1.0 0.0"; sizes[0] = 2.0; sizes[1] = 6.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(UnderwaterGExplosionSmokeEmitter) { ejectionPeriodMS = 15; periodVarianceMS = 0; ejectionVelocity = 6.25; velocityVariance = 0.25; thetaMin = 0.0; thetaMax = 90.0; lifetimeMS = 250; particles = "UnderwaterGrenadeExplosionSmoke"; }; datablock ParticleData(UnderwaterGrenadeSparks) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 350; textureName = "special/underwaterSpark"; colors[0] = "0.6 0.6 1.0 1.0"; colors[1] = "0.6 0.6 1.0 1.0"; colors[2] = "0.6 0.6 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.75; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(UnderwaterGrenadeSparksEmitter) { ejectionPeriodMS = 2; periodVarianceMS = 0; ejectionVelocity = 12; velocityVariance = 6.75; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 60; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "UnderwaterGrenadeSparks"; }; datablock ExplosionData(UnderwaterGrenadeExplosion) { soundProfile = UnderwaterGrenadeExplosionSound; faceViewer = true; explosionScale = "0.8 0.8 0.8"; emitter[0] = UnderwaterGrenadeDustEmitter; emitter[1] = UnderwaterGExplosionSmokeEmitter; emitter[2] = UnderwaterGrenadeSparksEmitter; emitter[3] = GrenadeExplosionBubbleEmitter; shakeCamera = true; camShakeFreq = "10.0 6.0 9.0"; camShakeAmp = "20.0 20.0 20.0"; camShakeDuration = 0.5; camShakeRadius = 20.0; }; //---------------------------------------------------------------------------- // Bubbles //---------------------------------------------------------------------------- datablock ParticleData(GrenadeBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.25; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1500; lifetimeVarianceMS = 600; useInvAlpha = false; textureName = "special/bubbles"; spinRandomMin = -100.0; spinRandomMax = 100.0; colors[0] = "0.7 0.8 1.0 0.4"; colors[1] = "0.7 0.8 1.0 0.4"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(GrenadeBubbleEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 1.0; ejectionOffset = 0.1; velocityVariance = 0.5; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "GrenadeBubbleParticle"; }; //---------------------------------------------------------------------------- // Debris //---------------------------------------------------------------------------- datablock ParticleData( GDebrisSmokeParticle ) { dragCoeffiecient = 1.0; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; lifetimeMS = 1000; lifetimeVarianceMS = 100; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -60.0; spinRandomMax = 60.0; colors[0] = "0.4 0.4 0.4 1.0"; colors[1] = "0.3 0.3 0.3 0.5"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 0.0; sizes[1] = 1.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( GDebrisSmokeEmitter ) { ejectionPeriodMS = 7; periodVarianceMS = 1; ejectionVelocity = 1.0; // A little oomph at the back end velocityVariance = 0.2; thetaMin = 0.0; thetaMax = 40.0; particles = "GDebrisSmokeParticle"; }; datablock DebrisData( GrenadeDebris ) { emitters[0] = GDebrisSmokeEmitter; explodeOnMaxBounce = true; elasticity = 0.4; friction = 0.2; lifetime = 0.3; lifetimeVariance = 0.02; numBounces = 1; }; //-------------------------------------------------------------------------- // Splash //-------------------------------------------------------------------------- datablock ParticleData( GrenadeSplashParticle ) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -1.4; lifetimeMS = 300; lifetimeVarianceMS = 0; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.05; sizes[1] = 0.2; sizes[2] = 0.2; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( GrenadeSplashEmitter ) { ejectionPeriodMS = 4; periodVarianceMS = 0; ejectionVelocity = 4; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 50; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "BlasterSplashParticle"; }; datablock SplashData(GrenadeSplash) { numSegments = 15; ejectionFreq = 15; ejectionAngle = 40; ringLifetime = 0.35; lifetimeMS = 300; velocity = 3.0; startRadius = 0.0; acceleration = -3.0; texWrap = 5.0; texture = "special/water2"; emitter[0] = BlasterSplashEmitter; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 1.0"; colors[2] = "0.7 0.8 1.0 1.0"; colors[3] = "0.7 0.8 1.0 1.0"; times[0] = 0.0; times[1] = 0.4; times[2] = 0.8; times[3] = 1.0; }; //-------------------------------------------------------------------------- // Particle effects //-------------------------------------- datablock ParticleData(GrenadeSmokeParticle) { dragCoeffiecient = 0.0; gravityCoefficient = -0.2; // rises slowly inheritedVelFactor = 0.00; lifetimeMS = 700; // lasts 2 second lifetimeVarianceMS = 150; // ...more or less textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -30.0; spinRandomMax = 30.0; colors[0] = "0.9 0.9 0.9 1.0"; colors[1] = "0.6 0.6 0.6 1.0"; colors[2] = "0.4 0.4 0.4 0.0"; sizes[0] = 0.25; sizes[1] = 1.0; sizes[2] = 3.0; times[0] = 0.0; times[1] = 0.2; times[2] = 1.0; }; datablock ParticleEmitterData(GrenadeSmokeEmitter) { ejectionPeriodMS = 15; periodVarianceMS = 5; ejectionVelocity = 1.25; velocityVariance = 0.50; thetaMin = 0.0; thetaMax = 90.0; particles = "GrenadeSmokeParticle"; }; datablock ParticleData(GrenadeDust) { dragCoefficient = 1.0; gravityCoefficient = -0.01; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1000; lifetimeVarianceMS = 100; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.3 0.3 0.3 0.5"; colors[1] = "0.3 0.3 0.3 0.5"; colors[2] = "0.3 0.3 0.3 0.0"; sizes[0] = 3.2; sizes[1] = 4.6; sizes[2] = 5.0; times[0] = 0.0; times[1] = 0.7; times[2] = 1.0; }; datablock ParticleEmitterData(GrenadeDustEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 15.0; velocityVariance = 0.0; ejectionOffset = 0.0; thetaMin = 85; thetaMax = 85; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; lifetimeMS = 250; particles = "GrenadeDust"; }; datablock ParticleData(GrenadeExplosionSmoke) { dragCoeffiecient = 0.4; gravityCoefficient = -0.5; // rises slowly inheritedVelFactor = 0.025; lifetimeMS = 1250; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "0.7 0.7 0.7 1.0"; colors[1] = "0.2 0.2 0.2 1.0"; colors[2] = "0.1 0.1 0.1 0.0"; sizes[0] = 2.0; sizes[1] = 6.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(GExplosionSmokeEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 6.25; velocityVariance = 0.25; thetaMin = 0.0; thetaMax = 90.0; lifetimeMS = 250; particles = "GrenadeExplosionSmoke"; }; datablock ParticleData(GrenadeSparks) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 350; textureName = "special/bigspark"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 1.0"; colors[2] = "1.0 0.36 0.26 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.75; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(GrenadeSparksEmitter) { ejectionPeriodMS = 2; periodVarianceMS = 0; ejectionVelocity = 12; velocityVariance = 6.75; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 60; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "GrenadeSparks"; }; //---------------------------------------------------- // Explosion //---------------------------------------------------- datablock ExplosionData(GrenadeExplosion) { soundProfile = GrenadeExplosionSound; faceViewer = true; explosionScale = "0.8 0.8 0.8"; debris = GrenadeDebris; debrisThetaMin = 10; debrisThetaMax = 50; debrisNum = 8; debrisVelocity = 26.0; debrisVelocityVariance = 7.0; emitter[0] = GrenadeDustEmitter; emitter[1] = GExplosionSmokeEmitter; emitter[2] = GrenadeSparksEmitter; shakeCamera = true; camShakeFreq = "10.0 6.0 9.0"; camShakeAmp = "20.0 20.0 20.0"; camShakeDuration = 0.5; camShakeRadius = 20.0; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock GrenadeProjectileData(BasicGrenade) { projectileShapeName = "grenade_projectile.dts"; emitterDelay = -1; directDamage = 0.0; hasDamageRadius = true; indirectDamage = 0.40; damageRadius = 15.0; radiusDamageType = $DamageType::Grenade; kickBackStrength = 1500; bubbleEmitTime = 1.0; sound = GrenadeProjectileSound; explosion = "GrenadeExplosion"; underwaterExplosion = "UnderwaterGrenadeExplosion"; velInheritFactor = 0.5; splash = GrenadeSplash; baseEmitter = GrenadeSmokeEmitter; bubbleEmitter = GrenadeBubbleEmitter; grenadeElasticity = 0.35; grenadeFriction = 0.2; armingDelayMS = 1000; muzzleVelocity = 47.00; drag = 0.1; }; //-------------------------------------------------------------------------- // Ammo //-------------------------------------- datablock ItemData(GrenadeLauncherAmmo) { className = Ammo; catagory = "Ammo"; shapeFile = "ammo_grenade.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "some grenade launcher ammo"; computeCRC = true; emap = true; }; //-------------------------------------------------------------------------- // Weapon //-------------------------------------- datablock ItemData(GrenadeLauncher) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_grenade_launcher.dts"; image = GrenadeLauncherImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a grenade launcher"; computeCRC = true; }; datablock ShapeBaseImageData(GrenadeLauncherImage) { className = WeaponImage; shapeFile = "weapon_grenade_launcher.dts"; item = GrenadeLauncher; ammo = GrenadeLauncherAmmo; offset = "0 0 0"; emap = true; projectile = BasicGrenade; projectileType = GrenadeProjectile; stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "ActivateReady"; stateTimeoutValue[0] = 0.5; stateSequence[0] = "Activate"; stateSound[0] = GrenadeSwitchSound; stateName[1] = "ActivateReady"; stateTransitionOnLoaded[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "Fire"; stateName[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.4; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateScript[3] = "onFire"; stateSound[3] = GrenadeFireSound; stateName[4] = "Reload"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateTransitionOnTimeout[4] = "Ready"; stateTimeoutValue[4] = 0.5; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateSound[4] = GrenadeReloadSound; stateName[5] = "NoAmmo"; stateTransitionOnAmmo[5] = "Reload"; stateSequence[5] = "NoAmmo"; stateTransitionOnTriggerDown[5] = "DryFire"; stateName[6] = "DryFire"; stateSound[6] = GrenadeDryFireSound; stateTimeoutValue[6] = 1.5; stateTransitionOnTimeout[6] = "NoAmmo"; }; PK !(_"_"scripts/weapons/mine.cs// ---------------------------------------------- // mine script // ---------------------------------------------- $TeamDeployableMax[MineDeployed] = 20; // ---------------------------------------------- // force-feedback datablocks // ---------------------------------------------- datablock EffectProfile(MineExplosionEffect) { effectname = "explosions/mine_detonate"; minDistance = 10; maxDistance = 50; }; // ---------------------------------------------- // audio datablocks // ---------------------------------------------- datablock AudioProfile(MineDeploySound) { filename = "fx/weapons/mine_deploy.wav"; description = AudioClose3D; preload = true; }; datablock AudioProfile(MineExplosionSound) { filename = "fx/weapons/mine_detonate.wav"; description = AudioBIGExplosion3d; preload = true; effect = MineExplosionEffect; }; datablock AudioProfile(UnderwaterMineExplosionSound) { filename = "fx/weapons/mine_detonate_UW.wav"; description = AudioBIGExplosion3d; preload = true; effect = MineExplosionEffect; }; //-------------------------------------------------------------------------- // Mine Particle effects //-------------------------------------------------------------------------- datablock ParticleData(MineExplosionBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.25; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 2000; lifetimeVarianceMS = 750; useInvAlpha = false; textureName = "special/bubbles"; spinRandomMin = -100.0; spinRandomMax = 100.0; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 0.4"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 1.0; sizes[1] = 1.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.3; times[2] = 1.0; }; datablock ParticleEmitterData(MineExplosionBubbleEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 1.0; ejectionOffset = 2.0; velocityVariance = 0.5; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "MineExplosionBubbleParticle"; }; datablock ParticleData( UnderwaterMineCrescentParticle ) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent3"; colors[0] = "0.5 0.5 1.0 1.0"; colors[1] = "0.5 0.5 1.0 1.0"; colors[2] = "0.5 0.5 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 1.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( UnderwaterMineCrescentEmitter ) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 10; velocityVariance = 5.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "UnderwaterMineCrescentParticle"; }; datablock ParticleData(UnderwaterMineExplosionSmoke) { dragCoeffiecient = 105.0; gravityCoefficient = -0.0; inheritedVelFactor = 0.025; constantAcceleration = -1.0; lifetimeMS = 1200; lifetimeVarianceMS = 00; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "0.7 0.7 1.0 1.0"; colors[1] = "0.3 0.3 1.0 1.0"; colors[2] = "0.0 0.0 1.0 0.0"; sizes[0] = 1.0; sizes[1] = 3.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(UnderwaterMineExplosionSmokeEmitter) { ejectionPeriodMS = 8; periodVarianceMS = 0; ejectionVelocity = 4.25; velocityVariance = 1.25; thetaMin = 0.0; thetaMax = 80.0; lifetimeMS = 250; particles = "UnderwaterMineExplosionSmoke"; }; datablock ExplosionData(UnderwaterMineExplosion) { explosionShape = "disc_explosion.dts"; playSpeed = 1.0; sizes[0] = "0.4 0.4 0.4"; sizes[1] = "0.4 0.4 0.4"; soundProfile = UnderwaterMineExplosionSound; faceViewer = true; emitter[0] = UnderwaterMineExplosionSmokeEmitter; emitter[1] = UnderwaterMineCrescentEmitter; emitter[2] = MineExplosionBubbleEmitter; shakeCamera = true; camShakeFreq = "8.0 7.0 9.0"; camShakeAmp = "50.0 50.0 50.0"; camShakeDuration = 1.0; camShakeRadius = 10.0; }; //-------------------------------------------------------------------------- // Mine Particle effects //-------------------------------------------------------------------------- datablock ParticleData( MineCrescentParticle ) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent3"; colors[0] = "1.0 0.8 0.2 1.0"; colors[1] = "1.0 0.4 0.2 1.0"; colors[2] = "1.0 0.0 0.0 0.0"; sizes[0] = 0.5; sizes[1] = 1.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( MineCrescentEmitter ) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 10; velocityVariance = 5.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "MineCrescentParticle"; }; datablock ParticleData(MineExplosionSmoke) { dragCoeffiecient = 105.0; gravityCoefficient = -0.0; inheritedVelFactor = 0.025; lifetimeMS = 1200; lifetimeVarianceMS = 00; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -200.0; spinRandomMax = 200.0; textureName = "special/Smoke/smoke_001"; colors[0] = "1.0 0.7 0.0 1.0"; colors[1] = "0.2 0.2 0.2 1.0"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 1.0; sizes[1] = 3.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(MineExplosionSmokeEmitter) { ejectionPeriodMS = 8; periodVarianceMS = 0; ejectionVelocity = 4.25; velocityVariance = 1.25; thetaMin = 0.0; thetaMax = 80.0; lifetimeMS = 250; particles = "MineExplosionSmoke"; }; datablock ExplosionData(MineExplosion) { explosionShape = "effect_plasma_explosion.dts"; playSpeed = 1.0; sizes[0] = "0.5 0.5 0.5"; sizes[1] = "0.5 0.5 0.5"; soundProfile = MineExplosionSound; faceViewer = true; emitter[0] = MineExplosionSmokeEmitter; emitter[1] = MineCrescentEmitter; shakeCamera = true; camShakeFreq = "8.0 7.0 9.0"; camShakeAmp = "50.0 50.0 50.0"; camShakeDuration = 1.0; camShakeRadius = 10.0; }; // ---------------------------------------------- // Item datablocks // ---------------------------------------------- datablock ItemData(MineDeployed) { className = Weapon; shapeFile = "mine.dts"; mass = 0.75; elasticity = 0.2; friction = 0.6; pickupRadius = 3; maxDamage = 0.2; explosion = MineExplosion; underwaterExplosion = UnderwaterMineExplosion; indirectDamage = 0.55; damageRadius = 6.0; radiusDamageType = $DamageType::Mine; kickBackStrength = 1500; aiAvoidThis = true; dynamicType = $TypeMasks::DamagableItemObjectType; spacing = 6.0; // how close together mines can be proximity = 2.5; // how close causes a detonation (by player/vehicle) armTime = 2200; // 2.2 seconds to arm a mine after it comes to rest maxDepCount = 9; // try to deploy this many times before detonating computeCRC = true; }; datablock ItemData(Mine) { className = HandInventory; catagory = "Handheld"; shapeFile = "ammo_mine.dts"; mass = 1; elasticity = 0.2; friction = 0.7; pickupRadius = 2; thrownItem = MineDeployed; pickUpName = "some mines"; computeCRC = true; }; PK !(ѻZKOKO"scripts/weapons/missileLauncher.cs//-------------------------------------- // Missile launcher //-------------------------------------- //-------------------------------------------------------------------------- // Force-Feedback Effects //-------------------------------------- datablock EffectProfile(MissileSwitchEffect) { effectname = "weapons/missile_launcher_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(MissileFireEffect) { effectname = "weapons/missile_fire"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(MissileDryFireEffect) { effectname = "weapons/missile_launcher_dryfire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(MissileExplosionEffect) { effectname = "explosions/explosion.xpl23"; minDistance = 10; maxDistance = 30; }; //-------------------------------------------------------------------------- // Sounds //-------------------------------------- datablock AudioProfile(MissileSwitchSound) { filename = "fx/weapons/missile_launcher_activate.wav"; description = AudioClosest3d; preload = true; effect = MissileSwitchEffect; }; datablock AudioProfile(MissileFireSound) { filename = "fx/weapons/missile_fire.WAV"; description = AudioDefault3d; preload = true; effect = MissileFireEffect; }; datablock AudioProfile(MissileProjectileSound) { filename = "fx/weapons/missile_projectile.wav"; description = ProjectileLooping3d; preload = true; }; datablock AudioProfile(MissileReloadSound) { filename = "fx/weapons/weapon.missilereload.wav"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(MissileLockSound) { filename = "fx/weapons/missile_launcher_searching.WAV"; description = AudioClosest3d; preload = true; }; datablock AudioProfile(MissileExplosionSound) { filename = "fx/explosions/explosion.xpl23.wav"; description = AudioBIGExplosion3d; preload = true; effect = MissileExplosionEffect; }; datablock AudioProfile(MissileDryFireSound) { filename = "fx/weapons/missile_launcher_dryfire.wav"; description = AudioClose3d; preload = true; effect = MissileDryFireEffect; }; //---------------------------------------------------------------------------- // Splash Debris //---------------------------------------------------------------------------- datablock ParticleData( MDebrisSmokeParticle ) { dragCoeffiecient = 1.0; gravityCoefficient = 0.10; inheritedVelFactor = 0.1; lifetimeMS = 1000; lifetimeVarianceMS = 100; textureName = "particleTest"; // useInvAlpha = true; spinRandomMin = -60.0; spinRandomMax = 60.0; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.0; sizes[1] = 0.8; sizes[2] = 0.8; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( MDebrisSmokeEmitter ) { ejectionPeriodMS = 10; periodVarianceMS = 1; ejectionVelocity = 1.0; // A little oomph at the back end velocityVariance = 0.2; thetaMin = 0.0; thetaMax = 40.0; particles = "MDebrisSmokeParticle"; }; datablock DebrisData( MissileSplashDebris ) { emitters[0] = MDebrisSmokeEmitter; explodeOnMaxBounce = true; elasticity = 0.4; friction = 0.2; lifetime = 0.3; lifetimeVariance = 0.1; numBounces = 1; }; //---------------------------------------------------------------------------- // Missile smoke spike (for debris) //---------------------------------------------------------------------------- datablock ParticleData( MissileSmokeSpike ) { dragCoeffiecient = 1.0; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; lifetimeMS = 1000; lifetimeVarianceMS = 100; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -60.0; spinRandomMax = 60.0; colors[0] = "0.6 0.6 0.6 1.0"; colors[1] = "0.4 0.4 0.4 0.5"; colors[2] = "0.4 0.4 0.4 0.0"; sizes[0] = 0.0; sizes[1] = 1.0; sizes[2] = 0.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( MissileSmokeSpikeEmitter ) { ejectionPeriodMS = 7; periodVarianceMS = 1; ejectionVelocity = 1.0; // A little oomph at the back end velocityVariance = 0.2; thetaMin = 0.0; thetaMax = 40.0; particles = "MissileSmokeSpike"; }; //---------------------------------------------------------------------------- // Explosion smoke particles //---------------------------------------------------------------------------- datablock ParticleData(MissileExplosionSmoke) { dragCoeffiecient = 0.3; gravityCoefficient = -0.2; inheritedVelFactor = 0.025; lifetimeMS = 1250; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -100.0; spinRandomMax = 100.0; textureName = "special/Smoke/bigSmoke"; colors[0] = "1.0 0.7 0.0 1.0"; colors[1] = "0.4 0.4 0.4 0.5"; colors[2] = "0.4 0.4 0.4 0.0"; sizes[0] = 1.0; sizes[1] = 3.0; sizes[2] = 1.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(MissileExplosionSmokeEMitter) { ejectionOffset = 0.0; ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 3.25; velocityVariance = 0.25; thetaMin = 0.0; thetaMax = 180.0; lifetimeMS = 250; particles = "MissileExplosionSmoke"; }; datablock DebrisData( MissileSpikeDebris ) { emitters[0] = MissileSmokeSpikeEmitter; explodeOnMaxBounce = true; elasticity = 0.4; friction = 0.2; lifetime = 0.3; lifetimeVariance = 0.02; }; //--------------------------------------------------------------------------- // Explosions //--------------------------------------------------------------------------- datablock ExplosionData(MissileExplosion) { explosionShape = "effect_plasma_explosion.dts"; playSpeed = 1.5; soundProfile = MissileExplosionSound; faceViewer = true; sizes[0] = "0.5 0.5 0.5"; sizes[1] = "0.5 0.5 0.5"; sizes[2] = "0.5 0.5 0.5"; emitter[0] = MissileExplosionSmokeEmitter; debris = MissileSpikeDebris; debrisThetaMin = 10; debrisThetaMax = 170; debrisNum = 8; debrisNumVariance = 6; debrisVelocity = 15.0; debrisVelocityVariance = 2.0; shakeCamera = true; camShakeFreq = "6.0 7.0 7.0"; camShakeAmp = "70.0 70.0 70.0"; camShakeDuration = 1.0; camShakeRadius = 7.0; }; datablock ExplosionData(MissileSplashExplosion) { explosionShape = "disc_explosion.dts"; faceViewer = true; explosionScale = "1.0 1.0 1.0"; debris = MissileSplashDebris; debrisThetaMin = 10; debrisThetaMax = 80; debrisNum = 10; debrisVelocity = 10.0; debrisVelocityVariance = 4.0; sizes[0] = "0.35 0.35 0.35"; sizes[1] = "0.15 0.15 0.15"; sizes[2] = "0.15 0.15 0.15"; sizes[3] = "0.15 0.15 0.15"; times[0] = 0.0; times[1] = 0.333; times[2] = 0.666; times[3] = 1.0; }; //-------------------------------------------------------------------------- // Splash //-------------------------------------------------------------------------- datablock ParticleData(MissileMist) { dragCoefficient = 2.0; gravityCoefficient = -0.05; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 400; lifetimeVarianceMS = 100; useInvAlpha = false; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.8; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(MissileMistEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 6.0; velocityVariance = 4.0; ejectionOffset = 0.0; thetaMin = 85; thetaMax = 85; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; lifetimeMS = 250; particles = "MissileMist"; }; datablock ParticleData( MissileSplashParticle ) { dragCoefficient = 1; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 0; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( MissileSplashEmitter ) { ejectionPeriodMS = 1; periodVarianceMS = 0; ejectionVelocity = 6; velocityVariance = 3.0; ejectionOffset = 0.0; thetaMin = 60; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "MissileSplashParticle"; }; datablock SplashData(MissileSplash) { numSegments = 15; ejectionFreq = 0.0001; ejectionAngle = 45; ringLifetime = 0.5; lifetimeMS = 400; velocity = 5.0; startRadius = 0.0; acceleration = -3.0; texWrap = 5.0; explosion = MissileSplashExplosion; texture = "special/water2"; emitter[0] = MissileSplashEmitter; emitter[1] = MissileMistEmitter; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 1.0"; colors[2] = "0.7 0.8 1.0 0.0"; colors[3] = "0.7 0.8 1.0 0.0"; times[0] = 0.0; times[1] = 0.4; times[2] = 0.8; times[3] = 1.0; }; //-------------------------------------------------------------------------- // Particle effects //-------------------------------------- datablock ParticleData(MissileSmokeParticle) { dragCoeffiecient = 0.0; gravityCoefficient = -0.02; inheritedVelFactor = 0.1; lifetimeMS = 1200; lifetimeVarianceMS = 100; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -90.0; spinRandomMax = 90.0; colors[0] = "1.0 0.75 0.0 0.0"; colors[1] = "0.5 0.5 0.5 1.0"; colors[2] = "0.3 0.3 0.3 0.0"; sizes[0] = 1; sizes[1] = 2; sizes[2] = 3; times[0] = 0.0; times[1] = 0.1; times[2] = 1.0; }; datablock ParticleEmitterData(MissileSmokeEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 1.5; velocityVariance = 0.3; thetaMin = 0.0; thetaMax = 50.0; particles = "MissileSmokeParticle"; }; datablock ParticleData(MissileFireParticle) { dragCoeffiecient = 0.0; gravityCoefficient = 0.0; inheritedVelFactor = 1.0; lifetimeMS = 300; lifetimeVarianceMS = 000; textureName = "particleTest"; spinRandomMin = -135; spinRandomMax = 135; colors[0] = "1.0 0.75 0.2 1.0"; colors[1] = "1.0 0.5 0.0 1.0"; colors[2] = "1.0 0.40 0.0 0.0"; sizes[0] = 0; sizes[1] = 1; sizes[2] = 1.5; times[0] = 0.0; times[1] = 0.3; times[2] = 1.0; }; datablock ParticleEmitterData(MissileFireEmitter) { ejectionPeriodMS = 15; periodVarianceMS = 0; ejectionVelocity = 15.0; velocityVariance = 0.0; thetaMin = 0.0; thetaMax = 0.0; particles = "MissileFireParticle"; }; datablock ParticleData(MissilePuffParticle) { dragCoeffiecient = 0.0; gravityCoefficient = 0.0; inheritedVelFactor = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 300; textureName = "particleTest"; spinRandomMin = -135; spinRandomMax = 135; colors[0] = "1.0 1.0 1.0 0.5"; colors[1] = "0.7 0.7 0.7 0.0"; sizes[0] = 0.25; sizes[1] = 1.0; times[0] = 0.0; times[1] = 1.0; }; datablock ParticleEmitterData(MissilePuffEmitter) { ejectionPeriodMS = 50; periodVarianceMS = 3; ejectionVelocity = 0.5; velocityVariance = 0.0; thetaMin = 0.0; thetaMax = 90.0; particles = "MissilePuffParticle"; }; datablock ParticleData(MissileLauncherExhaustParticle) { dragCoeffiecient = 0.0; gravityCoefficient = 0.01; inheritedVelFactor = 1.0; lifetimeMS = 500; lifetimeVarianceMS = 300; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -135; spinRandomMax = 135; colors[0] = "1.0 1.0 1.0 0.5"; colors[1] = "0.7 0.7 0.7 0.0"; sizes[0] = 0.25; sizes[1] = 1.0; times[0] = 0.0; times[1] = 1.0; }; datablock ParticleEmitterData(MissileLauncherExhaustEmitter) { ejectionPeriodMS = 15; periodVarianceMS = 0; ejectionVelocity = 3.0; velocityVariance = 0.0; thetaMin = 0.0; thetaMax = 20.0; particles = "MissileLauncherExhaustParticle"; }; //-------------------------------------------------------------------------- // Debris //-------------------------------------- datablock DebrisData( FlechetteDebris ) { shapeName = "weapon_missile_fleschette.dts"; lifetime = 5.0; minSpinSpeed = -320.0; maxSpinSpeed = 320.0; elasticity = 0.2; friction = 0.3; numBounces = 3; gravModifier = 0.40; staticOnMaxBounce = true; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock SeekerProjectileData(ShoulderMissile) { casingShapeName = "weapon_missile_casement.dts"; projectileShapeName = "weapon_missile_projectile.dts"; hasDamageRadius = true; indirectDamage = 0.8; damageRadius = 8.0; radiusDamageType = $DamageType::Missile; kickBackStrength = 2000; explosion = "MissileExplosion"; splash = MissileSplash; velInheritFactor = 1.0; // to compensate for slow starting velocity, this value // is cranked up to full so the missile doesn't start // out behind the player when the player is moving // very quickly - bramage baseEmitter = MissileSmokeEmitter; delayEmitter = MissileFireEmitter; puffEmitter = MissilePuffEmitter; bubbleEmitter = GrenadeBubbleEmitter; bubbleEmitTime = 1.0; exhaustEmitter = MissileLauncherExhaustEmitter; exhaustTimeMs = 300; exhaustNodeName = "muzzlePoint1"; lifetimeMS = 6000; muzzleVelocity = 10.0; maxVelocity = 80.0; turningSpeed = 110.0; acceleration = 200.0; proximityRadius = 3; terrainAvoidanceSpeed = 180; terrainScanAhead = 25; terrainHeightFail = 12; terrainAvoidanceRadius = 100; flareDistance = 200; flareAngle = 30; sound = MissileProjectileSound; hasLight = true; lightRadius = 5.0; lightColor = "0.2 0.05 0"; useFlechette = true; flechetteDelayMs = 550; casingDeb = FlechetteDebris; explodeOnWaterImpact = false; }; //-------------------------------------------------------------------------- // Ammo //-------------------------------------- datablock ItemData(MissileLauncherAmmo) { className = Ammo; catagory = "Ammo"; shapeFile = "ammo_missile.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "some missiles"; computeCRC = true; }; //-------------------------------------------------------------------------- // Weapon //-------------------------------------- datablock ItemData(MissileLauncher) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_missile.dts"; image = MissileLauncherImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a missile launcher"; computeCRC = true; emap = true; }; datablock ShapeBaseImageData(MissileLauncherImage) { className = WeaponImage; shapeFile = "weapon_missile.dts"; item = MissileLauncher; ammo = MissileLauncherAmmo; offset = "0 0 0"; armThread = lookms; emap = true; projectile = ShoulderMissile; projectileType = SeekerProjectile; isSeeker = true; seekRadius = 400; maxSeekAngle = 8; seekTime = 0.5; minSeekHeat = 0.7; // the heat that must be present on a target to lock it. // only target objects outside this range minTargetingDistance = 40; stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "ActivateReady"; stateTimeoutValue[0] = 0.5; stateSequence[0] = "Activate"; stateSound[0] = MissileSwitchSound; stateName[1] = "ActivateReady"; stateTransitionOnLoaded[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "CheckWet"; stateName[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.4; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateScript[3] = "onFire"; stateSound[3] = MissileFireSound; stateName[4] = "Reload"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateTransitionOnTimeout[4] = "Ready"; stateTimeoutValue[4] = 2.5; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateSound[4] = MissileReloadSound; stateName[5] = "NoAmmo"; stateTransitionOnAmmo[5] = "Reload"; stateSequence[5] = "NoAmmo"; stateTransitionOnTriggerDown[5] = "DryFire"; stateName[6] = "DryFire"; stateSound[6] = MissileDryFireSound; stateTimeoutValue[6] = 1.0; stateTransitionOnTimeout[6] = "ActivateReady"; stateName[7] = "CheckTarget"; stateTransitionOnNoTarget[7] = "DryFire"; stateTransitionOnTarget[7] = "Fire"; stateName[8] = "CheckWet"; stateTransitionOnWet[8] = "WetFire"; stateTransitionOnNotWet[8] = "CheckTarget"; stateName[9] = "WetFire"; stateTransitionOnNoAmmo[9] = "NoAmmo"; stateTransitionOnTimeout[9] = "Reload"; stateSound[9] = MissileFireSound; stateRecoil[3] = LightRecoil; stateTimeoutValue[9] = 0.4; stateSequence[3] = "Fire"; stateScript[9] = "onWetFire"; stateAllowImageChange[9] = false; }; PK !(^lhMhMscripts/weapons/mortar.cs//-------------------------------------- // Mortar //-------------------------------------- //-------------------------------------------------------------------------- // Force-Feedback Effects //-------------------------------------- datablock EffectProfile(MortarSwitchEffect) { effectname = "weapons/mortar_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(MortarFireEffect) { effectname = "weapons/mortar_fire"; minDistance = 2.5; maxDistance = 5.0; }; datablock EffectProfile(MortarReloadEffect) { effectname = "weapons/mortar_reload"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(MortarDryFireEffect) { effectname = "weapons/mortar_dryfire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(MortarExplosionEffect) { effectname = "explosions/explosion.xpl03"; minDistance = 30; maxDistance = 65; }; //-------------------------------------------------------------------------- // Sounds //-------------------------------------- datablock AudioProfile(MortarSwitchSound) { filename = "fx/weapons/mortar_activate.wav"; description = AudioClosest3d; preload = true; effect = MortarSwitchEffect; }; datablock AudioProfile(MortarReloadSound) { filename = "fx/weapons/mortar_reload.wav"; description = AudioClosest3d; preload = true; effect = MortarReloadEffect; }; // DELETE IF NOT NEEDED //datablock AudioProfile(MortarIdleSound) //{ // filename = "fx/weapons/weapon.mortarIdle.wav"; // description = ClosestLooping3d; // preload = true; //}; datablock AudioProfile(MortarFireSound) { filename = "fx/weapons/mortar_fire.wav"; description = AudioDefault3d; preload = true; effect = MortarFireEffect; }; datablock AudioProfile(MortarProjectileSound) { filename = "fx/weapons/mortar_projectile.wav"; description = ProjectileLooping3d; preload = true; }; datablock AudioProfile(MortarExplosionSound) { filename = "fx/weapons/mortar_explode.wav"; description = AudioBIGExplosion3d; preload = true; effect = MortarExplosionEffect; }; datablock AudioProfile(UnderwaterMortarExplosionSound) { filename = "fx/weapons/mortar_explode_UW.wav"; description = AudioBIGExplosion3d; preload = true; effect = MortarExplosionEffect; }; datablock AudioProfile(MortarDryFireSound) { filename = "fx/weapons/mortar_dryfire.wav"; description = AudioClose3d; preload = true; effect = MortarDryFireEffect; }; //---------------------------------------------------------------------------- // Bubbles //---------------------------------------------------------------------------- datablock ParticleData(MortarBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.25; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1500; lifetimeVarianceMS = 600; useInvAlpha = false; textureName = "special/bubbles"; spinRandomMin = -100.0; spinRandomMax = 100.0; colors[0] = "0.7 0.8 1.0 0.4"; colors[1] = "0.7 0.8 1.0 0.4"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.8; sizes[1] = 0.8; sizes[2] = 0.8; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(MortarBubbleEmitter) { ejectionPeriodMS = 9; periodVarianceMS = 0; ejectionVelocity = 1.0; ejectionOffset = 0.1; velocityVariance = 0.5; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "MortarBubbleParticle"; }; //-------------------------------------------------------------------------- // Splash //-------------------------------------------------------------------------- datablock ParticleData( MortarSplashParticle ) { dragCoefficient = 1; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -1.4; lifetimeMS = 300; lifetimeVarianceMS = 0; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.05; sizes[1] = 0.2; sizes[2] = 0.2; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( MortarSplashEmitter ) { ejectionPeriodMS = 4; periodVarianceMS = 0; ejectionVelocity = 3; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 50; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "MortarSplashParticle"; }; datablock SplashData(MortarSplash) { numSegments = 10; ejectionFreq = 10; ejectionAngle = 20; ringLifetime = 0.4; lifetimeMS = 400; velocity = 3.0; startRadius = 0.0; acceleration = -3.0; texWrap = 5.0; texture = "special/water2"; emitter[0] = MortarSplashEmitter; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 1.0"; colors[2] = "0.7 0.8 1.0 0.0"; colors[3] = "0.7 0.8 1.0 0.0"; times[0] = 0.0; times[1] = 0.4; times[2] = 0.8; times[3] = 1.0; }; //--------------------------------------------------------------------------- // Mortar Shockwaves //--------------------------------------------------------------------------- datablock ShockwaveData(UnderwaterMortarShockwave) { width = 6.0; numSegments = 32; numVertSegments = 6; velocity = 10; acceleration = 20.0; lifetimeMS = 900; height = 1.0; verticalCurve = 0.5; is2D = false; texture[0] = "special/shockwave4"; texture[1] = "special/gradient"; texWrap = 6.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; colors[0] = "0.4 0.4 1.0 0.50"; colors[1] = "0.4 0.4 1.0 0.25"; colors[2] = "0.4 0.4 1.0 0.0"; mapToTerrain = true; orientToNormal = false; renderBottom = false; }; datablock ShockwaveData(MortarShockwave) { width = 6.0; numSegments = 32; numVertSegments = 6; velocity = 15; acceleration = 20.0; lifetimeMS = 500; height = 1.0; verticalCurve = 0.5; is2D = false; texture[0] = "special/shockwave4"; texture[1] = "special/gradient"; texWrap = 6.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; colors[0] = "0.4 1.0 0.4 0.50"; colors[1] = "0.4 1.0 0.4 0.25"; colors[2] = "0.4 1.0 0.4 0.0"; mapToTerrain = true; orientToNormal = false; renderBottom = false; }; //-------------------------------------------------------------------------- // Mortar Explosion Particle effects //-------------------------------------- datablock ParticleData( MortarCrescentParticle ) { dragCoefficient = 2; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 000; textureName = "special/crescent3"; colors[0] = "0.7 1.0 0.7 1.0"; colors[1] = "0.7 1.0 0.7 0.5"; colors[2] = "0.7 1.0 0.7 0.0"; sizes[0] = 4.0; sizes[1] = 8.0; sizes[2] = 9.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( MortarCrescentEmitter ) { ejectionPeriodMS = 25; periodVarianceMS = 0; ejectionVelocity = 40; velocityVariance = 5.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 200; particles = "MortarCrescentParticle"; }; datablock ParticleData(MortarExplosionSmoke) { dragCoeffiecient = 0.4; gravityCoefficient = -0.30; // rises slowly inheritedVelFactor = 0.025; lifetimeMS = 1250; lifetimeVarianceMS = 500; textureName = "particleTest"; useInvAlpha = true; spinRandomMin = -100.0; spinRandomMax = 100.0; textureName = "special/Smoke/bigSmoke"; colors[0] = "0.7 0.7 0.7 0.0"; colors[1] = "0.4 0.4 0.4 0.5"; colors[2] = "0.4 0.4 0.4 0.5"; colors[3] = "0.4 0.4 0.4 0.0"; sizes[0] = 5.0; sizes[1] = 6.0; sizes[2] = 10.0; sizes[3] = 12.0; times[0] = 0.0; times[1] = 0.333; times[2] = 0.666; times[3] = 1.0; }; datablock ParticleEmitterData(MortarExplosionSmokeEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionOffset = 8.0; ejectionVelocity = 1.25; velocityVariance = 1.2; thetaMin = 0.0; thetaMax = 90.0; lifetimeMS = 500; particles = "MortarExplosionSmoke"; }; //--------------------------------------------------------------------------- // Underwater Explosion //--------------------------------------------------------------------------- datablock ParticleData(UnderwaterExplosionSparks) { dragCoefficient = 0; gravityCoefficient = 0.0; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 350; textureName = "special/crescent3"; colors[0] = "0.4 0.4 1.0 1.0"; colors[1] = "0.4 0.4 1.0 1.0"; colors[2] = "0.4 0.4 1.0 0.0"; sizes[0] = 3.5; sizes[1] = 3.5; sizes[2] = 3.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(UnderwaterExplosionSparksEmitter) { ejectionPeriodMS = 2; periodVarianceMS = 0; ejectionVelocity = 17; velocityVariance = 4; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 60; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "UnderwaterExplosionSparks"; }; datablock ParticleData(MortarExplosionBubbleParticle) { dragCoefficient = 0.0; gravityCoefficient = -0.25; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 1500; lifetimeVarianceMS = 600; useInvAlpha = false; textureName = "special/bubbles"; spinRandomMin = -100.0; spinRandomMax = 100.0; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 0.4"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 2.0; sizes[1] = 2.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.8; times[2] = 1.0; }; datablock ParticleEmitterData(MortarExplosionBubbleEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 1.0; ejectionOffset = 7.0; velocityVariance = 0.5; thetaMin = 0; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "MortarExplosionBubbleParticle"; }; datablock DebrisData( UnderwaterMortarDebris ) { emitters[0] = MortarExplosionBubbleEmitter; explodeOnMaxBounce = true; elasticity = 0.4; friction = 0.2; lifetime = 1.5; lifetimeVariance = 0.2; numBounces = 1; }; datablock ExplosionData(UnderwaterMortarSubExplosion1) { explosionShape = "disc_explosion.dts"; faceViewer = true; delayMS = 100; offset = 3.0; playSpeed = 1.5; sizes[0] = "0.75 0.75 0.75"; sizes[1] = "1.0 1.0 1.0"; sizes[2] = "0.5 0.5 0.5"; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ExplosionData(UnderwaterMortarSubExplosion2) { explosionShape = "disc_explosion.dts"; faceViewer = true; delayMS = 50; offset = 3.0; playSpeed = 0.75; sizes[0] = "1.5 1.5 1.5"; sizes[1] = "1.5 1.5 1.5"; sizes[2] = "1.0 1.0 1.0"; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ExplosionData(UnderwaterMortarSubExplosion3) { explosionShape = "disc_explosion.dts"; faceViewer = true; delayMS = 0; offset = 0.0; playSpeed = 0.5; sizes[0] = "1.0 1.0 1.0"; sizes[1] = "2.0 2.0 2.0"; sizes[2] = "1.5 1.5 1.5"; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ExplosionData(UnderwaterMortarExplosion) { soundProfile = UnderwaterMortarExplosionSound; shockwave = UnderwaterMortarShockwave; shockwaveOnTerrain = true; subExplosion[0] = UnderwaterMortarSubExplosion1; subExplosion[1] = UnderwaterMortarSubExplosion2; subExplosion[2] = UnderwaterMortarSubExplosion3; emitter[0] = MortarExplosionBubbleEmitter; emitter[1] = UnderwaterExplosionSparksEmitter; shakeCamera = true; camShakeFreq = "8.0 9.0 7.0"; camShakeAmp = "100.0 100.0 100.0"; camShakeDuration = 1.3; camShakeRadius = 25.0; }; //--------------------------------------------------------------------------- // Explosion //--------------------------------------------------------------------------- datablock ExplosionData(MortarSubExplosion1) { explosionShape = "mortar_explosion.dts"; faceViewer = true; delayMS = 100; offset = 5.0; playSpeed = 1.5; sizes[0] = "0.5 0.5 0.5"; sizes[1] = "0.5 0.5 0.5"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(MortarSubExplosion2) { explosionShape = "mortar_explosion.dts"; faceViewer = true; delayMS = 50; offset = 5.0; playSpeed = 1.0; sizes[0] = "1.0 1.0 1.0"; sizes[1] = "1.0 1.0 1.0"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(MortarSubExplosion3) { explosionShape = "mortar_explosion.dts"; faceViewer = true; delayMS = 0; offset = 0.0; playSpeed = 0.7; sizes[0] = "1.0 1.0 1.0"; sizes[1] = "2.0 2.0 2.0"; times[0] = 0.0; times[1] = 1.0; }; datablock ExplosionData(MortarExplosion) { soundProfile = MortarExplosionSound; shockwave = MortarShockwave; shockwaveOnTerrain = true; subExplosion[0] = MortarSubExplosion1; subExplosion[1] = MortarSubExplosion2; subExplosion[2] = MortarSubExplosion3; emitter[0] = MortarExplosionSmokeEmitter; emitter[1] = MortarCrescentEmitter; shakeCamera = true; camShakeFreq = "8.0 9.0 7.0"; camShakeAmp = "100.0 100.0 100.0"; camShakeDuration = 1.3; camShakeRadius = 25.0; }; //--------------------------------------------------------------------------- // Smoke particles //--------------------------------------------------------------------------- datablock ParticleData(MortarSmokeParticle) { dragCoeffiecient = 0.4; gravityCoefficient = -0.3; // rises slowly inheritedVelFactor = 0.125; lifetimeMS = 1200; lifetimeVarianceMS = 200; useInvAlpha = true; spinRandomMin = -100.0; spinRandomMax = 100.0; animateTexture = false; textureName = "special/Smoke/bigSmoke"; colors[0] = "0.7 1.0 0.7 0.5"; colors[1] = "0.3 0.7 0.3 0.8"; colors[2] = "0.0 0.0 0.0 0.0"; sizes[0] = 1.0; sizes[1] = 2.0; sizes[2] = 4.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(MortarSmokeEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 3; ejectionVelocity = 2.25; velocityVariance = 0.55; thetaMin = 0.0; thetaMax = 40.0; particles = "MortarSmokeParticle"; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock GrenadeProjectileData(MortarShot) { projectileShapeName = "mortar_projectile.dts"; emitterDelay = -1; directDamage = 0.0; hasDamageRadius = true; indirectDamage = 1.0; damageRadius = 20.0; radiusDamageType = $DamageType::Mortar; kickBackStrength = 2500; explosion = "MortarExplosion"; underwaterExplosion = "UnderwaterMortarExplosion"; velInheritFactor = 0.5; splash = MortarSplash; depthTolerance = 10.0; // depth at which it uses underwater explosion baseEmitter = MortarSmokeEmitter; bubbleEmitter = MortarBubbleEmitter; grenadeElasticity = 0.15; grenadeFriction = 0.4; armingDelayMS = 2000; muzzleVelocity = 63.7; drag = 0.1; sound = MortarProjectileSound; hasLight = true; lightRadius = 4; lightColor = "0.05 0.2 0.05"; hasLightUnderwaterColor = true; underWaterLightColor = "0.05 0.075 0.2"; }; //-------------------------------------------------------------------------- // Ammo //-------------------------------------- datablock ItemData(MortarAmmo) { className = Ammo; catagory = "Ammo"; shapeFile = "ammo_mortar.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "some mortar ammo"; computeCRC = true; }; //-------------------------------------------------------------------------- // Weapon //-------------------------------------- datablock ItemData(Mortar) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_mortar.dts"; image = MortarImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a mortar gun"; computeCRC = true; emap = true; }; datablock ShapeBaseImageData(MortarImage) { className = WeaponImage; shapeFile = "weapon_mortar.dts"; item = Mortar; ammo = MortarAmmo; offset = "0 0 0"; emap = true; projectile = MortarShot; projectileType = GrenadeProjectile; stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "ActivateReady"; stateTimeoutValue[0] = 0.5; stateSequence[0] = "Activate"; stateSound[0] = MortarSwitchSound; stateName[1] = "ActivateReady"; stateTransitionOnLoaded[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "Fire"; //stateSound[2] = MortarIdleSound; stateName[3] = "Fire"; stateSequence[3] = "Recoil"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.8; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateScript[3] = "onFire"; stateSound[3] = MortarFireSound; stateName[4] = "Reload"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateTransitionOnTimeout[4] = "Ready"; stateTimeoutValue[4] = 2.0; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateSound[4] = MortarReloadSound; stateName[5] = "NoAmmo"; stateTransitionOnAmmo[5] = "Reload"; stateSequence[5] = "NoAmmo"; stateTransitionOnTriggerDown[5] = "DryFire"; stateName[6] = "DryFire"; stateSound[6] = MortarDryFireSound; stateTimeoutValue[6] = 1.5; stateTransitionOnTimeout[6] = "NoAmmo"; }; PK !(V711scripts/weapons/plasma.cs//-------------------------------------- // Plasma rifle //-------------------------------------- //-------------------------------------------------------------------------- // Force-Feedback Effects //-------------------------------------- datablock EffectProfile(PlasmaSwitchEffect) { effectname = "weapons/plasma_rifle_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(PlasmaFireEffect) { effectname = "weapons/plasma_fire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(PlasmaDryFireEffect) { effectname = "weapons/plasma_dryfire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(PlasmaIdleEffect) { effectname = "weapons/plasma_rifle_idle"; minDistance = 2.5; }; datablock EffectProfile(PlasmaReloadEffect) { effectname = "weapons/plasma_rifle_reload"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(PlasmaExpEffect) { effectname = "explosions/explosion.xpl10"; minDistance = 10; maxDistance = 25; }; //-------------------------------------------------------------------------- // Sounds //-------------------------------------- datablock AudioProfile(PlasmaSwitchSound) { filename = "fx/weapons/plasma_rifle_activate.wav"; description = AudioClosest3d; preload = true; effect = PlasmaSwitchEffect; }; datablock AudioProfile(PlasmaFireSound) { filename = "fx/weapons/plasma_rifle_fire.wav"; description = AudioDefault3d; preload = true; effect = PlasmaFireEffect; }; datablock AudioProfile(PlasmaIdleSound) { filename = "fx/weapons/plasma_rifle_idle.wav"; description = ClosestLooping3d; preload = true; //effect = PlasmaIdleEffect; }; datablock AudioProfile(PlasmaReloadSound) { filename = "fx/weapons/plasma_rifle_reload.wav"; description = Audioclosest3d; preload = true; effect = PlasmaReloadEffect; }; datablock AudioProfile(plasmaExpSound) { filename = "fx/explosions/explosion.xpl10.wav"; description = AudioExplosion3d; effect = PlasmaExpEffect; }; datablock AudioProfile(PlasmaProjectileSound) { filename = "fx/weapons/plasma_rifle_projectile.WAV"; description = ProjectileLooping3d; preload = true; }; datablock AudioProfile(PlasmaDryFireSound) { filename = "fx/weapons/plasma_dryfire.wav"; description = AudioClose3d; preload = true; effect = PlasmaDryFireEffect; }; datablock AudioProfile(PlasmaFireWetSound) { filename = "fx/weapons/plasma_fizzle.wav"; description = AudioClose3d; preload = true; }; //-------------------------------------------------------------------------- // Explosion //-------------------------------------- datablock ParticleData(PlasmaExplosionParticle) { dragCoefficient = 2; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 750; lifetimeVarianceMS = 150; textureName = "particleTest"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 0.0"; sizes[0] = 0.5; sizes[1] = 2; }; datablock ParticleEmitterData(PlasmaExplosionEmitter) { ejectionPeriodMS = 7; periodVarianceMS = 0; ejectionVelocity = 5; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 60; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "PlasmaExplosionParticle"; }; datablock ExplosionData(PlasmaBoltExplosion) { explosionShape = "effect_plasma_explosion.dts"; soundProfile = plasmaExpSound; particleEmitter = PlasmaExplosionEmitter; particleDensity = 150; particleRadius = 1.25; faceViewer = true; sizes[0] = "1.0 1.0 1.0"; sizes[1] = "1.0 1.0 1.0"; times[0] = 0.0; times[1] = 1.5; }; //-------------------------------------------------------------------------- // Splash //-------------------------------------------------------------------------- datablock ParticleData(PlasmaMist) { dragCoefficient = 2.0; gravityCoefficient = -0.05; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 400; lifetimeVarianceMS = 100; useInvAlpha = false; spinRandomMin = -90.0; spinRandomMax = 500.0; textureName = "particleTest"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.8; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(PlasmaMistEmitter) { ejectionPeriodMS = 5; periodVarianceMS = 0; ejectionVelocity = 3.0; velocityVariance = 2.0; ejectionOffset = 0.0; thetaMin = 85; thetaMax = 85; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; lifetimeMS = 250; particles = "PlasmaMist"; }; datablock ParticleData( PlasmaSplashParticle2 ) { dragCoeffiecient = 0.4; gravityCoefficient = -0.03; // rises slowly inheritedVelFactor = 0.025; lifetimeMS = 600; lifetimeVarianceMS = 300; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -200.0; spinRandomMax = 200.0; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 1.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( PlasmaSplashEmitter2 ) { ejectionPeriodMS = 25; ejectionOffset = 0.2; periodVarianceMS = 0; ejectionVelocity = 2.25; velocityVariance = 0.50; thetaMin = 0.0; thetaMax = 30.0; lifetimeMS = 250; particles = "PlasmaSplashParticle2"; }; datablock ParticleData( PlasmaSplashParticle ) { dragCoefficient = 1; gravityCoefficient = 0.2; inheritedVelFactor = 0.2; constantAcceleration = -0.0; lifetimeMS = 600; lifetimeVarianceMS = 0; textureName = "special/droplet"; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( PlasmaSplashEmitter ) { ejectionPeriodMS = 1; periodVarianceMS = 0; ejectionVelocity = 3; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 60; thetaMax = 80; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; orientParticles = true; lifetimeMS = 100; particles = "PlasmaSplashParticle"; }; datablock SplashData(PlasmaSplash) { numSegments = 15; ejectionFreq = 0.0001; ejectionAngle = 45; ringLifetime = 0.5; lifetimeMS = 400; velocity = 5.0; startRadius = 0.0; acceleration = -3.0; texWrap = 5.0; texture = "special/water2"; emitter[0] = PlasmaSplashEmitter; emitter[1] = PlasmaSplashEmitter2; emitter[2] = PlasmaMistEmitter; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 1.0"; colors[2] = "0.7 0.8 1.0 0.0"; colors[3] = "0.7 0.8 1.0 0.0"; times[0] = 0.0; times[1] = 0.4; times[2] = 0.8; times[3] = 1.0; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock ParticleData(PlasmaRifleParticle) { dragCoefficient = 2.75; gravityCoefficient = 0.1; inheritedVelFactor = 0.2; constantAcceleration = 0.0; lifetimeMS = 550; lifetimeVarianceMS = 0; textureName = "particleTest"; colors[0] = "0.46 0.36 0.26 1.0"; colors[1] = "0.46 0.36 0.26 0.0"; sizes[0] = 0.25; sizes[1] = 0.20; }; datablock ParticleEmitterData(PlasmaRifleEmitter) { ejectionPeriodMS = 3; periodVarianceMS = 0; ejectionVelocity = 10; velocityVariance = 1.0; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 12; phiReferenceVel = 0; phiVariance = 360; overrideAdvance = true; particles = "PlasmaRifleParticle"; }; //-------------------------------------------------------------------------- // Projectile //-------------------------------------- datablock LinearFlareProjectileData(PlasmaBolt) { projectileShapeName = "plasmabolt.dts"; scale = "2.0 2.0 2.0"; faceViewer = true; directDamage = 0.0; hasDamageRadius = true; indirectDamage = 0.45; damageRadius = 4.0; kickBackStrength = 0.0; radiusDamageType = $DamageType::Plasma; explosion = "PlasmaBoltExplosion"; splash = PlasmaSplash; dryVelocity = 55.0; wetVelocity = -1; velInheritFactor = 0.3; fizzleTimeMS = 2000; lifetimeMS = 3000; explodeOnDeath = false; reflectOnWaterImpactAngle = 0.0; explodeOnWaterImpact = true; deflectionOnWaterImpact = 0.0; fizzleUnderwaterMS = -1; //activateDelayMS = 100; activateDelayMS = -1; size[0] = 0.2; size[1] = 0.5; size[2] = 0.1; numFlares = 35; flareColor = "1 0.75 0.25"; flareModTexture = "flaremod"; flareBaseTexture = "flarebase"; sound = PlasmaProjectileSound; fireSound = PlasmaFireSound; wetFireSound = PlasmaFireWetSound; hasLight = true; lightRadius = 3.0; lightColor = "1 0.75 0.25"; }; //-------------------------------------------------------------------------- // Ammo //-------------------------------------- datablock ItemData(PlasmaAmmo) { className = Ammo; catagory = "Ammo"; shapeFile = "ammo_plasma.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "some plasma gun ammo"; }; //-------------------------------------------------------------------------- // Weapon //-------------------------------------- datablock ItemData(Plasma) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_plasma.dts"; image = PlasmaImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a plasma gun"; }; datablock ShapeBaseImageData(PlasmaImage) { className = WeaponImage; shapeFile = "weapon_plasma.dts"; item = Plasma; ammo = PlasmaAmmo; offset = "0 0 0"; projectile = PlasmaBolt; projectileType = LinearFlareProjectile; stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "ActivateReady"; stateTimeoutValue[0] = 0.5; stateSequence[0] = "Activate"; stateSound[0] = PlasmaSwitchSound; stateName[1] = "ActivateReady"; stateTransitionOnLoaded[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "CheckWet"; stateName[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.1; stateFire[3] = true; stateRecoil[3] = LightRecoil; stateAllowImageChange[3] = false; stateScript[3] = "onFire"; stateEmitterTime[3] = 0.2; stateSound[3] = PlasmaFireSound; stateName[4] = "Reload"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateTransitionOnTimeout[4] = "Ready"; stateTimeoutValue[4] = 0.6; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateSound[4] = PlasmaReloadSound; stateName[5] = "NoAmmo"; stateTransitionOnAmmo[5] = "Reload"; stateSequence[5] = "NoAmmo"; stateTransitionOnTriggerDown[5] = "DryFire"; stateName[6] = "DryFire"; stateSound[6] = PlasmaDryFireSound; stateTimeoutValue[6] = 1.5; stateTransitionOnTimeout[6] = "NoAmmo"; stateName[7] = "WetFire"; stateSound[7] = PlasmaFireWetSound; stateTimeoutValue[7] = 1.5; stateTransitionOnTimeout[7] = "Ready"; stateName[8] = "CheckWet"; stateTransitionOnWet[8] = "WetFire"; stateTransitionOnNotWet[8] = "Fire"; }; PK !(T scripts/weapons/shockLance.cs//-------------------------------------------------------------------------- // Shock Lance // // //-------------------------------------------------------------------------- datablock EffectProfile(ShockLanceSwitchEffect) { effectname = "weapons/shocklance_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ShockLanceFireEffect) { effectname = "weapons/shocklance_fire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(ShockLanceReloadEffect) { effectname = "weapons/shocklance_reload"; minDistance = 2.5; maxDistance = 2.5; }; datablock AudioProfile(ShockLanceSwitchSound) { filename = "fx/weapons/shocklance_activate.wav"; description = AudioClosest3d; preload = true; effect = ShockLanceSwitchEffect; }; //-------------------------------------------------------------------------- // Explosion //-------------------------------------- datablock AudioProfile(ShockLanceHitSound) { filename = "fx/weapons/shocklance_fire.WAV"; description = AudioClose3d; preload = true; effect = ShockLanceFireEffect; }; datablock AudioProfile(ShockLanceReloadSound) { filename = "fx/weapons/shocklance_reload.WAV"; description = AudioClosest3d; preload = true; effect = ShockLanceReloadEffect; }; datablock AudioProfile(ShockLanceDryFireSound) { filename = "fx/weapons/shocklance_dryfire.WAV"; description = AudioClose3d; preload = true; effect = ShockLanceReloadEffect; }; datablock AudioProfile(ShockLanceMissSound) { filename = "fx/weapons/shocklance_miss.WAV"; description = AudioExplosion3d; preload = true; }; //-------------------------------------------------------------------------- // Particle data //-------------------------------------------------------------------------- datablock ParticleData(ShockParticle) { dragCoeffiecient = 0.0; gravityCoefficient = -0.0; inheritedVelFactor = 0.0; lifetimeMS = 1000; lifetimeVarianceMS = 0; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -100.0; spinRandomMax = 100.0; numParts = 50; animateTexture = true; framesPerSec = 26; animTexName[00] = "special/Explosion/exp_0002"; animTexName[01] = "special/Explosion/exp_0004"; animTexName[02] = "special/Explosion/exp_0006"; animTexName[03] = "special/Explosion/exp_0008"; animTexName[04] = "special/Explosion/exp_0010"; animTexName[05] = "special/Explosion/exp_0012"; animTexName[06] = "special/Explosion/exp_0014"; animTexName[07] = "special/Explosion/exp_0016"; animTexName[08] = "special/Explosion/exp_0018"; animTexName[09] = "special/Explosion/exp_0020"; animTexName[10] = "special/Explosion/exp_0022"; animTexName[11] = "special/Explosion/exp_0024"; animTexName[12] = "special/Explosion/exp_0026"; animTexName[13] = "special/Explosion/exp_0028"; animTexName[14] = "special/Explosion/exp_0030"; animTexName[15] = "special/Explosion/exp_0032"; animTexName[16] = "special/Explosion/exp_0034"; animTexName[17] = "special/Explosion/exp_0036"; animTexName[18] = "special/Explosion/exp_0038"; animTexName[19] = "special/Explosion/exp_0040"; animTexName[20] = "special/Explosion/exp_0042"; animTexName[21] = "special/Explosion/exp_0044"; animTexName[22] = "special/Explosion/exp_0046"; animTexName[23] = "special/Explosion/exp_0048"; animTexName[24] = "special/Explosion/exp_0050"; animTexName[25] = "special/Explosion/exp_0052"; colors[0] = "0.5 0.5 1.0 1.0"; colors[1] = "0.5 0.5 1.0 0.5"; colors[2] = "0.25 0.25 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 0.5; sizes[2] = 0.5; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData(ShockParticleEmitter) { ejectionPeriodMS = 1; periodVarianceMS = 0; ejectionVelocity = 0.25; velocityVariance = 0.0; thetaMin = 0.0; thetaMax = 30.0; particles = "ShockParticle"; }; //-------------------------------------------------------------------------- // Shockwave //-------------------------------------------------------------------------- datablock ShockwaveData( ShocklanceHit ) { width = 0.5; numSegments = 20; numVertSegments = 1; velocity = 0.25; acceleration = 1.0; lifetimeMS = 600; height = 0.1; verticalCurve = 0.5; mapToTerrain = false; renderBottom = false; orientToNormal = true; texture[0] = "special/shocklanceHit"; texture[1] = "special/gradient"; texWrap = 3.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; colors[0] = "1.0 1.0 1.0 1.0"; colors[1] = "1.0 1.0 1.0 0.5"; colors[2] = "1.0 1.0 1.0 0.0"; }; //-------------------------------------- // Projectile //-------------------------------------- datablock ShockLanceProjectileData(BasicShocker) { directDamage = 0.45; radiusDamageType = $DamageType::ShockLance; kickBackStrength = 2500; velInheritFactor = 0; sound = ""; zapDuration = 1.0; impulse = 1800; boltLength = 14.0; extension = 14.0; // script variable indicating distance you can shock people from lightningFreq = 25.0; lightningDensity = 3.0; lightningAmp = 0.25; lightningWidth = 0.05; shockwave = ShocklanceHit; boltSpeed[0] = 2.0; boltSpeed[1] = -0.5; texWrap[0] = 1.5; texWrap[1] = 1.5; startWidth[0] = 0.3; endWidth[0] = 0.6; startWidth[1] = 0.3; endWidth[1] = 0.6; texture[0] = "special/shockLightning01"; texture[1] = "special/shockLightning02"; texture[2] = "special/shockLightning03"; texture[3] = "special/ELFBeam"; emitter[0] = ShockParticleEmitter; }; //-------------------------------------- // Rifle and item... //-------------------------------------- datablock ItemData(ShockLance) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_shocklance.dts"; image = ShockLanceImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a shocklance"; computeCRC = true; emap = true; }; datablock ShapeBaseImageData(ShockLanceImage) { classname = WeaponImage; shapeFile = "weapon_shocklance.dts"; item = ShockLance; offset = "0 0 0"; emap = true; projectile = BasicShocker; usesEnergy = true; missEnergy = 0; hitEnergy = 15; minEnergy = 15; // needs to change to be datablock's energy drain for a hit stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "ActivateReady"; stateSound[0] = ShockLanceSwitchSound; stateTimeoutValue[0] = 0.5; stateSequence[0] = "Activate"; stateName[1] = "ActivateReady"; stateTransitionOnLoaded[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "CheckWet"; stateName[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.5; stateFire[3] = true; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateScript[3] = "onFire"; stateSound[3] = ShockLanceDryFireSound; stateName[4] = "Reload"; stateTransitionOnNoAmmo[4] = "NoAmmo"; stateTransitionOnTimeout[4] = "Ready"; stateTimeoutValue[4] = 2.0; stateAllowImageChange[4] = false; stateSequence[4] = "Reload"; stateSound[4] = ShockLanceReloadSound; stateName[5] = "NoAmmo"; stateTransitionOnAmmo[5] = "Ready"; stateName[6] = "DryFire"; stateSound[6] = ShockLanceDryFireSound; stateTimeoutValue[6] = 1.0; stateTransitionOnTimeout[6] = "Ready"; stateName[7] = "CheckWet"; stateTransitionOnWet[7] = "DryFire"; stateTransitionOnNotWet[7] = "Fire"; }; PK !()j=!=!scripts/weapons/sniperRifle.cs//-------------------------------------------------------------------------- // Sniper rifle // // //-------------------------------------------------------------------------- datablock EffectProfile(SniperRifleSwitchEffect) { effectname = "weapons/sniper_activate"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(SniperRifleFireEffect) { effectname = "weapons/sniper_fire"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(SniperRifleFireWetEffect) { effectname = "weapons/sniper_underwater"; minDistance = 2.5; maxDistance = 2.5; }; datablock AudioProfile(SniperRifleSwitchSound) { filename = "fx/weapons/sniper_activate.wav"; description = AudioClosest3d; preload = true; effect = SniperRifleSwitchEffect; }; datablock AudioProfile(SniperRifleFireSound) { filename = "fx/weapons/sniper_fire.wav"; description = AudioClose3d; preload = true; effect = SniperRifleFireEffect; }; datablock AudioProfile(SniperRifleFireWetSound) { filename = "fx/weapons/sniper_underwater.wav"; description = AudioClose3d; preload = true; effect = SniperRifleFireWetEffect; }; datablock AudioProfile(SniperRifleDryFireSound) { filename = "fx/weapons/chaingun_dryfire.wav"; description = AudioClose3d; preload = true; }; datablock AudioProfile(SniperRifleProjectileSound) { filename = "fx/weapons/sniper_miss.wav"; description = AudioClose3d; preload = true; }; //-------------------------------------------------------------------------- // Splash //-------------------------------------------------------------------------- datablock ParticleData( SniperSplashParticle ) { dragCoeffiecient = 0.4; gravityCoefficient = -0.03; // rises slowly inheritedVelFactor = 0.025; lifetimeMS = 600; lifetimeVarianceMS = 300; textureName = "particleTest"; useInvAlpha = false; spinRandomMin = -200.0; spinRandomMax = 200.0; colors[0] = "0.7 0.8 1.0 1.0"; colors[1] = "0.7 0.8 1.0 0.5"; colors[2] = "0.7 0.8 1.0 0.0"; sizes[0] = 0.5; sizes[1] = 1.0; sizes[2] = 2.0; times[0] = 0.0; times[1] = 0.5; times[2] = 1.0; }; datablock ParticleEmitterData( SniperSplashEmitter ) { ejectionPeriodMS = 25; ejectionOffset = 0.2; periodVarianceMS = 0; ejectionVelocity = 2.25; velocityVariance = 0.50; thetaMin = 0.0; thetaMax = 30.0; lifetimeMS = 250; particles = "SniperSplashParticle"; }; datablock SplashData( SniperSplash ) { numSegments = 5; ejectionFreq = 0.0001; ejectionAngle = 45; ringLifetime = 0.5; lifetimeMS = 400; velocity = 5.0; startRadius = 0.0; acceleration = -3.0; texWrap = 5.0; texture = "special/water2"; emitter[0] = SniperSplashEmitter; colors[0] = "0.7 0.8 1.0 0.0"; colors[1] = "0.7 0.8 1.0 1.0"; colors[2] = "0.7 0.8 1.0 0.0"; colors[3] = "0.7 0.8 1.0 0.0"; times[0] = 0.0; times[1] = 0.4; times[2] = 0.8; times[3] = 1.0; }; //-------------------------------------------------------------------------- // Explosion //-------------------------------------- datablock AudioProfile(sniperExpSound) { filename = "fx/weapons/sniper_impact.WAV"; description = AudioClosest3d; preload = true; }; datablock ParticleData(SniperExplosionParticle1) { dragCoefficient = 0.65; gravityCoefficient = 0.3; inheritedVelFactor = 0.0; constantAcceleration = 0.0; lifetimeMS = 500; lifetimeVarianceMS = 150; textureName = "particleTest"; colors[0] = "0.56 0.36 0.26 1.0"; colors[1] = "0.56 0.36 0.26 0.0"; sizes[0] = 0.0625; sizes[1] = 0.2; }; datablock ParticleEmitterData(SniperExplosionEmitter) { ejectionPeriodMS = 10; periodVarianceMS = 0; ejectionVelocity = 0.75; velocityVariance = 0.25; ejectionOffset = 0.0; thetaMin = 0; thetaMax = 60; phiReferenceVel = 0; phiVariance = 360; overrideAdvances = false; particles = "SniperExplosionParticle1"; }; datablock ExplosionData(SniperExplosion) { explosionShape = "energy_explosion.dts"; soundProfile = sniperExpSound; particleEmitter = SniperExplosionEmitter; particleDensity = 150; particleRadius = 0.25; faceViewer = false; }; //-------------------------------------- // Projectile //-------------------------------------- datablock SniperProjectileData(BasicSniperShot) { directDamage = 0.4; hasDamageRadius = false; indirectDamage = 0.0; damageRadius = 0.0; velInheritFactor = 1.0; sound = SniperRifleProjectileSound; explosion = "SniperExplosion"; splash = SniperSplash; directDamageType = $DamageType::Laser; maxRifleRange = 1000; rifleHeadMultiplier = 1.3; beamColor = "1 0.1 0.1"; fadeTime = 1.0; startBeamWidth = 0.145; endBeamWidth = 0.25; pulseBeamWidth = 0.5; beamFlareAngle = 3.0; minFlareSize = 0.0; maxFlareSize = 400.0; pulseSpeed = 6.0; pulseLength = 0.150; lightRadius = 1.0; lightColor = "0.3 0.0 0.0"; textureName[0] = "special/flare"; textureName[1] = "special/nonlingradient"; textureName[2] = "special/laserrip01"; textureName[3] = "special/laserrip02"; textureName[4] = "special/laserrip03"; textureName[5] = "special/laserrip04"; textureName[6] = "special/laserrip05"; textureName[7] = "special/laserrip06"; textureName[8] = "special/laserrip07"; textureName[9] = "special/laserrip08"; textureName[10] = "special/laserrip09"; textureName[11] = "special/sniper00"; }; //-------------------------------------- // Rifle and item... //-------------------------------------- datablock ItemData(SniperRifle) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_sniper.dts"; image = SniperRifleImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a sniper rifle"; computeCRC = true; }; datablock ShapeBaseImageData(SniperRifleImage) { className = WeaponImage; shapeFile = "weapon_sniper.dts"; item = SniperRifle; projectile = BasicSniperShot; projectileType = SniperProjectile; armThread = looksn; usesEnergy = true; minEnergy = 6; stateName[0] = "Activate"; stateTransitionOnTimeout[0] = "ActivateReady"; stateSound[0] = SniperRifleSwitchSound; stateTimeoutValue[0] = 0.5; stateSequence[0] = "Activate"; stateName[1] = "ActivateReady"; stateTransitionOnLoaded[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "CheckWet"; stateName[3] = "Fire"; stateTransitionOnTimeout[3] = "Reload"; stateTimeoutValue[3] = 0.5; stateFire[3] = true; stateAllowImageChange[3] = false; stateSequence[3] = "Fire"; stateScript[3] = "onFire"; stateName[4] = "Reload"; stateTransitionOnTimeout[4] = "Ready"; stateTimeoutValue[4] = 0.5; stateAllowImageChange[4] = false; stateName[5] = "CheckWet"; stateTransitionOnWet[5] = "DryFire"; stateTransitionOnNotWet[5] = "Fire"; stateName[6] = "NoAmmo"; stateTransitionOnAmmo[6] = "Reload"; stateTransitionOnTriggerDown[6] = "DryFire"; stateSequence[6] = "NoAmmo"; stateName[7] = "DryFire"; stateSound[7] = SniperRifleDryFireSound; stateTimeoutValue[7] = 0.5; stateTransitionOnTimeout[7] = "Ready"; }; PK !(0`!scripts/weapons/targetingLaser.cs//-------------------------------------------------------------------------- // Targeting laser // //-------------------------------------------------------------------------- datablock EffectProfile(TargetingLaserSwitchEffect) { effectname = "weapons/generic_switch"; minDistance = 2.5; maxDistance = 2.5; }; datablock EffectProfile(TargetingLaserPaintEffect) { effectname = "weapons/targetinglaser_paint"; minDistance = 2.5; maxDistance = 2.5; }; datablock AudioProfile(TargetingLaserSwitchSound) { filename = "fx/weapons/generic_switch.wav"; description = AudioClosest3d; preload = true; effect = TargetingLaserSwitchEffect; }; datablock AudioProfile(TargetingLaserPaintSound) { filename = "fx/weapons/targetinglaser_paint.wav"; description = CloseLooping3d; preload = true; effect = TargetingLaserPaintEffect; }; //-------------------------------------- // Projectile //-------------------------------------- datablock TargetProjectileData(BasicTargeter) { directDamage = 0.0; hasDamageRadius = false; indirectDamage = 0.0; damageRadius = 0.0; velInheritFactor = 1.0; maxRifleRange = 1000; beamColor = "0.1 1.0 0.1"; startBeamWidth = 0.20; pulseBeamWidth = 0.15; beamFlareAngle = 3.0; minFlareSize = 0.0; maxFlareSize = 400.0; pulseSpeed = 6.0; pulseLength = 0.150; textureName[0] = "special/nonlingradient"; textureName[1] = "special/flare"; textureName[2] = "special/pulse"; textureName[3] = "special/expFlare"; beacon = true; }; //-------------------------------------- // Rifle and item... //-------------------------------------- datablock ItemData(TargetingLaser) { className = Weapon; catagory = "Spawn Items"; shapeFile = "weapon_targeting.dts"; image = TargetingLaserImage; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; pickUpName = "a targeting laser rifle"; computeCRC = true; }; datablock ShapeBaseImageData(TargetingLaserImage) { className = WeaponImage; shapeFile = "weapon_targeting.dts"; item = TargetingLaser; offset = "0 0 0"; projectile = BasicTargeter; projectileType = TargetProjectile; deleteLastProjectile = true; usesEnergy = true; minEnergy = 3; stateName[0] = "Activate"; stateSequence[0] = "Activate"; stateSound[0] = TargetingLaserSwitchSound; stateTimeoutValue[0] = 0.5; stateTransitionOnTimeout[0] = "ActivateReady"; stateName[1] = "ActivateReady"; stateTransitionOnAmmo[1] = "Ready"; stateTransitionOnNoAmmo[1] = "NoAmmo"; stateName[2] = "Ready"; stateTransitionOnNoAmmo[2] = "NoAmmo"; stateTransitionOnTriggerDown[2] = "Fire"; stateName[3] = "Fire"; stateEnergyDrain[3] = 3; stateFire[3] = true; stateAllowImageChange[3] = false; stateScript[3] = "onFire"; stateTransitionOnTriggerUp[3] = "Deconstruction"; stateTransitionOnNoAmmo[3] = "Deconstruction"; stateSound[3] = TargetingLaserPaintSound; stateName[4] = "NoAmmo"; stateTransitionOnAmmo[4] = "Ready"; stateName[5] = "Deconstruction"; stateScript[5] = "deconstruct"; stateTransitionOnTimeout[5] = "Ready"; }; PK( !(b<$!scripts/weblinks.csPK( !(}$!scripts/defaultGame.csPK( !(x44$!gui/AIEButtonBarDlg.guiPK( !( gui/InspectAddFieldDlg.guiPK( !(Hŵ$!H gui/InspectDlg.guiPK( !(E$!_ gui/InteriorDebug.guiPK( !(~ $!'p gui/InteriorPreviewGui.guiPK( !(%WT6$!' gui/JoinChatDlg.guiPK( !(C**$! gui/JoystickConfigDlg.guiPK( !(nOO$![ gui/LaunchGui.guiPK( !(Z$!ٹ gui/LaunchToolbarDlg.guiPK( !(ݏe$! gui/LoadingGui.guiPK( !(J%""$! gui/LobbyGui.guiPK( !((־;;$! gui/LoginDlg.guiPK( !( ~~$!b gui/LoginMessageBoxDlg.guiPK( !(ø:CC$! gui/MessageBoxDlg.guiPK( !($! gui/MessagePopupDlg.guiPK( !(˵$! gui/MouseConfigDlg.guiPK( !(,p$!- gui/MoveThreadDlg.guiPK( !(V55$!K6 gui/NewMissionGui.guiPK( !(}$!Q gui/NewWarriorDlg.guiPK( !(H?$!qY gui/OptionsDlg.guiPK( !( ==$!Qn gui/PanoramaGui.guiPK( !(;rr$!o gui/PasswordDlg.guiPK( !(-_6ww$!bw gui/PickTeamDlg.guiPK( !(hEqHqH$!  gui/PlayGui.guiPK( !(X$$! gui/RecordingsDlg.guiPK( !(S;66$! gui/RemapDlg.guiPK( !(ԽTT$!D gui/ServerInfoDlg.guiPK( !(́ڃ\ \ $! gui/ShellLoadFileDlg.guiPK( !(_E$ $ $!] gui/ShellSaveFileDlg.guiPK( !(]I~~$! gui/SinglePlayerEscapeDlg.guiPK( !( e  $!pgui/TSShowDetailControlDlg.guiPK( !(~QQ$!gui/TSShowEditScale.guiPK( !(EL$!Qgui/TSShowGui.guiPK( !(eEYY$!'.gui/TSShowLightDlg.guiPK( !(j< $!?gui/TSShowLoadDlg.guiPK( !(: $!Jgui/TSShowMiscDlg.guiPK( !(=Q++$!Wgui/TSShowThreadControlDlg.guiPK( !(ƿ rr$!lsgui/TSShowTranDurEditDlg.guiPK( !(jk$!|gui/TSShowTransitionDlg.guiPK( !(>>$!gui/TaskHudDlg.guiPK( !(|# $!gui/TerraformerFullScreenGui.guiPK( !(e$!Lgui/TerraformerGui.guiPK( !(&<<!$!gui/TerraformerHeightfieldGui.guiPK( !(11$!gui/TerraformerTextureGui.guiPK( !(**!$!Fgui/TerrainEditorButtonbarDlg.guiPK( !(]@@$$!Qgui/TerrainEditorExtraToolbarDlg.guiPK( !()Ѱ $!gui/TerrainEditorFramesetDlg.guiPK( !(QZ$!gui/TerrainEditorGui.guiPK( !(>϶!$!gui/TerrainEditorStatusbarDlg.guiPK( !(%$!gui/TerrainEditorTextureSelectGui.guiPK( !(S$!X,gui/TerrainEditorToolbarDlg.guiPK( !("O!!!$!1gui/TerrainEditorVSettingsGui.guiPK( !( l11&$!xSgui/TerrainEditorValuesSettingsGui.guiPK( !({*  $!pgui/TestGui.guiPK( !(UU$!9{gui/TrainingGui.guiPK( !({:$!gui/TribeAdminMemberDlg.guiPK( !(XII!$!gui/TribeAndWarriorBrowserGui.guiPK( !(zz#$!ʹhelp/8. Terrain Texture Painter.hflPK( !(Bs}s}$!scripts/BountyGame.csPK( !(5-##$!.5scripts/CTFGame.csPK( !(I\$!Yscripts/CenterPrint.csPK+74.2:Vi mscripts/ChatGui.csPK( !(ξ0[5[5$!scripts/ChooseFilterDlg.csPK( !(|L77$!scripts/CnHGame.csPK( !((|/|/$!"1scripts/DMGame.csPK( !(>s%ZZ$!`scripts/DebriefGui.csPK( !(7H$!Zrscripts/DemoEndGui.csPK r _-eE!uscripts/DnDGame.csPK( !(L;@@$!9scripts/EditChatMenuGui.csPK( !(H<<$!zscripts/EditorGui.csPK( !(M"/./.$!scripts/EditorProfiles.csPK( !(s$!e3scripts/GameGui.csPK( !(Qzyo//$!scripts/HuntersGame.csPK( !(.**$!z scripts/LaunchLanGui.csPK( !(wLL$!7scripts/LobbyGui.csPK( !(W|=Y=Y$!˄scripts/OptionsDlg.csPK( !(f2$!;scripts/PantherXL.csPK( !(q" $!nscripts/PathEdit.csPK( !(pgthth$!>scripts/RabbitGame.csPK( !(UM$!Wscripts/SiegeGame.csPK( !({6-F;;!/scripts/inventory.csPK( !(i99$!*0scripts/inventoryHud.csPK( !(ox II$!*0scripts/item.csPK( !(k}ZLL$! 1scripts/joystickBind.csPK( !(B`$![1scripts/lavaPropMap.csPK( !(FM}##$!'1scripts/light_female.csPK( !(+$!1scripts/light_male.csPK( !(>-l$!{"1scripts/lightning.csPK( !([Q1$$$!+1scripts/liquidProfiles.csPK( !('h..$!jP1scripts/loadingGui.csPK( !(--$!~1scripts/lushPropMap.csPK( !(.$!1scripts/markers.csPK( !(uY  $!01scripts/medium_female.csPK( !(Dx$!p1scripts/medium_male.csPK( !(ty4y4$!1scripts/message.csPK( !(B' $!-1scripts/navGraph.csPK( !(H֮$!Y1scripts/objectiveHud.csPK( !(7ίC C $!<2scripts/pack.csPK( !(ܝM$!2scripts/particleDummies.csPK( !(ۑc$!2scripts/particleEmitter.csPK SG-oJ'EoEo!2scripts/player.csPK( !(( $! 4scripts/power.csPK( !(iT@NN$!,4scripts/projectiles.csPK C-YVV!{4scripts/recordings.csPK( !(Cd$!4scripts/redbook.csPK( !(Ǩ$!4scripts/scoreList.csPK( !(F{K K $!y4scripts/scoreScreen.csPK UGW-bq`OO!4scripts/server.csPK( !(mĈ4 $!v 6scripts/serverAudio.csPK( !(.RMM$!6scripts/serverCommanderMap.csPK( !(>*$!56scripts/serverDefaults.csPK( !(TbTT$!L6scripts/serverTasks.csPK( !(wqq$!c7scripts/simGroup.csPK( !(ҭK_$!7scripts/spdialog.csPK( !(J ծծ$!U7scripts/staticShape.csPK( !( $!^i8scripts/station.csPK( !($!9scripts/stationSetInv.csPK( !(i72rr$!X.9scripts/targetManager.csPK( !(@>$!J9scripts/trigger.csPK( !(2%%%$!X9scripts/turret.csPK( !(\scripts/webstuff.csPK( !('::$!->scripts/webtest.csPK( !(}]TT$!SK>scripts/autoexec/scripts.txtPK( !(bٖ$!K>scripts/packs/ELFbarrelPack.csPK( !( =$!Q>scripts/packs/aabarrelPack.csPK( !(ԑ!!$!W>scripts/packs/ammopack.csPK( !($!x>scripts/packs/cloakingpack.csPK( !($!M>scripts/packs/energypack.csPK( !(,"$!b>scripts/packs/missilebarrelPack.csPK( !(*s!$!>scripts/packs/mortarBarrelPack.csPK( !(.!$!>scripts/packs/plasmabarrelPack.csPK( !(kMWMW$!>scripts/packs/repairpack.csPK( !(l II$!/>scripts/packs/satchelCharge.csPK( !(p((!$! D?scripts/packs/sensorjammerpack.csPK( !(E#  $!sR?scripts/packs/shieldpack.csPK( !(;C!$![?scripts/turrets/ELFBarrelLarge.csPK( !(vE $!q?scripts/turrets/aaBarrelLarge.csPK( !(+!!)$!?scripts/turrets/indoorDeployableBarrel.csPK( !(%$!̴?scripts/turrets/missileBarrelLarge.csPK( !(B66$$!?scripts/turrets/mortarBarrelLarge.csPK( !(