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.

Scripting Tank Datablocks: Balanced Tank Ideas

Modding questions, answers, help.....

Moderators: Warfare, Moderator, Admin

Disturbo
A Few Broken Fenders
A Few Broken Fenders
Posts: 178
Joined: Thu Mar 22, 2007 12:46 pm

Post by Disturbo »

Next project: TimedTank.

Described already, it's going to be a dominating over-powerful tank that only lasts 1 min 30 seconds before self-destructing due to negative repairRate, or for even less time if it takes weapon/fog damage. I'll use the cruiser shape for this tank, and I have a race cruiser skin which I can edit(in order to get some totally irritating Honda signs off it!). I don't know what I'll use for it's brain and muzzleflash, however. It's code will be /ysan, meaning 'Your Seconds Are Numbered'.

BTW, here's the laser weapon datablock for the ElectricCharger:

Code: Select all

datablock ProjectileData(LaserProjectile)
{
   velocity = 64.0;           // meters per second
   inheritVelocity = 0.00;    // how much of shooters velocity to inherit
   numBounce = 0;             // usually 0
   bounceFactor = 0.0;
   splashArea = 0.0;          // usually 0
   count = 1000;                // how many shots per clip?
   saveOldCartridge = true;   // chuck old cartridge or keep it around
   canSave = false;           // can this cartridge be saved if another comes along?
   reloadTime = 50;         // in milliseconds
   burstDelay = 5000;         // milliseconds until next burst if button held down
   burstCount = 20;            // 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;                // usually 1
   gravityScale = 0.0;        //
   sizeScale = 0.3;           // scale of projectile (meters for bitmaps)
   resource = "~/data/shapes/Dazzle_Mods/Dazzle_Weapons_Pack/Projectiles_and_Explosions/Laser/DZ_laser.dts";
   tankExplosion = "LaserExplosion";   // datablock for explosion
   ownTankExplosion = "LaserExplosion";   // datablock for explosion
   bounceExplosion = "DefaultExplosion"; // datablock for explosion
   otherExplosion = "LaserExplosion";  // datablock for explosion
   reticle = "LaserReticle";
   emitter = "LaserEmitter";
};
I'm not going to release the reticle, emitter, explosion because those are physical stuff that can be made easily. I'm not going to release the EC's server code either. If I ever host my server online, the winning player/team of a populated online game observed by me will receive the code to the EC, making the ElectricCharger an 'unlockable'. :noshare: Anyone who wants to host the EC themselves will have set there own code for it(easy enough!).

The tank factory rolls on! :hello1: :geek: :wav:
Image

Visit the ThinkTanks tank factory!
Hhal
Need Major Repair
Need Major Repair
Posts: 620
Joined: Sat Jan 06, 2007 1:23 pm

Post by Hhal »

TMG Leader wrote:@ Brandon I noticed that your medic tanks tank data was named healboss i didnt know if u wanted it to heal itself if u didnt know how to to this heres the code add it at the end of the tanks data.

Code: Select all

repairRate = 0.7; 
repairs per second i would leave the number from 0.1-0.7 or else if it goes any higher your tank will take for ever to die.
It's not working for me...I drive my Medic into the fog and it keeps smoking forever and ever. I cranked it all the way up to 0.7 too! You sure you didn't just make this up? :gee:
Disturbo
A Few Broken Fenders
A Few Broken Fenders
Posts: 178
Joined: Thu Mar 22, 2007 12:46 pm

Post by Disturbo »

How much armor does your Medic have? If it keeps smoking forever and ever, that means the repairRate must be healing you at the same rate as the fog is damaging you, leading to an equilibrium and eternal fog-resistance for your tank! Hmmm...

However, I'm yet to test this feature myself. I think I'm going to postpone the TimedTank project in order to try and script up a mousewheel-activated speed-booster function for the EC, Charger and all my admin vehicles.

