Skip to content

Current questions and answers regarding the map editor.

User Avatar
#2936
Auto-translated
Regarding the icons for TalkBox, the table I compiled might be useful:
http://yadi.sk/d/E3j_pQhhCXj8w

To use it, you need to:
1. Place the const.lua file in the game folder along with the other files.
2. Include it in your main script: doFile(GetMapDataPath()..'const.lua');
3. In TalkBox, instead of an icon, pass something like icons_table['Titan'] - this will display the Titan icon (note that the parameter must be a string, so quotes are required. Theoretically, icons_table.Titan should also work, but I haven't tested it).
4. You can, of course, view the list of possible icons in the file itself. It contains all the monsters, some of the heroes, seemingly all the building icons on the map, and some other minor things. There are minimal comments. The table is not yet complete; I periodically add to it as I use a very large number of TalkBoxes on my map.

5. As a bonus, this file also contains a second table - creatures_table. With its help, you can obtain the following parameters for a monster by its ID:
- the path to the file with the monster's name
- the monster's strength parameter
- a string that can be used to extract the monster's icon from the previous table.
To clarify the last point: if you need to display the icon of a specific monster and you have its ID on hand, say CREATURE_PEASANT, then you can obtain the icon for TalkBox in this way:
icons_table[creatures_table[CREATURE_PEASANT][CREATURES_TABLE_ICON]]
Another possible use of this table is, for example, if you are displaying a TalkBox from the perspective of a certain monster, you can use its name as the title (parameter titleTextRef) by simply specifying creatures_table[CREATURES_TABLE_NAME]

If anything is unclear, feel free to ask.