Author Topic: How do I gun  (Read 3889 times)

So I just have to rename them? Nothing else?
Yeah. You renamed all the datablocks being created, but not the code referencing the datablocks. If they are named to the Gun's datablocks, then they will use those instead of the "new" ones. Rename all references to the default gun datablocks to your new ones.


Okay, will this work?
I should have mentioned that the names of the files included in the addon should either be renamed to what you named them in the server file or re-rename the server file to have matching names to those of the files. Sorry.

For example, you have a gunshot1 sound file, but in the server you named it to trigunshot1. It will not find a sound file because there is no such thing as trigunshot1. As I said above, you can edit the server to use gunshot1 or change the name of the sound file to trigunshot1.
« Last Edit: December 10, 2015, 12:17:02 AM by The Subject »


Why does the multi-projectile/projectile spread script take place on a single line? Also, it shouldn't be 'ShapeBaseImageData(trigunImage)::onFire', it should just be the name of the image data that's in the parenthesis, so it would be like this 'trigunImage::onFire'

However, there's already an onFire function, and you can't have multiples of the same function or otherwise one will overwrite the other, so just add the multi-projectile script to the onFire function above, like so
http://pastebin.com/raw.php?i=8izjFWaT

Also, if you plan on changing how the particles work, be sure to change their entries for 'uiName' in their emitter data, even though you change the name of the datablocks, they can still overwrite stuff that appears on the list for brick particles

Like for the trigunFlashEmitter's uiName entry, you could change it to 'uiName = "Tri-Gun Flash";', or you could remove that line entirely if you don't even want those particles to be spawnable on bricks

Then there's the projectile data, you're currently using the default Gun's damage type, so you're still probably modifying how the default Gun functions

You can avoid this by renaming the entries for directDamageType and radiusDamageType from '$DamageType::Gun' to '$DamageType::Tri-Gun' and changing 'Gun' from the start of 'AddDamageType("Gun",   '<bitmap:add-ons/Weapon_Gun/CI_gun> %1',    '%2 <bitmap:add-ons/Weapon_Gun/CI_gun> %1',0.2,1);' to the same thing you put for '$DamageType::NAME', which in this case would be Tri-Gun

Once you get around to making your own CI image (chat icon/the icon used to show how a player was killed) for your weapon, you can change the name of the bitmap's directory to the directory of your image

You also forgot to rename the shapeFile name in the weapon image from pistol.dts to tripistol.dts

Hope this has been of any help to you

Why does the multi-projectile/projectile spread script take place on a single line? Also, it shouldn't be 'ShapeBaseImageData(trigunImage)::onFire', it should just be the name of the image data that's in the parenthesis, so it would be like this 'trigunImage::onFire'

However, there's already an onFire function, and you can't have multiples of the same function or otherwise one will overwrite the other, so just add the multi-projectile script to the onFire function above, like so
http://pastebin.com/raw.php?i=8izjFWaT

Also, if you plan on changing how the particles work, be sure to change their entries for 'uiName' in their emitter data, even though you change the name of the datablocks, they can still overwrite stuff that appears on the list for brick particles

Like for the trigunFlashEmitter's uiName entry, you could change it to 'uiName = "Tri-Gun Flash";', or you could remove that line entirely if you don't even want those particles to be spawnable on bricks

Then there's the projectile data, you're currently using the default Gun's damage type, so you're still probably modifying how the default Gun functions

You can avoid this by renaming the entries for directDamageType and radiusDamageType from '$DamageType::Gun' to '$DamageType::Tri-Gun' and changing 'Gun' from the start of 'AddDamageType("Gun",   '<bitmap:add-ons/Weapon_Gun/CI_gun> %1',    '%2 <bitmap:add-ons/Weapon_Gun/CI_gun> %1',0.2,1);' to the same thing you put for '$DamageType::NAME', which in this case would be Tri-Gun

Once you get around to making your own CI image (chat icon/the icon used to show how a player was killed) for your weapon, you can change the name of the bitmap's directory to the directory of your image

You also forgot to rename the shapeFile name in the weapon image from pistol.dts to tripistol.dts

Hope this has been of any help to you
Whoa.
Have I done it?

Whoa.
Have I done it?
I can't even tell anymore


There might be something wrong with the program you're using to save these files that is compressing this, but i don't know anything about Macs...

I'm just using TextEdit for server.cs, then selecting it all, right clicking, and compressing them.

Use sublime text for coding.

I don't get what Masterlegodude gets. Maybe it's because I'm also on a Mac?


You still need to fix the stuff here:
AddDamageType("Tri-Gun",   '<bitmap:add-ons/Weapon_Gun/CI_trigun> %1',    '%2 <bitmap:add-ons/Weapon_Gun/CI_trigun> %1',0.2,1);/tt]
The first argument can't have a - and the file path is still wrong.
Then you need to change this:
Quote
datablock ProjectileData(trigunProjectile)
{
   projectileShapeName = "./tribullet.dts";
   directDamage        = 14;
   directDamageType    = $DamageType::Gun;
   radiusDamageType    = $DamageType::Gun;

   brickExplosionRadius = 0;
To the first argument of addDamageType.


You should also change the item field of trigunImage from bowItem, to your weapon's image. This is Badspot's fault, but you should still fix it.


I can't even tell anymore
[im g]http://i.imgur.com/a5GnaOO.png[/img]

There might be something wrong with the program you're using to save these files that is compressing this, but i don't know anything about Macs...
Notepad is a very stupid text editor and removed the format. If you open the code with Wordpad or Notepad++, it should display correctly.

You should also change the item field of trigunImage from bowItem, to your weapon's image. This is Badspot's fault, but you should still fix it.

oh yeah I forgot that
so wait do I put trigunItem or trigunImage

oh yeah I forgot that
so wait do I put trigunItem or trigunImage
Oh woops. Put trigunItem.