Announcement

Collapse
No announcement yet.

Problem referencing StaticMesh Components in same Actor

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

    Problem referencing StaticMesh Components in same Actor

    Hello guys,

    I have a (probably small) problem with my Blueprint. I'm trying to recreate a simple TicTacToe game.


    What I have right now is a Blueprint with the models and every single panel in the array as Static Mesh Components inside. It looks like this:

    Click image for larger version

Name:	Macro3.jpg
Views:	1
Size:	194.5 KB
ID:	1148858

    I got everything working so far. The first Panel (1x1) switches the material according to what owner it has (0 = none, 1 = Circle, 2 = X) so generally my Blueprint is working.
    What I wanted to do know is put that functionality on every single panel in the blueprint. So I took my existing Blueprint and converted it to a macro so I can reuse it for every panel. The important parts of the macro look like this:

    Click image for larger version

Name:	Macro.jpg
Views:	1
Size:	169.1 KB
ID:	1148859

    The yellow line represents what connection I need. It basically checks what value the panel variable (for example 1x1) has and changes the material accordingly on the panels specific mesh (in this case of course 1x1).
    So the main Blueprint looks like this:

    Click image for larger version

Name:	Macro2.jpg
Views:	1
Size:	85.6 KB
ID:	1148861

    Now, all I want to do is input the Static Mesh Component into each Macro so I can use it like I showed in the second picture. The problem is that the two types seem to be incompatible. Depending on what I set the macro input to I can either not input it into the macro at all or I can input it into the macro but the "Set Material" nodes inside the macros cannot use it.


    So, how do I solve that? I'm sure it's pretty easy but I cannot get behind it...

    Thanks in advance!

    #2
    What is the variable that you are looking for on the input?Perhaps you have set it as instance mesh or something of the like?

    Comment


      #3
      Wouldn't the set material node simply set 'self' if you left it alone? And you said this is per blueprint, so isn't it good the way you have it?

      Edit:
      Why don't you set a static mesh component input? And when you execute the macro, pass the macro the static mesh from 'get static mesh'.
      Last edited by Jamendxman3; 04-28-2015, 10:48 PM. Reason: Update
      Marketplace Assets

      Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
      Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
      Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

      Comment


        #4
        Thanks guys, but I found a different solution!

        I removed the panels from the playfield Blueprint. They are now seperate, own Blueprints that will be referenced via object variable in the playfield Blueprint. It works as intended now! Now I just have to find a way to make the rules actually apply on the panels. Right now I have no idea how to solve it

        Click image for larger version

Name:	tictactoe.jpg
Views:	1
Size:	110.3 KB
ID:	1075360

        Comment


          #5
          That is the simplest way to do it sure, but you should have been able to do it within the 1 blueprint pretty easily.

          Figuring out the actual "win/lose conditions" is a bit of a trickier 1. You will want to do a few loops checking what their partner is in each direction and if you get 3 in the 1 direction than you win. Which is why having them in a single blueprint would actually be easier for this but you could just pass the variables over to the level or gamemode blueprint

          Comment

          Working...
          X