nicknightyx Posted March 9, 2018 Share Posted March 9, 2018 (edited) Hi there, I wrote this function "onkill" and it will be listened inst:ListenForEvent("killed", onkill). It works well for any other creatures but nightmare creatures, when I kill a crawling bug or a terror beak it doesn't give me any feedback. Would somebody please check my code or tell me what's special about killing nightmare creatures? Thanks!! Spoiler Part of [character.lua] local function onkill(inst, data) local victim = data.victim if victim.components.combat then if victim:HasTag("dragonfly") then inst.point = inst.point + 14682 inst.class_S = inst.class_S + 1 inst.components.talker:Say("Point +14682 \n Badge S +1") elseif victim:HasTag ("werepig") then inst.point = inst.point + 34 inst.gcp_2 = inst.gcp_2 + 1 inst.components.talker:Say("Point +34\n"..inst.gcp_2) elseif victim:HasTag("koalefant") then inst.point = inst.point + 33 inst.class_D = inst.class_D + 1 inst.components.talker:Say("Point +33 \n Badge D +1") elseif victim:HasTag("guard") then inst.point = inst.point + 30 inst.components.talker:Say("Point +30") elseif victim:HasTag("nightmarecreature") then inst.point = inst.point + 27 inst.gcp_2 = inst.gcp_2 + 1 inst.components.talker:Say("Point +27\n"..inst.gcp_2) end end end local master_postinit = function(inst) inst:ListenForEvent("killed", onkill) return inst end Here is the character file and the whole mod if you want to test. XD hisoka.lua hisoka.rar Edited March 10, 2018 by nicknightyx Link to comment https://forums.kleientertainment.com/forums/topic/88486-tag-nightmarecreatures-doesnt-work-for-nightmare-creatures/ Share on other sites More sharing options...
nicknightyx Posted March 10, 2018 Author Share Posted March 10, 2018 bump Link to comment https://forums.kleientertainment.com/forums/topic/88486-tag-nightmarecreatures-doesnt-work-for-nightmare-creatures/#findComment-1013542 Share on other sites More sharing options...
CarlZalph Posted March 10, 2018 Share Posted March 10, 2018 @nicknightyx Nightmare creatures are the ones that are visible even when sane. Shadow creatures are the ones that come when you're no longer sane enough. If you want to apply an effect regardless of which, then check for tags "nightmarecreature" and "shadowcreature". You can discriminate between the two, of course. Link to comment https://forums.kleientertainment.com/forums/topic/88486-tag-nightmarecreatures-doesnt-work-for-nightmare-creatures/#findComment-1013579 Share on other sites More sharing options...
nicknightyx Posted March 11, 2018 Author Share Posted March 11, 2018 @CarlZalph Wow it worked! Thanks a bunch! Link to comment https://forums.kleientertainment.com/forums/topic/88486-tag-nightmarecreatures-doesnt-work-for-nightmare-creatures/#findComment-1013604 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