Whix Posted December 23, 2014 Share Posted December 23, 2014 Hey guys, trying to make a character mod and i was wondering how i would go about making it so that monsters/creatures in the game do not attack unless provoked while it's raining only. Not sure if there's a way but if there is could anyone lend me a hand?Thanks for reading. Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/ Share on other sites More sharing options...
Enmity Posted December 23, 2014 Share Posted December 23, 2014 Honestly I think you have to approach this by Modding all the Monsters/Creatures Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-591946 Share on other sites More sharing options...
BrotatoTips Posted December 23, 2014 Share Posted December 23, 2014 im sure some event handler to manage tags would do better than modding all creatures. Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-591953 Share on other sites More sharing options...
Whix Posted December 24, 2014 Author Share Posted December 24, 2014 Alright been looking through the already existing code, figuring out event handlers and all that and i think that affecting the stategraphs is probably the best way of at least making it so creatures will not be hostile towards my character but the issue i am having now is trying to figure out how to change the state of say the spider from investigate to something that isn't investigate.(i could be completely wrong about how i am going about it but this is just what i have seen so far from looking through a couple other forums on here and what the scripts look like) Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-592027 Share on other sites More sharing options...
BrotatoTips Posted December 24, 2014 Share Posted December 24, 2014 triggercreep = false on if something. using the event handler on that would work i think. and also you could use it to apply certain tags such as spiderwhisperer (pigs attack) or giving the effect of spiderhat at a certain level of wetness. i am unfamiliar on how to code events and stategraphs, but i assume this is useful info. Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-592032 Share on other sites More sharing options...
Whix Posted December 24, 2014 Author Share Posted December 24, 2014 An idea just hit me while trying to figure this problem out. I noticed the tags that were used in the scripts and thought couldn't i add those tags to my character so the hostile mobs see me as one of them and don't attack but on attack the tag changes to the default character tag i guess?An idea just hit me while trying to figure this problem out. I noticed the tags that were used in the scripts and thought couldn't i add those tags to my character so the hostile mobs see me as one of them and don't attack but on attack the tag changes to the default character tag i guess? Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-592048 Share on other sites More sharing options...
Whix Posted December 24, 2014 Author Share Posted December 24, 2014 I think i have discovered how to do this, it is a million times more simple than what i was thinking, simply by looking through the creatures files and looking at what tags they have, taking those tags and adding it to my character makes him "invisible" to the monsters constantly. The next challenge making this only happen when it's NOT raining. Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-592080 Share on other sites More sharing options...
BrotatoTips Posted December 24, 2014 Share Posted December 24, 2014 pretty sweet. what sort of tags were there? Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-592083 Share on other sites More sharing options...
Whix Posted December 24, 2014 Author Share Posted December 24, 2014 (edited) all the tags:inst:AddTag("ghost")inst:AddTag("monster") inst:AddTag("spider") inst:AddTag("insect") inst:AddTag("smallcreature") inst:AddTag("hound") inst:AddTag("knight")inst:AddTag("chess") inst:AddTag("tallbird") inst:AddTag("animal")inst:AddTag("largecreature") inst:AddTag("spiderqueen") inst:AddTag("WORM_DANGER") inst:AddTag("epic") inst:AddTag("hostile") inst:AddTag("bearger") inst:AddTag("largecreature") inst:AddTag("beefalo") inst:AddTag("deerclops") inst:AddTag("dragonfly") inst:AddTag("frog") inst:AddTag("Goose") inst:AddTag("mosquito") inst:AddTag("guard")inst:AddTag("werepig") inst:AddTag("bee")Well that's most of them, i'm sure i am missing many. Also i need to find a way to stop my character from running at anything (and fix conflicts) if seems like certain monsters like to automatically attack others Edited December 24, 2014 by Whix Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-592085 Share on other sites More sharing options...
Whix Posted December 24, 2014 Author Share Posted December 24, 2014 Alright now that i got that part sorted out now i am trying to remove those tags when it rains and i know the way i have done it is completely wrong. Basically what i have done is i found frograin and the line "inst:ListenForEvent "rainstart", function() and i have that but no idea where i should put it to make it work on my character script and how to adapt it so that it works for the tags i have added. Any tips on where i should be looking to put it? Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-592108 Share on other sites More sharing options...
Whix Posted December 24, 2014 Author Share Posted December 24, 2014 Don't worry i have it all working now! At long last it's working how i have wanted it to perfectly, you were very helpful thank you Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-592114 Share on other sites More sharing options...
Mobbstar Posted December 24, 2014 Share Posted December 24, 2014 (edited) Are pigmen really neutral that way?! Also epic tag may screw up your fight music. EDIT: from combat.lua, may be interesting alternatives (less mad-hack ): in retargetfn:116- newtarget:HasTag("notarget") in validtarget:229- or (target:HasTag("shadow") and not self.inst.components.sanity) in canbeattacked:749- if self.canbeattackedfn then750- can_be_attacked = self.canbeattackedfn(self.inst, attacker)751-end(my personal recommendation, as you could implement the rain factor at the same time) Edited December 24, 2014 by Mobbstar Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-592171 Share on other sites More sharing options...
Whix Posted December 26, 2014 Author Share Posted December 26, 2014 (edited) Yea the normal pigmen are neutral until provoked, even to each other they can fight. I had a look in there and that looks like it could be another way of doing it, but for me i simply gave my character certain tags that allows him to be "invisible" to the other creatures and then at certain times (when raining) simply take away those tags. Edit: actually i tried the ("notarget") tag and that is actually way better than what i was doing haha, i had them all written out but that actually is all of them into one and fixed the bug of my character randomly running up to another creature saying "go for the eyes" so thank you for finding that. Edited December 26, 2014 by Whix Link to comment https://forums.kleientertainment.com/forums/topic/47414-codeing-help/#findComment-592825 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