Take On Mars

Take On Mars

Not enough ratings
Fix Sample Replication
   
Award
Favorite
Favorited
Unfavorite
Item Type: Modification
Dependencies: Standard
File Size
Posted
Updated
81.166 KB
12 Aug, 2020 @ 6:35pm
12 Aug, 2020 @ 6:52pm
2 Change Notes ( view )

Subscribe to download
Fix Sample Replication

Description
Fixes an existing bug(as of build 39544) where survey tools fail to replicate to non-host clients information regarding where a sample was taken. This resulted in sample analysis results failing to replicate to said clients.

Mod changes one of the methods in the controller scripts for the soil scoop, drill and atmospheric sample collector. I'm not aware of any mods also changing these, however.
9 Comments
RA2lover  [author] 16 Sep, 2020 @ 6:54pm 
Main branch. Haven't checked for differences in the test branch.
Mr. Monochrome [Hood Certified] 16 Sep, 2020 @ 1:36pm 
@RA2lover

Is this for the main or test branch of the game? I ask because maybe this was fixed in the test branch. A lot of players don't know there are two branches still for this game the main and test branch. The latter has more updates then what the main branch has. The issue *might* be fixed there.
ryan_ 23 Aug, 2020 @ 4:22am 
Clear. More and more communicating with the creators of mods, I come to the conclusion that Dram (the lead developer) did not do anything. Since the problems are solved with a simple copy-paste of entire sections of scripts.
RA2lover  [author] 22 Aug, 2020 @ 6:59pm 
Sort of. While you can get a high-level understanding of how the controller scripts work by reading them, I just didn't bother checking whether you can make a mod change only specific methods within a class, and included the entire classes when writing this mod. If there's a way to only include the modified methods within a modified class, just let me know how and i'll update the mod to do that.

The only change made within each modified class was adding a line calling SynchGenVec within CreateSample after the created sample entity is fed with data telling where the sample was taken.

As for surface type check, it's contained within UpdateAuger, which is kind of a god method within the soil scoop controller class. Similar logic is present in UpdateDrilling on the hand drill controller class, but including ice and snow material enums.
ryan_ 22 Aug, 2020 @ 6:14pm 
SO you don't understand how scripts work. You stupidly copy them as they are. Without changing anything about them. Right ?
RA2lover  [author] 22 Aug, 2020 @ 6:12pm 
what do you mean by that?

I don't have documentation on the full API mods have access to - only the existing examples. This mod also copies the entire controller script from the hand tools - so it would probably be incompatible with other mods affecting these.

The controllers should have a list of valid surface materials - fixing that to include ice would solve that issue, but i'm not exactly aware of which surface types exist and where they do within map locations.
ryan_ 22 Aug, 2020 @ 12:58pm 
UFF. I See. Concerns multiplayer. And I thought that the bug with taking a sample was fixed. There is such a problem. On maps where there is a lot of ice, such as South Polar Cap, you can't take a Soil sample. However, I have already found a way to fix this bug. Do you have a full description of the script programming developer ?
RA2lover  [author] 22 Aug, 2020 @ 9:05am 
@ryan_: Multiplayer mode has a bug you can reproduce by:
1 - Joining a server as a client
2 - Taking a sample from a survey tool(soil scoop/hand drill/atmospheric collector)

Within the perspective of a client, that sample will be unnanotated instead of having a label indicating where it was collected. If that sample gets analyzed, the map resource view doesn't update for those clients.

Why? The server, when creating the sample, forgets to tell to other players where the sample was collected in. The fact a sample was created is passed on to clients, but because it forgot to tell them where it was taken, the clients don't know it and can't act on it.

The mod changes these tools, adding a script line telling the server to tell clients where the sample was taken. This not only provides label location info, but also lets them know which sectors to update in the map resource view once the sample gets analyzed. Without this fix, they'd need to leave the server and rejoin to get updates.
ryan_ 21 Aug, 2020 @ 2:40pm 
And in more detail ? Nothing is clear from the description. What exactly has been changed. What exactly did this lead to