Portraits: a way to have expression & unique level graph
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.
- Eleazar
- Retired Terrain Art Director
- Posts: 2481
- Joined: July 16th, 2004, 1:47 am
- Location: US Midwest
- Contact:
Portraits: a way to have expression & unique level graph
OK, i'm working on a campaign and i frakenstien some different expressions for the hero, and make a version for each of his levels.
Then i realize i don't know how to use these in the scenarios.
What's the easiest way to select a emotion for a particular chunk of dialog, but have the the character's correct level shown?
Then i realize i don't know how to use these in the scenarios.
What's the easiest way to select a emotion for a particular chunk of dialog, but have the the character's correct level shown?
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
-> What i might be working on
Attempting Lucidity
Lots of [if] statements. That's the only way I can think of.
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
name the portraits after the unit type, then store unit type before each dialogue sequence and have image=portraits/$herovariable.type|-{normal, angry, etc}.png in the [message] tag.
I'm not sure if "|" will work in [message] image= [/message]. If not, you'll have to concatenate at the beginning - you should store the unit, then set the variable $profile-normal equal to portraits/$unitname|-normal, etc.
This way has the advantage that, after the initial 20 lines or so per message sequence (which you can make into a macro), you don't need any if-statements or stuff like that. The disadvantage is that you have to have the portrait file names named after the unit type, complete with capital letters, spaces, etc. You could probably fix that with [if] statements in the initial macro...
I'm not sure if "|" will work in [message] image= [/message]. If not, you'll have to concatenate at the beginning - you should store the unit, then set the variable $profile-normal equal to portraits/$unitname|-normal, etc.
This way has the advantage that, after the initial 20 lines or so per message sequence (which you can make into a macro), you don't need any if-statements or stuff like that. The disadvantage is that you have to have the portrait file names named after the unit type, complete with capital letters, spaces, etc. You could probably fix that with [if] statements in the initial macro...
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
just choose a character, name the portriats according to the expression, and then use the right one in the right place.
for angry guy
for happy guy
I really don't see the need for [if] tags (unless his expression depends on previous events, if so, just use the [if] tags, and then do the same as above, but have message the same (or different if you want).
Code: Select all
[message]
description=Eleazar
message="Nothing here"
image=portraits/Eleazar-angry.png
[/message]
Code: Select all
[message]
description=Eleazar
message="Wow! four thousand gold pieces!"
image=portraits/Eleazar-happy.png
[/message]
I really don't see the need for [if] tags (unless his expression depends on previous events, if so, just use the [if] tags, and then do the same as above, but have message the same (or different if you want).
The reason for needing [if]'s:Ranger M wrote:I really don't see the need for [if] tags (unless his expression depends on previous events, if so, just use the [if] tags, and then do the same as above, but have message the same (or different if you want).
Eleazar wrote:different expressions for the hero, and make a version for each of his levels.
ah, didn't see that (and even when I did, It took me a moment to understand)zookeeper wrote:The reason for needing [if]'s:Ranger M wrote:I really don't see the need for [if] tags (unless his expression depends on previous events, if so, just use the [if] tags, and then do the same as above, but have message the same (or different if you want).Eleazar wrote:different expressions for the hero, and make a version for each of his levels.
Do you mean that you want to change your leader often?
Code: Select all
#define CHG_LEADER TYPE
[store_unit]
variable=leader_store
kill=no
[filter]
(the leader)
[/filter]
[/store_unit]
{VARIABLE leader_store.type {TYPE}}
[unstore_unit]
variable=leader_store
[/unstore_unit]
{VARIABLE msg {TYPE}}
#enddef
#define LEADER_MSG TEXT
[message]
description=(leader´s description)
message=_{TEXT}
image=$msg|.png
[/message]
#enddef
First read, then think. Read again, think again. And then post!
*Sigh*
What Eleazar is trying to do is not hard to understand. He wants to have 1. different portraits based on the level of the hero, and 2. different portraits for different "emotions" of messages. Toms' macro is useless here.
This is doable. Here's the macro:
Then, in all situations where there will be dialogue, put:
Then have files in images/portraits/ named "Unit Type-normal.png", "Unit Type-happy.png", etc.
What Eleazar is trying to do is not hard to understand. He wants to have 1. different portraits based on the level of the hero, and 2. different portraits for different "emotions" of messages. Toms' macro is useless here.
This is doable. Here's the macro:
Code: Select all
#define START_DIALOGUE
[store_unit]
[filter]
description=Leadername
[/filter]
variable=temp
[/store_unit]
[set_variable]
name=leader-portrait
value=portraits/$temp.type|-normal.png
[/set_variable]
[set_variable]
name=leader-portrait-happy
value=portraits/$temp.type|-happy.png
[/set_variable]
- - -
#enddef
Code: Select all
{START_DIALOGUE}
[message]
description=Leadername
image=$leader-portrait
message= _ "Hi."
[/message]
[message]
description=Leadername
image=$leader-portrait-happy
message= _ "I'm happy."
[/message]
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
Not that if it is for 1.1.1+ you can use level= as a key for standard unit filter.
Then you cound do things like :
However i find Turin's technique more elegant and portable.
Then you cound do things like :
Code: Select all
[if]
[have_unit]
side=1
canrecruit=1
level=1
[/have_unit]
[then]
<code for level 1 unit>
[/then]
[else]
... idem for lvl 2, 3, ect...
[/else]
[/if]