If repairRate does work, then the boostTicks, bounceStatic, bounceTank, unstuckTime, and unstuckBoost variables should also work in tankDB.cs. See the bottom of tankFx.cs for info about these variables. If the bounceStatic and bounceTank variables do work, then I'll set a negative bounceTank value for the EC in order to double the power of ramming attacks while keeping the tank's normal properties the same.
Image

Visit the ThinkTanks tank factory!
Hhal
Need Major Repair
Need Major Repair
Posts: 620
Joined: Sat Jan 06, 2007 1:23 pm

Post by Hhal »

Disturbo wrote:How much armor does your Medic have? If it keeps smoking forever and ever, that means the repairRate must be healing you at the same rate as the fog is damaging you, leading to an equilibrium and eternal fog-resistance for your tank! Hmmm...
No, that's not what I meant. I meant that I dip my 3 armor medic into the fog, pull it out really fast, then sit around for 10 minutes staring into the thick smoke waiting for something to happen. I really wonder if TMG isn't mistaken on this.
Disturbo wrote:However, I'm yet to test this feature myself. I think I'm going to postpone the TimedTank project in order to try and script up a mousewheel-activated speed-booster function for the EC, Charger and all my admin vehicles.
Good luck! I'm not that good at scripting, so I can't help you there.
Disturbo wrote:If the bounceStatic and bounceTank variables do work, then I'll set a negative bounceTank value for the EC in order to double the power of ramming attacks while keeping the tank's normal properties the same.
So you mean that the tank will be completely immune to gravity? Yay!!
Nightbane
A Few Broken Fenders
A Few Broken Fenders
Posts: 142
Joined: Sat Apr 21, 2007 4:30 am
Location: singapore

Post by Nightbane »

where to add these datablocks?
ImageNightbane's battle againts the ASV Boss Image I LOVE her LOL!
Hhal
Need Major Repair
Need Major Repair
Posts: 620
Joined: Sat Jan 06, 2007 1:23 pm

Post by Hhal »

How about instead of wasting 5 minutes of my time reading your spam, you go and REMOVE THAT HUGE SIG, read the MODDING RESOURCE, and STOP POSTING IN THREADS ASKING STUPID QUESTIONS.
Disturbo
A Few Broken Fenders
A Few Broken Fenders
Posts: 178
Joined: Thu Mar 22, 2007 12:46 pm

Post by Disturbo »

Hhal wrote:
Disturbo wrote:How much armor does your Medic have? If it keeps smoking forever and ever, that means the repairRate must be healing you at the same rate as the fog is damaging you, leading to an equilibrium and eternal fog-resistance for your tank! Hmmm...
No, that's not what I meant. I meant that I dip my 3 armor medic into the fog, pull it out really fast, then sit around for 10 minutes staring into the thick smoke waiting for something to happen. I really wonder if TMG isn't mistaken on this.
Disturbo wrote:However, I'm yet to test this feature myself. I think I'm going to postpone the TimedTank project in order to try and script up a mousewheel-activated speed-booster function for the EC, Charger and all my admin vehicles.
Good luck! I'm not that good at scripting, so I can't help you there.
Disturbo wrote:If the bounceStatic and bounceTank variables do work, then I'll set a negative bounceTank value for the EC in order to double the power of ramming attacks while keeping the tank's normal properties the same.
So you mean that the tank will be completely immune to gravity? Yay!!

1.
I've got the extra variables thing all sorted out. DON'T PUT THE EXTRA LINE IN THE TANK DATABLOCK ITSELF! Instead, do what I did. Go to tankFx.cs and create a new TankMiscData datablock, where you put the variables. Here's the one I made for the EC:

Code: Select all

datablock TankMiscData(DownforceMisc)
{
   boostTicks = 5;           // spread boost over this many ticks
   bounceTerrain = 1.0;       // 0->complete stop 1->full reverse
   bounceStatic = 0.0;       // 0->complete stop 1->full reverse
   frictionTerrain = 1.0;     // 0->no friction, 1->sticky
   bounceTank = 0.0;        // 0->complete stop 1->full reverse
   unstuckTime = 1000;       // time (in ms) tank can be stuck before getting unstuck boost
   unstuckBoost = 10;         // velocity boost in m/s
   repairRate = 0.03;         // number of units of damage repaired/second
};
Then, go to tankDb.cs and add a line for the misc data. Here's the one for the EC:

Code: Select all

   misc = "DownforceMisc";
Recompile the cs.dsos and try it out. It worked for the EC.

2.I thought that making a function for a speed boost attached to the mousewheel would be easy since the race modders do it all the time. I tried once and it crashed, but at least I now know how to attach a function to the 'wheel. The timed tank project would be easier though, but this would advance my scripting skills more than the self-destructing cruiser would.

3.It's not immune to gravity. The bounceTank, bounceStatic and bounceTerrain values describe how the tank acts upon collision with other tanks(inevitably in ramming attacks) , static objects(trees, rocks, etc.) and terrain(which occurs when the tank slams into a hill!). I've set bTank & bStatic to 0 so that the tank doesn't jump like crazy when it crashes into something, and I've set bTerrain to 1.0 so that the tank stops when it lands from a jump and doesn't go skittering along the ground. The bounceTerrain and frictionTerrain variables are actually scrum ball technology which I've incorporated in a tank without any problem. :idea:
Image

Visit the ThinkTanks tank factory!
User avatar
TMG Leader
Veteran Light
Veteran Light
Posts: 962
Joined: Mon Jun 25, 2007 10:31 am
Location: In my refrigerator....

Post by TMG Leader »

Why would I put a code like that if it wasnt real? And all the credit goes to Musick hes the 1 that found it and told me how to do it.
Disturbo wrote:How much armor does your Medic have? If it keeps smoking forever and ever, that means the repairRate must be healing you at the same rate as the fog is damaging you, leading to an equilibrium and eternal fog-resistance for your tank! Hmmm...
Disturbo is right if you keep on smoking the repair rate is doing its job but if your expecting it to heal super fast in the fog you would have to use a big number. The only reason I said .01-.07 is because I wanted it to be more fair so it dosnt take for ever for one tank to die in combat.
First to fall, last man standing.
Disturbo
A Few Broken Fenders
A Few Broken Fenders
Posts: 178
Joined: Thu Mar 22, 2007 12:46 pm

Post by Disturbo »

The code is real alright. I implemented it as shown in my above post, and it can heal - 'recharge' - the ElectricCharger from near-dead to full health in a little over 5 minutes. It's set to a very low stat of 0.03 so that it takes 33 seconds to recover 1 health point, and thus 330 seconds(5 and a half minutes) to reach full health of 10 hp.

BTW, I abandoned the idea of a speed booster, since I don't know the TSL code required to increase a tank's velocity(I do know how to modify it's score and health though). If anyone knows, please tell me. I can't find it in the resource.
Image

Visit the ThinkTanks tank factory!
ArtCrazy
Veteran Member
Veteran Member
Posts: 290
Joined: Fri Dec 29, 2006 10:14 am

Post by ArtCrazy »

Disturbo wrote:The code is real alright. I implemented it as shown in my above post, and it can heal - 'recharge' - the ElectricCharger from near-dead to full health in a little over 5 minutes. It's set to a very low stat of 0.03 so that it takes 33 seconds to recover 1 health point, and thus 330 seconds(5 and a half minutes) to reach full health of 10 hp.

BTW, I abandoned the idea of a speed booster, since I don't know the TSL code required to increase a tank's velocity(I do know how to modify it's score and health though). If anyone knows, please tell me. I can't find it in the resource.
There is noway to do that without changing the tank datablock. Create 2 datablocks, the same tank except one is faster, and switch between them.
It's also possible to tell the script to create a new tank datablock during runtime, but that'd be harder :P

Anyways, Remember the code is SERVER-SIDE, so to apply a key to it (like mouse wheel) everyone that wants to use that function MUST HAVE THE SCRIPT INSTALLED.

Who is online

Users browsing this forum: ClaudeBot [Bot] and 13 guests