KokaKolaA3 394 Posted July 2, 2015 Hi, i want that when i Player Move into a Trigger that it plays at some specific positions a Sound. And i want that you can go to a laptop and select Activate Laser, then its spawns a Object at a specific position. How can i do this? Sorry for my bad english :D Share this post Link to post Share on other sites
R3vo 2654 Posted July 2, 2015 (edited) Hey KokaKola, for the laser you would do the following: Create a script called "activateLaser.sqf" and put it into your mission folder. //The name can be anything but I'll use this one now for easier recognition. In the script you put the following code: _unit = _this select 0; //This is the unit the addAction is attached to _caller = _this select 1; //This is the unit that called the addAction _action = _this select 2; //That's the ID of the action "B_MRAP_01_F" createVehicle [0,0,0]; //This creates a Hunter MRAP at the position 0,0,0 _unit removeAction _action; //This removes the action once the laser has been activated Replace "B_MRAP_01_F" with the classname of the object you want to create. All classnames can be viewed here In the laptop's initialisation put the follwowing: this addAction ["Activate Laser","activateLaser.sqf"]; // This adds an addAction called "Activate Laser" to the laptop. The music part: This can be a little bit more complicated. I presume you want to play a sound in 3D. That would require you to define your custom music in your description.ext. First step is to create a description.ext in your mission folder.(Make sure it's not called description.ext.txt) In this file you put the following: class CfgSounds { sounds[] = {}; class wolf1 { name = "my_wolf_sound"; // how the sound is referred to in the editor (e.g. trigger effects) sound[] = {"fx\wolf1.ogg", 1, 1}; // filename, volume, pitch titles[] = {1, "*wolf growls*"}; // subtitle delay in seconds, subtitle text }; }; The music file needs to be in your mission folder and has to have the ending "filename.OGG". Once you've defined your custom sound properly you add the following line to the "on activation" field of you trigger playSound "wolf1"; // wolf1 needs to be replaced by the name you've defined in the CfG Sounds. I know those steps can be quite intimidating but feel free to ask again if something doesn't work or you didn't understand completely. Edited July 2, 2015 by R3vo Share this post Link to post Share on other sites
KokaKolaA3 394 Posted July 2, 2015 The Sounds works perfectly, But this is my Lichtschranke.sqf (activateLaser.sqf) _unit = _this select 0; //This is the unit the addAction is attached to [color="#FF0000"]what means _unit or _caller is that important?[/color] _unit = _this select 1; //This is the unit that called the addAction _unit = _this select 2; //That's the ID of the action "KKA3_5m_laser" createVehicle [14,71,67]; //This creates a Hunter MRAP at the position 0,0,0 _unit removeAction _action; //This removes the action once the laser has been activated Share this post Link to post Share on other sites
R3vo 2654 Posted July 2, 2015 (edited) The Sounds works perfectly, But this is my Lichtschranke.sqf (activateLaser.sqf) _unit = _this select 0; //This is the unit the addAction is attached to [color="#FF0000"]what means _unit or _caller is that important?[/color] _unit = _this select 1; //This is the unit that called the addAction _unit = _this select 2; //That's the ID of the action "KKA3_5m_laser" createVehicle [14,71,67]; //This creates a Hunter MRAP at the position 0,0,0 _unit removeAction _action; //This removes the action once the laser has been activated When you attach an addAction to a unit or object, the addAction transfers 3 variables in an array over to the script. e.g. [addActionOwner,addActionCaller,addActionID] _unit = _this select 0; selects only the object or unit which has the addAction. This is handy if you want to refer this object/unit later in the script. Same for _caller = _this select 0; In your case you would only need the unit/object, since you want to remove the action later in the script from the laptop (At least I presumed so) To learn more about addAction look here Edited July 2, 2015 by R3vo Share this post Link to post Share on other sites
KokaKolaA3 394 Posted July 2, 2015 Ok thanks. But when i activate the Trigger it plays the sound only at the Position of the Player. But i want that every blufor unit can hear it whereever he is. It is possible to have an action at a laptop to download a file and uplaod it on another Laptop and if the File is uploadet specific Triggers will be Deleted. Maybe you understand it better when i show you what i mean. 1. You have to download a File 2. You have to upload the file on another pc. 3. The file is a virus who deactivate the Trigger so no more alarm can be activated. Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted July 2, 2015 (edited) But when i activate the Trigger it plays the sound only at the Position of the Player. But i want that every blufor unit can hear it whereever he is. Tried this in the "OnAct"? ["wolf1","playSound", blufor] call BIS_fnc_MP; (Nevermind if I missed the context.) Edited July 2, 2015 by Heeeere's Johnny! Share this post Link to post Share on other sites
R3vo 2654 Posted July 2, 2015 Ok thanks. But when i activate the Trigger it plays the sound only at the Position of the Player. You should have said that before, that's way easier. When you open a trigger, click on "effects". There are a few different dropdown menus. Select the sound you want to play from there. Once the trigger is activated, the sound you've selected will play globally, for everyone to hear. It is possible to have an action at a laptop to download a file and uplaod it on another Laptop and if the File is uploadet specific Triggers will be Deleted. Maybe you understand it better when i show you what i mean. 1. You have to download a File 2. You have to upload the file on another pc. 3. The file is a virus who deactivate the Trigger so no more alarm can be activated. This is possible, also via an addAction. Add an addAction to your "download laptop" as I've showed you a few post above. download.sqf _unit = _this select 0; _caller = _this select 1; _action = _this select 2; _unit removeAction _action; //remove the downloaded action //show some simple hints to inform the player about the downloaded status hintSilent "Download started..."; sleep 1; hintSilent "5% downloaded"; sleep 1; hintSilent "10% downloaded"; sleep 1; hintSilent "15% downloaded."; sleep 1; hintSilent "20% downloaded"; sleep 1; hintSilent "25% downloaded"; sleep 1; hintSilent "30% downloaded"; sleep 1; hintSilent "40% downloaded"; sleep 1; hintSilent "50% downloaded"; sleep 1; hintSilent "70% downloaded."; sleep 1; hintSilent "85% downloaded"; sleep 1; hintSilent "90% downloaded"; sleep 1; hintSilent "91% downloaded"; sleep 1; hintSilent "92% downloaded"; sleep 1; hintSilent "100% downloaded"; sleep 1; hintSilent "Download finished"; playSound "scoreAdded"; laptop2 addAction ["Upload Virus","uploadVirus.sqf"]; //this would be the laptop where you upload the virus uploadVirus.sqf _unit = _this select 0; _caller = _this select 1; _action = _this select 2; _unit removeAction _action; //remove the downloaded action //show some simple hints to inform the player about the downloaded status hintSilent "Upload started..."; sleep 1; hintSilent "5% uploaded"; sleep 1; hintSilent "10% uploaded"; sleep 1; hintSilent "25% uploaded"; sleep 1; hintSilent "40% uploaded"; sleep 1; hintSilent "60% uploaded"; sleep 1; hintSilent "73% uploaded"; sleep 1; hintSilent "86% uploaded"; sleep 1; hintSilent "96% uploaded"; sleep 1; hintSilent "100% uploaded"; sleep 1; hintSilent "Upload finished"; playSound "scoreAdded"; uploadFinished = true; //use this variable to fire a task or trigger This should get you started. Share this post Link to post Share on other sites
KokaKolaA3 394 Posted July 3, 2015 Tried this in the "OnAct"? ["wolf1","playSound", blufor] call BIS_fnc_MP; (Nevermind if I missed the context.) Works fine thank you!---------- Post added at 07:28 ---------- Previous post was at 07:22 ---------- You should have said that before' date=' that's way easier.When you open a trigger, click on "effects". There are a few different dropdown menus. Select the sound you want to play from there. Once the trigger is activated, the sound you've selected will play globally, for everyone to hear. This is possible, also via an addAction. Add an addAction to your "download laptop" as I've showed you a few post above. download.sqf _unit = _this select 0; _caller = _this select 1; _action = _this select 2; _unit removeAction _action; //remove the downloaded action //show some simple hints to inform the player about the downloaded status hintSilent "Download started..."; sleep 1; hintSilent "5% downloaded"; sleep 1; hintSilent "10% downloaded"; sleep 1; hintSilent "15% downloaded."; sleep 1; hintSilent "20% downloaded"; sleep 1; hintSilent "25% downloaded"; sleep 1; hintSilent "30% downloaded"; sleep 1; hintSilent "40% downloaded"; sleep 1; hintSilent "50% downloaded"; sleep 1; hintSilent "70% downloaded."; sleep 1; hintSilent "85% downloaded"; sleep 1; hintSilent "90% downloaded"; sleep 1; hintSilent "91% downloaded"; sleep 1; hintSilent "92% downloaded"; sleep 1; hintSilent "100% downloaded"; sleep 1; hintSilent "Download finished"; playSound "scoreAdded"; laptop2 addAction ["Upload Virus","uploadVirus.sqf"]; //this would be the laptop where you upload the virus uploadVirus.sqf _unit = _this select 0; _caller = _this select 1; _action = _this select 2; _unit removeAction _action; //remove the downloaded action //show some simple hints to inform the player about the downloaded status hintSilent "Upload started..."; sleep 1; hintSilent "5% uploaded"; sleep 1; hintSilent "10% uploaded"; sleep 1; hintSilent "25% uploaded"; sleep 1; hintSilent "40% uploaded"; sleep 1; hintSilent "60% uploaded"; sleep 1; hintSilent "73% uploaded"; sleep 1; hintSilent "86% uploaded"; sleep 1; hintSilent "96% uploaded"; sleep 1; hintSilent "100% uploaded"; sleep 1; hintSilent "Upload finished"; playSound "scoreAdded"; uploadFinished = true; //use this variable to fire a task or trigger This should get you started.[/quote'] Works fine as well, i modified it al little bit, so when the Virus is uploaded then i have the action to aktivate the Laser. _unit = _this select 0; _caller = _this select 1; _action = _this select 2; _unit removeAction _action; //remove the downloaded action //show some simple hints to inform the player about the downloaded status hintSilent "Upload started..."; sleep 5; hintSilent "5% uploaded"; sleep 5; hintSilent "10% uploaded"; sleep 5; hintSilent "25% uploaded"; sleep 5; hintSilent "40% uploaded"; sleep 5; hintSilent "60% uploaded"; sleep 5; hintSilent "73% uploaded"; sleep 5; hintSilent "86% uploaded"; sleep 5; hintSilent "96% uploaded"; sleep 5; hintSilent "100% uploaded"; sleep 5; hintSilent "Upload finished"; playSound "scoreAdded"; laptop3 addAction ["Activate Laser","lichtschranke.sqf"]; //this would be the laptop where you upload the virus uploadFinished = true; //use this variable to fire a task or trigger Does this work? Share this post Link to post Share on other sites
R3vo 2654 Posted July 3, 2015 Yes, looks fine to me. Share this post Link to post Share on other sites
KokaKolaA3 394 Posted July 3, 2015 Yes, looks fine to me. Is it possible: Lock an special Door and you have to place an Bomb. Then explode the Bomb and the door is open? Share this post Link to post Share on other sites
R3vo 2654 Posted July 3, 2015 It's probably possible but I don't know how. Maybe someone else can help you with that. Share this post Link to post Share on other sites