Skip to content

6. Resource Function Library

Cutter Hodnett edited this page Nov 9, 2024 · 1 revision

Resource Function Library (child of Blueprint Function Library)

#include "ResourceFunctionLibrary.h"


Functions

  • ResourceComponentBase GetResourceFromActor(Actor actor,Name resourceName)
    • Returns the first resource with the given name on the actor.
  • ResourceComponentBase GetAllResourcesFromActor(Actor actor)
    • Returns all resources with the given name on the actor.
  • ResourceComponentBase GetResourceFromActors(Actor actors, **Name **resourceName)
    • Returns the first resource with the given name on each actor.
  • ResourceComponentBase GetAllResourcesFromActors(Actor actors)
    • Returns all resources with the given name on each actor.
  • AddResourceToActor(Actor actor, Name resourceName, Float addAmount)
    • Adds to the first resource with the given name on the actor.
  • DrainResourceFromActor(Actor actor, Name resourceName, Float drainAmount)
    • Drains from the first resource with the given name on the actor.
  • AddResourcePercentToActor(Actor actor, Name resourceName, Float addPercent, EResourcePercentType percentType)
    • Adds a percent to the first resource with the given name on the actor.
  • DrainResourcePercentFromActor(Actor actor, Name resourceName, Float drainPercent, EResourcePercentType percentType)
    • Drains a percent from the first resource with the given name on the actor.
  • AddResourceToActors(Actor actors, Name resourceName, Float amount)
    • Adds to the first resource with the given name on each actor.
  • DrainResourceFromActors(Actor actors,Name resourceName,Float amount)
    • Drains from the first resource with the given name on each actor.
  • AddResourcePercentToActors(Actor actors, Name resourceName, Float addPercent, EResourcePercentType percentType)
    • Adds a percent to the first resource with the given name on each actor.
  • DrainResourcePercentFromActors(Actor actors, Name resourceName, Float drainPercent, EResourcePercentType percentType)
    • Drains a percent from the first resource with the given name on each actor.
  • HealthResource GetActorHealthResources(Actor actor, Name healthNameFilter)
    • Returns all health resources with the filtered names.
  • Bool ActorImplementsAnyModification(Actor actor, Name modificationNames,Name healthNameFilter)
    • Checks if the actor implements the modification on the listed Health Resources.
  • GiveModificationDataToActor(Actor actors,Name resourceName,Float amount)
    • Drains from the first resource with the given name on each actor.
  • RemoveModificationFromActor(Actor actor,Name modificationNames,Name healthResourceNameFilter)
    • Removes modification data to the filtered HealthResource components on the actor.

Notes

  • This was created for easy access to resources on various actors by only needing the resource name and the actor.
  • Most of the functions in this library should only be called on the server. This does not include the getter functions.

Clone this wiki locally