Alon's Recent Forum Activity

  • Hey All,

    For the first time I'm trying to learn how to use Arrays with the Array Editor.

    I'm not sure how it's done, but I think I understand the basics.

    Instead of setting each value x1, x2, x3, etc... I can just LOAD the Json file from the Array Editor.

    I tried with and without .json and as you can see in the image it's not loading.

    .

    Can you please guide me how to make this works? what am I missing?

    Thanks ahead!

    i.imgur.com/Pvscz6v.png [/img]

    I also tried this:

    i.imgur.com/dahZqT3.png [/img]

  • You do not have permission to view this post

  • Thank you for your advice and explanation dop2000

    Sorry for all the questions, but I have more and I didn't want to split it to new threads as it's somehow related to my confusion, some are a bit off-topic but connected to each other.

    I hope that you'll donate your time as your advice is VERY appreciated and valuable to future confused users. THANKS AHEAD! :)

    .

    First of all, the way you described the (non-array) makes much more sense to me.

    But your last note about so many global variables makes me re-think about arrays.

    .

    .

    First question this is a bit Off-Topic came to my mind once again:

    You've mentioned GLOBAL variables for each item, and I may already start with a BIG mistake here.

    For my Player, I didn't use GLOBAL variables, but instance for it's HP or any other future variables that I will add.

    .

    Is this a BAD thing, will this cause me future issues? when the Player moves to the NEXT stage and such will the variables reset because I'm not using Global? (for all the events) or it's fine and I can preserve them somehow.

    .

    I'm wondering about this, BEFORE I'll start add more and more items and "skills" to my PLAYER character.

    I'm thinking about the option for 2-4 Players in the future, that is why I named it Player 1 (as seen on the example GIF). I'm not focus this right now as I want to complete the base conditions for Player 1.

    .

    Without even the "ITEMS" issue, Should I make a dedicated GLOBAL-VARIABLES event so I can organize them and have better access for basic future game stuff such as: menus, options, Player_1, Player_2 etc.. ?

    .

    I made 3 different Items for the Player to have from the "Randomizer" item for now, so I can start make either a simple Array + Probably Array Editor (still not sure about it).

    .

    The Arrays v.s. Variable decision:

    One problem I noticed in the Array / Array Editor which is more visual to me when it comes to organize:

    Unlike Excel / Google Sheets, I cannot just Drag-N-Drop to change order to re-organize my items later on when I will have hundreds of them. True, it make sense because the code is very precise X 1, X 2, X 3 so if I change some strings or values later on... I'll make a mess and it will take so much time to change manually anyway.

    .

    While as you said, too many Global Variables for the items:

    A HUGE list to play with, but each will have it's own group and I can always Re-Organize the order, put in specific groups add comments and so on.

    Of course in both ways I can use the Ctrl+F to find what I need.

    You've made a good point it is my game, but YOUR advice makes much more sense and helps me to run away from future mistakes so I won't need to Re-Code the all thing or just have hard time to play with the database.

    .

    .

    BEFORE I EVEN BEGIN with the Array / Variables for my Items, The last issue I hope you can help me with:

    .

    As you already understand I would like to make different Items, each time my Player will move to the next stage I want him to KEEP the last item he had (that's probably why I should use Global variables?)

    But then came to my mind another PROBLEM I may need to solve early:

    .

    I want to UNLOCK most of the Items I will add to the game, and I want to make sure that whenever the player UNLOCKED (found) a NEW Item it will be available to him in the future, even in a NEW GAME.

    so I'm guessing, I should make a Global Variable Boolean "LOCK / UNLOCK" (correct me if I'm wrong).

    .

    But what if I want to make 3 SAVE SLOTS for the game? now I lost tracking:

    So what happens to the GLOBAL VARIABLES of the unlocked variables that saved on SLOT 1 ?

    .

    .

    Once again, BIG THANKS to any of the questions you can answer or give me advice as long as I'm still on the early stages of the game, this will help a lot to run away from a bad project management.

    * Sorry about my bad English.

  • After few days, I'm still scratching my head about this.

    Since I'm not using an inventory, but random Items, each item will have different affect on the player, different powerup and such.

    Should I still work with Arrays / Array Editor for all my items and somehow find a way to "call" them when the item is picked?

    I found Arrays very confusing, I understand it supposed to be more organized like a spread sheet but when it comes to what each specific item does, it's not always just damage or price, it could be anything else I may add to the mechanics of the game.

    I will have many items in my game, that's for sure.

    I've created a dedicated Event Sheet just for the Items, but I didn't program them yet.

    I'm thinking about each Item and it's condition in a group, for example:

    • Group: Spring Helmet
    • [all conditions forSpring Helmet here]
    • Group: Rock Helmet
    • [all conditions to Spring Helmet here]

    And I will add more Group (items) to this event sheet...

    But that's where I get confused, how do I combine this with the Array / Array Editor?

    How do I "call" these items USING the array system?

    It may sound very complicated to me and very simple or obvious to you, but that's because Arrays are new to me, not in the idea of what it does (I understood that), More in how to use it and WHEN should I use it in Construct, since I understood from the docs it is SLOWER to search compare to variables.

    I hope that you understand my confusion, I'm learning and that is why I'm asking for your advice,

    most of you have much more experience than I do and I appreciate any help.

    So, should I go for a different approach here? any Advice please?

    Thanks ahead,

    No inventory, random items:

    (Should I use Arrays for all the items?)

    i.imgur.com/QIU3chJ.gif [/img]

    i.imgur.com/M5iAnOq.gif [/img]

  • OK, since I'm still learning and everything is new to me, Arrays... Dictionary... and more.

    I'll try to share my progress consider to this Items idea based on my game-engine because I don't use inventory. maybe it is MUCH more simple to accomplish and your advice will be very helpful.

    The concept:

    As shown in the GIF, When the player pickup the question-mark sphere a.k.a. "Randomizer".

    Next is the tricky part (for me)

    • As I keep working on the game I will add MANY MORE ITEMS.

    Just like the original post, I will need to "tag" somehow some items to different rarity:

    Common, Rare, Legendary.

    • Each item will do something else of course.

    In this case (Example GIF) the "Spring Helmet" will make the Player jump Higher.

    What I've done so far is no Arrays, no Variables or anything for the items because I want to make it on the best cleanest way that it will be easier for me to manage, modify, change, replace in the future.

    Questions:

    1 - Should I keep the ITEMS in 1 sprite, each item is different animation with dedicated name?

    or should I separate to 3 sprites: Items_Common, Items_Rare, Items_Legendary for better management?

    2 - Do I even need to use Array? can I use ONLY dictionary?

    I'm asking because the Array doesn't make any sense to me, the concept of X, Y (I don't need the Z depth) but have no idea how to call it and such. (still learning from experimenting).

    From reading about the Arrays and Dictionary, I understood that searching in Arrays is slower compare to the Dictionary or normal Variables, and I will have MANY items (and will keep expanding in the future) so what will be the best?

    3 - How do I make for each Item a different "power" because it will need different group of events.

    Should I add Variables on the "Items_Common" for example? I'm lost where to add variables or not.

    4 - What do I do next?

    Once the player pickup the "Randomizer" I want it to choose from either Common, Rare, or Legendary based on what the Player already unlocked in the game (I didn't got to this part yet, that's another problem).

    I hope you understand my goal and can help me out with good advice as I do step-by-step while learning and experimenting.

    Thanks ahead and sorry about my bad English.

    i.imgur.com/BpmZoh3.gif [/img]

    i.imgur.com/CyQCDOu.gif [/img]

  • OK, since I'm still learning and everything is new to me, Arrays... Dictionary... and more.

    I'll try to share my progress consider to this Items idea based on my game-engine because I don't use inventory. maybe it is MUCH more simple to accomplish and your advice will be very helpful.

    The concept:

    As shown in the GIF, When the player pickup the question-mark sphere a.k.a. "Randomizer".

    Next is the tricky part (for me)

    • As I keep working on the game I will add MANY MORE ITEMS.

    Just like the original post, I will need to "tag" somehow some items to different rarity:

    Common, Rare, Legendary.

    • Each item will do something else of course.

    In this case (Example GIF) the "Spring Helmet" will make the Player jump Higher.

    What I've done so far is no Arrays, no Variables or anything for the items because I want to make it on the best cleanest way that it will be easier for me to manage, modify, change, replace in the future.

    Questions:

    1 - Should I keep the ITEMS in 1 sprite, each item is different animation with dedicated name?

    or should I separate to 3 sprites: Items_Common, Items_Rare, Items_Legendary for better management?

    2 - Do I even need to use Array? can I use ONLY dictionary?

    I'm asking because the Array doesn't make any sense to me, the concept of X, Y (I don't need the Z depth) but have no idea how to call it and such. (still learning from experimenting).

    From reading about the Arrays and Dictionary, I understood that searching in Arrays is slower compare to the Dictionary or normal Variables, and I will have MANY items (and will keep expanding in the future) so what will be the best?

    3 - What do I do next?

    Once the player pickup the "Randomizer" I want it to choose from either Common, Rare, or Legendary based on what the Player already unlocked in the game (I didn't got to this part yet, that's another problem).

    I hope you understand my goal and can help me out with good advice as I do step-by-step while learning and experimenting.

    Thanks ahead and sorry about my bad English.

    https://i.imgur.com/BpmZoh3.gif[/img]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for sharing dop2000

    I'll have a look, I imagine how scary the code will look to me but I appreciate your help a lot! :)

  • > And now... to create zillions of variables for each of my items! :D

    Joking aside - things like this is the reason why so many beginners never finish their games. It may take a few hours to read about the features like dictionaries, arrays, families etc., but they will save you weeks and months of work in the future.

    I've seen too many projects with many hundreds and even thousands of repetitive lines of code, that could have been avoided if the author had spent a little time researching and learning..

    I appreciate your advice and I can't agree more with you.

    I did read about the Dictionary and the Arrays / Array Editor, can't say that I understand all of it because I'm a visual person (that's why I use Construct instead of actual writing code).

    So I want to start really simple because the best way to learn is to actually see how it works as doing small experiments and then my brain my scream: "Ahhhhh so this is how it works! got it!" hopefully.

    By starting small I want to try 3-5 items to picked up randomly from the array.

    The thing is, I have no idea how to connect my sprites-items (each will have their own variables or powers) to the arrays. I'm already confused with it and that's where making variables instead may sound like lots of lines even if I'll organized them in groups for each item.

    For sake of organization I have a dedicated "ITEMS" event sheet so I will code anything related to the Items in the game there.

    I looked for a good Construct 3 Arrays + Array Editor and didn't find any in English, and while just playing around with it, it doesn't make any sense how do I make the arrays "talk" with my sprites or how I choose from the array to apply an Item (spawn it to my player).

    Sorry for the long thread, I'm just scratching my head trying to understand how to use the arrays / array editor before I'll have to go to the other wrong choice: variable for each item which I totally agree it is a really primitive way to do.

    Also, I understood that Dictionary will create "key" as a word that holds a value, like string variables but I can make many, and it's more organized and can be called much faster than Arrays from what I read on the documents because in array it needs to search, and I'm planning to do a lot of items.

    So maybe I don't even need Arrays? but a different way with Dictionary?

    I'm sooo confused...

    Thanks ahead and sorry about my bad English.

    i.imgur.com/ijHy7xc.gif[/img]

  • This might do the job, try it.

    https://imgur.com/a/t9zXMMI

    THANKS!

    First it gave me like 3 items at once, so I tweaked it a bit:

    i.imgur.com/oXNfSRN.png [/img]

  • Hey All,

    I have many boxes in each level, each box have it's own hp (5 for now, I may change it as I work on the game).

    So after hitting a crate 5 times, it gets destroyed.

    I want that only ONE crate will drop an item, and it should be one of the crates chosen randomly.

    What is the easiest way to do this?

    Thanks ahead! :)

    Sorry, I'm not sure how to make the image works on the new forum yet, it's not that important anyway:

    i.imgur.com/fcTzKgs.gif[/img]

    i.imgur.com/JU09dAM.png[/img]

  • True, I should focus on the game itself as you're suggesting, thanks for the advice.

    And now... to create zillions of variables for each of my items! :D

  • You can use Array Editor to create a list, yes, but you still need to load it into the array before using it. (request the file with AJAX, then load into the array from JSON)

    I would give you a tutorial, but with recent changes to the website, it's impossible to find anything...

    Thanks that could be helpful!

    I tried to understand how to setup an Array with the Editor but with all the extra files or project needed to load I got confused, I don't think it will be sad to have a FILE accessible for others to hack.

    Isn't there a safer way to use array?

    Maybe I should do it via lots of variables like in my first example for ease of use, not sure yet.

    or maybe via Dictionary, I'm not sure if it acts like any normal variables but from reading (consider my bad English) I understood they are faster than Arrays, and giving names for each item may help me.

    As you can see my confusion is huge...

    BTW - I also noticed some issues with the new forum, it won't send me notifications via email.

    I tried to "unfolow" and then "follow" once again, but... I still don't get notifications so I need to check out manually from time to time.

    Sorry about my bad English and thanks again! :)

Alon's avatar

Alon

Member since 20 Feb, 2014

None one is following Alon yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies