tristanojbacon's Recent Forum Activity

  • Ok, so I found the Moving Angle and CurrentNode expression for the Pathfinding behaviour, and have changed the sprite to rotate towards the CurrentNode it's walking towards.

    However, I tried to change the animation based on angle, but I don't understand how the angles are decided. Is it relative to the node (with straight forward being 0 degrees), or is there a 'global angle' based on the layout that I can use?

    This is what I have now, and the animations are all over the place during Preview

  • I'm working on a top-down game with moving NPC sprites, and I'd like to use different animations based on their direction of movement. They all have 8-direction behaviour, but the only way I can see to change animations based on direction, is with keyboard input. However, these aren't player characters.

    I've found the "8-Direction -> Is Moving" condition, but no conditions or actions relating to direction of travel.

    I've tried doing it by object angle, but the object doesn't have rotation enabled. I also tried adding an invisible pinned sprite and rotating that, but I still can't find any conditions that would enable rotation based on direction of travel

  • I'm working on an RTS mobile game, similar to classics like Age of Empires, but I'm trying to decide whether I should design it as a Top-Down (like Zelda or Pokemon) or Isometric (Age of Empires, Diablo or Clash of Clans)

    What do you all think? Do you have a preference between the two?

    (From a player point-of-view, not as a developer)

    I'm also torn between artistic styles: realistic (Age of Empires) and 'cartoon' (Clash of Clans).

    These are more open questions than anything - I'm keen to hear what people think, based on their own experiences of playing mobile games!

  • Sorry , I don't think I fully appreciated what you were suggesting when I read it first time, then got distracted with another issue and forgot by the time I came back to this issue :`D

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks everyone for your suggestions!

    blackhornet was almost there with collisions. I added a "Turn off collisions" action right after the "on collision with tree" event, and everything worked as normal. I guess it just kept colliding and restarting the timer each tick!

    I then turned them back on once the character had finished collecting wood, so that they can drop it off at the storehouse.

  • It tries to go up, but only ever gets to 0.1/0.2 seconds before being reset.

    Interestingly, if you leave it for 20-30 seconds it starts working normally... Any ideas?

  • To link the tree and the character you can use UIDs.

    Give the character a variable called TreeUID

    Then, when the character collides with the tree set TreeUID to res_Tree.UID

    When the character's timer goes off use Pick Tree By UID: character.TreeUID to pick the correct tree

    However, I can anticipate there being a possible problem if the character's collision box changes during it's animation. It may repeatedly collide with the res_tree as it's frame changes. Try opening the game in debug mode so you can get a better look at what the timer is doing

    I was about to do that, but I decided to re-check the Debug Preview one last time. It turns out the "gatherResource" timer is being reset every tick, which I didn't notice before (I only just discovered the Watch tool!):

    It tries to go up, but only ever gets to 0.1/0.2 seconds before being reset. There aren't any other interactions with that timer in the Events Sheet, except for the "On Timer" condition below it.

    The parent event to that set-timer-event is just checking if the Human has a variable of job->woodcutter, in case you were wondering. No reason for any clashes.

    Thanks for your help so far!

  • Put 'On Timer' as it's own top-level event, not as a sub-event

    Ok, I did that but still no joy. This is what I have now:

    There are no other events impacting these two, they could effectively run on their own.

    I'm wondering if because it's not a sub-event of the collision condition, it now doesn't know which tree to deduct from? If so, how would I re-link it?

  • I'm trying to set up a Timer on an object. Once a Human sprite has is in collision with a Tree sprite, it should start 'collecting' the wood resource every 2 seconds, adding to the Human's wood total variable, and deducting from the Tree's wood remaining variable.

    I have a regular Timer in the 'on collision' event, but when I go to add the 'On Timer' condition in a sub-event, it doesn't show up as an option.

    The blue line is where I want to add the 'On Timer' condition.

    I feel like I'm missing something obvious here. I've seen 'On Timer' referenced hundreds of times online, but I can't find it in my editor. Below is all I see when I select the Human object in Conditions. The object has a Timer behaviour attached.

    Tagged:

  • Pathfinding logic youre constantly running the event and finding a path. You should do a trigger once to find the path, then the on path found trigger should be its own separate event.

    That worked perfectly, thank you! I assumed that the Find Path action would only happen once, but evidently not!

    Screenshot with working events below for anyone else having this issue:

    For the camera try drag and drop behaviour on a sprite that also has scroll to behaviour.

    I managed to fix this, really simple solution. The Unbounded Scrolling option in the Layout properties wasn't checked for some reason, and that was stopping the camera from moving. The events I shared in my initial post are correct (for anyone else with the same issue)

  • I've just started with Construct3, and am struggling with what I see as two very basic functions that were easy to implement in GDevelop.

    Hopefully someone can help!

    1. Pathfinding

    I want a Human sprite to find the nearest Tree object and move towards it. I've figured out how to pick the nearest one, but the Human goes in completely the wrong direction.

    In the screenshot below, the bottom left Tree is picked as the closest, and the animation is changed so I can see it. On startup, the Human is at the blue circle, but then starts moving to the right for some reason (red arrow).

    (Please excuse the awful graphics, I'm using placeholders whilst I build the functionality!)

    Here are the Events:

    2. Moving the camera with mouse/touch

    It's an RTS-style mobile game, so I want to move the camera by dragging. There are plenty of tutorials and examples available, but when I copy them over (word-for-word), they don't work. All the project settings are the same across my project and the examples/tutorials, same imported objects etc.

    However, nothing happens when I try and drag.

    I have two layers (layer_ui for general UI, and layer_background for all the objects)

    Here's the Events view. What am I missing?

  • You do not have permission to view this post

tristanojbacon's avatar

tristanojbacon

Member since 30 Jul, 2020

None one is following tristanojbacon yet!

Trophy Case

  • 4-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies