( CF ) Lots of Lights

( CF ) Lots of Lights

By Mad-Eye#2971 on Discord

This package contains several examples of light meshes with fire effects that are
controlled by scripts you can to control any number of effects, lights, or sounds. Some
will activate when players are within their triggers, some require players to interact,
and some will come on at night. The candles have a light flickering script.

The scripts are intended to be used with a variety of objects. The properties have tooltips
to describe how they behave.

NOTE: These scripts rely on connecting entities already in your map hierarchy rather than
spawning them as the game runs. This gives easy control over the properties of sounds and lights,
as well as position the effects.

Visit CharmingForge in Crayta to see some working examples.

The Objects

  • ( CF ) Chandelier - Walk
    A chandelier with a trigger under it. When the first play enters the trigger the chandelier
    will light and the light will flicker. When the last player leaves the light will stop.

  • ( CF ) SculptureWithFlames - Walk
    This works like the chandelier,but activates two fires in the bowls on the sculpture.

  • ( CF ) TempleChandelier - Walk
    A temple chandelier lights with a blue flame when players are in its trigger.

  • ( CF ) WallSconce - Walk
    The sconce lights when players are in its trigger.

  • ( CF ) Candelabra - Interact
    The candelabra will light up with flickering light when a player activates it with the interact key. They can also turn it off.

  • ( CF ) Candle - Interact
    The candle will light up with flickering light when a player activates it with the interact key. They can also turn it off.

  • ( CF ) OilLantern - DayNight
    The lantern will come on during the night if it’s placed in a map with the timeOfDayScript
    from the Adventure blueprint.

  • ( CF ) CandleStack - DayNight
    This bunch of candles comes on at night like the oil lantern, but also has light that

  • ( CF ) Trigger - Multiplayer
    This trigger has a script that fires onTriggerOccupied only when the first
    player enters and onTriggerEmpty when the last player exists.

The Scripts

  • lightEffectsToggleScript:
    Use this to activate and deactivate sounds, lights, and effects
    in the hierarchy. (eg, six candle flames on a chandelier, a matching light, and a sound).
    You can add as many of each as you like and use the functions on the script to turn them
    on and off.
    • The two functions to call on this script are TurnOn() and TurnOff().
    • There is a property called OnAt. When this is set to either “Day” or “Night” the script
      will listen try to find the timeOfDayScript that comes with the adventure blueprint
      and toggle itself on either during the day or night respectively There are properties
      to change the script it searches for and the events it listens to. The DayNight examples
      in the package use this.

  • lightFlickerScript:
    This will change the intensity of lights so simulate the effect of a
    flickering flame. Any lights added to this script will flicker in sync. Fire effects
    usually have their own lights and don’t need this, but candle flames do not.

    • This script can also move the lights within a radius. This is off by default, but intertesting with shadow-casting lights.

    • Look at the examples with candles to see how this is connected to the triggers or the
      toggle script.

  • triggerPlayerTrackerScript:
    All the triggers in this package use this script. It fires an event when the trigger is first
    occupied and one when it is empty again. A light triggered this way will stay lit as long as any players are in its trigger.

  • switchInteractionScript:
    The interactive candles use this. It’s a switch with prompts that keeps track of whether its
    is on or off. It can play a separate sound for toggling on or off, and can also play animations on
    a mesh.

1 Like