DAZZLE'S UPGRADE PACK

If you haven't already done so, upgrade your game by downloading Dazzle's all-in-one upgrade pack. It comes with everything you need for today's servers. Does your blue bar freeze when joining servers? Do you lag in games? Do you get an annoying siren in Phobik's Servers? This is what you need. CLICK HERE TO DOWNLOAD.

Totally Random Codes #1

Modding questions, answers, help.....

Moderators: Warfare, Admin, Moderator

Post Reply
Triv
Veteran Member
Veteran Member
Posts: 159
Joined: Mon Jan 22, 2007 6:32 pm
Contact:

Totally Random Codes #1

Post by Triv »

Switch your wacky mode on trooper.

I don't even myself know what some of these things do!!! But I have written them up in text files so there might have been some point. Ha Ha Ha.

Code: Select all

//--- OBJECT WRITE END --- 
// SLIDE FASTER THAN DRIVE FORWARD
Lighttank.accelrate = 100; 
Lighttank.deccelrate = 100; 
Lighttank.maxspeed = 30; 
Mediumtank.deccelrate = 70; 
Mediumtank.accelrate = 70; 
Mediumtank.maxspeed = 22; 
Heavytank.deccelrate = 60; 
Heavytank.accelrate = 60; 
Heavytank.maxspeed = 16.9; 
HOW TO CHANGE GAME TYPE DEFINITION ON SERVERLIST

Code: Select all

$Server::MissionType = "Battlemode (MOD)";
EMITTER COLORS GUIDE

Code: Select all

Heres a reference "chart" for different color values for 
Tribes 2 (for things such as particles):

1 0 0 = red 
0 1 0 = green 
0 0 1 = blue 
1 0.5 0 = orange 
1 1 0 = yellow 
1 0 1 = purple 
1 1 1 = white 
0 1 1 = cyan 
1 0.5 0.5 pinkish sort of color (havnt tried it) 
0.5 1 0.5 = pale green 
0.5 0.5 1 = pale blue 
0 0 0 = black (invAlpha must be set to true) 
1 0.5 0.5 = pale yellow 
CLONE CENTER = CLONES YOU
MAD CONTROL = YOU LOSE YOUR TANK CONTROL TO A COMPUTER AI

AT THE START OF MISSION FILE...

Code: Select all

function CloneCenter::onEnter(%client,%this,%tank)
{
   %client = %tank.client;
   %client.createplayer();
   %client.spawntank(pickSpawnPoint("") @ " " @ %rot);
   %tank.setai(GoldLightAI);
   //Or client.player.setai(GoldLightAI);
}

function MadControl::onEnter(%client,%this,%tank)
{
   %client = %tank.client;
   %tank.setai(GoldLightAI);
}

datablock PowerUpData(MadControl)
{
category = "PowerUp";
shape = "~/data/shapes/common/recharge.dts";
type = "weapon";
minOff = 0;
maxOff = 0;
startOn = true;
shadow = true;
shadowAnimation = true;
aiPickup = true;

Sound = "PupOnSound";
soundOff = "PupOffSound";
};

datablock PowerUpData(CloneCenter)
{
category = "PowerUp";
shape = "~/data/shapes/common/recharge.dts";
type = "weapon";
minOff = 0;
maxOff = 0;
startOn = true;
shadow = true;
shadowAnimation = true;
aiPickup = true;

Sound = "PupOnSound";
soundOff = "PupOffSound";
};
...LATER IN THE MISSION FILE

Code: Select all

   new PowerUp() {
      dataBlock = "CloneCenter";
      position = "42.9368 -33.4913 63.7055";
      rotation = "0.0440578 -0.179036 -0.982856 34.8027";
      scale = "1 1 1";
      lightBoost = "0";
   };
   new PowerUp() {
      dataBlock = "MadControl";
      position = "33.1737 -21.187 64.5959";
      rotation = "-0.0873596 -0.0221881 -0.99593 92.9074";
      scale = "1 1 1";
      lightBoost = "0";
   };
