MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 430 forks source link

[1.12.2] Wireless messages not working - event.pull("modem_message") #3444

Closed Jlectric closed 3 years ago

Jlectric commented 3 years ago

Hello. OpenComputers Version: 1.7.5.192 (on 1.12.2) Here's my issue in a video

This issue seems to have appeared before in OC version 1.6.8: #2681 (It seems the issue was closed as others weren't able to reproduce it) The cause suggested by MakotoMiyamoto doesn't seem to be correct as I was able to recreate the issue playing in survival too

Here is my world file if that is at all useful... New World.zip

RobertCochran commented 3 years ago

Wireless modems do not automatically send their messages over the air - you need to use the setStrength() method and give it a non-zero range with which to send messages over (see https://ocdoc.cil.li/component:modem ). That seems to imply to me that a relay will automatically set its strength to the maximum provided by the card (which is why it worked when you did it that way), but to be honest, it's been a while since I've played a lot with OpenComputers.

Jlectric commented 3 years ago

@RobertCochran Thanks for your response - I have just tried this (in the lua shell) but it doesn't seem to fix the issue. getStrength() returns 16 and setStrength() also always returns 16 for any value over 16. It would seem that the default range is the maximum of the card. (Running the example modem code has the same result as previously)

RobertCochran commented 3 years ago

A tier 1 wireless card by default has a maximum range of 16, which is consistent with what you're seeing.

However, now that I'm actually testing this out... I am 100% consistently getting the same behavior, also with 1.7.5.192 on Minecraft 1.12.2. T1 wireless cards are refusing to communicate directly with each other. Wireless communication only works when one end is wired into a relay with a wireless card, but only the side that's wired into the relay will get any messages.

Further testing with T2 wireless cards was perfectly fine. Under the same circumstances, even with the range reduced to the T1's 16 block limit, it's been perfectly fine and direct communication is happening as expected.

Kristopher38 commented 3 years ago

Please try upgrading to one of the latest working dev build (https://ci.cil.li) and retest, as similar issue regarding T1 wireless cards has been already resolved in the past.

Jlectric commented 3 years ago

@Kristopher38 Tried this with version 1.12.2-1.7.5.217 and it works fine - Thanks

To others experiencing this issue either use a newer build of the mod as it has been fixed (may not be stable?) Or just use the tier 2 card - @RobertCochran has tested that the tier 2 card doesn't have the same issue (I have also found it to work)