Add custom function to default element

  • Ahpiox
    4th May 2018 Member 0 Permalink

    Can i add custom function to existing default elements (OXYG, for example), i just want to create Silicon, that formed from OXYG fusion, but when i tried to do this - i failed. Some help, please...

  • TPT_PL
    4th May 2018 Member 0 Permalink
    Try tpt.elem_func(). Look the documentation up in the Wiki. (Weird thing, sim.partProperty(X, "Update") doesn't work that way.)
  • Ahpiox
    4th May 2018 Member 0 Permalink

    @TPT_PL (View Post)

     I learned about that some minutes ago, and also looked at huge lua scripts, and i got this stuff. Thanks

  • TPT_PL
    4th May 2018 Member 0 Permalink
    @Ahpiox (View Post)
    Was one of the scripts mine? :->
  • Ahpiox
    7th May 2018 Member 0 Permalink

    It was CHEM-MOD by Kev_AK, so dont mind

  • jacob1
    7th May 2018 Developer 0 Permalink
    @TPT_PL (View Post)
    I'm pretty sure sim.partProperty(X, "Update") works for default elements. If not, it's a bug. There's a good chance i'm removing tpt.element_func and all the tpt.register_ functions in the next update. tpt.element_func has had a replacement for a very long time, no excuse to still be using it. tpt.register_keypress can't possibly work in the next version and needs to be split into two events that I'd like to put inside a new events api.
  • Ahpiox
    8th May 2018 Member 0 Permalink

    @jacob1 (View Post)

     But what if i will try load a old script with tpt.element_func in the next versions of game? It is i need to rewrite whole script to load it normally, or there will be some stuff for this?

  • jacob1
    8th May 2018 Developer 0 Permalink
    @Ahpiox (View Post)
    I could probably provide a script to give compatibility back, but for new scripts, use the newer functions.