Zebbi's Recent Forum Activity

  • Depth of your array has to be set as least to 1, otherwise the whole array has no size. You can see that, if you look at your array in debug.

    Thank you! I was thinking the depth started at 0, so it works now! I was thinking it might be better to switch weapons by pushing the array, I think that's what it's called? Where you shift the cells in a cycle, so the game reads from the fixed cell, but the array shifts the cells around. Would that be a better way of doing it? And I should I be doing all this on every tick for performance?

  • Depth of your array has to be set as least to 1, otherwise the whole array has no size. You can see that, if you look at your array in debug.

    Thank you! I was thinking the depth started at 0, so it works now! I was thinking it might be better to switch weapons by pushing the array, I think that's what it's called? Where you shift the cells in a cycle, so the game reads from the fixed cell, but the array shifts the cells around. Would that be a better way of doing it? And I should I be doing all this on every tick for performance?

  • Trying to figure out how to set the default ammo amounts, I have a counter that should return the value to the HUD here:

    And here is the array, I'm playing around with the cells, trying to figure out how to bring in the right value:

    Where am I going wrong?

  • >

    > > purplemonkey Nope. It's impossible to do without a custom or event-based behavior. I had one person who was interested in doing this but it was never finished.

    > >

    > Dang it, thanks for trying though! Ah well, I guess I have to implement some dank code instead..

    >

    Zebbi

    I found a quick solution for disabling collisions on specific objects, etc. and would be willing to share it! Its a stupid trick but gets the job done.

    Would love it please! Not sure if it's okay to put all this in this thread, but it still fits in with the ethos that we need this kind of thing in an alternative platform behavior. Please share!

  • [quote:hnctqkjx]Would it be better practice if I only had things happen when they changed, either by putting it in a function or testing for a keypress? I could be wrong, just seeing if every tick is expensive in processing terms or not?

    I'd say it's irrelevant for something as simple as setting a variable.

    That's what I thought, thanks for clarifying. Can this method be used to recall data from an aray? I was going to have a 2d array that has the ammo amount and the max ammo for each weapon. Would this be the best way of storing and recalling the info for 6 weapons, or would it be better to use 6 different variables for storing?

  • For the first one if the value of CurrentWeap never exceeds 9 you could do this:

    every tick
    --- set animation frame to int(mid("0123345", CurrentWeap, 1))[/code:nqvtjblm]
    
    Or you could do this if you want to handle double digit values:
    [code:nqvtjblm]every tick
    --- set animation frame to int(tokenat("0,1,2,3,3,4,5", CurrentWeap))[/code:nqvtjblm]
    
    For the second bit I'd utilize key codes.
    "1" has a key code of 49
    "2" has one of 50
    ..
    "9" has one of 57
    
    You can make a simple capx to inspect the keycode values of certain keys if you wish or there's probably a reference online somewhere.
    
    So basically you then can do this:
    [code:nqvtjblm]on any key pressed
    system: Keyboard.LastKeyCode is between values (49,57)
    --- set CurrentWeap to Keyboard.LastKeyCode-49[/code:nqvtjblm]
    

    Thanks for that! I'm still working out how to use mid, int, str, zeropad, etc, so this is really helpful to have it examplified for me. Is using every tick a good idea for this kind of thing? Would it be better practice if I only had things happen when they changed, either by putting it in a function or testing for a keypress? I could be wrong, just seeing if every tick is expensive in processing terms or not?

  • Whoops!

  • As you can, this looks pretty bad, it would be so much nicer to have a keypress check that compares the range and sets the appropriate value, as would the global check. What's the correct way of doing this with expressions?

  • Is there anything this request works in?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, this is possible..

    Cool, I''ll figure out how eventually, just needed to know if I/O controls were available without relying on OS popup dialogs. BTW, I'll be using NW.js, all offline.

  • Is it possible to design one's own save/load dialog? I want to have a popup menu that pauses the game when ESC is press and brings up a menu. In there, there would be multiple options, one of which would be save/load, which would have a list of, say, 10 slots and a blinking input line. Standard stuff that most games have, not relying on OS dialogs. Is this possible?

  • Merry Chrimbus!

Zebbi's avatar

Zebbi

Member since 20 Jan, 2014

None one is following Zebbi yet!

Connect with Zebbi

Trophy Case

  • 10-Year Club
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

12/44
How to earn trophies