Jump to content
Sign in to follow this  
eviljack109

Need help with Mission Scripting, several problems need fixing.

Recommended Posts

I am currently working on a simple PVP mission for my arma clan and I need some help.

 

The mission is a simple idea. There is a sniper Team (their names are unit1 and unit2) stranded in the woods with no maps or NVGs. They are lost and need to get home. There is also A heli crew that is on their way to rescue the sniper team but their heli only spawn 5 mins into the game. The final team is BLUEFOR who is about a platoon strength, their goal is Hunt down and capture the sniper team, alive if possible. I have several things I want to do with the mission but I lack the knowledge of how and could use some help.

 

Problem 1:

I want to have the Heli spawn into the world 5 mins into the game.

 

Currently I have 3 heli's placed in the editor (heli1, hel2, heli3 are their names respectively)) Each heli has the code in the vehicles init field :

hideObject heli3;

That would be the field for Heli 3 for example.

 

I then have a trigger that looks for the Pilots. As long as they are on the island for 5 mins it would spawn the helicopters. This is what is in the Activation Field.

heli1 hideObject false;
heli2 hideObject false;
heli3 hideObject false;
hint "Helicoptors have spawned!";

In Theory that should spawn the helis after I set the countdown time to 300 seconds. What actually happens when I test the mission in Multiplayer is that they DON'T spawn and we have to use MCC to spawn them. So I need to know how to easily spawn the helis where I want.

 

This is optional, but if possible I would like the pilot crew to have the option between a few helicopters but may only choose 1. I would like to do this by having some object that spawns 5 mins into the game with multiple actions. Each one with the ability to spawn a heli. Once the Pilot chooses the vic they want, the object would despawn itself and they would have access to only one heli.

 

 

 

Problem 2:

I want to have the sniper team spawn together in one of a few pre-selected locations together. I know how to have the units spawn in several locations by linking them to a marker, but that will cause both units to spawn in separate areas and never together as a group.

 

 

Problem 3:

There is currently a large red circle that follows around the each unit in the sniper team. The circle has a radius of 250 meters and would update every 5 mins so everybody has an idea of where the sniper team is but never has an accurate idea of where they are.

 

I do this by naming each marker mrk_unit1 and mrk_unit2 then I have in the init.sqf the following:

[] spawn {
  while {not isnull unit1} do { "mrk_unit1" setmarkerpos getpos unit1; sleep 300; };
};

[] spawn {
  while {not isnull unit2} do { "mrk_unit2" setmarkerpos getpos unit2; sleep 300; };
};

While this kinda does the job the center of the marker will ALWAYS set itself so the center of the circle is at the the sniper's current location every time it updates, which defeats the purposed of having the marker a big red circle. I would like it if the circle would update every 5 mins but the sniper unit will always be within some random location within the circle. Basically the marker will say when it updates is "they are somewhere withing here, but where exactly I am unsure." 

 

Problem 4:

I also want to have several Tasks that give an update to both sides on the status of each sniper. Both teams would have the task to grab both the Sniper and the Sniper. For the Pilots for example would have a task to "rescue Sniper" the task would then become completed once the sniper entered a building back at base. The task would fail if either the Sniper would fail if either the Sniper was killed or captured. I currently have the triggers that give a hint when they fire based on the conditions. For example I have triggers that say when the Sniper is Killed, captured, or rescued, and the same set of triggers separately for the Spotter. Sadly when I link them to the task the the set task status modules it doesn't seem to work I believe I have linked them in the correct order but no matter what I do it never works. Also, for I have the task for Bluefor apply to all on the bluefor side, so they all see they have the task on their maps. Though the tasks for the pilots are synced to the pilots, but the task don't appear on their maps and I have no idea why. Also the task never update for either team when the Sniper or Spotter is killed, captured, or rescued.

 

~~~~

 

I also I have some features that are optional to the mission but I would like help setting it up.

 

Optional Feature 1:

I would like Blue-force Tracking for one side only. I want the Blue for team to know where each team is, but the other team cannot know where the others are as the pilots are also searching for the Sniper team. I am currently using the ACE mod with this mission so if there is a way to do it this their module I would like to know. Though I would prefer to set it up without the module cause I plan to make a version of the mission without mods so I don't want to lose Blue-force tracking when I remove the ACE mod.

 

Optional Feature 2:

Finally I would like to eventually everything I have mentioned here and have multiple sniper teams. This for when the Bluefor teams is actually at full strength. This would prevent the lone sniper team be hunted down by ENTIRE Platoon of enemies. I feel that escape would be impossible if there is too many enemies. So I would like it if there could possibly be multiple Sniper teams eventually. Each sniper team would spawn with their partner, but each team itself would spawn a separate random locations. There would also be a task and marker for each sniper and spotter on the ground. This is much harder so if somebody is whilling to tell me how to do this I would appreciate it greatly.

 

~~~~

Thank you for reading all this and if you can help me in anyway I will love you forever

Eviljack

 

 

Share this post


Link to post
Share on other sites

Hope this helps gets you started. I started to work on problem 1, but ran out time (Not tested lunch break).

 

Problem 2;

removed... PvP did not read that part

Problem 3 (updated):

[] spawn {
  while {not isnull unit1} do { 
  _unitPos = getpos unit1;                          //get the unit position
  _xRand = [25,35,45,50] call BIS_fnc_selectRandom; //X offset
  _yRand = [25,35,45,50] call BIS_fnc_selectRandom; //Y offset
  _posORneg = [1,-1]call BIS_fnc_selectRandom;      //is for making the X or Y positive or negative randomly ie. (25*-1) = -25 
  _offSet = [(_unitPos select 0) + (_xRand * _posORneg)  , (_unitPos select 1) + (_yRand * _posORneg), 0]; //set the offset
  "mrk_unit1" setmarkerpos _offSet; sleep 300; };   //set the marker position
};

idk know about 4.

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  

×