Jump to content

Recommended Posts

Have been searching around and I cannot for the life of me work out how some people do time acceleration from PARAMETERS.

I've had a look through a few missions that have it, unfortunately they have such complex mechanics I honestly cannot make head nor tail of them (Whole Lotta Altis for instance).

Would love to see how this is done through mission params, so that people have a choice at how fast they want the acceleration to go.

Thanks for any help.

Share this post


Link to post
Share on other sites

Look in the modules, they have already added one...

Share this post


Link to post
Share on other sites

Yes but the question was how do I allow people to change it from params ?

Edited by thefinn

Share this post


Link to post
Share on other sites

Maybe start by looking in the functions library within the editor? That might help. :)

I cannot get into arma 3 at the moment, thoughm because my hard drive is currently being repaired.

Share this post


Link to post
Share on other sites

I found it, but am a little iffy on how to use it.

BIS_fnc_moduleTimeMultiplier:

private ["_logic","_activated"];
_logic = [_this,0,objnull,[objnull]] call bis_fnc_param;
_activated = [_this,2,true,[true]] call bis_fnc_param;

if (_activated) then {
if !(_logic call bis_fnc_isCuratorEditable) then {
	private ["_time"];
	_time = _logic getvariable ["timemultiplier",1];
	settimemultiplier (_time max 0.01 min 120);
};
};

My Params class from description.ext:

class Params {
class STARTTIME {
	title = "Mission Start Time";
	values[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24};
	texts[] = {
		"1:00","2:00","3:00","4:00","5:00","6:00","7:00","8:00","9:00","10:00","11:00","12:00",
		"13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00","24:00"
	};
	default = 9;
	function = "BIS_fnc_paramDaytime";
};
};

Would this do?

class Params {
class STARTTIME {
	title = "Mission Start Time";
	values[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24};
	texts[] = {
		"1:00","2:00","3:00","4:00","5:00","6:00","7:00","8:00","9:00","10:00","11:00","12:00",
		"13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00","24:00"
	};
	default = 9;
	function = "BIS_fnc_paramDaytime";
};
class TIMEMULTIPLIER {
	title = "Time Acceleration";
	values[] = {1,2,4,6,8,12};
	texts[] = {"1x","2x","4x","6x","8x","12x"};
	default = 4;
	function = "BIS_fnc_moduleTimeMultiplier";
};
};

Edited by thefinn

Share this post


Link to post
Share on other sites

It looks like it will work. However, the parameters can only be interacted within hosting a server.

Share this post


Link to post
Share on other sites

Defaults should work (time of day does) and ... this doesn't ;)

I really have no idea what I'm doing with this part of description.ext.

Share this post


Link to post
Share on other sites
Maybe start by looking in the functions library within the editor? That might help. :)

I cannot get into arma 3 at the moment, thoughm because my hard drive is currently being repaired.

Do you want to change the time acceleration at mission start through the parameter?

I would write a simple script then which takes a value from the params array.

setTimeMultiplier (paramsArray select 0);

For more details here -> https://community.bistudio.com/wiki/Arma_3_Mission_Parameters

Share this post


Link to post
Share on other sites

Yeah I'm really after a good example of a mission that has that. That would be most helpful, then I can set anything I like in parameters.

Share this post


Link to post
Share on other sites

You don't really need a "functions = " in a param (its just optional apparently)

try this for your "class Params":

class TIMEMULTIPLIER {
 title = "Time Acceleration";
 values[] = {1,2,4,6,8,12};
 texts[] = {"1x","2x","4x","6x","8x","12x"};
 default = 4;
 file = "BIS_fnc_moduleTimeMultiplier.sqf"; 
};

the "file = "BIS_fnc_moduleTimeMultiplier.sqf";" is defining the location of where your ".sqf" script is. (in this case, your sqf file should be called "BIS_fnc_moduleTimeMultiplier.sqf" since you have already stated that :p )

I have provided two links below which will give you a basic understanding of how to use "class Params".

Link: https://community.bistudio.com/wiki/Arma_3_Mission_Parameters#Predefined_Params

