Announcement

Collapse
No announcement yet.

Creating a Global BP to change other BPs

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

    Creating a Global BP to change other BPs

    Hello,

    As an artist and a super noob BP user, I created a set of building templates. I have a base building mesh and I have 3 upgraded levels of it.

    Click image for larger version  Name:	files_01.jpg Views:	0 Size:	33.9 KB ID:	1719136

    I managed to create a blueprint that I can change it's levels. Here is the Blueprint:

    Click image for larger version  Name:	bp_building_a_01.jpg Views:	0 Size:	248.3 KB ID:	1719135

    With this I can change building's levels in editor.

    Click image for larger version

Name:	bp_menu_01.jpg
Views:	128
Size:	164.9 KB
ID:	1719137

    Great, but I will have dozens of this kind of buildings that have base + 3 levels so what I need is to create a BP (let's say BP_Building_Changer) that I can change this "select building level" variable in this global BP and all buildings will change accordingly.

    Past 3-4 days I was watching lots of videos (both official and community) reading documentation, forum posts but I couldn't do it. First of all I don't have programming skills, I can do materials but this is something else. Second, almost all examples suggest "event dispatchers" but all examples works with some trigger volumes or level blueprint, I couldn't find something similar to this situation and I don't know how to use "event dispatchers" in this scenario.

    How can I do this?
    Thanks.
    Last edited by Tirido; 02-09-2020, 08:03 AM.
    Scanned Poplar/Aspen Forest with Seasons
    http://www.tirido.com

    #2
    Originally posted by Tirido View Post
    Hello,

    As an artist and a super noob BP user, I created a set of building templates. I have a base building mesh and I have 3 upgraded levels of it.

    Click image for larger version Name:	files_01.jpg Views:	0 Size:	33.9 KB ID:	1719136

    I managed to create a blueprint that I can change it's levels. Here is the Blueprint:

    Click image for larger version Name:	bp_building_a_01.jpg Views:	0 Size:	248.3 KB ID:	1719135

    With this I can change building's levels in editor.

    Click image for larger version

Name:	bp_menu_01.jpg
Views:	128
Size:	164.9 KB
ID:	1719137

    Great, but I will have dozens of this kind of buildings that have base + 3 levels so what I need is to create a BP (let's say BP_Building_Changer) that I can change this "select building level" variable in this global BP and all buildings will change accordingly.

    Past 3-4 days I was watching lots of videos (both official and community) reading documentation, forum posts but I couldn't do it. First of all I don't have programming skills, I can do materials but this is something else. Second, almost all examples suggest "event dispatchers" but all examples works with some trigger volumes or level blueprint, I couldn't find something similar to this situation and I don't know how to use "event dispatchers" in this scenario.

    How can I do this?
    Thanks.
    I'm assuming you're talking about changing object type globally BEFORE runtime, ie in the editor?

    Comment


      #3
      Originally posted by ClockworkOcean View Post

      I'm assuming you're talking about changing object type globally BEFORE runtime, ie in the editor?
      So, in the basic shape bp I have:

      Click image for larger version

Name:	basic-shape-bp.PNG
Views:	156
Size:	146.3 KB
ID:	1719478

      Notice how the custom event has the 'call in editor' box ticked in the details panel.

      Then the 'global shape changer' code looks like this:

      Click image for larger version

Name:	global.PNG
Views:	148
Size:	73.3 KB
ID:	1719479

      ( also call in editor )

      This way, you have an extra step when changing an individual shape ( you have to press the button after change a parameter ), but you can change all the shapes from the global BP.

      Comment


        #4
        It works! Thank you so much ClockworkOcean !

        But one question:

        I couldn't make it to change another shape same time. In my example I have "building_a". But I will have building_a, building_b, wall_a... etc. So 'global shape changer' should change all of them in same time. But I couldn't connect "change shape" custom event in 'global shape changer' to another "get all actors of class" node for another object. It connects to just one "get all actors of class" node. So how can I change multi models in same time?

        I can create another custom event and name it "change shape b" and connect it to building_b's node. It works but there will be dozens of buttons in this case, it's not practical.

        Thank you again!
        Last edited by Tirido; 02-11-2020, 01:34 PM.
        Scanned Poplar/Aspen Forest with Seasons
        http://www.tirido.com

        Comment


          #5
          Got it I "string them together linearly", as documentation says. Now It works on multiple objects in same time

          Thank you so much again.
          Scanned Poplar/Aspen Forest with Seasons
          http://www.tirido.com

          Comment


            #6
            I made a bigger test and unfortunately it doesn't work completely.

            There are 5 type of buildings in the scene. As you can see when I run building_changer BP it only changes some of them.

            Click image for larger version  Name:	buildings_problem_01b.jpg Views:	0 Size:	542.1 KB ID:	1720403

            For building_c it works 100%, for building_b it works about 20% and it changes only the first building_a in the scene, for others it doesn't work. Weird. Every building BP is exact copy of building_a, just with different materials.

            Here is the building_changer BP:

            Click image for larger version  Name:	building_changer_2.JPG Views:	0 Size:	450.9 KB ID:	1720404

            What am I doing wrong? I'm using 4.24.2 by the way.
            Last edited by Tirido; 02-12-2020, 02:46 PM.
            Scanned Poplar/Aspen Forest with Seasons
            http://www.tirido.com

            Comment


              #7
              Any ideas?
              Scanned Poplar/Aspen Forest with Seasons
              http://www.tirido.com

              Comment


                #8
                Originally posted by Tirido View Post
                Any ideas?
                Tirido, you have to quote me, otherwise I don't get any notification

                You've made a NOOB mistake. You need to chain those loops together using the Completed pin! At the moment, every loop is running every other loop millions of times! I'm guessing it's slow?...

                Comment


                  #9
                  Originally posted by ClockworkOcean View Post

                  ... I'm guessing it's slow?...
                  Very Thank you, I will try it when I get home.
                  Scanned Poplar/Aspen Forest with Seasons
                  http://www.tirido.com

                  Comment


                    #10
                    Originally posted by ClockworkOcean View Post
                    You need to chain those loops together using the Completed pin!
                    Yes, it works! Thank you very much! And it's lightning fast
                    Last edited by Tirido; 02-17-2020, 01:16 PM.
                    Scanned Poplar/Aspen Forest with Seasons
                    http://www.tirido.com

                    Comment

                    Working...
                    X