Upgrades help

Plug-in related stuff can be discussed here.

Moderator: Plugin Moderators

User avatar
sairam
Inhabitant of a Conurbation
Reactions:
Posts: 537
Joined: 31 Dec 2017, 13:35
Location: India Pudukkottai
Plugins: Showcase Store
Version: Beta

Platform

Upgrades help

#1

Post by sairam »

I have a question that I am doing a coal plugin
My idea is coal mines spawns in the map and I have to change it to a ingame coal mine.I tried with "on click fun"
But it removes the coal ore and places a industrial zone only not building the coal mine. Please help.
Here is my code.

Code: Select all

[
  {
    "draw ground":true,
    "frames":[
      {
        "bmp":"coal4.png"
      }
    ],
     "on click fun":[
      {
        "actions":[
          {
            "type":"remove"
          },
          {
            "type":"build",
            "id":"$zoneindustrial"
          },
          {
            "id":"$coalmine00",
            "type":"build"
          }
        ],
        "condition":{
          "id":"update",
          "type":"upgrade"
        }
      }
    ],
    "height":1,
    "hidden":false,
    "id":"$coalore00",
    "text ":"An unmined coal ore, maybe you can turn it into a coal mine?",
    "title":"Coal Ore",
    "type":"decoration",
    "upgrades":[
      {
       "frames" [
       
       ],
        "id":"update",
        "price":0,
        "text":"Upgrades to coal mine",
        "title":"Mine coal"
      }
    ],
    "width":1
  },
  {
"id": "$coalmine00",
	"type": "industrial",
	"width": 4,
	"height": 4,
	"frames": [{"steal":"$coalmine00"}],
	"level": 2,
	"override":true
	}
]
Last edited by sairam on 19 Aug 2018, 14:24, edited 1 time in total.

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

Platform

Re: Re: Upgrades

#2

Post by JustAnyone »

You need to put zone on all 4 tiles.
Also zone should be TT.

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

Plugin Creator

Platform

Re: Re: Upgrades

#3

Post by CommanderABab »

The in game coal mine is 4x4 isnt it?

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

Plugin Creator

Platform

Re: Re: Upgrades

#4

Post by CommanderABab »

You need to change

Code: Select all

on click fun
to just

Code: Select all

fun

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

Plugin Creator

Platform

Re: Re: Upgrades

#5

Post by CommanderABab »

It's always a good idea to put the id of each section of your json at the beginning of the plugin.

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

Plugin Creator

Platform

Re: Re: Upgrades

#6

Post by CommanderABab »

On click fun precludes the upgrade possibility from ever happening.

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

Plugin Creator

Platform

Re: Re: Upgrades

#7

Post by CommanderABab »

Could you please post the picture of what you think the in-game coal mine looks like?

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

Plugin Creator

Platform

Re: Re: Upgrades

#8

Post by CommanderABab »

JustAnyone wrote:
18 Aug 2018, 14:06
You need to put zone on all 4 tiles.
Also zone should be TT.
That would be 4x4=16 tiles!

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

Platform

Re: Re: Upgrades help

#9

Post by JustAnyone »

Ok. Math is bad. Sorry!

User avatar
sairam
Inhabitant of a Conurbation
Reactions:
Posts: 537
Joined: 31 Dec 2017, 13:35
Location: India Pudukkottai
Plugins: Showcase Store
Version: Beta

Platform

Re: Re: Upgrades help

#10

Post by sairam »

How to place all four tiles?

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

Platform

Re: Re: Upgrades help

#11

Post by JustAnyone »

x, y in build action.

User avatar
sairam
Inhabitant of a Conurbation
Reactions:
Posts: 537
Joined: 31 Dec 2017, 13:35
Location: India Pudukkottai
Plugins: Showcase Store
Version: Beta

Platform

Re: Re: Upgrades help

#12

Post by sairam »

How give me a code example.

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

Platform

Re: Re: Upgrades help

#13

Post by JustAnyone »

Code: Select all

{
            "type":"build",
            "id":"$zoneindustrial",
            "x":0,
            "y":1
          }
Will build a tile at
[ ][X][ ]
[ ][ ][ ]
[ ][ ][ ]
_______________
MAP of locations
[ ][+Y][ ]
[-X ][X:0][+X]
[ ][-Y][ ]

User avatar
sairam
Inhabitant of a Conurbation
Reactions:
Posts: 537
Joined: 31 Dec 2017, 13:35
Location: India Pudukkottai
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades help

#14

Post by sairam »

It doesn't spawn the building. Please help. I'll upload my code.

Code: Select all

[
  {
    "draw ground":true,
    "frames":[
      {
        "bmp":"coal4.png"
      }
    ],
     "fun":[
      {
        "actions":[
          {
            "type":"remove"
          },
          {
            "type":"build",
            "id":"$zoneindustrial_lvl2",
            "x":0,
            "y":0
          },
          {
            "type":"build",
            "id":"$zoneindustrial_lvl2",
            "x":-1,
            "y":0
          },
          {
            "type":"build",
            "id":"$zoneindustrial_lvl2",
            "x":-2,
            "y":0
          },
          {
            "type":"build",
            "id":"$zoneindustrial_lvl2",
            "x":-3,
            "y":0
          },
          {
            "type":"build",
            "id":"$zoneindustrial_lvl2",
            "x":-4,
            "y":0
          },
          {
            "type":"build",
            "id":"$zoneindustrial_lvl2",
            "x":-1,
            "y":-1
          },
          {
            "type":"build",
            "id":"$zoneindustrial_lvl2",
            "x":-2,
            "y":-2
          },
          {
            "type":"build",
            "id":"$zoneindustrial_lvl2",
            "x":-3,
            "y":-3
          },
          {
            "type":"build",
            "id":"$zoneindustrial_lvl2",
            "x":-4,
            "y":-4
          },
          {
            "id":"$coalmine00",
            "type":"build"
          }
        ],
        "condition":{
          "id":"update",
          "type":"upgrade"
        }
      }
    ],
    "height":1,
    "hidden":false,
    "id":"$coalore00",
    "text ":"An unmined coal ore, maybe you can turn it into a coal mine?",
    "title":"Coal Ore",
    "type":"decoration",
    "upgrades":[
      {
       "frames":[
       
       ],
        "id":"update",
        "price":0,
        "text":"Upgrades to coal mine",
        "title":"Mine coal"
      }
    ],
    "width":1
  },
  {
"id": "$coalmine00",
	"type": "industrial",
	"width": 4,
	"height": 4,
	"frames": [{"steal":"$coalmine00"}],
	"level": 2,
	"override":true
	}
]

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

Plugin Creator

Platform

Re: Upgrades help

#15

Post by CommanderABab »

You have to remove and build the zone for each tile.

Or you could build a park that is already 4x4 and remove it in place of adding 15 more removes.

User avatar
sairam
Inhabitant of a Conurbation
Reactions:
Posts: 537
Joined: 31 Dec 2017, 13:35
Location: India Pudukkottai
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades help

#16

Post by sairam »

How can I build that can you show me with the code so that I can understand.

User avatar
sairam
Inhabitant of a Conurbation
Reactions:
Posts: 537
Joined: 31 Dec 2017, 13:35
Location: India Pudukkottai
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades help

#17

Post by sairam »

Not working I tried Here is my code!

Code: Select all

[
  {
    "draw ground":true,
    "frames":[
      {
        "bmp":"coal4.png"
      }
    ],
     "fun":[
      {
        "actions":[
          {
            "type":"remove"
          },
          {
            "type":"build",
            "id":"$bigpark00"
          },
          {
          "type":"remove"
          },
          {
            "type":"build",
            "id":"$zoneindustrial_lvl2",
            "x":0,
            "y":0
          },
          {
            "id":"$coalmine00",
            "type":"build"
          }
        ],
        "condition":{
          "id":"update",
          "type":"upgrade"
        }
      }
    ],
    "height":1,
    "hidden":false,
    "id":"$coalore00",
    "text ":"An unmined coal ore, maybe you can turn it into a coal mine?",
    "title":"Coal Ore",
    "type":"decoration",
    "upgrades":[
      {
       "frames":[
       
       ],
        "id":"update",
        "price":0,
        "text":"Upgrades to coal mine",
        "title":"Mine coal"
      }
    ],
    "width":1
  },
  {
"id": "$coalmine00",
	"type": "industrial",
	"width": 4,
	"height": 4,
	"frames": [{"steal":"$coalmine00"}],
	"level": 2,
	"override":true
	}
]

User avatar
sairam
Inhabitant of a Conurbation
Reactions:
Posts: 537
Joined: 31 Dec 2017, 13:35
Location: India Pudukkottai
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades help

#18

Post by sairam »

Was this forgotten @CommanderABab[Posts][PM]

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

Plugin Creator

Platform

Re: Upgrades help

#19

Post by CommanderABab »

Yep

User avatar
sairam
Inhabitant of a Conurbation
Reactions:
Posts: 537
Joined: 31 Dec 2017, 13:35
Location: India Pudukkottai
Plugins: Showcase Store
Version: Beta

Platform

Re: Upgrades help

#20

Post by sairam »

Please help! @Lobby[Posts][PM]. Can you help me?

Locked Previous topicNext topic

Return to “Plug-In Discussion”