Setting tmp of a CRAY spawned particle.

  • Jerehmia
    5th Mar 2022 Member 0 Permalink

    I'm trying to set the tmp property of particles spawned by a CRAY. At the bottom of the CRAY Wiki page there is a protip which mentions the ctype = element_id + 512 * tmp_value formula to achieve this, but whenever I try to set the CRAY's calculated ctype property with the PROP tool the CRAY's ctype gets erased and the CRAY copies it from the type of the first particle that touches it (the conductor meant to spark it).

     

    Am I doing something wrong or has setting calculated ctype values become impossible, presumably after the introduction of the "Prevent property tool from being used with invalid values" feature in version 96.2?

     

    I'm quite sure I understand the formula, spawning a DEUT particle (id 95) with a tmp of 100 would mean setting the CRAY's ctype to 95 + 512 * 100 = 51295 for instance.

  • LBPHacker
    5th Mar 2022 Developer 0 Permalink
    I'm trying to set the tmp property of particles spawned by a CRAY. At the bottom of the CRAY Wiki page there is a protip which mentions the ctype = element_id + 512 * tmp_value formula to achieve this,

    This only works with particles that handle the "v" creation parameter in their create function, the way FILT does. Particles don't do anything with this by default; in fact, the only one I can think of right now that does is FILT. The protip is correct in that this works with FILT, and also correct in not claiming that it works with anything else.

    but whenever I try to set the CRAY's calculated ctype property with the PROP tool the CRAY's ctype gets erased and the CRAY copies it from the type of the first particle that touches it (the conductor meant to spark it).

    This is not true. At least when I set the ctype of a CRAY to 51295, it stays 51295 (only the type bits are checked for validity), confirmed by running sim.partProperty(id, "ctype"), where id is the ID of the CRAY. The HUD doesn't reflect this because it still renders 51295 as "CRAY(DEUT)", as the type bits of 51295 still just "read" DEUT.

    presumably after the introduction of the "Prevent property tool from being used with invalid values" feature in version 96.2?

    Completely unrelated fix. You used to be able to use the tool and set invalid properties with it if the tool was configured wrong, even though it'd give you an error message.
    Edited 2 times by LBPHacker. Last: 5th Mar 2022
  • Jerehmia
    5th Mar 2022 Member 0 Permalink

    @LBPHacker (View Post)

    I'm sorry, I just rebooted and now everything works as expected.

     

    I tested this several times before posting with new saves and after restarting the binary. I even tested once more after reading your answer, the PROP tool really erased the CRAY's ctype before the reboot, the HUD rendered it as CRAY() and sim.partProperty(1, "ctype") produced a 0 (particle 0 was the conductor).

     

    I don't know what happened there, sorry for the inconvenience. I'll reboot before posting a possible bug the next time.

     

    Ignore this thread please.