meaty 34 Posted April 11, 2011 (edited) Hello, As i have a fair few questions and will prolly be asking more later i thought it'd be better to have it all in one thread rather than dozens :) ok down to business! I'm planning on createing a string of multiplayer missions that string into a campaign as sorts. I know my way around the 2d editor so i can place the units, do the waypoints, place triggers,functions, i can do the mission briefing and can sorta set up the tasks etc. However the thing i dont really know anything about is the scripting side. I've had a poke around a few defualt missions and some of it makes sense, whilst other bits are an utter mystery :confused: Anyway what i'm trying to figure out is (bits in the spoiler are what i've found out thus far, hidden to keep things tidey) .... Weapon loudouts change the guns, ammo, add satchels, smoke etc. I've found out how to do it with the US stuff (and the biki page listing them all!) with the "addmagazine 20Rnd_556x45_Stanag etc in the initialization bit. However i havent found any class names for the BAF addon :confused: Boat insertion summing to do with "assignAsCargo"?? Blow-upable objectives, "sweep n clear" and defend tasks no idea how to do these. So say blowing a radio tower is task 1, then clear the area of enermy is task 2, then defend the area is task 3 Spawn group from a random location as it says really, i'd like to have an ambush sort of thing, but with the enermy spawning along 1 of several roads, then moveing to the same objective. Spawn objective in random place not really needed but it does add an element of uncertainty if i end up leading a mission i make in multiplayer I'd like to add all the cool weather effects such as fog and dust storms as well, but one step at a time eh? :D Thanks in advance :) Edited April 11, 2011 by Meaty Share this post Link to post Share on other sites
neokika 62 Posted April 11, 2011 Welcome to the forums Meaty, Here is the complete A2 scripting commands list You can find all the class names here To make a unit/s start inside a boat or any other vehicle, use: _unit moveInCargo _vehicle; moveInCargo moveInCommander moveInDriver moveInGunner Lets say you have an object and the task it to destroy it, you could create a trigger or a script where it would wait until that object is destroyed Condition: !alive _object _neo_ Share this post Link to post Share on other sites
meaty 34 Posted April 13, 2011 thanks, i managed to get the groups spawning in the boats and the tasks to become complete when the shilkas get blown up. Got the weapons sorted as well, how i missed that thread i'll never know :o Haveing a bit of trouble with my tasks though, non of the intel, situation, tasks etc so up on the briefing page .. everything looks ok to my eyes. Also when one of the tasks is done in the missions then i get the green task complete box pop up but it says "task complete - any" for all of them. When all the tasks have been done (ie - everythings got blown up) the mission complete screen comes up like it should. :confused: (wrapped the briefing in spoilers to save scrolling) // F2 - Briefing // Credits: Please see the F2 online manual (http://www.ferstaberinde.com/f2/en/) // ==================================================================================== // JIP CHECK // Prevents the script executing until the player has synchronised correctly: #include "scripts\spectator\f_waitForJIP.sqf" // ==================================================================================== //CREATE NOTES FOR BREIFING //FEEL FREE TO USE WHICH RECORDS YOU NEED AND DISCARD THE OTHERS player createDiaryRecord["Diary", ["Credits", "SimHQ Mission By: Meatshield "]]; player createDiaryRecord["Diary", ["Situation", "Russian forces have taken over Sahrani by force and have killed the former President. British Armed Forces have been tasked, along with our US allies to retake Saharani and hand control back over to the people of saharani."]]; player createDiaryRecord["Diary", ["Intel", "Your squad has been assigned to take over the airfield on Antigua so it can be used for our purposes. Its well defended with plenty of ground troops. A few UAZs have been spotted as well as machine gun nests <marker name = 'mg_1'>here</marker> and <marker name = 'mg_2'>here</marker>. The AA sites are shilkas, its not know if they are actually manned or just their for show, however they are guarded. The <marker name = 'aa_radar'>AA radar</marker> is sat in the middle of the island and appears to be undefended a this time. <br/> There are also at least 2 mobile radio posts on the island to help with the AA radar. Once the main radar is destoryed this will become useless, however they are guarded but due to their mobility their never in the same place twice, so were unable to say where they are at this time. It also seems that the far west side of the island is the most lightly defened at this time."]]; player createDiaryRecord["Diary", ["Mission", "Your mission is to destroy the 3 AA sites <marker name = 'mkrTask1'>here</marker>, <marker name = 'mkrTask2'>here</marker> and <marker name = 'mkrTask3'>AA_site_1_1</marker>. Then destroy the AA radar <marker name = 'mkrTask4'>here</marker>, they can be blown up in any order. Expect at least 3 UAZs carrying MGs, about 40-50 infantry and MG nests (positions show in Intel) <br/> Each fire team has a medic. Bravo has 2 royal engineers with the satchels. We have also "borrowed" a SMAW from the yanks and given it to alpha. We have also raided the rest of the battlion for LSWs for this mission."]]; //CREATE TASKS // Task 4 objTask3 = player createSimpleTask["Destroy AA Radar"]; objTask3 setSimpleTaskDescription["Complete <marker name = 'mkrTask4'>Task 4</marker>", "Destroy AA Radar", "Destory AA Radar"]; objTask3 setSimpleTaskDestination markerpos "mkrTask4"; if varTask4 then { "mkrTask4" setMarkerColorLocal "ColorGreen"; "mkrTask4" setMarkerTypeLocal "Flag1"; "mkrTask4" setMarkerTextLocal "Complete"; objTask4 setTaskState "Succeeded"; }; //>---------------------------------------------------------< // Task 3 objTask2 = player createSimpleTask["Destory AA site 3"]; objTask2 setSimpleTaskDescription["Complete <marker name = 'mkrTask3'>Task 3</marker>", "Destory AA site 3", "Destory AA site 3"]; objTask2 setSimpleTaskDestination markerpos "mkrTask3"; if varTask3 then { "mkrTask3" setMarkerColorLocal "ColorGreen"; "mkrTask3" setMarkerTypeLocal "Flag1"; "mkrTask3" setMarkerTextLocal "Complete"; objTask3 setTaskState "Succeeded"; }; //>---------------------------------------------------------< // Task 2 objTask2 = player createSimpleTask["Destory AA site 2"]; objTask2 setSimpleTaskDescription["Complete <marker name = 'mkrTask2'>Task 2</marker>", "Destroy AA site 2", "Destory AA site 2"]; objTask2 setSimpleTaskDestination markerpos "mkrTask2"; if varTask2 then { "mkrTask2" setMarkerColorLocal "ColorGreen"; "mkrTask2" setMarkerTypeLocal "Flag1"; "mkrTask2" setMarkerTextLocal "Complete"; objTask2 setTaskState "Succeeded"; }; //>---------------------------------------------------------< // Task 1 objTask1 = player createSimpleTask["Destroy AA site 1"]; objTask1 setSimpleTaskDescription["Complete <marker name = 'mkrTask1'>Task 1</marker>", "Destroy AA site 1", "Destory AA site 1"]; objTask1 setSimpleTaskDestination markerpos "mkrTask1"; if varTask1 then { "mkrTask1" setMarkerColorLocal "ColorGreen"; "mkrTask1" setMarkerTypeLocal "Flag1"; "mkrTask1" setMarkerTextLocal "Complete"; objTask1 setTaskState "Succeeded"; }; // run this file again when respawning (only setup the killed EH once though) if ( isNil{player getVariable "mk_killedEHadded"} ) then { player addEventHandler ["killed", { [] spawn { waitUntil { alive player }; // waitUntil player has respawned execVM "briefing.sqf"; }; }]; player setVariable ["mk_killedEHadded", true]; }; Share this post Link to post Share on other sites
meaty 34 Posted April 13, 2011 ok well after a few days playing i've got the weapon loadouts sussed (how i missed that thread i have no idea! :o ), got the men spawning in the boats, and have blow-upable tasks .... sort of! 1 thing though, the briefing and tasks are not showing. Also whenever on of the tasks is complete i get graphic saying "task complete - any", however once all the tasks have been completed then the mission ends just fine :confused: Heres the briefing.sqf (in spoilers to prevent a really long thread!). As far as i can see it seems ok. // F2 - Briefing // Credits: Please see the F2 online manual (http://www.ferstaberinde.com/f2/en/) // ==================================================================================== // JIP CHECK // Prevents the script executing until the player has synchronised correctly: #include "scripts\spectator\f_waitForJIP.sqf" // ==================================================================================== //CREATE NOTES FOR BREIFING //FEEL FREE TO USE WHICH RECORDS YOU NEED AND DISCARD THE OTHERS player createDiaryRecord["Diary", ["Credits", "SimHQ Mission By: Meatshield "]]; player createDiaryRecord["Diary", ["Situation", "Russian forces have taken over Sahrani by force and have killed the former President. British Armed Forces have been tasked, along with our US allies to retake Saharani and hand control back over to the people of saharani."]]; player createDiaryRecord["Diary", ["Intel", "Your squad has been assigned to take over the airfield on Antigua so it can be used for our purposes. Its well defended with plenty of ground troops. A few UAZs have been spotted as well as machine gun nests <marker name = 'mg_1'>here</marker> and <marker name = 'mg_2'>here</marker>. The AA sites are shilkas, its not know if they are actually manned or just their for show, however they are guarded. The <marker name = 'aa_radar'>AA radar</marker> is sat in the middle of the island and appears to be undefended a this time. <br/> There are also at least 2 mobile radio posts on the island to help with the AA radar. Once the main radar is destoryed this will become useless, however they are guarded but due to their mobility their never in the same place twice, so were unable to say where they are at this time. It also seems that the far west side of the island is the most lightly defened at this time."]]; player createDiaryRecord["Diary", ["Mission", "Your mission is to destroy the 3 AA sites <marker name = 'mkrTask1'>here</marker>, <marker name = 'mkrTask2'>here</marker> and <marker name = 'mkrTask3'>AA_site_1_1</marker>. Then destroy the AA radar <marker name = 'mkrTask4'>here</marker>, they can be blown up in any order. Expect at least 3 UAZs carrying MGs, about 40-50 infantry and MG nests (positions show in Intel) <br/> Each fire team has a medic. Bravo has 2 royal engineers with the satchels. We have also "borrowed" a SMAW from the yanks and given it to alpha. We have also raided the rest of the battlion for LSWs for this mission."]]; //CREATE TASKS // Task 4 objTask3 = player createSimpleTask["Destroy AA Radar"]; objTask3 setSimpleTaskDescription["Complete <marker name = 'mkrTask4'>Task 4</marker>", "Destroy AA Radar", "Destory AA Radar"]; objTask3 setSimpleTaskDestination markerpos "mkrTask4"; if varTask4 then { "mkrTask4" setMarkerColorLocal "ColorGreen"; "mkrTask4" setMarkerTypeLocal "Flag1"; "mkrTask4" setMarkerTextLocal "Complete"; objTask4 setTaskState "Succeeded"; }; //>---------------------------------------------------------< // Task 3 objTask2 = player createSimpleTask["Destory AA site 3"]; objTask2 setSimpleTaskDescription["Complete <marker name = 'mkrTask3'>Task 3</marker>", "Destory AA site 3", "Destory AA site 3"]; objTask2 setSimpleTaskDestination markerpos "mkrTask3"; if varTask3 then { "mkrTask3" setMarkerColorLocal "ColorGreen"; "mkrTask3" setMarkerTypeLocal "Flag1"; "mkrTask3" setMarkerTextLocal "Complete"; objTask3 setTaskState "Succeeded"; }; //>---------------------------------------------------------< // Task 2 objTask2 = player createSimpleTask["Destory AA site 2"]; objTask2 setSimpleTaskDescription["Complete <marker name = 'mkrTask2'>Task 2</marker>", "Destroy AA site 2", "Destory AA site 2"]; objTask2 setSimpleTaskDestination markerpos "mkrTask2"; if varTask2 then { "mkrTask2" setMarkerColorLocal "ColorGreen"; "mkrTask2" setMarkerTypeLocal "Flag1"; "mkrTask2" setMarkerTextLocal "Complete"; objTask2 setTaskState "Succeeded"; }; //>---------------------------------------------------------< // Task 1 objTask1 = player createSimpleTask["Destroy AA site 1"]; objTask1 setSimpleTaskDescription["Complete <marker name = 'mkrTask1'>Task 1</marker>", "Destroy AA site 1", "Destory AA site 1"]; objTask1 setSimpleTaskDestination markerpos "mkrTask1"; if varTask1 then { "mkrTask1" setMarkerColorLocal "ColorGreen"; "mkrTask1" setMarkerTypeLocal "Flag1"; "mkrTask1" setMarkerTextLocal "Complete"; objTask1 setTaskState "Succeeded"; }; // run this file again when respawning (only setup the killed EH once though) if ( isNil{player getVariable "mk_killedEHadded"} ) then { player addEventHandler ["killed", { [] spawn { waitUntil { alive player }; // waitUntil player has respawned execVM "briefing.sqf"; }; }]; player setVariable ["mk_killedEHadded", true]; }; Any ideas? Share this post Link to post Share on other sites
fatty86 10 Posted April 13, 2011 Tasks are not completing properly because you used quote marks in the Mission diary, accidentally ending the string prematurely and breaking the rest of the script. Use double quote marks to embed a quote mark and have it show in your notes. Like this: player createDiaryRecord["Diary", ["Mission", "Your mission is to destroy the 3 AA sites <marker name = 'mkrTask1'>here</marker>, <marker name = 'mkrTask2'>here</marker> and <marker name = 'mkrTask3'>AA_site_1_1</marker>. Then destroy the AA radar <marker name = 'mkrTask4'>here</marker>, they can be blown up in any order. Expect at least 3 UAZs carrying MGs, about 40-50 infantry and MG nests (positions show in Intel) <br/> Each fire team has a medic. Bravo has 2 royal engineers with the satchels. We have also ""borrowed"" a SMAW from the yanks and given it to alpha. We have also raided the rest of the battlion for LSWs for this mission."]]; More info here: http://community.bistudio.com/wiki/Scripting_Grammar#Strings Also, a few of the variable names in there need to be updated. Check out under tasks 3 and 4 - you have objTask2 for task 2, and objTask3 for task 4. You already updated the other variables... just change those two to objTask3 and objTask4 (respectively) and you should be good. Share this post Link to post Share on other sites