def name_planets(system): planet_number = 1 # iterate over all planets in the system for planet in fo.sys_get_planets(system): # use different naming methods for "normal" planets and asteroid belts if fo.planet_get_type(planet) == fo.planetType.asteroids: # get localized text from stringtable name = fo.user_string("PL_ASTEROID_BELT_OF_SYSTEM") # %1% parameter in the localized string is the system name name = name.replace("%1%", fo.get_name(system)) else: # set name to system name + planet number as roman number... name = fo.get_name(system) + " " + fo.roman_number(planet_number) # ...and increase planet number planet_number = planet_number + 1 # do the actual renaming fo.set_name(planet, name)
def get_name_list(name_list): return fo.user_string(name_list).splitlines()