Masai's Recent Forum Activity

  • Your solution definitely works. I tried numerous ways to get it to work (ultimately resulting in bitter defeat), but this should work just fine for what I need. Thank you!

  • Hey guys! So I'm trying to get an action to run IF multiple instances of the same object are in specified positions. This works perfectly fine with an object with a single instance, but doesn't seem to work if multiple instances are introduced. For example, let's say I want to create an object IF any instances of (X)(Doesn't matter which instance, just that there are multiple) object are in either position of (X=200, Y=200) and (X=100, Y=100).

    This means that for the action to run, I have to have instances of (X) object at both positions, not simply one or the other. However, it doesn't matter which instance is in which position, just that an instance occupies those positions.

    If I do something simple like this, it works perfectly fine, albeit only for one instance of one object

    However, if I do something like this, it doesn't work. It doesn't appear that multiple instances are being read through. Its conditions are met only if that one object instance is in two places at the same time, which is impossible.

    Is there a way to say "If any instance of x object is at x position AND at x position, then..."?

    As always, thanks for the help and consideration

  • You sir, need to understand how amazing and helpful you are. Thanks again.

  • From the looks of this it appears that the actual index values in the array are being changed to the X and Y values of the desired objects to be stored. Is that the case or am I looking at this wrong?

    What I want is for the normal index values in the array (0 to Array.Width-1) to be kept so that I can call on them later, but I want their values to contain the positions of the objects.

    For example, let's say I have an object at (400, 500) in the layout. I store this object's position in an index of my array. So now if I said "Set position of (X) object" to Array.Width-3 (Let's say that index in the array contains the (400,500) location), X object would go to (400,500) instead of me directly telling X object to go to (400, 500)

    The idea is that no concrete position is being stored in the array because that position will change based on where the object is moved.

  • Bump. Still working on a solution for this.

  • With what I have set up the first option isn't viable. Not only that, but the first option would have me call in objects at specific locations, correct? I don't want objects to be spawned at specific pixels in the layout that are solely relative to the layout. I have objects spawning relative to other objects however, which works perfectly for what I want.

    I don't think the second option or third are very viable either. Again, I'm trying to store the locations of instances of objects that are already in the layout as the array's index values.

  • Good evening! I'm trying to store the positions of instances of a single object sequentially in an array's index values. Here is the desired effect that I want to be applied to the array.

    As you can see, each value of the array from start to finish follows in a logical order. I want to be able to call on those values through something like an expression later on, to the effect of something like "Set position of (x) object at (Array.Width-5)"

  • just a thought...

    capx> http://s000.tinyupload.com/index.php?fi ... 5803457407

    (r200)

    I love you. <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey guys! I'll try to explain this as best I can. I'm trying to spawn (x) amount of objects in a certain space, but I need specific objects to spawn, and the rest of the space to be filled with multiple instances of another object.

    I already have the space defined with an array, but now I need to manipulate how objects spawn within that array. Let's say I have a space like this :

    As you can see I have a 3x3 space of the same object, but let's say I want to inject two different objects into the 3x3 space, spawning in random available spaces in that 3x3 space and filling the remaining slots with our blue circle control group every time the layout is run, like this :

    or this :

    The problem isn't spawning the unique objects in random positions in the 3x3 space and filling the rest of the 3x3 space with one object with multiple instances. The problem is that when the unique objects spawn in the 3x3 space, there's a chance that they will overlap one another. Let's say I want to spawn 2 unique objects among the controlled object with multiple instances in the 3x3 space. I need a way to ensure that they won't spawn on the same tile If one unique objects spawns on one space, I need to make sure that the other object knows that space is no longer available to spawn on.

  • capx> http://s000.tinyupload.com/index.php?fi ... 7651153194

    (Latest Stable-r200)

    This is pretty much perfect! Thanks a lot.

  • just a thought..

    capx> http://s000.tinyupload.com/index.php?fi ... 3415084296

    Can't open the file. My version is a bit older since I'm running on Steam's version of Construct 2. Can you screenshot the necessary stuff?

  • How are you setting up your grid?

    Just by placement, nothing special. I'm not using any kind of tilemap or what have you. I have variables set up to store the locations of whatever is tapped, so there doesn't need to be any special framework for a grid. I'm still working on it and I got it functioning a bit more properly. Now tiles in the -x of the open space will go to the open space, but nothing else will. Still playing with it.

Masai's avatar

Masai

Member since 15 Aug, 2013

None one is following Masai yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies