WML trigger action for each Gg^Vov
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
WML trigger action for each Gg^Vov
Hi
My goal is to make big trees to work as villages on my map
but I can't use "village overlay" on big trees cause it make them dissappear
So I came up with solution to put that overlay over grass(Gg^Vov)
and then put image of the big tree like this:
I'm not going to do this for each tile by hand
and I couldn't find anything like this via google
Is there anyway to do this something like that:
Thank You
My goal is to make big trees to work as villages on my map
but I can't use "village overlay" on big trees cause it make them dissappear
So I came up with solution to put that overlay over grass(Gg^Vov)
and then put image of the big tree like this:
Code: Select all
{PLACE_IMAGE "terrain/forest/great-tree-tile.png" 5 3}
{PLACE_IMAGE "terrain/forest/great-tree.png" 5 2}
and I couldn't find anything like this via google
Is there anyway to do this something like that:
Code: Select all
[terrain_mask]
map="custom_map.map"
[if]
terrain=Gg^Vov
[then]
{PLACE_IMAGE "terrain/forest/great-tree-tile.png" $x $y}
{PLACE_IMAGE "terrain/forest/great-tree.png" $x $y-1}
[/then]
[/if]
[/terrain_mask]
-
- Posts: 1237
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: WML trigger action for each Gg^Vov
[store_locations] with a terrain filter to an array, then use for/each?
Speak softly, and carry Doombringer.
Re: WML trigger action for each Gg^Vov
Can I store whole map?white_haired_uncle wrote: ↑September 27th, 2023, 10:56 pm [store_locations] with a terrain filter to an array, then use for/each?
Could You show me your idea with example?
-
- Posts: 1237
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: WML trigger action for each Gg^Vov
Code: Select all
[store_locations]
terrain=Gg^Vov
variable=big_trees
[/store_locations]
[foreach]
array=big_trees
[do]
{PLACE_IMAGE "terrain/forest/great-tree-tile.png" $this_item.x $this_item.y}
{PLACE_IMAGE "terrain/forest/great-tree.png" $this_item.x $this_item.y-1}
[/do]
[/foreach]
{CLEAR_VARIABLE big_trees}
Speak softly, and carry Doombringer.
Re: WML trigger action for each Gg^Vov
Thanks!
You are amazing!
Now it works
Here's the final result in case someone bumps into this topic with same problem:
one of effects:
You are amazing!
Now it works
Here's the final result in case someone bumps into this topic with same problem:
Code: Select all
[event]
name=prestart
[store_locations]
terrain=Gg^Vov
variable=big_trees
[/store_locations]
[foreach]
array=big_trees
[do]
[set_variable]
name=y_sub_1
value=$this_item.y
sub=1
[/set_variable]
{PLACE_IMAGE "terrain/forest/great-tree-tile.png" $this_item.x $this_item.y}
{PLACE_IMAGE "terrain/forest/great-tree.png" $this_item.x $y_sub_1}
[/do]
[/foreach]
{CLEAR_VARIABLE big_trees}
{CLEAR_VARIABLE y_sub_1}
[/event]