picking

This forum is currently in read-only mode.
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Picking. I've been looking through some picking operations, and wow...there's alot going on there. I get some of it, but in the interest of distilling, as a simple example

    let's say I have

    *CRunObject Hello; //already pointing to a single instance of an object

    what command(s) would pick this object and allow it to continue down to the next subevent or actions?

    what if I had *CRunObject Hello, and *CRunObject Goodbye, how can I make both of those picked

    do you have to explicitly tell it to suppress elses, to run subevents, and run actions every time? or does it depend on the complexity of the particular picking operation?

  • You might be better off asking what can't be used to pick, as there are tons of ways. You can use just about anything the object can do to pick it, you can use the system to pick it, you can use other objects to pick it, the list goes on and on. As to your other question, you can add multiple conditions to the event, or pair them up using pv's, families, containers, object pairer, again just about anything they can have in common.

    On sub events Im not quite sure what you mean, any thing that is picked is automatically used in actions, unless nothing is picked, and then the parent is used.

  • He's talking about how to handle picking from the C++ side of things, in regards to making a plugin

  • Oh, disregard that, I suck at reading forum headers.

    Looks for new glasses

  • The correct pointer syntax is CRunObject*, by the way

    First, any action or condition that does any picking at all must specify the SOL_MODIFIER flag (otherwise behavior is undefined, and the app will probably crash). If the pointer is called 'object' and the pointer to its type (CRunObjType*) is called 'type', then the following does:

    pRuntime->SelectAll(type);
    // 'type' is now put in to 'all selected' mode, as if it hasn't yet been referenced by any conditions - eg. in an Always event[/code:34maw5si]
    
    [code:34maw5si]pRuntime->SelectAll(type);
    pRuntime->Select(object);
    // 'object' is now the only object picked[/code:34maw5si]
    
    [code:34maw5si]pRuntime->Select(object);
    // Without a preceeding 'selectall', this adds 'object' to the currently picked objects
    // It *must not* already be picked - if you're not sure call IsSelected() first to check[/code:34maw5si]
    
    [code:34maw5si]pRuntime->SelectAll(type);
    pRuntime->Select(object1);
    pRuntime->Select(object2);
    pRuntime->Select(object3);
    // The three objects 'object1', 'object2' and 'object3' are now selected
    // Note you cannot call Select() on the same object twice - if you think
    // any of those pointers might point to the same object, you must check it
    // isn't selected first via pRuntime->IsSelected(object)[/code:34maw5si]
    
    The code for running actions, subevents, suppressing elses etc is purely for looping conditions like for-each and repeat - they're a bit more complicated, but for other conditions, you don't need to worry about those functions at all.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanks ashley

    you've been a great help as usual

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