Houdini Posted May 23, 2015 Share Posted May 23, 2015 Sorry if this is easily answered, but this has been confusing me all day. My end goal is to make frogs not target my own character, but nobody else's. Obviously this isn't a particularly groundbreaking concept, so I went around the forums trying to get some information. Pretty much everybody agreed on what to do, so I did it too. However, I continue getting errors.inst:AddTag("frogfriend")done in the prefab file, adds the tag to my character, whatever. not a problem.local function retargetfn(inst) if not inst.components.health:IsDead() and not inst.components.sleeper:IsAsleep() then return FindEntity(inst, TUNING.FROG_TARGET_DIST, function(guy) if not guy.components.health:IsDead() then return guy.components.inventory ~= nil end end, {"_combat","_health"},-- see entityreplica.lua {"frogfriend"} ) endendAddPrefabPostInit("frog", function(inst) if GLOBAL.TheWorld.ismastersim then inst.components.combat:SetRetargetFunction(3, retargetfn) endend)copied straight from the frog.lua file and put in modmain, all I did was add the tag "frogfriend" to the list of tags to never target. My error message always comes up along the lines of "attempt to call global 'FindEntity' (a nil value)... in (field) targetfn". I figure it has something to do with the "guy.components.inventory ~= nil" line, but im not sure since that was in the original frog code. I'd appreciate the help! ^^ Link to comment https://forums.kleientertainment.com/forums/topic/54323-making-an-aggressive-mob-passive-help/ Share on other sites More sharing options...
Houdini Posted May 26, 2015 Author Share Posted May 26, 2015 Turns out, all i needed was to slap GLOBAL. in front of FindEntity, and that fixed everything *shrug* Link to comment https://forums.kleientertainment.com/forums/topic/54323-making-an-aggressive-mob-passive-help/#findComment-640972 Share on other sites More sharing options...
svanzscape Posted June 16, 2015 Share Posted June 16, 2015 I've got no clue how mods work, is it possible for me to add this? Link to comment https://forums.kleientertainment.com/forums/topic/54323-making-an-aggressive-mob-passive-help/#findComment-647572 Share on other sites More sharing options...
Seiai Posted June 16, 2015 Share Posted June 16, 2015 @svanzscape, only if u plan on changing the "no clue how mods work" part. and there's a lot of tutorials for that one. http://forums.kleientertainment.com/topic/50811-guide-modding-practices-series-index/ Link to comment https://forums.kleientertainment.com/forums/topic/54323-making-an-aggressive-mob-passive-help/#findComment-647609 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