AnD4D's Forum Posts

  • Sorry, not 100% sure what you mean, but please find the attached. I've set it so that the layout rotates 1 degree every tick. If you want, you can change it so that at the start of the layout, it is just set to a certain angle.

    CAPX here

  • Hello, back again.

    I got the system working properly with the targeting, however, I then thought about having the enemy able to target the weapons on the ship to disable them.

    This caused an issue in the sense that the turrets do not actually have their own speed or moving angle, as they are pinned, or simply always set to a certain position of a moving object, which is then moving around on its own. I considered having a variable on the item which reads off of the moving sprites speed/moving angle, and then feeding that into the turrets. However, if the sprite is rotating, the turret speed is increased even more.

    Please click here to see an example...

    You can move the blue targets around using the arrow keys, and you should see that they are always being hit... however, if you move them right off screen, the pink target is very rarely hit.

    Is there a way to improve this using method, as it only uses one variable (at the moment) and only a couple of lines.

    Would be greatly appreciated.

  • Wow, Yann! That's impressive stuff! I was trying to think of ways of making sqiddster's code less accurate so the AI isn't such a brilliant shot all the time. Definately appreciated :) Thank you!

  • sqiddster - tried that with closest family member (sounds odd). The aiming process worked as normal, but it remained targeting the first sprite, no matter which one was closest. Should I be using a distance condition instead?

    https://dl.dropbox.com/u/50465867/Construct/Targetting.capx

    *SCRATCH THAT* me being stupid! Missed the positioning section at the top. Also changed it so that it rotates towards, rather than pops direction. Brilliant formula Sqiddster!

  • NECROPOST!!!

    Great example sqiddster!

    Any idea how to have it select multiple targets from the same family, allowing us to have the unit target the closest enemy, or the enemy with the lowest health?

  • Darkflame Thanks for sending it through!

    The great thing about Construct 2 is that there are so many ways to achieve the same thing.

    https://dl.dropbox.com/u/50465867/Construct/Smash%20Tv.capx

    Give this a go, and let me know if you need help understanding it. Also, please note that event order is important. Make sure your character changes direction and THEN shoots, otherwise it will fire before chaning direction <img src="smileys/smiley1.gif" border="0" align="middle">

  • Post a capx, tag me in the post using followed by AnD4D and I'll help you out <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Is this plugin still being supported? I'm loving it so far. Very easy. Looking for the tank example. I'm trying to have a NPC navigate and look where he's walking. Struggling with that part so far.

  • Hey Tobye,

    I'd definitely be interested. I was literally just about to try to tie in the AStar pathfinder to this, when I thought I'd check on the forum.

    Cool stuff!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Brilliant Tobye!

    That's worked fine. I've updated the capx in the first post in case anyone else wants to see it.

  • Hi guys,

    I'm trying to figure out how to have a character have 4 directions in his animations (Up, Down, Left and Right). I've given him the bullet movement, and wish for the animation to be selected based on the direction he is moving in.

    I am testing this with 3 versions of the same sprite.

    I have tried a For Each command, followed by a 'if bullet angle is between 45 & 135 set animation to 'Down', and it appears to work, but If I add in the other directions, the characters just pretty much settle on looking down all the time. Quite frustrating.

    I came from Multi Media Fusion, where the system would pick the animation angle based on the sprites movement, and am surprised something like that still doesn't exist for C2 (which is sooooo much easier to use in a lot of other ways, I should add).

    In any case, I'd apprecaite any help.

    please see the capx here <img src="smileys/smiley5.gif" border="0" align="middle">

  • Oh, you did it. I was way off!!! <img src="smileys/smiley36.gif" border="0" align="middle" />

    Alright, I'll have a decent read of that, and figure out what I can do to swap, save, and load :)

    Thanks again!

  • I have removed the command "Tile set animation frame to 1" and have tried to re-introduce the code that will set the frame based on the underlying array number, but I'm not having much luck. Either the system appears to be painting the surrounding tiles, painting an ever changing pattern (somehow) or painting the entire board the same colour.

    I like what you've done with the Mouse.x and y positions coordinating with the array, but I'm not sure how I can re-use that data elsewhere.

    I am simply saving over the link in the first post. I feel I'm 1 line away from making this work as expected.

  • Great! I've read up on a few examples, but I can not figure out how to save and load. At the moment I'm just playing with keyboard commands to trigger these, and I'll have the mouse wheel choose the frame number, just to start things off...

    I'll give it a go. Hopefully it'll just click into my mind on what I'm doing :)

    Thanks a lot for your help!

  • Thanks vee41, very impressive. Still trying to get my head around the changes, but from what I'm gathering, there doesn't appear to be a method of saving or loading.

    The line which you removed - "SetAnimationFrame to Shop.At((Tile.IID)%LevelWidth,(Tile.IID)/LevelWidth)" was designed to refresh the tile sprite frame to reflect that of the array, meaning that if the array x.10,y.20 = 1, it would set the corresponding tile to play frame 1. This means that the array can be saved as a string, and then loaded on startup.

    Does this make sense?