Shop strangeness

I was working on a little hat mod, and noticed something I don't quite understand.

I wanted my first hat to be available without any tech pre-reqs, so did not give it any. In game though, it would not appear in the shop, though it was available for designing units. If I assign a tech-prereq to it, with no other changes at all, upon gaining that tech it DOES appear in the shop.

 

Then I realised, I'd based it on the padded helm, and that never appears in the shop either, but is available for unit design, but for the life of me I can't see why. The gnarled club has no tech pre-reqs and turns up in the shop just fine.

 

Can someone explain to me exactly what's happening here?

5,025 views 7 replies
Reply #1 Top

Could you post your code? Would make things easier ^^

Reply #2 Top

Ah, it doesn't really have anything to do with my own code.

Just look at CoreArmor.xml . The padded helm is the very first item on the list. It doesn't appear in the shop. The gnarled club is in coreweapons.xml, and does appear in the shop. Neither have tech pre-reqs. What I'm asking is, why are they behaving differently?

Reply #3 Top

Item can be unlocked in a shop via 2 methods...

1. Unlocked in an improvement via the <UnlocksShopItem> tag.

or

2. Unlocked via a technology that the ITEM SHOP'S OWNER has researched.

Right now, there's really no way for the item itself to identify which shops it will show up in, but I'll add it to the modding ToDo list!

Reply #4 Top

Hmm ok that usefull thanks ^^

 

However why does the club show up and not the cap oO? Bugs me really. I just tinkered around with it and realized the OPs problem myself, weird.

Reply #5 Top

Ahh, I see! Thankyou muchly!

K_CityHubs.xml has this going on

 

<!--******************************-->
    <!-- Settlement, Level 1: Outpost -->
    <!--******************************-->
    <ImprovementType InternalName="Outpost">

<!-- Item Shop - Base Items -->
        <UnlocksShopItem>SaltedPork</UnlocksShopItem>
        <UnlocksShopItem>GnarledClub</UnlocksShopItem>
        <UnlocksShopItem>Staff</UnlocksShopItem>
        <UnlocksShopItem>TravelingBoots</UnlocksShopItem>
        <UnlocksShopItem>Recruiting_Shirt</UnlocksShopItem>

So, out of all pre-reqless items, only those will appear. Anything else needs either to be assigned pre-reqs, or have a similar line added to an improvement. So given I don't want to be fiddling with existing buildings, I'm best off just not trying to make items without pre-reqs.

 

It's a bit weird that the padded set (apart from two bits that do have pre-reqs) doesn't appear in the shop. Maybe that should be something to look at.

Quoting BoogieBac, reply 3


Right now, there's really no way for the item itself to identify which shops it will show up in, but I'll add it to the modding ToDo list!
End of BoogieBac's quote

I hope you can make that change, as it would be much cleaner for modding to be able to just set it up within the item itself, rather than also having to tamper with other files.

Reply #6 Top

The basic items available in the shop can be modded into the cityhub files. Edit: Beaten.

Reply #7 Top

Quoting Arkenor, reply 5
Ahh, I see! Thankyou muchly!

K_CityHubs.xml has this going on

 


<!--******************************-->
    <!-- Settlement, Level 1: Outpost -->
    <!--******************************-->
    <ImprovementType InternalName="Outpost">

<!-- Item Shop - Base Items -->
        <UnlocksShopItem>SaltedPork</UnlocksShopItem>
        <UnlocksShopItem>GnarledClub</UnlocksShopItem>
        <UnlocksShopItem>Staff</UnlocksShopItem>
        <UnlocksShopItem>TravelingBoots</UnlocksShopItem>
        <UnlocksShopItem>Recruiting_Shirt</UnlocksShopItem>


So, out of all pre-reqless items, only those will appear. Anything else needs either to be assigned pre-reqs, or have a similar line added to an improvement. So given I don't want to be fiddling with existing buildings, I'm best off just not trying to make items without pre-reqs.
End of Arkenor's quote

Hmm thats interesting woudln`t have thought that ^^"