codah's Recent Forum Activity

  • well done

  • lol master. so is it 1, 2 or 6 only? or 1-6?

    edit: anyway see if you like it

    [attachment=0:3je2jhwq][/attachment:3je2jhwq]

    edit 2: I removed unncessary stuff from previous example

  • you said 'two'. Please come out with all the info at first

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • good work

  • this seems to work

  • codah

    Thank you for your help!

    https://vine.co/v/OjiLqtmuOea

    that's awesome!

  • codah LOL I started with spectrum zx 81, then Vic 20,Commodore 64,tried BBC, then went back to Amiga 500, 1200, and so on. I use to use CLI on amiga

    hehe ZX81 is already advanced

  • post an image of the error?

  • Colludium and Lordshiva1948 if you try his suggestion

    [quote:1z4702m9]Try selecting several objects in editor, hit "Enter" and then resize them, you'll understand what am I talking about.

    you will understand right away

  • If i start my 'selected weapon' values from 0 instead of 1 to match the way arrays work, than I assume an event mechanism like this :

    [quote:2c3u09sg]weapons: Value at(selectedWeapon - 1, 2) = 1

    would become this: ?

    [quote:2c3u09sg]weapons: Value at(selectedWeapon, 2) = 1

    Thanks again

    exactly

    Basically if you arrange your values and code to suit arrays from the start, you can possibly avoid writing LOTS of code. Like an order of magnitude.

  • Not sure if this answers directly, but I have a few suggestions (hope you don't mind)

    With your events 63-65, I suggest you use a mechanism like

    [quote:1pqqmjem]weapons: Value at(selectedWeapon - 1, 2) = 1

    and its action to

    [quote:1pqqmjem]gun: Set gun_type to GunNames.At(selectedWeapon)

    (GunNames is an array of the gun names) then you won't need separate code for every weapon.

    Also in that block, the second check for Value.at(4, 2) is redundant (as in, rearrange the logic)

    With the weapon number cycling, set selectedWeapon to something like [quote:1pqqmjem](selectedWeapon + 1) % 5

    General:

    Use constant values for array indexes, e.g. COLLECTED = 2, AMMO = 1, NAME = 0 then your code will be less error prone and easier to read, e.g.:

    [quote:1pqqmjem]weapons: Value at( selectedWeapon, COLLECTED) = 0

    or

    weapons: Value at( selectedWeapon, AMMO) = 0

    Finally, you might want to start your 'selected weapon' values from 0 instead of 1 to match the way arrays work. You'll find yourself doing -1 and +1 a lot, and it can be tedious and error prone.

    Anyway, to check for a value in a row, use either a System: For loop or an Array: for-each loop.

    Obviously, choose to use any or none of these, but if you're new to arrays then get into good practices from the start

  • Go through events and picking one event/condition at a time. Think about exactly which objects are picked at each stage, and why. Simplify things to the point that they are trivial, and working, then add back one thing, then another. Use debugging. I use Browser Log function a lot to show debugging info in Chrome. They are my tips to you. But as you hopefully saw, I did what was asked and changed ObjectsDisp to just Objects. It wasn't working before that either. Keep posting individual questions, I and others are more than happy to help, but 'my inventory doesn't work' is too general. Good luck

codah's avatar

codah

Member since 30 May, 2014

Twitter
codah has 1 followers

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies