Alon's Forum Posts

  • 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! :)

  • Thanks dop2000 Great example! it looks very organized to work with, I hope it's not hard to do since I never used Arrays before.

    So basically I can always use the Arrays Editor to edit and change my items, order, names and properties as I build the game or add more and more items without ruin what I already added to the Arrays list?

    Of course I'll try to play with it for few items first.

    I'm still confused about what is the use of Dictionary or when to use it, so I guess I'll try to focus Arrays first.

  • Hey All,

    As I keep building my very first game and still learning Construct 3, I ran into something I'm wondering how should I handle it.

    Eventually during time, I will add more and more Items to my game.

    For now, the items are not something you pick from a menu, just pick them and use or maybe switch to another during game. I may change it in the future but for now I want to keep it simple for the style of my game.

    Items may be separated to sections, for example:

    • 1-30 = "Common"
    • 31-50 = "Rare"
    • 51-60 = "Legendary"

    And I will probably add more to each of the sections.

    The Question:

    Should I just split them as above to groups of variables?

    or

    Should I use Arrays / Array Editor for such thing?

    Note:

    I never used Arrays, I don't know if it's hard to create, handle or manage in general.

    I did read about it and understand there is some kind of an organized Array Editor but still, I have no experience in this.

    The reason I'm asking this question is because I will probably keep update the game with MORE and MORE items on each version so what will be easier and smarter to use for such goal?

    If anyone can supply a good tutorial or capx example, it will be easier for me to follow visually since I'm not a programmer and still learning.

    Thanks ahead!

  • Hello All,

    As I'm working on my very first game, I would like to make 3 save / load slots that will save all the progress of the player include the items even after exiting the game.

    I must mention I didn't try to mess with saving options, I believe there are few options to do it but I have no clue so before I start experimenting I would like to know:

    • Is it SAFE from user-hacking ?
    • (manipulate save file to change variables)

    I did read the how-to-make-savegames tutorial and it helped a lot but I didn't have the chance to try it myself yet so I'm curious from your own experience with this, so you can give me advice or tips what to use or not to use for such purpose.

    I may have more questions related to this subject so thanks ahead!

    * Sorry about my bad English.

  • Thank you very much dop2000,

    The second code was exactly what I needed for multiple crates.

  • Hey All,

    I have some crates on my level, and first I what I did was:

    After few hits (from the player) a crate will break.

    Once the break animation is finished, Destroy the Crate.

    It was easy and it works great!

    So I wanted to make it better using a nice fade-out and then destroy.

    But I had some issues, the first issue the Animation of the "BREAK" looped all the time (it's playing 1 on the animation editor, not on loop).

    I guess the reason for this is because the HP of the Crate, it's stuck on 0 so it keeps playing.

    When I played with "only once" it worked but then a different problem comes in.

    It will only destroy 2 or 3 crates, then the rest of the crates will never be able to break.

    Again... I'm sure it's something about the HP which is not for each crate but for all of them.

    My 2 failed attempts:

    BTW - Destroy is Enable on the properties for automatic destory when fade is finished.

    How can I make this work properly?

    Thanks ahead!

  • Thanks again ! I will have a look on your example as soon as I get a chance!

    It sounds interesting, I will have to see maybe I should or shouldn't change my animation priority system.