• Help with the file structure of converting custom entities into the addon folder
    6 replies, posted
I'm trying to convert an entity i have using a hl2 model from the gmod files, lua files put in the base garrysmod/lua/entities folder, and a texture in garrysmod/materials/>modname<, but ive had issues with how the file structure should be, and even if an addon is able to access primitive garrysmod content. with the same lua code to find the prop, it gives me an error in game. Ontop of that, having the addon in both places, for the sake of comparing the two for now before i delete the default one, the addon shows up three times in the entities tab, which i would expect it to show up twice, since it is in the addons once, and the default files once, but the addons make it show up twice, and the files only once. My current file structure is addons/>modname</ lua/entities/(all the lua files) materials/(VTF and VMT File) https://files.facepunch.com/forum/upload/485737/637ced70-637e-49d8-bdcd-151a5442a497/Capture2.PNG https://files.facepunch.com/forum/upload/485737/404e340d-52a3-482e-89a9-ecd3be779d90/Capture.PNG https://files.facepunch.com/forum/upload/485737/03c07b7b-e6c7-4f22-9fcd-6ea153a372af/Capture1.PNG (The GMOD Screenshot is the difference between the before (right) and after (left) moving them to the addons folder)
Have you put the files in the core gamemode entities? or the current gamemode entities? or the core lua file? My suggestions would remove all instances of the addon except for in the addons folder. The only reason I've ever had an entity of the same name show up is because the entity is in the folders multiple times - this includes if they're named slightly different as the name of the entity is determined in the shared.lua. Once you've done that I would suggest going to the workshop, finding a playermodel and then subscribing to it, after that extract the .gma using gmad.exe. After you've done that you'll want to take a look at the folder structure as reference for the addon you are wanting to create. If you are receiving errors for your models/materials then this means you haven't included the materials/models in the proper path OR you haven't referenced the path correctly. Again use another addon for reference.
Would you know if you are able to reference hl2 models without having them in the addon folder?
yes all half-life 2 content is in the core files of gmod
I am trying to understand and I feel really stupid for some reason but, are you saying you have the hl2 model itself in the addon folder?
I believe they're asking if they can do something like Ent:SetModel("models/buggy.mdl") in an addon file and have it reference the model from garry's mod itself.
Thank you so much, I actually took a step back and recoded the small portion i had, and it worked now, knowing referencing hl2 models was alright helped me debug it a lot though
Sorry, you need to Log In to post a reply to this thread.