Hi I'm trying to figure out how to set up a time system for my crafting/farming. I'm trying to have each item created take X amount of time , and have that X object variable continue to count each second even while changing scenes and upon return to Craft/farming scene, items will check the X object variable to activate or not .

I've been using object variables with ID's which work fine in multiple scenes and changing simple bools, floats , etc but nothing like changing a float every second(like time), Ive tried to use Events to change the object variable but events seem to end when i change scenes, I tried variable events to change float X over time and it works but then stops when changing scenes.

I have everything setup for my crafting system(farming) the way I want it , I'm just trying to figure out this last part :/

Thanks :)
  • I never used Time and Day GiL tutorial for a real prototype, but it is well done: can't you get global variables from there and check them when the player reaches farming / crafting position?
    http://orkframework.com/tutorial/gameplay/time-and-day/
    I suppose you can make calculations to switch global to object variables, or you can check directly global time.
    I hope it helps you. ^^
  • Probably easiest to use the Research Tree feature, which offers exactly this functionality and also allows creating items, equipment and other things.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • @gamingislove Thanks for the reply and I will look into it :)!

    @Kaemalux yeah I set up a day and time global event with global variables but I'm having trouble getting the object to check the time I started crafting and the difference between start and current time in game, formulas don't seem to be able to use object variables or magbe im doing something wrong
  • @gamingislove The research Tree Just about what I'm Looking for but when I use Finish Variable Changes and User Object Variables I get an error:

    NullReference Exception : Object reference not set to an instance of an object
    Orkframework.Variablesetter.SetVariables( ORKFramework.VariableHanderhandler)
  • Are your crafting / farming object interactable? I suppose you could use time as a plain number, let me explain: you convert day / hour in total minutes passed (or seconds, as you like), and you store that number as variable, then when the player come back you have a second number, and you can check the difference, if the time passed is greater than the time needed to perform the growth / craft / etc you start the gathering event. I think it must be set up properly, but it should be doable without many problems...
  • Oh, I was just going to ask along these lines. Thank you from an innocent bystander...
  • @tribbles
    Does your user have an object variables component attached?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you all for the replies :D
    It's fine I figured it all out , I'm using global variables time and passing them to an object variable to determine the time even while changing scenes, I do have to use more object variable IDs for each unique Crafted/farmed item in my game but its not that bad .

    @gamingislove yes I was using object variable component , not really sure what was the problem but I figured out another way of doing my farming system :D
Sign In or Register to comment.