Author Topic: How to edit the brick placer's ProjectileData?  (Read 1396 times)

I need to edit the projectileData of the brickDeployProjectile, which is the brick placer's projectile (it's default so it's not really any place where I can easily change it in a text file). What is the protocol?
« Last Edit: September 23, 2014, 01:00:54 PM by Farad »

You can usually practice editing most datablock fields by putting tree(); into the console on a single-player server and finding the datablock in question in the DatablockGroup. If you know the datablock by name, which you do, you can open it in the inspector directly with inspect(datablockName);. Find the fields you want to modify and play with them until you get it how you want it. To actually apply the effect, you'll want to create a new add-on zip file with the description and server.cs file, and in the latter one, you put the line datablockName.fieldYouWantToChange = newValue;

There are some asterisks all over this procedure, but that'll do what you're going for here. For example, if the datablock you intend to edit is in another add-on, you'll want a forceRequiredAddon or loadRequiredAddon in your add-on to make sure the datablock exists before you try to change it.

that should do it, thanks. I'll keep this unlocked though incase anyone else has useful info

This is my very simple server.cs:
Code: [Select]
brickDeployProjectile.muzzleVelocity = 200;
brickDeployProjectile.lifetime = 150;
brickTrailEmitter.ejectionVelocity = 200;
brickTrailParticle.lifetimeMS = 150;

for some reason the 2nd line (brickDeployProjectile.lifetime = 150;) doesn't work, but the rest does. the projectile lifetime ends up being the default value of 4 somehow.