Jump to content
Sign in to follow this  
garbol87

Read File = Objective completed.

Recommended Posts

So I'm making a little something in the editor and I have one of those things that when you have a cool Idead for a mission and plenty time to do it, you either lack a skill or script... And I lack at both :) So I need your help guys.

For example I have a co-op mission whit 8 player max on Insurgents side what I want to do is: any of the player when gets near the "File" (there is empty object in editor by that name, and I named the object as file1), I want the player (but every player can do that) to be able to "read" the file.

And when They do, I want a new task to appear marking a location on object position on map.

speaking simply: file contains information on a traitor INS that has a random spawn (placment radius) and after players read the file it gives away his position or spawn him somewhere random. Hope that clears it up.

Share this post


Link to post
Share on other sites

Okay. I can't test this because I have no ArmA nearby, but I think it should work.

1: Make a trigger trigger with whatever size you want, and make it INDEPENDENT PRESENT and make it repeatable. If you want the player to have to remain near the document for a while to 'read' it you can add a 'Timeout' delay in the trigger of however many seconds you want (remember to fill in both the Min, Mid and Max fields)

Leave the Condition field with 'this' in it (I assume there are no other Independents that might get close enough to trigger it?)

2: In the On Activation there's lots of work to do. You need to create a new task, a description for the task, set it as current task, give it a marker, and do that for all the players. I think the following code should work:

{ tskFindTraitor = _x createSimpleTask ["Get to the traitor!"]; tskFindTraitor setSimpleTaskDescription ["Get to the location found in the documents to find the traitor.", "Get to the traitor!", "Traitor"]; tskFindTraitor setSimpleTaskDestination (getPos TratorDude); _x setCurrentTask tskFindTraitor; Nil = [objNull, ObjNull, tskFindTraitor, "CREATED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf" } forEach [p1,p2,p3,p4,p5,p6,p7,p8].

So, in order, the above code creates a new task, gives it a description, gives it a marker, sets the task as the current task, and lastly gives a hint popup so people are aware they've got the task. This assumes that the playable units all are named p1-p8.

I'm not 100% that the above works (due to locality in multiplayer and stuff) but I hope it is of help anyway :)

Edited by Inkompetent

Share this post


Link to post
Share on other sites

Instead of a trigger you could also add the "read file" as action to the file-object.

Share this post


Link to post
Share on other sites

Inkompetent - Thanks for the time and sugestion will try that, thanks.

Tajin - explain please, I'am intrigued. Some example or trmplate would be welcomed.

Share this post


Link to post
Share on other sites

_file = nameofobject addAction ["Read file", "readfile.sqf"]

replace nameofobject with the name of your object in editor

would add to the action list 'Read File' when you are close to the object. If you click the action is will launch the script readfile.sqf ...of course you can use any script name you like, just make sure it exists

Share this post


Link to post
Share on other sites

Thanks man, Where do I actually put it? And I should put the code in readfile.sqf that Inkompetent has suggested?

Share this post


Link to post
Share on other sites

Ok guys I got it working! Thank you very much for your help :)

Share this post


Link to post
Share on other sites
Ok guys I got it working! Thank you very much for your help :)

Any chance you could post here how you did? I bet there are quite a few (especially of the new mission-makers) that would love to see how you did it! :)

Oh, and have you tried it in multiplayer? I'm not entirely sure my code will run as it should on the machine of the players other than the one that read the text.

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  

×