how does rexrainbow Function call work with pick?

0 favourites
  • 5 posts
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.
  • If I have the following code:

    Event 1

    -- Subevent 1

    ---- Call Function("CreateObjectA")

    ---- Set ObjectA.Val = bla bla bla

    And CreateObjectA() is a rexrainbow function (in a separate event sheet), which has:

    On Function CreateObjectA

    -- System Create ObjectA

    Will the following calls that act on sprites of type "ObjectA" only act on the one that was created? As I understand it, when a sprite is created, the SOL (for sprites of ObjectA) is only set to that particular instance.

    I just want to make sure I don't have to do a subsequent Pick by the created objects UID. Anyone have any ideas about this? I've got a lot of object A being created on the fly, so it's very important that the following Set value call only act on the latest created instance of ObjectA.


    -- cacotigon

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think it won't. Well it's not very hard to check that, just instead of setting a variable set some random size and you'll see if all the already created object are affected or not.

    To simulate picking you could set a boolean named 'picked' to true on creation inside the function, and then add a "is picked" after the call to set your value and directly set this boolean to false to somehow lock it.

  • I will summon Rex now...

    up, up, down, down, left, right, left, right, B, A, START.


  • cacotigon

    My function plugin does not touch/change SOL. The SOL will be changed by event sheet itself.

    From my testing,

    -- Subevent 1
    ---- Call Function("CreateObjectA")
    ---- Set ObjectA.Val = bla bla bla

    the SOL in

    Set ObjectA.Val

    will not equal to created ObjectA. So Yann is right.

  • Thanks! In that case, I'd better stick to a subsequent pick call of the Function.Result which I set to the created object's UID.

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