Can someone explain how Array Eventing works?

Not favoritedFavorited Favorited 0 favourites
  • 2 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • I read the different tutorials I could find on this site and a few youtube ones I found. I sort of get how Arrays work, but I feel like I still don't understand how to work with them with Events.

    I get what cells are and how to make a "2d" array, import a Json file and load it to an Array that is big enough. I know as much as how to display text from a specific cell but I have no clue how to use events to cycle through an array or make loops. I've open up some of the examples that use arrays like that one VN one, but I didn't understand how the events they used worked the way they made them work.

    I don't understand what pushing or back or kur mean as far as events go or you would use an Array to make a multiple choice thing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is an example of a 2D array:

    The selected record has the coordinates (1, 5). You can access it directly using Array.At(1,5) expression.

    To loop through this kind of array, you can use the Array For Each event.

    For Each X loops only through the X axis, while For Each XY goes through all elements like this:

    Inside the For Each loop, you can use these expressions to get the current index or value: Array.CurX, Array.CurY, Array.CurValue

    “For Each” loops are rarely useful when working with 2D or 3D arrays — I prefer system loops because they give more control.

    For example, this loop goes through lines 1–7 (I don’t need line 0 because it contains column headers) and displays the message from each line:

    The Push action allows you to insert an empty row or column at the front or back of the array. I don’t think you’ll need this for a visual novel.

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