Adding an entry to the landscape menu?

Plug-in related stuff can be discussed here.

Moderator: Plugin Moderators

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

Platform

Adding an entry to the landscape menu?

#1

Post by mdk_813 »

Hey there,
I got another question. Probably a complicated one:
Is there a way to add an entry to the landscape menu that works like the trees (ideally with a randomizer and options to choose certain models)?
I'm currently working on a modular park set and this includes palmtrees, of which I also made versions without ground texture. But, these transparent versions don't really need to be in the park menu, instead it would be nice to be able to use them like the in-game trees (also it would avoid crowding the park menu too much)
Is there a way to do that?
If not, is there a way to add a randomizer and an area-tool to "normal" plugins?
My Plugins: Link

Update Sep 12, 2020:
As I am not really active here anymore, I am not able to answer any PMs in time.
So, as long as you mention me in the plugin and the description, feel free to use or modify my plugins for your own creations.

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

Platform

Plugin Creator

Re: Adding an entry to the landscape menu?

#2

Post by CommanderABab »

Type tree:

Code: Select all

{

 // this is for example, you must provide your own images and id!
  "id":"$tree.ab.unq.00",
  "type":"tree",
  "title":"trees for terrain",
  "text":"4",
  "author":"CommanderABab",
  "frames":[
  
    //you could use {"bmp":"image.png","count":4} here instead
     {"steal":"$loadtreeshere","frame":0,"move y":1,"count":4}
  ],
  "influence pollution":-1,
  "influence noise":-1,
  "influence nature":1,
  "frames per tree":4,
  "influence radioactive":-1
 },
Actually, I'm stealing frames from a park :).

Note the "frames per tree" tag. This means the "bmp" image should have 4 images of the same tree 32 pixels wide. You can load 4 bmp images separately within the frames statement or four versions in one image 128 pixels wide. You can have as many trees as you like which will be chosen randomly at terrain generation by providing multiple sets of images each containing "frames per tree" images.

If you don't provide enough frames, you will get an error.

You can place these trees manually randomly or one particular tree just like the in game trees.
Image

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

Platform

Re: Adding an entry to the landscape menu?

#3

Post by mdk_813 »

Holy, I expected it would be complicated and I really can't' quite follow.
I get that I must provide my own ID and images, that's alright.
And I mostly get that I can provide 4 images of 32px (with different tree-models each?) or one large 128px image.
But, what I don't get is, what you mean by "You can have as many trees as you like which will be chosen randomly at terrain generation by providing multiple sets of images each containing "frames per tree" images".
Do you mean, I can put several 128px-images into "frames" or do I have to make multiple complete entries (from "id" to "influence radioactive" like in your example)?

The thing is, I currently have four different single palms plus two groups of palms all on 1x1 tiles. I would like to have them all in one entry with randomizer and single-choose option.
And I really don't understand how to get that.

Thanks for your efforts and patience, CommanderABab!
My Plugins: Link

Update Sep 12, 2020:
As I am not really active here anymore, I am not able to answer any PMs in time.
So, as long as you mention me in the plugin and the description, feel free to use or modify my plugins for your own creations.

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

Platform

Plugin Creator

Re: Adding an entry to the landscape menu?

#4

Post by CommanderABab »

Then your frames statement would look like:

Code: Select all

"frames":[
  {"bmp": "palm1.png"},
       {"bmp":"palm2.png"},
      {"bmp": "palm3.png"}, 
      {"bmp":"palm4.png"},
      {"bmp": "twopalm1.png"}, 
      {"bmp":"twopalm2.png"}
  
 ],
 "frames per tree":1,
Or you could use

"frames per tree":2, for 3 groups of 2

Or

"frames per tree":3, for 2 groups of 3

and the game would cycle through the images on the same tile continually.
Image

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

Platform

Re: Adding an entry to the landscape menu?

#5

Post by mdk_813 »

So, I've tried it, and at least I was partially successful.
The palms appear as an entry in the terrain menu, BUT, it does not randomize or give me any options to choose. Instead, it just shows the last bmp that I put into "frames".

Here is the code I've used:

Code: Select all

[
   {
      "id":"Palmtrees.mdk_813",
	  "type":"tree",
	  "author":"mdk_813",
	  "frames":[{"bmp":"Palmtree_A_transp_1x1.png","bmp":"Palmtree_B_transp_1x1.png","bmp":"Palmtree_C_transp_1x1.png","bmp":"Palmtree_D_transp_1x1.png","bmp":"Palmtree_group_A_transp_1x1.png","bmp":"Palmtree_group_B_transp_1x1.png"}],
	  "title":"Palmtrees",
  "influence pollution":-1,
  "influence noise":-1,
  "influence nature":1,
  "frames per tree":1,
  "influence radioactive":-1
   }
]
My Plugins: Link

Update Sep 12, 2020:
As I am not really active here anymore, I am not able to answer any PMs in time.
So, as long as you mention me in the plugin and the description, feel free to use or modify my plugins for your own creations.

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

Platform

Re: Adding an entry to the landscape menu?

#6

Post by mdk_813 »

Also, "Palmtree_group_A_transp_1x1.png" and "bmp":"Palmtree_group_B_transp_1x1.png" consist of three palms each in one png. I don't now if this needs to be taken into account or not...
Last edited by mdk_813 on Sat Jul 22, 2017 2:06, edited 1 time in total.
My Plugins: Link

Update Sep 12, 2020:
As I am not really active here anymore, I am not able to answer any PMs in time.
So, as long as you mention me in the plugin and the description, feel free to use or modify my plugins for your own creations.

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2069
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Contact:

Platform

Plugin Creator

Re: Adding an entry to the landscape menu?

#7

Post by KINGTUT10101 »

With multiple frames per tree you can animate it without much effort.

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

Platform

Re: Adding an entry to the landscape menu?

#8

Post by mdk_813 »

KINGTUT10101 wrote:
Sat Jul 22, 2017 2:05
With multiple frames per tree you can animate it without much effort.
Hm, I don't get it.

I want one entry in the menu, which allows me to choose between these 7 options:

1) a randomizer that cycles through all 6 pngs below automatically
2) Palmtree_A_transp_1x1.png
3) Palmtree_B_transp_1x1.png
4) Palmtree_C_transp_1x1.png
5) Palmtree_D_transp_1x1.png
6) Palmtree_group_A_transp_1x1.png
7) Palmtree_group_B_transp_1x1.png
My Plugins: Link

Update Sep 12, 2020:
As I am not really active here anymore, I am not able to answer any PMs in time.
So, as long as you mention me in the plugin and the description, feel free to use or modify my plugins for your own creations.

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

Platform

Plugin Creator

Re: Adding an entry to the landscape menu?

#9

Post by CommanderABab »

mdk_813 wrote:
Sat Jul 22, 2017 2:01
So, I've tried it, and at least I was partially successful.
The palms appear as an entry in the terrain menu, BUT, it does not randomize or give me any options to choose. Instead, it just shows the last bmp that I put into "frames".

Here is the code I've used:

Code: Select all

[
   {
      "id":"Palmtrees.mdk_813",
	  "type":"tree",
	  "author":"mdk_813",
	  "frames":[{"bmp":"Palmtree_A_transp_1x1.png","bmp":"Palmtree_B_transp_1x1.png","bmp":"Palmtree_C_transp_1x1.png","bmp":"Palmtree_D_transp_1x1.png","bmp":"Palmtree_group_A_transp_1x1.png","bmp":"Palmtree_group_B_transp_1x1.png"}],
	  "title":"Palmtrees",
  "influence pollution":-1,
  "influence noise":-1,
  "influence nature":1,
  "frames per tree":1,
  "influence radioactive":-1
   }
]
You have to cycle through until you get the dice image again.

The in game trees use four frames for each tree which are used for wind animation effects.
Image

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

Platform

Re: Adding an entry to the landscape menu?

#10

Post by mdk_813 »

CommanderABab wrote:
Sat Jul 22, 2017 2:17
You have to cycle through until you get the dice image again.

The in game trees use four frames for each tree which are used for wind animation effects.
No, in the menu there is no option to cycle through. No blue arrows and no dice. Just the one preview of the last png. And that is what is build exclusively.
My Plugins: Link

Update Sep 12, 2020:
As I am not really active here anymore, I am not able to answer any PMs in time.
So, as long as you mention me in the plugin and the description, feel free to use or modify my plugins for your own creations.

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

Platform

Plugin Creator

Re: Adding an entry to the landscape menu?

#11

Post by CommanderABab »

CommanderABab wrote:
Sat Jul 22, 2017 1:27
Then your frames statement would look like:

Code: Select all

"frames":[
  {"bmp": "palm1.png"},
       {"bmp":"palm2.png"},
      {"bmp": "palm3.png"}, 
      {"bmp":"palm4.png"},
      {"bmp": "twopalm1.png"}, 
      {"bmp":"twopalm2.png"}
  
 ],
 "frames per tree":1,
Or you could use

"frames per tree":2, for 3 groups of 2

Or

"frames per tree":3, for 2 groups of 3

and the game would cycle through the images on the same tile continually.
Try it with this code.
Image

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

Platform

Re: Adding an entry to the landscape menu?

#12

Post by mdk_813 »

YES, it works!
Thank you guys!
My Plugins: Link

Update Sep 12, 2020:
As I am not really active here anymore, I am not able to answer any PMs in time.
So, as long as you mention me in the plugin and the description, feel free to use or modify my plugins for your own creations.

Post Reply Previous topicNext topic

Return to “Plug-In Discussion”