Badmiracle's Recent Forum Activity

  • I would also like to know how to limit the Turret Arc to say 90 degrees. I have done some searching and I believe that this Thread had the solution but the CAPX example was removed:

    Thanks.

  • I did yes, but the objects are stacking on top of each other instead of overlapping in the way that I want.

    A sword is flat, so I want it to be treated as such, and have other swords overlayed on top of it if they are dropped on top of it, instead of having the sword stack on top of other swords (I hope this makes sense).

  • Hey guys,

    I have been working on a feature for my Platform-style game - the ability for the games character to drop items. Since Platform games seem rather prevalent in the C2 Community, a solution may be beneficial to everyone.

    What I am trying to accomplish using the Physics behavior is to have the dropped items fall realistically onto other dropped items that are already on the ground.

    For example, if I drop a Sword on top of an Axe that is laying flat on the platform, then the dropped Sword should not stack on top of the resting Axe, but instead overlap it - while realistically disturbing the resting Axes position subtly as well as the Swords position on contact.

    By "realistically" I just mean something that looks natural.. for instance a random adjustment to the objects angle on contact as well as possibly a subtle force put on the object in a certain direction.

    I have been toying around with the different Physics features for sometime now and I just can't seem to get something that looks good. I had done something that sorta worked but became less and less realistic as more objects were being dropped.

    Note: Gravity is disabled in my game, and instead I apply a downward force on all objects being dropped. This is because my game isn't really a traditional Platformer (it looks like a Platform game but the character is able to move up and down as well). Additionally, I intend to make the Sword object part of a Family.

    Help is always appreciated. Thanks everyone for reading.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am working on a way to get my Spriter characters Eyes to rotate based on the Mouse location.

    The way I've done it is I've created 2 action points in Spriter over the eyes and spawned non-spriter "Eye" objects in both of the action points. Then I've pinned the 2 Eye objects onto the character in the location of the action points.

    The issue: it seems like the position of the Eyes lags a bit behind the characters movements.. (the position doesn't stay locked as the player moves) in addition to that the Z-Order seems to be an issue, as I can only place the Eyes above the entire character, or below the entire character (the Eyes need to be in-between - behind the helmet but above the face)... so I was wondering if there was a better way?

    Also I am not sure if this is an issue with Spriter or not but adjusting the Z-Order of any non-spriter objects in-between my Spriter objects "sub-"objects doesn't seem to work.

    Any help is always appreciated. Thanks.

  • RamPackWobble What X & Y would I then move the NPC to, to be within 500 pixels of the Bullets creation point?

  • The object I am trying to figure out the previous location of is a Bullet that uses the Bullet behavior.

    An NPC needs to be able to move a set distance (say 500 pixels) toward the point (X,Y) where the bullet was created/fired from (this NPC uses Pathfinding).

    I am trying to do this without taking into account the current location of the bullet (my check for the Bullet position doesn't happen every tick due to the sheer amount of bullets on the game screen at any time). So my question is - is this even possible? We know the location of the NPC and the Angle of Motion + Distance Traveled for the bullet.. how do we determine the X and Y that the NPC should move toward?

    Thanks.

  • Another thing you can do(I will hopefuly make a tutorial for this), which is something I'm trying to do right now, is to only use the pathfinding behaviour for finding a path from point A and point B, and, instead of moving your object using the pathfinding, you can try and use 8 Direction as it has built in collision checks, and will collide with solids properly.

    tarik00555, another member named zatyka has already done something like this but with the bullet behavior (so maybe this will help): pathfinding-experiences_t81496

    Direct Link: https://dl.dropboxusercontent.com/u/475 ... ement.capx

  • Here you go.

    Create a global variable "Random Timer"

    Create 3 separate Events

    Condition: On Layout start

    Action: Set variable Random Timer to "round(random(a,b))" where A is your min number and B is your max number. This will select a number between the two.

    Condition: Every 1 Second

    Action: Subtract 1 from Random Timer

    Condition: Variable Random Timer <= 0

    Action: Do what you want here..

    Edit: Added Round Expression. Thank you for pointing that out RamPackWobble

  • Bump

  • Hey guys,

    The NPCs in my game will attempt to Pathfind around a solid object, but if the Solid object rotates too quickly it sometimes collides with the NPCs. How would I make the NPCs react to this collision by being pushed back - and then shortly after have them resume their pathfinding.

    Thanks.

  • Make sure your Pathfinding Cell border is High (maybe even equal to average Line of Sight?) This way Herbivores will stay readily away from Carnivores naturally as quickly as 1 second once they come into Line of Sight. Carnivores will not mark Herbivores or other Carnivores as Obstacles - therefore they can Path Find right to them.

    Add Sprite Y as an Obstacle for Sprite X (Generally - Animals should always have other animals they wish to avoid as Obstacles in their Pathfinding)

    Be sure to Regenerate the regions of the Pathfinding Grid as objects move (otherwise the Solid objects on the map won't update) - you'll probably want to do this in the most efficient way possible - try taking into account your Sprites Line of Sight and generating a Rectangle that size around your object. Use "Regenerate Region" and do..

    Start X: SpriteX.X - (SpriteX.LineOfSight.Range / 2)

    Start Y: SpriteX.Y - (SpriteX.LineOfSight.Range / 2)

    End X: SpriteX.X - (SpriteX.LineOfSight.Range / 2)

    End Y: SpriteX.Y - (SpriteX.LineOfSight.Range / 2)

    Finally, Every 1 Second & Has Sight of THREAT > Find Path away from Threat

    You may want to make the Pathfinding Cell Size/Border smaller for smoother movement on different animals.. but this will likely require more memory usage as a new Pathfinding grid would have to be generated for each unique size.

  • You can use "Object is overlapping" to detect for collision. Also make sure that your sprites have a proper collision polygon set.

Badmiracle's avatar

Badmiracle

Member since 31 Aug, 2015

None one is following Badmiracle yet!

Trophy Case

  • 9-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies