Logic Expansion System

The logic expansion system is one of the largest systems in ArkFrame. It allows for mod authors to extend the functionality of existing actors without the need to remap them as we have needed to do in the past.

The system also offers a common lightweight system that can replace our heavy use of buffs that were used to act as mediators, the problem with this was that buffs had a lot of members that were replicated and may not be used. The logic expansions do replicate by default; however, they are essentially clean slates to work with without any of the things that may not be needed by the mod.

Creating a Logic Expansion

To create a new logic expansion object open your ModData BP and locate the LogicExpansion array, add a new element.

You will find a number of options in the struct, how you enter data into these fields is important to how your logic expansion gets matched with target actors that it is intended to extend. bShouldMatchByUniqueName is used to declare whether actors should be expanded by explicit declaration (ObjectUniqueNames), or by tags (DescriptiveTagsToMatch).

_images/logicExpansions_createNew.png

you can find these values for what to target by looking through the ArkFrame overrides classes and looking at the values set in the defaults.

_images/logicExpansions_tagging.png

If matching by object unique names then all that needs to occur is that the logic expansion declaration in the ModData blueprint must containe the exact case-sensative name in the array.

Matching by desriptive tags is a bit more complicated but quite powerful in terms of forward and mod compatibility. Multiple matching rules can be added; however, all rules in the array must individually evaluate to true in order for the matching to be successful. This feature works similiar to a SQL query, but only implements the four rules of AND, OR, NOR, and NAND. If you are not familiar with these terms than it is recommended that you look them up and how they work before working with descriptive tag matching.

The following example show a set of rules that would result in the class being considered a valid match if all of the following is true:

  • Has both the tags Character AND Dino

AND

  • Has either the tag Achatina OR Allosaurus
_images/logicExpansions_tagMatchExample.png

Creatively using these tags (And implementing good tagging on custom modded actors) can make for a very powerful and very flexible system of extending actors.

Once you have decided what actors you will extend it is time to create a new logic expansion class. Click the + symbol next to the LogicExpansionTemplate parameter and generate a new logic expansion BP.

Once you have done this and you open the blueprint, you will find that there is only one default field shown in the ArkFrame section:

_images/logicExpansions_defaults.png

This singular field is only needed if you intended to add MU entries to the actor. If you do intend to do this, enter the quantity of multiuse indices that are needed.

Graph Events

Logic expansions have all the standard actor events, but in the following locations you will find a large number of expanded events:

_images/logicExpansions_primaryEvents.png _images/logicExpansions_virtualFunctions.png

All of the events and overridable functions listed in these locations are actually triggered by the target actor that is being extended by this BP. This is the meat of the logic expansion system and allows for things to happens based on events and functions that previously were only accessable by remapping core blueprints.

_images/logicExpansions_exampleEvent.png

This system comes with a catch though. The flexibility of it means that the blueprint just has access to all of these events, that doesn’t mean that they are all valid for the target actor though. It falls upon the mod author to research what events will be triggered by the actors they are to extend. This can be done by exploring the ArkFrame override BPs.

MultiUse Support

MultiUse is supported by the logic expansion system and is implemented first by declaring how many multiuse indices are needed in the defaults:

_images/logicExpansions_MUExample1.png

This will autogenerate a single multiuse index unique to your logic expansion. Generated MultiUse indices are deposited into the inherited GeneratedMultiUseIndices array the first time that BPGetMultiUseEntries is called on the actor being extended.

_images/logicExpansions_MUExample2.png

From here the process of using the MultiUse system is similar to how one would do so on the original actor being extended. The exception is that the index that would normally be switched on is now most easily determined by index placement in the GeneratedMultiUseIndices array.

_images/logicExpansions_MUExample3.png _images/logicExpansions_MUExample4.png _images/logicExpansions_MUExample5.png