Jump to content
gc8

[RELEASE] Side missions script

Recommended Posts

This is a release of my side missions scripts that I am working on. What it does is that it creates 5 (Currently) simple missions for the player to complete. The missions are Free captives, Access computer, Assassinate officer and Destroy radar. The missions can also be considered as main missions, whatever suits your needs.

 

You can use this script to create side missions in your mission.

The scripts are still WIP and may have bugs and they are not yet tested on dedicated server, although should work.

 

If you find any bugs you can report them here. Also if you have any suggestions/request of what kind of side missions should be supported feel free to ask here.

I have created the first 5 side missions in what kind of missions would the special forces do, mind set. So if you have requests it should preferably be with that mind set.

 

Note: This script does not create enemies, only the mission target objects/men

 

Download:

https://drive.google.com/open?id=1b9fYl8BA1gIQyfFPYvghQ5yNlFY2JH6C 

 

Usage:

Extract the zip to your user missions folder and play. Check map for mission assigning and info

 

Starting side mission can be achieved by single line:

 

[getmarkerpos "misCap",west,"FreeCaptives"] call startSideMission;

 

 

If you want to make the script compatible with your missions you should edit the misImplement.sqf file under sideMissions folder. In there you define base position (where captives are transferred) etc.

 

To use in your mission you only need to get the code from init.sqf and of course the sideMissions/compositions folders

 

Have fun! 😄

  • Like 9

Share this post


Link to post
Share on other sites

Released new version!

The missions now support setting up the mission objects from composition. Also changed the eliminate officer mission name

 

  • Like 4

Share this post


Link to post
Share on other sites
19 hours ago, rob4545 said:

ahoj prosím, kam zadejte text TASK ID 

Děkuji

 

Sorry, only english please 🙂

 

  • Like 1

Share this post


Link to post
Share on other sites

Hi, is it possible to assign these missions to two factions simultaneously? For example, Indfor. My next question is will you continue to develop this script? Will you add more missions or something?

Share this post


Link to post
Share on other sites

PS. I don't know why, but the title and mission description are not shown in the game. Is it normal?

Share this post


Link to post
Share on other sites
15 hours ago, DiaZ35 said:

Hi, is it possible to assign these missions to two factions simultaneously?

 

you mean sides or factions? you can give any side (west,east,) as many missions you want

 

 

15 hours ago, DiaZ35 said:

My next question is will you continue to develop this script?

 

Sure if there's something I can add

 

 

15 hours ago, DiaZ35 said:

Will you add more missions or something?

 

If you give me new mission ideas what to add 🙂

 

 

14 hours ago, DiaZ35 said:

PS. I don't know why, but the title and mission description are not shown in the game. Is it normal?

 

The side mission texts are not shoving? Could it be difficulty setting?

 

Edited by gc8
missions

Share this post


Link to post
Share on other sites

I don't think this is a problem with the difficulty settings. I guess it's some error in the code or that I'm from Poland and use Polish in Arma 3, which causes the name and description of the mission not to be displayed. Here I'm sending you a screenshot of what it looks like for me. https://imgur.com/EbOhMcQ

Share this post


Link to post
Share on other sites

I would be grateful if you could help me solve this problem and if you could tell me how to add mission rewards. When it comes to scripts, I am a complete noob, I can edit a ready script, but when it comes to writing something myself, I have a big problem here

Share this post


Link to post
Share on other sites

Thanks for the quick reply. Now it works as it should, even new objects have appeared that were not there before. But while testing the mission, I got two bugs in eden editor. The missions run despite these bugs, so I don't know if I should worry about it. https://imgur.com/a/TuK8jUU

I have one more request, can you give me a sample script for a reward after completing the mission? For example, an item crate that respawns next to the player after completing the mission?

Share this post


Link to post
Share on other sites

@DiaZ35 thanks for letting me know about the bugs.. will look into it

 

do you have variable or something where you want the reward to go?

 

I personally use player setVariable ["money",1000]; to give player money

  • Like 1

Share this post


Link to post
Share on other sites

Uploaded new version, bugs fixed!

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the example and for fixing the errors very quickly. When it comes to the new mission, maybe something like "Clear the area of enemies" or "Destroy the enemy's weapon store", "Steal a vehicle", "Receive a supply drop"

  • Like 2

Share this post


Link to post
Share on other sites

I like ambush missions, search and destroy, recon, call in air support and defend from counterattack.

 

OP you mention your missions do not include the enemies? I am work i will need to dl the script and open later at home.

  • Like 1

Share this post


Link to post
Share on other sites
39 minutes ago, jandrews said:

OP you mention your missions do not include the enemies?

 

nope, that is left for mission makers to create 🙂

 

Share this post


Link to post
Share on other sites

Ok. I had a chance to look in the folder.  The compositions are nice.  If I wanted to make new versions is it as easy as replacing the named file?  I presume so.  However you have directions and angles added so perhaps not.

 

The laptop could use some access and download info with a timer to add since you may be hacking the pc.  And once hacked may be that leads to other side missions opening like capture the unit and save the unit, locate the enemy ammo storage and blow, locate the terrorist camp and destroy, etc..

 

Other ideas, 

 

Destroy radio tower, destroy comms station,  destroy electricity grid and black out a sector or region.

 

