Welcome to the Iron Front Fan Forums!
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Fudge

Captain
Registered:
Posts: 223
Reply with quote  #1 
I've been tinkering with the mission editor and set up a tank capture mission. Once there is enough tanks in a certain zone the mission ends using the code

({_x in thisList} count [Sher,Sher_1,Sher_2,Sher_3,Sher_4,SU85,SU85_1,SU85_2,T34,T34_1,T34_2,T34_3,T34_4]) > 2


I would like to be able to replace the 2 with a variable that can be done on the mission parameters. I've got it to show up on there using 


class Params
{
class tanks
{
title = "Number of tanks for Victory";
values[] = {0,1,2,3,4,5,6,7,8};
texts[] = {1,2,3,4,5,6,7,8,9};
default = 2
};
};


But editing my first line to 

({_x in thisList} count [Sher,Sher_1,Sher_2,Sher_3,Sher_4,SU85,SU85_1,SU85_2,T34,T34_1,T34_2,T34_3,T34_4]) > tanks


seems to do nothing. Is there a way to achieve what I'm after? Otherwise I'll just leave it as a hard coded value.

__________________
I have recently discovered the use of smilies and other emotes. They will be featured heavy in my posts for a while.
Stillwanttoplaythescreenshotgame
0
scars09

Sergeant
Registered:
Posts: 73
Reply with quote  #2 
paramtanks i think should work
0
Fudge

Captain
Registered:
Posts: 223
Reply with quote  #3 
Didn't work unfortunately. Going to look into variables and see if I can set one that the parma array can edit and the script can read. Thanks for the rapid help.

({_x in thisList} count [Sher,Sher_1,Sher_2,Sher_3,Sher_4,SU85,SU85_1,SU85_2,T34,T34_1,T34_2,T34_3,T34_4]) > parmatanks

__________________
I have recently discovered the use of smilies and other emotes. They will be featured heavy in my posts for a while.
Stillwanttoplaythescreenshotgame
0
scars09

Sergeant
Registered:
Posts: 73
Reply with quote  #4 
is that a typo? parmatanks?
paramtanks like param(eter)tanks
0
Fudge

Captain
Registered:
Posts: 223
Reply with quote  #5 
Ah yes, I can't read very well it seems . I'll give that a go and report back. Thanks again for the assistance.

Nvm, it was typed paramtanks in the script. I just copied it across to the forum incorrectly.

__________________
I have recently discovered the use of smilies and other emotes. They will be featured heavy in my posts for a while.
Stillwanttoplaythescreenshotgame
0
scars09

Sergeant
Registered:
Posts: 73
Reply with quote  #6 
({_x in thisList} count [Sher,Sher_1,Sher_2,Sher_3,Sher_4,SU85,SU85_1,SU85_2,T34,T34_1,T34_2,T34_3,T34_4]) >= (parmsArray select 0);
0
Fudge

Captain
Registered:
Posts: 223
Reply with quote  #7 
Cheers, that makes sense. I'll give that a go after tea. 
__________________
I have recently discovered the use of smilies and other emotes. They will be featured heavy in my posts for a while.
Stillwanttoplaythescreenshotgame
0
Fudge

Captain
Registered:
Posts: 223
Reply with quote  #8 
Turns out I was hungry for Iron Front and gave it a go. That didn't work either, but I've got it working another method. I'll go grab something to eat, and as long as I've got the time before the 'meet the entebe' event I'll post it tonight. If not I'll get it up tomorrow. Thanks for all the help 
__________________
I have recently discovered the use of smilies and other emotes. They will be featured heavy in my posts for a while.
Stillwanttoplaythescreenshotgame
0
Fudge

Captain
Registered:
Posts: 223
Reply with quote  #9 
Method.

In game:

Trigger set to anybody present
Condition 
({_x in thisList} count [Sher,Sher_1,Sher_2,Sher_3,Sher_4,SU85,SU85_1,SU85_2,T34,T34_1,T34_2,T34_3,T34_4]) >= paramtanks;

The list can be anything set in game but unit names. The trigger will only activate if there is that number or greater in the trigger area. In my case different tanks. Number is set in our parameter. parmtanks is a variable we create in a moment. 

In Mission Folder:

init.sqs
// RECEIVE PARAMETERS FROM MISSION SELECTION SCREEN AND APPLY SETTINGS
#include "scripts\process_params.sqf";

This calls a script files that processes the parameters.

description.ext
class Params
{
class missiontime
{
title = "Time of Day";
values[] = {-1,6,12,18,0};
texts[] = {"Default","Morning","Noon","Evening","Midnight"};
default = -1;
};
class missionweather
{
title = "Weather";
values[] = {-1,0,0.6,1};
texts[] = {"Default","Clear","Overcast","Stormy"};
default = -1;
};
class missionfog
{
title = "Fog";
values[] = {-1,0,0.2,0.6,0.9};
texts[] = {"Default","None","Light","Medium","Heavy"};
default = -1;
};
class tanks
{
title = "Number of tanks for Victory";
values[] = {1,2,3,4,5,6,7,8,9};
texts[] = {1,2,3,4,5,6,7,8,9};
default = 3
};

};

class tanks in the one we have added. Title is what the admin reads in the parameters. Values are hidden, what the game reads and is what sets the number of the variable. Texts relate in the order set. Default is what will be used if nothing is chosen.

process_params,sqf
private ["_paramtime","_paramweather","_paramfog"];

if !(isnil ("paramsarray")) then {

_paramtime = paramsarray select 0;
_paramweather = paramsarray select 1;
_paramfog = paramsarray select 2;
paramtanks = paramsarray select 3;

if (_paramtime >= 0) then {
if (isServer) then {
skipTime ((_paramtime - daytime + 24) % 24);
};
};

if (_paramweather >= 0) then {
0 setOvercast _paramweather;
};

if (_paramfog >= 0) then {
0 setFog _paramfog;
};
};

Goes through the parameters and sets them in game paramtanks creates our variable. = paramsarray select 3: gets the value selected from the 4th parameter array. Count starts at 0.

Thanks again Cars for the help, hopefully this helps others.

__________________
I have recently discovered the use of smilies and other emotes. They will be featured heavy in my posts for a while.
Stillwanttoplaythescreenshotgame
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.