Announcement

Collapse
No announcement yet.

get Struct Field by its name?

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

    get Struct Field by its name?

    Hi there..

    I ran into a problem when trying to create a simple Autotiling system, based upon Structs.

    To Create a Tile based on 4 Subtiles, i created the following Struct to hold the 4 Subtile IDs:
    Click image for larger version

Name:	Struct.jpg
Views:	1
Size:	228.0 KB
ID:	1196797

    Now, i check Bitwise if a the surrounding Blocks of my Tile are blockable or free. This is working that way:
    Click image for larger version

Name:	autotile2-300x291.png
Views:	1
Size:	3.4 KB
ID:	1196798
    And results in those 16 Tiles:
    Click image for larger version

Name:	spr_terrain_strip16-300x145.png
Views:	1
Size:	6.6 KB
ID:	1196799

    Now.. my Struct has 16 Fields. Each Filed has a Number as Name (from 0..15).
    With the following Blueprint, i´m checking Bitwise for the Blocks, and get a result BIT from 0..15:
    Click image for larger version

Name:	Autotile.jpg
Views:	1
Size:	492.7 KB
ID:	1196800


    The Question is now:
    How am i able to GET a Field of my Struct, by its Name?
    Like:
    Code:
    "Struct get (AutotileStoreBit.ToString)"
    Cause all i found via Blueprint is to break my Struct.. and this results in:
    Click image for larger version

Name:	Autotile2.jpg
Views:	1
Size:	132.0 KB
ID:	1196801


    So, is there a way to Get a Field of a Struct via its name, or/and can someone make me a Node for it if there isn´t one?


    thanks for reading

    #2
    I doubt this is possible in Blueprints. But this should work in your example:

    Click image for larger version

Name:	Unbenannt2.png
Views:	1
Size:	48.0 KB
ID:	1116609

    I rightclicked the output of the MapAutotileTable's Get node to split struct pin (that's the same as your break Struct_AutotileTable node). And I rightlicked the select node and added as many option pins as needed.
    Last edited by Pepeeee; 10-13-2016, 12:13 PM.
    Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

    Comment

    Working...
    X