Page 2 of 3

Re: Upgrades (for buildings)

Posted: 28 Jan 2018, 17:47
by cesareborgia94
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. :(

Re: Upgrades (for buildings)

Posted: 28 Jan 2018, 17:52
by Lobby
I assume you have to build the needed zone first.

Re: Upgrades (for buildings)

Posted: 28 Jan 2018, 17:56
by cesareborgia94
Goldspawntest.zip
Here is the zip file.
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.

Re: Upgrades (for buildings)

Posted: 28 Jan 2018, 18:17
by Lobby
It works if you add an action to build the needed zone and set "needs road":false in the industrial building.

Complete code :json

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
  }
]

Re: Upgrades (for buildings)

Posted: 28 Jan 2018, 18:22
by cesareborgia94
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.

Re: Upgrades (for buildings)

Posted: 28 Feb 2018, 21:33
by TheCrazyRobloxian
Hello!,
I have a question to ask:
¿Can upgrade frames have rotation aware?

Re: Upgrades (for buildings)

Posted: 28 Feb 2018, 22:05
by CommanderABab
I believe so.

Re: Upgrades (for buildings)

Posted: 01 Mar 2018, 03:17
by TheCrazyRobloxian
Now that i think about it, it would consume plugin space... :lol:

Re: Upgrades (for buildings)

Posted: 02 May 2018, 07:53
by Kulche
former member, there is no "," after id in tutorial! :fire

Re: Re: Upgrades

Posted: 18 Jun 2018, 01:52
by FranchuFranchu
Thanks to Lobby this tutorial survived!

Re: Re: Upgrades

Posted: 19 Jan 2019, 02:50
by Between3Characters
What about the namea of the upgrade? Can we add descriptions...?

Re: Re: Upgrades

Posted: 19 Jan 2019, 03:56
by CommanderABab
Between3Characters wrote:
19 Jan 2019, 02:50
What about the namea of the upgrade? Can we add descriptions...?
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.

Re: Re: Upgrades

Posted: 19 Jan 2019, 06:21
by Between3Characters
Thanks...

Re: Upgrades

Posted: 07 May 2019, 13:16
by dysprositos
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)

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

Posted: 07 May 2019, 16:16
by Lobby
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}]
    }]
}]

Re: Upgrades

Posted: 28 Jun 2019, 12:39
by Kulche
Can an upgrade have a preview frame? For example, I don't want to change the look of the building itself, but the upgrade should have a pic.

Re: Re: Upgrades

Posted: 28 Jun 2019, 13:04
by Lobby
Use

Code: Select all

"preview frames":[{"bmp":"icon.png"}]
for that :)

Re: Upgrades

Posted: 28 Jun 2019, 13:16
by Kulche
Thank you!

Re: Upgrades

Posted: 02 Aug 2019, 10:02
by Kulche
Another complicated question, can upgrades use separators? I'll go straight to explanation.
So, we have upgrades A, B, C and D. Only one is true, a separator is between C and D. Would we able to choose A/B and/or C/D?
Hope you understand what I meant.

Re: Upgrades

Posted: 02 Aug 2019, 18:39
by JustAnyone
Probably not, but you can use condition requirements in upgrades