Jump to content

LOOKING FOR HELP - Weapon Modding


vitaminded

Recommended Posts

I'm trying to add a weapon in the game with unity by making it a unity3d file but when i add it to the sdx folder and do the xml lines

 

it shows me this in game XD

looks like im holding a piece of leather

but why though ? XD

37890562_10217144892551499_6834091879097696256_n.thumb.jpg.7dd8589c110f20823283107568b620b9.jpg

 

does anybody know how to import correctly ?

i am adding the item into the xml and take some lines from sniper rifle and making it a mix between sniper and ak47, im not so good at modding since this is the first time i'm doing something like this

 

I would appreciate some help :D

 

AK5C rifle FBX FILE https://www.sendspace.com/file/tcxt14

 

icon in case u want it ak5cRifle.png.a92b53a7ddf78c667f85c150bcc3fd21.png

37890562_10217144892551499_6834091879097696256_n.jpg.94941ac31a9c4203c4c61f0a38608fc5.jpg

Link to comment
Share on other sites

That means your mesh file code is wrong. :)

 

Difficult to explain, but it should look like this.

 

<property name="Meshfile" value="#M4A1?M4A1"/>

 

The #M4A1 bit in this example is the name of the unity3D file under resources. The ?M4A1 bit of the code is the name of the PARENT object within Unity 3D.

Link to comment
Share on other sites

Unity_2018-07-26_16-22-56.jpg.3a70acc993c80d1913a401c7fef0a61e.jpg

 

7DaysToDie_2018-07-26_16-22-33.jpg.d8fe0c0c7e7ce279d83a8275137eba33.jpg

 

Please ignore the M4A1 stuff in the gun parts code. I used my existing rifle to test this worked. You will also want to change the magazine items to use the same as the AK-47.

 

<item id="3998" name="gunAK5C">
<property name="CustomIcon" value="gunAK5C" />
<property name="DescriptionKey" value="gunAK5CDesc"/>
<property name="Meshfile" value="#AK5C?AK5C"/>
<property name="Material" value="metal"/>
<property name="RepairTools" value="repairKit"/>
<property name="HoldType" value="48"/>
<property name="DegradationBreaksAfter" value="false"/>
<property name="SoundJammed" value="weapon_jam"/>
<property name="Attachments" value="flashlight02"/>
<property name="CrosshairOnAim" value="true"/> <!-- aimTest -->
<property name="CrosshairUpAfterShot" value="true"/> <!-- aimTest -->
<property class="Parts">
	<property name="Stock" value="partsM4A1_stock"/>
	<property name="Receiver" value="gunScope"/>
	<property name="Pump" value="partsM4A1_parts"/>
	<property name="Barrel" value="partsM4A1_barrel"/>
</property>
<property name="Sound_Sight_In" value="rifle_sight_in"/>
<property name="Sound_Sight_Out" value="rifle_sight_out"/>
<property class="Action0"> <!-- AttackAction -->
	<property name="Class" value="Ranged"/>
	<property name="Delay" value="0.150"/>
	<property name="Auto_fire" value="true"/>
	<property name="Crosshair_min_distance" value="13"/> <!-- 13 -->
	<property name="Crosshair_max_distance" value="16"/> <!-- 16 -->
	<property name="Magazine_size" value="30"/>
	<property name="Magazine_items" value="9mmBullet, 9mmBulletHP, Unload"/>
	<property name="Magazine_item_ray_counts" value="1, 1"/>
	<property name="Magazine_item_ray_spreads" value="0, 0"/>
	<property name="Reload_time" value="3.9"/>
	<property name="Bullet_icon" value="uzi"/>
	<property name="Sound_start" value="ak47_fire_start"/>
	<property name="Sound_repeat" value="Weapons/Ranged/AK47/ak47_fire_lp"/>
	<property name="Sound_end" value="Weapons/Ranged/AK47/ak47_fire_end"/>
	<property name="Sound_empty" value="weapon_empty"/>
	<property name="Sound_reload" value="ak47_reload"/>
	<property name="Horde_meter_rate" value="2.5"/>
	<property name="Horde_meter_distance" value="20"/>
	<property name="Particles_muzzle_fire" value="nozzleflash_ak"/>
	<property name="Particles_muzzle_smoke" value="nozzlesmokeuzi"/>
	<property name="DamageBonus.head" value="3"/>
	<property name="DamageBonus.wood" value="5"/>
	<property name="DamageBonus.earth" value="0.2"/>
	<property name="DamageBonus.glass" value="1"/>
	<property name="Buff" value="critGunAK47"/>
	<property name="Buff_chance" value="0.1"/>
	<property name="ActionExp" value="1"/>
