• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

New ammo type

Bolmack

Member
Joined
Mar 7, 2015
Messages
91
Reaction score
6
Hello, im trying to put guns on my custom server, i already added the sprite and copypasted the script from a bolt, and it works well, but i have 2 questions:

1. How can i add a new ammo type? i tried this but didnt work
This 1 is the weapon
Code:
    <item id="22703" article="a" name="Riffle">
        <attribute key="weight" value="4000" />
        <attribute key="weaponType" value="distance" />
        <attribute key="slotType" value="two-handed" />
        <attribute key="ammoType" value="bullet" />
        <attribute key="range" value="5" />


And this my bullets
Code:
    <item id="2360" article="a" name="bullet">
        <attribute key="weight" value="80" />
        <attribute key="slotType" value="ammo" />
        <attribute key="attack" value="30" />
        <attribute key="weaponType" value="ammunition" />
        <attribute key="ammoType" value="bullet" />
        <attribute key="shootType" value="bullet" />
        <attribute key="maxHitChance" value="90" />
        <attribute key="ammoAction" value="removecount" />

Second question:
How can i make my weapon shoot the sprite of my bullets? when a crossbow shots a bolt, you can see a bolt, same whit a bow and arrow, how can i make that?
 
First of all, what TFS u using?
Did u add it on weapons.xml?
ex.
Code:
  <distance id="2111" action="removecount" /> <!-- snowball -->

Second, Try to look into items.otbm if u want to create new.

Try this:
in: /weapons/weapons.xml
Add:
Code:
  <distance id="2360" action="removecount" unproperly="1" level="30" /> <!-- bullet -->
Code:
  <distance id="22703" level="30" unproperly="1"> <!-- Riffle -->
  <vocation name="Paladin" />
  <vocation name="Royal Paladin" showInDescription="0" />
  </distance>

in /items/items.xml
Code:
  <item id="2360" article="a" name="bullet">
  <attribute key="weight" value="80" />
  <attribute key="slotType" value="ammo" />
  <attribute key="attack" value="30" />
  <attribute key="weaponType" value="ammunition" />
  <attribute key="ammoType" value="bullet" />
  <attribute key="shootType" value="bullet" />
  <attribute key="maxHitChance" value="90" />
  </item>

Code:
  <item id="22703" article="a" name="riffle">
  <attribute key="weight" value="4000" />
  <attribute key="slotType" value="two-handed" />
  <attribute key="weaponType" value="distance" />
  <attribute key="ammoType" value="bullet" />
  <attribute key="range" value="5" />
  <attribute key="hitChance" value="1" />
  </item>

For Second Question, I can offer u the use of animation with small stone.
 
Last edited:
Already tried @Szare Jajko But didnt work, BTW im using tfs v1.0 win32

And still need to know how to change the sprite instead of using the rock is it posible?

@70011983 What do you mean whit a source edit?
 
Last edited by a moderator:
the shootType is an enum setup in const.h, named in tools.cpp. To add a new sprite to be used as shooting, you have to add it there, and register it in luascript.cpp. for ammoType, you can just set it to arrow or bolt because that information is not shown to the player, it's just an enum representing a number so it doesn't matter what it is unless you need more than two ammoTypes (like if you want bows, crossbows AND guns). If you need to add a new ammoType, that's in tools.cpp and const.h. A source edit is when you edit the source code (.cpp and .h files) and compile your own .exe rather than downloading a pre-compiled version. It's for customized features like you're attempting, which can't be done in lua
 
@RazorBlade Thanks!!! i will try to change that sprite tomorrow, and well im going to make bows and crossbows to shot arrows, and the guns shoting the bolts, so i will save a lot of job. xD
 
Back
Top