Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Hidden unit names in adventure mode  (Read 529 times)

Nolimit

  • Bay Watcher
    • View Profile
Hidden unit names in adventure mode
« on: September 06, 2017, 04:45:34 pm »

Is there any way in lua to get description name of a unit in adventure mode, e.g., 'recessed-chin', 'tall-ears' etc. I made a script that sort of simulates a custom dialogs between units. To get their professions and names I use dfhack.units.getProfessionName() and dfhack.units.getVisibleName(). And while getVisibleName takes into account impersonations, it doesn't take into account the fact that adventurer doesn't know npc's name yet.

And is there any flag that determines if name of a unit (histfig?) has been revealed. Also, how is appearance feature chosen to describe unit with a hidden name?

There is small problem with getProfessionName too - it returns profession with capitalized first letter, and normal dialogs use professions with only lowercase letters. But that's not such a big problem, if there is no simple solution to this, I'll just make decapitalizing function. The real question for me is how to return 'appearance' name of the unit.
Logged

Atkana

  • Bay Watcher
  • [CURIOUSBEAST]
    • View Profile
Re: Hidden unit names in adventure mode
« Reply #1 on: September 07, 2017, 02:00:31 am »

If the unit has a descriptor, it'll be stored as their adjective (unit.adjective). I can't help with the other things, though I am now intrigued about how the game stores known names...

Nolimit

  • Bay Watcher
    • View Profile
Re: Hidden unit names in adventure mode
« Reply #2 on: September 07, 2017, 03:42:40 am »

Thanks a lot. I saw adjectives before, but for some reason totally forgot about them. With this I could check for adjective field, if it's empty - it will use real name and profession, if it has something - use adjective and profession. It would be good to know what flag reveals name, but because game clears adjective field as soon as name is revealed I could use it as some sort of a flag.
Logged