TMAJA's Recent Forum Activity

  • Are your IDs fixed? IE: a hammer always has the same ID (let's say 0), axe is always 1... If your IDs are fixed, and can be numbers, then they are your Y index. Z is your instance variables.

    Hi BlackHornet,

    I figured it out, I understand exactly what you were saying now - my major problem was I hadn't made the item ID's numbers.

    Thanks for all your help, it's really appreciated!

  • Are your IDs fixed? IE: a hammer always has the same ID (let's say 0), axe is always 1... If your IDs are fixed, and can be numbers, then they are your Y index. Z is your instance variables.

    Yeah I think get what you are saying, but I still cant seem to get the data out of the array :S... This isn't my first time with 3D arrays either, I cant believe I'm so stumped on this.

    BlackHornet thanks for all your help so far, but would you just quickly write out what conditions/events you'd use to populate those variables?

    Seriously, thank you

  • You're thinking of storing the level and item, but that's not really the way to think of it, although there are different ways of doing it. You don't need to search for a level, your level maps to the index in X -> LevelA is X=0, LevelB is X=1... Your items map to Y, ItemA is Y=0, ItemB is Y=1. So the statistics for Level B, Item C are always (1,2,z). The array only contains the stat data. You do need to know the Y index for each item though. You could alternatively store the item ID always at Z=0, so then you could search for it in Y, and your statistics would always be from Z=1, to ...

    Thanks for the reply . I think I understand what you are getting at, but I still cant think how to get the data I'm after out of the array...

    Maybe its because my system is actually slightly more complex than I initially indicated, maybe I'm just being dense. The 'items' (objects on the Y) aren't actually items at all. They are simply IDs which are assigned at run time as an object is created - they how I planned on connecting the data on the Z with the object I just spawned.

    Basically I have items which I spawn in each level. I need to take information from an array and write it into those items instance variables. I'd like to just use one 3D array.

    Is there a better way of doing this?

    Thanks for your help, this is causing my a major headache!

  • Ok so if it is that problem, the issue is the way you have set up the On left button clicked conditions. You don't reference an individual enemy/member of the family so the damage is distributed across all of them. I cant really tell what you are doing with your red squares but you need to find a way of tying an instance of the enemy family to the damage - if you could explain how your conditions work a bit more I'm pretty sure we can figure out a solution.

    Feel free to PM me if you don't want to explain on here!

  • Ok so I think the problem is you are deducting the damage from all the enemies - just to confirm if you fire up the game with the debug layout enabled and you shoot one of the enemies, then check the health values does it deduct it from both/all?

  • Is it possible that when you attack one enemy you are altering the health on both of them?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmmm ok, I'm doing exactly that and my hostiles behave as expected.

    Does your code look like this?

    Enemy family - Health (less than or equal to) 0 | Enemy family - Destroy

    Do you have any extra conditions/actions in there?

  • You can't extract data from each dimension independently. A three dimensional array has to be indexed with an X, Y and Z index each time. Maybe provide a sample of the data in your array to make things clearer.

    Thanks for your reply BlackHornet,

    that makes sense, but how would I then extract data on the Z when my two potential X and Y are dynamic. I'll try and explain more thoroughly:

    my data looks like this -

    Level A - Level B - Level C (x)

    Item A - Item A - Item A

    Item B - Item B - Item B

    Item C - Item C - Item C

    (Y)

    On the Z axis there are stats for each of the items.

    This whole thing is so I can populate the items with the data from the array when I spawn them.

    E.G. I spawn Item A

    I loop through the array and look what Level I am in (the item stats change on different levels). Then I want to loop through and select the correct item in the array on the Y. Then finally I want to write the items instance variables with the correct information from the array on the Z.

    Does that make sense?

  • Hi, are you using a global variable or an instance variable to track your enemy health?

  • maybe try for "i" from 0 to Array.Width instead for each X element

    Hey Fireche,

    Thanks for your reply, I appreciate your suggestion. Could you explain a little more? I think I know what you mean but I'm not sure how to implement it.

    Thanks for your help!

  • Hello everyone,

    I have a 3D array with data inside. I want to move through the array by first looking for the correct value on the X axis, then look on that values Y axis before finally extracting data on the Z axis. To try and put it another way I want to first search my array for one value, then only search the array on the Y axis of that value - so if my first value is at X3, I only want to then search for my next value on the Y associated with X3.

    I'm trying to loop through my arrays with Curvalue using this:

    array - for each X element

    array - cur value | BoxA

    array - for each XY element

    array - cur value | ItemA Sub item A text | set text to array.at(array.curX, array.curY, array.curZ+3)

    But I'm not getting anything out of the array at all. I'm sure I've managed this before, can anyone point me in the right direction?

    Thanks

  • Hey LaDestitue,

    thanks for your reply - could you explain the difference between window size and canvas size then?

TMAJA's avatar

TMAJA

Member since 13 Feb, 2014

None one is following TMAJA yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies