SRP icon indicating copy to clipboard operation
SRP copied to clipboard

auto_name works even when it's not supposed to

Open SurDno opened this issue 5 years ago • 5 comments

Unlike cut Deliver items quests at Cordon, Garbage, Agroprom and Military Warehouses, the ones at Swamps have unique text strings associated with them. I am pretty sure these quests having unique titles and descriptions in PDA was what GSC intended since these texts are not just left in the game files, they are referenced in quest configs.

And title is used in a news part that appears when you get the quest: image

However, for some reason, neither the title nor the description is present when you hover over the quest in PDA: image

At first I thought it's a basic oversight with auto_name. Having no idea if it's defaulted to True or False, I tried both, and nothing changed. Neither in vanilla nor in SRP.

Related: the same bug also happened when I tried to restore two cut Agroprom quests - Find the dead stalker's loot and Find the missing stalker. Both of these quests do have unique titles but if you restore them, 'Return Item: %Item%' gets displayed instead.

SurDno avatar May 06 '20 20:05 SurDno

Update: that also affects release Military Bring Item quests that do have unique names specified for them but never use them, despite auto_name being set to false by default.

SurDno avatar May 27 '20 21:05 SurDno

Here is the logic in scripts\task_objects.script that governs what name a task receives:

if self.auto_name then
	local title = ""
	if (type == "eliminate_smart") or (type == "capture_smart") or (type == "defend_smart") or (type == "defend_smart_delay") then
		local sname = smart_names.get_smart_terrain_name(self.board.smarts[self.target].smrt)
		title = trans(self.name)..": "..sname
	elseif (type == "recover_item") then
		local item_inv_name = trans(system_ini():r_string(self.requested_item, "inv_name"))
		title = trans("sim_recover_item").." "..item_inv_name
	elseif (type == "find_upgrade") then
		title = trans("sim_find_upgrade").."."
	elseif (type == "bring_item") then
		title = "sim_bring_item"
	else
		title = trans(self.name)
	end
	t:set_title(title)
else
	t:set_title(self.name)
end

In the code above, self.auto_name has a boolean value corresponding to the 'auto_name' field of a task's configuration in configs\misc\tm_*.ltx (defaults to true if missing) and self.name has a string value corresponding to the 'name' field of a task's configuration in configs\misc\tm_*.ltx (defaults to task section name, e.g. 'gar_recover_item_3', if missing).

Decane avatar May 28 '20 19:05 Decane

for some reason, neither the title nor the description is present when you hover over the quest in PDA

That would be because of this code in task_objects.script:

if c < self.ri_counter then
	t:set_title(trans("sim_bring_item").." "..c.." ("..self.ri_counter..")")
	return false
else
	t:set_title("sim_bring_item_text")
	return true
end

Decane avatar May 28 '20 19:05 Decane

As visible from the code above, the 'Recover item' quest names (apparently, not just for Military Warehouses but for other locations as well) should use unique names if auto_name is either left unspecified or set to false. This is the case for most (all?) Return Item quests, but the player always sees 'Return Item: x' instead.

SurDno avatar May 28 '20 21:05 SurDno

As with 'Bring Item' - is it unclear whether it's intended behaviour or more of an oversight? These lines are in configuration files, I suppose they should be used.

SurDno avatar May 28 '20 21:05 SurDno