Jump to content
Sign in to follow this  
golfpro1286

Can you spot my problem?

Recommended Posts

So my mission used to work, but now something has gone wrong. I was hoping you guys could help me spot the error. So here is what is happening (or not happening I guess);

My mission is to go collect evidence, when the folder is picked up it identifies a target to go kill. That works fine, the task is created using this code in trigger:

Condition:

taskCompleted tskEvidence1 ; 

On Act:

tskobj_2 = player createSimpleTask ["Kill NSK."]; tskobj_2 setSimpleTaskDescription ["Evidence file obtained, NSK and his army has taken over the Vatra Airport. Find and eliminate him..","Kill NSK","Kill NSK"]; tskobj_2 setSimpleTaskDestination markerpos ""; player setCurrentTask tskobj_2; tskobj_2 = true; publicVariable "tskobj_2"; _marker = createMarker ["NSK", position player ];  "NSK" setMarkerType "Flag";  "NSK" setMarkerSize [1, 1];  "NSK" setMarkerDir 0.93884;  "YourMarker" setMarkerText "NSK's Base";  "NSK" setMarkerColor "ColorRed";  "NSK" setMarkerPos getMarkerPos "NSK"; 

The idea is that when I kill him it prompts me to search his body for evidence using following codes. However when I kill him it simply says objective complete. Does not create the third task. Here is the code I am using:

trigger to complete task when he is killed.

condition:

!alive nsk; 

on act:

"2" objStatus "DONE"; tskobj_2 setTaskState "SUCCEEDED"; player setCurrentTask tskobj_3; obj_3 = true; publicVariable "obj_3"; 

Then to set the third task to search his body once he is dead I use this trigger:

condition:

taskcompleted tskobj_2;

on act:

tskobj_3 = player createSimpleTask ["Search NSK's body."]; tskobj_3 setSimpleTaskDescription ["Verify NSK's death by taking his dogtags, also search for any other items of interest.","Search NSK's body.","Search NSK's body."]; task3 setSimpleTaskDestination markerpos "NSK"; player setCurrentTask tskobj_3; hint "Verify NSK's death by taking his dogtags, also search for any other items of interest." ;

Like I said it used to work, can you spot anything that would cause the tskobj_3 to not be created when nsk is killed?

Share this post


Link to post
Share on other sites

try these out:

// complete task 2
"2" objStatus "DONE";
tskobj_2 setTaskState "SUCCEEDED";
player setCurrentTask tskobj_3;
[b][u]obj_3[/u][/b] = true;			// should be tskobj_3
publicVariable "[b][u]obj_3[/u][/b]";		// should be tskobj_3

// create task 3
tskobj_3 = player createSimpleTask ["Search NSK's body."];
tskobj_3 setSimpleTaskDescription ["Verify NSK's death by taking his dogtags, also search for any other items of interest.","Search NSK's body.","Search NSK's body."];
[b][u]task3[/u][/b] setSimpleTaskDestination markerpos "NSK";		// should be tskobj_3
player setCurrentTask tskobj_3;
hint "Verify NSK's death by taking his dogtags, also search for any other items of interest.";

Share this post


Link to post
Share on other sites

Yeah those were corrected even before I posted this, it didn't work. I think the problem has to lie in the completion of tskobj_2 somehow. When I shoot him it says "objective complete" however it does not mark the task as complete or create the new one. This game is so frustrating lol.

Share this post


Link to post
Share on other sites

Try changing:

"YourMarker" setMarkerText "NSK's Base";

to this:

"NSK" setMarkerText "NSK's Base";

It may be detecting undefined variable on "YourMarker" and stopping the script.

--- edit --

It also could be that setCurrentTask tskobj_3 is running before the trigger has opportunity to detect task 2 completed and create task 3.

Move this:

player setCurrentTask tskobj_3; tskobj_3 = true; publicVariable "tskobj_3";

to the end of the "taskcompleted tskobj_2" trigger's onAct code.

Edited by OpusFmSPol

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  

×