ghost910 Posted February 9, 2015 Share Posted February 9, 2015 [ Russian ] Я делаю мод FOREST MAIDEN и хочу чтобы только меня не боялись зайцы . Я сумел найти способ чтоб они не боялись ВСЕХ персонажей, но мне надо чтоб это работало только на определенного персонажа. И в связи с этим мне надо узнать можно ли это сделать, или сделать какой-нибуть уникальный предмет чтоб кролики не боялись персонажа. [ English ( translate google =) ) ] I do fashion FOREST MAIDEN and I want to just me not afraid hares. I managed to find a way not to be afraid of all the characters, but I need this to work only on a specific character. And in this regard, I have to see if you can do it, or make a unique item to realties rabbits were not afraid of the character. Link to comment https://forums.kleientertainment.com/forums/topic/50768-help-help-needed-for-sanity-perks/ Share on other sites More sharing options...
rezecib Posted February 9, 2015 Share Posted February 9, 2015 @ghost910, in the common_postinit:inst:RemoveTag("scarytoprey") Link to comment https://forums.kleientertainment.com/forums/topic/50768-help-help-needed-for-sanity-perks/#findComment-611488 Share on other sites More sharing options...
ghost910 Posted February 9, 2015 Author Share Posted February 9, 2015 @ghost910, in the common_postinit:inst:RemoveTag("scarytoprey")Then another question, how do the same and birds Link to comment https://forums.kleientertainment.com/forums/topic/50768-help-help-needed-for-sanity-perks/#findComment-611505 Share on other sites More sharing options...
SenL Posted February 10, 2015 Share Posted February 10, 2015 Interesting. You could just remove tag "scarytoprey" for rabbit.Thanks. For the birds, I'm not sure if it's possible since birdbrain lua says local function ShouldFlyAway(inst) local busy = inst.sg:HasStateTag("sleeping") or inst.sg:HasStateTag("busy") or inst.sg:HasStateTag("flying") if not busy then local threat = FindEntity(inst, 5, nil, nil, {'notarget'}, {'player', 'monster', 'scarytoprey'}) return threat ~= nil or TheWorld.state.isnight endend Looks like even if you remove "scarytoprey" tag, you still have "player" tag.Rezecib? Link to comment https://forums.kleientertainment.com/forums/topic/50768-help-help-needed-for-sanity-perks/#findComment-611800 Share on other sites More sharing options...
rezecib Posted February 10, 2015 Share Posted February 10, 2015 @SenL, Yeah, birds are harder. This was discussed before for another bird-themed character, but no good solution was found. Link to comment https://forums.kleientertainment.com/forums/topic/50768-help-help-needed-for-sanity-perks/#findComment-611811 Share on other sites More sharing options...
DarkXero Posted February 10, 2015 Share Posted February 10, 2015 How about in modmain.lua:local function RecheckForThreat(inst) local busy = inst.sg:HasStateTag("sleeping") or inst.sg:HasStateTag("busy") or inst.sg:HasStateTag("flying") if not busy then local threat = FindEntity(inst, 5, nil, nil, {'notarget', 'birdwhisperer'}, {'player', 'monster', 'scarytoprey'}) return threat ~= nil or TheWorld.state.isnight endendAddStategraphPostInit("bird", function(sg) local old = sg.events.flyaway.fn sg.events.flyaway.fn = function(inst) if RecheckForThreat(inst) then old(inst) end endend)If you don't want to edit the brain and override it, or scan the brain to superimpose and edit a node, I guess. And a:inst:AddTag("birdwhisperer")in your character. Link to comment https://forums.kleientertainment.com/forums/topic/50768-help-help-needed-for-sanity-perks/#findComment-611819 Share on other sites More sharing options...
ghost910 Posted February 10, 2015 Author Share Posted February 10, 2015 How about in modmain.lua:local function RecheckForThreat(inst) local busy = inst.sg:HasStateTag("sleeping") or inst.sg:HasStateTag("busy") or inst.sg:HasStateTag("flying") if not busy then local threat = FindEntity(inst, 5, nil, nil, {'notarget', 'birdwhisperer'}, {'player', 'monster', 'scarytoprey'}) return threat ~= nil or TheWorld.state.isnight endendAddStategraphPostInit("bird", function(sg) local old = sg.events.flyaway.fn sg.events.flyaway.fn = function(inst) if RecheckForThreat(inst) then old(inst) end endend)If you don't want to edit the brain and override it, or scan the brain to superimpose and edit a node, I guess. And a:inst:AddTag("birdwhisperer")in your character. YES YES YES YES. thanks for help me. Аnd thanks to all who took part in the discussion on this topic. I believe 100% that topic can be closed to answer, BECAUSE EVERTHING WORK Link to comment https://forums.kleientertainment.com/forums/topic/50768-help-help-needed-for-sanity-perks/#findComment-611824 Share on other sites More sharing options...
SenL Posted February 11, 2015 Share Posted February 11, 2015 Hm, I get "attempt to call global 'FindEntity' (a nil value)" ... Link to comment https://forums.kleientertainment.com/forums/topic/50768-help-help-needed-for-sanity-perks/#findComment-611955 Share on other sites More sharing options...
Jjmarco Posted February 11, 2015 Share Posted February 11, 2015 @SenL, try sticking a GLOBAL before FindEntity (and TheWorld). Link to comment https://forums.kleientertainment.com/forums/topic/50768-help-help-needed-for-sanity-perks/#findComment-612010 Share on other sites More sharing options...
SenL Posted February 11, 2015 Share Posted February 11, 2015 Yes it works.Thank you. Link to comment https://forums.kleientertainment.com/forums/topic/50768-help-help-needed-for-sanity-perks/#findComment-612033 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