Call to prayer script for mission makers (marker version)

  1. ‹ Older
  2. 8 years ago
    Deleted 8 years ago by incontinenetia
  3. So. I am using the Call to Prayer file and scripting from @HeroesandvillainsOS mission. I have it working in one mission that I have moved from because of of other issues.
    I have found a mission that I am attempting to modify for my unit's private play and would like to use the Call there also.

    I am attempting to put the scripting code into my description.ext file, but there is already a ClassCfg Sounds entry.
    When I put the code for the Call to Prayer script in, I get an error.

    Can someone show me what I need to do or remove to get this working?
    Here is what I need to insert

    class CfgSounds {
    	sounds[] = {prayer};
    	class prayer {
    		name = "prayer";
    		sound[] = {"CalltoPrayer\sounds\prayer.ogg", db+1, 1};
    		titles[] = {};
    	};
    };

    after

    class CfgSounds {
    	sounds[] = {Vent,Vent2,Para};	
    	// ATM AirDrop
    	class Vent {name="Vent";sound[]={"ATM_airdrop\data\Vent.ogg",db-11,1.0};titles[] = {};};
    	class Vent2 {name="Vent2";sound[]={"ATM_airdrop\data\Vent2.ogg",db-11,1.0};titles[] = {};};
    	class Para {name ="Para";sound[]={"ATM_airdrop\data\parachute.ogg",db-11,1.0};titles[] = {};};	
    };

    Thanks for any help!

  4. What does the error say?

  5. error is as follows [directory]\description.ext, line 53: .CfgSounds: Member already defined.

  6. I wonder if you combined the scripts if it would work? What's line 53 in your description.ext? If you have notepad++ it will tell you your lines.

  7. Edited 8 years ago by HeroesandvillainsOS
    class CfgSounds {
    	sounds[] = {prayer};
    	class prayer {
    		name = "prayer";
    		sound[] = {"CalltoPrayer\sounds\prayer.ogg", db+1, 1};
    		titles[] = {};
    	};
    	sounds[] = {Vent,Vent2,Para};	
    	// ATM AirDrop
    	class Vent {name="Vent";sound[]={"ATM_airdrop\data\Vent.ogg",db-11,1.0};titles[] = {};};
    	class Vent2 {name="Vent2";sound[]={"ATM_airdrop\data\Vent2.ogg",db-11,1.0};titles[] = {};};
    	class Para {name ="Para";sound[]={"ATM_airdrop\data\parachute.ogg",db-11,1.0};titles[] = {};};	
    };

    Or something like that? Long shot but I'd do a backup and try it until a scripter gets in here. :)

  8. Deleted 8 years ago by incontinenetia
  9. @HeroesandvillainsOS  class CfgSounds { sounds[] = {prayer}; class prayer { name = "prayer"; sound[] = {"CalltoPrayer\sounds\prayer.ogg", db+1, 1}; titles[] = {}; }; sounds[] = {Vent,Vent2,Para}; // ATM AirDrop class Vent {name="Vent";sound[]={"ATM_airdrop\data\Vent.ogg",db-11,1.0};titles[] = {};}; class Vent2 {name="Vent2";sound[]={"ATM_airdrop\data\Vent2.ogg",db-11,1.0};titles[] = {};}; class Para {name ="Para";sound[]={"ATM_airdrop\data\parachute.ogg",db-11,1.0};titles[] = {};}; };

    Or something like that? Long shot but I'd do a backup and try it until a scripter gets in here. :)

    That should work I think, all you're doing is defining the sounds so this combination should be fine..

  10. Yeah, for missions, you cannot double-define config entries such as CfgSounds and CfgFunctions. You will have to combine the entries.

    class CfgSounds {
    	sounds[] = {prayer,Vent,Vent2,Para};
    
    	//-- Call to prayer
    	class prayer {
    		name = "prayer";
    		sound[] = {"CalltoPrayer\sounds\prayer.ogg", db+1, 1};
    		titles[] = {};
    	};
    
    	// ATM AirDrop
    	class Vent {name="Vent";sound[]={"ATM_airdrop\data\Vent.ogg",db-11,1.0};titles[] = {};};
    	class Vent2 {name="Vent2";sound[]={"ATM_airdrop\data\Vent2.ogg",db-11,1.0};titles[] = {};};
    	class Para {name ="Para";sound[]={"ATM_airdrop\data\parachute.ogg",db-11,1.0};titles[] = {};};	
    };
  11. Edited 8 years ago by HeroesandvillainsOS

    Ah! Cool. So not just sort of combined but REALLY combined, I see. This doesn't bode well for me to getting Autigergrad's sound pack working with the Call to Prayer script. :(

    I'll have to ask AA to share his description.ext. :)

  12. Thanks for the help guys! Great community here.

  13. @HeroesandvillainsOS  Ah! Cool. So not just sort of combined but REALLY combined, I see. This doesn't bode well for me to getting Autigergrad's sound pack working with the Call to Prayer script. :(

    I'll have to ask AA to share his description.ext. :)

    It works fine.

    My sounds are defined as sfx sounds, Call to prayer is defined as actual "sound", two completely different categories.

    Look at the Description.ext I provided in my ambient sounds pack. all you have to do is copy and paste the description.ext with the call to Prayer add on into that same description.ext so you'll have both the cfg SFX and cfg Sounds in one description.ext. That's it. You'll also want to make sure the actual sounds are in the mission as well of course.

  14. @AUTigerGrad It works fine.

    My sounds are defined as sfx sounds, Call to prayer is defined as actual "sound", two completely different categories.

    Look at the Description.ext I provided in my ambient sounds pack. all you have to do is copy and paste the description.ext with the call to Prayer add on into that same description.ext so you'll have both the cfg SFX and cfg Sounds in one description.ext. That's it. You'll also want to make sure the actual sounds are in the mission as well of course.

    Oh ok. So in this instance I can have their respective entries written individually in the description.ext I take it then? That's good. The easier the better. :)

  15. Edited 8 years ago by AUTigerGrad

    My sounds are 3D sounds...they are not Cfg Sounds. I'm not staring at my description.ext right now but I think it's CFG sfx or something like that.

    You're just pasting on the Cfg sounds portion for the call to prayer to the Cfg SFX. Should work fine.

  16. If it looks different than this:

    class CfgSounds {
    	sounds[] = {prayer};
    	class prayer {
    		name = "prayer";
    		sound[] = {"CalltoPrayer\sounds\prayer.ogg", db+1, 1};
    		titles[] = {};
    	};
    
    *Your sounds pack stuff here

    So like literally just placing them back to back like any other description.ext entry, could you post your description.ext back here?

  17. Correct. Back to back

  18. Anybody know how to alter the following script to only pick up designated markers or gamelogics?
    (This is the modified function originally written by Sacha, extracted from ALiVE Insurgency redux).

    CalltoPrayer_fnc_getCities = {
    	private ["_locations","_cityTypes","_randomLoc","_x","_cities"];
    	_cities = [];
    
    	_locations = configfile >> "CfgWorlds" >> worldName >> "Names";
    	_cityTypes = ["NameVillage","NameCity","NameCityCapital","NameLocal"];
    
    	for "_x" from 0 to (count _locations - 1) do {
    		_randomLoc = _locations select _x;
    
    		private["_cityPos","_cityType"];
    		_cityPos = getArray(_randomLoc >> "position");
    		_cityType = getText(_randomLoc >> "type");
    		if (_cityType in _cityTypes) then {
    			_cities pushBack [ _cityPos];
    		};
    	};
    	_cities;
    };

    Hoping to get the call to prayer working on FATA by getting this script to return marker positions set on minarets (which I will make a template for). Or alternatively, is there an easy way to make this return minaret locations (configfile >> "CfgVehicles" >> "CUP_A2_minaret_ep1")?

  19. Edited 8 years ago by SpyderBlack723

    Replace your CallToPrayer\init.sqf file with this code

    if !(isServer) exitWith {};
    
    _CalltoPrayerDebug = false;
    _functions = execVM "CallToPrayer\functions.sqf";
    waitUntil {scriptDone _functions};
    
    //-- Get cities
    _cities = [] call CalltoPrayer_fnc_getCities;
    
    CalltoPrayerLoudspeakers = [];
    {
    	_cityPos = _x select 0;
    
    	{
    		_pole = "Land_Loudspeakers_F" createVehicle (getPosATL _x);
    		CalltoPrayerLoudspeakers pushBack _pole;
    
    		if (_CalltoPrayerDebug) then {
    			_n = format["%1", floor (random 1000)];
    			_marker = createMarker [_n, _spawnPos];
    			_marker setMarkerShape "ICON";
    			_marker setMarkerType "mil_dot";
    			_marker setMarkerText "CTP loudspeaker";
    		};
    	} foreach (nearestobjects [_cityPos, INS_CTPLOCATIONS, 600]);
    } forEach _cities;
    
    [] call CalltoPrayer_fnc_prayerLoop;

    And then in your standard init.sqf (one that is executed automatically in each mission), simply define
    INS_CTPLOCATIONS = ["CUP_A2_minaret_ep1"];

  20. Damn, just forgot FATA has no cities defined.. I'll make another modification real quick

  21. Edited 8 years ago by SpyderBlack723

    Ok, then just replace the function you posted with this

    CalltoPrayer_fnc_getCities = {
    	private ["_locations","_cityTypes","_randomLoc","_x","_cities"];
    	_cities = [];
    
    	_locations = configfile >> "CfgWorlds" >> worldName >> "Names";
    	_cityTypes = ["NameVillage","NameCity","NameCityCapital","NameLocal"];
    
    	for "_x" from 0 to (count _locations - 1) do {
    		_randomLoc = _locations select _x;
    
    		private["_cityPos","_cityType"];
    		_cityPos = getArray(_randomLoc >> "position");
    		_cityType = getText(_randomLoc >> "type");
    		if (_cityType in _cityTypes) then {
    			_cities pushback [_cityPos];
    		};
    	};
    
    	{_cities pushback (getmarkerpos _x)} foreach INS_CTPMARKERS;
    	_cities;
    };

    Then place markers (icons, not rectangles/ellipses) on each of the cities that you want CTP to look for nearby INS_CTPLOCATIONS. After that, go back to your init.sqf where you defined INS_CTPLOCATIONS and define

    INS_CTPMARKERS = ["markername1","markername2","markername3"];

    Remember to put quotes around each marker name and separate them with a comma.

    Another quick thing to keep in mind, define these INS_x variables BEFORE you call the initialization function.

    So, to be safe, define these variables at the very top of your init.sqf

  22. Newer ›
 

or Sign Up to reply!