CREATOR4's Recent Forum Activity

  • ,

    The problem is I need the tile movement to work when using drag and drop. I think disabling it would disable the problem I'm trying to solve.

    I'll try move to and tween, hopefully I'll get some love there.

    Thanks again.

    I'm not sure what the problem is. I think I accomplished what you wanted by simply snapping the mouse movement and disabling tile movement when dragging

    gofile.io/d/1DsMk3

  • Every 3 seconds > Spr1large.Y + 65

    ?

    Or if you want it to be smooth use the MoveTo or Tween behavior

  • Your equation is wrong

    To get angle-distance do CenterX + distance_from_center * cos(angle)

  • ,

    Thank you for your suggestion, it gave me an idea. I set the X in the tile movement to 300 and Y to 0. Then removed all the other behaviors except tile movement - and it worked!

    The problem is, it still won't work with the mouse, only works with the keyboard.

    I can't seem to use 'cell_width' from your formula, I'm told it's invalid. (There is the possibility I'm entering it incorrectly) (I replaced cell_width with 85, the cell width)

    I'll keep plugging away.

    Thanks for the help.

    when you use mouse you should temporarily disable the tile movement behavior so it doesn't get in the way

    Yeah I meant for 'cell_width' to be a variable that you define :)

  • you could do something like

    set player x to round(mouse.X / cell_width) * cell_width

    this would make the player move to the mouse, but snap it to the grid at the same time

  • Thanks, but your file doesn't do what the original does.

    Whoops, I didn't even look at what it was supposed to be doing. Here it is:

    gofile.io/d/5abZNS

  • You're looking for families: construct.net/en/make-games/manuals/construct-3/project-primitives/objects/families

    Here's your file edited to work with families: gofile.io/d/woJLon

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

    I told you about collisions a few posts ago!

    "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"

    blackhornet is right about the solution as well, it's a good idea to have a sprite that acts as a hitbox and then a skin that you pin to the hitbox. It will make your life a lot easier. Disabling collisions is not a good long term solution. Imagine your character gets attacked while collecting wood. The attack won't collide with your character because collisions are disabled!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As You Can See By The Title, Construct 3 I Just Made A New Game Work Hard On It, Suddenly When I Save WHEN I SAVE!! It Says Login With Google So I Login AFTER I LOGIN I LOST ALL MY WORK GOD DAMNIT!!

    There Is Another Pain In The Ass Feature, YOU NEED TO PAY TO GET UNLIMITED EVENTS,For Me It's Okay That Exporting Multiplayer Etc Is Premium Feature, But For Gods Sake Why Only We Have 50 Events, Our Country Is Poor And Especially Its Quarantine, CAN YOU EXPECT ME CREATE A "HIGH QUALITY GAME" IN A MONTH!!!

    If you are having trouble affording C3, there is a pretty good free engine called Godot:

    godotengine.org

  • Could you just store all the Sprites' object histories in a dictionary?

    The key would be the sprite's UID and the value would be the sprite's JSON data

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

    So If Human's job = woodcutter -- > Set timer?

    If that's really the only parent condition then the timer is going to be constantly restarting, which is going to override itself and never let it complete. Try adding a 'Timer "gatheresource" is NOT running' condition before you set the timer. That'll prevent the timer from being set if it's already running

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

    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 different 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

CREATOR4's avatar

CREATOR4

Member since 7 Sep, 2019

Twitter
CREATOR4 has 1 followers

Trophy Case

  • 5-Year Club
  • Forum Contributor Made 100 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

8/44
How to earn trophies