Sushin's Forum Posts

  • Sushin,

    I think I've fixed it! Please bear in mind that I'm not sure of what effect you were trying to achieve, but it definitely does some good enemy AI type stuff now... The fix I found involved combining the enemy conditions into two groups, one For Each Enemies / IsAlert and one For Each Enemies / IsAlert(not).

    I've come across similar logic inconsistencies as this in the past in C2 and they are always infuriating to figure or work-around (most have been my own doing, I must confess!). I thought what you had should have worked but I suspect C2 didn't like the multiple checks of each state (although my version uses 2 check loops of each Enemies group).

    Here's my edited Capx so you can see what I've done. I haven't commented it but the group amalgamation should be kind of obvious. Hope this helps!

    https://dl.dropboxusercontent.com/u/184657779/the%20machine%20edited%20by%20ed.capx

    Well...it seems to work for a little bit, besides the fact that they won't rotate when they are patrolling, but if you alert a few of them and then go hide, they all simultaneously stop moving completely, patrolling or not.

    I'm perplexed that it even works, considering the part where you have the "is not alert" loop as a subevent to the "is alert" loop...

  • I made a separate camera object that follows the player.

    If you did that, it would just be a matter of changing what the camera follows. You can just set the camera to a position in the center of the room.

  • Sushin - blast it! I managed to reproduce your error, if that's any consolation... I'll have a tinker with the other conditions but a quick copy-paste of the IsAlert condition into each of the triggers hasn't fixed the problem (it seems like only one enemy moves....).

    Okay. Thanks for your time. I've been having a lot of problems with loops lately.

  • Colludium

    Thanks for the tip, but I have tried that multiple times. It says that triggers cannot be a sub-event of loops. Here's the error message:

    <img src="http://i.imgur.com/NbU3nIP.jpg" border="0" />

  • bump

  • Hi friends. I'm trying to use families to create a series of events to work for multiple enemy instances, and it...KIND of works, but there are a lot of problems with it.

    The patroling behavior right now seems to only be working for 1-2 enemies at a time. If you spawn only 1 enemy you can see that it works perfectly, but I can't get it to work on a bigger scale. I think i'm doing something terribly wrong with loops and families.

    The CAPX:

    dropbox.com/s/zqligiv6j532fwy/TheMachine0.6.capx

  • keepee

    tulamide

    Well, It actually is starting to seem like the looping for that particular event is not causing me the huge problems. At least I think so. It actually seems to be the way I was indicating the X and Y values. Here's a picture of what I'm doing there:

    <img src="http://puu.sh/4iueu.png" border="0" />

    And of my game layout

    <img src="http://puu.sh/4iupi.png" border="0" />

    I added the for loop right where I'm assigning X and Y values and that fixed the original problem I'm having...but now only area 0 will recreate properly. Area 1 and 2 seem to have broken X and Y positions on the walls and my feeling is that it's part of the first "on start of layout" block.

    I did your suggestion tulamide but the result didn't change from the picture above.

  • uh..sorry, i see now you are only using the family as a way to differentiate from the created wall object

    In which case, your events in the original post actually look correct, so are you sure it's not a problem with the way you position it after creation? You could check if the wall have been created or not by using a text object to display wall.count

    if they're not being created, it could still be a problem with the AreaSelector, or ZoneSelector... you can check these with a debug text object too.

    If all that stuff is fine, try reshuffling the conditions so the 'For each' is before the variable check, it shouldn't make a difference, but I remember having to do this in some cases

    like:

    +On start of layout

    +Zones | ZoneNumber = ZoneSelector

    +For each Walls                     

    +Walls | AreaType = AreaSelector      >Create object wall etc

    It cant be a way I position it after creation, because like I said, if the only area that exists is area 0, it works perfectly. The Walls family has a value called Area Number that I change for which group of wall objects I want to spawn.

    Area and Zone selector are set to 0 for now for testing purposes.

    I did the count thing and it says the right amount of walls have been added. It looks like there are only 2 or 3 walls. I suspect they are stacked on top of each other so the X and Y values aren't really getting changed properly or something.

    So far I have reshuffled the 3 conditions into every different order that makes sense. All together, and with the loop being the sub event, and with the wall and area selector being a subevent. It doesn't seem to make a difference...

  • keepee

    Yes, Wall is part of the Walls family.

    Basically what I am trying to do is create rooms of walls that are off screen, and then clone those walls and re-position them in different areas in the game.

    I don't really understand the problem with what I did as you explained. Do I put the for loop in the same spot as the UID check? I'm pretty sure I tried that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • when you filter/pick instances of a family, it doesn't automatically filter the individual objects that may or may not be in that family.

    (To avoid confusion I'll refer to 'Walls' as 'Family' and 'Wall' as 'object')

    So you may be correctly picking what Family instance.. but it's still ambiguous as to what Object instance you want..

    hope that makes sense..

    a way to pick the same object as the family you've alread picked is, for example

    For each Family

       Object | Pick instance with UID: Family.UID

    Yeah it kind of makes sense, but it didn't work at all unfortunately. Here's what I did.

    <img src="http://puu.sh/4hIGZ.png" border="0" />

    Just to make sure, I ran that same thing with all the walls deleted except for areatype 0 and it works as it should. Only when there are multiple area types is the problem happening.

  • I'm having an issue where I only want to call objects with a certain value in a for loop, however, I'm having huge issues.

    <img src="https://dl.dropboxusercontent.com/u/72855875/Untitled.jpg" border="0" />

    So I only want to call walls with a areatype of areaselector (in this case, the number is 0)

    It works great, except when there is more than one group of walls with a different area type. As soon as I add a second set of walls to clone, the walls get all messed up in size and position.

    Is there an easy way to fix this or even an alternative? I briefly considered making a new family of walls for each room but that seems extremely tedious.

  • you could use r0j0's canvas plugin, and paste the splatters.

    or more simpler: AFAIR construct2 can have lots of objects (I've tested like 500 objects at once) and there's no noticeable slowdown. You could implement a limit, as in "if I have more than 100 objects start to delete the older ones to give room to the new ones"

    Hope that helps

    That may be because you have a higher end computer. Weaker computers (especially phones) can experience terrible slow downs. In one instance someone testing one of my games has physics based bullets travelling slower than you could walk even though the physics were framerate independant.

  • If I have a game where I want to put a lot of decals around that I want to keep, like blood spatters or bullet holes, I know that using the sprite object wouldn't be the best idea because sprites support animation and have a ton of editable properties. A lot of sprites would simply lag the game, even if they aren't doing anything, so my question is, is there any other object type I can use for this purpose? Programs like flash have multiple subclasses for images depending on what you use them for, like a non-animating "graphic" vs a animated "movie clip" but construct only has really advanced and specific object types it seems.

    I was wondering if using the tiled background as an image would be better than a sprite, or even a 9-patch, or somehow rig the sprite font to be a decal, or is that even worse?

  • Could you put it on it's own layer, and rotate that?No. They simply cannot rotate what-so-ever.

  • Sushin did you find any workarounds? thxNope. The only solution is to not use 9 patch.