Alon's Recent Forum Activity

  • Thanks for the quick reply it sounds like a great solution!

    So if I got the idea:

    1 array for the normal Items who are already found by default, and 2nd Array for the NOT-Found-Yet Items.

    Then push from the 2nd Array list to the 1st one and delete it from the 2nd one.

    It make sense in my visual brain, I can see it "moves" from one to another but I'm not sure if I can accomplish it in C3 yet, Sure I must try it for the learning experience.

    If I'll get stuck, I'll ask for help.

  • On my journey of trying to get used to Array which I always ran away from... thanks to I could finally add a basic working Array to my game.

    Based on the GIF, as you can see the idea is whenever the PLAYER touch that cube-sprite on the left, it will add (push to the Array list) a NEW ITEM to the game which is what I want for my game: something to TRIGGER a NEW ITEM FOUND!

    and add it for the game (even if you quit it, I will learn and use how to SAVE later).

    I used the CHOOSE and put 2 "NEW" items like this: (Items that are not found yet by the player)

    Debug: EVERYTHING Works great, as soon as the player collide with that sprite it's destroyed and one of the two NEW Items will be added to the Array "Arr_Items" list.

    But THE PROBLEM is: next time when I want to add different ITEMS, it may still choose one of the ITEMS that already added.

    MY GOAL: Once a NEW ITEM is added to the Array list, I want NO MORE of this item to add in the future

    The GIF shows an example of what will happen if the PLAYER will FIND A NEW ITEM during a full game.

    I'm aware that the problem is CHOOSE because the names are there to choose from and I can't remove them once chosen... or maybe I can? (it will solve the issue)

    So is there a way to make sure, once an Item added to the list it won't be added again?

    so I won't get huge list with the same Items.

    Have a look:

    Please understand, not only I'm new to Construct 3 but also ARRAYS are new to me and I'm trying my best to learn and understand how it works in C3 while practicing. so far I'm VERY impressed from the powers of Arrays!

  • I had to try implement this Array to my actual game and do some tests, so far everything works great!

    But now I have this issue, maybe it's simple to solve using some Array action?

    I created a simple sprite so I can test NEW sprite added to the list.

    Once the Player is colliding with this sprite it's adding a NEW Item. (push to the array list)

    I used the CHOOSE and put 2 items like this:

    Debug: EVERYTHING Works great, as soon as the player collide with that sprite it's destroyed and one of the two NEW Items will added to the Array "Arr_Items" list.

    But The problem is... next time when I want to add different ITEMS, it may still choose one of the ITEMS that already added.

    So is there a way to make sure, once an Item added to the list it won't be added again?

    so I won't get huge list with the same Items.

    Have a look:

  • I'm not sure if it's possible but I would like to know:

    1 - Can I PAUSE specific Layer Names for few seconds? so EVERYTHING on that layer will be affected.

    if yes please explain how.

    2 - Can I PAUSE ALL Layout but choose which objects to ignore the Pause? (instead of pausing every single object in the code)

    Thanks ahead!

  • Ah okay, because it's a text variable it needs to be if equippedItem = ""

    On event sheet for stage 1 you set it to "" so that needs to be the check, or you can change it to NO_ITEM, doesn't really matter.

    Your original code was: equippedItem = "" and it didn't work.

    I tried to change it: equippedItem = "NO_ITEM" (I double checked so it's like the Array with caps)

    None of them are solving the issue, when I restart (F5) the player still have the latest states.

    EDIT:

    I Managed to fix it, I had another equippedItem = 0 (which doesn't make sense since it's string) so it was ignored.

    I'm keeping on practicing and playing around with this most basic Array, thanks to you I appreciate your help and great explanations.

  • Thanks I will read it.

    I've noticed an issue with the latest example, and I don't know how to fix it because... Arrays are still new to me.

    When you start a new RUN (F5 should simulate the same idea) after you already picked an item with SPEED or HIGHER JUMP the latest states will stay even if you restart the game with no item.

    What is the solution to reset it to actual no item (default settings) like I put on one of the groups called: "NO ITEMS - DEFAULT"

    I've tried:

    System > On start of layout > System | Set euippeditem to 0

    it didn't solve the problem, no change at all.

    1. Should I put it on the Array as one of the options?

    2. or there is a different Array action I can add within start of layout?

    3. Will this get RID of all the new items added to the array? (not supposed to if I will SAVE)

  • Key presses are triggers that trigger once without the need for adding a trigger once. The key press I added is in place of what would be your logic for unlocking the item.

    So if in my game it will be triggered by collision, overlapping or anything else (I don't know yet) so it won't add more than once by accident? I must be careful since I will add many items to found.

    What is the the best way (I know there are few) to SAVE and LOAD my game so it won't save the player's position or let him start with the last item.

    I may do only 1 slot or more for saving and RESET the game (all found items will be gone)

    All I want to save is the FOUND items, or should I say the most updated Array list?

    Can you please give me some advice on this subject?

  • Thanks for the detailed explanation I think this file is helping me to get the basics of how to work with the Array, I just added the actual "Helmet_Gold" added the animation, the item followed what you did there with it's name on "equippeditem" variable, etc..

    Great advice, I just used the Debug to see how it adds (push) to the end of the list no matter if it was Purple or Gold Helmet the first added.

    I just realize it will be impossible to check my arrays once I'll have many items which is my original plan for the actual game.

    The problem I ran into was, even when I added a sub-event with "Trigger Once" I can keep adding more and more Helmets to the list, and I know in my actual game I will use some creative triggers so I better know how to make it add only once.

    Any idea why "Trigger Once" not affecting this?

  • YES!!! This is the direction

    Since I don't just want to copy past this to my actual game, I would love to try understand how it works.

    But the problem is that... it's not visual at all, so maybe you can try to explain or draw it roughly?

    You can use arrows on my demonstration or something it will sure help me SEE it:

    In your version, I don't see which item is found and which isn't I'm guessing that you only set the 3 first items on the start layout while the others, are triggered using the '1' and '2' keys but I can trigger them in any way that I like of course.

    1 - The Purple and Golden Helmets which are "Not Found" by default, are not exist on the Array at all, right? or I missed that part. if so... where did you set them before you pushed them back? (confusion mode)

    2 - So if I will make 100 Items now, will I populate ONLY the "found" items and will PUSH BACK those who are not discovered yet? I wonder if that's the principle of what you did in the code.

    3 - I don't understand how the PUSH works exactly (documents are too general and not visual for my stupid brain) Can you explain? are they PUSHING "Purple_Helmet" from specific X,Y ? if so... from what place to what place.

    All I can guess is that pushing back should move -1 on the X, and if I'm correct... where is the "Purple_Helmet" on the first place? maybe I missed it in the code.

    Thanks ahead for your MIGHTY patience with me, I admire you and very thankful!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hehe thanks to you I still didn't give up on Arrays (yet) ;)

    To your question:

    Since the visual demonstration above won't show all the "rules" of the game, let me try to explain:

    The game will start with 5 items in total.

    As you can see 4 + 5 marked from the beginning of the game as FALSE, means: they won't be found

    The other 1,2,3 marked as TRUE, means: they can be found as soon as you play.

    Once the player collect and item the RANDOM should ONLY look for those that are found = TRUE.

    Now, imagine the Player end a RUN or find a "SUPER SPECIAL MAGICAL BOX" this will trigger one of the FALSE (not found yet) items, and will SET it to TRUE for the rest of the game (saving data) not just for the specific run.

    So you will get a message: "NEW ITEM HAS FOUND!" you just discovered a new one. it should be added to the items the RANDOM can pick now (which I have no idea how to do it of course).

    This is how it should work in theory, but in code? I have no idea.

    Any thoughts? None-Array solution? Array solution that I can... maybe follow? ;)

  • OK, as promised... I actually made this visual demonstration in construct (not sure why) it is nothing but text and animated arrows. thanks to my stuuupid visual brain!

    As you can see: I would say that I understand 2D Arrays, it is not the part where I'm lost in again and again but inside Construct's code which is not visual (yes, I did try the Array Editor, no.. it's very confusing to setup so I'm not using it).

    It's probably funny to any of you who thinks: "It's right in front of you visually, translate this to code!" yeah... tried that but again, me and Arrays in Construct 3 I'm not there yet.

    If you'll look at the EXAMPLE FILE I originally attached above this post (please ignore any ARRAYS I put there, can delete it. it does nothing), you can see the "normal" random pickup works very nice (just like in my game) but the part with the FOUND = False / Truth that's where I'm stuck... not sure how to make it work.

    So my question is:

    Is there a way to do this without arrays?

    Any of you for the challenge to help me out? Ashley dop2000

    I tried few things but I failed again and again, still I'm very curious what are the alternatives solutions without using Arrays.

    Thanks ahead for any suggestions, ideas, or even trying to accomplish this task on my example file and post it will be interesting to see how you solved this issue.

  • Thanks for playing with the example file , I just had a look.

    First of all maybe you didn't read the all post where I put the example file because I did mention to ignore my Array stuff, I have no actual idea what I did there I just tried to place them as a start after reading the documents and got even more confused... so it's not the reason I'm confused, the reason I'm confused about Arrays is how I "work" with them on the event sheets, I don't understand it.

    Again, I do understand the principle of 2D array that are Height and Width so I can visual something like shelves with items (X, Y). but that's not the issue as I mentioned above.

    BTW - I DO SEE how powerful ARRAYS now, especially as they deleted on the Debug mode (not that I need this feature but yeah it's wonderful). :)

    I don't understand why you made the player always get stuck with one item only once you pick up the other items, Yes I read what you said which is exactly that but maybe I didn't explain well what I'm trying to do:

    1 - All Items that are "marked" with "Item_Found" = Truth (Boolean I put on my example file SHOULD be able to pickup at any time.

    2 - Once you Trigger (kill a boss, or any other trigger on the game) it will add NEW unlocked items to the RANDOM RANGE (List of all items) by simply CHANGE Items from "Item_Found" = False to Truth.

    So the Items are already exist in the code but cannot be found until they found.

    I'm still not sure if I can explain it better but I tried, this is why my original example is very much close to what I'm looking for, but the UNLOCK part is what I'm trying to add (without Arrays, which are a total unorganized mess in the code for me in person).

    After looking at your version:

    To be honest, I don't understand anything from the re-code it looks like gibberish to me, that is why I suppose I shouldn't use Arrays, I'm scratching my head now trying to understand what's goin on and it looks so messy to me compare to how I did it before (ignoring the Arrays I put there for fun of course hehe).

    Sorry if it sounds like I'm complaining, Actually it's the opposite I'm very thankful that you took the time to re-do this on a file I made from scratch so basically it should be easier for me to understand but unfortunately, my brain cannot understand Arrays no matter what I do I'm blocked (or should I say just stupid) when it comes to such complicated mess of a code (I'm talking about the way Arrays design in Construct is hard for me to follow, edit, tweak, and most of all.. understand and create my own Arrays) so I should probably just give up on the all unlock idea and make my game much more simple... just random items.

    The truth is that I did HOPE that someone will find a way based on my "None-Array" code to solve my issue since Construct can do the same thing in so many ways but I understand that I'm the problem, since Arrays are the only answer and it's unfortunate for me.

    So I'll ask again because I'm really about to give up this wonderful feature I really wanted in my game:

    After anyone can have a look on my EXAMPLE FILE (please ignore any ARRAYS I put there, can delete it. it does nothing)

    My Question is:

    Can you SOLVE the issue I described here and originally on the first post WITHOUT using ARRAYS?

    Is there a super magical secret way to do it?

    If so PLEASE download the example file and show me, I'm extremely curious about it!

    Thanks ahead!

    EDIT:

    Since I didn't gave up on Arrays yet since I'm a very curious person, I will try to make a more simple visual example file, upload to share here and SOLVE the issue thanks to the community help. :)

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