Making a fence

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
TheoTownFan
Townsman
Reactions:
Posts: 55
Joined: 25 Jul 2018, 01:31
Location: Arkansas, USA
Plugins: Showcase Store
Version: Beta

Platform

Making a fence

#1

Post by TheoTownFan »

Okay so I downloaded a Barbed Wire fence as a plugin and it's been chilling there in my decorations folder with kinda gets on my nerves. Now that we got the new beta update for fences my OCD with this plugin is really ticking me off, lol.

Here's some pictures to let you understand.
20190912_193751.jpg
20190912_193820.jpg
20190912_193820.jpg (37.56 KiB) Viewed 9548 times
This is the category I want the barbed wire plugin inside. But I don't know how!
20190912_193903.jpg
Can someone please help me. I have ES File Explorer so I don't mind with the coding as long as you guys can tell me the steps.

Thank you,
★ Official TheoTown Idea Giver and Suggester ★

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

Plugin Creator

Platform

Re: Making a fence

#2

Post by CommanderABab »

Fence frames:
atm2.png
atm2.png (200 Bytes) Viewed 9541 times

Code: Select all

[{"id":"$atmfence",
	   "type":"fence",
	
	   "category":"$cat_fence00",
	
		"build time": 1,
		"price": 100,
		"removable": true,
		"frames": [{"bmp":"atm2.png","w":16,"count":2,"handle y":4}]
		"width": 1,
		"height": 1
		
},
{"id":"$useatmfence",
      
	   "category":"$cat_fence00",
		
		"price": 0,
		"removable": true,
		"needs road": false,
		
		"draw ground": true,
		"max count":16,
		"people":256,
		"type": "industrial",
		"level":3,
		"use fence":"$atmfence",
		"frames": [],
		"width": 1,
		"height": 1
		
}]
The fence is drawn at the bottom of the tile I believe. Let's give this a try. :)

So to get it in the desired category, use this line in the code:

Code: Select all

   "category":"$cat_fence00",
To get it to use the fence tool, it needs to be defined like $atmfence above.
my avatar:

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

Plugin Creator

Platform

Re: Making a fence

#3

Post by CommanderABab »

The fence tool uses two frames of width 16. Frame 0 is the left side, frame 1 is the right side.
my avatar:

User avatar
JohnSallow
Townsman
Reactions:
Posts: 64
Joined: 29 Jan 2020, 18:45
Location: Buenos Aires, Argentina
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Making a fence

#4

Post by JohnSallow »

Can I put night animations in a fence? :calc
As I'm hardly ever online on forum, I don't read any notifications from here by now, so if you wanna ask me permission of a plugin, or something, ask me on Discord: JohnSallow#3093
;)

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

Plugin Creator

Platform

Re: Making a fence

#5

Post by CommanderABab »

JohnSallow wrote:
16 Feb 2020, 15:25
Can I put night animations in a fence? :calc
No, I don't think so. I tried calling an animation from a fence. I did not see it being used.

Using null frames

Code: Select all

"frames":[]
for example in a fence results in a crash error when the game tries to draw it as it is expecting two bitmaps.

Code: Select all

"frames":[,]
works however.
my avatar:

User avatar
Player_no_Zero
Metropolitan
Reactions:
Posts: 140
Joined: 06 May 2019, 09:18
Location: Somewhere in Manila, Philippines
Plugins: Showcase Store

Plugin Creator

Platform

Re: Making a fence

#6

Post by Player_no_Zero »

Wait what's "people" code?
𝐄𝐕𝐄𝐑𝐘𝐓𝐇𝐈𝐍𝐆 𝐌𝐔𝐒𝐓 𝐆𝐎 𝐁𝐘 𝐓𝐇𝐄 𝐃𝐄𝐓𝐀𝐈𝐋
𝐘𝐎𝐔 𝐌𝐔𝐒𝐓 𝐂𝐎𝐍𝐓𝐀𝐂𝐓 𝐌𝐄 𝐅𝐈𝐑𝐒𝐓, 𝐍𝐎𝐓 𝐀𝐋𝐋 𝐎𝐅 𝐌𝐘 𝐒𝐏𝐑𝐈𝐓𝐄𝐒 𝐀𝐑𝐄 𝐅𝐑𝐄𝐄, 𝐖𝐈𝐓𝐇 𝐀𝐍 𝐄𝐗𝐂𝐄𝐏𝐓𝐈𝐎𝐍 𝐓𝐎 𝐆𝐑𝐀𝐕𝐄𝐘𝐀𝐑𝐃 𝐏𝐎𝐒𝐓𝐒.
CREDIT ME IF YOU WANT TO USE MY SPRITES

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

