Jump to content
Sign in to follow this  
Bloodofthedragon

Looking for advice on a roadblock mission

Recommended Posts

Hello everyone,

I've been with this series since Flashpoint but only in the past two years have I got serious about learning how to create missions of my own with any kind of complexity.

During that time I've accumulated a nice fat yellow folder full of hand scribbled notes, dozens upon dozens of bookmarks on how to's and resources and a couple hundred mb's of random example scripts/missions.

So far I have been doing pretty good on my own, bumbling my way through not really understanding scripts. Until now that is.

Recently I've been trying like hell to build a good COOP roadblock mission, something akin to Reezo's wonderful COOP 06 - Roadblock Duty (ACE) as seen here --> http://forums.bistudio.com/showthread.php?115906-COOP-06-Roadblock-Duty-%28ACE%29

But frankly I've hit the wall.

Ideally I would like to rebuild the same scenario without the ACE dependency.

So, what I'm thinking I'll have to do is: 1. Create the roadblock w/ units, barriers etc. (Obviously)

2. Create a spawn point for the randomized vehicles.

3. Create a marker/waypoint? for the vehicles to stop at. ie At the roadblock.

4. Create a marker/waypoint for the vehicles to go to after the roadblock. (Perhaps with some sort of cleanup so I don't create a junkyard?)

5. Somehow (This part scares me) script in some commands for the squad leader to order the vehicle to pass through the checkpoint.

6. Somehow put in a random chance that: Insurgents jump out and attack(From Civil vehicles), random civilian vehicles decide to detonate an I.E.D. (But not if you keep your rifle on him IE: Reezo's mission)

7. Somehow put in a simple to use and implement I.E.D. detector to the engineer slot. ( I'm thinking a simple beeping sound or even a text hint that an I.E.D. has been detected once the engineer is within say 5m?)

8. Set up multiplayer framework ( Bless you Fer and your F2 Mission Development Framework!!!)

1 through 4 I almost feel I can figure out but 5 through 7 make me want to hide under the bed. :p

I'm guessing the spawn will have to be handled by a script? As well as the randomization of vehicles, friend/foe and I.E.D. detector?

I've managed to learn how to use and tweak ready made scripts but I don't have the foggiest how to write my own.

What do you think would be the best way to go about all this?

I'd be eternally grateful for any advice.:bounce3:

Share this post


Link to post
Share on other sites

5. You could use a simple trigger, and scripted text.

6. Should not be too complicated, just pretty long script with many Randoms... it should be a part of the spawning system.

http://www.armaholic.com/page.php?id=7224 can be the IED part, if you customize a few things.

7. part of the script above. if you dont use it, you can add an action to the car to disarm IED. if you can disarm something, it exists...

If you need I can give you an example code, but for now Ill let you try it yourself :wink:

Share this post


Link to post
Share on other sites

Hi Silderoy, thanks for the reply!

On #5. Right, Probably call it from radio Alpha/trigger I assume?

#6. This part still confuses me, I have no idea how to write a script like that. Never even knew about the Randoms command, And I would imagine the script would have to have some sort of array comprised of all the civil vehicles?

I know enough to recognize an array when I see one but don't understand the proper syntax to write one myself...

#7 Love that idea! Simple to use, simple to build. ( As I usually play with my 60+ yr old disabled father simplicity is paramount) But what about preventing the bomber from detonating by keeping a weapon trained on him? Any idea how that could be done?

Lastly, I would absolutely love to see your example code! I'm always up for the chance to learn something new.

Thanks again Silderoy!

Share this post


Link to post
Share on other sites

spawnSystem.sqf:

_civCenter = createCenter Civilian;
_civgrp = createGroup Civilian;
_ECenter = createCenter east;
_Egrp = createGroup east;

//Variables and Arrays
_carList = ["SkodaBlue", "SkodaGreen", "SkodaRed", "Skoda", "VWGolf", "TT650_Civ", "hilux1_civil_2_covered", "hilux1_civil_1_open", "hilux1_civil_3_open", "car_hatchback", "datsun1_civil_1_open", "datsun1_civil_3_open", "datsun1_civil_2_covered", "car_sedan", "UralCivil", "Lada_base", "Lada2", "Lada1"];
_civilianList = ["TK_CIV_Takistani01_EP1", "TK_CIV_Takistani02_EP1", "TK_CIV_Takistani03_EP1", "TK_CIV_Takistani04_EP1", "TK_CIV_Takistani05_EP1", "TK_CIV_Takistani06_EP1", "TK_CIV_Worker01_EP1", "TK_CIV_Worker02_EP1"];
_InsurgentList = ["TK_INS_Soldier_EP1", "TK_INS_Soldier_2_EP1", "TK_INS_Soldier_3_EP1", "TK_INS_Soldier_4_EP1"];

_chanceINS = random 1;
_chancePAS = random 1;
_chanceIED = random 1;

//the marker the cars will spawn at. change according to your mission.
_mark = "vehspawn";

//Vehicle spawn
_randomCarNumber = floor (random (count _carList));
_randomCarType = _carList select _randomCarNumber;

_car = _randomCarType createVehicle (getMarkerPos _mark);
//hint format ["randomCarNumber: %1, randomCarType: %2", _randomCarNumber, _randomCarType];

sleep 5;
//Driver Spawn
_randomDriverNumber = random 1;

_randomCivNumber = floor (random (count _civilianList));
_randomCivType = _civilianList select _randomCivNumber;

_randomInsNumber = floor (random (count _insurgentList));
_randomInsType = _insurgentList select _randomInsNumber;

//check if driver is insurgent or civilian
if (_randomDriverNumber > _chanceINS) then {
_driver = _civgrp createUnit ["_randomCivType", (getMarkerPos _mark), [], 0, "FORM"];
//hint Format ["driver number: %1, driver Type: %2, driver side is %3", _randomCivNumber, _randomCivType, (side _driver)];
} else {
_driver = _Egrp createUnit ["_randomInsType", (getMarkerPos _mark), [], 0, "FORM"];
removeAllWeapons _driver;
_driver addWeapon "AK_47_M";
_driver addMagazine "30Rnd_762x39_AK47";
_driver addMagazine "30Rnd_762x39_AK47";
_driver addMagazine "30Rnd_762x39_AK47";
_driver addMagazine "30Rnd_762x39_AK47";
_driver addMagazine "HandGrenade_East";
//hint Format ["driver number: %1, driver Type: %2, driver side is %3", _randomInsNumber, _randomInsType, (side _driver)];
};

_driver moveInDriver _car;

sleep 5;
//if civilian, check if IED added, and add it
if (_randomDriverNumber > _chanceINS) then {
_randomIEDNumber = random 1;
if (_randomIEDNumber <= _chanceIED) then {
IED = "Sh_81_HE" createVehicle [(getPos _car) select 0,(getPos _car) select 1,2];
IED attachTo [_car];

_difuseIED = _car addAction ["Disarm IED", "disarmIED.sqf"];

//hint format ["IED needed number: %1, random number: %2", _chanceIED, _randomIEDNumber];

disarmIED.sqf:

_target = _this select 0;
_caller = _this select 1;
_id = _this select 2;

_target removeAction _id;

sleep 3;
if (_caller distance IED < 3) then {
hint "IED nutrelized!";
detach IED;
deleteVehicle IED;
} else {
hint "You were too far away and did not manage to disarm the IED...";
sleep 1;
detach IED;
};

At the moment, the driver doesnt spawn for some reason I can not see... but thats the basic idea.

Share this post


Link to post
Share on other sites

Thank you very much!

Between your example and tcp's scripts I got plenty of homework to keep me busy for awhile.

Again, really appreciate the help Silderoy. I'm gonna have alot fun messing around with this!

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  

×