Page 1 of 1

Fun help

Posted: 29 Aug 2018, 17:36
by sairam
I have the problem with fun
Here is my code!

Code: Select all

[
	{
		"id":"$coal.anim.sairam00",
		"type":"animation",
		"author":"sairam",
		"frames":[
			{"bmp":"coal1.png"},
			{"bmp":"coal2.png"},
			{"bmp":"coal3.png"},
			{"bmp":"coal4.png"}
			],
		"speed":0.005
	},
	{
       
		"id":"$coaltruck00",
		"type":"car",
		"v2":true,
		"frames":[
			{"bmp":"coaltruck.png","w":17,"h":13,"count":4}
	         ]
  
	},
	{
		"draw ground":true,
		"frames":[],
		"animation":[
		{"id":"$coal.anim.sairam00","x":0,"y":-6}],
		"fun":[
			{
			"actions":[
			{
				"type":"remove"
			},
			{
				"id":"$blank.coalmine.sairam00",
				"type":"build"
			}
		],
			"condition":{
				"id":"upgrade",
				"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":[null],
				"id":"upgrade",
				"price":0,
				"text":"Upgrades to coal mine",
				"title":"Coal Mine"
			}
		],
		"width":1
	},
	{
		"id": "$coalmine00",
		"type": "industrial",
		"width": 4,
		"height": 4,
		"frames": [{"steal":"$coalmine00"}],
		"level": 2,
		"car spawner": [ 
		{
			"cars":["$coaltruck00"],
			"count":10,
			"radius":290,
			"targets":["$coalplant00"]
		}
	              ],
		"override":true

	},
	{
		"id":"$blank.coalmine.sairam00",
		"type":"decoration",
		"width":4,
		"height":4,
		"hidden":true,
		"frames":[
		{"bmp":"blank.png"}
		],
		"fun": [
		{ 
				"actions": [
				{
					"type":"remove"
				},
				{
					"type":"build",
					"id":"$zoneindustrial_lvl2"
				},
				{
					"type":"build",
					"id":"$coalmine00"
				}
			]
		}
	]	
  }
]

Re: Fun help

Posted: 29 Aug 2018, 17:48
by malsa
Well here my answer:










...Do it yourself

Re: Fun help

Posted: 29 Aug 2018, 17:56
by cesareborgia94
Use jsonlint, I helped. Find the problem yourself.

Re: Fun help

Posted: 29 Aug 2018, 18:03
by sairam
But it doesn't build the coal mine.

Re: Fun help

Posted: 29 Aug 2018, 18:11
by sairam
cesareborgia94 wrote: โ†‘29 Aug 2018, 17:56 Use jsonlint, I helped. Find the problem yourself.
It is a valid json.

Re: Fun help

Posted: 29 Aug 2018, 18:14
by cesareborgia94
Delete your json and start all over again.

Re: Fun help

Posted: 29 Aug 2018, 18:58
by CommanderABab
"remove" just removes one tile at x,y.

Coal mine is 4x4 so you must remove, (zone? Is it a zoned building?) 16 tiles in a 4x4 rectangle before coal mine will build.

Re: Fun help

Posted: 29 Aug 2018, 19:03
by CommanderABab
So how do you clear and zone a rectangle of 16 tiles in a 4x4 square?

Rect condition and action

Posted: 29 Aug 2018, 23:17
by CommanderABab
Show
Introduced in 473:
๐Ÿ› Line action
๐Ÿ› Rect condition and action
๐Ÿ› Fix palm trees and cacti had auto build set to true
Show
condition

Code: Select all

{"type":"rect","w":10,"h":4,"min":1,"max":9999,"inner":[{...}]}
checks if the inner condition occurs โ‰ฅ min times and โ‰ค max times.
Show
action
similar, it executes the inner actions for each of the specified tiles:

Code: Select all

"actions":[{"type":"rect","w":4,"h":3,"inner":[{...},...]}]
Show
example action

Code: Select all

  "actions":
    [
      {"type":"rect","w":4,"h":4,"inner":
        [
          {"type":"remove"},
          {"type":"build","id":"$zoneindustrial_lvl2"}
        ]
      }
    ]
Does it work? Does it need more?
Try it and see.
Credits: Lobby

Re: Fun help

Posted: 30 Aug 2018, 04:12
by sairam
It doesn't works I'll give my zip file.

Re: Fun help

Posted: 30 Aug 2018, 04:34
by cesareborgia94
sairam wrote: โ†‘30 Aug 2018, 04:12 It doesn't works I'll give my zip file.Coal_induatry_sairam.zip
You just stole the texture from a former member. Shameful. Make the coal mine texture yourself.

Re: Fun help

Posted: 30 Aug 2018, 04:46
by cesareborgia94
Nobody will lend a help to someone who steals plugin textures from plugin creators, even from former members. Make the textures yourself first.

Re: Fun help

Posted: 30 Aug 2018, 06:27
by Sbb1413
cesareborgia94 wrote: โ†‘30 Aug 2018, 04:46 Nobody will lend a help to someone who steals plugin textures from plugin creators, even from former members. Make the textures yourself first.

I am very sad to hear. =(

Re: Fun help

Posted: 30 Aug 2018, 11:09
by malsa
sairam wrote: โ†‘30 Aug 2018, 04:12 It doesn't works I'll give my zip file.
You can't do that, have you read the rules