SPEED GATE = NEEDS FASTTANKS SCRIPTS INSTALLED. FOUND FROM 20+ SCRIPTS THREAD.

AT THE START OF MISSION FILE...

Code: Select all

datablock PowerUpData(SpeedGate)
{
   category = "PowerUp";
   shape = "~/data/shapes/common/recharge.dts";
   userseq1 = "activate";
   type = "weapon";
   shadow = true;
   staticShadow = true;

   soundOff = "ReloadSound";
};

function SpeedGate::onEnter(%db,%this,%tank)
{
   if (%db.type $= "weapon")
   {
      %choice = getRandom($pupTypes[3]);

        %orig_tank = %tank.dataBlock;
        if(%orig_tank $= "FastLightTank" | %orig_tank $= "FastMediumTank"  | %orig_tank $= "FastHeavyTank" )
            %orig_tank = $fastTankMap[%orig_tank];

        %tank.setDataBlock($tankMap[%orig_tank]);
        %tank.schedule(30000,"setDataBlock",%orig_tank);

      // schedule say SpeedyPup
      if (isObject(%tank.client))
         %tank.client.schedule(1000,"play2D","ActivateSpeedy");
   }
}
...LATER IN MISSION FILE

Code: Select all

   new PowerUp() {
      dataBlock = "SpeedGate";
      position = "77.8072 -69.1238 95.6818";
      rotation = "0.0373977 -0.0634508 -0.997284 94.2066";
      scale = "1 1 1";
      lightBoost = "0";
   };
VIEW BRAIN = WHEN PICKED SWITCHES YOUR CAMERA VIEW TO SIDE VIEW

AT THE START OF MISSION FILE...

Code: Select all

datablock PowerUpData(SideBrain)
{
   shape = "~/data/shapes/tanks/brain.dts";
   shadow = true;
   shadowAnimation = true;
   startOn = true;
   minOff = 1200;
   maxOff = 1200;

   sound = "PupOnSound";
   soundOff = "PupOffSound";
};

function SideBrain::onEnter(%db,%this,%tank)
{     
   %client = %tank.client;
   %tank.incScore(1);   // gives one point for player
   Centerprint(%client, "\c0You have picked up a brain", 3, 1);  
   Schedule(2000, 0, "toggleFirstPerson", 1);
}
...LATER IN MISSION FILE

Code: Select all

   new PowerUp() {
      dataBlock = "SideBrain";
      position = "75.8072 -67.1238 95.6818";
      rotation = "0.0377916 -0.0638672 0.997243 116.682";
      scale = "1 1 1";
      lightBoost = "0";
   };
NEGATIVE SCORES

Code: Select all

function Tank::incScore(%this,%delta,%deltaTeam)
{ 
%client = %this.client;
%client.score += %delta; 
%client.cumScore += %delta; 

if (isObject(%client.team)) 
{ 
%client.team.score += %deltaTeam; 
%client.team.cumScore += %deltaTeam;
} 
//END REMOVE LINES, next lines can be used to display messages when scores change.
messageAll('MsgClientScoreChanged', "", %client.score, %client.cumScore, %client); if (isObject(%client.team))
messageAll('MsgTeamScoreChanged', "", %client.team.score, %client.team.cumScore, %client.team.getId());
}
PICKING A BRAIN GIVES POINTS.
YOU NEED TO LATER PLACE AN OBJECT FOR IT.

Code: Select all

//:::::::BrainGivesPoints:::::::
function Brains::onEnter(%db,%this,%tank)
{     
   %client = %tank.client;
   %tank.incScore(%client.score ++);   // players score doubles plus two
   Centerprint(%client, "Aivot", 3, 1);  
}

datablock PowerUpData(Brains)
{
   shape = "~/data/shapes/tanks/brain.dts";
   shadow = true;
   shadowAnimation = true;
   startOn = true;
   minOff = 1200;
   maxOff = 1200;

   sound = "PupOnSound";
   soundOff = "PupOffSound";
};
MINE = FATAL FOR YOUR HEALTH
YOU NEED TO LATER PLACE AN OBJECT FOR IT.

Code: Select all

//:::::::MINE:::::::
function Mine::onEnter(%db, %this, %tank)

{
   %newPos = %z;
   %tank.setTransform(%newPos);
   %client = %tank.client;
   Centerprint(%client, "", 3, 1);  
   %tank.hurtMe(100);
   %tank.incScore(-1,1);
   
   // Plays explosion sound
   if (isObject(%tank.client))
      %tank.client.schedule(1000,"play2D","RockBoom");
}             

datablock PowerUpData(Mine)

{
   aipickup = 0;
   emitterduration = 0;
   maxoff = 1600;
   minoff = 800;
   shadow = 1;
   shadowanimation = 1;
   shape = "game/data/shapes/tanks/defaultexplosion.dts";
   starton = 0;
   staticshadow = 0;
};
TOUCHING THIS GIVES YOU POINTS
YOU NEED TO LATER PLACE AN OBJECT FOR IT.
//:::::::POINT PER TOUCH:::::::

Code: Select all

datablock PowerUpData(Play)

{
   aipickup = 0;
   emitterduration = 0;
   maxoff = 0;
   minoff = 0;
   shadow = 1;
   shadowanimation = 1;
   shape = "~/data/shapes/common/scrumgoal.dts";
   starton = 0;
   staticshadow = 0;
};

function Play::onEnter(%db,%this,%tank)

{   
   if ($Game::MissionType $= "Deathmatch")
   {
      serverPlay3D(PupOffSound,%this.getTransform());
      if ($Game::TeamGame)
         bottomPrintAll(%tank.client.nameBase SPC "finished a one lap for the" SPC %tank.client.team.shortName SPC "team!",4,2);
      else
         bottomPrintAll(%tank.client.nameBase SPC "finished a one lap",4,2);
      %tank.incScore(1,1);         
   }   
}
TELEPORTS YOU - NOT SURE WHERE
YOU NEED TO LATER PLACE AN OBJECT FOR IT.

Code: Select all

//:::::::SPAWN TELEPORT:::::::
function SpawnTeleport::onEnter(%db, %this, %tank)

{
   %pos = %tank.getPosition();
   %rot = %tank.Rotation;
   %newPos = (pickSpawnPoint("") @ " " @ %rot);
   %tank.setTransform(%newPos);
   %client = %tank.client;
   Centerprint(%client, "", 3, 1);  

}

datablock PowerUpData(SpawnTeleport)

{
   aipickup = 0;
   emitterduration = 0;
   maxoff = 100;
   minoff = 50;
   shadow = 1;
   shadowanimation = 1;
   shape = "game/data/shapes/common/scrumgoal.dts";
   starton = 0;
   staticshadow = 0;
};  
SPEEDY ONLY POWERUP
YOU NEED TO LATER PLACE AN OBJECT FOR IT.

Code: Select all

//:::::::SPEEDY ONLY PUP:::::::
datablock PowerUpData(SpeedyPup)
{
   category = "PowerUp";
   shape = "~/data/shapes/common/powerup.dts";
   type = "weapon";
   minOff = 60000;
   maxOff = 90000;
   startOn = false;
   shadow = true;
   shadowAnimation = true;
   aiPickup = true;

   sound = "PupOnSound";
   soundOff = "PupOffSound";
};

function SpeedyPup::onEnter(%db,%this,%tank)
{
   if (%db.type $= "weapon")
   {
      %choice = getRandom($pupTypes[0]);
      %tank.setProjectile($pupTypes[0]);
      // schedule say SpeedyPup
      if (isObject(%tank.client))
         %tank.client.schedule(1000,"play2D","ActivateSpeedy");
   }
}
UFO CHANGER
YOU NEED TO LATER PLACE AN OBJECT FOR IT.

Code: Select all

