How do I make an element reflect protons

  • SARIEL42
    16th Jun 2021 Member 0 Permalink

    In the LUA api, how do I make an element reflect protons instead of letting them pass through

  • jacob1
    17th Jun 2021 Developer 0 Permalink
    Use the sim.can_move function

    It looks like sim.can_move(tpt.el.prot.id, tpt.el.brck.id, 0)

    for can_move, 0 means "don't allow pass through", 1 means "swap positions", and 2 is "pass through - occupy same space".

    This function is present in the current version of the game, but is very unreliable and prone to being reset. The next version of the game fixes this so that can_move changes stick. Plan is to release that version this month (although I made that plan before having several huge distractions this month).
  • SARIEL42
    18th Jun 2021 Member 0 Permalink

    @jacob1 (View Post)

     It worked, thanks!