Upgrades

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3679
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Upgrades

#1

Post by Lobby »

.. wrote:
16 Jun 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.
Last edited by CommanderABab on 16 Jun 2018, 18:58, edited 1 time in total.
=^._.^= ∫

User avatar
CommanderABab
AB
Reactions:
Posts: 10597
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Platform

Plugin Creator

Re: Upgrades (for buildings)

#2

Post by CommanderABab »

Something new learned everyday!

User avatar
CommanderABab
AB
Reactions:
Posts: 10597
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Platform

Plugin Creator

Re: Upgrades (for buildings)

#3

Post by CommanderABab »

Is there anything that upgrade won't work upon?

User avatar
Lobby
Developer
Reactions:
Posts: 3679
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades (for buildings)

#4

Post by Lobby »

They should work on any building. Have you tried something specific?
=^._.^= ∫

User avatar
CommanderABab
AB
Reactions:
Posts: 10597
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Platform

Plugin Creator

Re: Upgrades (for buildings)

#5

Post by CommanderABab »

No, just asking. :)

User avatar
CommanderABab
AB
Reactions:
Posts: 10597
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Platform

Plugin Creator

Re: Upgrades (for buildings)

#6

Post by CommanderABab »

Does the upgrade require a frame?

User avatar
Lobby
Developer
Reactions:
Posts: 3679
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades (for buildings)

#7

Post by Lobby »

Actually not, you may write

Code: Select all

"frames":[]
=^._.^= ∫

User avatar
CommanderABab
AB
Reactions:
Posts: 10597
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Platform

Plugin Creator

Re: Upgrades (for buildings)

#8

Post by CommanderABab »

Lobby wrote:
21 Jun 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.

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2192
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Platform

Plugin Creator

Re: Upgrades (for buildings)

#9

Post by KINGTUT10101 »

So if the values in the upgrade add onto the other values will negative numbers subtract from it?

User avatar
Lobby
Developer
Reactions:
Posts: 3679
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades (for buildings)

#10

Post by Lobby »

Yes, that's how math works :bc
=^._.^= ∫

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2192
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Platform

Plugin Creator

Re: Upgrades (for buildings)

#11

Post by KINGTUT10101 »

Just wondering if the game supported that.

User avatar
JustAnyone
Developer
Reactions:
Posts: 3336
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Upgrades (for buildings)

#12

Post 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.
:pickle:

User avatar
CommanderABab
AB
Reactions:
Posts: 10597
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Platform

Plugin Creator

Re: Upgrades (for buildings)

#13

Post by CommanderABab »

Animation.

User avatar
JustAnyone
Developer
Reactions:
Posts: 3336
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Upgrades (for buildings)

#14

Post by JustAnyone »

CommanderABab wrote:
28 Aug 2017, 17:13
Animation.
Gimme code example.
:pickle:

User avatar
Lobby
Developer
Reactions:
Posts: 3679
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades (for buildings)

#15

Post 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.
=^._.^= ∫

User avatar
khadafi laidi
Inhabitant of a Planet
Reactions:
Posts: 1313
Joined: 16 Dec 2016, 13:11
Location: Ternate, Indonesia
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades (for buildings)

#16

Post by khadafi laidi »

Upgrade can use coordinate X and Y?
If you read this, thats mean i'm already quit from this forum. I had bad life right now so pls get off from here

cesareborgia94
Reactions:

Re: Upgrades (for buildings)

#17

Post 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 ;)

User avatar
Lobby
Developer
Reactions:
Posts: 3679
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades (for buildings)

#18

Post 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.
=^._.^= ∫

cesareborgia94
Reactions:

Re: Upgrades (for buildings)

#19

Post by cesareborgia94 »

Lobby wrote:
27 Jan 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?

User avatar
Lobby
Developer
Reactions:
Posts: 3679
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades (for buildings)

#20

Post by Lobby »

Something like

Code: Select all

"fun":[{
  "actions":[{"type":"remove"},{"type":"build","id":"newBuildingId"}]
}]
=^._.^= ∫

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”