|
Post by F1Andre on Dec 23, 2015 15:59:21 GMT
That's why there is a array, I explained that part, just go back and read it again. What do you mean by taking up to man resources.
|
|
|
Post by MonstaWolf on Dec 23, 2015 16:12:52 GMT
Nevermind the resources thing. Now I'm just wondering how the script will know the correct time to choose, because if the time is picked at random just like the songs were, it would only have a 1/(however many songs there will be) chance of picking the right one.
Sorry if this all sounds noobish.
EDIT: I believe I figured out a way to do it, I'll get back to you if I can get it to work.
|
|
|
Post by F1Andre on Dec 23, 2015 16:42:20 GMT
The song time is not picked at random, only the song is picked and then each song has it's own int value and according to that you call the right song time.
|
|
|
Post by MonstaWolf on Dec 23, 2015 17:30:42 GMT
I got it to detect when the song ends, and now I just need help setting the time on the EventTimer. I need a way to convert the string to a float, otherwise it will not let me set the time.
Here's the script (this stupid public wifi won't let me use the "code" option so please bear with me):
//Times string[] time = {"273", "345", "365", "317", "296", "337", "376", "204", "236", "201", "203", "269", "215", "196", "219",};
OUT_44= time[newRandom]; //newRandom was used up above to choose the song, this is what determines which string to choose from.
EDIT: I'm also trying this:
//Times string[] time = {"273", "345", "365", "317", "296", "337", "376", "204", "236", "201", "203", "269", "215", "196", "219",};
float(Songtime) iStringVal(time);
|
|
|
Post by F1Andre on Dec 23, 2015 19:22:10 GMT
Firstly use a int array or a float. And to convert string to float would be fairly simple (and weird from a programming standpoint): string timer = 17; // This would be your object timer
To convert it to float: float timerFloat = timer;
|
|
|
Post by MonstaWolf on Jan 4, 2016 12:51:57 GMT
I'll try it, but where did you get the number 17 from? Do I need to adjust it according to something?
EDIT: I keep getting the "Can't implicitly convert string to float" error, like I was getting before, no matter how I change it. Sorry for the very late reply, I was on Christmas break. Speaking of that, hope you had a Merry Christmas (Sorry if you don't celebrate that) and a happy New Year.
One more edit: Hang on, I forgot to use an int array. I'll use an int array and tell you how it goes.
|
|
|
Post by MonstaWolf on Jan 5, 2016 17:33:46 GMT
It works!
Thanks for your help, f1! I really appreciate it!
|
|