lukasaurus
Member-
Content Count
6 -
Joined
-
Last visited
-
Medals
Everything posted by lukasaurus
-
Help with music not working via script
lukasaurus posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have the following script. It actually works for the first track (I don't plan on using these tracks, I just had them on my computer in ogg format) if (player in car1) then {player addAction ["Track 1 - Anton Maiden",{hint "Playing Anton Maiden";1 fadeMusic .35;playMusic "track1";},[],9]; player addAction ["Track 2 - Top Gun Theme",{hint "Playing Top Gun Theme";1 fadeMusic .35;playMusic "track2";},[],8];} else { removeAllActions player; 1 fadeMusic 0.0; } However, the second track won't work. The action shows up, it says the hint, but the audio doesn't play. My description file looks like this class CfgMusic { tracks[]={}; class track1 { name = ""; sound[] = {"\music\song1.ogg", db+10, 1.0}; }; class track2 { name = ""; sound[] = {"\music\song2.ogg", db+10, 1.0}; }; }; The files are all in the right place, song2 is in ogg format. Here is the weird thing though. It's not the file with the problem, because it won't work with any ogg file in track2. Even if I make a copy of song1 and call it song2, it doesn't play. I can't figure out why.... ---------- Post added at 02:20 ---------- Previous post was at 02:14 ---------- And I figured it out - turns out description file is only refreshed when you first load the mission in the editor, so I needed to reload it for the tracks to be recognised. -
What is wrong with this code (beginner)
lukasaurus replied to lukasaurus's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Alright, I get it, cheers. That's completely unlike any other programming language I've used before with accessing array indexes, which is why I was getting so confused. -
What is wrong with this code (beginner)
lukasaurus posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm just learning, going through some video tutorials. I'm familiar with Python and C#. Some of the syntax in Arma Script makes no sense to me for example, the following should work in my head, but does nothing in game. I cannot figure out why random_task_text = ["pink_task","green_task","yellow_task"];//name of task random_task_target = [pink_task,green_task,yellow_task];//target of task //_random_task = random_task_text call BIS_fnc_selectRandom; //hint _random_task //this works _x = floor (random count random_task_text); //get a random task index //hint str _x //this also works hint random_task_text[_x]; //display the task name On lines 3 and 4, that will select a random string and display it. Line 5 is also working (you can see my code to test it commented out). But line 7 does nothing, when in my mind, it should take the random int generated from line 5 and then display the string in that index. It doesn't. Any help? This function is called random_task.sqf and the init.sqf files runs it. I can get it to do the stuff that I have commented out, but am confused as to why I can't get it to work the way I want. -
What is wrong with this code (beginner)
lukasaurus replied to lukasaurus's topic in ARMA 3 - MISSION EDITING & SCRIPTING
What I am wanting to do is get the index value and then use it for multiple arrays. How would I do that? I understand what you did, but that won't give me the index of the string, so I can't use it for other arrays... -
I registered here a while back and still haven't been enabled to post threads?
-
Hi, looking forward to learning more about scripting and modding.