Jump to content

Sign in to follow this  
hansham

NEW: SniperWar scenario

Recommended Posts

Hello builders and scripters.

I am a Editor nOOb and I want to make a MP Sniper War mission.

In a sniper war the players (team deathmach) are limited to an area and between the two groups is a no-man's land which is not accessible.

opfor

x x x x

----------------------------

no man's land

----------------------------

x x x x

bluefor

I managed to create this situation, made a lot of wire-boundaries, disabeled the AI in the description file, everybody spawns as sniper with only sniper rifles in the ammobox, but when I put it online, i can not join the group. In the team-select screen everything is greyed and not selectable.

I really do not know how to make a system for counting scores, make one side win on a number of points and how to limit the number of respawns per group. I want no individual respawns, but a group budget until there is one respawn left per member. When your last respawn is gone, you must be able to be a spectator (an invisible player who can not shoot) until the last team member is shot or when the playtime is over.

Is there any existing sniper-war scenario like this available as example? (i never found one)

How do I create a Team vs Team deathmach?

Share this post


Link to post
Share on other sites

How about reading Mr.Murrays Editing Bible - i think i read something there about PvP and Scorecounting.

And use the search-function within this forum. You might want to try google too..

For your joining-problem: Did you set the units to "playable"?

Share this post


Link to post
Share on other sites

Thank you for your reply. Trust me, I spend Hours looking for scripts. What is PvP?

Share this post


Link to post
Share on other sites

You shouldn`t spend hours into looking for scripts... you should spend hours for learning how to script by yourself... :p

PvP == Player vs. Player

;)

Share this post


Link to post
Share on other sites

You should start by searching for TDM sniper match in user missions or on Armaholic/OFPEC. They have missions out there that are very close to your description.

If you find one you can download it and play to see how it works in game and see how close that is to your idea.

Share this post


Link to post
Share on other sites
  TJ72 said:
If you find one you can download it and play to see how it works in game and see how close that is to your idea.

...thank you but I know exactly what I want. I have played many sniper war maps, specially in Ghost Recon I.

The problem is that i do not get my scripts working. When a Blufor kills an Opfor, the kill is not counted, so the game does not end. Triggers also do not detect kills, so I am figuring out how to register kills and show them to the players.

Also, setting a limit to the amount of individual respawns and make the died snipers viewers from a 'bird perspective' is not easy and I have not found any examples for that after hours of searching.

The scenario is that died snipers float above the map as invisible persons and can function as spotter for living snipers from this 'bird-perspective', fixed in one position. Blufor and Opfor both on their own side.

Trying to understand the very brief explanations in script language takes me even longer, because programmers haf the nasty habit of telling you a part, but leave out details that prevent the script form working.

For example, many times a script is explained but nobody tells where to put the script.

Edited by hansham
typing mistakes

Share this post


Link to post
Share on other sites
  hansham said:
...thank you but I know exactly what I want. I have played many sniper war maps, specially in Ghost Recon I.

:)

  hansham said:
The problem is that i do not get my scripts working. When a Blufor kills an Opfor, the kill is not counted, so the game does not end. Triggers also do not detect kills, so I am figuring out how to register kills and show them to the players.

I just put something together for you. I am not sure how much you know about scripting so I hope it does not confuse you more! This is also for Singleplayer....I can't help you make this work in multiplayer.

You can download a little demo here.

This consists of a script and a function.

The script in this case is the init.sqf itself for want of a better place to put the code.

The function is in a separate folder called "func".

Create "init.sqf" in your mission folder....

"init.sqf":-

private ["_i","_units","_unit"];

whoDunnit = compile preProcessFile "func\fn_whoDunnit.sqf";

sleep 1;

_units = allUnits;

for [{_i=0},{_i<count _units},{_i=_i+1}] do {
_unit = _units select _i;
_unit addeventhandler ["KILLED",{nul=[_this] call whoDunnit}];
sleep 0.01;
};

Then make a folder in your mission folder called "func" and create the file "fn_whoDunnit.sqf" with the code below.

"fn_whoDunnit.sqf":-

private ["_deatharray","_victim","_killer","_side","_x1","_y1","_x2","_y2","_dis"];

_deatharray =_this select 0;

_victim = _deatharray select 0;
_killer = _deatharray select 1;

_x1 = getPos _victim select 0;
_y1 = getPos _victim select 1;

_x2 = getPos _killer select 0;
_y2 = getPos _killer select 1;

_x = _x2 - _x1;
_y = _y2 - _y1;

_dis = sqrt(_x^2+_y^2);

_dis = round _dis;

_killer globalchat format ["%1 killed %2 at %3m", name _killer, name _victim, _dis];

Add a few BLUFOR groups...add a few OPFOR groups and let them slog it out. The kills will be reported.

  hansham said:
Trying to understand the very brief explanations in script language takes me even longer, because programmers haf the nasty habit of telling you a part, but leave out details that prevent the script form working.

For example, many times a script is explained but nobody tells where to put the script.

Mate I haven't commented the code for you...but it's not much code and you should be able to follow it pretty easily. The other thing is it's 2:40 am ! LOL!

You mentioned GR 1....well I still play that up to today with a couple mates. It works well and we get a lot of kicks out of it.

I use this same script above to hear "He's history", "Kill confirmed" or "Goodbye" when I kill someone in the Arma world.

Here's the code!

private ["_deatharray","_side", "_victim","_killer","_dis"];

_deatharray =_this select 0;

_victim = _deatharray select 0;
_killer = _deatharray select 1;

_side = side _victim;

_dis = round (_killer distance _victim);

if (isPlayer _killer) then {

_killer globalchat format ["%1 killed %2 at %3m", name _killer, name _victim, _dis];

if (_side == side player) then {

	playsound "onourside";

} else {

_rnd = floor (random 3);

if (_rnd == 0) then {playsound "killconfirmed"};
if (_rnd == 1) then {playsound "heshistory"};
if (_rnd == 2) then {playsound "goodbye"};

};

};

Wheeww! That was longer than expected.

Hope it helps!

Edited by twirly
Clarity

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  

×