Tungstan's Forum Posts

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!

  • Thanks for this, plinkie. I'll check the whole code again and repost this in the forums.

    Cheers!

  • Hey plinkie,

    I have tried this and still is not working as intended.

    everything is working fine until reaching 3 farmers, where it just ignores the event and even if the farmcount is 3 it will still only collect 3 food every 2 seconds...

    image is here: ibb.co/iYKhUx

    I will also load the .capx if it helps... maybe the issue could be somewhere else?

  • Here's another image with the whole function for the "farm"

    ibb.co/fBJE9x

    The function is called when the building is placed on the map. for testing purposes, a building is already placed on the map.

    Essentially I want to have a farm that adds produces food based on how many farmers are working it. In the future I want to add animations for each of the farmers working on the farm, (for each minion destroyed, I can spawn another with the animation set to "farming" at the location of the farm, or can even change the animation of the farm sprite based on this number) but for now I want to make sure the farm is working as intended.

    Any help with this is really appreciated.

    If you have any questions, please let me know! Cheers

  • I have tried

    farmercount = 1, every 2 seconds, add 1 to food

    farmercount = 2, every 2 seconds, add 3 to food

    farmercount = 3, every 3 seconds, add 12 to food

    works fine up until the second event

    farmercount = 3, every 2 seconds, add 5 to food

    but ignores the following "farmercount = 3" event for some reason and only adds 3 food every 2 seconds even when the farm is full (3 farmers). I've tried with else in-between the statements, still not working...

    I don't know much about the "while" loop. any thoughts if that would do the trick? Maybe something like:

    while farm has less than 2 farmers

    farmercount = 1, every 2 seconds, add 1 to food

    farmercount = 2, every 2 seconds, add 5 to food

    while farm has 3 farmers

    farmercount = 3, every 3 seconds, add 12 to food

    I am not sure how to implement this yet, however. would I have to use an "else" between the "while" events? Do I have to check boolean of farm "isFull" instead of checking farmercount? I will try some ideas now, but if any of you guys have an answer, please let me know

    thanks a lot!

  • Thanks for the quick answer, plinkie!

    I have not tried it yet like this because I want to later to have 2 farms, for example, and be able to count the farmers for that specific farm (or household eating said food).

    Or is it possible to tie this to a specific instance of a farm? like, for example: if sprFarm.IID then farmercount = 1, every 2 seconds, add 1 to food

    Then again,is it IID or UID I need to look at?

  • Hi guys,

    hope someone can help me with this.

    So basically I have a guy working a farm, producing 1 food ever 2 seconds.

    the way this is set up is basically this: if the farm is empty -> call a function to make minions go to . on collision with it, the minion sprite is destroyed, and a value of 1 is added to farm's instance variable. when the value of 3 is reached, the function changes the behavior of the minions, so they would not be interested in it any longer.

    when the first minion enters the farm, 1 is added to farm's instance variable and also a boolean "isInhabited" set to true.

    the problem is that I have tried to make it so when there is only 1 guy working to add 1 to the global variable "food" ever 2 seconds, when 2 guys are working, i wanted to add 5 to food every 2 seconds or when farm's boolean "isFull" is set to true (meaning 3 farmers), to add 12 to food every 3 seconds.

    don't think i'm skilled enough to think this one through. here's an image with the best idea i've had so far..

    ibb.co/kuoLhH

    hopefully someone can illuminate me!

  • Hi guys,

    hope someone can help me with this.

    So basically I have a guy working a farm, producing 1 food ever 2 seconds.

    the way this is set up is basically this: if the farm is empty -> call a function to make minions go to . on collision with it, the minion sprite is destroyed, and a value of 1 is added to farm's instance variable. when the value of 3 is reached, the function changes the behavior of the minions, so they would not be interested in it any longer.

    when the first minion enters the farm, 1 is added to farm's instance variable and also a boolean "isInhabited" set to true.

    the problem is that I have tried to make it so when there is only 1 guy working to add 1 to the global variable "food" ever 2 seconds, when 2 guys are working, i wanted to add 5 to food every 2 seconds or when farm's boolean "isFull" is set to true (meaning 3 farmers), to add 12 to food every 3 seconds.

    don't think i'm skilled enough to think this one through. here's an image with the best idea i've had so far..

    hopefully someone can illuminate me!