Announcement

Collapse
No announcement yet.

Tutorial/Example: Adding custom MultiUse(Radial) menu entry/action

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Tutorial/Example: Adding custom MultiUse(Radial) menu entry/action

    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: https://github.com/Mezzow/ADKTutorials
    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

    Let's start:
    - 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:

    [screenshot]https://i.imgur.com/KW8h3jE.png[/screenshot]

    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":

    [screenshot]https://i.imgur.com/MuOW9Yh.png[/screenshot]

    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:


    [screenshot]https://i.imgur.com/5HdZL9L.png[/screenshot]

    - "BPTry Multi Use" function:


    [screenshot]https://i.imgur.com/xvVnLrE.png[/screenshot]
    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!

    - (optional)"BPClient Do Multi Use" Event on the Event Graph:


    [screenshot]https://i.imgur.com/HYnqsFN.png[/screenshot]

    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!

    How to restrict access to menu entries (Tribe only, Personal Owner only and Server Admin only)
    Last edited by Mezzow; 08-12-2016, 06:36 PM.
    ARKModding.net Wiki --- ARKModding.net: Resource Collection, BP Snippets --- ADK Tutorial/Example Blueprint Collection on github --- Tutorial: Adding custom MultiUse(Radial) menu entry/action --- My Steam Workshop

    #2
    Brilliant! You're an asset to the modding community Mezzow. Very grateful for all the support you have given. Thanks man! I have done a bunch with multi-use now too with comments etc. Incase anyone wants some more references or something to learn from I would be happy to post here. Again, Mezzow. You're awesome man!

    Comment


      #3
      if only this was posted before i starting my menu took me a day or 2 to learn how to do it my self =( but thanks for this
      My MODS: Ark Advance | Ark Steampunk Mod

      Comment


        #4
        Another user was asking me about this topic and one thing I wanted to make sure they knew about was replication. Depending on what you want the item to do, you might need to ensure everything is bouncing back and forth between the server and all other connected users. For the changing materials in my Advanced Architecture Mod I do this by creating an integer variable and setting the replication to RepNotify. This opens another function that fires every single time that variable is changed. I have my Try multi use do what it needs to do but also change the value of my repnotify integer. That new function then has all the major changes to my structures being made and it replicates nicely. That variable you use can also have the box for SaveGame checked and the value will individually save for any deployed structures you made with this setup. This is invaluable for also setting up an OnBeginPlay event in the main event graph where you can decide to make changes to the structure the moment its loaded into the game, and have those changes reflect a previously chosen value, even after a restart.

        Comment


          #5
          Originally posted by hogscraper View Post
          Another user was asking me about this topic and one thing I wanted to make sure they knew about was replication. Depending on what you want the item to do, you might need to ensure everything is bouncing back and forth between the server and all other connected users. For the changing materials in my Advanced Architecture Mod I do this by creating an integer variable and setting the replication to RepNotify. This opens another function that fires every single time that variable is changed. I have my Try multi use do what it needs to do but also change the value of my repnotify integer. That new function then has all the major changes to my structures being made and it replicates nicely. That variable you use can also have the box for SaveGame checked and the value will individually save for any deployed structures you made with this setup. This is invaluable for also setting up an OnBeginPlay event in the main event graph where you can decide to make changes to the structure the moment its loaded into the game, and have those changes reflect a previously chosen value, even after a restart.
          I will try and make an example that explains replication in this context better. Or maybe one that explains replication at all, i will see.
          Regardless i can only recommend to watch the networking tutorial series by epic here: https://www.youtube.com/playlist?lis...SFPRiBpwe5sTwc
          ARKModding.net Wiki --- ARKModding.net: Resource Collection, BP Snippets --- ADK Tutorial/Example Blueprint Collection on github --- Tutorial: Adding custom MultiUse(Radial) menu entry/action --- My Steam Workshop

          Comment


            #6
            Thanks Mezzow, the tutorial works great! This will really bring my mods to a more professional level
            Last edited by duke54; 01-17-2016, 01:09 AM.
            Trampolines Mod
            https://steamcommunity.com/sharedfil...ext=trampoline

            Comment


              #7
              Once again, can't thank you enough! Now that I'm editing my own mods I can give players more control over how things work (now my trampoline mod needs only one trampoline and I can let the players set it up how they want). My horizons have expanded. Please do more tutorials.


              Personaly I would like to see an 'Admin only' multiUse action, or a multiUse action that gets user text input like the in game note paper
              Last edited by duke54; 01-17-2016, 01:39 AM.
              Trampolines Mod
              https://steamcommunity.com/sharedfil...ext=trampoline

              Comment


                #8
                Here is an example on how to do some checks(Tribe only, Personal Owner only and Server Admin only). It all goes in the "BPGet Multi Use Entries" function:

                [screenshot]https://i.imgur.com/qxJYK22.png
                [/screenshot]

                [screenshot]https://i.imgur.com/xRimnGw.png
                [/screenshot]

                [screenshot]https://i.imgur.com/b1PdPly.png
                [/screenshot]

                You can do other things like checking if the structure is powered, pin locked, etc. in a similar manner.

                Im going to expand this a bit more and then also upload it to github.
                ARKModding.net Wiki --- ARKModding.net: Resource Collection, BP Snippets --- ADK Tutorial/Example Blueprint Collection on github --- Tutorial: Adding custom MultiUse(Radial) menu entry/action --- My Steam Workshop

                Comment


                  #9
                  Sweet! I feel like I'm becoming more powerful, ha ha.
                  Trampolines Mod
                  https://steamcommunity.com/sharedfil...ext=trampoline

                  Comment


                    #10
                    Originally posted by Mezzow View Post
                    [screenshot]https://i.imgur.com/qxJYK22.png[/screenshot]
                    In the photo above for the Tribe condition check, you have a node linking the Target/Targeting team, Targeting team and the Branch nodes, what is the node called. When I connect the nodes, it uses the "Convert int to boolean" node, which from what I can tell only accepts one input, not two as you have illustrated above. See my screenshot below:

                    [screenshot]http://i.imgur.com/WauKkzG.png[/screenshot]

                    Comment


                      #11
                      That node is called "Equal(Integer)" and is used to check uf the two values you put in are equal. Those are available for different variable types.
                      ARKModding.net Wiki --- ARKModding.net: Resource Collection, BP Snippets --- ADK Tutorial/Example Blueprint Collection on github --- Tutorial: Adding custom MultiUse(Radial) menu entry/action --- My Steam Workshop

                      Comment


                        #12
                        Originally posted by Mezzow View Post
                        That node is called "Equal(Integer)" and is used to check uf the two values you put in are equal. Those are available for different variable types.
                        Thanks for your reply, I managed to figure that out in the end, all works splendidly. Thanks for the awesome tutorial. Quick question, with the Tribe Alliance system dropping in the next patch, do you think you'll be able to update the tutorial when that happens to cover conditionally checking for allied tribe targets as well? That would be really helpful.

                        Comment


                          #13
                          Originally posted by matt_d_rat View Post
                          Thanks for your reply, I managed to figure that out in the end, all works splendidly. Thanks for the awesome tutorial. Quick question, with the Tribe Alliance system dropping in the next patch, do you think you'll be able to update the tutorial when that happens to cover conditionally checking for allied tribe targets as well? That would be really helpful.
                          I will definitely look into that when we get the devkit update!
                          ARKModding.net Wiki --- ARKModding.net: Resource Collection, BP Snippets --- ADK Tutorial/Example Blueprint Collection on github --- Tutorial: Adding custom MultiUse(Radial) menu entry/action --- My Steam Workshop

                          Comment


                            #14
                            I want to change the 'Whistle'-menu, so I can add or replace the actions in the radial selector to my own custom action/functions. How can I do this? It probably won't change by editing the MultiUse menu.
                            Check out my ARK Mod Play As Dino!

                            Comment


                              #15
                              This thread was linked to me with the instruction:

                              Originally posted by boats View Post
                              https://forums.unrealengine.com/show...u-entry-action

                              You would add a multiuse to the campfire which spawns the dinosaur on the server after checking the contents of the actor's inventory.
                              Could you show an example of how to go about doing this please?
                              I'm basically trying to spawn a dino from a custom structure the way bosses are spawned with a tribute at the towers.

                              Comment

                              Working...
                              X