does new wire require rewriting sprk

  • ReallyJustDont
    27th Jun 2020 Member 0 Permalink

    If I want to create a new conductive/wire element that uses SPRK, would I have to rewrite the SPRK update function, or is it automatically compatible somehow

    Edited once by ReallyJustDont. Last: 27th Jun 2020
  • Fusionftw
    28th Jun 2020 Member 0 Permalink
    This post has been removed by LBPHacker: 1) not true 2) has syntax errors 3) should be on pastebin
    Edited 7 times by Fusionftw. Last: 28th Jun 2020
  • LBPHacker
    28th Jun 2020 Developer 1 Permalink
    You just have to add the PROP_CONDUCTS and PROP_LIFE_DEC properties to your element. In C++ that would be just OR-ing them into Properties, that is:Properties = ... | PROP_CONDUCTS | PROP_LIFE_DEC;... if they're not already there; this is how METL does it. In Lua it'd be something likeelem.property(your_id, "Properties", bit.bor(elem.property(your_id, "Properties"), elem.PROP_CONDUCTS, elem.PROP_LIFE_DEC))
  • ReallyJustDont
    29th Jun 2020 Member 0 Permalink

    ah, thanks. so if i do create an element, for example a "silver" element based on brck, which just has CONDUCTS and LIFE_DEC with no update function, what elements would it conduct to and from by default?

  • LBPHacker
    29th Jun 2020 Developer 0 Permalink
    Everything else with those properties, plus/minus whatever exceptions there are in SPRK's code.