lionz's Recent Forum Activity

  • Looks like you have it sorted...the reason he won't move is because of your mismatch between RUN and Run, be careful with that...it sets to RUN but then checks for Run.

    You also have another issue which is although your barbarian is looking left the angle is pointing to the right so the cone of vision points right. You could set to 360 initially i suppose, note that setting it to 360 after trying to detect LOS as you have done will not do much.

    I've set up an attack function here :

    dropbox.com/scl/fi/r2e02c08c4g8s2nov1zgz/Space-knight.c3p

  • Try rebuilding the obstacle map a few seconds after you enter the layout, do they still have the problem? Might be because obstacle map is built before the objects have fully loaded into memory but this is just a guess. I know it generates the obstacle map once only on start of layout.

  • Well I would use the pathfinding method if you are adding obstacles.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I wouldn't do that with pathfinding, probably something like give the monster object Bullet behaviour and then create an event 'every tick, monster set angle toward position player.x, player.y. That will make it look like the monster is following you.

    If you were to do it with pathfinding it might not look like the monster is following you as it goes to the previous player start point but it would be something like find path to player, move along path, on destination arrived, find path to player.

  • Because you're finding a new path every tick. You only need to find the path once then let the object move along the path then find a new path when it reaches its destination (in general). Try 'on start of layout' instead of 'every tick' and you will see it move after finding the path once.

  • You've explained it well so I guess you have the walking and line of sight done already? When they are not in line of sight (LOS inverted) you can then set a variable to choose(0,1) this picks either 0 or 1, then you relate 0 to one attack and 1 to the other. You can pass these variables through a function for attacking if you know how.

  • Indeed that's why I was reluctant to say use rexrainbow MoveTo as it seems impossible to add on Construct 3.

  • could you post the pic again? looks like your logic is broken and making them move to 0,0

  • I did this mechanic with a theme park game to build paths, you can just have while mouse button is down, when cursor is over a particular grid square then change it to the texture of the block, or spawn it there depending how your game works. It also depends on how you set up the grid detection and how the original drag and drop works to drop in a block, you basically just duplicate that action as the mouse cursor moves over the centre of other squares in the grid.

  • I tend to use the rex_moveto plugin for something like this, it should accomplish what you want to move 32 pixels to right on a key press. https://c2rexplugins.weebly.com/rex_moveto.html

    As mentioned above your code is fine except you need to define player.x+32 as a variable beforehand as the player.x changes while lerp is running.

  • Moving around solid objects in a top down game is pretty much what the Pathfinding behaviour is for, try that! I guess if you are working in a grid system then you could allocate empty spaces for dropped loot and make sure it's not occupied, pick the nearest unoccupied space to an enemy when they are killed.

  • Well if you have it setup how I described then they will never go for food unless water is fine, is that the kind of priority you are talking about?

lionz's avatar

lionz

Member since 5 Aug, 2013

Twitter
lionz has 73 followers

Trophy Case

  • 11-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

24/44
How to earn trophies