PointyBuns Posted July 5, 2019 Share Posted July 5, 2019 When I am scripting a dancer, how do I list all the parts of the song in the object to play? I have been struggling for an hours, but no matter how I list them in the "sound_name," I always get an error. This is my code: integer owner_only_trigger = FALSE; string on_command = "black"; string off_command = "light"; string animation_name = "Best"; string sound_name = "EIB part_01"; integer listener_handler; Link to comment Share on other sites More sharing options...
Mollymews Posted July 5, 2019 Share Posted July 5, 2019 post your code by clicking the Code <> button on the editor toolbar. Paste your code into the pop-up window. This will help to format your code to make it easier for us to read do this and we will be in a better position to give you advice about what your script issue might be Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted July 5, 2019 Share Posted July 5, 2019 (edited) Probably better to put the inidividual parts in a list, and then each time you need a part, get the sound using llList2String list song_parts = ["part1", "part2", "part3"]; integer numSongs; integer thisSong; string soundToPlay; default{ state_entry() { numSongs = llGetListLength(song_parts); thisSong = 0; soundToPlay = llList2String(song_parts, thisSong); and so on You work through the parts by increasing thisSong until it is one less than numSongs (if there are four parts, list length will be 4 but as they are ordered 0 to 3 you stop at 3). Edited July 5, 2019 by Profaitchikenz Haiku Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now