Jump to content

Creating a Training Bow


Lyeos

Recommended Posts

Hello !

 

I've added a Training Bow to increase the archery skill during quiet nights.

The training Bow uses training arrows which I added

It's working as intended but I have 2 issues with it.

 

The 1st one is that it still does 1 damage to players and blocks, when I would want it to do no damage at all.

I'm not sure if it's doable as you have to hit something to gain exp on archery (I tried to set Velocity, Gravity and Lifetime to 0 but no exp).

Here is what I have fore those :

 

[*] Training Bow

<item id="2001" name="woodenTrainingBow">
<property name="Meshfile" value="Items/Weapons/Ranged/Bows/WoodenBow/WoodenBowPrefab"/>
<property name="Material" value="wood"/>
<property name="RepairTools" value="wood"/>
<property name="HoldType" value="27"/> <!-- "Sway Off" is hardcoded for hold types 26, 27, 53 -->
<property name="FuelValue" value="0"/>
<property name="EconomicValue" value="0"/>
<property name="EconomicBundleSize" value="1"/>
<property name="SellableToTrader" value="false"/>
<property name="DegradationBreaksAfter" value="false"/>
<property name="SoundJammed" value="ItemNeedsRepair"/>
<property name="SoundDestroy" value="wooddestroy1"/>
<property name="CrosshairOnAim" value="false"/> <!-- aimTest -->
<property name="CrosshairUpAfterShot" value="false"/>
<property class="Action0"> <!-- AttackAction -->
	<property name="Class" value="Catapult"/>
	<!-- Catapult might not be the best name for it but it can also be used for a slingshot -->
	<property name="Hitmask_override" value="Arrow"/>
	<property name="Delay" value="1"/>
	<property name="Crosshair_min_distance" value="30"/> <!-- 30 -->
	<property name="Crosshair_max_distance" value="30"/> <!-- 30 -->
	<property name="Magazine_size" value="1"/>
	<property name="Magazine_items" value="trainingArrow"/>
	<property name="Rays_spread" value="0.017"/>
	<property name="Reload_time" value="0.9"/>
	<property name="Bullet_icon" value="uzi"/>
	<property name="Sound_start" value="bow_fire"/>
	<property name="Sound_repeat" value=""/>
	<property name="Sound_end" value=""/>
	<property name="Sound_empty" value="weapon_empty"/>
	<property name="Sound_reload" value="bow_reload"/>
	<property name="Sound_draw" value="bow_draw"/>
	<property name="Sound_cancel" value="bow_fire_cancel"/>
	<property name="Particles_muzzle_fire" value="nozzleflashuzi"/>
	<property name="Particles_muzzle_smoke" value="nozzlesmokeuzi"/>
	<property name="Max_strain_time" value="0.5"/>
	<!-- ammunition can override Exp values-->
	<property name="ActionExp" value="5"/>
	<property name="ActionExpBonusMultiplier" value="5"/>
</property>
<property class="Action1"> <!-- UseAction -->
	<property name="Class" value="Zoom"/>
	<property name="Zoom_max_out" value="45"/>
	<property name="Zoom_max_in" value="45"/>
</property>
<property name="Group" value="Ammo/Weapons,Basics"/>
<property class="Attributes">
	<property name="DegradationRate" value="0,0"/>
	<property name="DegradationMax" value="1,1"/>
</property>
<property name="ActionSkillGroup" value="Archery"/>
<property name="CraftingSkillGroup" value="craftSkillWeapons"/>
<property name="RepairExpMultiplier" value="5.5"/>
<property name="PickupJournalEntry" value="alternateAmmoTip"/>
<property name="CustomIcon" value="woodenBow" />
<property name="CustomIconTint" value="fad10b"/>
</item>

 

[*]Training Arrow :

<item id="2002" name="trainingArrow">
<property name="Meshfile" value="Items/Weapons/Ranged/Bows/WoodenBow/Arrow"/>
<property name="DropMeshfile" value="Items/Misc/arrow_dropped"/>
<property name="HandMeshfile" value="Items/Misc/arrow_hand"/>
<property name="HoldType" value="32"/>
<property name="Material" value="paper"/>
<property name="Stacknumber" value="250"/> <!-- STK ammo -->
<property name="FuelValue" value="0"/>
<property name="EconomicValue" value="0"/>
<property name="EconomicBundleSize" value="5"/>
<property class="Action1">
	<property name="Class" value="Projectile"/>
	<property name="Explosion.ParticleIndex" value="0"/> <!-- no expl. -->
	<property name="Velocity" value="47"/>
	<property name="FlyTime" value="0"/>
	<property name="Gravity" value="-4.7"/>
	<property name="LifeTime" value="12"/>
	<property name="DamageBonus.head" value="0"/>
	<property name="DamageBonus.glass" value="0"/>
	<property name="DamageBonus.wood" value="0"/>
	<property name="DamageBonus.earth" value="0"/>
	<property name="DamageBonus.metal" value="0"/>
	<property name="DamageBonus.cloth" value="0"/>
