[SOLVED] Specific request from City-State quests?

stack_man

Chieftain
Joined
Jul 2, 2021
Messages
2
I need to determine what specifically a City-State wants in its quest, such as a campus or a spearman, and use this info to determine the name of the icon for that unit/district/etc.

My original method was to take a substring of the quest name (ex. "Build a Campus District"), but this does not work if the language is not English.

Is there any way to get this information directly?
 
In the end, I used something like this to compare every quest description until I found a match:

Code:
local questLocName = "LOC_"..questType.."_INSTANCE_NAME"

for info in GameInfo.Units() do
    if questName == Locale.Lookup(questLocName, info.Name) then
        iconName = info.UnitType;
        break;
    end
end
 
Back
Top Bottom