Pythagoras's Recent Forum Activity

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

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, I just started using Construct, and I've been playing around making an RTS based on the RTS example that comes with the program. Right now, when you set the units to avoid eachother, they sort of smash into eachother and come to a standstill before moving again.

    Obviously it isn't very realistic for people to crash into each other like this, so I'm wondering if there's a smoother way to make the units avoid each other.

    Also, I want the units to kind of spread out at their destination. I tried making them move to a random point around the mouse when the player clicks, but often their destinations still overlap and they sort of try to "fight" for a specific spot. It'd be nice if I could have them move to a position around the destination based on where they were standing when they started, since that would fix my first problem as well, but I have no idea how I would pull that off.

    Basically my question is, what's the best way to set up RTS movement for human units from a top down perspective?

Pythagoras's avatar

Pythagoras

Member since 12 Apr, 2009

None one is following Pythagoras yet!

Trophy Case

  • 15-Year Club
  • Email Verified

Progress

16/44
How to earn trophies