Forums Index >> Modding >> TUTORIAL: How To Create A New Weapon
Page : <1> :
Hey, I can not find the folder called Special.cs. All I found was Special.cs.dso. That one didnt have thoose lines with the different weapons on.
Lookin out for a new army.
Monday, July 31, 2006 at 6:27:59 PM
Page : <1> :
I'm making this tutorial due to a request by EXE. Please note that I did not make very much weapons myself, so it could be that small errors occur.
Only Part #1 and Part #2 are neccesary, but I suggest doing Part #1, Part #2, Part #3 & Part #4. Don't do Part #5 if you don't know what you're doing.
There's one TT-opensourced file neccesary for this, the Special.cs
Place the special.cs into game/server/scripts. So, let's start?
Part #1 - - The Weapon Itsself
1. Open your special.cs
2. Add these lines (the quoted part) to the bottom of it
d atablock ProjectileData(MyNewProjectile)
{
velocity = 85.0; // meters per second
inheritVelocity = 0.97; // how much of shooters velocity to inherit
numBounce = 0; // usually 0
splashArea = 0.0; // usually 0
count = 145; // how many shots per clip?
saveOldCartridge = false; // chuck old cartridge or keep it around
canSave = true; // can this cartridge be saved if another comes along?cons
reloadTime = 150; // in milliseconds
burstDelay = 1000; // milliseconds until next burst if button held down
burstCount = 5; // number of projectiles to fire per burst
synchTime = 1000; // synch over this many milliseconds
synchBefore = 500; // synch if not older than this in milliseconds
damage = 1; // the damage your weapon does to foes.
gravityScale = 0.4; // howmuch will your new weapon be influenced by the gravity?
sizeScale = 0.4; // scale of projectile (meters for bitmaps)
resource = "~/data/shapes/tanks/DefaultProjectile.png"; // shape or bitmap
tankExplosion = "DefaultTankExplosion"; // datablock for explosion
ownTankExplosion = "DefaultOwnTankExplosion"; // datablock for explosion
bounceExplosion = "DefaultExplosion"; // datablock for explosion
otherExplosion = "DefaultExplosion"; // datablock for explosion
reticle = "DefaultReticle"; // datablock for rectile
};
3. Now it's time to make your weapon be original...
3.1. Change some of the numbers (what number does what, is the piece of text behind the '//' [Copyright to MAX-CR for That])
3.2. Change the path to shape or bitmap (make sure the path is correct)
3.3. I suggest not changing the lines below resource.
4. Rename your weapon to what you want, do that by doing this:
Change
d atablock ProjectileData(MyNewProjectile)
To
d atablock ProjectileData(TheNameOfYourWeaponGoesHere )
Make sure there are NO spaces in the name of your weapon.
Ok, you just finished Part #1, Congrats! Time to move on now!
Part #2 - - Make Your Weapon Work Whit A PowerUp
1. Open-Up your special.cs again, and find these lines:
$n umPupTypes = 3;
$pupTypes[0] = "SpeedyProjectile";
$pupTypes[1] = "BounceProjectile";
$pupTypes[2] = "SplashProjectile";
$pupSnds[0] = "ActivateSpeedy";
$pupSnds[1] = "ActivateBounce";
$pupSnds[2] = "ActivateSplash";
Change these lines to:
$n umPupTypes = 4;
$pupTypes[0] = "SpeedyProjectile";
$pupTypes[1] = "BounceProjectile";
$pupTypes[2] = "SplashProjectile";
$pupTypes[3] = "TheNameOfYourWeaponGoesHere ";
$pupSnds[0] = "ActivateSpeedy";
$pupSnds[1] = "ActivateBounce";
$pupSnds[2] = "ActivateSplash";
$pupSnds[3] = "";
That wasn't such hard, was it? You're done, but I suggest doing next steps, too
Part #3 - Creating A Emitter For Your Weapon
1. Open up your special.cs
2. Add these lines to the bottom of it
d atablock particledata(NameOfYourEmitter )
{
animateTexture = "1";
animTexName[0] = "game/data/shapes/common/powerupGlassSpec.png";
colors[0] = "0.900000 0.900000 0.900000 1.000000";
colors[1] = "0.900000 0.900000 0.900000 1.000000";
colors[2] = "0.900000 0.900000 0.900000 1.000000";
colors[3] = "0.900000 0.900000 0.900000 1.000000";
constantAcceleration = "1";
dragCoefficient = "100";
framesPerSec = "1";
gravityCoefficient = "1000";
inheritedVelFactor = "100";
lifetimeMS = "1000";
lifetimeVarianceMS = "1";
sizes[0] = "1";
sizes[1] = "0.5";
sizes[2] = "2";
sizes[3] = "1";
spinRandomMax = "0";
spinRandomMin = "0";
spinSpeed = "1000";
textureName = "game/data/shapes/tanks/BossGlassSpec.png";
times[0] = "1";
times[1] = "1.2";
times[2] = "1.5";
times[3] = "2";
useInvAlpha = "true";
windCoefficient = "0";
};
d atablock particleemitterdata(NameOfYourEmitter emitter) // Make Sure emitter is after the name
{
className = "ParticleEmitterData";
ejectionOffset = "0";
ejectionPeriodMS = "25";
periodVarianceMS = "20";
ejectionVelocity = "5";
velocityVariance = "0.5";
lifetimeMS = "0";
lifetimeVarianceMS = "0";
orientOnVelocity = "1";
orientParticles = "0";
overrideAdvance = "false";
particleFarDist = "1000";
particles = "NameOfYourEmitter ";
phiReferenceVel = "0";
phiVariance = "360";
thetaMax = "180";
thetaMin = "180";
useEmitterColors = "0";
useEmitterSizes = "0";
};
d atablock ParticleEmitterNodeData(NameOfYourEmitter emitternode) // Make sure emitternode is after the name
{
timeMultiple = 99;
};
3. Change the numbers and paths (I think this website offers more info about emitters)
4. Add this line after the emitter's datablock
NameOfYourWeapon .emitter= "NameOfYourEmitter emitter"; //Make Sure emitter is after the name of the emitter
Okay, this piece is finished, too. Let's move on to Part #4 NOTE: Only do Part #4 If You Really Know What You're Doing [u]
[u]Part #4 - - Adding Your Weapon (Eventually + Emitter) To Your AdminScript
This piece is split in in two pieces, one for people whit DashCodes , and one for people whit ACAS
For People Whit ACAS
1. Open-Up game/server/Admin Script/AdminCodes.cs .
2. Find This Piece:
e lse if(%code $= "/invisi")
{
if(IsDictator(%sender,"You're not a Dictator"))
invisi(%sender,%msg);
return;
}
3. Add This Piece After That Piece
e lse if(%code $= "/newwep")
{
if(IsAdmin(%sender,"You're not an admin"))
admprojectilechanger(%sender,%msg,"TheNameOfYourWeapon ");
return;
}
4. So It Should Look Like This:
e lse if(%code $= "/invisi")
{
if(IsDictator(%sender,"You're not a Dictator"))
invisi(%sender,%msg);
return;
}
e lse if(%code $= "/newwep")
{
if(IsAdmin(%sender,"You're not an admin"))
admprojectilechanger(%sender,%msg,"TheNameOfYourWeapon ");
return;
}
e lse
{
bottomprint(%sender,%code SPC "is not a code",4,4);
return;
}
Your Ready To Use Your Weapon As A Code! (/newwep)
For People Whit DashCodes
1. Open-Up game/server/Dash/codes.cs
2. Find This Piece
e lse if (%code $= "/restart" )
call("restartGame",%sender);
3. After That Piece, add this:
e lse if (%code $= "/newwep" )
call("projectilechanger",%sender,"NameOfYourWeapon ");
4. So it should look like this:
e lse if (%code $= "/restart" )
call("restartGame",%sender);
else if (%code $= "/newwep" )
call("projectilechanger",%sender,"NameOfYourWeapon ");
else
commandToClient(%sender,'BottomPrint', %code@ " IS NOT A VALID CODE",4,4);
Your Ready To Use You Weapon As A Code! (/newwep)
--------------------------------------
Every piece of this tutorial is copyright © 2006, for Cassie. Exept ACAS © Art Crazy, DashCodes © Dash & Some Quotes © MAX-CR.
It Is NOT Prohibited To Copied, Showed To Public In Any Form WhatsSoEver, Whitout a prior written consent by Author.
--
@ Everyone Who Is Good At This : Plz tell me when there are errors/typos/missings of this tutorial, thank you.
-
Last edited: Sunday, July 23, 2006 at 5:21:48 AM