Tungstan's Recent Forum Activity

  • This is exactly what I needed! Thanks very much, I really appreciate it!

    I also want to make sure I understand this correctly:

    1. on click, variable cellX gets the value of Tilemap.PositionToTileX(Mouse.x) and celly respectively.

    so Tilemap.PositionToTileX(Mouse.X) = the coordinate of X of tile which is on the same X line as the mouse?

    2. I don't really understand the loop from cellY to celly +100 what it actually does (but indeed works!). can you please explain this part for me a bit, as well.

    I believe I understand the rest.

    Thank you very much again!

  • Hi guys

    I'm pretty new to Construct, (well, on and off, mostly off, but getting into Construct again recently) and just trying to get my head around a simple thing. I have looked for tutorials that tackle this, but so far have not found any solutions to my problem. It may something so trivial that no one had taken the time to explain, but I can't seem to make any progress on this.

    I have a placeholder at mouse.x, mouse.y. I want to click somewhere above the ground tilemap (game is platformer, side view) and I want to create another sprite where the mouse is, but on the ground, and destroy the placeholder. In other words, X to be still at mouse, but Y to be set wherever the ground tilemap is under the mouse cursor (hope this makes sense)

    Obviously x = Mouse.X, Y = Tilemap.Y has not produced the result I wanted, I have tried other things like Tilemap.X + (Mouse.X), (Tilemap.Y) + (Mouse.Y)

    Another version is to have "invisible" sprites spread out along the ground and then just spawn the turret at their coordinates, but this isn't something that I really want to do.

    Hope you guys understand what I am trying to achieve.

  • i know it's been a while but can this be used with a progress bar? (aka tiled background to show the progress of the cooldown)

  • Got you! I thought that events running after a function will be part of the function for some reason.. I'll look at the code again.

    Live and learn.

    Thanks again!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I know how to disable and activate Groups, but I thought doing it via functions would work just as well. I did not know that I can't use Every x seconds in a function, never came up in everything I read on functions so far...

    I also just realized that in the first function there is an "Every x seconds" event. Would that be why it triggers at start of layout in spite of the disabled action to call it?

    I'll have to get rid of all the functions for now until I learn them better. and work with groups instead, I guess.

    Btw, if you have any links to any tutorials / articles of what one CAN'T do within a function would be really appreciated, as this never was a topic in everything I've read so far, which lead me to believe that any piece of code within the function will work. Btw, if you haven't noticed already I don't have a background in programming so please have mercy on me

    Thanks again for the pointers!

  • I disabled all the functions except for a simple one. In the main even sheet, I also disabled the action of calling it, yet it still triggers.

    hopefully, this image can tell you more: ibb.co/eVnzSH

  • I don't think I'm using any of the 3rd party plugins... I've installed a few a while ago to check some examples of things I was interested in but never really used any.

    As for events outside any functions, I will check to see if I misplaced something somewhere.

    Please let me know if there're any plugin names that popup when you try to open the .Capx and I'll upload another version without those.

    Thanks again!

  • here's the .CAPX: ufile.io/bq3oa

    it's not a lot of code, shouldn't take you long <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

    thank you very much! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

  • even though they are disabled at start of layout, they still trigger when i run the code.

    image of even sheet here: ibb.co/haAm7H

    I have a separate event sheet for functions which is included in the main even sheet. if I disable the groups of functions in the functions event sheet, then they won't work. but otherwise, no matter if I call them or not in the main even sheet, they all run at layout start... It's quite annoying as I don't know why this happens! Is it really a bug? Can I circumvent it or do I need to start fresh (I'd rather not..)?

  • Hi everyone!

    One quick issue.

    I have a bunch of functions in a separate functions event sheet (included in main event sheet) that fire off at start of layout, although I do not call them anywhere in the code! For example, I have a function that triggers something when the cursor is over a certain object, however, I wanted that to happen only when the function is being called. This is not what I got. Even if I don't call the function anywhere, it will still trigger.

    Anyone has any ideas why and what can I do to stop this from happening?

    Cheers!

  • I did just that and it worked! by checking a variable "farmerCount" i can then set how much food is produced every x seconds!

    As for the values, they're obviously not hammered in. this was just random numbers for testing purposes. Wanted to see a clear difference in value and time when testing at the end I would more than likely keep the food produced at an even number of every x seconds.

    Thanks for the tip

  • I found the issue after checking with the debug... I had the farm only accept 2 farmers instead of 3... that was ONE STUPID MISTAKE that cost me 1 day!

    live and learn... thanks for the input again!

Tungstan's avatar

Tungstan

Member since 18 Mar, 2018

None one is following Tungstan yet!

Trophy Case

  • 6-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies