Arrays: Returning different Y's

0 favourites
  • 3 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • I've been struggling with this for a couple of days now, and while I continue to work through it I thought I'd see if anyone can provide some guidance.

    Synopsis: I have an array, that holds 4 pieces of information.

    a) Room. b) Door #. c) Destination Room. d) Destination Door.

    There are 61 entries in the array including row 0 with titles.

    The final result is that I want to go to the layout of destination room, and position the player at the destination door. Likely via a call with the parameter of room/door.

    The room and door # are known by a global variable for room, and an instance variable for the door. (RoomNumber and ExitDoor.DoorNumber)

    The screenshots attached are the contents of the array, the event sheet and the output (showing that I was able to extract some of the data, but have failed to be able select a certain Room/Door record. I feel I'm close but not close enough.

    ** NOTE: The last two lines do NOT work, it doesn't find the matching entry.

    This is the contents of the array.

    The event sheet and the output.

    Thoughts, input or solutions?

    Thanks.

    Graham.

  • You are mixing the System and Array looping mechanisms. You have to use one or the other. Since most of the code uses loopindex("Y"), switch the CurY code to use loopindex also. Use System"Compare two values": DoorArray.At(loopindex("Y")) not-equal 0, etc...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you blackhornet,

    Jiggled it about a bit, and now it looks like this and works as intended. Appreciate the time and solution.

    Graham.

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