Jump to content

[HELP] Trying to make a 50cal barrel modlet


Quasimiyao

Recommended Posts

Hi all, I could use some help with a modlet I am trying to put together. Trying to make a 50 caliber barrel mod for the huntingrifle. Still learning to work with xml files and xpath, and there's a few things I havent worked out yet :)

I got the barrelmod, the recipe for it, the schematic and also the learnable schematic to learn the blueprint based on Sols learnable schematics working, and using the 50 cal ammo from GG2015's turret mod since I had that installed. Will make my own when I get it working tho.

Problem I am having is getting the rifle to accept the ammo after installing the barrel. This is the code I tried using, based on the barrelextender:

 

    <append xpath="/item_modifiers">

   <item_modifier name="modGun50calBarrel" installable_tags="barrelAttachments" blocked_tags="revolver,flaredBarrel" modifier_tags="barrelAttachment" type="attachment">
	<property name="Stacknumber" value="1"/>
	<item_property_overrides name="gunHuntingRifle">
	<effect_group tiered="false">
		<passive_effect name="DamageFalloffRange" operation="perc_add" value=".4"/>
		<passive_effect name="MaxRange" operation="perc_add" value=".4"/>
		<passive_effect name="KickDegreesVertical" operation="perc_add" value="0.12"/>
		<passive_effect name="KickDegreesHorizontal" operation="perc_add" value="0.1"/>
		<passive_effect name="EntityDamage" operation="perc_add" value="1"/>
	</effect_group>
	<property class="Action0">
	<property name="Magazine_items" value="50 Caliber Ammo"/>
	</property>
	</item_property_overrides>
	<property name="PickupJournalEntry" value="augmentGunsTip"/>

I also tried just switching the ammotype of the rifle to see how to target teh Magazine_items property, but I am not sure how to get to anything under the property class=Action0

<configs>

<set xpath="items/item[@name='gunhuntingrifle']/property[@name='Action0']/property[name='Magazine_items']/@value">50 Caliber Ammo</set>

</configs>

I tried switching around @class and @name, but it wont apply that part.

 

Any help will be much appreciated :)

 

EDIT: Seems to be a problem with the ammo itself, added it to the rifle directly in the main xml, and that didnt work either. So will look at adding my own ammo and recipe for it and see where that gets me :)

EDIT2: Sorry about the lack of title for the thread, tired.. and cant edit title apparently

Link to comment
Share on other sites

Ok, so I made some progress. Made my own ammo which works if I add it to the list of usable ammo in the hunting rifle. And did some changes to the barrel code. I get no errors, and the game applies all changes no problem, as confirmed by doing the Exportcurrentconfigs from the console. But the rifle will still not accept the new ammo after attaching the barrelmod. This is the code I have in the item_modifiers now:

 

<configs>

   <append xpath="/item_modifiers">

   <item_modifier name="modGun50calBarrel" installable_tags="barrelAttachments" blocked_tags="revolver,flaredBarrel" modifier_tags="barrelAttachment" type="attachment">
	<property name="Stacknumber" value="1"/>
	<item_property_overrides name="gunHuntingRifle">
	<property name="Magazine_items" value="ammo762mmBulletFMJ,ammo762mmBulletFMJSteel,ammo50cal"/>
	</item_property_overrides>
	<effect_group tiered="false">
		<passive_effect name="DamageFalloffRange" operation="perc_add" value=".4"/>
		<passive_effect name="MaxRange" operation="perc_add" value=".4"/>
		<passive_effect name="KickDegreesVertical" operation="perc_add" value="0.12"/>
		<passive_effect name="KickDegreesHorizontal" operation="perc_add" value="0.1"/>
		<passive_effect name="EntityDamage" operation="perc_add" value="1"/>
	</effect_group>

	<property name="PickupJournalEntry" value="augmentGunsTip"/>
</item_modifier>

</append>

</configs>

Link to comment
Share on other sites

Noone have any idea of how to get a weaponmod to change ammotype of a weapon? Everything works, except it still uses default ammo. Even does way more damage (upped it a notch extra to test if that worked). All thats missing is getting the ammo in the frickin rifle :p I feel like I am overlooking something real obvious here.. Does it have to be a magazine mod to be able to target the ammo property?

 

<configs>

   <append xpath="/item_modifiers">

   <item_modifier name="modGun50calBarrel" installable_tags="barrelAttachments" modifier_tags="barrelAttachment" type="attachment">
	<property name="Stacknumber" value="1"/>
	<item_property_overrides name="*">
	<property name="Magazine_items" value="ammo50cal"/>
	</item_property_overrides>
	<effect_group tiered="false">
		<passive_effect name="DamageFalloffRange" operation="perc_add" value=".4"/>
		<passive_effect name="MaxRange" operation="perc_add" value=".4"/>
		<passive_effect name="KickDegreesVertical" operation="perc_add" value="0.12"/>
		<passive_effect name="KickDegreesHorizontal" operation="perc_add" value="0.1"/>
		<passive_effect name="EntityDamage" operation="perc_add" value="2"/>
	</effect_group>

	<property name="PickupJournalEntry" value="augmentGunsTip"/>
</item_modifier>

</append>

</configs>

Link to comment
Share on other sites

Judging by the comunity here, I think if someone reads the post that knows how, they will share :) I can convert the rifle to 50 cal, ammo works and have made a modlet making it just a 50cal rifle. Just to test that it works as intended. But getting the barrel to change ammotype is eluding me. Maybe I have to learn how to code xml before making more modlets.. I just prefer learning by making :)

Link to comment
Share on other sites

Judging by the comunity here, I think if someone reads the post that knows how, they will share :) I can convert the rifle to 50 cal, ammo works and have made a modlet making it just a 50cal rifle. Just to test that it works as intended. But getting the barrel to change ammotype is eluding me. Maybe I have to learn how to code xml before making more modlets.. I just prefer learning by making :)

 

Keep at it mate. When I am home I will look at it also and see if I can be of assistance. And your right the community will help if they can.

 

- - - Updated - - -

 

<configs>

 

<set xpath="items/item[@name=gunhuntingrifle]/property[@name=Action0]/property[name=Magazine_items]/@value">50 Caliber Ammo</set>

 

</configs>

 

Should gunhuntingrifle be gunHuntingRifle or however it is exactly spelt in the items.xml

Link to comment
Share on other sites

Thx :) But can I add that inside the append I do to get the 50cal barrelmod in item_modifiers.xml? I used that code, except @class='action0' instead of @name='action0' to convert the whole rifle to a 50 cal in items.xml. If I can use a set command inside an append command that should solve things. I am ingame now, planning on doing a stream with another streamer. But I havent heard from her yet, so I might pop out of the game and try. Gonna message her and see if we stream today or not now. Cause if that works I want to make a 338 barrel for the marksman rifle aswell.

 

Edit: Not good at explaining after a couple drinks :p

Link to comment
Share on other sites

Ah yea, I had this problem too. For some reason item_property_override simply would NOT work with "Magazine_items". It works for a bunch of other properties both inside and outside the Action class. Dunno, it's weird. Almost like item_property_override doesn't search for properties with matching names, but instead has a pre-defined set of names it can override and magazine_items isn't one of them.

Link to comment
Share on other sites

Hmm, that sucks if it actually have a predefined list. Would be very weird if it does tho. I was trying to figure out other ways to do it, but cant think of any other options, besides going a whole different way. Like making a 50cal using the huntingrifle model, just renamed and with a barrel already installed in a modslot, maybe with a preinstalled color mod and custom icon tint, to tell the difference between them. Then I can just use the set command and tell it to use 50cal ammo. I know I wouldnt ned to have the barrel installed, but could be a crafting recipe consisting of a huntingrifle and a barrel. Just to make it feel a bit more different in a way. Plus having to craft it to get the rifle to accept that caliber kinda makes sense, kinda..

 

Edit: Thanks for the help and encouragement guys, very much appreciated :)

Link to comment
Share on other sites

If you're going that way which may be the best option for a workaround (craft it with recipe), you can just append in a whole new item called "gunHuntingRifle50cal" then add in "<property name="Extends" value="gunHuntingRifle"/>". Then all you should need to add are any aspects that you're changing such as magazine_items, the effect_group with new damage values, etc. Edit: probably easier if I just paste code. Something like this should work:

 

<append xpath="/items">
<item name="gunHuntingRifle50cal">
<property name="Extends" value="gunHuntingRifle"/>
<property name="CustomIcon" value="gunHuntingRifle"/> [color="#FFA500"](forgot you need this too)[/color]
<property name="EconomicValue" value="900"/>

<property class="Action0">
	<property name="Magazine_items" value="ammo50cal"/>
</property>

<effect_group name="Base Effects">
	<passive_effect name="EntityDamage" operation="base_add" value="50"/>
	(+ any other effects you want to add)
