Difference between revisions of "Learn an Engram using an Item"

From ARK Modding Wiki
Jump to navigation Jump to search
(Replaced content with "Category:Tutorials Category:TIAPs Due to a new exposed node this has become very simple - use the "Blueprint Used" event and call "Server Unlock Engram".")
Line 1: Line 1:
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]
 
[[Category:TIAPs]]
 
[[Category:TIAPs]]
This is a step by step guide for manually adding an engram to the learned engrams list using an item's "Blueprint Used" function.
 
Please be warned that the current version is not properly persistent yet, we are working on this.
 
== Learn an engram on blueprint used ==
 
# Open the item and navigate to the graph tab
 
# Find the function "Blueprint Used", right click it and press "Implement Function"
 
  
== Building the graph to update to show changes in the current session ==
+
Due to a new exposed node this has become very simple - use the "Blueprint Used" event and call "Server Unlock Engram".
<gallery>
 
Learnengram01.png|In your function graph you should first check if you are the server using "Switch Has Authority"
 
Learnengram02.png|Next get a reference to the primal character
 
Learnengram03.png|To add the item to the engrams tree view we have to get a reference to the player state
 
Learnengram04 .png|Now we add our item to the "Engram Item Blueprints" array of the player state. This will make it show in the engram tree. For the purpose of this tutorial I selected the Large Crop Plot. Make sure to promote this to a variable in production use!
 
Learnengram05.png|Now drag the PrimalCharacter pin from step 2 and get a reference to Inventory Component. From there drag "Get Default Inventory Items" and from that drag "Add". Again select our Large Crop Plot.
 
Learnengram06.png|Now drag the InventoryComponent pin from the last step to "Get Default Engrams" and from that, again, drag "Add". Use "1" as the value.
 
Learnengram07.png|Again drag the InventoryComponent, this time to "Initialize Inventory".
 
</gallery>
 
 
 
== Building the graph to store the changes ==
 
The best way is to connect this graph to the execution node of "Initialize Inventory"
 
[[File:LearnEngram08.png|frame|center]]
 
This might look a bit confusing at first glance but I'll walk you through it.
 
 
 
# From your "Cast To ShooterPlayerState" Node drag the "Shooter Player State" Pin and get "My Player Data Struct" and "My Player Data" as seen in the upper right part of the picture. From "My Player Data" drag "My Data".
 
# From your "Cast To PrimalCharacter" node drag the "Primal Character" Pin and get "My Inventory Component", from that get "Default Inventory Items" as seen in the lower left part of the picture.
 
# Next drag the "MyPlayerDataStruct" (Upper right) Pin and get "Break PrimalPlayerDataStruct".
 
# Now drag the "My Data" and "My Player Data Struct" (Upper right) Pins and for both get "Set Members ...". Connect the "Initialize Inventory" Node execution pin from the first graph to the first "Set members" Node, and the execution Pin from the first "Set members" Node to the second.
 
# The execution pins are now set up, now we need to finish up the data connections. Begin with connecting all matching pins from "Break PrimalPlayerDataStruct to the two "Set members" nodes. Leave out the "MyPersistentCharacterStats" Pin!
 
# From the "Break PrimalPlayerDataStruct" drag the Pin "My Persistent Character Stats" and get "Break PrimalPersistentCharacterStatsStruct"
 
# From one of the "Set members" Nodes drag the "My Persistent Character Stats" input pin and get "Make PrimalPersistentCharacterStatsStruct". Connect the "Make .. " node to the second "Set members" node too.
 
# As seen in the lower left part of the image connect the Default Inventory Items Pin to the "Player State Engram Blueprints" Pin of the "Make .. " node.
 
# Finally Connect the "Character Status Component Experience Points" and "Player State Total Engram Points" of the "Break PrimalPersistentCharacterStatsStruct" to the "Make ..." Node.
 
 
 
== Result ==
 
Now give your character the item and use it. As a result you should see the item in your engram tree view, your crafting engrams in the inventory, and additionally a message "ADDED: Engram [XYZ]" should appear, just like when regularly learning an engram.
 
 
 
== Copy & Paste ==
 
You can find a full paste of the blueprint graph here: http://pastebin.com/raw/EtbMUfnf
 
 
 
== Interactive Blueprint Display ==
 
You can find an interactive Copy & Paste version here: http://blueprintue.com/blueprint/_6p7uoo9/
 
Sadly the ARK custom classes and structs are now shown with name, but in combination with the above images this should allow you to get stuff working!
 

Revision as of 17:41, 7 October 2017


Due to a new exposed node this has become very simple - use the "Blueprint Used" event and call "Server Unlock Engram".