Question about functions and UID

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Template for dungeon/maze generation, using wave function collapse
  • In a lot of Construct 2 projects I see this technique being used. I don't get it at all though. I don't understand how this helps identify the UID of an enemy but it does. What is the parameter here even supposed to be? I don't see a proper parameter. I've been trying to recreate that same thing where a function is only called for individual instances of an object to no avail. I also know that Construct 2 Functions are different from Construct 3 functions so maybe that's apart of it. If someone could please explain what's happening here I'd appreciate it.

  • The actions that call the function are the ones to look at if you want to know how it specifies the uid to use.

    Since c2 functions don’t know what was picked when you called them you often need a way to specify what instance to pick. Passing an object’s uid as a parameter is one way to do that.

    As a minimal example it could look like this:

    On function: “rotate90”
    Sprite: pick by uid function.param(0)
    — Sprite: rotate 90 degrees
    
    Start of layout
    For each sprite
    — call function “rotate90” (sprite.uid)
  • That technique is now redundant in Construct 3. Either make a function and check Copy picked and it automatically re-uses the same picked instance at the time the function was called, or make a custom action.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see, thank you both for the replies!

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