Upgrades
Moderator: Plugin Moderators
-
- Inhabitant of a Planet
- Reactions:
- Posts: 1306
- Joined: Sun Nov 12, 2017 9:23
- Location: The Kingdom of Babilandia
- Plugins: Show
- Version: Beta
Re: Upgrades (for buildings)
Thanks Lobby
I rarely make plugins now, but I still make them in spare time.
Disclaimer
Disclaimer
- CommanderABab
- AB
- Reactions:
- Posts: 9105
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
Re: Upgrades (for buildings)
Nice idea! Sort of like mining an ore deposit discovered in Civilization!cesareborgia94 wrote: ↑Sat Jan 27, 2018 13:29Hello,
I have a question.
Can you upgrade for a building which is type:decoration to any RCI building, in this case the building will be upgraded into an industrial type.
Here is the json code:
IF you are wondering... Yes, on the plans to do a small ore based mining for rural villages. Just curiousCode: Select all
[{"build time":0,"draw ground":true,"frames":[{"bmp":"goldorespawn.png"}],"height":1,"id":"$goldore.cesare","influence noise":0,"influence park":0,"influence pollution":0,"needs road":false,"power":0,"spawn":{"height":200,"p":0.003,"radius":800},"text":"A gold ore that is left unmined","title":"Gold ore","type":"decoration","upgrades":[{"frames":[{"bmp":"goldminei.png"}],"height":1,"id":"goldmineind01","influence noise":1,"influence pollution":0,"price":500,"text":"Convert your gold ore into gold mines","title":"Gold Mine","type":"industry","width":1}],"water":0,"width":1}]
![]()

-
- Inhabitant of a Planet
- Reactions:
- Posts: 1306
- Joined: Sun Nov 12, 2017 9:23
- Location: The Kingdom of Babilandia
- Plugins: Show
- Version: Beta
Re: Upgrades (for buildings)
I got this error when I tried to implement the fun condition:
/storage/emulated/0/TheoTown/plugins/Goldspawntest/goldorespawn01.json:
org.json.JSONException: End of input at character 408 of
/storage/emulated/0/TheoTown/plugins/Goldspawntest/goldorespawn01.json:
org.json.JSONException: End of input at character 408 of
Code: Select all
[{"build time":0,
"draw ground":true,
"frames":[{"bmp":"goldorespawn.png"}],
"height":1,"id":"$goldore.cesare",
"influence noise":0,
"influence park":0,
"influence pollution":0,
"needs road":false,
"power":0,
"spawn":{"height":200,"p":0.003,"radius":800},
"text":"A gold ore that is left unmined",
"fun":[
{
"actions":[{"type":"remove"},{"type":"build","id":"$goldmineind01"}],
I rarely make plugins now, but I still make them in spare time.
Disclaimer
Disclaimer
- CommanderABab
- AB
- Reactions:
- Posts: 9105
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
Re: Upgrades (for buildings)
You might want to use to change the building.
Code: Select all
"on click fun"

-
- Inhabitant of a Planet
- Reactions:
- Posts: 1306
- Joined: Sun Nov 12, 2017 9:23
- Location: The Kingdom of Babilandia
- Plugins: Show
- Version: Beta
Re: Upgrades (for buildings)
Hello,
Update on gold ore ----> gold mine
I have tried the fun attribute to change the building. But upon clicking the gold ore, it only removes the texture of gold ore ("type": "decoration") but did not build a gold mine ("type":"industrial"). Also tested "type": "residential" and "type": "commercial" but did not work.
But other building types such as "park" or "sport" will work, it will remove gold ore and build gold mine with that type. (You cannot imagine a gold mine to be a sport or park)
The fun attribute just doesn't apply to RCIs. Its just remove it and leave an empty space behind.
Update on gold ore ----> gold mine
I have tried the fun attribute to change the building. But upon clicking the gold ore, it only removes the texture of gold ore ("type": "decoration") but did not build a gold mine ("type":"industrial"). Also tested "type": "residential" and "type": "commercial" but did not work.
But other building types such as "park" or "sport" will work, it will remove gold ore and build gold mine with that type. (You cannot imagine a gold mine to be a sport or park)
The fun attribute just doesn't apply to RCIs. Its just remove it and leave an empty space behind.

I rarely make plugins now, but I still make them in spare time.
Disclaimer
Disclaimer
-
- Inhabitant of a Planet
- Reactions:
- Posts: 1306
- Joined: Sun Nov 12, 2017 9:23
- Location: The Kingdom of Babilandia
- Plugins: Show
- Version: Beta
Re: Upgrades (for buildings)
My plan here is that the gold ore spawn randomly in a world map as decoration, and then you can upgrade it into a small gold mine as industrial. It is simple idea really. I have plans for copper mines and silver mines but this cannot come to fruition :(
Please move discussion if this is a little off-topic. You can see the code and texture in zip file provided above.
I rarely make plugins now, but I still make them in spare time.
Disclaimer
Disclaimer
Re: Upgrades (for buildings)
It works if you add an action to build the needed zone and set "needs road":false in the industrial building.
Complete code
Complete code

Code: Select all
[
{
"draw ground":true,
"frames":[
{
"bmp":"goldorespawn.png"
}
],
"fun":[
{
"actions":[
{
"type":"remove"
},
{
"type":"build",
"id":"$zoneindustrial"
},
{
"id":"goldmine",
"type":"build"
}
],
"condition":{
"id":"upgrade",
"type":"upgrade"
}
}
],
"height":1,
"hidden":false,
"id":"goldore",
"text ":"An unmined gold ore, maybe you can turn it into a gold mine?",
"title":"gold ore",
"type":"decoration",
"upgrades":[
{
"frames":[
],
"id":"upgrade",
"price":0,
"text":"Upgrades to goldmine",
"title":"Mine gold"
}
],
"width":1
},
{
"needs road":false,
"draw ground":true,
"frames":[
{
"bmp":"goldminei.png"
}
],
"height":1,
"hidden":false,
"id":"goldmine",
"influence noise":0,
"influence pollution":0,
"people":3,
"power":0,
"text":"Goldmine",
"type":"industrial",
"water":0,
"width":1
}
]
=^._.^= ∫
-
- Inhabitant of a Planet
- Reactions:
- Posts: 1306
- Joined: Sun Nov 12, 2017 9:23
- Location: The Kingdom of Babilandia
- Plugins: Show
- Version: Beta
Re: Upgrades (for buildings)
Thanks Lobby for all the help. I'll be testing it first. If it does well, I'll probably release my gold ore plugin today.
I rarely make plugins now, but I still make them in spare time.
Disclaimer
Disclaimer
- TheCrazyRobloxian
- Villager
- Reactions:
- Posts: 19
- Joined: Mon Nov 13, 2017 22:21
Re: Upgrades (for buildings)
Hello!,
I have a question to ask:
¿Can upgrade frames have rotation aware?
I have a question to ask:
¿Can upgrade frames have rotation aware?
Really basic plugin maker! - Plugins once every 10 years"



- CommanderABab
- AB
- Reactions:
- Posts: 9105
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
- TheCrazyRobloxian
- Villager
- Reactions:
- Posts: 19
- Joined: Mon Nov 13, 2017 22:21
Re: Upgrades (for buildings)
Now that i think about it, it would consume plugin space... 

Really basic plugin maker! - Plugins once every 10 years"



Online
Re: Upgrades (for buildings)
former member, there is no "," after id in tutorial! 

I'm not lazy, I'm motivated to do nothing!
...
...
- FranchuFranchu
- Inhabitant of a Country
- Reactions:
- Posts: 798
- Joined: Sun May 28, 2017 0:07
- Location: Freezing in Argentina
- Plugins: Show
- Version: Beta
Re: Re: Upgrades
Thanks to Lobby this tutorial survived!
Did you know you can't blink while smiling :) ?
- Between3Characters
- Metropolitan
- Reactions:
- Posts: 123
- Joined: Thu Oct 04, 2018 13:31
- Plugins: Show
- Version: Beta
Re: Re: Upgrades
What about the namea of the upgrade? Can we add descriptions...?
Moderators, dont delete our plugins please
- CommanderABab
- AB
- Reactions:
- Posts: 9105
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
Re: Re: Upgrades
You can provide "text" and "title" for each upgrade. They will be shown when that particular upgrade is selected to be chosen. They do not affect the text and title of the building however.Between3Characters wrote: ↑Sat Jan 19, 2019 2:50What about the namea of the upgrade? Can we add descriptions...?

- Between3Characters
- Metropolitan
- Reactions:
- Posts: 123
- Joined: Thu Oct 04, 2018 13:31
- Plugins: Show
- Version: Beta
-
- Settler
- Reactions:
- Posts: 1
- Joined: Fri Apr 27, 2018 15:12
- Location: Italy
- Plugins: Show
- Version: Beta
Re: Upgrades
I have a problem, when I write the code for upgrade, even if I insert all 4 frames and the rotation function, the frames always remain the same, while the same building, while when it is not upgrade it changes the image for each side.
Here is the code:
(Sorry for my English)
Here is the code:
(Sorry for my English)
Code: Select all
[{
"id": "PiazzaMoroSpoglia",
"type": "park",
"title": "Piazza Aldo Moro Coccaglio (Bs)",
"text": "Piazza",
"width": 4,
"height": 4,
"rotation aware": true,
"frames": [{
"bmp": "PiazzaMoroL4.png"},
{"bmp": "PiazzaMoroL3.png"},
{"bmp": "PiazzaMoroL2.png"},
{"bmp": "PiazzaMoroL1.png"
}],
"upgrades": [{
"id": "PiazzaMoroPiante",
"title": "Piazza Aldo Moro Coccaglio (Bs)",
"text": "L'aggiunta delle piante è l'ideale per tenere al fresco i tuoi cittadini durante la calura estiva",
"width": 4,
"height": 4,
"rotation aware": true,
"frames": [{
"bmp": "PiazzaMoroL5.png"},
{"bmp": "PiazzaMoroL6.png"},
{"bmp": "PiazzaMoroL7.png"},
{"bmp": "PiazzaMoroL8.png"}],
Re: Re: Upgrades
Upgrades aren't rotation aware on their own. You have to use a rotation aware animation in an upgrade in order to support rotation awareness in it. This may look like that:
Code: Select all
[
{
"id":"PiazzaMoroSpoglia_upgrade00",
"type":"animation",
"frames":[{
"bmp": "PiazzaMoroL5.png"},
{"bmp": "PiazzaMoroL6.png"},
{"bmp": "PiazzaMoroL7.png"},
{"bmp": "PiazzaMoroL8.png"}],
"rotation aware":true
},
{
"id": "PiazzaMoroSpoglia",
"type": "park",
"title": "Piazza Aldo Moro Coccaglio (Bs)",
"text": "Piazza",
"width": 4,
"height": 4,
"rotation aware": true,
"frames": [{
"bmp": "PiazzaMoroL4.png"},
{"bmp": "PiazzaMoroL3.png"},
{"bmp": "PiazzaMoroL2.png"},
{"bmp": "PiazzaMoroL1.png"
}],
"upgrades": [{
"id": "PiazzaMoroPiante",
"title": "Piazza Aldo Moro Coccaglio (Bs)",
"text": "L'aggiunta delle piante è l'ideale per tenere al fresco i tuoi cittadini durante la calura estiva",
"frames": [null],
"animation":[{"id":"PiazzaMoroSpoglia_upgrade00","x":0,"y":0}]
}]
}]
=^._.^= ∫