female and [object] description
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.
female and [object] description
Hi,
I have a pickupable object that needs to show a different string depending the unit's gender. Is there a way of doing that without having to define the same object twice with 2 descriptions inside an [if] unit.gender?
https://github.com/virtualghetto/Vaelia ... .cfg#L1831
I have a pickupable object that needs to show a different string depending the unit's gender. Is there a way of doing that without having to define the same object twice with 2 descriptions inside an [if] unit.gender?
Code: Select all
[object]
name= _ "Poison"
image=items/potion-poison.png
duration=scenario
description= _ "$unit.name pricked her finger on a rusty nail."
[effect]
apply_to=hitpoints
increase=-10%
[/effect]
[effect]
apply_to=status
add=poisoned
[/effect]
[/object]
- Elvish_Hunter
- Posts: 1576
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: female and [object] description
Maybe before that
[object]
you can store the correct pronoun in a variable, then use $pronoun
instead of "her" in the message.Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Re: female and [object] description
Yes thank you, I was hoping to avoid the extra [IF], but there might not be a way around that. I guess [object] could be a good candidate for a new female_description field?
-
- Inactive Developer
- Posts: 503
- Joined: April 24th, 2016, 4:18 pm
Re: female and [object] description
Check out OBJ_SWORD_FIRE in HttT httt_utils.cfg
I forked real life and now I'm getting merge conflicts.
Re: female and [object] description
Thank you so much for that. I didn't know I could use message inside of object, it helped a lot.
- Celtic_Minstrel
- Developer
- Posts: 2223
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: female and [object] description
No, that won't work for localization. You would need to store the entire correct string, not just the pronoun.Elvish_Hunter wrote: ↑December 10th, 2019, 8:44 pm Maybe before that[object]
you can store the correct pronoun in a variable, then use$pronoun
instead of "her" in the message.