Unit portrait not showing? [Solved]

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
kurt751
Posts: 232
Joined: June 4th, 2016, 11:17 pm

Unit portrait not showing? [Solved]

Post by kurt751 » September 12th, 2016, 4:39 pm

I made a simple unit (it's not my first) which works as expected, except in dialogues I don't get the picture set under [portrait], it just shows the unit sprite. :shock:
I tried using another portrait picture, taken from another unit (which works normally), but no portrait image will show up in the new unit, no matter what I do. I'm going insane...

Here is what the unit .cfg looks like (I cut out the attack stuff to make it shorter):

Code: Select all

[unit_type]
    id=Saruq
    name= _ "Saruq"
    race=khalifate
    image="units/saruq.png"
    {MAGENTA_IS_THE_TEAM_COLOR}
    hitpoints=82
    movement_type=khalifatearmoredfoot
    movement=7
    experience=150
    level=4
    alignment=lawful
    advances_to=null
    {AMLA_DEFAULT}
    cost=100
    upkeep=free
    usage=fighter
    description= _ "Bathim guards have trained all their lifetime in the hope of becoming the guards of the famed University of Bathim. Only the very best are accepted. Saruq is their current leader, and apparently on a mission."+{SPECIAL_NOTES}+{SPECIAL_NOTES_MARKSMAN}+{SPECIAL_NOTES_SLOW}
    die_sound={SOUND_LIST:HUMAN_DIE}
    {DEFENSE_ANIM "units/saruq.png" "units/saruq.png" {SOUND_LIST:HUMAN_HIT} }
      [portrait]
        size=400
        side="left"
        mirror="false"
        image="portraits/transparent/SaruqP.png"
      [/portrait]
      [portrait]
        size=400
        side="right"
        mirror="true"
        image="portraits/transparent/SaruqP.png"
      [/portrait]
        {TRAIT_FEARLESS_MUSTHAVE}
      [abilities]
        {ABILITY_SKIRMISHER}
      [/abilities]
        ...
[/unit_type]
The path to the portrait picture is correct (copy/pasted from another unit sheet), and as I said, even if I copy the whole "image=some.png" line from another unit, I still won't get anything else in dialogue than the unit sprite. I tried changing the unit sprite, so I'm sure the dialogue uses the unit sprite and not something else.
What is going on? I have already created 12 other hero units, and they all worked without a problem... :shock:
Last edited by kurt751 on September 12th, 2016, 4:49 pm, edited 1 time in total.

kurt751
Posts: 232
Joined: June 4th, 2016, 11:17 pm

Re: Unit portrait not showing? Why?

Post by kurt751 » September 12th, 2016, 4:49 pm

Found it. Forgot the profile= line. :doh:

Post Reply