Create Fractal Flame Scripts Pt 4

Time Needed : 30 minutes

The inner workings!

Well if you've completed the previous three tutorials (links at bottom of this) then well done you, no really, be proud. It can take time to get your head around a lot of this, so well done! What I'll discuss next is how to set values you would normally do with sliders and the like within JWildfire. This can be useful for three reasons:

To control things like gamma or brightness so scripts look their best.

To randomise settings to give random background colours for example each time your script is run.

To set the name of your script in the title area, so flames created with the script contain whatever you put in the title.

The flame set command

This is the basis for most of this tutorial, the flame set commands you'll see at the top of your script if you've created a script from a flame. Adding new ones is as simple as creating a blank line underneath the main ones and adding your own. I'll list some underneath, but first let's take a look at some of the ones that are there. Don't forget that after you have made modifications, save your script then click the rescan button in JWildfire.

  1. Default Flame Set Commands

    In the picture you'll see the flame set commands that are contained when you create a script from a flame. You'll see they take the format flame.set…… with values. So in the screenshot you see “flame.setCamZoom(0.40726252);” this refers to the zoom value of the fractal. If you switch back to JWildfire and look for zoom that's what this refers to. You can either set it to a new value, or use the range command from tutorial 3 to randomise the zoom value.

    You'll also see some values have been commented out with the double slash // you can remove the slash characters to uncomment these lines and change the brightness and gamma values.

    My tip here is to go to JWildfire and double click in an area for any of these so say perspective for example. Double click the value in JWildfire, then do a CTRL C (copy) then switch back to your script and remove the 0 value in the brackets, and do CTRL V to paste the value from JWildfire.

    Sc Tutorial 4 step 1 - Flame Setcommands

  2. Looking into other flame.set additionals that will boost your scripts.

    As mentioned above, copying and pasting any of these flame.set commands underneath the main ones will add extra control or randomising for your script. Let's take an easy one to begin with. How to set the title of the script, and any flames it creates. We do this with the flame.setName command as in this

    flame.setName(“Name of script by You”);

    Try adding that after the main flame.set commands and change the text between the quotes. Run your script, then click the title button in JWildfire and you'll see it's set the name of the flame it created to your title.

    Flame set title

  3. Using flame.set commands in conjunction with the range command from tutorial 3

    This is where it gets fun! but also if you're new it can look complicated, but it isn't really. As long as you have the range command set up from tutorial 3, it will allow you to add random values to the flame.set commands. Here for example, is it being used to randomise the background colour of corners of your flame. So the first line tells the script we're using the background color type of 4 corners and a centre colour.

    The upper left section, we're choosing a random red green and blue value between 1 and 128, the numbers go up to 255, but I'm keeping at 128 so the values it chooses aren't too bright. In effect what this all does is randomise the top left and right colours of the flame, but keep the bottom left and right colour to 0 which is black. Also keeps the centre black.

    I know the code looks horribly confusing with all the brackets and what not, but if you try to remember that values are placed in brackets. So the Lower left for example you can see the zero in brackets. All we're doing in the top area is replacing the 0 value with the range(value1,value2) command and because it's values are in brackets, when placed inside the value area of a flame set it looks messy.

    You may mess up and have an incorrect amount of brackets and get an error, but don't panic, just go back to your script and make sure there's an equal amount of open and close brackets. JWildfire will tell you the line number of the command that has the problem.

    flame.setBgColorType(org.jwildfire.create.tina.base.BGColorType.GRADIENT_2X2_C);

    // upper left
    flame.setBgColorULRed(range(1,128));
    flame.setBgColorULGreen(range(0,128));
    flame.setBgColorULBlue(range(0,128));

    // upper right
    flame.setBgColorURRed(range(0,128));
    flame.setBgColorURGreen(range(0,128));
    flame.setBgColorURBlue(range(0,128));

    // lower left color
    flame.setBgColorLLRed(0);
    flame.setBgColorLLGreen(0);
    flame.setBgColorLLBlue(0);

    // lower right color
    flame.setBgColorLLRed(0);
    flame.setBgColorLLGreen(0);
    flame.setBgColorLLBlue(0);

    // centre color
    flame.setBgColorCCRed(0);
    flame.setBgColorCCGreen(0);
    flame.setBgColorCCBlue(0);

  4. More flame.set commands to try

    Please leave comments if you get stuck, and I'll do my best to help.

    Moving on, some more flame.set commands. Remember, some can have negative values also, so just use a – character -21.4 for example.

    Brightness
    flame.setBrightness(value);
    flame.setLowDensityBrightness(value);

    Saturation (values between 1.0 and 1.2 usually best)
    flame.setSaturation(value);

    Symmetry (order value is how much symmetry)
    flame.setPostSymmetryType(org.jwildfire.create.tina.base.PostSymmetryType.POINT);
    flame.setPostSymmetryOrder(3);
    flame.setPostSymmetryCentreX(0);
    flame.setPostSymmetryCentreY(0);

    Antialias – gets rid of dots with glynnsim1
    flame.setAntialiasAmount(0.0);

    Foreground Opacity (Decimal value between 0 and 1)
    flame.setForegroundOpacity(value);

    White Level (bring out brightness)
    flame.setWhiteLevel(value);

    Gamma
    flame.setGamma(value);

    Colour Balancing
    flame.setBalanceRed(value);
    flame.setBalanceBlue( value );
    flame.setBalanceGreen( value );

    Position
    flame.setCentreX(value);
    flame.setCentreY( value );

Tools
  • Notepad ++
Materials
  • JWildfire

See Also …

You may be interested in ...

Leave a Comment