jmiller4180's Forum Posts

  • 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...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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?

  • I have two little people sprites. Those sprites can walk around, and whatever and once in awhile they will randomly have the urge to chat with another sprite. I am curious about everyones opinion on the best way to go about this would be?

    The way I thought of doing it was using Wait Signals. So when the event starts the first sprite says whatever, then sends a signal for the second sprite to say whatever, back and forth back and forth until it ends. That will work just fine and dandy, but I want it to be more interactive. If sprite #1 says something like "Hugs", and sprite #2 is in a bad mood maybe it responds in a negative way like "I don't want hugs right now." I do have a mood variable that ranges from 1-100, but how in the process of the conversation logic can the sprite check its mood variable, and respond correctly to what the other sprite has said?

    Anyone have any ideas, or maybe a point in the right direction on how i can implement something like that?

  • I got the game to install once just fine. I worked on my game a little, uninstalled the old game, then tried to install the new game version and I get a Parse Error when trying to install it.

    1. I exported from Construct 2 via the Cordova Export Method

    2. I Go into IntelXDK, import HTML 5 Game

    3. Another window pops up to check settings. I chose use Cordova Plugins, and No for game option.

    4. I fill in all of the details like version number, app id, etc, etc.

    5. I downgrade my CLI version because of that build error.

    6. I build it.

    7. download it and try to install on my phone.

    8. Every single time now I get a Parse Error when trying to install it.

    This is extremely frustrating. Anyone have any ideas? Why is this such a complicated confusing process?

  • I figured it out. If anyone else runs into this issue, and doesn't want to use sine, or platform, or any other behavior in a work around fashion this is how I did it.

    Get the plugin rex_moveto - http://c2rexplugins.weebly.com/rex_moveto.html

    For Debug purposes I set it up to update a instance variable on my sprite so I could see the angles.

    Create Instance Variable - MovingAngle (number)

    Add Event - Sprite -> (condition) MoveTo is moving

    Action - Set Sprite MovingAngle to Sprite.MoveTo.MovingAngleStart

    Add Event - Sprite -> (condition) Compare Instance Variable MovingAngle > 90 AND MovingAngle < 270

    Action - Set Mirrored

    Add Event - Sprite -> (condition) Compare Instance Variable MovingAngle > 270 OR MovingAngle < 90

    Action - Not Mirrored