[Help] Contextual pop clothes to building on tile

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Dëzaël

Captain
13 Badges
Nov 12, 2016
494
21
  • Stellaris: Synthetic Dawn
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
Hi!

I'm currently fiddling with a custom asset selector for a portraits set. Everything works fine except I'm trying to get pops to wear specific clothes depending the building they work.

My code in the pop scope is as follows :
Code:
random = {
            trigger = {
                OR = {
                    tile = { has_building = building_mining_network_1 }
                    tile = { has_building = building_mining_network_2 }
                    tile = { has_building = building_mining_network_3 }
                    tile = { has_building = building_mining_network_4 }
                    tile = { has_building = building_mining_network_5 }
                    tile = { has_building = building_mineral_processing_plant_1 }
                    tile = { has_building = building_mineral_processing_plant_2 }
                    tile = { has_building = building_slave_processing }
                    tile = { has_building = building_great_pyramid }
                    tile = { has_building = building_toy_factory }
                    tile = { has_building = building_primitive_farm }
                    tile = { has_building = building_primitive_factory }
                    tile = { has_building = building_odd_factory }
                    tile = { has_building = building_hab_astro_mining_facility }
                    tile = { has_building = building_worm_mine }
                }
            }
            list = {
                "gfx/models/portraits/sapiens/sapiens_male_clothes_pop_mineral.dds"
            }
        }

I have several sections like this for every building and role clothes. On empire initialization upon starting a game, pops get clothes assigned properly. The result I get when I move a pop is it takes the clothes corresponding to the tile it originates from, when it should take those matching the destination tile. If I drag a pop and drop it on top of another to swap them, both will take the clothes matching the tile I first took the pop from.

I am guessing "tile" in the code is refering to the tile where the action originated from, and is the same for both pops, being part of the same "action scope" so to say.

The question are :
- is there a way to refer to the destination tile instead of the originating tile?
- is there a way to differentiate the swapped pops' destination tiles?
both in the asset selector.

I also thought of using the on_pop_moved action and making some custom event to fire, but I have no clue if it's even possible to trigger an asset selection from outside the asset selector.

I found nothing useful on the wiki or google on this. Hoping some portrait guru can help me!