VFX – Part 4: Advanced Information

From Baldur's Gate 3 Modding

This is Part 4 of the VFX tutorial. In this part, we'll cover more advanced information, such as how to plug your VFX into projectile spells and how to add effects to scenery, the environment, characters, objects, and animations.

Spells and Statuses

Statuses are conditions that can affect a character/object, such as Burning, Faerie Fire, Downed, and Charmed. They are often results of a spell or an event and can last for multiple in-game turns. Just like spells, their properties are set via the Stats Editor. For information on how to make new stats and set their properties, see Making a Basic Spell.

There is a difference between some types of spells and statuses. Some spell types will have extra columns to connect effects to that are unique to them.

Projectile Spells: Trajectories Column

This section is about how to plug in your effects for a Projectile spell. For information on how to create a Projectile spell, see Making a Projectile Spell.

The Trajectories column is unique to Projectile spells. Trajectories represent the visuals that will be visible in Projectile spells. Projectile spells require the Trajectories GUID to be filled in in their stats.

First of all, to find the Trajectories column, simply open the Stats Editor, look for your mod/project, and press the + symbol next to the SpellData folder. Select Projectile from the menu to create a new Projectile spell type.

Creating a Projectile spell type.

After creating the spell type, we will create a new spell entry. In the first row, give the spell the name Projectile_Test in the Name column and use the FireBolt spell as the parent in the Parent column.

Giving a name and parent to the new spell.

Scroll to the right to find the Trajectories column.

The Trajectories column in the Projectile-type spell.

This column requires a root template GUID. To create one, we need to manage root templates. Open the Root Templates Manager by clicking on the building block icon in the toolbar of the main Editor.

Opening the Root Templates Manager.

To create a new root template, press the Create New icon in the top left of the Root Templates Manager. A new window should appear allowing you to set the mod, the type of root template, and more.

In this case, set the root template Type to Projectile and name it VFX_Projectile_Test_01. Leave the default Properties for the moment.

ⓘ You can also create a new root template based on an existing one by right-clicking on one and selecting the option Create new from selected. The second option, Create inherited from selection, can be used for cases where you want to create a child of a root template.

Creating a new root template and naming it.

Find your new root template in the Root Templates Manager. Click on the root template’s name, locate the Sidebar, and look for the section with Projectile settings.

The Projectile settings in the Projectile spell’s root template.

The most important parameters to use are the following:

  • Beam Effect: The parameter that will make a beam effect appear between the Cast Bone Name (see below) of the character casting the spell and the end location of the projectile. Fill in the name of the resource you want to use as a beam. Make sure that the model you use is 10 metres long in the -Z axis so that the size of it scales automatically according to the distance between the source and the target.
  • Cast Bone Name: The starting bone position from the caster of the projectile when casting the Projectile spell. Fill in the name of the bone you want to use. The most commonly used one is Dummy_CastFX.
  • Detach Beam: When set to true, this will cause the beam to detach from its start and end points.
  • GroundImpact Effect ID: The effect that will appear in addition to the Impact Effect ID (see below) when the ground is targeted or when the ground is close to the end location of the projectile. Fill in the name of the resource you want to use.
  • Impact Effect ID: The impact effect that will play when the projectile or the beam comes into contact with the end position of the projectile. Fill in the name of the resource you want to use.
  • Rotate Impact: When set to true, this will cause the effect connected in the Impact Effect ID to try to rotate according to the projectile’s orientation.
  • Trail Effect ID: The projectile’s visuals. Fill in the name of the resource you want to use.

For the purpose of this tutorial, copy and paste the following names into the corresponding parameters of the VFX_Projectile_Test_01 root template:

  • Cast Bone Name: Dummy_CastFX
  • Impact Effect ID: VFX_Projectiles_Damage_Acid_AcidSplash_Impact_01
  • Trail Effect ID: VFX_Projectiles_Damage_Acid_AcidSplash_Projectile_01

ⓘ The effect names are simply the names of the resources found in the Resource Manager. You can right-click on a resource, select Copy Name to Clipboard, and then paste it to the root template’s parameter.

It should look like this when all set up:

VFX_Projectile_Test_01 after taking the previous steps.

When you are done setting up your Projectile, move back to the Root Templates Manager and save with the Save icon. It will save all of your changes to the root template.

Saving the changes made to the root template.

After saving, locate the VFX_Projectile_Test_01 root template, right-click on it, and select the option Copy GUID to Clipboard. Open up the Stats Editor, find the Trajectories column, and paste your root template’s GUID. Save your progress in the Stats Editor with the Save icon.

