Jump to content
Sign in to follow this  
Kommiekat

Evidence inside body then search body

Recommended Posts

I've seen this in other missions and I'd like to know how they do it.

I want to place DogTags on a unit and then his body has to be searched, with the DogTags taken by player to end that objective.

I have no idea where to start much less how to do a Search using the best tags for best search results.

Share this post


Link to post
Share on other sites

Give the bad guy the dog tags.

badguy addWeapon "EvDogTags";

Search body:

// You can add animations here etc.

if (badguy hasWeapon "EvDogTags") then 
   {
            hint "Dog tags were found, mission complete";
            // What ever code you need to complete the mission.
   };

Share this post


Link to post
Share on other sites

Thanks guys, I'll look into it.

Seems knowing what words to put in the SEARCH is half the "fun".

Share this post


Link to post
Share on other sites

Hello again,

I have 5 objectives for my SP mission.

5th mission will be to collect evidence and END1.

I am trying to simulate Kylanias script for "Collect Evidence" into mine but not working.

Kylanias script:http://www.kylania.com/ex/?p=84

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

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

End1 trigger

taskCompleted tskEvidence1;

Briefing sqf

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

collect.sqf

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

My script

Evidence (dog tags)

evi1

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

badguy

badguy addWeapon "evi1";

collect sqf

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

My Briefing:

// Fifth Objective
tskObj5 = player createSimpleTask["Find evidence.."]; 
tskObj5 setSimpleTaskDescription["Search for DogTags. Continue North in-country.", "Find DogTags", "Search for DogTags"];
tskObj5 setSimpleTaskDestination (getMarkerPos "VanVung");
[objNull, ObjNull, tskObj5, "ASSIGNED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

NOTE: it says "....CA\Modules\MP..."

What is the "MP"? Mult-iplayer?

Will this work for SP?

Also, end trigger. I don't know what to do to make mission end with Kylanias script and all of my other objectives combined.

My thinking:Trigger

Activation: Blufor, Present

Condition

(taskCompleted taskObj1) && (taskCompleted taskObj2) && (taskCompleted taskObj3) && (taskCompleted taskObj4) && (taskCompleted taskObj5)

On Act

End1;

I'm also getting "bin/config/weapons/evi1" problems.

Something I'm doing is not right.

I want Player to approach the dead bad guy, use Action to get the DogTags and then mission ends about 30 sec later with cool music I can use as dropdown or maybe later figure out the OUTRO.

HELP!:eek: Thanks guys!

Share this post


Link to post
Share on other sites

You can't give him 'evi1' because that isn't the name of the item. evi1 is a name kylania gave the evidence object. If you want the bad guy to have the dogtags in his gear, then you need to do as Riouken said:

badguy addWeapon "EvDogTags";

But if this is what you want then you don't need to mess around with addaction. Just have a trigger with this condition:

"EvDogTags" in weapons player

This trigger will fire when the player takes the dogtags from the bad guy's gear. Then you can set some variable like

ObjDogTags = true; 

And add that to your end condition.

Share this post


Link to post
Share on other sites

Thanks for your reply, Ranger. Seems I'm getting clearer on this, but still not sure.

What about this code?

(taskCompleted taskObj1) && (taskCompleted taskObj2) && (taskCompleted taskObj3) && (taskCompleted taskObj4) && (taskCompleted taskObj5)

I still need this, yes?

Just to be sure I understand....

Trigger

Activation: Blufor

Present

Type: #End1

Condition

"EvDogTags" in weapons player

On Act

ObjDogTags = true;

Correct so far?

Share this post


Link to post
Share on other sites

Just to be sure I understand....

Trigger

Activation: Blufor

Present

Type: #End1

Condition

"EvDogTags" in weapons player

On Act

ObjDogTags = true;

Correct so far?

None Present is fine. You don't need to use a variable like "ObjDogTags" if your end trigger is just counting task names though. In the activation you can just execute whatever script was going to run to make the task complete. like you had here:

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

I still need this, yes?

(taskCompleted taskObj1) && (taskCompleted taskObj2) && (taskCompleted taskObj3) && (taskCompleted taskObj4) && (taskCompleted taskObj5)

As long as your task names match the ones in that trigger, then that will work, yes.

Edited by 2nd Ranger

Share this post


Link to post
Share on other sites

OK, I've got the addAction working for player to pick up evidence (dogtags) and the objective will "Succeed", problem is, the dogtags are lying on the ground.

Unit name

badguy

Initialization

badguy addWeapon "EvDogTags"; 

DogTags name

evi1

Initialization

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

I even tried Synchronize from dogtags to badguy.

Still not placed inside the badguy.

Share this post


Link to post
Share on other sites

If the player knows the guy will have the dogtags, you don't need addaction and you don't need to put down the dogtags object. You addweapon the dogtags to the badguy and he has them in his inventory. He will be dead, right? You just get them out of his inventory with your gear menu as if you are taking his weapons, and the trigger will detect when the player has them in his gear.

If you still want to use addaction then you need to name the dogtag object, then delete it in your action script, like deletevehicle dogTagObj

Edited by 2nd Ranger

Share this post


Link to post
Share on other sites

First of all, thank you for your help. It's much appreciated.

I'm getting this solved step by step.

So far, you're advice and Rioken with "badguy addWeapon "EvDogTags"; is working.

I am able to kill badguy and retrieve dogtags from him and put in my inventory.

Problem is, it's not showing as "SUCCEED" nor is the mission ending, as that is my 5th and last Objective.

I have three triggers placed near that 5th obj:

1st

Blufor

Present

Condition:

this; "EvDogTags" in weapons players

On Act

tskObj5 setTaskState "Succeeded"; taskhint ["Dog Tags acquired !\nTask Complete", [0.600000,0.839215,0.466666,1], "taskDone"];

Note: This is not showing up.

2nd

Blufor

Present

min 30 mid 30 max 30

Type: End #1

Condition:

triggerActivated trgAllTasksComplete

On Act:

"nothing is written here"

Note: Not ending mission

3rd

None

Present

Name: trgAllTasksComplete

Condition:

taskState tskObj1 == "Succeed" && taskState tskObj2 == "Succeed" && taskState tskObj3 == "Succeed" && taskState tskOj4 == "Succeed" && taskState tskObj5 == "Succeed"  

On Act

hintSilent "Game will end in 30 second"

Note: Still not ending the mission

I don't know what is going on.

Here is my Briefing....in brief..

// Fifth Objective
tskObj5 = player createSimpleTask["Find dog tag evidence.."]; 
tskObj5 setSimpleTaskDescription["Search for DogTags. Continue North in-country.", "Find DogTags", "Search for DogTags"];
tskObj5 setSimpleTaskDestination (getMarkerPos "VanVung");
[objNull, ObjNull, tskObj5, "ASSIGNED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

// Fourth Objective
tskObj4 = player createSimpleTask["Recon Mau Nau Nam."]; 
tskObj4 setSimpleTaskDescription["Recon Mau Nau Nam for U.S. trooops. This means going in-country. Watch for booby traps!", "Recon Mau Nau Nam", "Mau Nau Nam"];
tskObj4 setSimpleTaskDestination (getMarkerPos "MauNauNam");


// Third Objective
tskObj3 = player createSimpleTask["Recon neighboring village for U.S. presense."]; 
tskObj3 setSimpleTaskDescription["Recon Tim Lat for U.S. presence and destroy any munitions you come across.", "Recon Tim Lat", "Recon Tim Lat"];
tskObj3 setSimpleTaskDestination (getMarkerPos "TimLat");



// Second Objective
tskObj2 = player createSimpleTask["Recon Van Mieu for U.S. presense."]; 
tskObj2 setSimpleTaskDescription["Recon old French Fort for U.S. presence and destroy any munitions you come across.", "Recon Van Mieu", "Recon Van Mieu"];
tskObj2 setSimpleTaskDestination (getMarkerPos "VanMieu");



// First Objective
tskObj1 = player createSimpleTask["Recon Ha Nam for U.S. presense."]; 
tskObj1 setSimpleTaskDescription["Recon Ha Nam village and destory any munitions you come across.", "Recon Ha Nam", "Recon Ha Nam"];
tskObj1 setSimpleTaskDestination (getMarkerPos "HaNam");

Share this post


Link to post
Share on other sites

This first condition field is wrong, you can not use ; in a condition field. Also the player command does not have an s on the end, its sigular, its a local command.

Wrong:

 this; "EvDogTags" in weapons players 

I'm at work right now so I can't test but try this:

 ("EvDogTags" in (weapons player)) 

Share this post


Link to post
Share on other sites

OK, I'm getting SUCCEED with that code of yours! Thanks for that.

Getting closer to finishing this mission.

I still can't get the mission to end though. I have no idea what's going on.

Nothing changed in those triggers except your code.

Any ideas? Should be a simple fix. Either I've got too little or not enough of something.

Share this post


Link to post
Share on other sites

Try using a boolen variable to start the second trigger:

first trigger:

onActivation

[color="Red"]mypubvariable1 = true[/color];tskObj5 setTaskState "Succeeded"; taskhint ["Dog Tags acquired !\nTask Complete", [0.600000,0.839215,0.466666,1], "taskDone"];

Second Trigger:

condition field

mypubvariable1

Share this post


Link to post
Share on other sites

OK, changed per your request and looking good, except....it ends at the 30 sec time I set, or ends immediately if I take the timers out...

(This is working like a charm!)

tskObj3 Trigger

Bluefor

Present

Cond:

("EvDogTags" in (weapons player))

On Act:

tskObj5 setTaskState "Succeeded"; taskhint ["Dog Tags acquired !\nTask Complete", [0.600000,0.839215,0.466666,1], "taskDone"];

2nd Trigger

None

Present

Name: mypubvariable1

Cond:

[color="Red"]mypubvariable1 = true;[/color]taskState tskObj1 == "Succeed" && taskState tskObj2 == "Succeed" && taskState tskObj3 == "Succeed" && taskState tskOj4 == "Succeed" && taskState tskObj5 == "Succeed" 

On Act:

hintSilent "Game will end in 30 second"

3rd Trigger

Blufor

Present

Time Out: 30,30,30

End #1

Cond:

mypubvariable1

On Act:

(No code written here. Do I need something here?)

Thanks a lot for your help!

Share this post


Link to post
Share on other sites

Try it like this:

OK, changed per your request and looking good, except....it ends at the 30 sec time I set, or ends immediately if I take the timers out...

2nd Trigger

None

Present

Name: mypubvariable1 mytrigname /// dont name objects the same as your variables this is probably your problem!

Cond:

taskState tskObj1 == "Succeed" && taskState tskObj2 == "Succeed" && taskState tskObj3 == "Succeed" && taskState tskOj4 == "Succeed" && taskState tskObj5 == "Succeed" 

On Act:

hintSilent "Game will end in 30 second";[color="Red"]mypubvariable1 = true;[/color]

3rd Trigger

Blufor

Present

Time Out: 30,30,30

End #1

Cond:

mypubvariable1

On Act:

(No code written here. Do I need something here?)

Thanks a lot for your help!

Share this post


Link to post
Share on other sites

Task Obj5 is showing Succeed, but mission is just not completing.

I'm lost. Tried all kinds of different combinations. Not working.

Have to somehow combine all my tskObj's with the last EVI1 task to complete.

Should be easy, but I'm missing something. Will have to research more.

Any ideas is much appreciated and thanks for your help so far.

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  

×