[added] Dual Elbow & Fork wire components #2000
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
g_debug = 1
in console) should visualise how much power is in the 2nd set and where it is going.Description
Fixes #1716
This PR changes logic in
MechanismsCommon.as
and all component script files to support a 2nd set ofinput topology
,output topology
,power_new
andpower_old
. They have the same names but with a2
appended to it at the end. The first set is refered to as "section 0" and the second set is refered to as "section 1".The two new tiles make use of the 2nd set, whereas all the other components don't, making
Activate()
,Deactivate()
andSpecial()
return early from the function if it detects that it is called with any set that isn't "section 0".Since the builder inventory menu couldn't fit both new component tiles on the 2nd page, I made it so it will be enlarged by an additional row when playing in Sandbox.
It isn't necessary to add a Dual Elbow to the game, I just did it here because I could and wanted to show off it's possible.
Tested offline, works as intended.
Although it is technically ready, it is probably possible to improve the code.
Initially, I tried implementing a class object that contains a whole set (see above), with the
MapPowerGrid@
receiving an array of such objects viagrid.setAll()
. Unfortunately the game kept crashing during loading each time so I resorted to implementing a second set of primitive variables instead.