BudBloom's Forum Posts

  • You don't need to know how to use all the features of an array to use them. All arrays do is store multiple values in them, and all you need to be able to do is set the size, set values, and get values.

    Arrays indexes are 0 based, which means to access the first element of an array the expression would be Array.At(0), and the second would be Array.At(1), and so on...

    If you ever try to set a value in a cell that doesn't exist it will do nothing, and if you try to get a value from a cell that doesn't exist you'll get 0.

    And as noted above a way you can do what you're asking in your OP will look like this:

    So just literally changing a number variable to access different cells.

    The push action just increases the size of the array by 1 and places a value in the new cell. Array.CurValue, CurX, etc... are used when you use the "for each element" condition. You really don't really need to use those things. You could use normal event loops with loopindex as well. Overall arrays tend to be more closely related to traditional programming and is more abstract sometimes to understand them.

    Figuered it out. If you do it that way it adds one to "X", so to make it go down, you do it as Array.At(0,index)

  • You don't need to know how to use all the features of an array to use them. All arrays do is store multiple values in them, and all you need to be able to do is set the size, set values, and get values.

    Arrays indexes are 0 based, which means to access the first element of an array the expression would be Array.At(0), and the second would be Array.At(1), and so on...

    If you ever try to set a value in a cell that doesn't exist it will do nothing, and if you try to get a value from a cell that doesn't exist you'll get 0.

    And as noted above a way you can do what you're asking in your OP will look like this:

    So just literally changing a number variable to access different cells.

    The push action just increases the size of the array by 1 and places a value in the new cell. Array.CurValue, CurX, etc... are used when you use the "for each element" condition. You really don't really need to use those things. You could use normal event loops with loopindex as well. Overall arrays tend to be more closely related to traditional programming and is more abstract sometimes to understand them.

    It's still not working. Like always I can get it to display the first cell but afterwards it still only displays "0"

  • 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.

  • > I just don't know how to execute it in the engine.

    Exactly as described in the comment above.

    There are also two official examples, search for "visual novel" in the example browser. One uses an array, another - flowcharts.

    I tried to look at the examples before and couldn't understand how they did anything in either one. The tutorial for arrays and such doesn't really explain it very well, like what does push or back or cur actually mean or how they work or how they work together in events. From the start I wanted to know how do I set an event loop so that everytime I press click it can cycle through the array. So far I don't have the answer.

  • I mean, I understand the idea of how to do it. I just don't know how to execute it in the engine.

  • I am not sure if this makes sense, but I was trying to make a visual novel like text display. I am trying to make it so every time I left click it moves what cell is being displayed as text down in order.

  • Thanks, that worked

  • I looked at the tutorial on the site and a few videos, so I thought it would be easy enough. It seemed like it was. But I feel like I have no idea what I am doing.

    I created an array under files. Inserted the Array, Json and AJAX objects. Then, put an on layout load action from AJAX to Request Project File from the array file I created at first. And I am supposed to I think use the parse action from the JSON object somehow? Maybe?

    EDIT: I copied and pasted data from a spreadsheet on the array file I made first. And I made sure to set the Array object dimensions so it would have the same cells, 3 width and 32 rows, 1 depth.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't think that will really help me with what I'm trying to do. I want to keep the text the same size as it displays in the dialogue box. I'm not sure what the action in the script sheet will do if I'm typing text in an array or converting a text document to a Json file to grab the lines from.

  • Trying to make a visual novel type dialogue. In the instructions it says that if text is bigger than the text box it wouldn't display.

    More over, how can I can tell if text in a cell should be broken up? Or is there a way for the engine to break up text in a cell?

  • Ok, I tried putting it in families and using frame tags instead of giving them instance variables and it works perfectly. I was able to get past the part I was stuck at, making the cards destroy themselves and then create an upgraded version. With this method only one of the two cards is destroyed since I'm comparing family to sprite, which then made it super simple to just add an event to change the frame on the one that doesn't get destroyed. So it all ended up being way easier. Thanks so much to all of you that responded to this and helped me.

  • I'm trying to follow along but I'm still not sure how putting the cards in a family helps if I did it that way unless you mean making each card face it's own object under a "card family" rather than one sprite object where every card is a separate frame.

    I don't understand how to make it so it only works with specific variables. When I make an event I pick the compare variables to select the card face. But then when I do something like "destroy" or change animation frame it does it for all of them. Like, when I make a new event I can compare variables so I can pick which card I want the event to effect. But then when I pick the event action I don't see a way to compare those variables to limit it to only that card face.

    So it looks something like event is compare variables, then sub condition when collision/overlap. Then event action. And it's the event action that is giving me problems because I don't know how to make it so when it destroys the card object it only destroys it if it shares the same variable.

  • I still can't get it to work. I thought I could change the direction platform behavior objects fell and that would make lining up/setting the cards easier, but I couldn't find how.

    Using instance variables didn't really make it work. I tried using frame tags too. I am not sure how R0J0hound recommended. The problem right now is that I can't figuere out how to make it so that cards that have the same variable/frametag/are-in-same-animation-and-frame to interact the way I need them to without interacting with every version of that object.

  • You should set up some instance variables on those cards so you have more control over what's happening particularly the level of the card. I don't know your upgrade mechanic and how outcomes are created but if for example you want to combine 2 cards you could only allow if a lvl 1 is selected to click on another lvl 1 card, then combine into a lvl 2 so destroy both then create a new lvl 2 card and pick the frame at random 3 or 4.

    I did not think about assigning the cards instance variables. I was trying to do it by comparing the animation and frame lol. In hindsight that would make controlling their behaviors cleaner.

    The main problem still is that you don't sepect on cards to merge and upgrade rather my intent is to have a phase of play happen where it checks for cards of the same level and type that are touching to them merge and upgrade them. The combat system I'm trying to replicate uses action points as a resource. Moving a card to a new position costs an action point and so does playing a card. Everytime you play a card or merge two cards from a character's abilities that character gains energy. When energy is full you gain a special card that is their ultimate ability. High level cards also sometimes have additional effects such as preventing the target from using their attacks, specials, or ultimate cards depending. Or inflicting a status effect or granting buffs.

    The reason I like this combat system so much is because you have so many choices each turn to tackle enemies as combat plays out in the form of a very simple puzzle.

    Anyways, I'll try to give them variables and see if I can get them behaving the way I want them to later after work.

  • For context, I'm trying to do a sort of card battler with limited varieties of card abilities that merge with each other to make upgraded versions of that same card. Sort of the system in Reverse: 1999 if you want to look up sort of what I am trying to do.

    I got as far as having the cards spawn and move left and stop when they hit each other and stop spawning when I have a full hand until it's the player's turn again.

    I kind of can't wrap my head around how I would do that. Also, I have all the card faces as individual sprites. Each animation is a character's abilities and has 7 frames. When a card spawn it picks an animation of a character selected at random and then picks a frame between 1-2 at random (1 is the face for the attack ability and 2 for skill at lvl 1.) Frame 3 is attack at lvl 2, Frame 4 is skill at lvl 2, Frame 5 is attack at lvl 3, and frame 6 is skill at lvl 3. Frame 0 is the ultimate ability that only spawns at the start of player turn when they have enough "energy."