Destroy cargo ships with explosives, destroy/ fix convoy, support missions like protect the unit from point a to b, deliver ammo to fob, provide support to fob under attack,  

 

Guerrilla warfare tactics, like disrupt and sabatoge, 

 

Lrrp ops, having to get supply drops to maintain long range patrols, patrol/ recon areas, small group hit and run tactics,  cover of darkness ops, red dawn (original) type ambushes.

 

option to sequence missions instead of all spawning at once for specific order?

 

In your opinion whats best way to add units? Via script in mission file? Alivemod?

 

I will look more in to file this weekend and see what I can add.

 

Its a good start.

 

 

 

 

 

 

  • Like 2

Share this post


Link to post
Share on other sites

@jandrews yes you can replace the composition files and if you want new compositions (and are good in coding) you can change the composition in missions.h or create new missions with new comps.

 

you have good mission ideas just that maybe little bit too complicated some of them  🙂

 

easiest way to add units would of course be the editor. I haven't really dived in the existing scripts to do this as I always write my own scripts that are a part of bigger project...

Share this post


Link to post
Share on other sites

I uploaded new version where I have cleared the init.sqf from unnecessary code that  I forgot there which probably just confused you

 

To learn how to start the side missions look at this code in init.sqf:

 

[getmarkerpos "misCap",west,"FreeCaptives"] call startSideMission;
[getmarkerpos "misLaptop",west,"AccessComputer"] call startSideMission;
[getmarkerpos "misRadar",west,"DestroyRadar"] call startSideMission;
[getmarkerpos "tmis",west,"EliminateEnemy"] call startSideMission;
[getmarkerpos "off",west,"CaptureOfficer"] call startSideMission;

 

Those five lines create five missions for west side in the given marker position

 

Share this post


Link to post
Share on other sites

Hi, I ran into another problem with the side mission script everything works but the mission reward is only given to the host. Do you know how I could change my current code so that the player and his team that completed the mission would receive a reward? Or at least all players of a given side get a reward?

 

// modify this function for reward on completing mission
onSideMissionComplete =
{
 params ["_misConf","_reward","_completers","_helpers"];
 [500,0] call HG_fnc_addOrSubXP;
 [500, 0] call HG_fnc_addOrSubCash;
 // Todo: Give money to player
 
 
 player globalchat format ["--> %1 - %2 - %3 - %4",configname _misConf, _completers, _helpers, floor time ];
 
};

 

Share this post


Link to post
Share on other sites

I have one more question, is it possible to set up automatic restart of tasks so that they can be renewed after some time?

Share this post


Link to post
Share on other sites
17 hours ago, DiaZ35 said:

Hi, I ran into another problem with the side mission script everything works but the mission reward is only given to the host. Do you know how I could change my current code so that the player and his team that completed the mission would receive a reward? Or at least all players of a given side get a reward?

 

yes you can loop through the _completers array and give reward to each one. but  I don't think you can use the HG_fnc_addOrSubXP function if it does not take player as parameter

 

 

17 hours ago, DiaZ35 said:

I have one more question, is it possible to set up automatic restart of tasks so that they can be renewed after some time?

 

sure is. here's example code:

 

 


if(isServer) then 
{

_forSide = west; // for west only

_misTypes = ["FreeCaptives","AccessComputer","DestroyRadar","EliminateEnemy","CaptureOfficer"];

while { true } do
{

 _runningMisTypes = _forSide call smGetRunningMissionTypesForSide;

 // If no missions running
 if(count _runningMisTypes == 0) then
 {
  _mtype = selectRandom _misTypes; // Get random mission type

  _misPos = getmarkerpos "testMisPos"; // Get mis pos (put more positions here)

  [_misPos,_forSide,_mtype] call startSideMission;
 };

 sleep 2;
};


};

 

something like that. code not tested

 

with that code you don't need to call startSideMission anywhere else just let the script do it's thing

  • Like 1

Share this post


Link to post
Share on other sites

I made some changes so that you need to edit the misImplement.sqf file so that the script knows where is your base etc. New version uploaded

Share this post


Link to post
Share on other sites
3 hours ago, gc8 said:

yes you can loop through the _completers array and give reward to each one. but  I don't think you can use the HG_fnc_addOrSubXP function if it does not take player as parameter

Thanks for the help but can you show me an example using _completers and HG_fnc_addOrSubXP?

 

3 hours ago, gc8 said:

sure is. here's example code:

Where should I put this code to make everything work as it should?

Share this post


Link to post
Share on other sites
19 minutes ago, DiaZ35 said:

Thanks for the help but can you show me an example using _completers and HG_fnc_addOrSubXP?

 

the problem is HG_fnc_addOrSubXP doesn't take player as argument

 

so I can only give you this:

 

// modify this function for reward on completing mission
onSideMissionComplete =
{
 params ["_misConf","_reward","_completers","_helpers"];
 

{

 // give money/XP to _x (player)

} foreach _completers;
 
 
 player globalchat format ["--> %1 - %2 - %3 - %4",configname _misConf, _completers, _helpers, floor time ];
 
};

 

 

19 minutes ago, DiaZ35 said:

Where should I put this code to make everything work as it should?

 

at the bottom of init.sqf is one place. but make it server only by putting appropriate code:

 

if(isServer) then {  };

 

I modified the code to include that

  • Like 1

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

×