Energy Moving Through Solids?

  • Hecker
    24th Sep 2023 Member 0 Permalink

    How can I replicate the proton's behavour of moving through solids?
    Ie: if I create an element called radiation and I want it to move through, lets say, Metal ?

  • RebMiami
    26th Sep 2023 Member 0 Permalink

    You can do this using sim.can_move(type1, type2, 2) where type1 is your radiation particle and type 2 is the particle you want it to be able to. For example, if you want a radiation particle called "RADI" to be able to move through METL, you can use sim.can_move(elem.YOURSCRIPT_PT_RADI, elem.DEFAULT_PT_METL, 2)

  • Hecker
    27th Sep 2023 Member 0 Permalink

    How do I do this for every element other then insulation ? 

     

    Sort of an exclusion list:

     

    excludeElements:

    Insulation

    CustomElement1

    Edited 5 times by Hecker. Last: 27th Sep 2023
  • RebMiami
    28th Sep 2023 Member 0 Permalink

    Sadly, there currently isn't a good way to do this. The best way is as follows:

    for i=0,2^sim.PMAPBITS-1 do
    if i ~= elem.DEFAULT_PT_INSL and i ~= elem.YOURSCRIPT_PT_CUSTOM1 then
    sim.can_move(elem.YOURSCRIPT_PT_RADI, i, 2)
    end
    end

    The caveats include:

    • Make sure you put this code after all the places in your script where you allocate elements. Otherwise, elements allocated after this code runs will not interact with your element correctly.
    • There is no guarantee it will work with other scripts. Sometimes it will, and sometimes it won't, dependent entirely on what order the script manager decides to load them in.
  • Hecker
    28th Sep 2023 Member 0 Permalink

    Thank you!