Pythagoras's Forum Posts

  • Oh yeah, I did that by mistake, and couldn't find a way to undo it, but if that fixes the problem then great. Where do I download the unstable version of construct? I can't find in the developer, or the downloads section.

    Well, anyway I separated the 2 animations like you said, but the animation still gets cut short.

  • http://host-a.net/ivan_mage/animation_problem.cap

    Hopefully that helps.

    By the way, how do I upload files on this forum?

  • Thanks, that fixed my problem. However, now it's only playing the first 2 frames of the animation, instead of all 4 like it should. It seems to me like the animation gets reset every time the character moves to a new grid space, because it plays all the way through when I set the movement speed lower. Is there some way around this?

  • So I have 4 walking animations, one for each direction, and I want my character to animate when it moves using the grid movement behavior. So, my events for this look like this:

    http://i150.photobucket.com/albums/s117 ... roblem.png

    The animation plays fine when the player moves for the most part, my problem is, when the player stops moving, then moves again in the same direction, the animation won't play. It also won't play when the player moves initially at the start of the game, but if he stops then moves in a different direction it plays fine again.

    Anybody know what I'm doing wrong?

  • Awesome, thanks!

    I'll be bookmarking that page for sure.

  • Basically, I'm looking for a way to take 2 points (In this case, coordinates in an object's private variables, and the mouse's position) and return the direction from one point to another. I can't seem to find a way to do this in construct.

    Any ideas?

  • Ah, I just figured out why It wasn't working.

    2 things, the variable was set to number rather than text, and I was checking the collisions for the purely visual animated part of the player, rather than the square mask I'm using for collisions.

  • Hmm, I changed it to text, but it still only returns 0. I wonder what else I'm doing wrong.

  • Here's the cap file.

    http://www.mediafire.com/?kykye2zjizm

    And yes, sorry. It's setting the text, not the value.

    Also, your .cap file says it was made in a later version of Construct, even though I'm using the most up to date version from the website. Is there a beta out or something?

  • I have a Text object with the default text set to Lobby

    Then, I have a tiled background object, with the RoomName varable set to Storage Room

    And then, on the "On overlapping object" event for the player with the tiled background, I have it setting the value of the Text object to the RoomName of the tiled background.

    If that doesn't help, I'll post the .cap

  • Basically, what I'm trying to do is set it up so the name of the room the player is in is displayed on the HUD. I have several tiled background objects that act as floors, and they all have a private variable named RoomName.

    I want to make it so that when the player overlaps the floor, the variable RoomName for that object is displayed on the HUD, but for some reason no matter what I do, it always displays 0, even when I set the default text for it to something else.

    Any idea what I'm doing wrong?

  • That works perfectly! Thanks!

    I'm not very good with math, so I would probably have spent hours trying to come up with something like that.

    Now, supposing I wanted to make this work for NPCs too, would this make the NPC go after the closest player unit, or to the first created?

  • Basically, I'm making a simple RTS, nothing fancy. Right now the player can click on an enemy unit to send his units to attack, but I'd like them also to move to a point within the range of the enemy unit, rather than moving directly to it.

    This image explains it fairly well.

    http://i150.photobucket.com/albums/s117 ... intlol.jpg

    The red is the enemy, green squares are the player's units, and the blue circles with lines are the destination I want the green squares to end up at if the player sends them to attack the enemy.

    I know from using Game Maker years ago that it had handy little lengthdir_x and lengthdir_y commands for just such an occasion, so is there something similar in construct?

  • I'll give that a try, and get back to you.

    I've also tried to the units "fighting" over the point where the player clicks. Basically, what I did was set it up so it checks if another unit is taking up the target area, and set it to place the target 32 pixels out from the old target. The only problem is, they seem to reach the destination, realise that they're overlapping that position, so they keep picking a new one over and over. Is there a way to only make it check for objects that aren't actually the original object itself?

    My next problem is, I have a bunch of NPC units that I want to walk towards the nearest player controlled unit. The NPCs are using the RTS behavior, and I can get them to move towards the player's units when they get within a certain range, but they always go for the original object, and not the ones created in runtime. There doesn't seem to be a way to set it to go towards the nearest object, so I can't really figure it out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the speedy reply!

    I'll give all your ideas a shot. I'm fairly new with Construct, but I've had a ton of experience with making games before, and this program is so intuitive it makes everything really easy.

    I know, making an RTS is a bit of a challenge, so I hope I can get it to work.