lionz's Recent Forum Activity

  • A choose won't work, you need another array with all of the items you can find pushed to it. Then on finding/unlocking an item you choose a random item from that array and push it to your first array. Then you delete the item found in the second array so it cannot be picked again. You should be able to work that out based on the logic that is there already which picks a random item from the first array.

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

  • This tutorial should be enough for saving your game construct.net/tutorials/how-to-make-savegames-11

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

  • I think what you might be missing here is you can see the array in debug mode, so you can view the list of items and when you press 1 see it added to the list of items.

    It's all in the manual about push but basically the array in your game is a list of found items at co-ordinates 1,0 2,0 3,0 4,0 etc. When you push something at the 'back' you are adding to the list, so when you push it becomes 5,0. Run your game in debug layout, you can see the array there as a list. When you press 1 it is pushed to the array, added to the list. There is not much to it, just think of it is a list and you are adding this item to the bottom.

    When you find an item it is pushed to the array/list. This means it is available to pick from with the picking code, as the picking floor(random(1, array.width)) picks an item from the list. Instead of setting it to a certain value as you did with the default items, push just adds it to the back of the queue.

    1. When you start the game, only the ones set exist, the ones you put in your on start of layout set the default items.

    2.You set the default items. Anything you find/unlock later is pushed to the back

    3. Explained above

  • Ok I've cut down my original file a bit. You don't have any logic to grant a new item and i'm assuming F5 is to mimic a new run? So if you load my file and press 1, you will mimic an unlock of purple helmet and itll be available for future run. 2 is gold helmet etc. Essentially all you do is when you unlock an item, you push it to the array. The array is a list of all found items.

    dropbox.com/s/z52yhok12qd4b3c/arraytest.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's interesting that you created a visual representation that looks like an array. Anyway, now that you've broken down the logic I've noticed it doesn't make too much sense or there is a step missing somewhere. You say that items 1-3 are picked from because they are default/found. Items 4-5 are skipped. Items 4-5 should only appear in future runs if they are found, so how are they found?

  • Salman_Shh that looks good and fun to play :)

  • I can see why you had a problem with arrays. You are filling the array on start of layout as I mentioned but you have something in your game that restarts the layout and fills the array again, that's not great but I see it's 'debug'.

    Check out : dropbox.com/s/z52yhok12qd4b3c/arraytest.c3p

    You can see how I've done the following :

    - Got rid of item_number, used a local variable to pick something random from the array and set it to equippedItem

    - Set animation to equippedItem, this takes out a chunk of code

    - Remove the equippedItem from the array so it can't be picked again

    - Added an arrayblock variable so you only fill the array once (the F5 thing mentioned above)

    Hopefully you can view that file and see how it works. All you would need to do now is add more stuff to the array and add more equippedItem = blocks like you have already. It is better if you understand it and know what is going on.

  • I can take a look but I can't find a download link, just lots of adverts and nowhere to download from.

  • you could add to a variable every second until it hits 20 but I feel like this is accomplishing the same thing.

  • I don't think anyone can help you with that other than construct staff so this is probably in the wrong place.

lionz's avatar

lionz

Member since 5 Aug, 2013

Twitter
lionz has 79 followers

Trophy Case

  • 12-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

25/44
How to earn trophies