Jump to content
Sign in to follow this  
thetrooper

Creating a recon mission

Recommended Posts

I would not start too many of these scripts since they each one would check what the player is looking at often. But 2 or 3 should be fine. I assume when you say run separate sqf's you mean spawn it multiple times. There's no need to copy the sqf file.

There are 2 kinds of "events". One that is run when each target is spotted and another that is run when no targets are left or you return true in the first - like you have seen now. How you use them is up to you. You can put if's and whatever into the code that runs for each spotting if you need to do something complicated.

ok, so I could put an action around after say if 'fighter b' is spotted, then...? Or is it more complicated than that?

Kommiekat, best to read from post 18. Bulk of code as an SQF and there's a part about calling it from init file.

Share this post


Link to post
Share on other sites
Sorry to ask but, is that the final coding in post #22 and where does the PHP code go?

The latest is in #18. You are supposed to put this in a file. Call it "recon.sqf" for example. Then in your "init.sqf" you can write this:

//Save the script into MF_Recon
MF_Recon = compile preProcessFile "recon.sqf";

/* Now we want to start a recon task where you must recon at least 5 of the units named f_X in the editor */
_units = [f_1, f_2, f_3, f_4, f_5, f_6];
//This happens when a unit is spotted. If more than 5 return true which means this recon task is over.
_onTargetSpotted = {hint "You spotted af fighter"; count (_this select 2) >= 5};
//What happens when the mission is over?
_onNoTargetsLeft = {hint "Based on intel, town has been declared hostile";};
//Start this recon task
[_units, nil, nil, nil, nil, _onTargetSpotted, _onNoTargetsLeft] spawn MF_Recon;  

TheTropper you can write anything in that code you use. Example where _onNoTargetsLeft is something else in the above case:

/* Variables passed [justSpotted, NotSpotted, alreadySpotted] */

_onNoTargetsLeft = {
    _unitSpotted = _this select 0;
    if (_unitSpotted == f_b) then {
        hint "One of them is carrying a bomb belt!!!";
    } else {
        //If player damaged his vision might be bad?
        if (damage player > 0.5) then {
            hint "Possible fighter might be armed, can't tell for sure";
        } else {
            hint "Enemy units spotted";
        };
    };
    //DON'T stop recon mission so return false. Returning nothing will do the same
   false
};

Share this post


Link to post
Share on other sites

_onSpottedTarget = {hint "You spotted af fighter"; count (_this select 2) >= 5};
//Called when no targets left to spot. _this = [_unitsNotSpotted, _unitsSpotted]
_onNoTargetsLeft = {

_unitSpotted = _this select 0;
     _unitSpotted = _this select 0;
    if (_unitSpotted == war1) then {
        hint "Found a big bad guy";
    };
    //DON'T stop recon mission so return false. Returning nothing will do the same
   false
};

sleep 2;
//Only supposed to show when 5 fighters found
davis SideChat "Hello Zero, this is me, found 5 fighters in the town";

sleep 5;

HQ sideChat "davis, is that you? ok Davis, good job over";

};

ok this is what I got, but when start the mission, it goes to the SideChat, finishing the mission. Where have I gone wrong with this?

Share this post


Link to post
Share on other sites

Define work in MP:

1. How should it work; who get's the mission / can spot? Should everybody on one side get the recon mission/spot opportunity? Or should you be able to customize that it will only be valid for a single squad or just some individuals? Do you keep the task on respawn?

2. Should JIP's get the recon opportunity too?

//Non MP stuff undecided still

- What happens when a target dies before being spotted? Do you still need to spot it? Currently you do.

- What happens when something is deleted by another script and that was the last target you needed. Currently it will complete the task (after a little time).

Sure it could it work in MP if someone invest the time in it. I might do that if I knew what people want.

A far severe problem is that people have trouble using the script. I made it very configurable because people wanted to do different things, like end mission already when only some of the targets have been spotted and etc.. This, however, also makes the script hard to use as can be seen by the last posts.

Edited by Muzzleflash

Share this post


Link to post
Share on other sites

This would be my suggestion.

1) I would just set it so only a few players would be able to spot say 4 max so really just squad leaders or a few snipers teams ( be able to specify there name in the configurations ( i.e. “s1â€, “s2â€,â€s3â€,â€s4†or whatever the players name is)

2) I personally would not worry too much about JIP but that is just me as I mostly play in a clan mission where all Team Leaders /snipers are already in game and we start together.

3) You would not really need end mission In MP as it will probably be just part of the Task or a side mission type thing so just a hint to say Yep you have located xyz – and set a variable to true so they can fire of anything else they need using that variable –

Not seen this type in a MP before and would add another feel to a MP squad game for sure - just wish i could script better have lots of ideas just no goood at scripting :(

BTW works great in SP love it !

Share this post


Link to post
Share on other sites

I didn't mean to actually end the entire mission, but more the "recon task". Eg. you are told so spot 6 tanks, but you only really need to spot 4 of them.

Share this post


Link to post
Share on other sites

Can i get an example mission. ive been at it for hours and i cant get it to work. in what file do i put what. I dont understand and your instructions are unclear to me.

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  

×