Diiferent images for same unit
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.
Diiferent images for same unit
Hi, I have a question.
I want to make unit, that will have different images for different hp status; something like 3 images for 100% hp, 66% hp and 33% hp.
Is it real and if yes, how can I do it?
I want to make unit, that will have different images for different hp status; something like 3 images for 100% hp, 66% hp and 33% hp.
Is it real and if yes, how can I do it?
- Lord-Knightmare
- Discord Moderator
- Posts: 2361
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: Diiferent images for same unit
Well, you could try something using these tags:-
Make sure to do this inside an event(s) tag.
Code: Select all
[unit]
[modifications]
[object]
[effect]
apply_to=hitpoints
increase=66%
[/effect]
[/object]
[object]
[standing_anim]
[/standing_anim]
[/object]
[/modifications]
[/unit]
Code: Select all
[event]
[/event]
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Re: Diiferent images for same unit
It could be done with the a bit forgotten variationWMLElmor wrote:Hi, I have a question.
I want to make unit, that will have different images for different hp status; something like 3 images for 100% hp, 66% hp and 33% hp.
Is it real and if yes, how can I do it?
Spoiler:
- pyrophorus
- Posts: 533
- Joined: December 1st, 2010, 12:54 pm
Re: Diiferent images for same unit
Hi !
HTH,
That's right, but you can use modify_unit to apply variations instead of objects (better I think, because objects accumulate in unit description):trewe wrote: It could be done with the a bit forgotten variationWML
Code: Select all
[modify_unit]
[filter]
id=$unit.id
[/filter]
variation=injured
[/modify_unit]
HowTos: WML filtering, WML variables
Re: Diiferent images for same unit
Will not work if the stats of the variation differ from the base unit. modify_unit>variation only changes names and the images, any stats (moves, attacks, defences, hitpoints) are not applied. Although that may be irrelevant in this particular case since the OP only wants to change images anyway... Against object stacking one can use clear_variable to erase unused ones.pyrophorus wrote:That's right, but you can use modify_unit to apply variations instead of objects (better I think, because objects accumulate in unit description):