I am making a simple random room generator.
It works via making a room, then at the doorways of the room having another blueprint that makes another room, and so on and so forth.
Currently i am working with only one room, it has a ‘entry’ arrow, and a ‘spawn’ or ‘exit’ arrow.
Here you can see the red arrow is the ‘entry’ arrow, and the blue arrow is the ‘spawn arrow’, for the example, i will refer to the spawn arrow in the picture as spawn arrow 2 because it is used in the second iteration (thus the program is recursive).
*they have been raised for the photograph, but should be on transform.z = 0.
When the room spawns, its transform is set to the spawn arrows transform, then the distance between its current transform and the ‘entry’ arrow is added to its current transform, in theory moving the room so that the ‘entry’ arrow lines up with the original ‘spawn’ arrow.
First try i made
These two bits of code should do the same thing.
The result is as follows:
The first iteration works fine.
But then on the second time, the ‘spawn arrow’ is not placed in the same spot as in the blueprint component viewer, and sits in the middle of the room as appose to at the door.
Heres a picture with the arrows raised so its easier to see (note that it creates stairs- to be expected, but the arrows are alot clearer in this picture).
Id really like some advice on this, any help will earn you love. I find looking at blueprints to be confusing.