Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto_name works even when it's not supposed to #106

Open
SurDno opened this issue May 6, 2020 · 5 comments
Open

auto_name works even when it's not supposed to #106

SurDno opened this issue May 6, 2020 · 5 comments

Comments

@SurDno
Copy link
Contributor

SurDno commented May 6, 2020

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
Copy link
Contributor Author

SurDno commented May 27, 2020

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 SurDno changed the title Deliver items text bug auto_name works even when it's not supposed to May 27, 2020
@Decane
Copy link
Owner

Decane commented May 28, 2020

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
Copy link
Owner

Decane commented May 28, 2020

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

@SurDno
Copy link
Contributor Author

SurDno commented May 28, 2020

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
Copy link
Contributor Author

SurDno commented May 28, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants