emperorben's Forum Posts

  • 8 posts
  • Thanks for the suggestions; unfortunately I'm still looking for a solution.

    About 4., you can spawn ghosts on the top layer (above walls, players).

    Is there a particular way to do this? I've always been under the impression that objects that interact with solids will interact with them on all layers. I tried what you suggested and confirmed that they did stop moving when hitting the walls.

    And ry2009, I guess I forgot to mention in my original post that the enemies often or always chase the player, so they need to go in a specific direction and they will also often be interacting with each other. If I have them bounce or change direction it gets pretty jittery quite quickly since they tend to bunch up.

  • Hi all,

    There's a few threads about this but I haven't yet found one that works for me. Here's what I need:

    1. Enemies cannot overlap each other or the player.

    2. Enemies cannot push each other or the player.

    3. If two enemies collide, they can still move if the direction they are facing is clear. Otherwise, the enemy should wait.

    4. One family of enemies needs to be able to walk through solid walls, like a ghost. The player and other enemies cannot walk through that wall.

    My biggest problem is getting a single enemy to stop when two enemies collide. I tried to do this by giving the enemies 8Direction and Solid, but they were pushing each other, and were also clipping through walls at times. Maybe there's a way around this?

    What I've settled on for now is using bullet behavior, and giving them a collision in front, where if the collision overlaps another enemy, the collision's container stops. You can see that in the example. I tried to just say "When enemy collides with enemyFamily, stop enemy", but then I can't figure out how I'd get the enemy to move again.

    Does anybody have suggestions on a better way to do this?

    A secondary question - if you play the capx file, you'll see the enemy jittering. I've found that if I disable the "Set desiredSpeed..." in event 5, then it stops. I have no idea why that actually helps, though. It'll possibly be a moot point if I can get the enemy movement resolved, but it's still strange.

    Here's the stripped-down file as an example: dl.dropboxusercontent.com/u/59414921/testEnemyOverlapping.capx

    Thanks in advance!

  • Now it's giving me another error:

    An unknown error occurred while accessing an unnamed file.

    I'm not sure what's happening here :(

  • I went to take a look at your file but I got an 'Out of memory' error when I tried to load it...

    Off the top of my head, couldn't you do #1 by creating the shadow object and then using an Always event that sets the shadow object to the .X and .Y of the player? I wouldn't think being in the air would effect this, but it depends on how you are doing things.

    Sorry I couldn't be more help... I'll try to figure this issue out and if I can I'll get back to you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Off the top of my head (and sorry if I'm maybe misunderstanding the question...), I would personally use Private Variables.

    I would give every object a Private Variable like 'myLayer', and set up a few events that change this value when you move to a new layer. Then, whenever I was doing a check for collision or what-not, I'd simply add a condition to check for the Private Variable. You can even check to see if 'Player1.'myLayer'' is equal to 'Enemy1.'myLayer''... so if the player collides with the enemy AND their layers are the same, then the action can be performed.

  • Hi, I am trying to use families a little bit, and I am a little confused with the information I have found. Basically, I just want to know how family private variables work, and what differentiates families from attributes.

    I've read that all family members have to have the same private variables... but is that only if I'm trying to change a variable on family? For example, I have family 'Dog' with variable 'Legs'. The two members of this family are 'Lab' and 'Bulldog'. Each of them has the 'Legs' variable because they are both members of the family... but I want to add a unique variable to both 'Lab' and 'Bulldog'; let's say 'Lab' has a variable 'Snout' and 'Bulldog' has a variable 'Tail'.

    Now, will the family have problems with this? Obviously I cannot try to change variable 'Tail' in an event for the family because not every member of the family has that variable, but that's fine with me.

    Next, from what I understand, Attributes differ from families only in that we cannot perform a large number of events on Attributes, correct? And I guess that families all have to be the same type of object (Sprite, Tile, etc), while Attributes don't?

    Finally, along with my first question to an extent... can an object have multiple families? It would be pointless if each family had to have the same private variables, because then they would all pretty much be the same... right? Could I have family 'Animal', and then in that family I have family 'Dogs' and family 'Birds'... and then within each of those families can I have multiple objects? Such as types of dogs and types of birds? Basically, can I build this structure so I can select EVERY animal, or just every bird, or just a specific bird, or a specific dog, etc? Will families work like this?

    Thanks for any input!

  • Hi all,

    I am trying to implement box pushing into my platformer, but I can't quite seem to get it to work all that well. My main concern is how to make the box fall realistically. I started using physics, and while looking at another topic on these forums, I found some a useful .cap file to use as reference:

    However, this cap file still does not explain everything I need to know. Basically, the box, when pushed off an edge, does not behave realistically; gravity is far too weak, so the box drifts down, instead of falling down.

    So my problem is how to fix this. I tried tweaking physics attributes, to no avail. Adding mass makes it too heavy to push, increasing gravity makes the box bounce and act kinda funny. I tried giving the box a platformer behavior; with this, I was able to edit the gravity of the box as it fell, but for one reason or another it won't stop bouncing, as if gravity is pulling it down and the world is pushing it back up. Of course, I CAN make it stop bouncing if I turn gravity off on the Physics behavior, but then the box slides forever on the ground. Furthermore, even while changing these values, the box still does not fall straight down, but instead falls at an angle (even with the horizontal air value turned down to 0).

    Basically, how do I create a box that the player can push, a box that will fall 'realistically'? The only way I can think of at the moment is to use a number of custom events that change values based on where the box is in location to the world and the box's current state, but that seems like a pain...

    Thanks!

  • Hello all, I've been using Construct and lingering around these forums for a handful of months now, and finally I decided it was time for me to join the ranks! I wish it could be under better circumstances than 'oh crap I need help guys!', but it is what it is.

    So, I'll preface this by saying I'm sorry if an answer to my problem has been posted already... I have tried to search the forums and look around and I can't see anything that quite fits my problem.

    I've been using version .98.9 for a while... things were going just fine, mostly just getting the hang of the thing and making a number of smaller projects. Last week I decided it was time to update to a newer version; I figured maybe it would add some new features that I had been wishing were in there, and maybe it would fix some bugs. So I downloaded and installed .99.42... and this is where my problems began.

    For starters, with this new version, my animations don't seem to work. I don't have anything complicated, mostly just Left and Right angles, but the character doesn't turn. This not only happens with my creations, but also with poor Charlie from Platform School. Even worse, many (or all?) events don't work. My character cannot do anything event-based anymore such as double-jump or crouch. Mind you, through all this I made sure not to save the files in this version of Construct. Just while typing this I realized that perhaps my animation problem is the same as my event problem (seeing as events probably control my animations)... though that doesn't help me fix it

    So, I used System Restore to go back to the day before, when I still had .98.9. When I went to open files, I would get crashes on some of them, and others I would get an error (I can't remember exactly what the error was, but it might have been telling me it couldn't find some sheet... maybe event sheets).

    Finally, when I undid the restore and things were back to where they were the first time I had .99.42 (animations and events broken). Which is where I'm at now. I have not experimented much to see if I create a new game whether it will work or not, but I'd like to be able to use my old events and play my old games. Does anyone have any suggestions? Did I perhaps do something wrong in the install? Also, how do I install multiple versions of Construct at once? Do I just rename the file when it asks me where to save it?

    Sorry for the long explanation... and thanks for any help!

  • 8 posts