• 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.

Soulbuster

Corporal
14 Badges
Jun 28, 2016
43
44
  • Cities: Skylines
  • Magicka 2
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Stellaris: Synthetic Dawn
  • Cities: Skylines - Green Cities
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Prison Architect
  • Stellaris
so I don't know much about lua scripts and was wondering if there is a way to count objects.

something along the lines of : "for each object in objects" or an maybe the devs have created inbuilt method like "object.count()".

I'm trying to get naval capacity to increase from something other than space ports or population.
I don't see any modifiers for this except for the naval_capacity_add % increment. while this would suffice for the most part but it's not pretty and for my purposed it would be kinda messy - I'd rather find a way to have a fixed amount :/

Would really appreciate the info ^_^
 

Foraven

Major
17 Badges
May 14, 2016
544
168
  • Sword of the Stars II
  • Stellaris: Humanoids Species Pack
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
Things you can actually count :

count_owned_pops - Counts the amount of pops which fill a requirement and compare it to a number
count_ships - compares number of ships in a fleet that matches the [limit = {..}]
count_owned_ships
count_pop_factions - Counts the amount of pop factions which fill a requirement and compare it to a number
count_deposits - counts number of deposits of given type on planet or tile
count_tech_options - Compares the amount of tech options a country has against a value, can specify which area
count_armies - Counts the amount of armies which fill a requirement and compare it to a number
count_war_participants -
count_potential_war_participants -
num_fleets - checks if a country has the said number of fleets
num_ships - checks if a country has the said number of ships
num_ethics - compares the number of ethics with a value
num_traits - compares the number of traits with a value
num_killed_ships - Compares how many ships scope country has killed of [target]
num_taken_planets - Compares how many planets scope country has taken from [target]
num_communications - compares the number of planets on a planet with a value
num_rare_techs - Compares number of researched rare technologies
num_free_spaceport_module_slots - Compares the parameter to the amount of free spaceport module slot
num_spaceport_modules - Compares the parameter to the
num_energy - compares the number of energy on a planet with a value
num_armies - checks if a country has the said number of armies
num_war_demands - compares the number of war demands with a value
max_naval_capacity - Compares a countries max naval capacity
used_naval_capacity_integer - Compares a countries used naval capacity
used_naval_capacity_percent - Compares a countries percent used naval capacity. values 0-1
war_begun_num_fleets_gone_mia - Checks how many fleets went MIA due to the war declaration
war_begun_num_wormhole_stations_destroyed - Checks how many fleets went MIA due to the war declaration
num_owned_planets - compares the number of owned planets in a country with a value


You can do = > <, like count_ships > 8 or count_deposits = 5.

There should be a few thing on that list you can use...