City.getWorkers ([type], [level])
Returns the number of industrial or commercial workers in your city. "type" is optional and is used to select which kind of worker you want to count (commercial, industrial). If "type" is left blank, it returns the total number of workers in the city. "level" is also optional and is used to select which level of worker you want to count (0, 1, 2). If "level" is left blank, workers of all levels will be counted.
City.getBuildingsofType (type, [level])
Returns the number of buildings of a specified type. "type" is used to select which building type you want to count (park, health, residential, etc). "level" is optional and is used to select which building level you want to count if the building type is "residential", "commercial", or "industrial" (0, 1, 2)
City.getIncome ()
Returns the current income of the city.
City.getHappiness ([type])
Returns a number between 0 and 1 that reflect the happiness level of your city. "type" is optional and is used to detect specific happiness levels (supply, transportation, etc). If "type" is left blank, the city's overall happiness will be returned instead.
City.getSize ()
Returns the size of the city as a number.
Lua Suggestions
- KINGTUT10101
- 1,000,000 inhabitants
- Reactions:
- Posts: 1943
- Joined: Thu Jul 07, 2016 22:50
- Location: 'Merica
- Plugins: Show
- Version: Beta
- Phone model: Moto x4
Lua Suggestions
Last edited by KINGTUT10101 on Mon Oct 14, 2019 4:36, edited 2 times in total.
All of my plug-ins, maps and more:
https://sites.google.com/site/theotownmaps/home
YouTube channel:
https://m.youtube.com/c/kingtut-101
https://sites.google.com/site/theotownmaps/home
YouTube channel:
https://m.youtube.com/c/kingtut-101
- KINGTUT10101
- 1,000,000 inhabitants
- Reactions:
- Posts: 1943
- Joined: Thu Jul 07, 2016 22:50
- Location: 'Merica
- Plugins: Show
- Version: Beta
- Phone model: Moto x4
Re: Lua Suggestions
I apologise if any of these are already possible. If some of them are possible, let me know how it works please.
All of my plug-ins, maps and more:
https://sites.google.com/site/theotownmaps/home
YouTube channel:
https://m.youtube.com/c/kingtut-101
https://sites.google.com/site/theotownmaps/home
YouTube channel:
https://m.youtube.com/c/kingtut-101
- Ølsken
- Former Bearbear65
- Reactions:
- Posts: 4791
- Joined: Fri Feb 10, 2017 14:53
- Plugins: Show
- Version: Beta
- Phone model: Samsung S10
Re: Lua Suggestions
Cool ideas!
About happiness would the returned value to 0.54 if the happiness of the specified category is 54%? As you said it would be between 0 to 1
About happiness would the returned value to 0.54 if the happiness of the specified category is 54%? As you said it would be between 0 to 1

- KINGTUT10101
- 1,000,000 inhabitants
- Reactions:
- Posts: 1943
- Joined: Thu Jul 07, 2016 22:50
- Location: 'Merica
- Plugins: Show
- Version: Beta
- Phone model: Moto x4
Re: Lua Suggestions
Yes. I believe that's how the current version of City.getHappiness () works right now.
All of my plug-ins, maps and more:
https://sites.google.com/site/theotownmaps/home
YouTube channel:
https://m.youtube.com/c/kingtut-101
https://sites.google.com/site/theotownmaps/home
YouTube channel:
https://m.youtube.com/c/kingtut-101
- FranchuFranchu
- Inhabitant of a Country
- Reactions:
- Posts: 797
- Joined: Sun May 28, 2017 0:07
- Location: Melting in Argentina
- Plugins: Show
- Version: Beta
Re: Lua Suggestions
for City.getSize() you can do City.getWidth() * City.getHeight()
Did you know you can't blink while smiling :) ?
Who is online
Users browsing this forum: Bysa and 0 guests