Jump to content
Sign in to follow this  
dragunov90

enemy counter

Recommended Posts

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?huh.gif

Share this post


Link to post
Share on other sites

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

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?huh.gif?huh.gif?? What's wrong

Share this post


Link to post
Share on other sites

my bad, typo sad_o.gif

nil = thisList execVM "mySpamCounter.sqf";

Sorry.

Share this post


Link to post
Share on other sites

Thank you ;P By the way, do you know some good tutorials in order to make cutscenes, have never done one sad_o.gif

Share this post


Link to post
Share on other sites

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 mission

Please help:P

Share this post


Link to post
Share on other sites

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

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 ;P

Is this correct?

Share this post


Link to post
Share on other sites

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

Doesnt this just count total in trigger, regardless of side?

Cheers

GC

Share this post


Link to post
Share on other sites

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

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 huh.gif? help please I'am almost there

Share this post


Link to post
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×