Shrinking the resource bar spacing

Hello! I’m in the process of adding a new resource, and it’s actually going pretty well(Steam workshop, the ‘Bear’ mod). One small thing I’ve run in to is I’d like to decrease the spacing between the icons and amounts, so that I can squeeze in another icon on that row. I know it’s a horizontal layout group, but those things tend to be fickle and without being able to play around with it in unity, I’m not entirely sure what property I need to adjust where to accomplish what I’m after.

Another user was kind enough to show the ‘overlap’ that happens when I add my new resource: Joxi (28 kb) закачан 24 августа 2021 г. Joxi

Any pointers on what I can patch in order to fit things in would be very appreciated!

Hi!
Adding a new resource can be difficult to implement since the game expects enums. You can cast your own int values to (Resource) though, so it’s doable.

Check the storage panel in the top left, it’s to the right of the equipment button. This panel is meant to handle more resources when the space in the top bar runs out.

If you still want to use the top bar itself, I recommend testing it out in your own Unity Project first, find out which properties change what in the HorizontalLayoutGroup and once you’ve figured it out, apply your knowledge to Founders’ Fortune.

Thanks, I found it! Had to set the spacing on the horizontal layout group to a negative number on the child elements, as well as the bar itself. -2 worked out pretty darn well.

Adding a resource has been a challenge, I didn’t even think of using the storage! I may try that for some future additions. I’ve got a new building that produces the new resource, and new buildings that require it to be built. Having a good amount of fun modding the game, which was fantastic to start with. I’m torn between trying to add new traits or trying to add a new animal to the game next!

1 Like

On to another question, and I don’t know if you can really offer much insight here, but I thought I’d ask:

I’ve added a new animal, I’ve got it spawning in-game and everything, however he won’t move. I suspect this may have something to do with my ragdoll setup, because if I go in to the debugging tools (human management->active human->human AI->ragdoll) and toggle the ragdoll active it will instantly toggle it back off but the animal will move for an action. Once it has completed that action, it goes back to ‘stuck’ until I use the debugger to flicker the ragdoll enabled again.

It seems to be getting stuck somewhere on enabling the navmeshagent. Decompiling the assets doesn’t really give many clues, since I can’t see how the prefabs are setup very clearly. Any hints would be appreciated, otherwise I’ll keep plugging away at it.

I can’t actually help you with anything, but your mod sounds interesting. I do hope you’ll make it available here as well, or at the very least post a couple of screenshots, when it’s done :smiley:

Thanks! I think I’ve actually traced the issue a bit further to the animation state. I don’t have the animation state behaviours set up properly on my creature, so it isn’t detecting the appropriate ‘default animation state’. Working through that now!

Sounds good. I haven’t dared try to model an animal yet, or fiddle with animations :slight_smile:

Ah didn’t see this post before helping you on Discord. If it helps I can provide the animator controller asset and / or screenshots of it when I’m back at work.

Thank you so much for your help! Ultimately, I had to patch around the code rather than the get asset setup properly, due to dll inclusion issues. The end result works, although the end result is that the animation transitions aren’t quite as nice and smooth as the built in ones. However, I now have some bears:

2 Likes

Oh they look adorable! Are they dangerous? :stuck_out_tongue:

Very!

I’m still deciding which direction to take them. My intent is that they are an animal that, once tamed, will fight hostile factions like a guard dog(rather than produce any resources). I’m thinking of making it one of the quests to have one appear and be tameable.

Sounds good, though I’d hate to see them hurt in the fighting! :smiley:

In the end, I’ve got it set up so that only one bear spawns on a new map. They’re very tanky, although they aren’t any more aggressive than other animals(taking 1/4th damage, and doing 2x damage).

However, during the winter, bears will forage 1-3 food a couple times per day(potatoes, tomatoes, or apples). Making them a cute, and useful, addition to new colonies!

2 Likes