dragunov90 0 Posted July 11, 2007 Hi I would love too have a enemy counter in my missions so that i know how many enemies there are left, would someone please help me with this one? Share this post Link to post Share on other sites
Taurus 20 Posted July 11, 2007 example Define a variable in your init-file or init of any unit. CounterSpam = true; Create a trigger, set it to cover your battlefield Side: OPFOR, repeatedly Timeout: min: 3, max: 0, mid: 0 (if you want it to wait 3 seconds between the updates. Cond: CounterSpam OnAct:CounterSpam=false;hint format ["%1 enemie(s) left!",count thisList]; OnDeA: CounterSpam = true [edit] OR, the more performance-wise. Side: OPFOR, once Cond: this OnAct:nil = thisList execVM "mySpamCounter.sqf"; mySpamCounter.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _triggerList = _this; while{true} do{ hint format ["%1 enemie(s) left!",count _triggerList]; sleep 3; }; [edit] Edited missing stuff in second example. [edit2] Argh forgot the end tag for Share this post Link to post Share on other sites
dragunov90 0 Posted July 12, 2007 The second possibility doesn't work. OnAct:thisList execVM "mySpamCounter.sqf"; Whn I put that inte the activation field it says type script expected or nothing???? What's wrong Share this post Link to post Share on other sites
Taurus 20 Posted July 12, 2007 my bad, typo nil = thisList execVM "mySpamCounter.sqf"; Sorry. Share this post Link to post Share on other sites
dragunov90 0 Posted July 12, 2007 Thank you ;P By the way, do you know some good tutorials in order to make cutscenes, have never done one Share this post Link to post Share on other sites
zaphod 0 Posted July 12, 2007 try this link: OFPEC Camera tutorials Share this post Link to post Share on other sites
dragunov90 0 Posted July 16, 2007 The more performance wise method This goes in the trigger: Side: OPFOR, once Cond: this OnAct:nil = thisList execVM "mySpamCounter.sqf"; this goes in a scriptfile: mySpamCounter.sqf _triggerList = _this;while{true} do{ hint format ["%1 enemie(s) left!",count _triggerList]; sleep 3;};And this in the init:CounterSpam = true;Am I doing the right thing, cause I had some problems with script couldn't be found once i started the missionPlease help:P Share this post Link to post Share on other sites
Taurus 20 Posted July 16, 2007 Where did you put the mySpamCounter.sqf-file. ? it needs to be in the folder where your mission.sqm file is at. Share this post Link to post Share on other sites
dragunov90 0 Posted July 17, 2007 Should I name the script file "mySpamCounter" and In that file put this: _triggerList = _this;while{true} do{ Â hint format ["%1 enemie(s) left!",count _triggerList]; Â sleep 3;};And I Know that It should be in my mp mission folder ;PIs this correct? Share this post Link to post Share on other sites
Taurus 20 Posted July 17, 2007 you must not forget the file-ending .sqf. If you do not have that enabled in windows that you see them. When you save the file in notepad(or something) Select: Fileformat: All Then name the file: mySpamCounter.sqf. The scriptfile go where you have your mission file which I mentioned earlier, this below is an example, you need to find out where your currently editing by your own.(its for english windows too) C:\Documents and Settings\<your name>\My Documents\ArmA Other Profiles\<your Arma profile>\missions\MyMission.Intro I'm sorry to say this, but if you don't understand this I must ask you to read up on the basics found in the top-stickies here on the forum. It'll learn you what you need to know to get started. Share this post Link to post Share on other sites
Cloughy 0 Posted July 18, 2007 Doesnt this just count total in trigger, regardless of side? Cheers GC Share this post Link to post Share on other sites
Taurus 20 Posted July 18, 2007 Nope, It'll count the guys with light-green mushrooms on their heads. [edit] As the trigger is set to monitor the ones mentioned above. Share this post Link to post Share on other sites
dragunov90 0 Posted July 18, 2007 I understand but, I have managed to locate the file now, but now there is a new problem, when i enter the game there is some kind of black console showing the code: _triggerList = _this;while{true} do{ hint format ["%1 enemie(s) left!",count _triggerList]; sleep 3;};It says error and something in line 6 ? help please I'am almost there Share this post Link to post Share on other sites
Taurus 20 Posted July 18, 2007 you musn't have the code thing in. like: _triggerList = _this; while{true} do{ hint format ["%1 enemie(s) left!",count _triggerList]; sleep 3; }; Share this post Link to post Share on other sites