NeddoFreddo Posted August 3, 2015 Share Posted August 3, 2015 For some reason, it just doesn't work. Like, when I spawn it in, (or try to), it just doesn't appear? Can you help? Link to comment Share on other sites More sharing options...
BaconAndRibs Posted August 3, 2015 Share Posted August 3, 2015 Can you give some more info. Like a crash log or maybe upload your file? Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 4, 2015 Share Posted August 4, 2015 Can you give some more info. Like a crash log or maybe upload your file?The game doesn't crash, the mod does appear in my mod selection screen, just when I try to spawn it in, it doesnt appear, (apparently the game doesn't recognise the prefab "violin" (which is my item)) Link to comment Share on other sites More sharing options...
BaconAndRibs Posted August 4, 2015 Share Posted August 4, 2015 Can you upload your mod or maybe just your prefab script so I can take a look. It might be something in the code or your prefab is spawning but just isn't showing because the animation wasn't created proper. Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 4, 2015 Share Posted August 4, 2015 Can you upload your mod or maybe just your prefab script so I can take a look. It might be something in the code or your prefab is spawning but just isn't showing because the animation wasn't created proper.Ok, here are the .lua files in my prefabs folder.modmain.lua Link to comment Share on other sites More sharing options...
BaconAndRibs Posted August 4, 2015 Share Posted August 4, 2015 (edited) Couple of things you should really change:Your modmain.lua file goes into you main folder and not your prefab folder. (Expands on the first point) Your file structure should be similar to the games file structure. Look at other mods for an example. Some of your code that you put in your modmain should be in your prefab file so I guess your prefab file would be called "violin" and most of the code you have should be in there.Use this for an example mod and just change the code and images around. Edited August 4, 2015 by BaconAndRibs Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 8, 2015 Share Posted August 8, 2015 (edited) Couple of things you should really change:Your modmain.lua file goes into you main folder and not your prefab folder. (Expands on the first point) Your file structure should be similar to the games file structure. Look at other mods for an example. Some of your code that you put in your modmain should be in your prefab file so I guess your prefab file would be called "violin" and most of the code you have should be in there.Use this for an example mod and just change the code and images around.Hmm, for some reason the game still doesn't let me spawn in the violin, even when i type in 'wand'. Edited August 8, 2015 by NeddoFreddo Link to comment Share on other sites More sharing options...
BaconAndRibs Posted August 8, 2015 Share Posted August 8, 2015 If you upload your folder I can take a look at it. See if I can find what's wrong with it. Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 8, 2015 Share Posted August 8, 2015 (edited) I think i uploaded it.........EDIT: Nope! I think the file is too big. Edited August 8, 2015 by NeddoFreddo Link to comment Share on other sites More sharing options...
BaconAndRibs Posted August 10, 2015 Share Posted August 10, 2015 Is it in a zip file or maybe upload two folders? If you are unable to upload it then I can't do much to help but the only thing I can think of is replacing the images and scml files in the example mod and change the code. You just change the names around and see if it works out. That's what modding involves, making mistakes and trying to find where you made the mistake. Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 11, 2015 Share Posted August 11, 2015 Is it in a zip file or maybe upload two folders? If you are unable to upload it then I can't do much to help but the only thing I can think of is replacing the images and scml files in the example mod and change the code. You just change the names around and see if it works out. That's what modding involves, making mistakes and trying to find where you made the mistake.Ok here it is.Violin.zip Link to comment Share on other sites More sharing options...
pickleplayer Posted August 12, 2015 Share Posted August 12, 2015 Ok here it is.Violin.zip Uh, I tested out your mod, and I can spawn the violin just fine. How are you trying to spawn the item in? Are you typing: c_spawn("violin", 1) into the console? Because it works fine when I do that. The only other thing off about it is it says "MISSING NAME" when you hover your mouse over the violin. (you can fix that by adding this into your violin.lua file;STRINGS.NAMES.VIOLIN = "Violin" Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 12, 2015 Share Posted August 12, 2015 (edited) Uh, I tested out your mod, and I can spawn the violin just fine. How are you trying to spawn the item in? Are you typing: c_spawn("violin", 1) into the console? Because it works fine when I do that. The only other thing off about it is it says "MISSING NAME" when you hover your mouse over the violin. (you can fix that by adding this into your violin.lua file;STRINGS.NAMES.VIOLIN = "Violin"Yes, I typed that exact thing (like I always do!) Also turns out it did't work for me because the whole thing was inside another folder (like there were 2 violin folders.)The inventory image is still the one of the deafault mod, can u help?This was originally designed to be part of a character mod, and I wanted to give it the effects of a pan flute and add a crafting recipe. (btw i have already made the character http://steamcommunity.com/sharedfiles/filedetails/?id=486052508)Sorry to bother you. Edited August 12, 2015 by NeddoFreddo Link to comment Share on other sites More sharing options...
pickleplayer Posted August 12, 2015 Share Posted August 12, 2015 Yes, I typed that exact thing (like I always do!) Also turns out it did't work for me because the whole thing was inside another folder (like there were 2 violin folders.)The inventory image is still the one of the deafault mod, can u help?This was originally designed to be part of a character mod, and I wanted to give it the effects of a pan flute and add a crafting recipe. (btw i have already made the character http://steamcommunity.com/sharedfiles/filedetails/?id=486052508)Sorry to bother you. Hm, the image inside the inventoryimages/violin.tex Is still the image of the wand. Do you have Steam's "Don't Starve Mod Tools" installed? If you install that, it should take care of exporting all your .png images to their .xml and .tex versions for you. To install it; open up steam and open the "library" tab and click "tools", and find Dont Starve Mod Tools, and install it. Now whenever you run Dont Starve, the steam autocompiler will take all the .png images in your folders and export them and do all that stuff for you. If that doesnt work, you could always do it the old fashioned way. Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 13, 2015 Share Posted August 13, 2015 (edited) Hm, the image inside the inventoryimages/violin.tex Is still the image of the wand. Do you have Steam's "Don't Starve Mod Tools" installed? If you install that, it should take care of exporting all your .png images to their .xml and .tex versions for you. To install it; open up steam and open the "library" tab and click "tools", and find Dont Starve Mod Tools, and install it. Now whenever you run Dont Starve, the steam autocompiler will take all the .png images in your folders and export them and do all that stuff for you. If that doesnt work, you could always do it the old fashioned way.Thanks, I just ran the autocompiler again. and replaced the image. I figured out how to add it to my character, and did, but could you please give me some tips on how to make it work like a panflute/Thanks Edited August 13, 2015 by NeddoFreddo Link to comment Share on other sites More sharing options...
pickleplayer Posted August 13, 2015 Share Posted August 13, 2015 Thanks, I just ran the autocompiler again. and replaced the image. I figured out how to add it to my character, and did, but could you please give me some tips on how to make it work like a panflute/ThanksYea, I recently made a similar item so I can help.You can basically just copy most of the code from the panflute's files into your own and it should work. Do you know where to find the game files for don't starve?The panflute is also a prefab, so look for the prefabs folder, and you should find it in there. Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 14, 2015 Share Posted August 14, 2015 Yea, I recently made a similar item so I can help.You can basically just copy most of the code from the panflute's files into your own and it should work. Do you know where to find the game files for don't starve?The panflute is also a prefab, so look for the prefabs folder, and you should find it in there.Thanks, but I am having problems with the character for some reason. Where do i put all the violin files if I want it to be part of the character? I have tried to put it in the anim folder, would the main folder work? Link to comment Share on other sites More sharing options...
pickleplayer Posted August 14, 2015 Share Posted August 14, 2015 Thanks, but I am having problems with the character for some reason. Where do i put all the violin files if I want it to be part of the character? I have tried to put it in the anim folder, would the main folder work?If you want it to be part of the character, everything should be part of one mod instead of two seperate mods. So they both need to be in the same mod folder. you can do this by just copying and pasting all of the files from the violin mod to their respective folders in your character mod, and changing the modmain.lua a bit. So take both of the files in your mods/violin/anim folder (violin.zip and swap_violin.zip) and paste them into the anim folder of your character's mod; mods/wilfred/anim (assuming your mod folder is named wilfred.)So you should have the anim files for both your character and the violin in the same anim folder. now you do the rest with the other folders; exported, images, and scripts. copy everything inside your violin/exported folder (the two folders), and paste them in wilfred/anim.And copy the one folder inside violin/images, and paste it in wilfred/images.now copy violin.lua from violin/scripts/prefabs, and paste it in wilfred/scripts/prefabs. And that should be it. Now, since there can only be one modmain.lua, you cant just copy and paste it into the folder. You need to change the existing modmain.lua to include your code along with it. and since your voilins modmain.lua is only 3 lines, you'll literally only have to add one word to wilfred's modmain.lua to include it. (I think)in wilfred's modmain.lua, find where you added the prefabs. its probably something like PrefabFiles = { "wilfred",}Just add the violin pefab and a comma to that line like this;PrefabFiles = { "wilfred", "violin",}and thats it.I'm pretty sure you dont need to do anything with the modinfo.lua to make him spawn with it, just add it to the startng inventory code, just like you did with the one man band. and that should work! (don't forget to disable your other violin mod before running it, because it'll crash if you have two mods adding the same prefab into the game) Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 14, 2015 Share Posted August 14, 2015 (edited) If you want it to be part of the character, everything should be part of one mod instead of two seperate mods. So they both need to be in the same mod folder. you can do this by just copying and pasting all of the files from the violin mod to their respective folders in your character mod, and changing the modmain.lua a bit. So take both of the files in your mods/violin/anim folder (violin.zip and swap_violin.zip) and paste them into the anim folder of your character's mod; mods/wilfred/anim (assuming your mod folder is named wilfred.)So you should have the anim files for both your character and the violin in the same anim folder. now you do the rest with the other folders; exported, images, and scripts. copy everything inside your violin/exported folder (the two folders), and paste them in wilfred/anim.And copy the one folder inside violin/images, and paste it in wilfred/images.now copy violin.lua from violin/scripts/prefabs, and paste it in wilfred/scripts/prefabs. And that should be it. Now, since there can only be one modmain.lua, you cant just copy and paste it into the folder. You need to change the existing modmain.lua to include your code along with it. and since your voilins modmain.lua is only 3 lines, you'll literally only have to add one word to wilfred's modmain.lua to include it. (I think)in wilfred's modmain.lua, find where you added the prefabs. its probably something like PrefabFiles = { "wilfred",}Just add the violin pefab and a comma to that line like this;PrefabFiles = { "wilfred", "violin",}and thats it.I'm pretty sure you dont need to do anything with the modinfo.lua to make him spawn with it, just add it to the startng inventory code, just like you did with the one man band. and that should work! (don't forget to disable your other violin mod before running it, because it'll crash if you have two mods adding the same prefab into the game)Hey, thanks so much, but when I moved all of the violin components into wilfred's folders, the panflute thing never worked afterwards. (i mean that it was not putting things to sleep.) Can you please help?And yeah, thanks for all the help, I probably sound like a complete noob asking all these questions. Edited August 14, 2015 by NeddoFreddo 1 Link to comment Share on other sites More sharing options...
pickleplayer Posted August 14, 2015 Share Posted August 14, 2015 Hey, thanks so much, but when I moved all of the violin components into wilfred's folders, the panflute thing never worked afterwards. (i mean that it was not putting things to sleep.) Can you please help?And yeah, thanks for all the help, I probably sound like a complete noob asking all these questions. Yea, I can help. you'll need to be more specific about what you need though, or show me your code so I can see what you're doing d: It's okay, a lot of people here are. I've only been here 3 weeks. There really is a lack of the basic introductory programming tutorials for don't starve. The only way most people can do it is by looking at the game's code or code from other people's mods. Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 15, 2015 Share Posted August 15, 2015 (edited) Yea, I can help. you'll need to be more specific about what you need though, or show me your code so I can see what you're doing d: It's okay, a lot of people here are. I've only been here 3 weeks. There really is a lack of the basic introductory programming tutorials for don't starve. The only way most people can do it is by looking at the game's code or code from other people's mods.I wanted to make the violin act like a panflute, i.e. putting things to sleep on use.I've got the violin to do some of the panflute things, when you hover over it in your inventory, it shows the option to rightclick and play, but when you right click nothing actually happens.I'll upload the code so you can take a look at it. This might seem a little weird, but I think the violin will be wwwaaayyyy to op. I wanted to add this thing where there is a one in ten chance that when you play the violin, it will play a 'bad note' where birds will fly away and anything that can attack you will. (attack you.)I think that that is a little complicated, if you can help thanks but if you can't don't worry. I also wanted to add a examination quote for wilfred, do you know how?Thanksviolin.lua Edited August 15, 2015 by NeddoFreddo Link to comment Share on other sites More sharing options...
pickleplayer Posted August 15, 2015 Share Posted August 15, 2015 I wanted to make the violin act like a panflute, i.e. putting things to sleep on use.I've got the violin to do some of the panflute things, when you hover over it in your inventory, it shows the option to rightclick and play, but when you right click nothing actually happens.I'll upload the code so you can take a look at it. This might seem a little weird, but I think the violin will be wwwaaayyyy to op. I wanted to add this thing where there is a one in ten chance that when you play the violin, it will play a 'bad note' where birds will fly away and anything that can attack you will. (attack you.)I think that that is a little complicated, if you can help thanks but if you can't don't worry. I also wanted to add a examination quote for wilfred, do you know how?Thanks Ah, I remember had this same problem when I was working on mine as well. It turns out it needs to have the Flute tag, otherwise it wont play. just add; inst:AddTag("flute") somwhere in the item's main fn function. But also there is a problem with TUNING.VIOLIN_SLEEPRANGE, because the violin doesnt have a defined "sleeprange", so it will crash the game if you try to play it. See; when you see something in the code like TUNING.SOMETHINGINALLCAPS, it's actually just taking a number in the game's tuning.lua file. But you can just replace it with your own number and it will work exactly the same.just type the number 10 in place of TUNING.VIOLIN_SLEEPRANGE, and it will have a range of 10 feet. (or meters or whatever) same thing with this lineinst.components.sleeper:AddSleepiness(5, TUNING.VIOLIN_SLEEPTIME)replace it with whatever number you wantinst.components.sleeper:AddSleepiness(5, 20)this will make them fall asleep for 20 seconds also, yea. For description, you can put this right underneath where you defined what it's name was;STRINGS.CHARACTERS.GENERIC.DESCRIBE.VIOLIN = "whatever you want here, in quotes" Link to comment Share on other sites More sharing options...
NeddoFreddo Posted August 15, 2015 Share Posted August 15, 2015 Ah, I remember had this same problem when I was working on mine as well. It turns out it needs to have the Flute tag, otherwise it wont play. just add; inst:AddTag("flute") somwhere in the item's main fn function. But also there is a problem with TUNING.VIOLIN_SLEEPRANGE, because the violin doesnt have a defined "sleeprange", so it will crash the game if you try to play it. See; when you see something in the code like TUNING.SOMETHINGINALLCAPS, it's actually just taking a number in the game's tuning.lua file. But you can just replace it with your own number and it will work exactly the same.just type the number 10 in place of TUNING.VIOLIN_SLEEPRANGE, and it will have a range of 10 feet. (or meters or whatever) same thing with this lineinst.components.sleeper:AddSleepiness(5, TUNING.VIOLIN_SLEEPTIME)replace it with whatever number you wantinst.components.sleeper:AddSleepiness(5, 20)this will make them fall asleep for 20 seconds also, yea. For description, you can put this right underneath where you defined what it's name was;STRINGS.CHARACTERS.GENERIC.DESCRIBE.VIOLIN = "whatever you want here, in quotes"Thank you so much, it worked!Is there a way to change the animation so the violin does not look like a pan flute when I play it?If not, it doesn't matter too much. (OK it does matter alot but if you don't know how it's fine) Link to comment Share on other sites More sharing options...
Benzor Posted August 15, 2015 Share Posted August 15, 2015 After making a TEX file for the ground item, should I delete the PNG? sorry, i haven't modded in don't starve before, clearly Link to comment Share on other sites More sharing options...
pickleplayer Posted August 15, 2015 Share Posted August 15, 2015 Thank you so much, it worked!Is there a way to change the animation so the violin does not look like a pan flute when I play it?If not, it doesn't matter too much. (OK it does matter alot but if you don't know how it's fine) As I've just recently found out for myself, custom animations are crazy complicated and difficult to make. If you manage to make the animation in spriter, I could probably show you how to put it into the game, since I'm currently working on doing that with my own mod right now d: I don't know if there is a way to just change the picture of the panflute to a violin in the animation, if that's what you were wondering. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now