beders's Forum Posts

  • 2 posts
  • You can have it both ways. 'Create object' or 'Spawn object' pick the instance, so you can initialise just that object in a constructor-like way. If you *do* want to do something to *all* instances after creating another instance (which sounds unusual but is possible), just put 'pick all' in a subevent and then you can affect all instances from there.

    This should probably make it into the manual (in the section where System Create Object is described)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • What is the best way to pick items from a container if an event related to a family is triggered (with a family member being in a container)?

    I tried to find the answer on the forum, but failed to do so

    Example:

    Family: Tank consisting of [ ELC_AMX_Base, Hetzer_Base ]

    Family instance variable: selected

    Family: Turret consisting of [ ELC_AMX_Turret, Hetzer_Turret ]

    Container: ELC_AMX_Base, ELC_AMX_Turret

    Container: Hetzer_Base, Hetzer_Turret

    Now if I have a condition that triggers on family instances:

    | Tank is selected | actions...

    for example,

    how can I then find the turret belonging to the actual tank being picked? For example this condition picks an ELC_AMX_Base, it seems that the ELC_AMX_Turret is not being picked with it (which I would expect since it is in the same container!)

    The documentation indicates that 'if an object from a container is picked, all objects from the container are picked as well',

    but that doesn't seem to be the case with families.

    The only solution I found so far was to give each Tank an instance variable to point to the turretUID and then use that in a sub event:

    | Tank is selected |

       | Turret Pick instance by UID Tank.turretUID | [ action A,B,C ]

    Is that the recommended approach?

    Thanks,

    Jochen

  • 2 posts