InaneDugong Posted March 30, 2014 Share Posted March 30, 2014 Hi. So, got a different issue: can't get DS to pick up the mod prefab of Abigail_Flower (Abigail_Flower2 in this case). I copied over the Abigail_Flower prefab, changed its name, changed local_assets = Abigail to assets = Abigail_Spirit. Abigail_Spirit is the editted Abigail prefab and I want my Abigail_Flower2 to link to it. Is that a mistake? This is how I've gone about referencing local prefabs: Abigail_Flower2 (mod Flower) Abigail_Spirit (mod Abigail)local assets ={ Asset("ANIM", "anim/abigail_spirit.zip"), Asset("IMAGE", "images/inventoryimages/abigail_spirit.tex"), Asset("ATLAS", "images/inventoryimages/abigail_spirit.xml"),}prefabs = { "abigail",} Original Unedited Files and how they reference each other Abigaillocal assets ={ Asset("ANIM", "anim/ghost.zip"), Asset("ANIM", "anim/ghost_wendy_build.zip"), Asset("SOUND", "sound/ghost.fsb"),}local prefabs = {} Abigail_Flowerlocal assets ={ Asset("ANIM", "anim/abigail_flower.zip"), --Asset("SOUND", "sound/common.fsb"),} local prefabs ={ "abigail",} Extra: Code I changed in Abigail_Flower2This is the code I changed. I changed -TUNING.SANITY_HUGE to SANITY_MEDLARGE. That should be it, I believe.local function ondeath(inst, deadthing) if inst.components.inventoryitem.owner == nil and not deadthing:HasTag("wall") and inst:GetDistanceSqToInst(deadthing) < 16*16 then if inst.components.cooldown:IsCharged() then GetPlayer().components.sanity:DoDelta(-TUNING.SANITY_HUGE) local abigail = SpawnPrefab("abigail") abigail.Transform:SetPosition(inst.Transform:GetWorldPosition()) inst.SoundEmitter:PlaySound("dontstarve/common/ghost_spawn") inst:Remove() end endend So, the logic I've used is to reference MY Abigail_Flower to the original Abigail prefab, and then I tried referencing the mod prefab (abigail_spirit). Neither has worked. Can anyone see what I've done wrong at a glance? Thanks for all help. local assets ={ Asset("ANIM", "anim/abigail_flower.zip"), --Asset("SOUND", "sound/common.fsb"),} prefabs ={ "abigail_flower",} Link to comment Share on other sites More sharing options...
Skorp Posted March 30, 2014 Share Posted March 30, 2014 I'm pretty sure you create a new folder in the mods folder like this : Mods / Mymod / scripts / prefab / abigail.lua.The abigail.lua being the same as the normal file but with your modifications. Also you need to create a modinfo.lua in "Mymod" Link to comment Share on other sites More sharing options...
InaneDugong Posted March 30, 2014 Author Share Posted March 30, 2014 Oh, really? Is there a way to do it so there's less code on the mod end? Figures I may as well ask the question whilst I'm here. Link to comment Share on other sites More sharing options...
Skorp Posted March 30, 2014 Share Posted March 30, 2014 The mod overwrites the original file with your file, if that’s what you're asking. It could be possible to use a modmain.lua to not overwrite anything but is usually less reliable than the normal way. Link to comment Share on other sites More sharing options...
InaneDugong Posted March 30, 2014 Author Share Posted March 30, 2014 Thanks for your help, Skorp. Link to comment Share on other sites More sharing options...
Skorp Posted March 30, 2014 Share Posted March 30, 2014 No problem! I'm also new to this and if I don't get how do to something after trying for a while I come to ask here. Link to comment Share on other sites More sharing options...
InaneDugong Posted March 31, 2014 Author Share Posted March 31, 2014 Updated with a related issue. So, I can't get it to work. I copied over the whole prefab and made the edit, but both Abigail prefabs make reference to each other in weird ways and I'm not sure if I've got the code wrong. The original Abigail_Flower prefab has 'local assets = abigail prefab', but the already modded Abigail_Spirit (which is the Abigail Prefab for the mod) has 'assets' and not 'local assets'. Not sure what to do here. Link to comment Share on other sites More sharing options...
Skorp Posted March 31, 2014 Share Posted March 31, 2014 You named the modded file different? If that's the case then the game will ignore it unless you modify another file to use your file instead of the default.Basically there is no reason to have a different name if you want a small change, the mod loader will replace the normal file with yours without any problem if is the same name and the same location (create folders in your mod folder like I said before). Link to comment Share on other sites More sharing options...
InaneDugong Posted March 31, 2014 Author Share Posted March 31, 2014 You named the modded file different? If that's the case then the game will ignore it unless you modify another file to use your file instead of the default.Basically there is no reason to have a different name if you want a small change, the mod loader will replace the normal file with yours without any problem if is the same name and the same location (create folders in your mod folder like I said before). Oh.... Gotcha. And is there any reason to change the local_prefab to refer to the new default file (Abigail_Spirit instead of Abigail)? As in, I'm modding over another mod, right? And the other mod already has Abigail_Spirit instead of Abigail. So, if I'm just copy/pasting the Abigail_Flower prefab and the prefab normally targets the Abigail prefab, should I change it to target Abigail_Spirit because the mod uses that file instead? And does it stay as local_prefabs = Abigail or Abigail_Spirit, or change to just prefabs = etc? Sorry, I'm way under my head here. Thanks heaps for your time though, it's been a great help. Link to comment Share on other sites More sharing options...
Skorp Posted March 31, 2014 Share Posted March 31, 2014 Oh.... Gotcha. And is there any reason to change the local_prefab to refer to the new default file (Abigail_Spirit instead of Abigail)? As in, I'm modding over another mod, right? And the other mod already has Abigail_Spirit instead of Abigail. So, if I'm just copy/pasting the Abigail_Flower prefab and the prefab normally targets the Abigail prefab, should I change it to target Abigail_Spirit because the mod uses that file instead? And does it stay as local_prefabs = Abigail or Abigail_Spirit, or change to just prefabs = etc? Sorry, I'm way under my head here. Thanks heaps for your time though, it's been a great help. I don't have much experience in that but if you are modding a mod you could copy-paste the entire mod in a different folder and change the files that you want, in this case you would change the abigail_spirit if that's the only abigail in the mod since I expect that it would overwrite the normal files to do whatever the mod does. Link to comment Share on other sites More sharing options...
InaneDugong Posted March 31, 2014 Author Share Posted March 31, 2014 I don't have much experience in that but if you are modding a mod you could copy-paste the entire mod in a different folder and change the files that you want, in this case you would change the abigail_spirit if that's the only abigail in the mod since I expect that it would overwrite the normal files to do whatever the mod does. Hmm, damn. I guess that work-around will have to do, aye. That or a senior person actually opens this thread at all. ;-; Alright, will go through the files in the mod and make sure nothing is specifically pointing at Abigail_Spirit and then just copy it all to a new folder and revert the names. Thanks heaps for the help. Really appreciated, Skorp. <3 Link to comment Share on other sites More sharing options...
Heavenfall Posted April 1, 2014 Share Posted April 1, 2014 Take a step back and tell us what you're trying to do and why. Doesn't have to be more than two sentences. Then we can hint at the best way to proceed. Link to comment Share on other sites More sharing options...
InaneDugong Posted April 1, 2014 Author Share Posted April 1, 2014 Take a step back and tell us what you're trying to do and why. Doesn't have to be more than two sentences. Then we can hint at the best way to proceed. I am trying to change the Sanity Cost for summoning Abigail (from 50 to 30). I believe I've found the line in Abigail_Flower prefab. Thing is, I'm placing this over a pre-existing mod. The mod has its own Abigail prefab and it's renamed as Abigail_Spirit. I have copied and pasted the Abigail_Flower prefab to the mod folder into the prefabs subfolder. I have changed the line from -TUNING.SANITY_HUGE to -TUNING.SANITY_MEDLARGE. The Abigail_Flower LUA begins with Assets and then mentions the local prefab = Abigail. The mod I'm adding to already has its own Abigail prefab (Abigail_Spirit), so I'm not sure what to do here. And, yeah, this is where I'm at. Everything else is littered around the place - not that I'm being very helpful here. I was hoping the answer would be simple. :< Link to comment Share on other sites More sharing options...
Heavenfall Posted April 1, 2014 Share Posted April 1, 2014 If the mod abigail uses the same flower and doesn't overwrite it, you can just copy the whole flower file into a mod /scripts/prefabs/ and the game will load that file instead of your standard file. Just alter the sanity value once you've copied the file over. Link to comment Share on other sites More sharing options...
InaneDugong Posted April 1, 2014 Author Share Posted April 1, 2014 Oh, okay. Will try that. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.