NPCMaxwell Posted November 18, 2024 Share Posted November 18, 2024 (edited) I have made a rather simple function in my custom Maxwell‘s prefab that makes him do a „stomping“ animation (used from onemanband) when standing near a flower and laugh at the flower in a villanous way. The problem is that the behaviour will be triggered for ALL friendly flowers, including roses! While I only want Maxwell to stomp on normal good flowers but NOT on his girlfriend‘s roses I have tried everything from using the flower can tag flower must not tag (like being used for getting Maxwell to only react with his idle to codex umbra not other books) until saying prefab ~= „flower_rose“ etc but no option excludes them. I have even looked into flowers.lua and saw the roses are tagged with „thorny“ but also using this as exclusion doesn‘t seem to work. I had a TEMPORARY version of installing a pre-check that looks for roses, assigning them a different behaviour first and only allowing the stomping on flowers to happen when roses were not present around Maxwell, but this was back when I tried the approach via modmain with adding the function to his prefab after postinit, but this caused a lua error that froze a fellow Wilson in place whenever the timer to call the rose check would kick in. So I discarded the modmain version and tried a completely different approach via the character‘s prefab where I left the roses un-considered by now. Sadly I have deleted the old only-for-me working modmain version so I can‘t remember how I temporary managed to have the roses be excluded. Another approach to install a similar check in the character prefab failed because I FORGOT how I managed to make the game RECOGNIZE the search for roses in particular the first place. I just remember the code included something about the „thorny“ detail. Can maybe someone try out to get the game recognize roses in contrast to flowers by e.g. the console print function and let me know a way that I may then try to include in my code? The current flower stomping code is very messy and mostly a product of my half-asleep brain so I am rather intimidated to share it here for having someone to directly edit / review it. I rather want to see if there is some nudge in the right direction that I can try to apply myself first and if it either fails or negatively affects some Wilson again I would maybe return and ask again with more details of what it currently looks like ^^‘ *hides under bush hat* Edited November 18, 2024 by NPCMaxwell 2 1 Link to comment https://forums.kleientertainment.com/forums/topic/160716-how-to-excluded-roses-from-triggering-a-character%E2%80%98s-behaviour/ Share on other sites More sharing options...
JeMiChi Posted November 18, 2024 Share Posted November 18, 2024 Very rude of Maxwell to stomp on Charlie's roses indeed! I hope someone here knows how to teach him some manners - without making any innocent Wilson or other character crash for it... x'D Best of luck with your mod!!! 1 Link to comment https://forums.kleientertainment.com/forums/topic/160716-how-to-excluded-roses-from-triggering-a-character%E2%80%98s-behaviour/#findComment-1757566 Share on other sites More sharing options...
yanecc Posted November 19, 2024 Share Posted November 19, 2024 I think you can learn something from the behavior of the Bee Queen Crown, players will bow to other players wearing the crown and greet. Link to comment https://forums.kleientertainment.com/forums/topic/160716-how-to-excluded-roses-from-triggering-a-character%E2%80%98s-behaviour/#findComment-1757665 Share on other sites More sharing options...
NPCMaxwell Posted November 19, 2024 Author Share Posted November 19, 2024 1 hour ago, yanecc said: I think you can learn something from the behavior of the Bee Queen Crown, players will bow to other players wearing the crown and greet. I will probably look at it if you say so, but I am not sure if I will find a way in there to make the game recognize the difference between a rose and a normal flower. Link to comment https://forums.kleientertainment.com/forums/topic/160716-how-to-excluded-roses-from-triggering-a-character%E2%80%98s-behaviour/#findComment-1757669 Share on other sites More sharing options...
yanecc Posted November 19, 2024 Share Posted November 19, 2024 To look for nearby flowers but excluding roses, I think this should work FindEntity(inst, 2, nil, { "flower" }, { "thorny" }) ~= nil or add an extra check FindEntity(inst, 2, function(guy) return guy.scrapbook_anim ~= "rose" end, { "flower" }, { "thorny" }) 1 1 Link to comment https://forums.kleientertainment.com/forums/topic/160716-how-to-excluded-roses-from-triggering-a-character%E2%80%98s-behaviour/#findComment-1757673 Share on other sites More sharing options...
NPCMaxwell Posted November 19, 2024 Author Share Posted November 19, 2024 12 hours ago, yanecc said: To look for nearby flowers but excluding roses, I think this should work FindEntity(inst, 2, nil, { "flower" }, { "thorny" }) ~= nil or add an extra check FindEntity(inst, 2, function(guy) return guy.scrapbook_anim ~= "rose" end, { "flower" }, { "thorny" }) Thank you!!! The first version worked perfectly, to tell the game to check for roses and make Maxwell leave them alone so I didn't need to try the second version. Also Wilson does not mind Maxwell's quirky behaviour now 1 1 Link to comment https://forums.kleientertainment.com/forums/topic/160716-how-to-excluded-roses-from-triggering-a-character%E2%80%98s-behaviour/#findComment-1757741 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