Announcement

Collapse
No announcement yet.

How can I get a blueprints name? or a class reference to self in a blueprint?

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

    How can I get a blueprints name? or a class reference to self in a blueprint?

    How can I get a blueprints name? or a class reference to self in a blueprint? Thanks


    Update: I found a way to do it but will this way work the same after packing? I'm using the "Get Display Name" the non-debugging one is this one ok to use for final game packing?


    Click image for larger version  Name:	5.jpg Views:	1 Size:	141.1 KB ID:	1493109







    Last edited by Cipher5; 06-24-2018, 07:57 AM.

    #2
    No, never use the display name to identify actors, or do anything other than debugging.

    Comment


      #3
      Originally posted by ste1nar View Post
      No, never use the display name to identify actors, or do anything other than debugging.
      There are 2 different "display name" nodes, one obviously says don't use the other doesn't have a warning... How else would I get the class or blueprint name? thanks

      Comment


        #4
        Cipher5

        Originally posted by Cipher5 View Post
        There are 2 different "display name" nodes, one obviously says don't use the other doesn't have a warning... How else would I get the class or blueprint name? thanks
        Blueprints like Level-Actors support 'User-Defined' Tags, so maybe that's a safer option...
        The warning seems to be about 'Localization' and never displaying this info to end-users...
        It'd be interesting to test what actually breaks in editor vs packaged builds for both cases.

        Comment


          #5
          Considering that you want to use a Name property to pull some data from a data table, I would use a Name variable to identify the type I'm working with. It looks like it's a weapon getting the appropriate Ammo data, in which case it would be "Ammo Type".

          Comment


            #6
            The reason I'm doing it this way is so when the item/blueprint is spawned in the world the blueprint can just get its own class automatically and then grab the right data from the right data table.

            Comment


              #7
              How about : event begin play > Get Self> get class > get all actors of class > for each > loopbody> item == self = true > pull data

              Comment


                #8
                Originally posted by Muntrax View Post
                How about : event begin play > Get Self> get class > get all actors of class > for each > loopbody> item == self = true > pull data
                Thanks for helping me out I really appreciate you taking the time. I just tried to as you said but I still need either the class name or the blueprint name for my blueprint to work. The way above puts me still getting just the actors name not the class. any more ideas? How I have it currently setup is if I know the class of the spawned blueprint actor I can use that class to run through each data table I have e.g. weapons, ammo, projectiles, food, etc. If the row name (I made all my row names the name of the class/blueprint) matches great then pull data, if no row found it will jump to check the next data table and so on. I thought the way I'm using works pretty slick so far... I'm packaging my project right now to see if my setup will still work or be broken. If my way works then I guess I'll just roll with it unless I find a better easier way to do the same thing. Thanks

                Comment


                  #9
                  Use BP Tags...

                  Comment


                    #10
                    Originally posted by franktech View Post
                    Use BP Tags...
                    You wouldn't have a quick example of using tags? or a link? thanks

                    Comment


                      #11
                      Hello
                      Here is a video with good explanation and example : https://www.youtube.com/watch?v=e2rdXo408Q0

                      Comment


                        #12
                        Thanks for the link. I watched it, and it seems like it can come in handy sometime. It looks like a lot of extra work for what I'm doing, I tested packaging a test project and displaying the blueprints Class Display Name, Object Name and Display Name. The class display name worked after packaging awesome, at least how I have it setup with chopping 2 off the end of it. As we all already knew the other two ways failed and gave the other object editor assigned name with the added numbers at the end. Thanks to all that read and contributed on this tread because I learned something new on BP Tags etc.




                        I attached a picture of the output in the packaged game, my blueprint was named test28 and as you can see it displayed right for the class display name. No matter how many test28 blueprints I drag on to the map the name will never change.
                        Last edited by Cipher5; 06-30-2018, 02:02 AM.

                        Comment


                          #13
                          Cipher5

                          I had suggested BP -> Class Defaults -> 'Actor Tags'...
                          They're just a user enterable 'text string' description.
                          Sounds like that's all you need for this problem, no?

                          Anyway it sounds like you have it working packaged.
                          Maybe keep a note around to check on it periodically.
                          Just in case new engine versions cause that to break...

                          Comment

                          Working...
                          X