</effect_group>
</item>
</append>

Link to comment
Share on other sites

You should also be able to add the following properties from the dyes underneath the "CustomIcon" property to add a tint by default, don't think you should need to use a mod with item_property_override. Just try placing it on the item itself.

 

(This is from the black dye)

 

<property name="CustomIcon" value="gunHuntingRifle"/>

<property name="TintColor" value="70,70,70"/>

<property name="CustomIconTint" value="87,87,87"/>

<property name="UMA.Overlay0Tint" value="87,87,87"/>

Link to comment
Share on other sites

Thats what I was thinking. Would copy the whole section and tweak values like recoil, range, damageFallOffRange in addition to damage. Maybe use the magnum sound just make it louder if possible. And if going that way I might also require the magazine extender mod in the recipe, maybe renaming that too to fit the build. Keep it boltaction, but with maybe 5 or 7 rounds mag, which would also "justify" a slightly higher firing rate. Makes sense to need more than just a barrel to change from 7.62 to 50 cal anyway. Could even require tripod and scope. if called attachement it can be removed but named mod in the files makes it permanent apparently. Unless thats just in the item_modifiers.xml.

The idea was, or is, to make several of the weapons upgradeable with a few new ammo types. 9mm to desert eagle, marksman to barret m82 and so on. Just not with those exact names without having custom models.

Link to comment
Share on other sites

Only thing is, using more than 1 round per magazine with the hunting rifle may not work right. The bolt cycling animation is the reload animation, so I don't believe the character would cycle the bolt after each shot. Would require some unity model animation modding to get that right. You may decide that's fine or maybe the mr10 would be better for the 50 cal modification.

Link to comment
Share on other sites

Yeah thats a good point. But if I do the mr10, I dont really need a mag on the boltaction, would just be two of the same pretty much.

Thanks for the tips on coloring other things than icons, didnt know I could do that actually :) That makes it even more viable to just drop the barrel mod and make a separate rifle instead.

 

[ATTACH=CONFIG]26695[/ATTACH]

 

logged in to try and I cant interact with my minibike all of a sudden :p laying on the ground inside the traders place and he is closing in minutes.. Love alpha games :)

Link to comment
Share on other sites

Only thing is, using more than 1 round per magazine with the hunting rifle may not work right. The bolt cycling animation is the reload animation, so I don't believe the character would cycle the bolt after each shot. Would require some unity model animation modding to get that right. You may decide that's fine or maybe the mr10 would be better for the 50 cal modification.

 

Nah it is fine to have more then 1 bullet. I have my hunting rifle on 20. The reloading animation only works when you have to reload

Link to comment
Share on other sites

Oh right, thats also a good point. And since the shotgun animation and sound makes it seem like two shells being loaded, then I suppose I couldlive with one bullet beingloaded in the mag, and the rest just appears by itself :) Still want a small mag tho, and more powerful than the marksman, with a larger mag and higher rate of fire. Atleast thats what I've been thinking. Never know what happens in testing.

 

Now to figure out how to get that frickin minibike unstuck from the pavement before trader kicks me out :p

Link to comment
Share on other sites

Thx for all the help so far :) Got almost all of the first weapon, 50cal rifle, working, including learnable schematic that teaches you to make the blueprint for crafting the rifle, custom tint on the weapon, and have schematic, rifle and ammo added to the loot.xml.

But For some reason I get no icon for the rifle with this code:

<property name="CustomIcon" value="gunhuntingrifle"/>

I have tried with and without using the custom icon tint. Even vanilla files use that for things like steel ammo, using standard ammo with custom tint. Not sure whats going on here.

 

And, I want to add it to progression, so it unlocks at Advanced Engineering lvl 4 (not decided for sure which lvl), but not figuring out how to add it to the correct passive_effect, with it being 4 passive_effects with the same name. Only difference is the lvl value. Adding it all in a [@name= tag does not work. How to target the passive_effect with the lvl "level=4,5". For reference the vanilla code looks like this after <effect_group> :

<passive_effect name="RecipeTagUnlocked" operation="base_set" value="1" level="4,5" tags="shotgunTurret,gunRocketLauncher,gunToolNailgun"/>

I just want my rifle in there somehow :p

 

Edit: For unknown reasons the itemicon is now showing..

 

Edit2: Got it all working :) Now just considering if I should release before I get a custom model working :)

Thx for help :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...