Non-static placeable "initial state" variable - conditionally hiding placeables
Aornar
Member Posts: 4
Hi folks,
I've come across an interesting problem that doesn't seem to have a straightforward solution. The general idea is the following:
- I have an area which serves as the 'party camp'.
- Each companion has their own space within the camp including their tent and some other placeables specific to them (e.g. scattered books for the wizard, combat dummy and anvil for the fighter, etc.); About 10-20 placeables total per companion.
- I want these groups of placeables to spawn / despawn conditionally depending on whether the companion is a member of the party (e.g. has been recruited, hasn't left the party and isn't dead).
I've seen that non-static placeables have a "destroyed" initial state which makes them invisible, but I cannot find the name of the local variable that actually controls this state. The closest I have managed to find is X2_L_PLC_ACTIVATED_STATE, but this is merely a boolean between Active/Inactive states for lights,levers,etc.
Ideally, what I would like to do is spawn the entire camp (including placeables for all companions) and then conditionally set some of the placeables to a "destroyed" state or make them into hidden objects, but I can't seem to find either of those two functions. I don't want to destroy the objects permanently, in case they need to be reverted to 'visible' at a later date (when a new companion joins the party, for example).
I have considered the usual techniques for hidden objects (such as waypoints that spawn objects on top of them), but this will be very clunky in a small area housing ~150 separate waypoints. I've also considered 'teleporting' the unused objects to some inaccessible corner of the map while storing their previous location data inside the object in case it needs to be ported back, but again this seems a bit hacky.
Would anyone be able to recommend a better solution for this or am I out of luck?
Many thanks,
Aornar
I've come across an interesting problem that doesn't seem to have a straightforward solution. The general idea is the following:
- I have an area which serves as the 'party camp'.
- Each companion has their own space within the camp including their tent and some other placeables specific to them (e.g. scattered books for the wizard, combat dummy and anvil for the fighter, etc.); About 10-20 placeables total per companion.
- I want these groups of placeables to spawn / despawn conditionally depending on whether the companion is a member of the party (e.g. has been recruited, hasn't left the party and isn't dead).
I've seen that non-static placeables have a "destroyed" initial state which makes them invisible, but I cannot find the name of the local variable that actually controls this state. The closest I have managed to find is X2_L_PLC_ACTIVATED_STATE, but this is merely a boolean between Active/Inactive states for lights,levers,etc.
Ideally, what I would like to do is spawn the entire camp (including placeables for all companions) and then conditionally set some of the placeables to a "destroyed" state or make them into hidden objects, but I can't seem to find either of those two functions. I don't want to destroy the objects permanently, in case they need to be reverted to 'visible' at a later date (when a new companion joins the party, for example).
I have considered the usual techniques for hidden objects (such as waypoints that spawn objects on top of them), but this will be very clunky in a small area housing ~150 separate waypoints. I've also considered 'teleporting' the unused objects to some inaccessible corner of the map while storing their previous location data inside the object in case it needs to be ported back, but again this seems a bit hacky.
Would anyone be able to recommend a better solution for this or am I out of luck?
Many thanks,
Aornar
0
Comments
When you want the set to appear, call (say) RevealStuff("tag") which recreates all the objects in the array via CreateObject.
The tables only need to be built once, strictly speaking.
Another method is to apply EffectCutsceneInvisibility(), but that has at least two known bugs.