Jump to content

swift39

Member
  • Content Count

    27
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

1 Follower

About swift39

  • Rank
    Private First Class

Recent Profile Visitors

844 profile views
  1. Thank you... It turned out it was a bad .ogg file. I had built and rebuilt a couple times earlier with Audacity but after your post rebuilt in same then saved as mp3 file. then ran it through dBpoweramp for the conversion for the file to .ogg and now works fine. I feel like a bit of an idiot chasing posts now. Anyway lessoned learned and thank you all again. Cheers Greg Yeah +50 is a bit loud, in my desperation I cranked it up just in case it was being drowned out. Its down now...
  2. Thanks for the reply. Yes, I tried playMusic with the same result. I am wishing to pursue playSound because I found in some of the forums it has no distance limitations, and bypasses the music volume which everyone has turned down, but haven't been able to confirm it yet. Cheers Greg
  3. Hello All, I spent most of the day trying to get a music to play in an intro I am playing with. Scouring the forums and google, I have tried what I think is almost everything and yet completely missing something. I am using Alias Intro script which is easy to use by the way. but cannot get a piece of music file to play at all. I would like to use "playSound" as during my mission to find the solution I read that this play across the map and does not have a distance limit. the intro.sqf // Original script and functions created by Alias from aliascartoons and all credit goes to him // nul = [JIP] execVM "AL_intro\intro.sqf"; waitUntil {time > 0}; _jip_enable = _this select 0; [[_jip_enable],"TWR_intro\time_srv.sqf"] remoteExec ["execVM"]; waitUntil {!isNil "curr_time"}; if (!hasInterface) exitWith {}; if ((!curr_time) or (_jip_enable<0)) then { playSound "sum41_war"; loopdone = false; while {!loopdone} do { // INSERT CAMERA SHOTS BELOW ______________________________________________________________________________ _1stshot = [cam1, cam1, target0, 20, 2.0, 2.0, true, 0, -6, 3, true] execVM "TWR_intro\camera_work.sqf"; cutText ["<t color='#FFFFFF' size='5'>TOWERGAMES PRESENTS</t>", "BLACK IN", 15, true, true]; waitUntil {scriptdone _1stshot}; ......... The description.ext class CfgSounds { sounds[] = {sum41_war}; class sum41_war { name = "sum41_war"; sound[] = {"\sound\sum41_war.ogg", db+50, 1}; titles[] = {}; }; }; From what I read it should be this simple, but obvisouly am missing something. the file is 3 mb, could that be the issue? Any suggestion or comments greatly appreciated. Cheers Greg
  4. Thanks to you both, I was overthinking this I just had to place the getDir before disableAI and it works fine or as well as the AI will let you. Cheers Greg orgPos = getDir _x; _x disableAI "ANIM"; _x setDir _dir; _x lookAt _official;
  5. Just a quick question... Is there a way after setting a new direction of AI to return to their original position? I am using getDirVisual for an official they turn and face as he walks by _dir = getDirVisual _official; //Find the direction of the official then execute it _x disableAI "ANIM"; _x setDir _dir; _x lookAt _official; which works, but when released from the script they continue their animation in the "new" direction which is messing things up. What I would like to do is save the AI's original position then change direction during the script, then upon completion return to original direction and animation. Hope this makes sense Cheers Greg
  6. Thanks, that seems to do the trick.
  7. Hello Is there a way to Blacklist traffic like you have done in Civilians? I like the randomness of your work and definitely adds to missions a bit of realism. It would be nice to have no traffic in a couple select areas, as it tends to reek havoc in a military compound in a mission I am trying to build. Thanks for any suggestions. Cheers Greg
  8. Thank you very much for your consideration. I am looking for a guide explaining the differences and have read Fockers Arma 3 Scripting Guide, but doesn't touch dedicated. I will continue to read forums and hopefully come to some understanding of the main or key differences when it comes to this segment. Although I don't understand it would require such a different approach from multi-player. Anyways thank you for your assistance and take care Cheers Greg
  9. Ok so yesterday I had everything working in GOM's script on SP and the EDEN MP. Placed it on the Dedicated server and it fell down. Assuming this is right... //inits the protesters sqf _init = [] execVM "scripts\GOM\GOM_fnc_armedProtesters.sqf"; //this initializes all functions within the .sqf file waitUntil {scriptDone _init}; _initProtesters = [] spawn GOM_fnc_armedProtestersInit; _attack = player addEventHandler ["FiredNear", { [10] spawn GOM_fnc_armedProtestersAttack; //starts the attack with amount of attackers as param, defaults to 5 if no number is given player removeEventHandler ["FiredNear", _thisEventHandler]; }] remoteExec ["_attack", 0]; I am at a complete loss as to how to adapt GOM's script to function on a dedicated server. Mainly I am just getting confused. I have tried a few techniques, i.e placing it in the Serverinit.sqf and such but to no avail. Any suggestions or an explanation on how to script this for dedicated server, the steps to be followed and such would be greatly appreciated. I apologize in advance for lack of understanding with this, but am just trying figure this out. Cheers Greg
  10. Ok so I believe I am making some progress. First thank you to XianGrim.... The Helipad linked to the Protester script works great, then adding a sleep and delete vehicle gives the scene a little realism, well I think anyway.... I will post the script later. I think I am slowly understanding the remoteExec application, but am having some difficulty with errors... GOM's script init //inits the protesters sqf _init = [] execVM "scripts\GOM\GOM_fnc_armedProtesters.sqf"; //this initializes all functions within the .sqf file waitUntil {scriptDone _init}; _initProtesters = [] spawn GOM_fnc_armedProtestersInit; _attack = player addEventHandler ["FiredNear", { [10] spawn GOM_fnc_armedProtestersAttack; //starts the attack with amount of attackers as param, defaults to 5 if no number is given player removeEventHandler ["FiredNear", _thisEventHandler]; }] remoteExec ["call", 0]; My script init (AKA AZCoder's work) //inits the civilian protesters sqf _init = [] execVM "scripts\TWR\TWR_fnc_protestanim.sqf"; //this initializes all functions within the .sqf file waitUntil {scriptDone _init}; _initProtesters = [] spawn TWR_fnc_ProtesterInit; _flee = player addEventHandler ["FiredNear", { [] spawn TWR_fnc_ProtesterRelease; player removeEventHandler ["FiredNear", _thisEventHandler]; }]remoteExec ["call", 0]; While the script seems to run and for the most part work, although in my script it seems to work intermittently. I get this error '[#]call (_this)' Error _call: Type Number, expected code My understanding is when 0, the function or command will be executed globally. Confusing... Like I stated yesterday the purpose of the two scripts is just me learning, but also I am thinking having Mine/AZCoder script to have civilians protest (the Bulk of them) then when firedNear they do what civilians do and then Have GOM's script (a realistic amount) provide the armed civilians to continue the Riot. Anyway thanks for the interest and will continue to sort this out. Suggestions, Comments or feedback always welcome Cheers Greg *****UPDATE****** Ok I am feeling a little stupid right now and assuming this is right, because it removed the scripting errors, but this worked: //inits the protesters sqf _init = [] execVM "scripts\GOM\GOM_fnc_armedProtesters.sqf"; //this initializes all functions within the .sqf file waitUntil {scriptDone _init}; _initProtesters = [] spawn GOM_fnc_armedProtestersInit; _attack = player addEventHandler ["FiredNear", { [10] spawn GOM_fnc_armedProtestersAttack; //starts the attack with amount of attackers as param, defaults to 5 if no number is given player removeEventHandler ["FiredNear", _thisEventHandler]; }] remoteExec ["_attack", 0]; //inits the civilian protesters sqf _init = [] execVM "scripts\TWR\TWR_fnc_protestanim.sqf"; //this initializes all functions within the .sqf file waitUntil {scriptDone _init}; _initProtesters = [] spawn TWR_fnc_ProtesterInit; _flee = player addEventHandler ["FiredNear", { [] spawn TWR_fnc_ProtesterRelease; player removeEventHandler ["FiredNear", _thisEventHandler]; }]remoteExec ["_flee", 0]; The only thing left is to get my script to release the civilians when shots are fired. Cheers Greg
  11. So finally having sometime to get back on this little excursion, I have spent the morning sorting everything out that has been provided to date. I decided I would create a script using AZCoder's script and with a "few suggestions" from GOM mainly to understand the principles of functions and the process of there is always more than one way to achieve the same results when it comes to coding. I also figured having a script in the tool box that provided animation loops then when triggered the AI carry on there merry way could never hurt. so with AZCoder's animation script I came up with this: AI Init this setVariable ["TWR_fnc_ProtesterAnim",true,true]; the Init.sqf //inits the civilian protesters sqf _init = [] execVM "scripts\TWR\TWR_fnc_protestanim.sqf";//this initializes all functions within the .sqf file waitUntil {scriptDone _init}; _initProtesters = [] spawn TWR_fnc_ProtesterInit; _flee = player addEventHandler ["FiredNear", { player remoteExec [[] spawn TWR_fnc_ProtesterRelease]; player removeEventHandler ["FiredNear", _thisEventHandler]; }]; As I am sure, most have figured out the remoteExec is not in the right place or written wrong, because I am getting a scripting error. I am still sorting this out becuase I really dont know the "proper" approach. To me this makes sense to have the remoteExec command fire in the init.sqf, to ensure all players receive it on their respective systems. I am still reading up on this and will welcome a sure fire way to make this command work properly or an explanation on how this works. The .sqf TWR_fnc_ProtesterInit = { _Protesters = allUnits select {_x getVariable ["TWR_fnc_ProtesterAnim", false]}; //Random Animations for loop #define __RandomAnimation (["UnaErcVelitelProslov4", "c7a_bravo_dovadeni1", "shaftoe_c0briefing_otazky_loop6", "c7a_bravo_dovadeni3"] call BIS_fnc_selectRandom); //grab all usable civilian classes, needed to randomize loadout in the forEach loop _rndCivClasses = ("getNumber (_x >> 'side') isEqualTo 3 AND configName _x isKindOf 'Man' AND getNumber (_x >> 'scope') >= 2" configClasses (configFile >> "CfgVehicles")) apply {configName _x}; { _dir = getDir _x; //get and set random loadout _rndLoadout = getUnitLoadout selectRandom _rndCivClasses; _x setUnitLoadout _rndLoadout; _x switchMove "";//to skip weapon holster animation after weapon removal _x doWatch (_x getRelPos [50,_dir]);//reset watch direction after group change // AI prevented to move or change behavior. _x disableAI "ALL"; _x stop true; _x setBehaviour "CARELESS"; //Disable Animation and Set AI direction to South. sleep 0.1; _dirToFace = [_x, player] call BIS_fnc_dirTo; _x disableAI "ANIM"; _x setFormDir _dirToFace; _x setDir _dirToFace; //AI animation is selected randomly and started _x switchMove __RandomAnimation; //AI animation is looped and randomly changed _animLoop = _x addEventHandler ["AnimDone", { _x = _this select 0; _x switchMove __RandomAnimation; }]; _x setVariable [ "animLoop", _animLoop, true ]; //Protest Chant //playSound ["fx_protest1", 30] remoteExec ["say3D", 0]; }forEach _Protesters; }; TWR_fnc_ProtesterRelease = { _Protesters = allUnits select {_x getVariable ["TWR_fnc_ProtesterAnim", false]}; { //Stop animation _animLoop = _x getVariable "animLoop"; _x removeEventHandler ["AnimDone",_animLoop]; //Release AI from current state _x enableAI "ALL"; _x stop false; _x switchMove ""; }forEach _Protesters; }; true; The first function seems to work well with no noted issues yet. The second function (Release Function) not so much, well it seems to release the AI it appears they go back to the animation loop after a few seconds. I am thinking it is in the Stop Animation lines, but having some difficulty figuring out how to ensure this will indeed stop the loop because the variable is in the first function. //Stop animation _animLoop = _x getVariable "animLoop"; _x removeEventHandler ["AnimDone",_animLoop]; Grumpy Old Mans Script AI Init this setVariable ["GOM_fnc_potentialArmedProtester",true,true]; Init.sqf _attack = player addEventHandler ["FiredNear", { player remoteExec [[10] spawn GOM_fnc_armedProtestersAttack];//starts the attack with amount of attackers as param, defaults to 5 if no number is given player removeEventHandler ["FiredNear", _thisEventHandler]; }]; without the remoteExec portion this works well thank you GOM. Otherwise it is the same as above with regards to scripting error. GOM's .sqf No changes and works flawlessly. Thank you again. So that is were this at and welcome any suggestions, comments or guidance... Cheers Greg
  12. Thank You... I am away with work for a couple days so will switch it over when I get home. When you say it should work fine in SP is that a typo or do I need to script different for MP? Anyway thank you again everyone, I am enjoying the learning process and will post my results when I get home mid week. Cheers Greg
  13. Again thanks and I think I have this working the way I envisioned it. With regards to the Undefined variable, I have no clue... Was trying some recommended fixes, got the point of where I was forgetting what was tried and changed, Restarted Arma with a fresh copy of the sqf. and it went away. Don't know what to think about that. To have the Protesters attack when fired near I put this in the init.sqf and it works //inits the protesters sqf _init = [] execVM "scripts\GOM\GOM_fnc_armedProtesters.sqf";//this initializes all functions within the .sqf file waitUntil {scriptDone _init}; _initProtesters = [] spawn GOM_fnc_armedProtestersInit; _attack = player addEventHandler ["FiredNear", {[10] spawn GOM_fnc_armedProtestersAttack; }]; changing GOM's From This _attack = [] spawn { sleep 60;//delay or condition for the attack to happen [10] spawn GOM_fnc_armedProtestersAttack;//starts the attack with amount of attackers as param, defaults to 5 if no number is given }; To This _attack = player addEventHandler ["FiredNear", {[10] spawn GOM_fnc_armedProtestersAttack; }]; It seems to work, but was wondering if there was a better or preferred method when it comes to initiating this or is this method going to create issues later. Thanks Greg
  14. Wow... Thank You that is exactly what I was looking for (in my mind), though I would of never of thought of it. The randomization of everything is nothing short of awesome. Your demo mission worked flawlessly, of course, when placed into my mission I am getting a Undefined variable in expression _x Which has me a bit confused as I have not changed anything, but will sort it out. As this scenario is triggered by a player firing their weapon, would it be more efficient to have the addEventHandler in the init.sqf or the armedProtester,sqf? or create a trigger? Anyway, thanks you all and will post results as I sort them out. Cheers, Greg
  15. Thank you AZCoder... I was on my way to bed when it seemed we posted at the same time. The animation loop works and looks good. I have modified the script a bit and seems that I have one last hurdle to overcome, which tomorrow is a new day. the script now seems to work to this point. //Make Civilians Enemy if ((handgunWeapon _civ) isEqualTo true) then { [_civ] joinSilent createGroup sideEnemy; _civ addRating -10000; _civ allowFleeing 0; _civ setSkill ["courage", 1]; _civ reveal [player, 3.75]; _civ setBehaviour "COMBAT"; _civ setCombatMode "RED"; }; }]; I just started manipulating this, but am out of gas. The plan (now, after reading posts and gathering ideas) is to have any armed civilians become rogue and attack both Blufor and Civilians when the EH is triggered. The plan for the mission would be they players will have to eliminate the rogue mob while keeping civilian casualties to a minimum. throw in a couple suicide bombers and things could get interesting. Again thank you for the assistance and next time I am in Washington State I owe you a beer or six. The latest full version of the script #define __RandomAnimation (["UnaErcVelitelProslov4", "c7a_bravo_dovadeni1", "shaftoe_c0briefing_otazky_loop6", "c7a_bravo_dovadeni3"] call BIS_fnc_selectRandom); { _civ = _x; _civ setBehaviour "CARELESS"; // AI prevented to move or change behavior. _civ disableAI "PATH"; _civ disableAI "MOVE"; _civ stop true; //Disable Animation and Set AI direction to South. sleep 0.1; _dirToFace = [_civ, player] call BIS_fnc_dirTo; _civ disableAI "ANIM"; _civ setFormDir _dirToFace; _civ setDir _dirToFace; //AI animation is selected randomly and started _civ switchMove __RandomAnimation; //AI animation is looped and randomly changed _animLoop = _civ addEventHandler ["AnimDone", { _civ = _this select 0; _civ switchMove __RandomAnimation; }]; _civ setVariable [ "animLoop", _animLoop, true ]; //Protest Chant [ProtesterA_1, ["fx_protest1", 30, 1]] remoteExec ["say3D", 0]; // Combat Mode, Randomly selects weapons for Civilians _civ addEventHandler ["FiredNear", { _civ = _this select 0; //Stop animation _animLoop = _civ getVariable "animLoop"; _civ removeEventHandler ["AnimDone",_animLoop]; //Release AI from current state _civ enableAI "ALL"; _civ stop false; _civ switchMove ""; //Randomize and add weapons _weapon = selectRandom ["hgun_ACPC2_F", "", "hgun_P07_F", "hgun_P07_F", "", "hgun_Rook40_F"]; _mag = selectRandom (getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines")); _civ addMagazine _mag; _civ addWeapon _weapon; //Make Civilians Enemy if ((handgunWeapon _civ) isEqualTo true) then { [_civ] joinSilent createGroup sideEnemy; _civ addRating -10000; _civ allowFleeing 0; _civ setSkill ["courage", 1]; _civ reveal [player, 3.75]; _civ setBehaviour "COMBAT"; _civ setCombatMode "RED"; }; }]; } forEach [ProtesterA_1, ProtesterA_2, ProtesterA_3, ProtesterA_4, ProtesterA_5]; Cheers Greg
×