Portal_In_Time Posted October 25, 2016 Share Posted October 25, 2016 Hey forum people. I'm sure you've heard this a thousand times, but I've been having troubles making a mod. It's meant to make it so that Spiders don't attack Abigail, and vice-versa, though both me and a friend can't figure out how to do this, and we've been trying for quite a while to no avail. Is there any way more talented/skilled people can help us out with this? Thank you. Link to comment https://forums.kleientertainment.com/forums/topic/71137-assistance-with-a-pacification-mod/ Share on other sites More sharing options...
. . . Posted October 25, 2016 Share Posted October 25, 2016 AddPrefabPostInit("spider", function(inst) if not GLOBAL.TheWorld.ismastersim then return end local OldCanTarget = inst.replica.combat.CanTarget function inst.replica.combat:CanTarget(target, ...) return OldCanTarget(self, target, ...) and not ( target:HasTag("abigail") ) end end) Put this code in your modmain.lua & I think it should make it that Spiders can never attack Abigail. If you want the same for Abigail to never attack spiders you would do this in your modmain.lua also. AddPrefabPostInit("abigail", function(inst) if not GLOBAL.TheWorld.ismastersim then return end local OldCanTarget = inst.replica.combat.CanTarget function inst.replica.combat:CanTarget(target, ...) return OldCanTarget(self, target, ...) and not ( target:HasTag("spider") and target:HasTag("smallcreature") )--Needs both tags so Abigail fights SpiderQueens end end) Link to comment https://forums.kleientertainment.com/forums/topic/71137-assistance-with-a-pacification-mod/#findComment-829442 Share on other sites More sharing options...
Serpens Posted October 25, 2016 Share Posted October 25, 2016 (edited) 1 hour ago, SuperDavid said: AddPrefabPostInit("spider", function(inst) if not GLOBAL.TheWorld.ismastersim then return end local OldCanTarget = inst.replica.combat.CanTarget function inst.replica.combat:CanTarget(target, ...) return OldCanTarget(self, target, ...) and not ( target:HasTag("abigail") ) end end) Put this code in your modmain.lua & I think it should make it that Spiders can never attack Abigail. If you want the same for Abigail to never attack spiders you would do this in your modmain.lua also. AddPrefabPostInit("abigail", function(inst) if not GLOBAL.TheWorld.ismastersim then return end local OldCanTarget = inst.replica.combat.CanTarget function inst.replica.combat:CanTarget(target, ...) return OldCanTarget(self, target, ...) and not ( target:HasTag("spider") and target:HasTag("smallcreature") )--Needs both tags so Abigail fights SpiderQueens end end) looks okay, but I'm not sure if it is enough to mod the "replica" like you did... maybe you also have to mod the normal component. I would say try it out on a world without and a world with caves Edited October 25, 2016 by Serpens Link to comment https://forums.kleientertainment.com/forums/topic/71137-assistance-with-a-pacification-mod/#findComment-829459 Share on other sites More sharing options...
Maris Posted October 26, 2016 Share Posted October 26, 2016 (edited) I like the idea. So I made the mod and tested it. You can publish it. http://pastebin.com/DDYW7gey Edited October 26, 2016 by Maris Link to comment https://forums.kleientertainment.com/forums/topic/71137-assistance-with-a-pacification-mod/#findComment-829503 Share on other sites More sharing options...
Serpens Posted October 26, 2016 Share Posted October 26, 2016 great whoever wants to upload this, please also upload a version, where spiders do not attack chester, if webber is the eyebone carrier (instead of checking for "weberr" better check for "monster" or simular, so it will be compatible to mod characters with same skill At best also compatible to "Personal Chester" mod Link to comment https://forums.kleientertainment.com/forums/topic/71137-assistance-with-a-pacification-mod/#findComment-829689 Share on other sites More sharing options...
Maris Posted October 27, 2016 Share Posted October 27, 2016 (edited) Actually spiders won't attack other spiders with this mod even if Webber is the master. It's some kind of issue. Someone can improve the script by making two groups of creatures where creatures from one group are peaceful to creatures from other group but they aren't peaceful to each other if in the same group. Edited October 27, 2016 by Maris Link to comment https://forums.kleientertainment.com/forums/topic/71137-assistance-with-a-pacification-mod/#findComment-829820 Share on other sites More sharing options...
Portal_In_Time Posted October 28, 2016 Author Share Posted October 28, 2016 On 10/25/2016 at 6:25 PM, Maris said: I like the idea. So I made the mod and tested it. You can publish it. http://pastebin.com/DDYW7gey Oh man, thank you so much! I'll be sure to give you full credit for this awesome mod. Now Webber and Wendy can finally be played in the same world! Link to comment https://forums.kleientertainment.com/forums/topic/71137-assistance-with-a-pacification-mod/#findComment-830280 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