Changing particle colors

  • optifine55
    15th Jan 2023 Member 0 Permalink

    How do i change a particle's color using the console? I wanna turn the color to red but I don't know the hex code

     

    Tried using tpt.el.glow.color=FFFF0000 but that didn't work

  • LBPHacker
    15th Jan 2023 Developer 1 Permalink
    Beyond the commands that begin with !, the console is just a Lua console, so your commands have to adhere to Lua syntax. What you want is hexadecimal notation, which is introduced by 0x in Lua. You probably want tpt.el.glow.color = 0xFFFF0000.

    Things of note:
    • you don't actually need to specify the alpha channel, it gets ignored in the Color property;
    • you really should use utilities in the sim and elem API namespaces instead; in this case, elem.property(elem.DEFAULT_PT_GLOW, "Colour", 0xFF0000);
    • this sets the Color property for not one particle but the element, which each particle is an instance of.
    Edited once by LBPHacker. Last: 15th Jan 2023
  • optifine55
    16th Jan 2023 Member 0 Permalink

    @LBPHacker (View Post)

     I tried both of those commands didn't work and yes sorry for the misunderstanding I meant to change the color of the element not a single particle

    Edited once by optifine55. Last: 16th Jan 2023
  • LBPHacker
    16th Jan 2023 Developer 0 Permalink
    Define "didn't work". You can change glow's Colour property, but that doesn't mean glow particles will actually be rendered with that colour. Glow has a custom graphics function, you'll have to look into how those work.