DragonFireBrenn Posted January 7, 2019 Share Posted January 7, 2019 hello! first time making a mod, and I am trying to make a custom character that bees will not attack. this link is the only thread I could find on the subject, but either the files for bees are written differently, or the way the code is written has changed. I have added the tag "beefriend" to the character as shown below; I don't know if it is in the right place local function onbecamehuman(inst) inst.components.locomotor:SetExternalSpeedMultiplier(inst, "alyx_speed_mod", 2) inst:AddTag("beefriend") here is the code that I think dictates what the bees attack local function KillerRetarget(inst) return FindEntity(inst, SpringCombatMod(8), function(guy) return inst.components.combat:CanTarget(guy) end, { "_combat", "_health" }, { "insect", "INLIMBO" }, { "character", "animal", "monster" }) end local function SpringBeeRetarget(inst) return TheWorld.state.isspring and FindEntity(inst, 4, function(guy) return inst.components.combat:CanTarget(guy) end, { "_combat", "_health" }, { "insect", "INLIMBO" }, { "character", "animal", "monster" }) or nil end if anyone knows where and how to add the tag to the code, and where to put that code in the modmain.lua , that would help me a lot. thank you for reading! Link to comment Share on other sites More sharing options...
Norfeder Posted January 7, 2019 Share Posted January 7, 2019 (edited) inst:AddTag("insect") It should make killerbees and spring bees neutral to your character. They will still fight back if you attack them first however. Edited January 7, 2019 by Norfeder Link to comment Share on other sites More sharing options...
Ultroman Posted January 7, 2019 Share Posted January 7, 2019 (edited) True. That'll also make mosquitos and wasps neutral to the character, though. It'll also change the impact sound when not wearing armor, because his target-type will be determined as "insect_" instead of "flesh_". If those things are acceptable, then this is definitely the easiest and least intrusive solution. Edited January 7, 2019 by Ultroman Link to comment Share on other sites More sharing options...
DragonFireBrenn Posted January 7, 2019 Author Share Posted January 7, 2019 so to clarify, I should just add the tag "insect" to the character. thanks to both of you, i will try this out. Link to comment Share on other sites More sharing options...
Ultroman Posted January 7, 2019 Share Posted January 7, 2019 Yes, if you accept the impacts I described in my last post. Link to comment Share on other sites More sharing options...
DragonFireBrenn Posted January 8, 2019 Author Share Posted January 8, 2019 I tried it and it worked! thank you both so much! now all that's left to do is try and decompile willows /anim files to use as a template... for the 10th time thanks again, -brenn 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