WixeyWinsock's Recent Forum Activity

  • Many thanks, R0J0hound.

  • Hi,

    I have the following set up to arrange collected items in a horizontal row:

    How would I change this so that items are arranged in (for example) rows of 15, with a new row starting underneath, instead of them going off the edge of the screen, like in the screenshot? Thanks in advance.

    Tagged:

  • Thanks lionz, the revised version was very helpful.

    Logic isn't my strongest point and I also have chronic health issues that leave me feeling physically and mentally exhausted so it can take a while to really 'get' things sometimes. I doubt I'll ever find arrays easy, I just want to learn enough to finish my projects.

  • Hi,

    Thanks for the advice. The only reason I used push front was because push back resulted in the items displaying identical animations when created in the inventory.

    I have a very limited understanding of arrays so although I can see how using the items' X array variable will work I don't know how to set it up. Could you (or someone) please upload a small example, as I find visual aids make things easier to understand?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    I've run into a problem with a simple inventory system. When an item is collected it appears in the inventory's item slot, but the first slot is always filled with a sprite displaying the default animation instead of whatever the actual item is. The subsequent items display correctly, but are always one behind the currently collected item. I can't work out if it's an issue with the inventory array action I'm using or with the JSON file.

    https://drive.google.com/file/d/1FWt_LkNIcdUCUbaTrcluHZcf3tLk-C1A/view?usp=sharing

  • Hi DiegoM,

    Thanks for the advice. I'll go with the first option as I doubt I'd be able to get the second option working (maths and logic were never my strong points, though I have an analytical streak).

  • Hi,

    About a year ago I made a simple 'what character are you' style quiz with

    16 possible results. Every now and again I got some feedback and found people always got the same result. I've tested it multiple times and have found you can potentially get other results, but it's almost impossible due to the clunky method I was using.

    The quiz consisted of eight questions, each with two possible answers. Every time a question is answered, the answer is stored in sequence as a global string, for example if the person answered 'A' for the first six questions and 'B' for the last two the string would look like 'AAAAAABB'.

    There's also a global number that increases by one every time a question is answered, moving to the results layout when the eighth question is answered.

    The results were determined by the global string sequence. The problem is only one or two string sequences give one of the 15 results, with the 16th result being the one the player gets if the string doesn't match any of the sequences for the others.

    What could I change so that players stand a better chance of getting more varied results, other than manually adding loads of separate answer sequences? I can upload the C3 file if it makes things easier.

  • Just out of curiosity, would it be possible to make the above setup in Construct 2?

    I don't have much experience with it other than a few small test projects and installing a JSON plugin, but found I couldn't replicate the "floor(random(0,JSON.ArraySize(".items")))" action - I kept getting an "ArraySize is not a expression or instance variable in JSON" message.

  • Hi oosyrag,

    Thanks again for the link, I've finally got everything working.

    I'm in two minds about whether to stick with json as although it's been a good (though tiring) learning experience, I doubt anyone else will be working on this project other than me so arrays would be the better choice as I have a small amount of experience with them compared to json, which I'm completely new to, but have been struggling to work out what events to change in order to get the same setup working with arrays.

    Having said that, I think I've got enough to work with for now so switching to arrays isn't essential.

  • Hi oosyrag,

    This is the setup I'm currently using. The json file contains the id, animation name and description details for each item. Maybe I'm using "Get" wrong, as spawned items always have "0" for ID and the default animation. I tried setting a random ID but this only worked for the first item; the others IDs constantly cycle through 0-9 and the animation was still the default one.

  • Thanks oosyrag. I eventually got it to work using push to front for the sprite animations and set value to (0,1) for the ID. I'd also forgotten to add ",1" after the CurX for the ID.

    One last thing. When I spawn items randomly on the item layout, is there a way to generate the correct ID instance variable for each item? So far all generated items have an ID of 0.

  • Hi oosyrag,

    Many thanks for the link, it's been a big help.

    I've run into a problem with a variation of this setup where I collect items on another layout before combining them. I'm trying to store individual items' ID instance variables and current animations in an "inventory" array,

    but on moving to the combining layout, it either displays the correct animations or IDs, but not both. I expect I'm not using the right "push back" actions on the item collect layout (see below):

    I might not be using the correct "set to" actions on the combining layout either:

    I've tried "push back Item.AnimationName&Item.ID" but this sets all the items' IDs to "NaN".

WixeyWinsock's avatar

WixeyWinsock

Member since 9 Jul, 2019

Twitter
WixeyWinsock has 1 followers

Connect with WixeyWinsock