//:::::::BABYBOSS CHANGER:::::::
datablock PowerUpData(BabybossChanger)
{
   aipickup = 0;
   emitterduration = 0;
   shadow = 1;
   shadowanimation = 1;
   starton = 0;
   staticshadow = 0;
   category = "PowerUp";
   shape = "~/data/shapes/common/recharge.dts";

   soundOff = "ReloadSound";
};

function BabybossChanger::onEnter(%db,%this,%tank)
{
   %client = %tank.client;
   %clienttank = %client.startingtankdb;
   %tank.client.startingtankdb = "babyboss";
   //%tank.hurtme(100);
   Centerprint(%client, "Switching to UFO", 3, 1);
   $dumb2:schedule1 = %tank.schedule(1500 , hurtme, 100);
}
HEALTH STATION
YOU NEED TO LATER PLACE AN OBJECT FOR IT.

Code: Select all

//:::::::HEALTH STATION:::::::
datablock PowerUpData(HealGate)
{
   category = "PowerUp";
   shape = "~/data/shapes/common/recharge.dts";
   userseq1 = "activate";
   type = "health";
   shadow = true;
   staticShadow = true;

   soundOff = "ReloadSound";
};

function HealGate::onEnter(%db,%this,%tank)
{
   if (%db.type $= "health")
   {
      %tank.hurtMe(-100);

      // schedule say Heal
      if (isObject(%tank.client))
         %tank.client.schedule(1000,"play2D","ActivateHeal");
   }
}
WEAPON STATION
YOU NEED TO LATER PLACE AN OBJECT FOR IT.

Code: Select all

//:::::::WEAPON STATION:::::::
datablock PowerUpData(WeaponGate)
{
   category = "PowerUp";
   shape = "~/data/shapes/common/recharge.dts";
   userseq1 = "activate";
   type = "weapon";
   shadow = true;
   staticShadow = true;

   soundOff = "ReloadSound";
};

function WeaponGate::onEnter(%db,%this,%tank)
{
   //echo(%tank.client.name @ " enters powerup " @ %this.getId() @ " of type " @ %db.type);
   if (%db.type $= "weapon")
   {
      %choice = getRandom($NumPupTypes-1);
      %tank.setProjectile($pupTypes[%choice]);
      // schedule say $pupSnds[%choice]
      if (isObject(%tank.client))
         %tank.client.schedule(1000,"play2D",$pupSnds[%choice]);
   }
}
HEALTH ONLY POWERUP
YOU NEED TO LATER PLACE AN OBJECT FOR IT.

Code: Select all

//:::::::HEALTH ONLY POWERUP:::::::
datablock PowerUpData(Health)
{
   category = "PowerUp";
   shape = "~/data/shapes/common/health.dts";
   type = "health";
   minOff = 90000;
   maxOff = 120000;
   startOn = false;
   shadow = true;
   shadowAnimation = true;
   aiPickup = true;

   sound = "PupOnSound";
   soundOff = "PupOffSound";
};

function Health::onEnter(%db,%this,%tank)
{
   if (%db.type $= "health")
   {
      %tank.hurtMe(-100);

      // schedule say Heal
      if (isObject(%tank.client))
         %tank.client.schedule(1000,"play2D","ActivateHeal");
   }
}
WEAPON ONLY POWERUP
YOU NEED TO LATER PLACE AN OBJECT FOR IT.

Code: Select all

//:::::::WEAPON ONLY POWERUP:::::::
datablock PowerUpData(WeaponPowerup)
{
   category = "PowerUp";
   shape = "~/data/shapes/common/powerup.dts";
   type = "weapon";
   minOff = 60000;
   maxOff = 90000;
   startOn = false;
   shadow = true;
   shadowAnimation = true;
   aiPickup = true;

   sound = "PupOnSound";
   soundOff = "PupOffSound";
};

function WeaponPowerup::onEnter(%db,%this,%tank)
{
   //echo(%tank.client.name @ " enters powerup " @ %this.getId() @ " of type " @ %db.type);
   if (%db.type $= "weapon")
   {
      %choice = getRandom($NumPupTypes-1);
      %tank.setProjectile($pupTypes[%choice]);
      // schedule say $pupSnds[%choice]
      if (isObject(%tank.client))
         %tank.client.schedule(1000,"play2D",$pupSnds[%choice]);
   }
}
CRAZYYYYYYYYYYYYYYY !!!!!!!!!!!! TRY THIS PUT SOMEWHERE!!!!!!!!!1 LOL

Code: Select all

$specialFog = "1"; 
FOG LAYERS - EXPLAINED

Code: Select all

With respects to "gaps" in the fog layer, have you tried setting the end of one fog layer to the start of the next? 

For example:

         fogVolume1 = "50 0 200";
         fogVolume2 = "75 200 250";
         fogVolume3 = "100 250 300";

(note that the upper limit of one fog layer is 200 and the lower limit of the next is 200)

I have this and I don´t see any gaps. Or did you mean something else?

The engine supports 3 fog layers. These layers are defined in the .mis file and could be changed in code. Here is a snippit and what each does:

// fogStormX is to enable and disable a particular fog layer.
// 0 is ENABLE and 1 is disable.
fogStorm1 = "0"; 
fogStorm2 = "1"; 
fogStorm3 = "0"; 

// The fogVolumeX discripes what "levels" the fog exists 
// at and how dense it is.
// 1st - is the "distance" one can see.
// 2nd - is the start height of the fog layer.
// 3rd - is the end height of the fog layer.
// NOTE: fog layers cannot overlap.
fogVolume1 = "100 0 169.5"; 
fogVolume2 = "150 170 250";
fogVolume3 = "0 0 0";

// The fogVolumeColorX descripts the color of the fog.
// 1st - red
// 2nd - blue
// 3rd - green
// 4th - Alpha
// The values should all be between 0.0 and 1.0.
fogVolumeColor1 = "0.900000 0.900000 0.900000 1.000000";
fogVolumeColor2 = "0.900000 0.900000 0.900000 1.000000";
fogVolumeColor3 = "0.000000 0.000000 0.000000 1.000000";
THE COLOR CHANGING EMITTER

Code: Select all

datablock particledata(lightparticle)
{
animateTexture = "1";
animTexName[0] = "game/data/shapes/tanks/AreaExplosion.jpg";
colors[0] = "0 0 1 1.000000";
colors[1] = "0 1 0 1.000000";
colors[2] = "1 0 0 1.000000";
colors[3] = "0.000000 0.000000 0.000000 1.000000";
constantAcceleration = "1";
dragCoefficient = "0.997067";
framesPerSec = "100";
gravityCoefficient = "-0.20757";
inheritedVelFactor = "0.297456";
lifetimeMS = "5000";
lifetimeVarianceMS = "250";
sizes[0] = "0.247922";
sizes[1] = "0.745389";
sizes[2] = "0.84409";
sizes[3] = "1.54513";
spinRandomMax = "500";
spinRandomMin = "90";
spinSpeed = "100";
textureName = "game/data/shapes/common/VolcanoExplosion.png";
times[0] = "5";
times[1] = "1.5";
times[2] = "9";
times[3] = "1";
useInvAlpha = "1";
windCoefficient = "0";
};
//
//
datablock particleemitterdata(lightparticleemitter)
{
className = "ParticleEmitterData";
ejectionOffset = "0";
ejectionPeriodMS = "2";
ejectionVelocity = "25.5";
lifetimeMS = "1";
lifetimeVarianceMS = "1";
orientOnVelocity = "1";
orientParticles = "0";
overrideAdvance = "1";
particleFarDist = "10000000000000";
particles = "lightparticle";
periodVarianceMS = "27";
phiReferenceVel = "0";
phiVariance = "360";
thetaMax = "90";
thetaMin = "90";
useEmitterColors = "0";
useEmitterSizes = "0";
velocityVariance = "100.0";
};
WILL BE CONTINUED FROM SAME TITLED THREAD BUT NUMBER #2
Post Reply