how do I pick a family instance of a particular object

This forum is currently in read-only mode.
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • normally I can do

    pRuntime->SelectAll(MyObjectType);

    pRuntime->Select(MyObjectPointer);

    to select a particular object assuming that MyObjectPointer points to a specific instance of MyObjType

    if I want to select MyObjectPointer as a member of a family of type MyFamilyType

    would it be

    pRuntime->SelectAll(MyFamilyType);

    pRuntime->SelectF(MyObjectPointer,MyFamilyType); ??

    also, what would happen if I tried to do:

    pRuntime->SelectF(MyObjectPointer,ADifferentFamilyType)

    assuming that MyObjectPointer was not a member of ADifferentFamilyType, or that ADifferentFamilyType pointed to a different object type

    also, is there a way to add an object to a family via a plugin?

    either during runtime or edittime

    meaning that I have a pointer MyFamilyType, and MyObjectPointer, which is not a member of that family

    and I can add the object to the family without the user doing so manually?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • normally I can do

    pRuntime->SelectAll(MyObjectType);

    pRuntime->Select(MyObjectPointer);

    No, you should always use the functions that end in F (eg SelectF) because the other ones are deprecated and do not work properly.

    [quote:17wwbheq]

    pRuntime->SelectAll(MyFamilyType);

    pRuntime->SelectF(MyObjectPointer,MyFamilyType); ??

    That's right, it works the same as selecting it for an ordinary object type.

    [quote:17wwbheq]

    pRuntime->SelectF(MyObjectPointer,ADifferentFamilyType)

    This is only valid if MyObjectPointer is a member of the family "ADifferentFamilyType", you cannot pick objects in types or families they're not a part of. The consequences of this are undefined.

    [quote:17wwbheq]also, is there a way to add an object to a family via a plugin?

    Sorry, this isn't possible.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)