Jump to content
Sign in to follow this  
lucilk

delete group in SQF

Recommended Posts

I need some help with a script and cant find the way to make it work.

So the ideea is to spawn a group move to player position and then i need 2 things:

1. The Condition:

the group has SAD waypoint so after they kill all enemies they will wait a bit and then to be deleted.

2. This is like a support triggered from Radio but i dont want him to be used only after 10 minutes after the group has been deleted. I mean like a delay or something, u know call it every 10 minutes after the first support has been completed. So i need a delay on the trigger.

The script is working perfect they spawn they move look for enemyes on player position but i dont know how to put these conditions.

This is what i have done so far:

GroupTank1 = CreateGroup West;

Tank1 = createVehicle ["M1A2_TUSK_MG", [(getMarkerPos "armor1") select 0,(getMarkerPos "armor1") select 1,0], [], 1, "FORM"];
tankc1 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,1], [], 0, "CAN_COLLIDE"];
tankc1 moveInDriver Tank1;
tankc2 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,2], [], 0, "CAN_COLLIDE"];
tankc2 moveInGunner Tank1;
tankc3 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,3], [], 0, "CAN_COLLIDE"];
tankc3 moveInCommander Tank1;
tankc4 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,4], [], 0, "CAN_COLLIDE"];
tankc4 moveInTurret [Tank1, [0,1]]

Tank2 = createVehicle ["M1A2_TUSK_MG", [(getMarkerPos "armor1") select 0,(getMarkerPos "armor1") select 1,0], [], 10, "FORM"];
tank2c1 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,1], [], 0, "CAN_COLLIDE"];
tank2c1 moveInDriver Tank2;
tank2c2 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,2], [], 0, "CAN_COLLIDE"];
tank2c2 moveInGunner Tank2;
tank2c3 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,3], [], 0, "CAN_COLLIDE"];
tank2c3 moveInCommander Tank2;
tank2c4 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,4], [], 0, "CAN_COLLIDE"];
tank2c4 moveInTurret [Tank2, [0,1]] 

Tank3 = createVehicle ["M1A2_TUSK_MG", [(getMarkerPos "armor1") select 0,(getMarkerPos "armor1") select 1,0], [], 20, "FORM"];
tank3c1 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,1], [], 0, "CAN_COLLIDE"];
tank3c1 moveInDriver Tank3;
tank3c2 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,2], [], 0, "CAN_COLLIDE"];
tank3c2 moveInGunner Tank3;
tank3c3 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,3], [], 0, "CAN_COLLIDE"];
tank3c3 moveInCommander Tank3;
tank3c4 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,4], [], 0, "CAN_COLLIDE"];
tank3c4 moveInTurret [Tank3, [0,1]] 

Hope you got the ideea. I realy need this i am a newbie so please help me out.

Edited by lucilk

Share this post


Link to post
Share on other sites
for [{_loop=0}, {_loop<1}, {_loop=_loop}] do
{
GroupTank1 = CreateGroup West;

Tank1 = createVehicle ["M1A2_TUSK_MG", [(getMarkerPos "armor1") select 0,(getMarkerPos "armor1") select 1,0], [], 1, "FORM"];
tankc1 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,1], [], 0, "CAN_COLLIDE"];
tankc1 moveInDriver Tank1;
tankc2 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,2], [], 0, "CAN_COLLIDE"];
tankc2 moveInGunner Tank1;
tankc3 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,3], [], 0, "CAN_COLLIDE"];
tankc3 moveInCommander Tank1;
tankc4 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,4], [], 0, "CAN_COLLIDE"];
tankc4 moveInTurret [Tank1, [0,1]];

Tank2 = createVehicle ["M1A2_TUSK_MG", [(getMarkerPos "armor1") select 0,(getMarkerPos "armor1") select 1,0], [], 10, "FORM"];
tank2c1 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,1], [], 0, "CAN_COLLIDE"];
tank2c1 moveInDriver Tank2;
tank2c2 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,2], [], 0, "CAN_COLLIDE"];
tank2c2 moveInGunner Tank2;
tank2c3 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,3], [], 0, "CAN_COLLIDE"];
tank2c3 moveInCommander Tank2;
tank2c4 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,4], [], 0, "CAN_COLLIDE"];
tank2c4 moveInTurret [Tank2, [0,1]];

Tank3 = createVehicle ["M1A2_TUSK_MG", [(getMarkerPos "armor1") select 0,(getMarkerPos "armor1") select 1,0], [], 20, "FORM"];
tank3c1 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,1], [], 0, "CAN_COLLIDE"];
tank3c1 moveInDriver Tank3;
tank3c2 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,2], [], 0, "CAN_COLLIDE"];
tank3c2 moveInGunner Tank3;
tank3c3 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,3], [], 0, "CAN_COLLIDE"];
tank3c3 moveInCommander Tank3;
tank3c4 = GroupTank1 createUnit ["USMC_Soldier_Crew", [0,0,4], [], 0, "CAN_COLLIDE"];
tank3c4 moveInTurret [Tank3, [0,1]];

sleep 600;

{deleteVehicle _x} forEach (units GroupTank1);
deleteVehicle Tank1;
deleteVehicle Tank2;
deleteVehicle Tank3;

sleep 30;
};

Edited by Mr Fenix

Share this post


Link to post
Share on other sites

Thanks Fenix but i just tested and not working, yes they spawn but just for a moment like 1 sec and then are deleted, i have added the waypoins but still ... nothing, still trying.

Help me out pls :(

Share this post


Link to post
Share on other sites
Where exactly is the code? And how exactly is it called? Is it SP or MP?

:D i am kinda new on all this but i am making some tests now in MP, hope it works and i will make it work, as for the code just download the example mission and you will see 6 files sqf thats all there is. give it a try on the example mission and you will figure it out

Example mission

Share this post


Link to post
Share on other sites

Thank you so much Fenix, been looking tirelessly on how to delete createUnit groups!

Share this post


Link to post
Share on other sites

Hi Lucilk,

I know this may defeat the purpose of doing what you're doing and you've obviously put alot of effort in so far... but could it be possible to use the ACM to do all of this for you? If you could define its operational conditions it may just be a matter of applying certain scripts to implement it and the module can manage the rest...

just a thought.

cheers

Ebola

Share this post


Link to post
Share on other sites

this is a old thread i am way more advanced now, this is not a problem anymore Ebola. Thx

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  

×