denzo 47 Posted April 5, 2015 Hey all, Ive got this script Im trying to use to change the players operational load-out. The idea was to use an addaction command to remove everything, refill inventory with new gear then remove the addaction. I wanted to fade to a black screen for a few seconds while the script does its thing, then to fade back in. This is what I have so far: comment "Remove existing items"; titlecut ["","black out",2] ~2 removeAllWeapons a1; removeAllItems a1; removeAllAssignedItems a1; removeUniform a1; removeVest a1; removeBackpack a1; removeHeadgear a1; removeGoggles a1; comment "Add containers"; a1 forceAddUniform "U_B_GhillieSuit"; for "_i" from 1 to 2 do {a1 addItemToUniform "FirstAidKit";}; a1 addItemToUniform "acc_flashlight"; a1 addItemToUniform "SmokeShell"; a1 addItemToUniform "7Rnd_408_Mag"; a1 addItemToUniform "HandGrenade"; a1 addVest "V_Chestrig_khk"; for "_i" from 1 to 2 do {a1 addItemToVest "FirstAidKit";}; for "_i" from 1 to 5 do {a1 addItemToVest "7Rnd_408_Mag";}; for "_i" from 1 to 3 do {a1 addItemToVest "15Rnd_mas_9x21_Mag";}; for "_i" from 1 to 2 do {a1 addItemToVest "HandGrenade";}; a1 addItemToVest "ClaymoreDirectionalMine_Remote_Mag"; a1 addBackpack "B_AssaultPack_khk"; for "_i" from 1 to 2 do {a1 addItemToBackpack "FirstAidKit";}; for "_i" from 1 to 4 do {a1 addItemToBackpack "7Rnd_408_Mag";}; for "_i" from 1 to 3 do {a1 addItemToBackpack "15Rnd_mas_9x21_Mag";}; for "_i" from 1 to 4 do {a1 addItemToBackpack "HandGrenade";}; a1 addItemToBackpack "ClaymoreDirectionalMine_Remote_Mag"; a1 addGoggles "G_mas_wpn_bala_t"; comment "Add weapons"; a1 addWeapon "srifle_LRR_F"; a1 addPrimaryWeaponItem "optic_Nightstalker"; a1 addWeapon "hgun_mas_grach_F_sd"; a1 addHandgunItem "muzzle_mas_snds_LM"; a1 addWeapon "Rangefinder"; comment "Add items"; a1 linkItem "ItemMap"; a1 linkItem "ItemCompass"; a1 linkItem "ItemWatch"; a1 linkItem "ItemRadio"; a1 linkItem "ItemGPS"; a1 linkItem "NVGoggles_mas_h"; comment "Set identity"; a1 setFace "WhiteHead_14"; a1 setSpeaker "Male02ENG"; a1 removeaction "change" ~2 titlecut ["","black in",2] So, the script works fine without the titlecuts but I cant seem to make it work with them. Any ideas? Any help is greatly appreciated as Ive been out the game for a while and not terribly familiar with .sqf Thank you in advance, Denz Share this post Link to post Share on other sites
jshock 513 Posted April 5, 2015 Um, not sure what the "~2" are? But your also missing ";" after your title cut lines. Share this post Link to post Share on other sites
Greenfist 1863 Posted April 5, 2015 Um, not sure what the "~2" are? But your also missing ";" after your title cut lines. That's a sleep for 2 sec. And the ; is not needed in the SQS. This should be in SQF syntax I guess. Share this post Link to post Share on other sites
jshock 513 Posted April 5, 2015 That's a sleep for 2 sec. And the ; is not needed in the SQS.This should be in SQF syntax I guess. Hm, never seen that syntax before :p. And the following may be of interest: https://community.bistudio.com/wiki/BIS_fnc_fadeEffect Share this post Link to post Share on other sites
denzo 47 Posted April 5, 2015 (edited) Thank you for the quick replies! The script is saved as a .SQF file. The ~2 is me and my old habbits... Ive replaced it with Sleep 0.5 Ok, so after adding ; to the end of my titlecut it did work but it now wont fade back in! Edited April 5, 2015 by Denzo Share this post Link to post Share on other sites
Greenfist 1863 Posted April 5, 2015 Hm, never seen that syntax before :p. It's an older code, sir, but it checks out. Thank you for the quick replies! The script is saved as a .SQF file. The ~2 is me and my old habbits... Ive replaced it with Sleep 0.5Ok, so after adding ; to the end of my titlecut it did work but it now wont fade back in! Sounds like the code halts before the end. Missed the ; and sleep there, perhaps? Share this post Link to post Share on other sites
denzo 47 Posted April 5, 2015 I learned .SQS back in the Flashpoint days :P Okay, I have updated the script: Titletext ["","black out",0]; sleep 2; comment "Remove existing items"; removeAllWeapons a1; removeAllItems a1; removeAllAssignedItems a1; removeUniform a1; removeVest a1; removeBackpack a1; removeHeadgear a1; removeGoggles a1; comment "Add containers"; a1 forceAddUniform "U_B_GhillieSuit"; for "_i" from 1 to 2 do {a1 addItemToUniform "FirstAidKit";}; a1 addItemToUniform "acc_flashlight"; a1 addItemToUniform "SmokeShell"; a1 addItemToUniform "7Rnd_408_Mag"; a1 addItemToUniform "HandGrenade"; a1 addVest "V_Chestrig_khk"; for "_i" from 1 to 2 do {a1 addItemToVest "FirstAidKit";}; for "_i" from 1 to 5 do {a1 addItemToVest "7Rnd_408_Mag";}; for "_i" from 1 to 3 do {a1 addItemToVest "15Rnd_mas_9x21_Mag";}; for "_i" from 1 to 2 do {a1 addItemToVest "HandGrenade";}; a1 addItemToVest "ClaymoreDirectionalMine_Remote_Mag"; a1 addBackpack "B_AssaultPack_khk"; for "_i" from 1 to 2 do {a1 addItemToBackpack "FirstAidKit";}; for "_i" from 1 to 4 do {a1 addItemToBackpack "7Rnd_408_Mag";}; for "_i" from 1 to 3 do {a1 addItemToBackpack "15Rnd_mas_9x21_Mag";}; for "_i" from 1 to 4 do {a1 addItemToBackpack "HandGrenade";}; a1 addItemToBackpack "ClaymoreDirectionalMine_Remote_Mag"; a1 addGoggles "G_mas_wpn_bala_t"; comment "Add weapons"; a1 addWeapon "srifle_LRR_F"; a1 addPrimaryWeaponItem "optic_Nightstalker"; a1 addWeapon "hgun_mas_grach_F_sd"; a1 addHandgunItem "muzzle_mas_snds_LM"; a1 addWeapon "Rangefinder"; comment "Add items"; a1 linkItem "ItemMap"; a1 linkItem "ItemCompass"; a1 linkItem "ItemWatch"; a1 linkItem "ItemRadio"; a1 linkItem "ItemGPS"; a1 linkItem "NVGoggles_mas_h"; comment "Set identity"; a1 setFace "WhiteHead_14"; a1 setSpeaker "Male02ENG"; a1 removeaction 0; sleep 2; TitleText ["","black in"0]; ...Still cant figure out what is stopping it Share this post Link to post Share on other sites
jshock 513 Posted April 5, 2015 Maybe the removeAction? Try: a1 removeAction (_this select 2); If all this code is ran inside the addAction. Nvm, Greenfist should have the solution below :p. Share this post Link to post Share on other sites
Greenfist 1863 Posted April 5, 2015 Missing , TitleText ["","black in",0]; Share this post Link to post Share on other sites
denzo 47 Posted April 5, 2015 (edited) Ya, I just saw it! Will try and let you guys know. Edited April 5, 2015 by Denzo Share this post Link to post Share on other sites
jshock 513 Posted April 5, 2015 Greenfist Its right down the bottom buddy ;) He is saying you missed a comma "," Share this post Link to post Share on other sites
Greenfist 1863 Posted April 5, 2015 Rgr, will the remove the addaction Jshock and let you know.Greenfist Its right down the bottom buddy ;) Well, your copied code is missing a comma between the quote and zero. Maybe you should use the startup parameter -showscripterrors and the game might notify you of these kind of errors. :D Share this post Link to post Share on other sites
denzo 47 Posted April 5, 2015 Sadly that didn't do the trick... So it fades out okay, swaps the gear okay but wont fade back in... Greenfist I didn't even know about that command! Will give it a bash ---------- Post added at 21:55 ---------- Previous post was at 21:45 ---------- Thank you both Greenfist and JShock. I got it working thanks to the -showscripterrors. Brilliant lads :) Will send you a wee message once I've finished making the mission, let you both try it out! Share this post Link to post Share on other sites