Jump to content

Recommended Posts

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 :wilson_ecstatic:

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 by NPCMaxwell
  • Like 2
  • Wavey 1

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!!!

  • Happy Hazard 1
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. :distracted:

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.

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" })
  • Like 1
  • Thanks 1
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 :D

  • Like 1
  • GL Happy 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...