Page 1 of 3

Upgrades

Posted: Wed Jun 21, 2017 21:08
by Lobby
.. wrote:
Sat Jun 16, 2018 17:22
Upgrades

In this topic, I'll show you how to add upgrades to your plugin. (Example: Waterslide upgrade for pool)

This is how an upgrade may look in a plugin:

Code: Select all

[{
	"id": "$sample.plugin.unique.id.park00",
	"type": "park",
	"author": "Lobby & theotheoderich",
	"width": 1,
	"height": 1,
	"frames": [{
		"bmp": "sample_bmp.png"
	}],
	"influence park": 40,
	"upgrades": [{
		"id": "$sample.plugin.unique.id.park01",
		"frames": [{
			"bmp": "someupgrade_bmp"
		}],
		"price": 2000,
		"monthly price": 20,
		"influence park": 20
	}]
}]
This will add "$sample.plugin.unique.id.park01" to our park. Upgrades can use same functions like normal buildings. Upgrade frame should have same resolution as their building, but height can be different.

Functions
"upgrades" - defines upgrades for the building

I hope this helped you, have fun with your upgrading!
Tutorial is by .former member.


Thank you :)

Some additional notes:
  • price, monthly price, water, power and influences will be added to corresponding values of the building when the upgrade is applied
  • You can also provide animations as for regular buildings, but no smoke
  • You can set "only one":true in an upgrade to state that no other upgrade may be active at the same time. We use this for example for the radio station were you can have selected only one program at the same time.

Re: Upgrades (for buildings)

Posted: Wed Jun 21, 2017 22:25
by CommanderABab
Something new learned everyday!

Re: Upgrades (for buildings)

Posted: Wed Jun 21, 2017 22:27
by CommanderABab
Is there anything that upgrade won't work upon?

Re: Upgrades (for buildings)

Posted: Wed Jun 21, 2017 22:49
by Lobby
They should work on any building. Have you tried something specific?

Re: Upgrades (for buildings)

Posted: Wed Jun 21, 2017 22:50
by CommanderABab
No, just asking. :)

Re: Upgrades (for buildings)

Posted: Wed Jun 21, 2017 23:29
by CommanderABab
Does the upgrade require a frame?

Re: Upgrades (for buildings)

Posted: Thu Jun 22, 2017 0:09
by Lobby
Actually not, you may write

Code: Select all

"frames":[]

Re: Upgrades (for buildings)

Posted: Thu Jun 22, 2017 7:18
by CommanderABab
Lobby wrote:
Wed Jun 21, 2017 22:49
They should work on any building. Have you tried something specific?
I have now!

It does indeed work with influences, price, monthly price.

It does not work with provide aspect.

Re: Upgrades (for buildings)

Posted: Mon Jun 26, 2017 21:49
by KINGTUT10101
So if the values in the upgrade add onto the other values will negative numbers subtract from it?

Re: Upgrades (for buildings)

Posted: Mon Jun 26, 2017 23:18
by Lobby
Yes, that's how math works :bc

Re: Upgrades (for buildings)

Posted: Mon Jun 26, 2017 23:58
by KINGTUT10101
Just wondering if the game supported that.

Re: Upgrades (for buildings)

Posted: Mon Aug 28, 2017 11:05
by JustAnyone
Hello,
I have A question to give:
"How to make add a little part of frame on full frame using upgrade?"
Example: Stadium/Main fire station.

Re: Upgrades (for buildings)

Posted: Mon Aug 28, 2017 17:13
by CommanderABab
Animation.

Re: Upgrades (for buildings)

Posted: Tue Aug 29, 2017 16:27
by JustAnyone
CommanderABab wrote:
Mon Aug 28, 2017 17:13
Animation.
Gimme code example.

Re: Upgrades (for buildings)

Posted: Mon Jan 08, 2018 18:20
by Lobby
True, thank you :bc
About ordinal for upgrades, it doesn't really matter as the order in which you define them will be used and you have access to change it.

Re: Upgrades (for buildings)

Posted: Tue Jan 09, 2018 0:13
by khadafi laidi
Upgrade can use coordinate X and Y?

Re: Upgrades (for buildings)

Posted: Sat Jan 27, 2018 13:29
by cesareborgia94
Hello,
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:

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","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}]
IF you are wondering... Yes, on the plans to do a small ore based mining for rural villages. Just curious ;)

Re: Upgrades (for buildings)

Posted: Sat Jan 27, 2018 13:31
by Lobby
No, you cannot change the type of the building. However, you might use fun to replace it with a whole new building of another type.

Re: Upgrades (for buildings)

Posted: Sat Jan 27, 2018 13:38
by cesareborgia94
Lobby wrote:
Sat Jan 27, 2018 13:31
No, you cannot change the type of the building. However, you might use fun to replace it with a whole new building of another type.
I have a question. How to use fun to replace the one building to another without upgrading it?

Re: Upgrades (for buildings)

Posted: Sat Jan 27, 2018 13:50
by Lobby
Something like

Code: Select all

"fun":[{
  "actions":[{"type":"remove"},{"type":"build","id":"newBuildingId"}]
}]