How to collect evidence


Here’s a sample mission that does what you want I believe. It’s abstracted, as in the evidence doesn’t become an inventory item, it just goes away and completes the task.
First place your player.
Second place the evidence, named evi1, where you want it to be found. I used EMPTY -> Objects (Small) – Evidence (File2) for my example. Also place an EMPTY marker called obj1 there so the task system knows where to direct the player to look.

In the Init field of the evidence object I put the following:

evi1’s init field:

Code:
this addaction ["Collect evidence!", "collect.sqf"];

This will add an action to the folder allowing the player to use the item to collect it. The contents of the collect.sqf is as follows:

collect.sqf:

Code:
deletevehicle evi1;
tskEvidence1 setTaskState "SUCCEEDED";
[objNull, ObjNull, tskEvidence1, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

That will delete the item in game since you’ve “collected” it. Set your current task to SUCCEEDED and display a pretty hint window saying so. I also have a trigger with the condition of !alive (evi1) which plays some music when you find the folder.

I also have another trigger which ends the mission. It’s an End1 Type trigger with this as it’s settings:

End1 Trigger Condition:

Code:
taskCompleted tskEvidence1;

End1 Trigger On Act:

Code:
End1;

I also set the timeout period for this trigger at 10/10/10 so you could listen to the music and see the ‘Task Completed’ hint.

The actual task system is set up via three files, init.sqf, briefing.sqf and briefing.html. These are those files:

init.sqf:

Code:
execVM "briefing.sqf";

briefing.sqf:

Code:
player createDiaryRecord ["Diary", ["Mission: Find the Folder", "Your mission is to pick up this folder."]];

tskEvidence1 = player createSimpleTask ["Find evidence."];
tskEvidence1 setSimpleTaskDescription ["Near the fountain you'll find a blue folder.  Pick it up.", "Find evidence.", "Search for Evidence"];
tskEvidence1 setSimpleTaskDestination (getMarkerPos "obj1");
player setCurrentTask tskEvidence1;
[objNull, ObjNull, tskEvidence1, "ASSIGNED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

briefing.html:

HTML Code:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">

<title>Title</title>
</head>

<body bgcolor="#FFFFFF">
<! -----DEBRIEFING----->
<hr>
<br>
<h2><a name="Debriefing:End1">Evidence Found!</a></h2>
<br>
<p>
<! ------victory------>
You found the stuff, I am so proud of you!
</p>
<br>

<hr>
<br>
<h2><a name="Debriefing:End2">WHAT DID YOU DO!?</a></h2>
<br>
<p>
<! ------KIA------>
Srsly?
</p>
<br>

<! -----DEBRIEFING END----->

</body>
</html>



  1. #1 by K9 on August 18, 2010 - 5:52 PM

    Sample mission dont work;
    Not Found

    The requested URL /arma2/evidence.zip was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    • #2 by kylania on August 18, 2010 - 8:55 PM

      Oops, silly capital E! Link fixed.

  2. #3 by K9 on August 19, 2010 - 8:42 PM

    work now, thanks

  3. #4 by SINcere on October 11, 2010 - 12:20 PM

    Where and how do we call on the init.sqf, briefing.sqf, and briefing.html? Not sure how I can get this to work. Yeah as you already know I’m a beginner and not to bright sometimes. The answer is probably very apparent, but unfortunately I’m not seeing it.

  4. #5 by Breeze on December 25, 2010 - 11:09 AM

    Kylania could this be done, where the evidence is on an officer and after he dies its able to be taken off the officer.

  5. #6 by WallyJas on January 3, 2011 - 3:51 AM

    Ky, how can we add the evidence to the players kit? I would like to add a mission success trigger to it for when it is returned to base. How do I do that please?

  6. #7 by mia389 on January 7, 2011 - 6:38 PM

    Will the hint goto everyone on the server or will it only goto the person collecting it?

Comments are closed.