hey guys so i have a feature for my game but im not sure how to implement it, i’ll try to explain the best i can
basically i want to have where you can enter dates and time with the numpad so you’d press a button to enable the date selector, then you’d enter month in 2 digits, day in 2 digits and then year in 4 digits and lastly press a button to submit it. it would then print the numbers to the screen, i’m not sure how to make this or account for things like leap years any help appreciated
this is what ive come up with for the month, but im not sure how i’d do the day or year. i followed a guide on making cheat codes and basically am printing the text for now
here is a basic on off switch to start recording the numbers pressed.
here i’m gathering the buttons, asking if the key to record buttons is on, and then letting it check.
lastly heres the “cheat index” from the tutorial basically numbers 00 - 99 and they are tied to 13 functions, (JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC and ERR for any number thats not 01-12)
i dont know how to kill an event and i really dont want to make functions for every number because once i get to year thats 1,000 functions to make by hand. any ideas much appreciated
You could use date time with whatever method, actually. You may need to figure out some data formatting first, the above is just a pseudoscript example.
unfortunately i dont know enough about widgets to even get started with that
edit: i messed around with datetime a bit, it doesnt support year 0 which i need and annoyingly doesnt support leading 0’s so i cant enter for instance 01,01,0000 for a date
so took about a week but i finally got it to a point im mostly happy with, i had to manually write out 10,000 years but it’ll soon be enterable. my only concern is once i have a working time input i wont be able to see the days, months and years roll over using this method
Hello! Please tell me how to do it according to the above script. I made it according to your script, but when I enter a value in Editable Text, date time from string keeps returning flase.
As mentioned bove, DateTime needs specific format. Follow the link I posted above to see what I mean. You’re probably invalidating that node.
Most importantly, what’s the point of using Data Time if you’re reformatting the data anyway? Take the string apart, and pull what’s needed out of it directly.