Jump to content
pliskin124

Music from Actively Spawned Vehicles

Recommended Posts

Getting a "error: missing ]"

 

on

_list = (_this select 0);
{_playSongs = _x addaction ["Start Music Player","musicplayer.sqf",true,1,false,true"","_x in _target"];} forEach _list;

 

I think I understand what its doing, its adding the player to the list, then checking if anyone in the list is inside of a vehicle, then adding the action to the vehicle of anyone in the list. Not sure how to fix the ] error though. I'll try one of the other call compiles you suggested.

Share this post


Link to post
Share on other sites

Well it looks like there is some issues in the action, I just copy/pasted.

Look at what you wrote:

_list = (_this select 0); {_playSongs = _x addaction ["Start Music Player","musicplayer.sqf",true,1,false,true,"","_x in _target"];} forEach _list;

you're forgetting the "," in the action. 

It's not adding the player to the list.

Once activated, it gathers who is in the trigger at the time of activation and packs it into an array, regardless of wether or not it's a vehicle or just a player.

so then you can reference it in script. 

Share this post


Link to post
Share on other sites
2 hours ago, Midnighters said:

((vehicle player) != objNull) 

try that...?

To do what? player is its own vehicle! so, there is no chance to check if player is in a vehicle with that.

 

vehicle player == player  >> player is on foot

isNull objectParent player  >> player is on foot

 

NB: player == player >> player is defined and you can" work" with him.

Share this post


Link to post
Share on other sites
3 hours ago, pierremgi said:

To do what? player is its own vehicle! so, there is no chance to check if player is in a vehicle with that.

 

vehicle player == player  >> player is on foot

isNull objectParent player  >> player is on foot

 

NB: player == player >> player is defined and you can" work" with him.

I totally understand that, and i think you should test it for yourself. Because otherwise, if this doesnt work then all of my vehicle restriction shit is all faulty and doesnt work. 

Share this post


Link to post
Share on other sites
6 minutes ago, Midnighters said:

I totally understand that, and i think you should test it for yourself. Because otherwise, if this doesnt work then all of my vehicle restriction shit is all faulty and doesnt work. 

So, I can't read what you want to do with that (not seen your whole code).

One sure thing: vehicle player != objNull is true for player on foot. And always true as far as you're starting your mission.

 

Share this post


Link to post
Share on other sites
1 minute ago, pierremgi said:

So, I can't read what you want to do with that (not seen your whole code).

One sure thing: vehicle player != objNull is true for player on foot. And always true as far as you're starting your mission.

 

I could care less as to what I do here, as long as the thread starter gets a general idea, probably not the best example for this instance. 

Share this post


Link to post
Share on other sites

Hey guys, my question is kinda along this lines here.

 

I have been trying to use radio chatter via box radio at base forever. Only for MP it does not work. Anyone have any good code for MP for radio chatter via radio box at base.

Share this post


Link to post
Share on other sites
8 minutes ago, jandrews1 said:

Hey guys, my question is kinda along this lines here.

 

I have been trying to use radio chatter via box radio at base forever. Only for MP it does not work. Anyone have any good code for MP for radio chatter via radio box at base.

See my code earlier in this thread, works fine in MP.

 

Cheers

Share this post


Link to post
Share on other sites
1 hour ago, jandrews1 said:

Hey guys, my question is kinda along this lines here.

 

I have been trying to use radio chatter via box radio at base forever. Only for MP it does not work. Anyone have any good code for MP for radio chatter via radio box at base.

Yep, See the Grumpy Old Man code.

My two cent contrib:

- say3D needs to be remoteExec, no difficulty, and takes advantage from relative path declared in description.ext. Very good solution for custom sounds/musics.

- playSound3D is global, so no need to remote exec it, but you need to declare the full (absolute) path of the sound. Here is my script for endless broadcast of any shuffled Arma music from the object you want (static).

Share this post


Link to post
Share on other sites

Okay,

 

I have been testing the script out for a while (Sorry for the delay, been working). It works great, however one glaring issue, on vehicles because it is attaching an invisible radio, occassionally if the vehicle is moving too fast either helicopter, plane, or ground vehicle the sound seems to lag behind the vehicle and eventually becomes too quiet until you slow down and then it is blaringly loud. I assume this is because the say3D is catching up to the object. Any fix for this?

 

Secondly, any suggestions on how I can make a randomized loop of songs to play continually... i.e., Song 1, to Song 7, to Song 3, etc. I know this is done with an array function but I'm not quite sure how to call it from my existing script. I'd like to replace the Random parameter with a command that allows all of the songs to play through until the end (preferably without repeats, but not really necessary)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×