I’m creating a separate topic here to go in-depth into some of the powerful new Blueprint Scripting features you’ll find in ARK Dev Kit v243.91 which will release later today:
- Have a look at this Blueprint:
You’ll find lots of new blueprint logic controlling how the Titanosaur attacks and is Tamed, and how its Character Status Component (which has its own Blueprint overrides) interacts with its Taming state – you now have the capability to dynamically modify the Attack Infos and Character Status Component value adjustments in Blueprint. The Titanosaur Inventory Component also has overrides about how & whether Inventory Items uses are allowed.
You can now attach Structures to StaticMeshSockets from any collidable StaticMesh in the Environment – no matter whether it’s a Foliage or StaticMeshActor. See this blueprint “Blueprint’/Game/PrimalEarth/Structures/BuildingBases/TreePlatform_Base_SM.TreePlatform_Base_SM’” and this asset “StaticMesh’/Game/PrimalEarth/Environment/Redwoods/Vegetation/Trees/RedwoodTree01/SM_Redwood_01_CurvedLeaves.SM_Redwood_01_CurvedLeaves’” for an example of how it’s used.
Mountable Turrets can now use multiple types of ammo. See these for example: Blueprint’/Game/PrimalEarth/Structures/BuildingBases/StructureTurretBallistaBaseBP.StructureTurretBallistaBaseBP’ and Blueprint’/Game/PrimalEarth/CoreBlueprints/Weapons/PrimalItemAmmo_ChainBola.PrimalItemAmmo_ChainBola’
Gas Mask Buff has some unique logic to prevent/interact with other kinds of buffs: Blueprint’/Game/PrimalEarth/CoreBlueprints/Buffs/Buff_GasMask.Buff_GasMask’
Items can now override in blueprint what other items they can be dragged onto, and what they do once dragged onto another item, see ‘Blueprint’/Game/PrimalEarth/CoreBlueprints/Resources/PrimalItemResource_MagicCharcoal.PrimalItemResource_MagicCharcoal’’ for an example of this – the “Magic Charcoal” allows itself to be dragged onto Raw Meat, and instantly ‘turns’ the Raw Meat into Cooked Meat when so. (note: this test asset is not cooked into the game, so if you want to use it in a mod, you’ll need to make a mod copy of it)
Structures snap points now support per-SnapPoint Mesh Socket Names (on either “To” and “From” Sockets or both), so you can optionally use StaticMesh Sockets for your Snaps rather than Vector offsets. Each Snap Point also supports Inclusion and Exclusion lists of Structures to allow Snapping either To-or-From, so you can use these lists instead of (or alongside) the snapping bit masks if that’s easier for you.
Structures now support Overriding final Snap Transformations via Blueprint, which also allows the Snap Point to be dynamically affected by whatever logic you want. See this blueprint ( Blueprint’/Game/PrimalEarth/Structures/Stone/Stone_Doorframe/Doorframe_Stone_Flipper.Doorframe_Stone_Flipper’ ) for a networked “Flippable Doorframe” blueprint, which allows the door direction to be flipped by user input on the frame. You can also override these functions to custom determine whether a Snap is even allowed via arbritrary Blueprint logic:
bBPOverrideSnappedToTransform (set this to true on the parent structure if you wish it to override the transform of what is intending to snap to it… if it returns false, it will NOT override the Transform, and if it returns TRUE but sets bForceInvalidateSnap to 1, it will FAIL the snap).
bool BPOverrideSnappedToTransform(APrimalStructure* childStructure, int32 ChildSnapFromIndex, FVector UnsnappedPlacementPos, FRotator UnsnappedPlacementRot, FVector SnappedPlacementPos, FRotator SnappedPlacementRot, int32 SnapToIndex, FVector& OutLocation, FRotator& OutRotation, int32& bForceInvalidateSnap);
UFUNCTION(BlueprintNativeEvent) int32 BPIsAllowedToBuild(const FPlacementData& OutPlacementData, int32 CurrentAllowedReason); UFUNCTION(BlueprintNativeEvent) bool IsValidSnapPointTo(APrimalStructure* ChildStructure, int32 MySnapPointToIndex); UFUNCTION(BlueprintNativeEvent) bool IsValidSnapPointFrom(APrimalStructure* ParentStructure, int32 MySnapPointFromIndex);
- Most importantly, Actors now have a dedicated client-to-server / server-to-client network communication method, for any client to communication with the server about an actor, or vice versa. You can think of this as a dedicated “channel” to talk to the server about an actor, even if the client doesn’t “OWN” the actor. It can be very useful for sending arbritrary network data about an actor from the client-to-the-server, or vice versa, without having direct client ownership. For example, if you had a mailbox structure, and wanted to request data when it’s activated, but you don’t want the server to have to multi-cast that data to all clients, just the requesting client. Previously this would not have been possible.
These are the relevant blueprint functions:
virtual bool BPClientHandleNetExecCommand(FName CommandName, const FBPNetExecParams& ExecParams);
UFUNCTION(BlueprintImplementableEvent) virtual bool BPServerHandleNetExecCommand(APlayerController* FromPC, FName CommandName, const FBPNetExecParams& ExecParams); UFUNCTION(BlueprintCallable, Category = "Actor") virtual void ServerSendExecCommandToPlayer(APlayerController* ToPC, FName CommandName, const FBPNetExecParams& ExecParams, bool bIsReliable = false, bool bForceSendToLocalPlayer = false, bool bIgnoreRelevancy=false); UFUNCTION(BlueprintCallable, Category = "Actor") virtual void ServerSendExecCommandToEveryone(FName CommandName, const FBPNetExecParams& ExecParams, bool bIsReliable = false, bool bForceSendToLocalPlayer = false, bool bIgnoreRelevancy = false);
UFUNCTION(BlueprintCallable, Category = “Player”)
void ClientSendNetExecCommandToServer(AActor* ForActor, FName CommandName, const FBPNetExecParams& ExecParams, bool bIsReliable);
Here’s an example of it in-use ( Blueprint’/Game/PrimalEarth/Structures/Stone/Stone_Doorframe/Doorframe_Stone_Flipper.Doorframe_Stone_Flipper’ ), once you’ve built that structure (add it to the StructurePlacer list and snap it to foundation), as a client select the “Test Net Exec” Activation Wheel option on this structure and you’ll see that the server will send data back to the requesting client, based on data that the requesting client sends to the server. (The client will print the result to the screen).
#8 in particular will be useful for advanced interactive networked blueprints, especially involving structures or dinos that you do not directly possess. It essentially act as a two-way client<->server communication method for arbitrary Actors.
Have fun, hope you enjoy these powerful new capabilities! Note that these features will only work properly in v243.91 and up specifically, so be sure to tell your clients/servers to upgrade their game builds to the latest version if you intend to use these new features! (as we won’t be releasing another Major version update for about 3 weeks or so)
Good luck all, happy modding!
ARK Lead Designer, Lead Programmer, Development Director, Co-Founder @ Studio Wildcard