coding start

Author Topic: coding start  (Read 1658 times)

I'm new to coding and im wondering where to start.

Get someone to help you. Believe it or not, the less haughty of the experienced scripters around here are quite nice. I won't say who, since everyone would pester him for help, but someone who everyone would know but doesn't post on the forums a whole lot helped me. Then I looked at some tutorials, and then I bought TGE! Yay!


Torque Game Engine, the engine Blockland runs on.

The best way to learn is look through scripts, read a few tutorials (can be found by searching forums) and try and make stuff.

lego were you talking about me?   Well, starting in coding can be a very easy, or very hard thing to do. You should start off with edits first, because they are the easiest.  The main thing that you ned to know for editing a .cs is datablocks at this point. Datablocks care actually (in my mind) advanced variables or place holders, it all depends on how you use them. You always need to change the datablocks to make a good edit. here is a portion of the gun.cs. I have highlighted in red all of the datablocks that needed to be changed. when you want to create a new .cs just copy an existing one, and rename it. 

/gun.cs

//audio
datablock AudioProfile(gunShot1Sound)
{
   filename    = "./sound/gunShot1.wav";
   description = AudioClose3d;
   preload = true;
};
datablock AudioProfile(insert name herebulletHitSound)
{
   filename    = "./sound/arrowHit.wav";
   description = AudioClose3d;
   preload = true;
};


//shell
datablock DebrisData(gunShellDebris)
{
   shapeFile = "./shapes/gunShell.dts";
   lifetime = 2.0;
   minSpinSpeed = -400.0;
   maxSpinSpeed = 200.0;
   elasticity = 0.5;
   friction = 0.2;
   numBounces = 3;
   staticOnMaxBounce = true;
   snapOnMaxBounce = false;
   fade = true;

   gravModifier = 2;
};


//muzzle flash effects
datablock ParticleData(gunFlashParticle)
{
   dragCoefficient      = 3;
   gravityCoefficient   = -0.5;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 25;
   lifetimeVarianceMS   = 15;
   textureName          = "base/data/particles/star1";
   spinSpeed      = 10.0;
   spinRandomMin      = -500.0;
   spinRandomMax      = 500.0;
   colors[0]     = "0.9 0.9 0.0 0.9";
   colors[1]     = "0.9 0.5 0.0 0.0";
   sizes[0]      = 0.5;
   sizes[1]      = 1.0;

   useInvAlpha = false;
};
datablock ParticleEmitterData(gunFlashEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 1.0;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "gunFlashParticle";
};

datablock ParticleData(gunSmokeParticle)
{
   dragCoefficient      = 3;
   gravityCoefficient   = -0.5;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 525;
   lifetimeVarianceMS   = 55;
   textureName          = "base/data/particles/cloud";
   spinSpeed      = 10.0;
   spinRandomMin      = -500.0;
   spinRandomMax      = 500.0;
   colors[0]     = "0.5 0.5 0.5 0.9";
   colors[1]     = "0.5 0.5 0.5 0.0";
   sizes[0]      = 0.15;
   sizes[1]      = 0.15;

   useInvAlpha = false;
};
datablock ParticleEmitterData(gunSmokeEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 1.0;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "gunSmokeParticle";
};


//bullet trail effects
datablock ParticleData(insert name herebulletTrailParticle)
{
   dragCoefficient      = 3;
   gravityCoefficient   = -0.0;
   inheritedVelFactor   = 1.0;
   constantAcceleration = 0.0;
   lifetimeMS           = 525;
   lifetimeVarianceMS   = 55;
   textureName          = "base/data/particles/thinRing";
   spinSpeed      = 10.0;
   spinRandomMin      = -500.0;
   spinRandomMax      = 500.0;
   colors[0]     = "0.3 0.3 0.9 0.4";
   colors[1]     = "0.5 0.5 0.5 0.0";
   sizes[0]      = 0.15;
   sizes[1]      = 0.25;

   useInvAlpha = false;
};
datablock ParticleEmitterData(insert name herebulletTrailEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 0.0;
   velocityVariance = 0.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "insert name herebulletTrailParticle";
};


datablock ParticleData(gunExplosionParticle)
{
   dragCoefficient      = 8;
   gravityCoefficient   = -0.5;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 700;
   lifetimeVarianceMS   = 400;
   textureName          = "base/data/particles/cloud";
   spinSpeed      = 10.0;
   spinRandomMin      = -50.0;
   spinRandomMax      = 50.0;
   colors[0]     = "0.9 0.9 0.6 0.9";
   colors[1]     = "0.9 0.5 0.6 0.0";
   sizes[0]      = 0.25;
   sizes[1]      = 1.0;

   useInvAlpha = true;
};
datablock ParticleEmitterData(gunExplosionEmitter)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 5;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 89;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "gunExplosionParticle";
};


datablock ParticleData(gunExplosionRingParticle)
{
   dragCoefficient      = 8;
   gravityCoefficient   = -0.5;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 300;
   lifetimeVarianceMS   = 100;
   textureName          = "base/data/particles/star1";
   spinSpeed      = 10.0;
   spinRandomMin      = -50.0;
   spinRandomMax      = 50.0;
   colors[0]     = "1 1 0.0 0.9";
   colors[1]     = "0.9 0.0 0.0 0.0";
   sizes[0]      = 0.2;
   sizes[1]      = 0.2;

   useInvAlpha = false;
};
datablock ParticleEmitterData(gunExplosionRingEmitter)
{
   lifeTimeMS = 50;

   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 5;
   velocityVariance = 0.0;
   ejectionOffset   = 0.0;
   thetaMin         = 89;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "gunExplosionRingParticle";
};

datablock ExplosionData(gunExplosion)
{
   //explosionShape = "";
   soundProfile = bulletHitSound;

   lifeTimeMS = 150;

   particleEmitter = gunExplosionEmitter;
   particleDensity = 10;
   particleRadius = 0.2;

   emitter[0] = gunExplosionRingEmitter;

   faceViewer     = true;
   explosionScale = "1 1 1";

   shakeCamera = false;
   camShakeFreq = "10.0 11.0 10.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   // Dynamic light
   lightStartRadius = 0;
   lightEndRadius = 2;
   lightStartColor = "0.3 0.6 0.7";
   lightEndColor = "0 0 0";
};


AddDamageType("Gun",   '<bitmap:add-ons/ci/gun> %1',    '%2 <bitmap:add-ons/ci/gun> %1',0.5,1);
datablock ProjectileData(gunProjectile)


and it goes on, you get the idea. look around in you shapes, sound, and other folders in your addon folder. you can add sounds to your sound folder, and change it is your .cs files. that is a baisic overview of how to make .cs files and mods. if you ned help, there are alot of experianced users in the coding help section of the forums that can answer your questions.



you dont code from scratch unless you know torque script, you can get the torque engine here: http://www.garagegames.com/



3d modeling: there are lots of ways ad programs that you can model things, what you should start with is google sketchup, it is avery easy to use program, and is a good start, for exporting your model to .dts files form the sketchup file, you can just ask on the forums, you ill get an answer.  it can be found here: http://sketchup.google.com/

good luck  :cookieMonster:
« Last Edit: January 25, 2008, 12:56:00 PM by Radial543 »

Damn it, don't suggest that people learn how to code by editing weapons.

Teach them how to construct their own datablocks and weapon states.

i guess your right :/  , but alas i'm not fitted for that
« Last Edit: January 25, 2008, 12:58:46 PM by Radial543 »


Get someone to help you. Believe it or not, the less haughty of the experienced scripters around here are quite nice. I won't say who, since everyone would pester him for help, but someone who everyone would know but doesn't post on the forums a whole lot helped me. Then I looked at some tutorials, and then I bought TGE! Yay!
Jookia? or someone else who is banned/doesnt post much?

And, of course, LegoEggo is now an epic modder.  He must have had good help.

Is there a TGE for free because I don't really want pay $100+   also thank you for helping me guys

Is there a TGE for free because I don't really want pay $100+   also thank you for helping me guys
Not unless you want it illegally. Which is just stupid.

And, of course, LegoEggo is now an epic modder.  He must have had good help.

I lol'd much :cookieMonster: .

I never said they gave me in depth, 6 hour, complicated, pwnage lessons - they just gave me a start.

If you reallyreallyreally want to know who helped me, send me a PM, cause PMs are pwn.



Is there a TGE for free because I don't really want pay $100+   also thank you for helping me guys

You don't need to buy it to make mods for blockland.

And, of course, LegoEggo is now an epic modder.  He must have had good help.

I lol'd much :cookieMonster: .

I never said they gave me in depth, 6 hour, complicated, pwnage lessons - they just gave me a start.

If you reallyreallyreally want to know who helped me, send me a PM, cause PMs are pwn.




Its Aloshi. Amrite?