The other is just a library of every single script if you are having trouble creating your own script. :)

Link: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3

Hope it helps,

Rawner135

Share this post


Link to post
Share on other sites

It's not like I'm not reading the documentation. It's just that the documentation just mentions things then moves on.

No examples given.

I will try what you put there though.

btw in reading the documentation I realised I need "isGlobal =1;" on the daytime param too otherwise it'll only set time on the server. Apparently the time of day isn't JIP compatible.

---------- Post added at 19:16 ---------- Previous post was at 18:57 ----------

Finally got it thanks to all ;)

---------- Post added at 19:24 ---------- Previous post was at 19:16 ----------

In case anyone gets here by google or search.

Description.ext segment:

class Params {
class STARTTIME {
	title = "Mission Start Time";
	values[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24};
	texts[] = {
		"1:00","2:00","3:00","4:00","5:00","6:00","7:00","8:00","9:00","10:00","11:00","12:00",
		"13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00","24:00"
	};
	default = 9;
	function = "BIS_fnc_paramDaytime";
	isGlobal=1;
};
class TIMEMULTIPLIER {
	title = "Time Acceleration";
	values[] = {1,2,4,6,8,12};
	texts[] = {"1x","2x","4x","6x","8x","12x"};
	default = 4;
};
};

init.sqf segment:

nul=[]execVM "params.sqf";

params.sqf:

setTimeMultiplier (paramsArray select 1);

Edited by thefinn

Share this post


Link to post
Share on other sites

The easiest way to this I find is:

Description.ext

class Params {
class timeAcc {
	title = "Time acceleration";
	values[] = {1, 2, 3, 12};
	texts[] = { "1x", "2x", "3x", "12x" };
	default = 1;
};
};

Init.sqf

if(isServer) then { 
_param = if(isMultiplayer) then { 
	paramsArray select 0  //Change the 0 to whichever index fits your description.ext
} else {  
	1  //Default value for singleplayer can also be used for previewing in the editor, good for debug.
};
setTimeMultiplier _param;
};

Hope that helps.

Edit:

Too slow, glad it worked out!

Share this post


Link to post
Share on other sites

I'm very sorry i've read this topic just now, here is a simple way for time acc. param, according to the new A3 params system without actually make too many scripting and having everything working also for JIP

//TIME ACC:\\
class Timeacc
{
title = "Time Acceleration";
values[] = {1,5,10,15,20,25,30,35,40,45,50,55,60};
texts[] = {"1x (1game min. = 1real min.)","5x","10x","15x","20x","25x","30x (1game min. = 2real sec.)","35x","40x","45x","50x","55x","60x (1game min. = 1real sec.)"};
default = 30;
function = "BIS_fnc_paramTimeAcceleration";
};

Tested and used on many BIS missions and many missions of mine made for my community

regards

Simon

Edited by Simon1279

Share this post


Link to post
Share on other sites

Is thre something wrong with time acceleration module?

 

I managed to have a 4 hours day/night cycle. But right now no matter the number of time acceleration I use. The time don't goes that fast.

It have been added a maximum of time acceleration?

Share this post


Link to post
Share on other sites
30 minutes ago, esfumato said:

Is thre something wrong with time acceleration module?

 

I managed to have a 4 hours day/night cycle. But right now no matter the number of time acceleration I use. The time don't goes that fast.

It have been added a maximum of time acceleration?


MP or SP?

Share this post


Link to post
Share on other sites
5 hours ago, killzone_kid said:


MP or SP?

 

Well what I would like to do is a MP mission Team vs Team. No AI.

 

But I am not taking care about the server, local, global stuff. I don't have experience scripting.

 

For testing, I managed to run the mission playing it with play in multiplayer option of the eden editor and enabled several ai with some waypoints to see if the triggers worked.

 

If somebody wants to give me some hints I did a thread to have all the questions in the same thread.
 

https://forums.bistudio.com/topic/163775-newbie-wants-to-create-mp-game-mode/?p=2822787

 

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

×