Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. Hello Guest!
    Welcome to the Bug Report forum, please make sure you search for your problem before posting here. If you post a duplicate (that you post the same issue while other people have already done that before) you will be given a warning point which can eventually lead into account limitations !

    Here you can find a guide on how to post a good bug report thread.
    Space Engineers version --- Medieval Engineers version
  2. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Programmable Blocks on pasted grids

Discussion in 'Bug Reports' started by Thalyn, Sep 30, 2017.

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

    Messages:
    19
    It would appear that a Programmable Block attached to a grid when it's being pasted into a world (either with Space Master or in Creative) is retaining the exact same state it had when it was copied. This includes not executing the Program method, as well as variable assignments and values. As a result, some scripts can attempt - unsuccessfully - to control a separate grid, rather than the one they're currently attached to as the block IDs will have changed (even if their names have not).

    Since there is no way (that I have found) for a player to detect whether a grid is pasted or not, this requires the addition of dirty work-arounds (such as manual reinitialisation or superfluous comparisons) rather than simply letting the game engine do its thing in order to let such scripts continue to function.

    *ed: It would seem that loading into a world can sometimes cause similar issues with existing grids. This leaves me even less sure as to what could possibly be causing it; though it may or may not be related to the timer block calling the program in the first place.
     
  2. Malware Master Engineer

    Messages:
    9,663
    When a grid is pasted into a world, it's the same as creating a new grid and new blocks (including the PBs), so the programs are recompiled. The scripts are indeed copied, but not the states - it doesn't work that way.

    I think you might be seeing a known but unexplained issue where code run in the scripts' constructors fail to find blocks on subgrids?

    If you have reproducible examples on such worlds, I know @rexxar is looking for them.

    (ps: I'm the author of the compiler, despite not being employed by Keen)
     
  3. Thalyn Trainee Engineer

    Messages:
    19
    Apologies for taking so long to get back. Had a few things come up which drew my attention away.

    I have three (3) "PoC" or "Proof of Concept" grids on my workshop which all show the same basic problem. Two (2) of the three function exclusively by way of intercepting cockpit input, a 60Hz timer block (it repeatedly triggers itself) and a programmable block, while the last has a mode entirely based on that function (which isn't always enabled), and all three won't work until you recompile the program after pasting them into a world or loading a world.

    http://steamcommunity.com/sharedfiles/filedetails/?id=1106998193
    http://steamcommunity.com/sharedfiles/filedetails/?id=895076485
    http://steamcommunity.com/sharedfiles/filedetails/?id=894348192

    (This is why I don't design concept cars - yeesh those grids are ugly!)

    PS That last one has some peculiar (mis)behaviour with the rear leg. It doesn't like "unlocking" after you've pasted it or reloaded it. It may be related to the above, since I do access its rotors via the programmable block.
     
  4. Sinbad Senior Engineer

    Messages:
    2,788
    that seems to be working as intended? haven't we always needed to recompile after paste?
    needing recompile on world load is another story though. they should just carry on where they left off.
     
  5. Noy Apprentice Engineer

    Messages:
    112
    Though it's important to note that a script might store data that persists past recompile. Useful but, if handle poorly can cause weird bugs similar to this.
     
Thread Status:
This last post in this thread was made more than 31 days old.