rootzm's Recent Forum Activity

  • I'm working on enemy AI and have run into the following issue. In the examples below, I have three enemy AI units moving through three different waypoints in a never ending cycle. I have them set up to stay in formation a relative distance from each other.

    This works just great until I add another condition. I have it set up where if the player moves into any of the enemy unit's detection range, the enemy stops their patrol to chase and shoot at the player until the players leaves their detection range. However, two weird bugs popped up that I need help with cause I'm out of ideas at this point.

    Patrol AI - 3 enemies fire

    1) In the above file, the bug that comes up is that I can move the player unit with the arrow keys within range of the enemy and then run out of their range. All three enemies chase and shoot as long as I'm in their range. If I leave their range, they try to go back to their patrol. Situations come up though where I can lead one enemy away while the other two continue on the patrol. Eventually, this messes things up and freezes the enemies. I would like every enemy in the patrol to chase regardless of if they were not the enemy unit that detected my player..

    Patrol AI - attempted Pick All fix

    2) This is my attempt to fix problem number one. I thought if I used a Pick All statement to make all enemies "active in the loop" again, that I could then run another sub FOR statement to tell all enemies in the array to attack together at once to prevent the problem above. It's important that the array is told to attack because I plan on having other enemies in different arrays of the same object type and I don't want them all attacking - just those enemies in the array where the player was detected. Anyway, this method didn't work as you can see. It changes it so that only one enemy unit attacks and it still messes up the relative formation.

    Sorry for the length of this post but any assistance would be greatly appreciated as I'm banging my head on the wall on this one so far.

    thanks,

    rootzm

  • Hi all. I discovered Construct2 a couple weeks back and have been learning a lot. I decided (stupidly?) to try to create a Real Time Strategy game first. My first alpha version is linked below. I hope some people find it interesting.

    A Desert Challenge

    I should also note that there are a large amount of bugs that I still need to get rid of and the AI is very very basic at this point - the enemy has a couple patrol routes. I just decided to post my progress so far.

    I also recommend that you read the instructions within the game as there are helpful controls which will make killing the AI easy. One thing that's not documented is that if you have any units deselected, they will attack nearby enemies automatically - so be aware of that.

    Thank you to the creators of this wonderful tool. I've attempted Flash game programming before and have made way way way more progress with Construct2 and HTML5.

    rootzm

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Arrays are killing me. How do I get the UIDs of 4 instances of one object into 4 slots in an array?

    I created an object, dragged 4 instances of it to the Layout. Then I created an array on the layout and get it dimensions of 4,1,1.

    On the event sheet I tried:

    Array>For Each element on the event

    Array>Set Value at Arrayname.At(loopindex) to objectname.UID on the action

    It doesn't seem to work and I can't figure out where it's messed up. Can anyone help explain this concept? Once the UIDs are in the array, I think I know how to use the array with For Each statemes.

    Thank you in advance for any help

  • Thank you very much Nixtrix. You not only solved my problem but added some nice features like the opacity to know a unit is selected and multiple selections at once.

    I don't see a way to give you reps so here's this instead:

    <img src="smileys/smiley32.gif" border="0" align="middle" />

  • Hi.

    I'm playing with some RTS concepts. I am able to individually select different units and move them about the screen one at a time. However, the following example is giving me fits:

    I click a unit and click on the far right side of the screen. While that first unit is moving, I click a second unit and move it as well to another location. It begins to move as well. However, the first unit will no longer stop unit the second unit stops. I tried to record the clicked target locations first and then use a For Loop to check for each unit to fix the problem but that makes it so units move in the direction of a click but then stops immediately. Can anyone help with this? I have both movement problem available in the capx file. Toggle/Untoggle the lines to see both movement problems.

    Here is the link to my capx file

    RTS testing

    Thank you in advance for any help

rootzm's avatar

rootzm

Member since 15 Jun, 2012

None one is following rootzm yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies