Skip to content

[#2796] Reorder comms data assignment in station placement#2797

Closed
oznogon wants to merge 1 commit intodaid:masterfrom
oznogon:2796-comms-on-place-station
Closed

[#2796] Reorder comms data assignment in station placement#2797
oznogon wants to merge 1 commit intodaid:masterfrom
oznogon:2796-comms-on-place-station

Conversation

@oznogon
Copy link
Contributor

@oznogon oznogon commented Mar 18, 2026

In ECS, setTemplate() overwrites the entity's CommsReceiver component to use the default comms script.

In place_station_scenario_utility.lua, re-initialize setCommsFunction immediately after applying setTemplate in placeStation. On legacy this should be idempotent, on ECS this should restore the expected state.

Should fix #2796.

In ECS, setTemplate() overwrites the entity's CommsReceiver component
to use the default comms script.

In place_station_scenario_utility.lua, re-initialize setCommsFunction
immediately after applying setTemplate in placeStation. On legacy this
should be idempotent, on ECS this should restore the expected state.
@oznogon oznogon changed the title Reorder comms data assignment in station placement [#2796] Reorder comms data assignment in station placement Mar 18, 2026
end
end
if commsStation ~= nil then
station:setCommsScript(""):setCommsFunction(commsStation)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setCommsScript is redundant (setting a function overrules a script) and this looks odd, does it this depend on some global?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to throw this valid hot potato at @Xansta

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I did both setCommsScript to an empty string and setCommsFunction to the desired function based on something that happened when I was first writing scripts several years ago. I can't tell you why specifically, because I don't remember. I have not gone back to change instances because while it's redundant, and my reasons are fuzzy, it still works and I've been spending my time writing other scenario scripts

@oznogon
Copy link
Contributor Author

oznogon commented Mar 18, 2026

Closing in favor of #2798

@oznogon oznogon closed this Mar 18, 2026
@oznogon oznogon deleted the 2796-comms-on-place-station branch March 18, 2026 20:55
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

Successfully merging this pull request may close these issues.

[Bug] lua setCommsFunction(commsStation) not registering the function

3 participants