Jump to content
Sign in to follow this  
OddballWDI

How to get an Evidence file

Recommended Posts

Has anyone figured out how to pick up an evidence file? dePBO'ed the campain and took a look at mission BitterChill. They named the evidence file "BIS_Cobalt", and there is a script file called actionCollectEvidence.sqf which looks like it has something to do with it. But I can't find any triggers, or anything that references the actionCollectEvidence.sqf file. Does anyone know how this is done? I'd like the player to collect an evidence file in a mission I'm making, but I can't figure out how this was done.

Share this post


Link to post
Share on other sites

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:

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:

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:

taskCompleted tskEvidence1;

End1 Trigger On Act:

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:

execVM "briefing.sqf";

briefing.sqf:

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>

<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> 

Edited by kylania
stupid capital E

Share this post


Link to post
Share on other sites

This worked perfectly! Thanks! It's exactly what I needed.

Share this post


Link to post
Share on other sites

The sample mission above gives me a 404

This kind of mission would be helpful if I could dl it somwhere else maybe?:)

Share this post


Link to post
Share on other sites
The sample mission above gives me a 404

This kind of mission would be helpful if I could dl it somwhere else maybe?:)

Yup. Can someone get up a working link. For some reason what was posted here doesn't work for me. I'm sure I'm doing something wrong but I can't seem to see what's the problem. If I could see it in the Editor it would help me get it solved.

Share this post


Link to post
Share on other sites

Oops! Sorry fixed the link. Forgot my file had a capital E in it. :) Should be good now.

Share this post


Link to post
Share on other sites

Hey thanks a lot kylania, this will surely come in handy :cool:

Share this post


Link to post
Share on other sites

Yes thank you. I'm not sure why this won't work for me. I'll try the mission. :yay:

EDIT:

Thanks again, it worked well. Not sure why my setup didn't work. It was setup the same way.

Edited by Manzilla

Share this post


Link to post
Share on other sites

So the "Collect.sqf" is entered as an additional command in the 'inti' section?

Edited by RazorHead1

Share this post


Link to post
Share on other sites

No razor, the 'collect.sqf' is a file which is placed in your mission folder along with your init.sqf and mission.sqm plus some other files if they are needed.

The 'collect.sqf' is then activated by the way of a trigger when you take the evidence or its activated by another script.

Hope that helps.

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  

×