How to remove 'canrecruit=yes' golden crown?
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.
How to remove 'canrecruit=yes' golden crown?
I have a mod that gives their own icon to certain units they can recruit but are NOT the leader.
I'm using this to replace icon on an unit with canrecruit=yes, but doesn't work. Using replace= is the same as add=, both add my custom icon over the gold crown of the new unit that can recruit. How I can delete the gold crown? This gold crown is added automatically by the game, maybe because is added after the event when i use replace?
I have tried this other way to remove overlays at the end of the same event, but it doesn't work either
Code: Select all
[modify_unit]
[filter]
canrecruit=no
[filter_wml]
[variables]
aww_promoted_leader=no
[/variables]
[/filter_wml]
[/filter]
canrecruit=yes
[object]
id=aww_promoted_icon_overlay
[effect]
apply_to=overlay
replace="misc/aww-leader-crown-bronze.png"
[/effect]
[/object]
[variables]
aww_promoted_leader=1
[/variables]
[/modify_unit]
Code: Select all
[remove_unit_overlay]
[filter_wml]
[variables]
aww_promoted_leader=1
[/variables]
[/filter_wml]
image=misc/leader-expendable.png
[/remove_unit_overlay]
Re: How to remove 'canrecruit=yes' golden crown?
Here ya go.
I used Photoshop to remove the crowns.
I used Photoshop to remove the crowns.
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.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: How to remove 'canrecruit=yes' golden crown?
As far as I know, you cannot remove the gold crown on a unit with canrecruit=yes. I think it is added permanently within the game code, and not with an [effect]. However, I know you can cover it. If you move your bronze crown down a few pixels, it looks like it would cover the gold one. (You should move it down anyway because it is covering too much of the movement orb now.)
I don't know what your second code block is demonstrating. Your previous code and image don't show that you added
I don't know what your second code block is demonstrating. Your previous code and image don't show that you added
misc/leader-expendable.png
in the first place, so of course you can't remove it. Also, you added an object.Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: How to remove 'canrecruit=yes' golden crown?
misc/leader-expendable.png, according to the IS_EXPENDABLE_LEADER macro, it is the crown held by leaders who can recruit. I was trying to remove it that way, accordingly, but it didn't work.
image-utils.cfg
image-utils.cfg
Code: Select all
#define IS_EXPENDABLE_LEADER
# Embed this into a unit declaration to add an expendable leader icon to the unit.
[+modifications]
[object]
[effect]
apply_to=overlay
add="misc/leader-expendable.png"
[/effect]
[/object]
[/modifications]
#enddef
Re: How to remove 'canrecruit=yes' golden crown?
By the way, I don't move it a few pixels lower because I don't want it to cover the "Loyal" icon on other units. In any case, the appearance of the crown covering is not bad at all, I will probably end up leaving it that way. But I was especially interested in finding out why it took a while to remove that crown that seems hard-coded.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: How to remove 'canrecruit=yes' golden crown?
Yes, but I didn't see where you used that macro or image, so it looked like you were doing it wrong.
I knew that something was wrong with your code because this does work. (I just tested it to be sure.) However, this is not the best way to remove an overlay because two objects are left in the unit--one that places the overlay, and one that removes it. It would be better to remove the object that added the first overlay instead.
You could make a second version of the loyal icon that is lower. It could also go in front of the crown instead of behind it.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: How to remove 'canrecruit=yes' golden crown?
I think there is a misunderstanding...beetlenaut wrote: ↑November 14th, 2022, 1:10 pmI knew that something was wrong with your code because this does work. (I just tested it to be sure.) However, this is not the best way to remove an overlay because two objects are left in the unit--one that places the overlay, and one that removes it. It would be better to remove the object that added the first overlay instead.
I know this works for any overlay, normally. But NOT with the golden crown we are talking about specifically, the one added by default when we set canrecruit=yes.
Now I'm assuming there is no object in this overlay, nor can it be removed by normal ways, so I'll follow your advice to modify my own overlay to cover the possibilities.
Re: How to remove 'canrecruit=yes' golden crown?
Done. Now I simply filter whether it's trait=loyal or not, and give each one different icons, one that replaces the gold crown with a bronze one overlay, and the loyals the same crown with the loyal bracelet attached.
Thanks!