1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Important Be careful with calling programmable blocks from your mods!

Discussion in 'Modding' started by Malware, Mar 29, 2018.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Malware

    Malware Master Engineer

    Messages:
    9,867
    Some of you might have seen a problem where programmable blocks start firing instruction overflow exceptions. Investigations have shown that this is caused by mods calling the programmable block from other threads.

    The programmable block is not, and cannot be, thread safe. Even just getting the programmable block's object builder from another thread will invoke PB code (Save, to be exact), which might mess up the instruction counter.

    Programmable blocks should only be called from the main thread.
     
  2. InVaLiD_EDM

    InVaLiD_EDM Trainee Engineer

    Messages:
    3
  3. mojomann71

    mojomann71 Senior Engineer

    Messages:
    2,005
    With that being said that gives Keen another reason to get rid of the block. :(
     
  4. Malware

    Malware Master Engineer

    Messages:
    9,867
    Not really, no - because the problem isn't the PB, it's the mod code.
     
    • Like Like x 1
  5. InVaLiD_EDM

    InVaLiD_EDM Trainee Engineer

    Messages:
    3
    Most likely Keen won't remove it because it's got so many uses in game, if Keen does remove it, I'm sure someone will recreate it.
     
  6. mojomann71

    mojomann71 Senior Engineer

    Messages:
    2,005
    Well they have moved it to experimental so just anxious that they will remove it.
     
  7. Malware

    Malware Master Engineer

    Messages:
    9,867
    The only way to recreate a PB would be as a plugin, it can't be modded in. It would reduce its use significantly as only a few people would be willing to take the risk of installing a plugin.
     
    • Agree Agree x 2
  8. vasvadum

    vasvadum Apprentice Engineer

    Messages:
    392
    I agree with that last bit. Plugins are dangerous, and should be frowned upon. Keen needs to make Plugins not required for modding the game. Apparently every mod I want to make, will require a plugin. :/ I think.
    I very much doubt Keen would remove the Programming Block though, mass riots would happen, the streets would be flooded with pitch forks and protest signs saying "Bring back Programming Blocks!". :woot:
    I notice this is an old thread, but its also sticky so it doesn't hurt replying as it won't get bumped anywhere. :p
     
  9. Malware

    Malware Master Engineer

    Messages:
    9,867
    Plugins aren't required to make mods. There's hardly any plugins at all, out there, really. Doesn't change your point though; while some things should definitely stay prohibited, they've locked down a bit too much of their own game. Or; more correctly, haven't opened up.
     
  10. Roxette

    Roxette Senior Engineer

    Messages:
    1,546
    Would you care to say what additional things in particular you think should be more accessible for modding?
     
  11. Malware

    Malware Master Engineer

    Messages:
    9,867
    @Roxette Pretty much the entire game save for things that can damage the player's computer... I don't see any reason for restricting anything in mods for other reasons than that. I see modders tearing their hair out all the time because some random element of the game is prohibited.

    I do get why though. It's a whitelist so everything needs to be actively allowed. It's the safest way to do this. Better to err on the side of caution. This means that someone needs to go through the game and vet and whitelist every single aspect of it. That's a lot of work, and as the game changes, so does the whitelist.

    But still.
     
  12. Stardriver907

    Stardriver907 Master Engineer

    Messages:
    3,368
    Add to that the occasional notion that the game is almost finished, which leads to a flood of mods, followed by an update that kills most of them.

    Or at least it seems that way.

    Would be nice if they could get all this sorted out.
     
Thread Status:
This last post in this thread was made more than 31 days old.