Sign in to follow this  
notfound404

[Mod help] Critter sensor

Recommended Posts

notfound404    0

hi !

I have just started a mod, following the unofficial guide and managed to create an "hello world" mod. But now i don't know how to implement what i want to do.

I am trying to modify the critter sensor (logiccrittercountsensor) to be able to select critter's type to count, like what you do with the critter drop-off (creaturedeliverypoint).

However, i'am completely lost, and I have difficulties finding a way to do what i want.

Could someone indicate me what file/methods I should look and modify ?

Share this post


Link to post
Share on other sites
pether    1420

spunds like you will need to make your own GUI, I hate that part so I won't be helpful there

But I suggest making it with little steps - start with making sensor that only detects eg. Hatches and when that works try to make Hatches a variable you can control. 

For more help, I'd suggest visiting modding discord, there are people who will know how to make the GUI once everything else in your mod works

  • Like 1

Share this post


Link to post
Share on other sites
RomenH    21

The critter drop-off uses the `TreeFilterable` component with an `acceptedTags` list that has all of the tags for critters.

When a building has the `TreeFilterable` component, the side screen will automatically show up and allow you to pick from that list of tags. So I think that's a good start. You do not need to make your own UI if you can make that list of checkboxes work for your sensor idea.

  • Like 3

Share this post


Link to post
Share on other sites
notfound404    0

Thanks for the help ! I had a lot of things going on, so I just started working on this stuff.

Thanks to your advice i managed to get an almost working prototype using TreeFilterable. However I encountered some difficulties :

I'dd like my sensor to have CritterSensorSideScreen (SideScreenContent). So i copied it, modifying targetSensor. How can i add it to my sensor's sidescreen ? It looks like PLib.UI should have the things I need, but i don't know how it works.

Edited by notfound404

Share this post


Link to post
Share on other sites

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
Sign in to follow this