pick object by uid (SOLVED!!! er...REQUEST FILLED!)

This forum is currently in read-only mode.
From the Asset Store
An educational game for Fill in the Blanks. An easy to use template for developers to build larger games
  • I think it's been mentioned by others as well as myself,

    but then I learned alot and thought it was no longer necessary

    and then I learned alot more and I realize

    it really would be ridiculously useful

    and allow alot of flexibility with functions and complex object interactions

    sometimes you need to be able to choose an object out of a pool of many

    without being able to pick it first

    or you want to be able to remember a list of certain objects for later picking

    without being able to repick some object that you're going to pair them to

    I don't mean anything complex, just an event

    pick object by UID

    then you put the UID

    and it will pick whatever object and only that object will be picked(unless there are other conditions in the event)

    I understand it's possible to do a for every object and then a UID is equal to temp

    but first, this would require a different event for every object type or family

    and if you want to use this feature alot, it will always be looping through every object over and over

    if it's possible with python, someone please explain where I can start looking and whether this feature is broken, or more generally, exactly how broken python is

    I can't remember what the reason this UID picking idea is usually rejected for, or if it's just usually a request not responded to. is it harder than it seems?

  • sometimes you need to be able to choose an object out of a pool of many

    without being able to pick it first

    I don't know what you mean by this. Is there any significant difference between "choose" and "pick" in this context?

    Also, you don't need a For Each Object loop to pick by UID, you just compare the UID. For Sprite, there is a specific condition just for that under Misc. For other objects you can do a Pick By Comparison and use obj.UID as an expression.

  • thanks deadeye.

    > sometimes you need to be able to choose an object out of a pool of many

    > without being able to pick it first

    >

    I don't know what you mean by this. Is there any significant difference between "choose" and "pick" in this context?

    I meant just pick it without it having to trigger an event

    [quote:25orbjsp]Also, you don't need a For Each Object loop to pick by UID, you just compare the UID. For Sprite, there is a specific condition just for that under Misc. For other objects you can do a Pick By Comparison and use obj.UID as an expression.

    cool, I just realized the compare UID thing for sprites, before I came back to the forums. as for the other objects and pick by comparison, I guess something someone said at one point made me feel this would be inefficient in large doses, like it's cycling through each object, and if you had a few hundred things to pick from and you were picking more than one UID every tick, it would eventually start slowing things down. is this true? or is it cycling through every object to check a variable a negligible amount of cpu time that won't really add up? because if that's the case, it will simplify alot of other things on this project.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • btw, in case anyone was wondering

    it isn't a significant amount of time to check lots of UIDs

    I just made construct check the unique ids of 100 sprites 500 times a tick

    which is a total of 50,000 UID checks per tick

    and it was still running at 400fps

    thanks again deadeye

    this made my day

    man oh man, wait till you guys get a load of what I'm working on

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