Fence Pack UPDATE by mdk_813 [Park]

Show us your Parks, Sports Complexes, and Management plugins.

Moderator: Plugin Moderators

User avatar
mdk_813
Inhabitant of a Country
Reactions:
Posts: 856
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

Platform

Fence Pack UPDATE by mdk_813 [Park]

#1

Post by mdk_813 » Sun Jul 09, 2017 1:42

Hi guys,
so, after the Sound Walls which I certainly could not have done without the help of former member (thanks again!), I started to look further into creating plugins and especially json-files on my own, because I had no clue on how to work that. After some tedious errors I now have finished my first fully self-created plugin:
Fence Pack by mdk_813

I know there is already the possibility to use the fences from the military addon, however these are double fences which are not really suitable for general use in a city (and also they define a military zone. So, I wanted to create some fences on my own.
The pack contains a normal wire fence and a barbedwire fence version. Both are fully modular.
I hope you enjoy.

UPDATE: Fence_Linetool_mdk_813.zip
I've turned both fence types into linetools in order to make placement much easier.
Also, I've added a police influence so that the fences actually reduce crime. The barbed fence is obviously more effective in reducing crime than the regular fence, but the former is also a bit more costly than the latter.
The two fences can be found in the deco menu.

So, for the sake of increasing the ease of use and to get the additional benefit of crime reduction, I strongly recommend redownloading the plugin.
Please note, this new plugin does not replace the older one. Therefore, you will need to bulldoze all the old fences in your cities before deleting the old plugin form your plugin folder.
Attachments
Fence_Linetool_mdk_813.zip
(7.11 KiB) Downloaded 2483 times
fence_pack_mdk_813.zip
This file is obsolete!!!
(65.67 KiB) Downloaded 2019 times
Fence_Pack_mdk_813_Cover.png
Last edited by mdk_813 on Sun Sep 10, 2017 0:42, edited 2 times in total.
My Plugins: Link

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

User avatar
CommanderABab
AB
Reactions:
Posts: 7557
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Fence Pack by mdk_813 [Park]

#2

Post by CommanderABab » Sun Jul 09, 2017 2:26

Code: Select all

"influence police":10,
"influence park":5",
Would do it. But won't have police cars.
746!746Currently using beta 746. 746 What's new? :)
lit trfc lights!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

User avatar
mdk_813
Inhabitant of a Country
Reactions:
Posts: 856
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

Platform

Re: Fence Pack by mdk_813 [Park]

#3

Post by mdk_813 » Sun Jul 09, 2017 2:45

CommanderABab wrote: โ†‘
Sun Jul 09, 2017 2:26

Code: Select all

"influence police":10,
"influence park 5",
Would do it. But won't have police cars.
Thanks for your reply!
No police cars would be perfectly alright, because the fences should just have a general influence of reducing the likelihood of crimes, just like in the real world.
But I have some further questions:
How much influnece is 10? Is it like 10%?
Also, wouldn't "influence park 5" produce a json-error? Should it not have the same format as the above "influence police": 10?

And, finally, I'm thinking about moving the plugin to the decorations-group. Can decorations also have influence?
My Plugins: Link

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

User avatar
CommanderABab
AB
Reactions:
Posts: 7557
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Fence Pack by mdk_813 [Park]

#4

Post by CommanderABab » Sun Jul 09, 2017 3:03

:roll: It was a typo sorry. Influence 10 is about the range from the fence to the house.
746!746Currently using beta 746. 746 What's new? :)
lit trfc lights!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

User avatar
mdk_813
Inhabitant of a Country
Reactions:
Posts: 856
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

Platform

Re: Fence Pack by mdk_813 [Park]

#5

Post by mdk_813 » Sun Jul 09, 2017 3:06

CommanderABab wrote: โ†‘
Sun Jul 09, 2017 3:03
:roll: It was a typo sorry. Influence 10 is about the range from the fence to the house.
OK, so 10 is quite a limited influence then?
But what would be the maximum influence possible? I just want to know in order to understand the influence-system.
My Plugins: Link

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

User avatar
CommanderABab
AB
Reactions:
Posts: 7557
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Fence Pack by mdk_813 [Park]

#6

Post by CommanderABab » Sun Jul 09, 2017 3:14

Yeah, rather limited, but your fence would be like bus stops, the influence multiples a bit when placed close together. Maximum....you don't want to go too high.
746!746Currently using beta 746. 746 What's new? :)
lit trfc lights!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

User avatar
mdk_813
Inhabitant of a Country
Reactions:
Posts: 856
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

Platform

Re: Fence Pack by mdk_813 [Park]

#7

Post by mdk_813 » Sun Jul 09, 2017 3:50

CommanderABab wrote: โ†‘
Sun Jul 09, 2017 3:14
Yeah, rather limited, but your fence would be like bus stops, the influence multiples a bit when placed close together. Maximum....you don't want to go too high.
No, don't worry,I have no intention of going too high, I just want to get a feel for the relations.
Currently, I don't understand what this 10 actually is.
Is it a reduction of a crime value by 10 (so turning a crime value of, say, 50 to 40)?
Is it a reach of 10 pixels that reduces crime in that radius to zero?
Or what is it?
My Plugins: Link

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

User avatar
CommanderABab
AB
Reactions:
Posts: 7557
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Fence Pack by mdk_813 [Park]

#8

Post by CommanderABab » Sun Jul 09, 2017 4:54

If it is solid green, cfime wont happen.
746!746Currently using beta 746. 746 What's new? :)
lit trfc lights!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

User avatar
mdk_813
Inhabitant of a Country
Reactions:
Posts: 856
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

Platform

Re: Fence Pack by mdk_813 [Park]

#9

Post by mdk_813 » Sun Jul 09, 2017 5:34

CommanderABab wrote: โ†‘
Sun Jul 09, 2017 4:54
If it is solid green, cfime wont happen.
Ah alright, thank you, I think I get it know.
So, the number defines the extent of the influence-radius, and within that radius crime is eliminated.
My Plugins: Link

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

User avatar
CommanderABab
AB
Reactions:
Posts: 7557
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Fence Pack by mdk_813 [Park]

#10

Post by CommanderABab » Sun Jul 09, 2017 6:02

:)
746!746Currently using beta 746. 746 What's new? :)
lit trfc lights!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