</property>
<property class="Action1"> <!-- UseAction -->
	<property name="Class" value="Zoom"/>
	<property name="Zoom_overlay" value="Items/Weapons/HUD/sniper_zoom_overlay"/>
	<property name="Zoom_max_out" value="40"/>
	<property name="Zoom_max_in" value="15"/>
</property>
<property name="LightSource" value="lightSource"/> <!-- Start: Needed for the attachment flashlight -->
<property name="ActivateObject" value="Attachments/flashlight/lightSource"/>
<property name="AttachmentFlashlight" value="flashlight02"/> <!-- End: Needed for the attachment flashlight -->
<property name="Group" value="Ammo/Weapons"/>
<property name="ActionSkillGroup" value="Rifles"/>
<property name="CraftingSkillGroup" value="craftSkillGuns"/>
<property name="RepairExpMultiplier" value="10.8"/>
<property name="LightValue" value="0.45"/>
<property name="EconomicValue" value="6400"/>
</item>

 

And this is the unity3D file for it. I did it super fast so positioning might be slightly off (looks like it needs to go up a little bit to me).

 

https://drive.google.com/open?id=1IJtkaGpcKA2nkEzkcn4hKNPyKLR-xb14

Link to comment
Share on other sites

hey thanx :D can you tell me how you did it ?

 

- - - Updated - - -

 

oooooooooooh so the <property name="Meshfile" value="#AK5C?AK5C"/> line was wrong

 

Yep. That's why I included a screenshot of unity so you could see the object hierarchy :)

Link to comment
Share on other sites

