How do you create a .CS file?

Author Topic: How do you create a .CS file?  (Read 951 times)

I've been busting my ass trying to make mods when I haven't been able to make a Server.CS for them. Can someone tell me how? Thank you.

Bloukface

Notepad > Type Code  > Save As... > File Type: All Files | File Name: server.cs

That's what i've been doing, but the files don't work in-game. Should it be read-only?

That's what i've been doing, but the files don't work in-game. Should it be read-only?

Post your console.log of you executing your .cs file

Okay. I'd also like to know how to edit them without breaking them.

Okay. I'd also like to know how to edit them without breaking them.

Just set .cs files to open with Visual Studio/Notepad/Notepad++/Word/ whatever text editor you want to use.


If your .cs file doesn't work, first things first, you might have syntax error(s).

Just set .cs files to open with Visual Studio/Notepad/Notepad++/Word/
I open them with Notepad. When I want to save changes, it just makes a new copy of it as a txt. Then I have to re-save as a .cs and that's when it breaks.

AddDamageType("ThrowingKnifeDirect",  'Riddled %1 With Daggers',    '%2 Riddled %1 with Daggers!',1,1);

datablock ProjectileData(ThrowingKnifeProjectile)
{
   projectileShapeName = "./ThrowingDaggerProjectile.dts";

   directDamage        = 40;
   directDamageType    = $DamageType::ThrowingKnifeDirect;

   radiusDamage        = 0;
   damageRadius        = 0;
   radiusDamageType    = $DamageType::ThrowingKnifeDirect;

   explosion             = ThrowingKnifeExplosion;
   stickExplosion        = ThrowingKnifeStickExplosion;
   bloodExplosion        = ThrowingKnifeStickExplosion;
   particleEmitter       = ThrowingKnifeTrailEmitter;
   explodeOnPlayerImpact = true;
   explodeOnDeath        = true; 

   armingDelay         = 4000;
   lifetime            = 4000;
   fadeDelay           = 4000;

   isBallistic         = true;
   bounceAngle         = 170; //stick almost all the time
   minStickVelocity    = 10;
   bounceElasticity    = 0.2;
   bounceFriction      = 0.01;   
   gravityMod = 1.0;

   hasLight    = false;
   lightRadius = 3.0;
   lightColor  = "0 0 0.5";

   muzzleVelocity      = 55;
   velInheritFactor    = 1;

   uiName = "ThrowingKnife";
};
This is part of Add-ons/MedBladePack1/ThrowingDagger.cs

I just want to increase the firing rate to 10x the original firing rate, but at the same time decreasing the damage per dagger to 10% of the original damage. Can you do this for me?

I open them with Notepad. When I want to save changes, it just makes a new copy of it as a txt. Then I have to re-save as a .cs and that's when it breaks.

You have to save the file as All Files (*) then type in blah.cs

The ThrowingDagger.cs is attached. To edit the firing rate, you must edit the state timeout of the Reload state, and directDamage is the damage. 100 is a kill.