Structures
- A reference
- We are getting closer to the goal.
- A transporter that "grows" with the game
- Right now the data is stored in the wrong place.
- I would like the ability to turn levels on and off
- I would like level names, not just map names.
- It's starting to look like three parallel arrays
- But structures can save us.
- Build a structure type
- I want a FloorT
- It should hold a name (level name) , string (level description ) and a bool (active)
- Build a new structure type
- Click in the Content Browser and select
- Blueprints, structure (NOt Blueprint Actor)
-
- Now just add the fields.
-
- You can now build an instance or even an array of these.
- Let's build an BP_TransportDir
- The normal box and cube for collision.
- But add a FloorT variable
- Make it an array.
- Initialize the first record.
- On EventBeginPlay, enable input
- Add a event key p event to print all elements in the array.
- Add a foreach
- Hook up the array.
- Note that you can split the pin for the array element.
- Or you can use a "Break" note.
-
-
-
- I added a keypress a
- This adds another level.
-
- Note the MakeFloorT node.
- Finally a keypress z
- This toggles the active flag on the first element.
- Notice the SetArrayElem node
-