KirbyJParasol Posted March 7, 2016 Share Posted March 7, 2016 So here I am, reading the wiki, when I see that Magiluminescence can be refueled by nightmare fuel?! I immediately go and craft one and try it...but it doesn't work. Confused, I ask Dr. Google why it won't work. Turns out, this is a new feature in Shipwrecked, not DST. So I can't refuel my brand new Magiluminescence. This will not do. So my questions are twofold: What's the best way to mod an item already existing in the base game, and how do you add new fuels to them? Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/ Share on other sites More sharing options...
KirbyJParasol Posted March 9, 2016 Author Share Posted March 9, 2016 Still looking for help. Perhaps if someone with the Shipwrecked DLC could share the prefab for the Magiluminescence? Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/#findComment-731996 Share on other sites More sharing options...
Aquaterion Posted March 10, 2016 Share Posted March 10, 2016 How DS:SW did it: item to use as fuel: inst:AddComponent("fuel") inst.components.fuel.fueltype = "NIGHTMARE" inst.components.fuel.fuelvalue = TUNING.LARGE_FUEL item to be fueled: inst:AddComponent("fueled") inst.components.fueled.accepting = true inst.components.fueled.fueltype = "NIGHTMARE" inst.components.fueled:InitializeFuelLevel(TUNING.YELLOWAMULET_FUEL) so unless they changed how fuel works in DS:SW, you can just give a fueltype to an item, then use it elsewhere Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/#findComment-732024 Share on other sites More sharing options...
KirbyJParasol Posted March 10, 2016 Author Share Posted March 10, 2016 Thank you! That worked just fine. Turns out DST already has made nightmare fuel a fuel type, so I only had to change the magiluminescence. That said, this is my first time actually creating a mod, instead of just editing another. In-game, the mod is stable, but if I try to relaunch a server that has already been running it, I get this message: [string "scripts/modindex.lua"]:626: bad argument #1 to 'pairs' (table expected, got string) And then the full lua error stack traceback after that. Not sure what to do here. Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/#findComment-732295 Share on other sites More sharing options...
Aquaterion Posted March 10, 2016 Share Posted March 10, 2016 (edited) 24 minutes ago, KirbyJParasol said: Thank you! That worked just fine. Turns out DST already has made nightmare fuel a fuel type, so I only had to change the magiluminescence. That said, this is my first time actually creating a mod, instead of just editing another. In-game, the mod is stable, but if I try to relaunch a server that has already been running it, I get this message: [string "scripts/modindex.lua"]:626: bad argument #1 to 'pairs' (table expected, got string) And then the full lua error stack traceback after that. Not sure what to do here. should probably post the full error. btw you should probably add this if u dont have it on it: inst.components.fueled:SetDepletedFn(inst.Remove) Edited March 10, 2016 by Aquaterion Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/#findComment-732303 Share on other sites More sharing options...
Muche Posted March 11, 2016 Share Posted March 11, 2016 3 hours ago, KirbyJParasol said: That said, this is my first time actually creating a mod, instead of just editing another. In-game, the mod is stable, but if I try to relaunch a server that has already been running it, I get this message: [string "scripts/modindex.lua"]:626: bad argument #1 to 'pairs' (table expected, got string) And then the full lua error stack traceback after that. Not sure what to do here. It seems to point to incorrect value of configuration_options in modinfo. In addition to full error please post whole modinfo.lua. Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/#findComment-732399 Share on other sites More sharing options...
KirbyJParasol Posted March 12, 2016 Author Share Posted March 12, 2016 http://prntscr.com/aeiim4 And then here's the modinfo.lua -- This information tells other players more about the mod name = "Refuel Magiluminescence" description = "Now you can fuel the Magiluminescence with Nightmare Fuel, just like in Shipwrecked!" author = "KirbyJParasol" version = "1" -- This is the URL name of the mod's thread on the forum; the part after the index.php? and before the first & in the URL -- Example: -- http://forums.kleientertainment.com/index.php?/files/file/202-sample-mods/ -- becomes -- /files/file/202-sample-mods/ forumthread = "" -- This lets other players know if your mod is out of date, update it to match the current version in the game api_version = 1 ---- Can specify a custom icon for this mod! icon_atlas = "" icon = "" --This lets the clients know that they need to download the mod before they can join a server that is using it. --all_clients_require_mod = false --This let's the game know that this mod doesn't need to be listed in the server's mod listing client_only_mod = false --Let the mod system know that this mod is functional with Don't Starve Together dst_compatible = true --These tags allow the server running this mod to be found with filters from the server listing screen server_filter_tags = {"Refuel Magiluminescence"} configuration_options = "" Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/#findComment-733174 Share on other sites More sharing options...
Muche Posted March 13, 2016 Share Posted March 13, 2016 That is definitely incorrect value of configuration_options. Its value can be either nil if the mod has no options, or a table. Here is the original post explaining the options: Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/#findComment-733577 Share on other sites More sharing options...
KirbyJParasol Posted March 14, 2016 Author Share Posted March 14, 2016 Thank you, the mod is now stable Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/#findComment-733635 Share on other sites More sharing options...
KirbyJParasol Posted March 18, 2016 Author Share Posted March 18, 2016 (edited) Well, it's still stable, but it has an unintended function. It's now impossible to craft any amulet BESIDES the magiluminescence. EDIT: I hotfixed it myself. So I learned that when you mod a base game file, you need to make sure to include EVERYTHING the old file had, and then put in your modifications. Instead of just including the lines relevant to your modded item. Which is what I did at first. Only included the Magiluminescence code. Cut out the code for alllll the other amulets. Yeah... Edited March 18, 2016 by KirbyJParasol hotfix Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/#findComment-735651 Share on other sites More sharing options...
Muche Posted March 18, 2016 Share Posted March 18, 2016 Yeah, replacing whole base game files is generally bad practice, it increases the chances of your mod being incompatible with other mods or future game updates. I think your idea could be implemented by adding AddPrefabPostInit("yellowamulet", function(inst) inst.components.fueled.accepting = true inst.components.fueled.fueltype = GLOBAL.FUELTYPE.NIGHTMARE end) into modmain.lua (and not touching prefabs/amulet.lua at all). Link to comment https://forums.kleientertainment.com/forums/topic/65194-how-to-implement-custom-item-fuels/#findComment-735662 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