Any way to get save infos into variable?

  • Jerehmia
    7th June Member 0 Permalink

    @jacob1 (View Post)

     I find this all a more than a bit ridiculous.

     

    First I produce a working function that returns the  json from a http request and you tell everyone it can't be done for the obscure reason that the httprequest implementation is buggy in WASM. Well, guess what, nobody is going to run their scripts in the browser version of TPT, plus I apparently did the impossible with my code.

     

    Then there is the point that if my code doesn't work it bugs out after blocking the game for a few seconds and that's a huge issue, but if you create a tick() function that takes too much time and bugs out after a blocking the game for a few seconds that's no problem.

     

    I'm an academically educated systems programmer and I'm about to give up responding in the forum because of the way you treat my input.

    Edited 4 times by Jerehmia. Last: 7th June
  • jacob1
    7th June Developer 0 Permalink
    @Jerehmia (View Post)
    I guess I can't understand your hostility, I don't feel like I've been rude to you, but maybe it felt that way when I pointed out the problems in your post. That's definitely not my intention though. Since this is a help thread for someone else, I wanted to make sure z4dg9ssw135 didn't get misled on how to solve the problem.

    The reason I pointed out the WASM flaw isn't because I think WASM matters, it's because some refactors @LBPHacker made to the http request code means that the same freezing problem in WASM will apply to all versions of TPT once 100.0 releases. Therefore, your script will freeze the game every time.

    As for the rest, I don't have a "nice" way to say it. Your understanding of both coroutines and of tick functions is completely wrong.

    Again, I was just trying to correct it and point you in the right direction. You seemed to mix up coroutines and multithreading, and thought you had written an asynchronous method when it was actually blocking (and will block until the request completes). You're also still under the impression that checking httpreq:status in a tick function can hang the game, when that isn't the case. It's non-blocking, and will allow the game to run while the request runs in the background.

    If you don't want to respond anymore on the forum, that's fine. If you do respond, all I ask is that you be respectful, and don't take attempts to correct / fix your code as a personal attack.
    Edited 2 times by jacob1. Last: 7th June
  • z4dg9ssw135
    9:07:09 Member 1 Permalink

    Anyways lets not start a flame because of that.

    The code works thanks to both of you and it is good.

    At least im not stuck with http requests anymore and can finally make the rest.