Hi, thanks for the replies
That’s what I want. But please clarify:
Crate BP = Parent, and Loot BP = Child inside Parent.
- Spawn Actor inside Actor: If I have Crate BP with an Actor variable (my third pic above) of the Loot BP - is there a way to instance edit the properties of the Loot BP, while in World > Details panel? (This is what I need.)
Or when you said this, did you mean it applies to both Child Actor Component spawns AND Actor (Actor variable = purple) spawns?
- Spawn Child Actor Component inside Actor: And it seems I cannot access Child Actor/replacement Actor properties [in an Instance] - because you explained that “You can’t access it from Constructor because neither the Component nor the Actor it spawns exist at Constructor time.” So I should not use Child Actor Comp, correct?
- But in BP view (Graph Editor), the original copy (single copy that changes the settings for all) of my Child Actor Component IS existing and displaying inside the Crate BP at Construct - because thats how I select 6 armor pieces (while inside the Crate BP > at the Right Details panel > “Child Actor Template”).
Then the Construct script (in Child Loot BP) reads the updated DT row handle > pulls data from Table, and updates the mesh displayed for that armor piece while inside the Crate hollow - but only for the original version of Crate BP. If I change Child vars again (in Graph), all Crates update to reflect the same settings.
- So sorry for my confusion, but you are saying [in an Instance of the Crate BP > placed in a Map], that that version of the Child does not exist yet - and that is why I cannot access/change its properties in Worldview? And thus I should not use Child Actor Comp for my goal?
My clarification: I am not destroying the Crate or Dresser, etc - they will stay visible and look empty. Only that I need the Crate BP (Parent/Holder Actor) to be separate from the Child/Spawned/Other Actor:
- because I just remembered I will also spawn Weapons, which have their own Pickup/drop code (and collisions boxes) for long after the Player collected it from Crate BP (thus Weapon BP needs to be independent of Crate code).
This is not feasible for me because each armor pickup can have 1 to 6 independent parts that can mix/match - read from a DT. Meaning for each Crate BP, I need to edit 8 variables/variatons of the Loot pickup (armor). So I want to be able to edit Crate 1 to spawn boots… but I have 20 Boot versions in the DT – so I cant make 20 versions of Crates for each boot. Crate 2 will spawn random parts, Head and boots, or Head and top - selecting from a list of 200 DT options. Thus it is too tedious to make 200 copies of Crate BP to define the exact loot (Child variants).
Above I explained why. And I saw someone else’s example. They made a Building BP, with Prop BPs inside: Desk BP, trigger Door BP, Stapler BP… We want to use Building BP because it has procedural generation code for the look/room count. And we want to populate the Building inside with other BPs that have separate trigger volumes or logic, since Player will be able to gather Prop BPs to take out of Building BP.
I dont understand what you mean – because I did make a BP for Crate, and BP for Loot type 1 (armor), BP for Loot type 2 (weapon). I need the code separate because they arent related and each is complicated.
Update: I used method #3): in Parent’s Construct Script > Get Actor of the current Child Actor Component, then CastTo [Child Actor’s] variables > Set new – (which forces Child’s Construct script to run, read DT, and Set its internal Mesh, color, stats - which will be preloaded in Parent in Editor, then final loaded at BeginPlay).
- Inside Parent, I made copies of Child’s variables (that I want to change per instance). I can edit Parent’s variables in Worldview - which solves problem 1.
And in Parent’s Construct code, I cast to exact Child Loot BP > get Child’s variable 1 > set it equal Parent’s placeholder variable 1. Then I need to repeat the Get/Set for ~20 more variables that update the look of Loot BP (modular armor, 6 pieces).
- Cons: This is tedious (to make copies of Child’s vars in Parent) because I am calling a Function inside Loot BP (armor setup), which needs 6 variables per armor piece since it uses the Player’s Skeleton/animation for modular armor. So in the pic below, I did the work for 2 armor pieces.
-
But can you help me: how can I replace the CastTo Node or use BPI? (I know how to setup BPI, but unclear on the specifics, when to set an Input vs Output in the BPI, and if the Message or Function goes in the Sender BP or Receiver BP?)
-
Or can you show how to Wildcard (name) cast? (I can make a master Loot BP, and have Children Loot BPs as you said, so they are the same class. But still, if I switch the Loot to spawn in Crate BP (Child Actor Component or Actor variable), then what is the code to determine which Child Loot variables to get?)
-
How can I avoid having to make ~8 copies of Child BP’s vars, in Parent BP?
Thank you