Difference between revisions of "Weapons"

From Voxel Turf Wiki
Jump to: navigation, search
(Created page with "{{stub}} {{version|1.0.28}} ==Small Arms== There are 5 kinds of small arms and 3 tiers (black, silver, gold). Higher tier weapons can only be taken from Bandit Base|Bandit B...")
 
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{stub}}
 
{{stub}}
{{version|1.0.28}}
+
{{version|1.3.3}}
 
==Small Arms==
 
==Small Arms==
 
There are 5 kinds of small arms and 3 tiers (black, silver, gold). Higher tier weapons can only be taken from [[Bandit Base|Bandit Bases]].
 
There are 5 kinds of small arms and 3 tiers (black, silver, gold). Higher tier weapons can only be taken from [[Bandit Base|Bandit Bases]].
 +
 +
[[file:basicWeapons.png|center|700px]]
  
 
===Stats===
 
===Stats===
Line 19: Line 21:
 
* Crouch! This not only reduces your hitbox size, but it reduces the chance of Bandits hearing your footsteps.
 
* Crouch! This not only reduces your hitbox size, but it reduces the chance of Bandits hearing your footsteps.
 
* Be sure to be in the line of sight of one enemy at a time! Don't charge into rooms full of enemies, you'll get killed very quickly.
 
* Be sure to be in the line of sight of one enemy at a time! Don't charge into rooms full of enemies, you'll get killed very quickly.
 +
* Carry several weapons and switch them out when you run out of ammo. Switching weapons is way faster than reloading
  
==Modding==
+
==Modding Scripts==
 
Have a look at {{file|scripts/common/define_weapons.lua}}.
 
Have a look at {{file|scripts/common/define_weapons.lua}}.
 
It is recommended that you use the hook provided at the end of the file - the defineWeaponsUserCallback table.
 
It is recommended that you use the hook provided at the end of the file - the defineWeaponsUserCallback table.
Line 35: Line 38:
  
 
Be sure to define both your {{file|mods/MODNAME/scripts/server_scripts.lua}} and {{file|mods/MODNAME/scripts/client_scripts.lua}} to include your script file!
 
Be sure to define both your {{file|mods/MODNAME/scripts/server_scripts.lua}} and {{file|mods/MODNAME/scripts/client_scripts.lua}} to include your script file!
 +
 +
==Modding Textures and Models==
 +
This is an example on how to modify the rifle's object and texture.
 +
You can get a new model to appear in the game by exporting as a .obj file, and placing it in
 +
 +
{{file|/mods/YourModName/models/rifle.obj}}
 +
 +
And the texture in:
 +
 +
{{file|/mods/YourModName/textures/weapons/weapon12.EXT}} (for normal rifle)
 +
 +
{{file|/mods/YourModName/textures/weapons/weapon13.EXT}} (for silver rifle)
 +
 +
{{file|/mods/YourModName/textures/weapons/weapon14.EXT}} (for gold rifle)
 +
Where EXT is either .tga, .png or .jpg
 +
 +
 +
If you want weapon mods to work with the new model then that's a little more complicated:
 +
Weapon mods basically work by alpha-masking textures, and then the game combines several textures together to make the full weapon texture.
 +
You'll have to make the model have all the attachments (eg. scope, silencer) and have the parts of the texture for the attachments be *transparent*. Then create the textures for each component in {{file|/weapons/mods/}} - for example mod46.tga is the texture for the Scope for a Rifle. Also note that all pixels apart from the scope are transparent. Again tga, png and jpg are all supported.
 +
 +
==External Links==
 +
[http://www.indiedb.com/games/voxel-turf/news/dev-diary-3-weapons-part-1-small-arms-and-weapon-mods Dev Diary 3: Weapons Part 1: Small Arms and Weapon Mods]
 +
 +
[http://www.indiedb.com/games/voxel-turf/news/dev-diary-4-weapons-part-2-rockets-explosives-and-blast-resistance Dev Diary 4: Rockets, Explosives and Blast Resistance]
 +
 +
[[Category:Content]]

Latest revision as of 08:10, 22 January 2020

This article is a Stub. You can help by expanding it

This article may be out of date. It was last updated for 1.3.3.

Small Arms

There are 5 kinds of small arms and 3 tiers (black, silver, gold). Higher tier weapons can only be taken from Bandit Bases.

BasicWeapons.png

Stats

Weapon Mods

Up to two weapon mods can be applied to a weapon at a time. There is no way to remove them from an attached weapon, so be careful!

Rocket Launchers

There are 4 rocket launchers in the game.

Grenades

There is currently one kind of grenade in the game.

Combat Strategy

  • Aim for the head - some weapons (such as the Assault Rifle and the Rifle) do significantly more damage for head shots.
  • Crouch! This not only reduces your hitbox size, but it reduces the chance of Bandits hearing your footsteps.
  • Be sure to be in the line of sight of one enemy at a time! Don't charge into rooms full of enemies, you'll get killed very quickly.
  • Carry several weapons and switch them out when you run out of ammo. Switching weapons is way faster than reloading

Modding Scripts

Have a look at scripts/common/define_weapons.lua . It is recommended that you use the hook provided at the end of the file - the defineWeaponsUserCallback table.

function myWeaponMod (BlockTypes, ItemTypes)
	-- Your code here
end


if (defineWeaponsUserCallback == nil) then defineWeaponsUserCallback = {} end
defineWeaponsUserCallback[#defineWeaponsUserCallback+1] = { "myWeaponMod name | my description ", myWeaponMod };

Be sure to define both your mods/MODNAME/scripts/server_scripts.lua

and mods/MODNAME/scripts/client_scripts.lua
to include your script file!

Modding Textures and Models

This is an example on how to modify the rifle's object and texture. You can get a new model to appear in the game by exporting as a .obj file, and placing it in

/mods/YourModName/models/rifle.obj


And the texture in:

/mods/YourModName/textures/weapons/weapon12.EXT

(for normal rifle)

/mods/YourModName/textures/weapons/weapon13.EXT

(for silver rifle)

/mods/YourModName/textures/weapons/weapon14.EXT

(for gold rifle)

Where EXT is either .tga, .png or .jpg


If you want weapon mods to work with the new model then that's a little more complicated: Weapon mods basically work by alpha-masking textures, and then the game combines several textures together to make the full weapon texture. You'll have to make the model have all the attachments (eg. scope, silencer) and have the parts of the texture for the attachments be *transparent*. Then create the textures for each component in /weapons/mods/

- for example mod46.tga is the texture for the Scope for a Rifle. Also note that all pixels apart from the scope are transparent. Again tga, png and jpg are all supported. 

External Links

Dev Diary 3: Weapons Part 1: Small Arms and Weapon Mods

Dev Diary 4: Rockets, Explosives and Blast Resistance