Hi, in this tutorial i will try to give you an overview how you can add a custom MultiUse entry to your mod structure(should also work for any other actor).
I will cover only the basics in this tutorial but i am planning to create more example blueprints with comments that cover some more advanced use cases of the multiuse functions and ideally other topics too, if you guys like this one.
You can download the example asset with all the comments on github here: GitHub - Mezzow/ADKTutorials: Tutorial/Example Blueprints for the Ark Survival Evolved DevKit
If you download as zip extract to ARKDevKit\Projects\ShooterGame\Content\Mods and remove the “-master” tag from the “ADKTutorials” folder.
The path to the asset should look like this: ARKDevKit\Projects\ShooterGame\Content\Mods\ADKTutorials\MultiUse\TestBox_MU_Basic.uasset
- I am going to assume you know how to setup a mod and custom structure and have already done both.
1. Open up the blueprint of your custom structure.
**2. In the “Defaults” panel, look for the flag “Blueprint Multi Use Entries” and set it to true:
3. Go to the “Graph” tab, right-click on “BPTry MultiUse” and select “Implement function”. Do the same thing again for “BPGet Multi Use Entries”:
**4. Now you are set to add your own entry to the menu through those functions. I won’t cover every step here, instead i created the basic example blueprint with extensive comments that hopefully explains itself:
- “BPGet Multi Use Entries” function:
- “BPTry Multi Use” function:
[INDENT=2]NOTE: Always set “Return Value” to true on the Return node(at least for the default execution path) or else options that trigger UI Widgets like pin codes and custom names won’t work anymore![/INDENT]
- (optional)“BPClient Do Multi Use” Event on the Event Graph:
Some additional information how these functions work:
“BPGet Multi Use Entries” is executed on the client as soon as a player is near enough to interact and targets the structure. It passes the default multiuse entries of the actor as an array, you can then modifiy it within the function and return back the modified array. This returned array is then used to determine the menu entries that get displayed.
“BPTry Multi Use” is executed on the server when a player activates a menu entry. The “Use Index” indicates which multiuse entry was activated. If the “Return Value” bool is set to true in the return node the “BPClient Do Multiuse” Event will be fired on the client.
The “BPClient Do Multi Use” event is fired on the activating client after “BPTry Multi Use”. An example for when you can use this is if you want to display notifications for the interacting player only.
I hope this tutorial/example is somewhat conclusive, if not please tell me! Also if anyone spots errors in any of the explanations and comments do not hesitate to correct me!
As i wrote earlier if you guys like this i am willing to make more tutorials of this kind, so any feedback or question is welcome!