</property>
<property name="Group" value="Ammo/Weapons,Basics"/>
<property class="Attributes">
	<property name="GetQualityFromWeapon" value="true"/>
	<property name="EntityDamage" value="0,0"/>
	<property name="BlockDamage" value="0,0"/>
</property>
<property name="CraftingSkillGroup" value="craftSkillWeapons"/>
<property name="CustomIcon" value="ironArrow" />
<property name="CustomIconTint" value="fad10b"/>
</item>

 

Second thing is I can't have a good name and description for it.

Training bow says "WOODENTRAININGBOW" and training arrow says "TRAININGARROW".

I've tried to add it into the Localization.txt but didn't seem to work.

woodenTrainingBow,items,Gun,KgNone,Wooden Training Bow,"Arc en bois d'entraînement",Training Holzbogen,,Training Arco de madera
woodenTrainingBowDesc,items,Gun,EnChanged GrChanged,"Used for training archery. Uses training arrows for ammunition. Do not try to kill anything with it.","Un arc en bois. Idéal pour l'entraînement à l'archerie. Requiert des flèches d'entraînement comme munitions. Ne pas essayer de tuer Lyeos avec","Training Bow",,Training Bow
trainingArrow,items,Ammo,EnChanged,Training Arrow (Ammo),"Flèche en fer d'entraînement",Training Eisenpfeil (Mun),,Training Flecha de hierro
trainingArrowDesc,items,Ammo,KgNone,A stone arrow used for practicing archery. Only used with a training bow.,"Une flèche en pierre servant à l'entraînement à l'arc. Ne s'utilise que sur un Arc d'entraînement",Training Arrow,,Training Arrow

 

If anyone has any clue how to help me :)

Link to comment
Share on other sites

I like the idea, but it's really a very early game kind of thing.

I would say you should make a 3rd item "Training Target" which is made from grass fibers. Maybe time it so it has the exact number of hit points needed to gain 5 levels, assuming one point per hit.

That was you get both. Also I would suggest that training arrows only need wood to be made. The assumption is that you pull them out, and re-use the feathers, but that can't be simulated better than just not using them IMHO. It also makes the training arrows cheaper to use and therefore more likely TO be used by any potential modders that want to add it into their game.

 

anyway just my two Dukes.

Link to comment
Share on other sites

I like the idea, but it's really a very early game kind of thing.

I would say you should make a 3rd item "Training Target" which is made from grass fibers. Maybe time it so it has the exact number of hit points needed to gain 5 levels, assuming one point per hit.

That was you get both. Also I would suggest that training arrows only need wood to be made. The assumption is that you pull them out, and re-use the feathers, but that can't be simulated better than just not using them IMHO. It also makes the training arrows cheaper to use and therefore more likely TO be used by any potential modders that want to add it into their game.

 

anyway just my two Dukes.

My recipes for the bow and arrow are this :

<recipe name="woodenTrainingBow" count="1">
<ingredient name="wood" count="4"/>
<ingredient name="yuccaFibers" count="1"/>
</recipe>
<recipe name="trainingArrow" count="5">
<ingredient name="wood" count="1"/>
</recipe>

 

I'm trying to create a block that would be used as a training target but I'm still trying to figure a few things (e.g. how to make it shine bright but has either an important resource cost or has a big heatmap so it's not used as a light)

 

<property name="DescriptionKey" value="clubWoodDesc"/> points to localization.txt

Tried it and didn't work.

Link to comment
Share on other sites

Copied that right out of items.xml, so as long as your value=" matches the entry in localization.txt it should work. Look it over again and you should be able to get it working.

 

To be clear, if you copy/pasted <property name="DescriptionKey" value="clubWoodDesc"/> you should get the DescriptionKey for the wooden club in-game. If you changed it to match your item names and it doesn't work, check the formatting on the lines you added to localization.txt against what's already there.

Link to comment
Share on other sites

Your localization is wrong. This is what I use for a custom gun...

 

gunP225,items,Item Gun,KgNone,P225 Pistol,,

gunP225Desc,items,Item Gun,KgNone,Pistol that uses 9mm and 9mm HP ammo. More accurate than the standard pistol and has a larger magazine.,,

 

The bolded parts are the important bit. You're missing items before Item. I've found missing ANYTHING out of that straight up stops it working. Drove me mad for hours :)

Link to comment
Share on other sites

Your localization is wrong. This is what I use for a custom gun...

 

gunP225,items,Item Gun,KgNone,P225 Pistol,,

gunP225Desc,items,Item Gun,KgNone,Pistol that uses 9mm and 9mm HP ammo. More accurate than the standard pistol and has a larger magazine.,,

 

The bolded parts are the important bit. You're missing items before Item. I've found missing ANYTHING out of that straight up stops it working. Drove me mad for hours :)

 

Didn't seem to work. So my solution ATM is to have a regular name :

<item id="2001" name="Training Bow">

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...