ⓘ GUIDs are unique to every root template. Yours will be different from the one used in this tutorial.

The GUID of the VFX_Projectile_Test_01 root template assigned to the spell.

ⓘ The Trajectories from the Projectile spell will spawn at the textkey set in the CastTextEvent column in the Stats Editor.

All that is left now is to test the spell. Just like in Part 3 of this guide, open the debug console (Ctrl+Shift+F11). Enter addDebugSpell Projectile_Projectile_Test. The spell should appear in your hotbar. Select the spell and cast it.

If the projectile and impact no longer look like Fire Bolt and instead look like Acid Splash, you have successfully assigned your new Projectile root template!

The new projectile impact of the Projectile_Test spell.

You can now play around with some other parameters in the Projectile root template to control things like the type of trajectory (TrajectoryType) and the speed (Acceleration and InitialSpeed).

Most Other Spell Types: BeamEffect Column

The BeamEffect column is mainly used to add an effect between the Source (caster) and its Target on specific bones. We mostly use it for Target- and Shout-type spells.

The BeamEffect column, which can be found in SpellData in the Stats Editor, needs to be set up in a specific way.

ⓘ We don’t recommend using the BeamEffect column for Projectile spells. If you want to create a spell that is mainly a beam, like Ray of Frost, it’s better to set it up as a Projectile spell rather than a Target spell.

Let’s set one up to see how it works. Please note that the following steps are described in more detail in Part 1 of this guide, and this guide assumes you have diligently followed Parts 1–3 prior to starting.

Create a new empty effect in the Effect Editor.

Place a Bounding Sphere, set the Radius to 5, and adjust the Start/End time to 0 and 3 so that it lasts for 3 seconds.

Add a Model component to another track and set the Start/End time to be the same as that of the Bounding Sphere. In the Model component, set the Mesh GUID to VFX_Static_Beam_01_Exterior_Default_01.

The VFX_Static_Beam_01_Exterior_Default_01 assigned in the new effect.

The next step is the most important – it’s so that the model scales correctly between the Source and the Target. Your model needs to be a total length of 1 metre in the -Z axis. This particular model is, by default, 10 metres.

Create the Scale module in the model you created. Find the Scale Modifier Z parameter, click the little circle icon to the left of it, and select Distance to Target to activate it. Also, change the Z Scale to 0.10 to make it 1 metre long.

ⓘ The forward direction in our Editor is the -Z axis. This is why the model needs to be going in that direction visually. Also, the system needs the size of your model or emitter in the -Z axis to be 10 metres. If you’re using a model, you might need to adjust your Z Scale and/or your Scale Modifier Z to make it the right size. If you’re using a Cylinder Emitter, you can scale its Height to 1 metre and change the Up Axis to Z = -1. For a Cylinder Emitter, you can also click the circle icon to the left of Height Modifier and activate the Distance to Target.

Setting the Distance to Target parameter to scale the Z axis of the model correctly.

ⓘ The Beam Effect in the Projectile Root Template and the BeamEffect column in Stats use different systems, so they aren’t connected in the same way and don’t have the same parameters. The Beam Effect in the Projectile Root Template requires the length of the model to be 10 meters BUT doesn’t use the Distance to Scale. The scaling is done automatically.

Save your effect in a new Cast Paladin folder (In Spells, create Cast > Arcane > Paladin) and name it VFX_Paladin_BeamEffectColumn_Test_01. When it is saved, select Build > Compile Effect in the Effect Editor.

The effect saved in the right directory.

Go to the Resource Manager to create a new resource. In your Effects > Effects > Spells resource folder, create a new Cast folder, create an Arcane folder within it, and then add a Paladin package within that.

ⓘ You can find more information on how to create folders and packages in Part 2 of this guide.

The newly created folders and package.

You can now create your new resource in the Paladin package as you did in Part 2.

When the resource of the VFX_Paladin_BeamEffectColumn_Test_01 effect is created, go to the MEI Editor. In the Spelldata_Target MEI folder you made in Part 3, create a new MEI and name it Test_BeamEffectColumn. Select the newly made MEI and add your effect to it.

To make the effects item in your MEI work in the BeamEffect column, you need to set the following parameters properly:

  • SourceBones: The start point of the beam.
  • TargetBones: The end point of the beam.
  • UseDistance: The parameter that allows the effect to scale between the start and end points.
  • StartTextKey: The textkey used from the animation of the character from the stats to spawn the effect.

For this tutorial, set these parameters as follows:

  • SourceBones: Dummy_CastFX
  • TargetBones: Dummy_BodyFX
  • UseDistance: Check the box.
  • StartTextKey: Cast
Setting up the MEI.

When it’s done, go to the Stats Editor.

In SpellData > Target, create a new stats entry and name it PaladinBeamEffectColumn. Set the parent to TrueStrike, like you did for PaladinTestSpell in Part 3. Move to the BeamEffect column and set it to Test_BeamEffectColumn by selecting the MEI from the dropdown list.

Click on the Save and Export icon in the Stats Editor.

Setting up the BeamEffect column for the new spell.

After saving, you’re ready to test the spell.

Enter Game Mode and add the spell to your hotbar via the debug console by entering addDebugSpell Target_PaladinBeamEffectColumn.

Move your character where there are tents and torches by moving your camera to the right spot, placing your cursor where you want your character to appear, and pressing Ctrl+T to teleport them there.

This time, you will need an extra character to serve as a target to test the spell on. To add a new non-hostile character, in the debug console, type addPlayerCharacter BASE_Humans_Male_acd7060a-43bd-4dc9-b050-9d9b2cf7b7df, place your cursor where you want the character to appear (while still having the debug console selected), and press Enter on your keyboard.

When you have both of your characters, select your main character and then the spell you added earlier to their hotbar. Cast it on the male human you just created as the target of the spell and watch the results. If everything went well, you should see your BeamEffect appear for 3 seconds.

The beam model from the MEI attached to the BeamEffect column.

Scenery/Environment Effects

To be placed in a level, effect resources must be attached to a root template.

Open the Root Templates Manager.

Opening the Root Templates Manager.

You can modify an existing Scenery root template or create your own. To create your own, press the Create New icon on the top left of the Root Templates Manager. Set the Type to Scenery and leave the default Properties for the moment.

Creating a new Scenery-type root template and naming it.

Search for and find your new root template in the Root Templates Manager. Click on the root template’s name, locate the Sidebar, and look for the Visual Resource ID field. Click the little dropdown arrow on the right, search for the effect name you want to assign your root template to, and click Set. For this tutorial, we'll assign the existing effect VFX_Environment_Butterflies_01 from the Shared folder.

ⓘ The effect needs to be a looping one to be visible all the time. This doesn’t mean there always has to be something playing during the loop. You can be creative with it. There is no limit to the length of the looping phase.

Assigning a visual effect to the new root template.

Save the template via the save icon at the top of the Root Templates Manager and you’re done! The template can be dragged and dropped in the level and the effect should appear.

Feel free to play around with some other parameters in the root template you just created, like the Shoot Through and Walk Through parameters, depending on your desired results.

Attaching Effects to a Visual

Effects can be attached directly to a character or an object at all times, or to specific animations.

Attaching Effects to a Character/Object

Effects can be attached to a visual, such as a character or an object, and will remain as long as that visual is loaded.

You can attach an effect via the visual’s resource. In the Resource Manager, locate the model you want to attach the effect to. Double-click on the model to open the Edit Visual window. Click on the Attachments tab. There, you’ll be able to see the dummies that have been added to the model.

Drag the Edit Visual window to the side so you can also see the Resource Manager. In the Resource Manager, select the effect resource you would like to connect to the model resource, and then, in the Edit Visual window, simply click on the arrow on the right column to assign the effect to the desired dummy.

Adding an effect to a dummy.

It should add the effect to the dummy. Press the OK button at the bottom of the Edit Visual window to confirm your changes, and then save the changes you made to the resource by clicking on the save icon in the Resource Manager (to the left of the Filters search bar).

Attaching Effects to an Animation

Effects can be attached directly to animations via a textkey of the EventType Effect. This can be useful if you want the effect to play every time an animation plays, regardless of who or what uses it.

In the Resource Manager, find the animation resource the effect needs to be attached to and double-click it to open the Animation Preview window. The window contains animation tracks at the top and a preview at the bottom. Make sure to make the file editable by right-clicking on the resource and selecting Open for Edit.

The Animation Preview window.

Create a textkey by right-clicking on one of the tracks under the main one and adding an Effect textkey.

Adding an Effect textkey.

Select the effect and change its properties (Start time, End time, Bone [you can type the name of the bone if it doesn’t appear in the list], Effect [you can copy/paste the name of your resource], etc.) in the Textkey Properties panel on the right.

The Hard Attach parameter will make the effect follow the bone to which it’s attached and disappear as soon as the character/object being animated disappears.

The Interrupt Loop At End parameter is meant for looping effects. The looping effect will stop only when the animation has ended.

ⓘ Sometimes, new effect resources won’t appear when plugged into an animation. You might need to restart the Editor for your new effect resource to be registered and appear properly. This is also true for changes made to the animation Effect textkey.

Attaching Effects in the UUID Object Editor

In specific cases, some effects are assigned in the UUID Object Editor. The UUID Object Editor can be accessed via a spreadsheet icon on the toolbar of the main Editor.

The UUID Object Editor icon.

Find the VFX folder in Projects > [Your mod name] > VFX.

THE VFX folder in the UUID Object Editor.

There are four types of effect that must be assigned via the UUID Object Editor. These are DeathEffects, ManagedStatusVFX, Passives, and VFX. Each of these needs its effects to be plugged into the UUID Object Editor so they can be referred to either in code or in other parts of the Editor, depending on their type.

DeathEffects

A DeathEffects stat determines which effects play on a creature/character for each death type.

Each stat (that is, each row in the DeathEffects file) contains multiple columns that each correspond to a death type, each of which requires a corresponding MEI. The DeathEffects stat is assigned via the root template of the creature/character in the Root Templates Manager.

Adding a new DeathEffects stat in the UUID Object Editor.

In the root template of the creature/character in the Root Templates Manager, search for the Death Effect field and assign the name of the new DeathEffects stat you just created.

The Death Effect field in the Root Templates Manager.

ManagedStatusVFX

ManagedStatusVFX are integrated as a way to avoid having multiple status effects playing on a target at the same time, and to provide generic effects for less unique statuses. Statuses that last fewer than 10 turns use ManagedStatusVFX. The PositiveEffect, NegativeEffect, and MixedEffect columns require a MEI.

Adding a new ManagedStatusVFX stat in the UUID Object Editor.

ManagedStatusVFX are referred to in the Stats Editor in Project > ModName > StatusData > Status_BOOST.

In the Status_BOOST section of the Stats Editor, look for the status you want to use the ManagedStatusVFX system, and find the ManagedStatusEffectType and ManagedStatusEffectGroup columns:

  • In the ManagedStatusEffectType column, assign Positive to positive statuses like Bless, and Negative to negative statuses like Difficult Terrain.
  • In the ManagedStatusEffectGroup column, select the area of the body (the "group") that the effect should be applied to (Legs or Torso).

ⓘ We use the Legs and Torso groups, but you are free to create other groups (like Head and Weapon) according to your needs. The current Head and Weapon groups have their effects deactivated in their MEI. They won’t work unless activated.

The ManagedStatusEffectType and ManagedStatusEffectGroup columns in the Stats Editor.

When a target in the game receives two statuses, one set to Positive and the other to Negative, both belonging to the same group, it will play the MEI connected in the MixedEffect column of the UUID Object Editor.

A target receiving multiple statuses set to Positive will only show the Positive effect once. The same is true for Negative.

Passives

Passive spells done via the Stats Editor require their PrepareEffect and CastEffect to be set via the UUID Object Editor in the Passives table. Just like for spells from the Stats Editor, MEIs need to be assigned to those columns.

Adding a new Passive stat in the UUID Object Editor.

The link between the passive spell from the Stats Editor (in the Projects > ModName > Stats > Passive table) and the one in the UUID Object Editor will be made automatically if both share the same name (e.g. the Metamagic passives).

The Metamagic_Subtle Passive in the Stats Editor referring to the one from the UUID Object Editor.

VFX

These are for specific functions called by code, such as UI elements (LevelUp, Dodge, Range Circle, etc.). These UUIDs are referenced from code, so you can only override existing UUIDs to change how certain effects look in-game.

For example, here’s the existing VFX table from Shared:

The VFX table from Shared.

If you want to override the VFX indicator for AoE, you would right-click on that row, and select Override in and choose your mod.

The "Override in" option.

You could then modify that row in your mod’s VFX table.

If your changes aren’t appearing after saving, you can go back to the main Editor and, in the Tools menu, click on Reload Stats… If they’re still not appearing, you might need to restart the Editor for everything to update properly.

We hope that, with all this additional information, you have all you need to create the new effects you desire. Have fun playing around with all the tools and systems!