User avatar
Lobby
Developer
Reactions:
Posts: 3331
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Fence Pack by mdk_813 [Park]

#11

Post by Lobby » Sun Jul 09, 2017 10:43

Nice fences you have there :bc
...Have a nice stay

User avatar
Skyhunter117
Inhabitant of a Country
Reactions:
Posts: 798
Joined: Wed May 03, 2017 10:31
Location: Vault 101
Plugins: Show

Platform

Re: Fence Pack by mdk_813 [Park]

#12

Post by Skyhunter117 » Sun Jul 09, 2017 11:47

I kinda hope this gets implemented into the main game.
Lord Hunter of [Reducted]
ใ€Šใ€‹Stand strongใ€Šใ€‹
"See ya, wouldn't wanna be ya."-Some random marine from Halo 2.[/r]

User avatar
CommanderABab
AB
Reactions:
Posts: 7557
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Fence Pack by mdk_813 [Park]

#13

Post by CommanderABab » Sun Jul 09, 2017 12:07

Skyhunter117 wrote: โ†‘
Sun Jul 09, 2017 11:47
I kinda hope this gets implemented into the main game.
Especially if placed like wires.
746!746Currently using beta 746. 746 What's new? :)
lit trfc lights!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

Barky
TheoTown Cartographer
Reactions:
Posts: 2074
Joined: Mon Apr 17, 2017 22:13
Location: Ireland
Plugins: Show

Platform

Re: Fence Pack by mdk_813 [Park]

#14

Post by Barky » Sun Jul 09, 2017 12:35

This is really nice
Great job! :D

User avatar
khadafi laidi
Inhabitant of a Planet
Reactions:
Posts: 1303
Joined: Fri Dec 16, 2016 13:11
Location: Ternate, Indonesia
Plugins: Show
Version: Beta
Phone model: Xiaomi note A5

Platform

Re: Fence Pack by mdk_813 [Park]

#15

Post by khadafi laidi » Sun Jul 09, 2017 12:37

Finaly, with this no one can get out on village :evil:
Fact about me:
-President of FINDONEZIA
-Im rarely active right now
-Subscribe my channel:
https://www.youtube.com/channel/UCWS1fz ... 4syaxcA74A

User avatar
mdk_813
Inhabitant of a Country
Reactions:
Posts: 856
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

Platform

Re: Fence Pack by mdk_813 [Park]

#16

Post by mdk_813 » Sun Jul 09, 2017 13:17

Thank you, guys.
I'm glad you like it.

I'm working on some other ideas as well. Hopefully, I will be able to finish and upload those soon.
My Plugins: Link

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

Luigi
Inhabitant of a Planet
Reactions:
Posts: 1443
Joined: Fri Mar 17, 2017 11:25
Location: Fairview Coast
Plugins: Show
Phone model: Samsung Galaxy note2

Platform

Re: Fence Pack by mdk_813 [Park]

#17

Post by Luigi » Sun Jul 09, 2017 15:01

Very nice :bc
PRESIDENT OF FAIRVIEW COAST
using the latest version as always.
*phone broken

User avatar
Lobby
Developer
Reactions:
Posts: 3331
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Fence Pack by mdk_813 [Park]

#18

Post by Lobby » Sun Jul 09, 2017 19:53

With version 313 (released in beta, today) you can use the frame alignment attribute. If it's true, you can build your plugin with a line tool similar to roads or wires. In order to use this you have to provide 16 frames which follow the same pattern as road frames.

Usage:

Code: Select all

"frame alignment":true
For demonstration I just modified your plugin a bit. I grouped up all 16 frames within one image:
fence.png
fence.png (1.88 KiB) Viewed 6536 times
The code may then look like:

Code: Select all

[
 {
    "id":"$deco_mdk_813_fence00",
    "type":"decoration",
    "width":1,
    "height":1,
    "frame alignment":true,
    "draw ground":true,
    "frames":[{"bmp":"fence.png","w":32,"h":23,"count":16}]
  }
]
Note that with "frame alignment":true there's no need to use "rotation aware":true.
Attachments
fence.json
(222 Bytes) Downloaded 32 times
...Have a nice stay

User avatar
mdk_813
Inhabitant of a Country
Reactions:
Posts: 856
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

Platform

Re: Fence Pack by mdk_813 [Park]

#19

Post by mdk_813 » Sun Jul 09, 2017 20:23

Wow, that's pretty cool :D
But I don't understand the order in which the pieces are placed in that longer image. Is the order random or is there an inherent logic to it?
My Plugins: Link

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

User avatar
Lobby
Developer
Reactions:
Posts: 3331
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Fence Pack by mdk_813 [Park]

#20

Post by Lobby » Sun Jul 09, 2017 20:59

For implementation reasons there's some binary logic behind it:
frame_index.png
frame_index.png (29.01 KiB) Viewed 6509 times
Let's assume we have a fence at current tile. We then have to pick a frame dependent on the four neighbor tiles. To get the index of the frame we need we iterate over all neighbors and add the neighbor's value only to the index if there's a fence, too.

So, if no of the neighbors is a fence we use index = 0+0+0+0 = 0 (note that index 0 is the first frame)
If only neighbor north_east is a fence we use index = 0+2+0+0 = 2
If all neighbors are fence we use index = 1+2+4+8 = 15 (the last frame)

Now try again to see this pattern in the order:
fence.png
fence.png (1.88 KiB) Viewed 6509 times
...Have a nice stay

Post Reply Previous topicNext topic

Return to โ€œParks, Sports and Managementโ€

Who is online

Users browsing this forum: No registered users and 4 guests

๏ปฟ