|
Post by MonstaWolf on Dec 9, 2015 15:56:36 GMT
I got it to work, but the game freezes for a few seconds each time the song changes.
|
|
|
Post by F1Andre on Dec 9, 2015 16:00:48 GMT
Not sure why, it may be due to the fact that Rad has to load a new asset.
|
|
|
Post by F1Andre on Dec 9, 2015 16:02:24 GMT
If that is the case, you should consider figuring out how to load the song in the background. But try to compile the project and then test it, you may just get different results.
|
|
|
Post by MonstaWolf on Dec 9, 2015 16:10:29 GMT
Okay, I'll try that tomorrow and tell you the results. Anyways, thanks a ton for the help
|
|
|
Post by F1Andre on Dec 9, 2015 16:18:28 GMT
Your welcome
|
|
|
Post by MonstaWolf on Dec 10, 2015 16:15:07 GMT
The only thing I have yet to figure out is how to make the game know when to switch songs automatically. Once I do that, I can finally move on with development
|
|
|
Post by F1Andre on Dec 10, 2015 20:35:20 GMT
Great to hear
|
|
|
Post by MonstaWolf on Dec 11, 2015 13:08:51 GMT
Great to hear The reason why I haven't continued on is because I don't want to have to change the script in multiple projects.
|
|
|
Post by F1Andre on Dec 11, 2015 20:13:24 GMT
Writing adaptive scripts needs planning, but you will get used to it as you gain experience.
|
|
|
Post by MonstaWolf on Dec 14, 2015 15:32:53 GMT
Oh wait, I think I know how that would work. Doesn't mean I know exactly how, but I can guess that it's writing a portion of the script in a readable file and only changing that file, so the scripts can read it
|
|
|
Post by F1Andre on Dec 14, 2015 20:38:46 GMT
Not exactly, it is more like writing a script or piece of code that that can be ported to any project and be used with no to little modifications. It simply "adapts"(not really but more or less) to the surrounding code. Storing information in a file can work, but it would most likely be more trouble than anything else. This can work but depends on what you are trying to achieve, so if you choose this option just know that it's a valid way. I can help if you can explain exactly what you are trying to achieve. In general writing code that can be reused or just adapts may seem time consuming at first but can become a little side bonus, next time you need that function, you simply copy, paste and use it to suite your needs. A prime example of such type of code can be found in something I have written and use in apps I develop: It is a script where you simply make a boolean true from a other script and it triggers a function that opens up a UI where you can set the time (like an android phone when you set the time in settings); After that when the user presses "okay" the variables are stored and can be retrieved from an other script or class. Just like that I have variable saving scripts, GUI elements (like dropdown lists, expand and shrink lists) etc. It's very basic but can save you time the next time you need a similar function. Just be sure on what you want the code to do and how it must be used(or interacted with) before you start writing you masterpiece This is a very long explanation, the idea here is to give you a full understanding of what it means to write adaptive (I'm sure there are multiple terms that are used, they all come down to a single main idea) code.
|
|
|
Post by MonstaWolf on Dec 15, 2015 0:21:44 GMT
Ah, ok. I have done that a few times before, with a render script that could be copied to each traffic car easily if you linked the objects in the right order
|
|
|
Post by MonstaWolf on Dec 23, 2015 12:32:39 GMT
Not having any luck with it
|
|
|
Post by F1Andre on Dec 23, 2015 13:08:36 GMT
What is the problem?
|
|
|
Post by MonstaWolf on Dec 23, 2015 13:23:45 GMT
I'm still having trouble making it properly detect when to play the next song
|
|
|
Post by MonstaWolf on Dec 23, 2015 14:06:02 GMT
I'm just having trouble thinking of a method to doing it.
|
|
|
Post by F1Andre on Dec 23, 2015 14:28:58 GMT
The code that I provided should work, can you post the whole script or the one you are using to do this.
|
|
|
Post by MonstaWolf on Dec 23, 2015 14:50:31 GMT
Well, that script works (I modified it a tiny bit as well). It can pick a random song from the list, but won't do it on it's own after the current song stops. I made the script activate when you play the project, as well as when you press the certain key. But, I don't know how to make it activate itself after a song ends.
|
|
|
Post by F1Andre on Dec 23, 2015 14:58:57 GMT
Did you implement that part where you start a timer and when the timer is greater or equal to the song time in the array the next song will be played and the timer is reset to 0.
|
|
|
Post by MonstaWolf on Dec 23, 2015 15:50:40 GMT
That's the problem. I don't know how I'm going to have a timer for each song (since they're all different times) without taking up too many resources
|
|