Jump to content
Sign in to follow this  
ServiceStud

Personal driving score MP

Recommended Posts

Hey all.

I tried searching but either the answer is not here or I am searching for the wrong things. I am a newb at mission making so maybe I got the nomenclature wrong.

Anyhow, here is my question:

I have created a tank driving range with road-cones lining the road the driver is supposed to follow.

What I want to do is to tally the amount of cones a specific player disturbs and display it (preferably in an unobtrusive format) for all players.

It would also rock to be able to reset/remove this display from a 3rd place once the driving part is done.

The map allows a max of 6 players, it is Multiplayer. If it makes any difference, the game is Iron Front.

Is this possible? I was looking at the addScore bit but I cannot for the life of me see how I would tie this to the myriad road cones.

Any tips?

Thanks in advance!

Share this post


Link to post
Share on other sites

Hm. After 30+ views and no response, I assume the question was either too hard or too easy. I will just have to tally score manually then.

Share this post


Link to post
Share on other sites

Its a bit more complex than what it may appear. Objects don't generally carry a score, so you'd have to somehow turn cones into a visible variable.

possibility that using eventhandler "killed" for the cones may work, but then knocking the cones may not kill/destroy them.

you could try handledamage - but again not sure this works with cones.

could have a loop script on each to detect a vehicle which comes within a certain distance of the cone, and then penalise them for that.

best i can think of right now - maybe someone else can focus your idea - but cant honestly say that knocking cones over will excite many people on here to assist - sorry dude. good luck

Share this post


Link to post
Share on other sites

I would like this too. I have the mission "autocross" but it only gives a time and doesn't tell me how many cones were knocked down.

Share this post


Link to post
Share on other sites

Save the positions of the cones in an array and then compare each one after the course is finished?

//init var's
courseFinished = false;
_coneArray = [];

//save positions of all cones in a nested array
{
 _coneArray set [count _coneArray, [_x,getPosATL _x]];
}forEach [cone1,cone2,cone3];
//add cone names up here ^

//wait until the trigger becomes true
waitUntil {sleep 1; courseFinished};
_score = 20;

//compare the distance between the actual position of the cone and the orignal position. if higher than 5cm, score is reduced.
{
_cone = _x select 0;
_originalPos = _x select 1;
if (((getPosATL _cone) distance _originalPos) > 0.05) then {
	_score = _score-1;
};
}forEach _coneArray;

//display score
hint format ["You've completed the course.\nYour score is: %1 out of 20",_score];

Just tested it and it seemed to work just fine. I placed a trigger at the end of the course with blufor present, on activation: courseFinished = true;

Obviously not MP/reset compatible, I don't really have time for that. But it's a start.

You could delete all the cones after the course is finished, set the variable to false, and place new cones. It'll take some time to get all that working.

Edited by cuel

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  

×