vitaminded Posted July 26, 2018 Share Posted July 26, 2018 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 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 AK5C rifle FBX FILE https://www.sendspace.com/file/tcxt14 icon in case u want it Link to comment Share on other sites More sharing options...
KhaineGB Posted July 26, 2018 Share Posted July 26, 2018 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 More sharing options...
KhaineGB Posted July 26, 2018 Share Posted July 26, 2018 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 More sharing options...
vitaminded Posted July 26, 2018 Author Share Posted July 26, 2018 hey thanx can you tell me how you did it ? - - - Updated - - - oooooooooooh so the <property name="Meshfile" value="#AK5C?AK5C"/> line was wrong Link to comment Share on other sites More sharing options...
KhaineGB Posted July 26, 2018 Share Posted July 26, 2018 hey thanx 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 More sharing options...
vitaminded Posted July 26, 2018 Author Share Posted July 26, 2018 the screen shot is low res i cant see anything how do i see it full screen XD ? Link to comment Share on other sites More sharing options...
KhaineGB Posted July 26, 2018 Share Posted July 26, 2018 There you go Do right-click, open image in new tab on that one and you'll get the full size. Link to comment Share on other sites More sharing options...
vitaminded Posted July 26, 2018 Author Share Posted July 26, 2018 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 More sharing options...
KhaineGB Posted July 26, 2018 Share Posted July 26, 2018 I don't see any reason why it wouldn't. It worked fine for me. Is the unity3d file in Mods/SDX/Resources? Link to comment Share on other sites More sharing options...
vitaminded Posted July 26, 2018 Author Share Posted July 26, 2018 yes Link to comment Share on other sites More sharing options...
vitaminded Posted July 26, 2018 Author Share Posted July 26, 2018 i renamed it from <item id="3998" name="gunAK5C"> to <item id="3998" name="AK5C"> but in the game when i hover my mouse over it it says AK-47 ASSULT RIFLE :/ Link to comment Share on other sites More sharing options...
vitaminded Posted July 26, 2018 Author Share Posted July 26, 2018 i fixed that it was on the localization txt the mesh though is still the same it's not showing the weapon XD Link to comment Share on other sites More sharing options...
KhaineGB Posted July 26, 2018 Share Posted July 26, 2018 Then I'm super confused. I know that unity3D file I posted + the code works fine because I got a screenshot in-game. O.o I'll poke around and see if anyone else has any ideas. Link to comment Share on other sites More sharing options...
xyth Posted July 26, 2018 Share Posted July 26, 2018 Its hard to troubleshoot without all the data. If you can package up your files into a mod, we can look it over. Chances are a typo in the xml, given KhaineGB got the model in game. Link to comment Share on other sites More sharing options...
vitaminded Posted July 26, 2018 Author Share Posted July 26, 2018 this is what im looking to right now will reply if i find something Link to comment Share on other sites More sharing options...
vitaminded Posted July 26, 2018 Author Share Posted July 26, 2018 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 Link to comment Share on other sites More sharing options...
xyth Posted July 27, 2018 Share Posted July 27, 2018 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 More sharing options...
vitaminded Posted July 27, 2018 Author Share Posted July 27, 2018 it doesnt work if i extend it it swaps the model after the ak47 :/ Link to comment Share on other sites More sharing options...
Mumpfy Posted July 27, 2018 Share Posted July 27, 2018 this is what im looking to right now will reply if i find something this is what im looking to right now will reply if i find something 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 More sharing options...
xyth Posted July 27, 2018 Share Posted July 27, 2018 Check your logs. You probably will see an error message like "SDX: Could not find asset 'AK5C' Link to comment Share on other sites More sharing options...
vitaminded Posted July 27, 2018 Author Share Posted July 27, 2018 SDX: Could not find bundle named 'AK5C' (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37) this is what im finding in logs Link to comment Share on other sites More sharing options...
xyth Posted July 28, 2018 Share Posted July 28, 2018 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 More sharing options...
vitaminded Posted July 28, 2018 Author Share Posted July 28, 2018 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 More sharing options...
xyth Posted July 28, 2018 Share Posted July 28, 2018 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 More sharing options...
vitaminded Posted July 29, 2018 Author Share Posted July 29, 2018 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.