ellipse=no

The place to post your WML questions and answers.

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.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: ellipse=no

Post by Helmet »

Celtic_Minstrel wrote: December 24th, 2022, 5:45 am This code will remove the ellipse...
It works great! I like the id, and how removing the object to make the ellipse come back, but I especially like this part:

Code: Select all

		[filter_location]
			formula=keep
		[/filter_location]
No keeping track of x,y, which is great, because I often move things around on a map.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Toranks
Translator
Posts: 168
Joined: October 21st, 2022, 8:59 pm
Location: Sevilla
Contact:

Re: ellipse=no

Post by Toranks »

Helmet wrote: December 24th, 2022, 6:35 am
Celtic_Minstrel wrote: December 24th, 2022, 5:45 am This code will remove the ellipse...
It works great! I like the id, and how removing the object to make the ellipse come back, but I especially like this part:

Code: Select all

		[filter_location]
			formula=keep
		[/filter_location]
No keeping track of x,y, which is great, because I often move things around on a map.
You can filter by type of terrain too, In case you only want to remove the ellipse in winter keeps, but not in summer keeps, for example
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: ellipse=no

Post by Helmet »

Toranks wrote: December 24th, 2022, 7:42 am You can filter by type of terrain too, In case you only want to remove the ellipse in winter keeps, but not in summer keeps, for example
I tried filtering by type of terrain and it worked. Now the Snowman can have an ellipse in non-frozen enemy keeps, if I want to do that.

Thanks, Toranks.

Code: Select all

    [filter]
		id=MyLeader
		[filter_location]
            		terrain=Kha #   		<--  Snowy Human Castle Keep
			#formula=keep
		[/filter_location]
	[/filter]
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Celtic_Minstrel
Developer
Posts: 2222
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: ellipse=no

Post by Celtic_Minstrel »

Does terrain=K*a work? If it does, that would match any snowy keep, not just a human one. (Assuming the terrain codes are consistently assigned.) For example, a snowy encampment, or a snowy orcish keep, or a snowy elven keep.

If that doesn't work you would have to list out all the possibilities, like terrain=Kha,Kea,Koa,Kva, etc.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Atreides
Posts: 1075
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: ellipse=no

Post by Atreides »

Celtic_Minstrel wrote: December 24th, 2022, 5:44 pm Does terrain=K*a work? If it does, that would match any snowy keep, not just a human one. (Assuming the terrain codes are consistently assigned.) For example, a snowy encampment, or a snowy orcish keep, or a snowy elven keep.

If that doesn't work you would have to list out all the possibilities, like terrain=Kha,Kea,Koa,Kva, etc.
I've run into this with the Lonely Era!
This was my solution:

Code: Select all

            [filter_location]
                terrain={SNOW_ICE_TERRAIN}
                # terrain=Aa,Aa^*,Ha,Ms,Ms^*,Ai,Rrc^Vhca,Ha^Vhha,K*a,C*a last 2 are wrong, wildcard doesn't work like that
            [/filter_location]

Code: Select all

#define SNOW_ICE_TERRAIN
Rra^*,A*^*,*^Esa,*^Feta,*^Fpa,*^Fda,*^Fma,Ha*^*,Ms*^*,*^Voa,*^Vea,*^Vha,*^Vhca,*^Vhha,*^Vca,*^Vla,*^Vaa,Cea^*,Coa^*,Cha^*,Cva^*,Cfa^*,Kea^*,Koa^*,Kha^*,Kva^*,Kfa^* #enddef
The commented out bit was the original.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: ellipse=no

Post by Helmet »

Celtic_Minstrel wrote: December 24th, 2022, 5:44 pm Does terrain=K*a work? If it does, that would match any snowy keep, not just a human one.
Thanks. terrain=K*a does work!

Atreides wrote: December 24th, 2022, 7:06 pm This was my solution...
Nifty solution. Thanks for sharing it!
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Toranks
Translator
Posts: 168
Joined: October 21st, 2022, 8:59 pm
Location: Sevilla
Contact:

Re: ellipse=no

Post by Toranks »

This is my version:
terrain=A*,Ms*,Ha*,Cea^*,Coa^*,Cha^*,Cva^*,Cfa^*,Kea^*,Koa^*,Kha^*,Kva^*,Kfa^*,Rra^*,*^Esa,*^Fpa,*^Feta,*^Fda,*^Fma,*^Voa,*^Vea,*^Vha,*^Vhca,*^Vhha,*^Vca,*^Vla,*^Vaa
User avatar
Atreides
Posts: 1075
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: ellipse=no

Post by Atreides »

Helmet wrote: December 24th, 2022, 8:27 pm
Celtic_Minstrel wrote: December 24th, 2022, 5:44 pm Does terrain=K*a work? If it does, that would match any snowy keep, not just a human one.
Thanks. terrain=K*a does work!
It does??? I did this under 1.14 where it definitely did not work. Now I wonder if this was an undocumented change in 1.16.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: ellipse=no

Post by Helmet »

Atreides wrote: December 25th, 2022, 9:14 pm It does??? I did this under 1.14 where it definitely did not work. Now I wonder if this was an undocumented change in 1.16.
Maybe check the document for 1.17 -- that's what I'm using.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: ellipse=no

Post by Helmet »

Celtic_Minstrel wrote: December 24th, 2022, 5:45 am [*]I added an ID to your [object] tag so it can be removed later.
[*]Instead of adding an object to put the ellipse back, this version removes the object that made the ellipse go away. using [remove_object]. Since the default state is to have an ellipse (because the unit type definition says so), that'll cause the ellipse to come back.
[/list]
I noticed something unexpected.

When my leader moves out of his keep, he loses his Leadership ability. The ability was given at unit creation within side WML.

Code: Select all

	...
        color=white
        [abilities]
            {ABILITY_LEADERSHIP}
        [/abilities]
        income=-2
        ...
I also noticed that undo stops working when objects are being given or removed.

I read about [allow_undo] in the Wiki. Is there a downside to using [allow_undo] in this situation, to allow the Leader's move on/off his keep to be undone? It seems safe to me, but I thought I should ask. Also, how does one use [allow_undo]?
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
Atreides
Posts: 1075
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: ellipse=no

Post by Atreides »

Helmet wrote: December 25th, 2022, 10:15 pm
Atreides wrote: December 25th, 2022, 9:14 pm It does??? I did this under 1.14 where it definitely did not work. Now I wonder if this was an undocumented change in 1.16.
Maybe check the document for 1.17 -- that's what I'm using.
Ah, that seems to explain it. By coincidence I discovered last night that in 1.16

Code: Select all

terrain=*C*,*K*
is equal to matching ALL terrain.

Looks like an upgrade is coming in 1.18 if the beta version works differently.
User avatar
Celtic_Minstrel
Developer
Posts: 2222
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: ellipse=no

Post by Celtic_Minstrel »

I haven't heard anything about changes to how terrain globs work, but it's possible something was changed that I don't know about, or even "by accident".
Helmet wrote: December 26th, 2022, 8:49 pm When my leader moves out of his keep, he loses his Leadership ability. The ability was given at unit creation within side WML.

Code: Select all

	...
        color=white
        [abilities]
            {ABILITY_LEADERSHIP}
        [/abilities]
        income=-2
        ...
You shouldn't add arbitrary things in unit WML like that, because they will disappear whenever the unit is rebuilt. Adding and removing an object is just one way that could happen – he would have also lost the ability if he simply levelled up (assuming he has an advancement).

(Note: The [side] tag accepts unit WML which will describe the side leader, so even though it's in the [side] tag, that code is still unit WML, not side WML.)

The correct way to add an ability in unit WML is to format it as an object:

Code: Select all

[modifications]
	[object]
		[effect]
			apply_to=new_ability
			{ABILITY_LEADERSHIP}
		[/effect]
	[/object]
[/modifications]
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: ellipse=no

Post by Helmet »

Celtic_Minstrel wrote: December 26th, 2022, 10:44 pm The correct way to add an ability in unit WML is to...
Thanks for the explanation. I have a tendency to think that if something works, then it must be fine, but recently most of my mistakes have been writing code that seems to work, but actually causes weird problems that are difficult for me to debug.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Post Reply