How do I Pick Instance with UID

0 favourites
  • 3 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.
  • not sure why this is not working,

    with is blank and no checks it changes them all. when the check for the text "U" is only changes all the stars that are "U". If I select

    Pick nearest/furthest and set the exact coordinates of the star right bellow each text it works, but sometimes it will change other stars next to it, so not working perfect. do you have another idea to pick the right label with the right uid so only that object gets its text changed?

    so run the game, select the star with a U, scan it, and wait. the closer the star to the ship the faster the scan. just FYI for debuging

    here is the capx:

    https://app.box.com/bridge-command

    Its in the Main Event sheet. the code will take each text.uid and store it in an array next to the star.uid when created.

    "S"&starData.At(starData.IndexOf(Star.UID), 10) position

    the star UID is stored in a global var called starselected for each star you select. the text on the right of the screen if for debugging.

    Snumber = Charted Stars

    U = Uncharted ( percent will scale down to 1% change to spawn, set to 90% for debugging)

    Controls are:

    G = hide grid

    S = save state

    L = Load state

    mouse Scroll in or out to Zoom

    Left click to select

    if you enter coordinates in the textbox on top double click it when finished to move the ship in the angle of the direction you entered.

  • Two issues,

    First you have:

    Pick Instance with UID starData.At(starData.IndexOf(StarSelected))

    when it should be: starData.At(starData.IndexOf(StarSelected), 10)

    Second, when you create your data in your Functions Event sheet. You have a condition for when stars have not been picked. The Data is then pushed on the array and edited. You had this AFTER your naming < 10 and else condition...it needs to be before it.

    Example:

    Currently you have

    if naming < 0

    ---do blah

    else

    ---do other blah

    If star has been not selected

    ---do some blah

    But it should be:

    If star has been not selected

    ---do some blah

    if naming < 0

    ---do blah

    else

    ---do other blah

    After those 2 changes, it works.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OMG you are the best! I didn't even think of the order of creation, so simple too! I feel better now haha!

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