mrmoon 19 Posted January 14, 2012 Ok so I have a squad all with custom faces issued via setface command but when I reload the game they are all random default bis faces. Any way round this? Share this post Link to post Share on other sites
Pulverizer 1 Posted January 15, 2012 Could you use identities defined in description.ext instead? Like so: class CfgIdentities { class Officer { name = "James Abrams"; face = "Face33"; glasses = "none"; speaker = "Adam"; pitch = 1.00; }; class Commander { name = "John Peterson"; face = "Face2"; glasses = "none"; speaker = "Adam"; pitch = 1.00; }; }; this setIdentity "Commander"; Share this post Link to post Share on other sites
mrmoon 19 Posted January 15, 2012 Yeah I thought about that but would having 200 or so setidentity commands be a good idea? Share this post Link to post Share on other sites
nikiller 18 Posted January 15, 2012 hi, Do you use setFace command in the unit's init field? cya. Nikiller. Share this post Link to post Share on other sites
rellikki 7 Posted January 15, 2012 You need to have a constant script running in the mission checking the passed time. In init.sqs type the following: #loop ? time < 2 : goto "setface" ~1 goto "loop" #setface unit1 setFace "faceX" goto "loop" This would reset the selected face back to unit1 every time the mission is loaded. You need to do that to every unit. Share this post Link to post Share on other sites
nikiller 18 Posted January 15, 2012 (edited) hi, You need to have a constant script running in the mission checking the passed time. In init.sqs type the following: #loop ? time < 2 : goto "setface" ~1 goto "loop" #setface unit1 setFace "faceX" goto "loop" This would reset the selected face back to unit1 every time the mission is loaded. You need to do that to every unit. Thanks for the tips Rellikki. I never learned SP scripting especially the saveGame, saveVar, saveIdentity stuffs. Somebody could guide me to a complete tuorial since I'm working on SP campaign. (sorry for pirating the topic) EDIT: nvm I found what I need in OFPEC. cya. Nikiller. Edited January 15, 2012 by Nikiller Share this post Link to post Share on other sites
mrmoon 19 Posted January 16, 2012 Hmm yeah this could work thanks, might slow down the mission though it is a huge one after all. Share this post Link to post Share on other sites
Pulverizer 1 Posted January 17, 2012 It's a good practice to use iterators, like conditional loop with a counter or the forEach command, for such repetitive tasks, so you can do with only one script instead of 200 hundred copies of the same thing running. ForEach will block other execution so it's best to use it for light tasks, or initialization that only happen once. Why do you need 200 faces? Are the faces random, or all the same face or what? Share this post Link to post Share on other sites
nikiller 18 Posted January 17, 2012 (edited) hi, Hmm yeah this could work thanks, might slow down the mission though it is a huge one after all. For big missions, you should use a spawn manager. It fragments the mission init since all the AI are not initialized at the same time. Moreover, it decreases the mission.sqm size making the mission faster to load. Having a lot of scripts executed at the same time and running in parallele is never good. Better to use use a random delay (i.e: ~1+random 1) Init fields in sqm is good when you need very fast execution like moveInCargo a lot of units in a BMP who is in the sea. Like that it avoids that some units are not loaded (especially in MP). I is also good to give name to a group. That's why I asked you if you setFace your units in their init field. When you start the game and load the mission it works since element are not loaded in RAM yet. But when you load the mission another time, setFace in the init field is faster and is overwriten by the default config.cpp random face system who seems executed few microseconds later. That's why Rellikki made a loop to check if the mission has started. I think that just execute a set face script from the init.sqs should be enough since stuffs in the init are only executed when the mission starts. If you are lazy (like me) here's a trick to execute a script for a lot of units without repeating the same thing over and over. init.sqs ;********************** ;Init Script by Nikiller ;Contact: nikillerofp@hotmail.fr ;********************** _allgrplist = [grp1,grp2,grp3,grp4,grp5,grp6] _all_ar=[] {_all_ar=_all_ar+(units _x)} forEach _allgrplist {[_x] exec "whateverscript.sqs"} forEach _all_ar exit Give a name to each groups (MyGroupName=group this in each leader's init field). Copy this script in your init.sqs, change the group name array by your own groups name and change whateverscript.sqs by your setFace script name. I suggest you this setFace script. cya. Nikiller. Edited January 17, 2012 by Nikiller Share this post Link to post Share on other sites
mrmoon 19 Posted January 19, 2012 Thanks for the help guys for now Im using the set face loop as it doesnt seem to be slowing things down that much despite the very long script. I need the 200 faces because the mission is set in iran and its quite long requiring an occasional reload, I tried doing it without but the iranian soldiers and civilians just look terrible with bis white faces. Share this post Link to post Share on other sites