OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Rytuklis on 05 May 2012, 15:57:18
-
Alright... Briefing and objectives in OFP are so simple and easy, but i still don't get it how to make these in ArmA II.
Can someone lend a hend and give me a detailed explanation? Thanks.
-
Hello,
You may try taskmaster2 :
http://www.armaholic.com/page.php?id=7377
-
Using a generator (like the one linked above, or this one (http://www.ofpec.com/ed_depot/index.php?action=details&id=643&game=Arma2)) is the easiest way, but you might want to know how it actually works too.
Basically, you need to run a file (usually named briefing.sqf) from your init.sqf (or from the init field of a unit), which contains all the text etc. of your briefing. So, example:
init.sqf:
[player] execvm "briefing.sqf"
briefing.sqf:
_unit = _this select 0;
_unit createDiaryRecord ["Diary", ["Extra stuff", "Add extra info here."]];
_unit createDiaryRecord ["Diary", ["Situation", "Situation Text"]];
_unit createDiaryRecord ["Diary", ["Background", "Background text"]];
Task1 = _unit createSimpleTask [""];
Task1 setSimpleTaskDescription ["Main Text", "Description", "Waypoint Description"];
//RUG_Task1 setSimpleTaskDestination (getpos place1)
[objNull, ObjNull, Task1, "CREATED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";
Task2 = _unit createSimpleTask [""];
Task2 setSimpleTaskDescription ["Main text", "Short Description", "Waypoint Description"];
//RUG_Task2 setSimpleTaskDestination (getpos place2);
[objNull, ObjNull, Task2, "CREATED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";
The commented parts (setSimpleTaskDestination) would attach a waypoint to (for instance) an invisible H or a Game Logic named place1 and place2; these would show up on your HUD when you set that task as current. The big script-lines are the ones that make the nice text show up on the screen, "New Task Assigned" and such. Other options aside from "CREATED" can be read here: linky (http://www.ofpec.com/COMREF/index.php?action=details&id=1261&game=All). That won't actually fail or cancel the tasks though, you still need to use setTaskState for that.
But yeah, the generators might be the best way to go :)
Wolfrug out.
-
Thanks, appreciated