Tonakien
(Tonakien)
August 25, 2023, 8:01pm
1
I need array of actors connected to other actors where same actors can appear multiple times.
I tried maps but key must be unique so it is no go for my purpose.
I assume I need to create custom structure with only two variables as single links on my objects. And then I need to create array of that structure.
Any suggestions?
Everynone
(Everynone)
August 25, 2023, 8:11pm
2
Sounds like you’ve answered it already:
structure with only two variables as single links on my objects:
And then I need to create array of that structure.
Tonakien
(Tonakien)
August 25, 2023, 8:41pm
3
Yeah sounds about right but I encountered strange issue…
This is how I add records to the array:
It works fine while Im placing blocks in a row:
But when I connect 2 or more blocks to the same block this start to happen:
And I dont know why… “Halp!”
It is different structures created on the flight… there should be no connection between them to delete references in other structures…
Update: This issue happens even with only 2 blocks just with some time passed
Tonakien
(Tonakien)
August 25, 2023, 10:27pm
4
Seems like I have very similar issue like in this topic:
I have an “item” struct. ID, name, stats, etc etc…
First problem: My item BPs randomly had their structure reset. I don’t have many items yet, but plan on having hundreds. If all of them were to reset that would be totally devastating. I don’t know what caused it, but I think modifying the structure is what did it.
Second problem: Every time I launch my project, all of my structure array pins get unlinked. All of them. Again, this started happening after I modified the struct.
What can I do t…
Log output:
[2023.08.26-01.20.28:788][ 60]LogBlueprintUserMessages: [BP_ShipEditoPlayer_C_0] Child Block BP_FrameBlock01_C_0 Connected to Parent Block BP_CoreBlock01
[2023.08.26-01.20.34:148][703]LogBlueprintUserMessages: [BP_ShipEditoPlayer_C_0] Child Block BP_FrameBlock01_C_0 Connected to Parent Block BP_CoreBlock01
[2023.08.26-01.20.39:463][335]LogBlueprintUserMessages: [BP_ShipEditoPlayer_C_0] Child Block None Connected to Parent Block BP_CoreBlock01
I did absolutely nothing. Just sit and press “print log”.
After 10 seconds first variable in data structure became empty
Its always first variable that should contain link on component. And it does… first couple of seconds…
pezzott1
(pezzott1)
August 26, 2023, 5:09am
5
if a parent has more than one child you need a struct per child?
Tonakien
(Tonakien)
August 26, 2023, 6:49am
6
I want to store a map of connected objects.
Child need to be able to connect to several parents.
Which leads me to structure per each child.
Is there another solutions? Im open to suggestions
Tonakien
(Tonakien)
August 26, 2023, 10:41am
8
Parent is a block that is already part of a ship. Child is new block that player want to add.
I mean I understand this is not regular parent-child concept. I just use same words to simplify understanding.
pezzott1
(pezzott1)
August 26, 2023, 3:17pm
9
IMO a Map <parent, child array> should be enough, but only for this instance.
Do you plan to allow the player to save this?