Author Topic: Making weapons...  (Read 1028 times)

I know this is actually on-topic, but I really wanna make some weapons. Like, how do I just change the damage, firing rate, etc. of the weapons I already have?

EDIT: Many people make their weapons so that they don't work if the regular Gun is disabled. Oddly enough, all the weapons with this trait have become unusable after I edit them. I can enable the weapon, but in the list of items it doesn't show up. Yes, I did change the UI name. Does anyone know how to thwart such scripts that hinder me from making weapons?
« Last Edit: March 24, 2011, 11:13:52 PM by MrMeows »

Open the .zip of the file and look in the .CS using a text editor, such as notepad.
Depending on the weapon, the way it handles firing is different.

In order to change the damage of the weapon, you should find the projectile datablock. There is generally a damage value you can tweak. A player has a standard health of 100, so keep this in mind. You can also edit the splash damage and explosion radius as well as the color of the explosion and light generated by the projectile as well as how it affects bricks (it detects their resistance to damage by volume, multiplying their width, depth and height. Keep in mind that a 1/3rd brick is actually counted as 1 in volume.

Editing firing rate is a bit more complex. This is usually handled at the bottom of the script in the image datablock of the item. There states are handled. Inmagine the states as a flowchart written out on paper. In them are instructions of how it handles moving to the next state and which state to move to when. Most weapons with alternating fire methods alter this system from the default. The quick way to lower the time between shots or raise it is to tweak the timeout values given. If you wanted to create a machinegun of sorts, you would instead of waiting for mouseup to transition back to the starting state you would have a timeout that if the mouse was still down at the end of the timeout it would loop back to the fire state.

If this doesn't make sense let me know and I can give even simpler instructions.
Note: I haven't actually looked at torquescript in over a year and didn't bother opening up a reference file so I may not be using the correct terminology in some parts. You should be able to figure it out though.
« Last Edit: March 23, 2011, 02:05:42 AM by ladios »

Open the .zip of the file and look in the .CS using a text editor, such as notepad.Depending on the weapon, the way it handles firing is different.

In order to change the damage of the weapon, you should find the projectile datablock. There is generally a damage value you can tweak. A player has a standard health of 100, so keep this in mind. You can also edit the splash damage and explosion radius as well as the color of the explosion and light generated by the projectile as well as how it affects bricks (it detects their resistance to damage by volume, multiplying their width, depth and height. Keep in mind that a 1/3rd brick is actually counted as 1 in volume.

Editing firing rate is a bit more complex. This is usually handled at the bottom of the script in the image datablock of the item. There states are handled. Inmagine the states as a flowchart written out on paper. In them are instructions of how it handles moving to the next state and which state to move to when. Most weapons with alternating fire methods alter this system from the default. The quick way to lower the time between shots or raise it is to tweak the timeout values given. If you wanted to create a machinegun of sorts, you would instead of waiting for mouseup to transition back to the starting state you would have a timeout that if the mouse was still down at the end of the timeout it would loop back to the fire state.

If this doesn't make sense let me know and I can give even simpler instructions.
Note: I haven't actually looked at torquescript in over a year and didn't bother opening up a reference file so I may not be using the correct terminology in some parts. You should be able to figure it out though.

Notepad can't save it as a .cs file.

I could transfer the .cs file from another weapon... would that work?
« Last Edit: March 23, 2011, 11:13:35 PM by MrMeows »

Notepad can't save it as a .cs file.
Yes it can. If you have opened a .cs document, it should automatically save to a .cs format.

Yes it can. If you have opened a .cs document, it should automatically save to a .cs format.

It doesn't though...

When saving, from the file type dropdown menu, it should have "Text Document (.txt)" and "All Files".

Select "All Files" and save the file like so: weaponname.cs/server.cs

if you do weaponname.cs, be sure to have a server.cs to do exec("./weaponname.cs");.

I made my first weapon!

It's a nerf gun. Edit of the regular gun. It has only 1.25 damage.

Here's the link: http://www.mediafire.com/?8bbisu9drgrzlti
« Last Edit: March 24, 2011, 12:19:50 AM by MrMeows »

I made my first weapon!

It's a nerf gun. Edit of the regular gun. It has only 1.25 damage.

Here's the link: http://www.mediafire.com/?2b666ypzao5s9wz
Did you remember to edit the UIname and such so that it doesn't replace the regular Gun?
If not, this would be immediately failbinned.

Did you remember to edit the UIname and such so that it doesn't replace the regular Gun?
If not, this would be immediately failbinned.

I fixed it. Now the only problem is the gun's icon. It seems when I recolored it, it got a white square background...
« Last Edit: March 24, 2011, 12:20:53 AM by MrMeows »

I made another weapon. The Infernothrower. It's an edit of the Pyro Gun with five times the range and double damage.

Here's the link: http://www.mediafire.com/?ngr0pi49qqbx2zy

This kid seems promising.

This kid seems promising.
my sarcasomiter is in the grey area.

my sarcasomiter is in the grey area.

I was being serious :o


He's new and already making weapons in a somewhat decent way.