Plugin Creator

Platform

Re: Making a fence

#7

Post by CommanderABab »

It's the same as "workers".
my avatar:

User avatar
AntarcticTreay
Villager
Reactions:
Posts: 16
Joined: 07 Nov 2019, 08:06
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Making a fence

#8

Post by AntarcticTreay »

Value?
SUPREME DICTATOR OF THE A.M.M.R FEDERATION
WELCOME EVERYONE

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

Plugin Creator

Platform

Re: Making a fence

#9

Post by CommanderABab »

Something sensible for the size of the building. :)

1x1 buildings are automatically limited.
my avatar:

User avatar
Lakan Haraya
Metropolitan
Reactions:
Posts: 131
Joined: 28 Mar 2019, 09:34
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Making a fence

#10

Post by Lakan Haraya »

How can I create slope fence frames? Like the in-game one.
"ᜀᜃᜓ ᜀᜅ᜔ ᜁᜌᜓᜅ᜔ ᜑᜇᜌ"
CEO of Haráya Motors

“TheoTown Philippines Council”
“Kapulungan Ng Mga Nagkakaisang Lungsod”

User avatar
TheFennekin
Neighborhood fox
Reactions:
Posts: 2728
Joined: 24 Aug 2017, 11:17
Location: Wandering around
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Making a fence

#11

Post by TheFennekin »

Lakan Haraya wrote:
17 Jul 2020, 03:23
How can I create slope fence frames? Like the in-game one.
Same question 😐
i miss the good ol days

User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4314
Joined: 14 Sep 2017, 17:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Making a fence

#12

Post by THEMAX »

i wonder the same thing.
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact

User avatar
imajoke
Inhabitant of a Conurbation
Reactions:
Posts: 532
Joined: 27 Oct 2019, 02:39
Plugins: Showcase Store
Version: Beta

Re: Making a fence

#13

Post by imajoke »

CommanderABab wrote:
13 Sep 2019, 06:16
Fence frames:

atm2.png

Code: Select all

[{"id":"$atmfence",
	   "type":"fence",
	
	   "category":"$cat_fence00",
	
		"build time": 1,
		"price": 100,
		"removable": true,
		"frames": [{"bmp":"atm2.png","w":16,"count":2,"handle y":4}]
		"width": 1,
		"height": 1
		
},
{"id":"$useatmfence",
      
	   "category":"$cat_fence00",
		
		"price": 0,
		"removable": true,
		"needs road": false,
		
		"draw ground": true,
		"max count":16,
		"people":256,
		"type": "industrial",
		"level":3,
		"use fence":"$atmfence",
		"frames": [],
		"width": 1,
		"height": 1
		
}]
The fence is drawn at the bottom of the tile I believe. Let's give this a try. :)

So to get it in the desired category, use this line in the code:

Code: Select all

   "category":"$cat_fence00",
To get it to use the fence tool, it needs to be defined like $atmfence above.
"Cat_fence 00" doesn't work anymore. I put it in my fence plugin and it makes an error
Show
click me
MADE YA LOOK LOOOOL :space
youtube: curtis warren btw stop begging

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

Plugin Creator

Platform

Re: Making a fence

#14

Post by CommanderABab »

$c not $C.
my avatar:

User avatar
imajoke
Inhabitant of a Conurbation
Reactions:
Posts: 532
Joined: 27 Oct 2019, 02:39
Plugins: Showcase Store
Version: Beta

Re: Making a fence

#15

Post by imajoke »

CommanderABab wrote:
14 Mar 2021, 20:04
$c not $C.
I know. This phone automatically capitalises, but it didnt with the category
Show
click me
MADE YA LOOK LOOOOL :space
youtube: curtis warren btw stop begging

User avatar
lrnzalfrd88
Settler
Reactions:
Posts: 5
Joined: 06 Oct 2018, 22:37
Plugins: Showcase Store

Re: Making a fence

#16

Post by lrnzalfrd88 »

I don't understand. I'm using JSON Genie app, can someone tell me step by step?

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”