hey KhaineGB it's still not working, :'( this is what my xml looks like

 

 
<item id="3998" name="gunAK5C">
   <property name="Meshfile" value="#AK5C?AK5C"/>
<property name="Material" value="metal"/>
<property name="CustomIcon" value="ak5crifle" />
<property name="DescriptionKey" value="gunAK5CDesc"/>
<property name="RepairTools" value="repairKit"/>
<property name="HoldType" value="48"/>
<property name="DegradationBreaksAfter" value="false"/>
<property name="SoundJammed" value="weapon_jam"/>
<property name="Attachments" value="flashlight02"/>
<property name="CrosshairOnAim" value="true"/> <!-- aimTest -->
<property name="CrosshairUpAfterShot" value="true"/> <!-- aimTest -->
<property class="Parts">
	<property name="Stock" value="partsAK47_stock"/>
	<property name="Receiver" value="Scope"/>
	<property name="Pump" value="partsAK47_parts"/>
	<property name="Barrel" value="partsAK47_barrel"/>
</property>
<property name="Sound_Sight_In" value="rifle_sight_in"/>
<property name="Sound_Sight_Out" value="rifle_sight_out"/>
<property class="Action0"> <!-- AttackAction -->
	<property name="Class" value="Ranged"/>
	<property name="Delay" value="0.150"/>
	<property name="Auto_fire" value="true"/>
	<property name="Crosshair_min_distance" value="13"/> <!-- 13 -->
	<property name="Crosshair_max_distance" value="16"/> <!-- 16 -->
	<property name="Magazine_size" value="30"/>
	<property name="Magazine_items" value="762mmBullet" />
	<property name="Magazine_item_ray_counts" value="1, 1"/>
	<property name="Magazine_item_ray_spreads" value="0, 0"/>
	<property name="Reload_time" value="3.9"/>
	<property name="Bullet_icon" value="uzi"/>
	<property name="Sound_start" value="ak47_fire_start"/>
	<property name="Sound_repeat" value="Weapons/Ranged/AK47/ak47_fire_lp"/>
	<property name="Sound_end" value="Weapons/Ranged/AK47/ak47_fire_end"/>
	<property name="Sound_empty" value="weapon_empty"/>
	<property name="Sound_reload" value="ak47_reload"/>
	<property name="Horde_meter_rate" value="2.5"/>
	<property name="Horde_meter_distance" value="20"/>
	<property name="Particles_muzzle_fire" value="nozzleflash_ak"/>
	<property name="Particles_muzzle_smoke" value="nozzlesmokeuzi"/>
	<property name="DamageBonus.head" value="3"/>
	<property name="DamageBonus.wood" value="5"/>
	<property name="DamageBonus.earth" value="0.2"/>
	<property name="DamageBonus.glass" value="1"/>
	<property name="Buff" value="critGunAK47"/>
	<property name="Buff_chance" value="0.1"/>
	<property name="ActionExp" value="1"/>
</property>
<property class="Action1"> <!-- UseAction -->
	<property name="Class" value="Zoom"/>
	<property name="Zoom_overlay" value="Items/Weapons/HUD/sniper_zoom_overlay"/>
	<property name="Zoom_max_out" value="40"/>
	<property name="Zoom_max_in" value="15"/>
</property>
<property name="LightSource" value="lightSource"/> <!-- Start: Needed for the attachment flashlight -->
<property name="ActivateObject" value="Attachments/flashlight/lightSource"/>
<property name="AttachmentFlashlight" value="flashlight02"/> <!-- End: Needed for the attachment flashlight -->
<property name="Group" value="Ammo/Weapons"/>
<property name="ActionSkillGroup" value="Rifles"/>
<property name="CraftingSkillGroup" value="craftSkillGuns"/>
<property name="RepairExpMultiplier" value="10.8"/>
<property name="LightValue" value="0.45"/>
<property name="EconomicValue" value="6400"/>
</item>

Link to comment
Share on other sites

i have this in items xml

 

 

 

<item id="2506" name="AK5C">
   <property name="Meshfile" value="#AK5C?AK5C"/>
<property name="Material" value="metal"/>
<property name="CustomIcon" value="ak5crifle" />
<property name="DescriptionKey" value="AK5CDesc"/>
<property name="RepairTools" value="repairKit"/>
<property name="HoldType" value="48"/>
<property name="DegradationBreaksAfter" value="false"/>
<property name="SoundJammed" value="weapon_jam"/>
<property name="Attachments" value="flashlight02"/>
<property name="CrosshairOnAim" value="true"/> <!-- aimTest -->
<property name="CrosshairUpAfterShot" value="true"/> <!-- aimTest -->
<property class="Parts">
	<property name="Stock" value="partsAK5C_stock"/>
	<property name="Receiver" value="partsAK5C_receiver"/>
	<property name="Pump" value="partsAK5C_parts"/>
	<property name="Barrel" value="partsAK5C_barrel"/>
</property>
<property name="Sound_Sight_In" value="rifle_sight_in"/>
<property name="Sound_Sight_Out" value="rifle_sight_out"/>
<property class="Action0"> <!-- AttackAction -->
	<property name="Class" value="Ranged"/>
	<property name="Delay" value="0.150"/>
	<property name="Auto_fire" value="true"/>
	<property name="Crosshair_min_distance" value="13"/> <!-- 13 -->
	<property name="Crosshair_max_distance" value="16"/> <!-- 16 -->
	<property name="Magazine_size" value="30"/>
	<property name="Magazine_items" value="762mmBullet" />
	<property name="Magazine_item_ray_counts" value="1, 1"/>
	<property name="Magazine_item_ray_spreads" value="0, 0"/>
	<property name="Reload_time" value="3.9"/>
	<property name="Bullet_icon" value="uzi"/>
	<property name="Sound_start" value="ak47_fire_start"/>
	<property name="Sound_repeat" value="Weapons/Ranged/AK47/ak47_fire_lp"/>
	<property name="Sound_end" value="Weapons/Ranged/AK47/ak47_fire_end"/>
	<property name="Sound_empty" value="weapon_empty"/>
	<property name="Sound_reload" value="ak47_reload"/>
	<property name="Horde_meter_rate" value="2.5"/>
	<property name="Horde_meter_distance" value="20"/>
	<property name="Particles_muzzle_fire" value="nozzleflash_ak"/>
	<property name="Particles_muzzle_smoke" value="nozzlesmokeuzi"/>
	<property name="DamageBonus.head" value="3"/>
	<property name="DamageBonus.wood" value="5"/>
	<property name="DamageBonus.earth" value="0.2"/>
	<property name="DamageBonus.glass" value="1"/>
	<property name="Buff" value="critGunAK47"/>
	<property name="Buff_chance" value="0.1"/>
	<property name="ActionExp" value="1"/>
</property>
<property class="Action1"> <!-- UseAction -->
	<property name="Class" value="Zoom"/>
	<property name="Zoom_overlay" value="Items/Weapons/HUD/sniper_zoom_overlay"/>
	<property name="Zoom_max_out" value="40"/>
	<property name="Zoom_max_in" value="15"/>
</property>
<property name="LightSource" value="lightSource"/> <!-- Start: Needed for the attachment flashlight -->
<property name="ActivateObject" value="Attachments/flashlight/lightSource"/>
<property name="AttachmentFlashlight" value="flashlight02"/> <!-- End: Needed for the attachment flashlight -->
<property name="Group" value="Ammo/Weapons"/>
<property name="ActionSkillGroup" value="Rifles"/>
<property name="CraftingSkillGroup" value="craftSkillGuns"/>
<property name="RepairExpMultiplier" value="10.8"/>
<property name="LightValue" value="0.45"/>
<property name="EconomicValue" value="6400"/>
</item>

 

 

 

and this in recipes

 

 

 

<recipe name="AK5C" count="1" craft_area="assembly">
<ingredient name="partsAK5C_stock" count="1"/>
<ingredient name="partsAK5C_receiver" count="1"/>
<ingredient name="partsAK5C_barrel" count="1"/>
<ingredient name="partsAK5C_parts" count="1"/>
</recipe>

 

 

 

it's not working :p

Link to comment
Share on other sites

No other item id 2506 in the item.xml? Try extending off the ak47 in case your missing a property. try adding <property name="HandMeshfile" value="#AK5C?AK5C"/> to force the handmesh to your model. That should work if you are using the correct parent object name and file name

Link to comment
Share on other sites

this is what im looking to right now will reply if i find something :p

 

this is what im looking to right now will reply if i find something :p

 

When i have that issue is usually because i screwed something in unity, not the xml files, the game shows a kind of leather sack because cant use the object you imported... so the xml could be fine....

 

the code: <property name="Meshfile" value="#M4A1?M4A1"/> (example) works locating the imported object and the mesh inside the object (if im not wrong) I used to have the same issue quite a lot until i decided to name everything the same way...

 

when you take the mesh in unity name it "Test" and then when you create the empty object to contain it also name it "Test"... you will end up with a child object named "Test" from a main object called "Test"....then export it and... yes you guessed name the object "Test".... i guess by now you know how the xml shoould look like...

 

<property name="Meshfile" value="#Test?Test"/>

 

also always be aware of caps sensitive so careful when typing... to really be sure do a simple object like a club from scratch dont use the same scene... check that out then once solved move forward with another gun...

 

hope it helps somehow.

Link to comment
Share on other sites

The error message I posted would mean you typed the parent asset name differently in xml than you named it in Unity. The error message you posted means you typed the .unity3d save file name differently in xml than you named it when exporting out of Unity.

Link to comment
Share on other sites

that's really strange idk what's going on XD i used unity 5.3.8 and followed this tutorial,

 

judging by the profile picture im guessing it's your channel ?

 

i also tried adding the one khainegb made with the same results

 

the unity3d im exporting has the parent and the child both named AK5C and in the xml it's the same #AK5C?AK5C

 

i'm playing war of the walkers mod but i don't think that's an issue since the katana and the crowbar work

 

if it isn't any trouble could u try adding it to your game, no big deal if you can't though

Link to comment
Share on other sites

My loading the file probably won't help. The error message is clear, the resource named AK5C.unity3d can't be found. That means one of several things. The file name is spelled differently, capitalized differently, or not in the correct folder location. Unless I have your complete mod, I can't check all those things. We all have struggled with these minor errors that stop things cold. Recheck everything.

Link to comment
Share on other sites

i named the parent AK5C and the child AK5C then also named the unity3d file AK5C Then in the xml i typed this for the meshfile #AK5C?AK5C

 

the result inside the game is not the gun model but just a piece of leather XD

 

as it happens i did upload my game for a friend who recently got the game so here it is : https://drive.google.com/open?id=1WvefVPHtPG_XDob8Z5Yy0I8nvyEzGDJh ( it doesnt have the xml lines for the AK5C though )

 

here is also the unity3d file i made : https://drive.google.com/open?id=1BfeNwACZo8N2jX0-1W40IH24cj2SgDVh

 

fbx : https://www.sendspace.com/file/tcxt14

 

icon : [ATTACH=CONFIG]24800[/ATTACH]

 

feel free to try it if you want thank you for taking the time to help me :D

ak5crifle.png.0cb86b90af7b828de7f2ef366e0d4643.png

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...