jmiller4180's Forum Posts

  • So I am doing a count of objects that have a variable of 1. This is working as it displays in a text.

    How do I pick 0,1,2,3,4,5,6,7,8 etc instances of the picked objects?

    If PickedCount = 8, I want to pick the 1 through 8th instance each seperately and have them each do something different based on what nth instance it is.

    1 nth instance will do this

    2 nth instance will do this

    3 nth instance will do this

    etc, etc

    Any ideas would be great help. Thanks

  • I want to create a fog of war that isnt just black, or a fog that you cannot see the map but instead is a grey darked out fog, but you can still see the ground. Then when the player goes over it it reveals the map and anything new going on under the map that wasn't seen.

    So the fog sort of takes a screenshot of the map while the player is there, then when it fogs back over again it will show what the player just saw but anything new happening under the fog isnt shown until the player reveals it again. This is a fog used commonly in RTS games.

    Anyone have any ideas on how this can be done in Construct 2?

  • Thanks for the reply, but I am not even close to 10k.

  • New Update. So the preview server worked in Microsoft Edge, but not in Chrome or NW.js. When exported to NW.js and opened the .exe it worked fine. Not sure what is going on but its fairly annoying.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Quick Note. I was able to export the game and it runs fine. Just preview isnt working. Thanks

  • Everything was working fine, and then I did some minor changes to a button press, and what characters do after they are created and now the game won't load a preview. It sticks at 93% forever. Any ideas? I tried that page that went through what the problems could be but nothing seems to be working. Preview browser is nwjs, but changing it to Chrome or any other one doesn't make a difference, it only loads to 93% on all of them.

    I tried changing pre-load sounds to no. That didn't help.

  • Success so far. Thank you for the tip. This actually works quite well and will be quite a bit less code than the other way I was thinking about doing it which now that I think about it was sort of just creating the turret manually when all was said and done.

  • I'll give it a shot and post the resukts.

  • Spawning multiple soliders of the same object type (Soldier1)

    When Soldier1 has line of sight it sets HasLineOfSight to True

    When a Soldier1 Intances turns LineOfSight to True it should spawn a bullet and set angle towards the Enemy

    Here is what I have

    Pick Solider1 where HasLineOfSight (true)

    (sub) - Enemy - Pick nearest to (Soldier1.X, Soldier1.Y)

    System - Every 2 Seconds

    System - For Each Soldier 1

    Action: System - Create Object bullet on layer 1 at (Solider1.X, Soldier1.Y)

    Bullet - Set Angle toward (Enemy.X, Enemy.Y)

    Bullet - set bullet(behaviour) enabled

    What Happens

    Now what happens with the above is that each Soldier1 that HasLineOfSight (true) will spawn a bullet, but instead of setting angle towards the closest Enemy, they all set the Bullet angle towards only one of the Enemies, and I am not sure which instance the bullet is choosing.

    I need each solider to spawn a bullet and set its angle toward the enemy that is closest to him.

    Sometimes what will happen is that only one of the instances will spawn a bullet, but that only happens when I mess around with it.

    Please Help Me Fix This

    Please help me figure out how to get each solider to spawn their own bullet and set the bullets angle toward the enemy that is closest to him.

  • I think I figured out how to make it work although I am not positive if this is how its supposed to work

    I got it working by adding the add obstacle to the on-create event for the Enemy family.

    Enemy, On Created ----> Add Pathfinding Obstacle rock1

  • Just started over and recreated it in Stable release and can verify its doing the same thing. Double checked to make sure obstacles were set to custom, rock1 does not have a solid behaviour, and collisions are enabled on the rock1.

  • I have been fighting with Pathfinding and it has been totally keeping me from progressing in this game, its extremely furstrating.

    Here is the code.

    It was working just fine, no problems. Then I add something totally unrelated to pathfinding and now when I test the game the Enemy just walks right through the rock1, when before they would walk around it as expected. The only thing I added after the pathfinding was working is the code at the bottom that is disabled which should not have any affect on pathfinding I don't think.

    The last version of the game did the same thing and the only way I could get it working again was to delete all of the obstacle objects, delete pathfinding, re-add objects, and re-add pathfinding. I don't want to get 90% through the game and run into this problem again where pathfinding just decides to stop working and I have to start over again. Any ideas? Could it be that I am using a beta branch of Construct 2 (Release 231) ?

  • I just changed the way the game is viewed instead of direct top down its more isometric looking now. This allows for z order to be used so objects/characters don't appear to be overlapping as bad.

  • 99Instances2Go thank you very much, it is helpful beyond words. I am curious on how you would solve the overlapping problem now? So they make it to destination but all pile up and look like one object, this is not something that will be good at all in the type of game I am working on. I tried doing is overlapping at offset and such to move the object down 10 pixels or up 10 pixels if it sees an overlap but it seems to not work right. Push out from Solid (rex behaviour plugin) just doesn't look to natural it looks like they are literally pushing the object which is no good.

    There will potentially be 1-20 enemy on the map at a time, and they all need to have a line of site so when they throw rocks its not unrealistically going through the body of the enemy in front of them like its a magic rock.

  • Figured it out again even though I still think it shouldn't behave this way. Solider LOS obstacles was set to Custom, while Enemy was set to Solid.

    So Enemy cannot see Soldier when LOS Obstacle on Enemy is set to Solid, and Soldier has Solid Behaviour Enabled.

    Is it because Enemy is seeing Soldier as an Obstacle instead of a Target, even though I have it specifically looking for that Soldier Object?