Unit description query

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.
Post Reply
User avatar
Spannerbag
Posts: 505
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Unit description query

Post by Spannerbag »

Hi,

I'm working on my UMC and some units have modified resistances that differ from those in their unit_type so when the player right clicks and views the unit description, the information reported is not correct.
Whilst it could be done, I guess, via [set_menu_item], I was wondering if there was any way to create a dummy ability or trait that when clicked and the description is displayed, will report the current resistance values for this unit?

Alternatively, would it be possible to use WML/lua to either:

a) overwrite the resistances in unit description with the actual values for the right-clicked unit, or

b) (maybe even better) add a column to the right of the resistance values that shows the corresponding values for the unit?

Of course, if I've missed something obvious, please enlighten me!


Why am I avoiding [set_menu_item]? I just prefer, whenever possible, to use as limited a palette as possible of interface options.
Just a weird personal hang-up I guess...

If this isn't worth doing or is too difficult no worries, just thought I'd ask :)

Cheers!
--Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Unit description query

Post by vghetto »

Maybe creating your own [movetype] file would solve this. look at data/core/units.cfg for further information.
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Unit description query

Post by Ravana »

It is unit type description, not unit description.

Unit values you can see by hovering on sidebar.
User avatar
Spannerbag
Posts: 505
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: Unit description query

Post by Spannerbag »

vghetto wrote: September 26th, 2021, 2:51 pm Maybe creating your own [movetype] file would solve this. look at data/core/units.cfg for further information.
Thanks for the suggestion - but am now sorted thanks to Ravana (again) :D

But as always, thanks for taking the time/trouble to reply, it's appreciated!

Cheers!
--Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Spannerbag
Posts: 505
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: Unit description query

Post by Spannerbag »

Ravana wrote: September 26th, 2021, 3:36 pm It is unit type description, not unit description.

Unit values you can see by hovering on sidebar.
Many thanks - that's exactly what I wanted :D
Heh, been playing for some time now - can't believe I missed that... :doh:

Anyway, thanks again, one more to do ticked off the list :)

Cheers!
--Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
Post Reply