Results 1 to 14 of 14

Thread: Adding new guns to 7 Days to Die (A17)

  1. #1
    Colony Founder KhaineGB's Avatar
    Join Date
    Apr 2017
    Location
    Liverpool, UK
    Posts
    1,793
    Rep Power
    1

    Adding new guns to 7 Days to Die (A17)

    I figured the tutorial for adding guns to the game needed updating, especially since things have changed in A17. If you don't have your prefab setup correctly, you'll be presented with NRE's upon trying to equip your new gun.

    So I did a tutorial thing!

    https://www.youtube.com/watch?v=jffCqEC9Deo&t=12s

    Hopefully it'll be of use to folks.

  2. #2
    Ranger Quasimiyao's Avatar
    Join Date
    Feb 2017
    Location
    Norway
    Posts
    286
    Rep Power
    1
    Thx alot for this tutorial Been wanting to add a custom model to the rifle I made before releasing it. Tried making the exact same thing as you did first tho ,just to see ifI got it working, but keep getting NRE's when trying to equip it. I did the attachments same way as you did in the video, and did exactly the same edits in the xml aswell. Only thing different was I couldnt find the prefan gun with the flashlight attached, so use the PistolPrefab extracted with Asset Studio instead. But that shouldnt have any effect on the result? Except possibly scale/orientation?

  3. #3
    Colony Founder KhaineGB's Avatar
    Join Date
    Apr 2017
    Location
    Liverpool, UK
    Posts
    1,793
    Rep Power
    1
    If you're getting an NRE when trying to equip it, then I absolutely guarantee you're missing the Attachments/Scope transform (and yes, the capitilization MATTERS).

    Try disabling action1 for the gun in your XML. If it stops giving NRE's, that's your problem. You didn't set up the scope object correctly.

  4. #4
    Ranger Quasimiyao's Avatar
    Join Date
    Feb 2017
    Location
    Norway
    Posts
    286
    Rep Power
    1
    I checked that first thing actually, since you were pretty clear on that in the video, which is a good thing or I might just aswell have missed it

    Still, commenting out action1 did work. it shoots and all, but what I'm actually holding in my hand looks like a piece of cloth or leather
    (Your assumptions that people watching your video were familiar with Unity editor is not applicable in all cases lol). I know I should be before using it, but looked so easy based on your tutorial

    Annotation 2018-12-30 224524.jpg

    Edit: Also, when looking at the huntingrifle prefab extracted from the games assets folder, I dont see all the attachment points I would assume based on the attachments the gun supports. But as long as I add a scope attachment(which it has) it should be ok to use if I dont add any other attachment tags in the xml? Working on a weapons modlet, and currently just using ingame models with different tints. Would be nice if I could add custom models and sounds to them aswell
    Last edited by Quasimiyao; 12-30-2018 at 09:56 PM.

  5. #5
    Colony Founder KhaineGB's Avatar
    Join Date
    Apr 2017
    Location
    Liverpool, UK
    Posts
    1,793
    Rep Power
    1
    I assumed people had gone through Xyth's basic unity tutorials because he's done WAY more than me.

    Piece of leather like that means the XML is somehow wrong. That's what 7DTD does when it can't find the model for whatever reason (For the record, I've literally had that happen, changed the name of the .prefab file in unity, re-exported and then it's worked for no reason).

    I believe other tags are not REQUIRED, but may throw NRE's if you try to attach a mod that doesn't have the appropriate "slot" defined on the prefab for the transform.

  6. #6
    Ranger Quasimiyao's Avatar
    Join Date
    Feb 2017
    Location
    Norway
    Posts
    286
    Rep Power
    1
    Hehe, I would assume most people watching it, at least those with the intent of doing anything with it, have watched his videos. And I will do so later or tomorrow. Its just that you made it look quite easy using a free asset and just importing it so I thought I'd have a go at it
    I did make it twice, after first failed, to make sure I hadn't missed anything. And used a slightly different name, incase the underscore in the first could be one reason. I'll try and export the same one with different name later when I get home.

    As long as other guns work without the other tags it shouldn't be an issue. Can just remove the attachment tags from the xml. And try adding the ones that's appropriate for the different weapons when I get the basic models working.

  7. #7
    Community Moderator xyth's Avatar
    Join Date
    Dec 2016
    Location
    Florida, USA
    Posts
    1,795
    Rep Power
    1
    @KhaineGB Glad you finally got this posted. Well done! This will be a popular Tutorial.

  8. #8
    Ranger Quasimiyao's Avatar
    Join Date
    Feb 2017
    Location
    Norway
    Posts
    286
    Rep Power
    1
    You were indeed right, renaming the prefab an re-exported it and it worked like a charm I did have to add -270 degrees for the attachments for side and scope to point the right direction (and I realised now that I could just used 90 without the minus...). Side also needed to move ca 0.6 further back. Plus the barrel same rotation adjust but position x2.5 y0.2 ca to not be same place as the scope ( I did add the gun to the item_modifiers list first to see if that corrected enough, which it didnt). But I got a working gun thx to your tutorial after never used Unity editor before, so thx again for a very nice and easy to follow tutorial There might be a few new guns in the mod section soon

  9. #9
    Colony Founder KhaineGB's Avatar
    Join Date
    Apr 2017
    Location
    Liverpool, UK
    Posts
    1,793
    Rep Power
    1
    Glad it helped.

    And yeah, it makes no sense to me that you sometimes need to change the prefab name to get 7DTD to load it. It's one of those random strange things I've just learned to deal with.

  10. #10
    Colony Founder Sorrowthief's Avatar
    Join Date
    Jan 2015
    Location
    North Carolina USA
    Posts
    1,043
    Rep Power
    1
    I've been following the tutorials and have managed to do the flag and the gun like you have in the video and make it work in the game. I used to play with Unity a lot when my son was in college for game design and we spent a good part of a year trying to make our own game. Meaning I still have a lot of bought assets laying around that I can use. I was trying to make a new trap but cannot get it to work. I was trying to use the spinning blade trap as a template but I am unsure of what tag I should use for one and animation on my prefab is the other. My hammer trap has a spinning animation attached. How could I get that in the game to work with electricity like the spinning blade trap? So far I keep getting NRE on every attempt so I figure it has to be something with the tags and perhaps the electrical stuff is more complicated? I also notice that the traps all use LOD, does that make a difference? If I am using the xml blade traps as a template for my hammer trap is it looking for all those LOD models?
    Last edited by Sorrowthief; 01-18-2019 at 12:31 AM.

  11. #11
    Nomad zombo's Avatar
    Join Date
    Sep 2016
    Posts
    357
    Rep Power
    1
    Very useful video.

    Could you make a guide on how to add armor?

  12. #12
    Colony Founder KhaineGB's Avatar
    Join Date
    Apr 2017
    Location
    Liverpool, UK
    Posts
    1,793
    Rep Power
    1
    Quote Originally Posted by zombo View Post
    Very useful video.

    Could you make a guide on how to add armor?
    We can't add new UMA models yet.

    It sucks. -_-

    - - - Updated - - -

    Quote Originally Posted by Sorrowthief View Post
    I've been following the tutorials and have managed to do the flag and the gun like you have in the video and make it work in the game. I used to play with Unity a lot when my son was in college for game design and we spent a good part of a year trying to make our own game. Meaning I still have a lot of bought assets laying around that I can use. I was trying to make a new trap but cannot get it to work. I was trying to use the spinning blade trap as a template but I am unsure of what tag I should use for one and animation on my prefab is the other. My hammer trap has a spinning animation attached. How could I get that in the game to work with electricity like the spinning blade trap? So far I keep getting NRE on every attempt so I figure it has to be something with the tags and perhaps the electrical stuff is more complicated? I also notice that the traps all use LOD, does that make a difference? If I am using the xml blade traps as a template for my hammer trap is it looking for all those LOD models?
    I -think- blocks that use electricity need very specific tags in order to work, but I have not messed with that to be totally honest with you.

  13. #13
    Scavenger YuriBengala's Avatar
    Join Date
    Dec 2015
    Posts
    35
    Rep Power
    0
    Hello KhaineGB, awesome video you did, i wanted to thank you for it, thanks to it i created the Soviet Pack, really thanks!
    And one question, im trying to implement a Animation to a gun, in Unity everything is working fine, im using the Animator to do it, but when i put the gun in game the animations don't work,do you have any idea why this is happening?

  14. #14
    Colony Founder KhaineGB's Avatar
    Join Date
    Apr 2017
    Location
    Liverpool, UK
    Posts
    1,793
    Rep Power
    1
    I'm still working out animations myself. Took me 3 days to do 1 crossbow.

    The main ones you need are an empty idle anim, a fire and a reload. I find that using triggers work's better than bools and you MUST have your animator on the empty parent object within unity, NOT on the model.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •