jmiller4180's Recent Forum Activity

  • I figured it out, but it doesn't seem right.

    I disabled Solid Behavious on the Soldier and it started getting LOS to the Solider Correctly. However the Enemy has solid behaviour and Soldiers are able to line of sight them just fine. Something is wrong or I am missing something extremely obvious.

  • I had this working and then did something which started causing awkward behaviour, so I deleted all of my line of sight code and started over. I am at a very simple form of line of sight and its not working and its blowing my mind.

    Obstacles: Solids

    Range: 400

    Cone of View: 360

    Use Collision Cells: Yes

    Event:

    Enemy has LineOfSight to Soldier -> Set SeesEnemy 1

    Thats it....and its not working at all.

    The enemy spawns on the right side of the window, uses pathfind to find a path to a random Solider. The objective is that when it triggers lineofsight to soldier I will change the speed to make the enemy stop. (it was working before without issue). On Create the enemy finds the path, moves along the path, but when its within line of site range it does nothing, just continues to the Soldier and stops when it arrives, never triggers lineofsight at all. I am absolutely baffled.

    Quick Edit. I have the Soliders using a line of sight behaviour as well, and they trigger line of sight fine, and throw squares at the enemy when they are within range. So line of sight does work with Soliders, but not Enemy even in the most simplest form.

  • Bump for more visibility. Anyone have any ideas?

  • Quick rundown. Enemy guys are coming from the right, good guys that the player controls on the left.

    Enemy guys are picking a random target point on the left side of the map and finding a path to that after the on create event. Good guys for sake of arguement will throw rocks at the enemy as they approach, and when hit by the rock they are stunned which should cause them to pause for 1-2 seconds before proceeding if and only if they do not have a line of sight to the good guy.

    My problem is I can only get one of those solutions working at a time. So its either I can get the enemy to stop for a brief moment after being hit by a rock, and then they proceed until they are hit again, or I can get them to stop when they have line of sight and throw their own rocks. I can never get it to where the enemy is stunned if they dont have line of sight and also the enemy will stop to throw rocks if there is line of sight to the player and after the enemy or line of sight is no longer there to start moving again. It almost seems like invert has line of sight (doesn't have line of sight) to object doesn't work after they had line of sight.

    I can get the enemy to throw rocks when they have line of sight, but then the event that causes the stun overides them being stopped and sends them moving again, or I can get them to stop when line of sight is there, but cannot get them to move again after the line of sight is no longer there.

    Any ideas?

  • Easiest solution.... make a dummy sprite that covers both lanes. Pin the car to one side of the dummysprite. Move dummysprite instead. Car will always stay on right side, in crossings, roundabouts, when turning. Not harder than that.

    U can even have the car u-turn by just rotating the dummy sprite,

    Edit: you can also make sure it can't turn if it's overlapping another sprite, or opposite other cars nearby stop while it's turning.

    That actually sounds like it would be a solid solution. If I get some time I am going to test it and reply back to this thread, but I really see no reason why it wouldnt work. Thank you.

  • Nevermind I found it in beta releases haha. I look forward to seeing if you have other ideas. I am going to check this one out.

  • Thank you much. I am not able to open the project because it says it was saved in release 230 and I am only on 227 however I am not able to download anything newer lol....thats confusing.

  • Well this is unfortunate :/ Some things in Construct 2 are easy, and some things are a pain in the bottom.

    So maybe the MoveTo plugin from Rex would be better suited? Then just have the waypoints. Something like one lane is pink waypoints labeled waypoints1, and the second are green labeled waypoints2. If they spawn in the pink make it pick a random pink waypoint and moveto that waypoint. From left to right on the screen it would be Higher to Lower numbers, so that way if the object is moving left or at that angle it would add +1 to the move to if its moving right it would subtract -1 from the moveto so that it keeps moving until it hits its target waypoint number.

    Hope that makes sense..

    Really there isn't an easier way?

  • Must be a tough one to crack hmm...

  • I am making a top down game and it has simulated traffic in it. I can get the cars to go to random waypoints just fine using pathfinding, but the problem is they are all over the road and will just drive through each other without blinking an eye. I need to figure out a way to have the cars stay in their own lanes depending on the direction they are heading, and also at least somewhat yield to other cars instead of just running them over.

    Anyone have any ideas?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I have a sprite sheets already with images on them. Well together its one image, and its pixel art. I was curious if anyone knew a way to edit that PNG file in an app made with construct 2, and allow them to save the newly edited image? It would have to be edited pixel by pixel though, and only pieces of the sprite sheet at a time, like sections of it as each section has a different association with the i image.

    Imagine a cardboard cutout of a box template. How it looks nothing like a box when its not folded together. That is the kind of sprite it is. So it looks like a flat 3d object, and each of the sections can be colored and changed individually.

  • Here is a thought. Would it just be different "Signals" Being sent. So if Sprite #1 says "Hugs" , Hugs is the signal "HugsSignal" which then goes to a Family event that is waiting for that specific signal, and can do a check like IF Variable Mood > 50, send positive response like "I Love Hugs!", IF Variable Mood < 50, send negative response like "I don't like hugs".?

    Would this be way to much work and there is a much simpler way to do it?

jmiller4180's avatar

jmiller4180

Early Adopter

Member since 31 Jul, 2013

None one is following jmiller4180 yet!

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies