Jump to content
Sign in to follow this  
Azza FHI

how to do rolling jumbled text in intros

Recommended Posts

hi guys, I hope u know what I mean. u know the text that rolls across the screen in the bottom corner jumbling the letters and then forms the title, date etc. I haven't found anything by searching coz I don't know what its called, saying that I found how to do it in A2 but was wondering if this is how u do it in A3 or is there a better way?

thanks

Share this post


Link to post
Share on other sites
hi guys, I hope u know what I mean. u know the text that rolls across the screen in the bottom corner jumbling the letters and then forms the title, date etc. I haven't found anything by searching coz I don't know what its called, saying that I found how to do it in A2 but was wondering if this is how u do it in A3 or is there a better way?

thanks

Try the arma 2 way, if that doesnt work post back and im sure sombody in the commuity will help you

Share this post


Link to post
Share on other sites

This one?

["First Blood", str(date select 2) + "." + str(date select 1) + "." + str(date select 0), "Altis"] call BIS_fnc_infoText;

Share this post


Link to post
Share on other sites

Does anybody know the exact method for what BIS are using in the campaign?

Share this post


Link to post
Share on other sites

Hey Kydoimos;-),


/*
Author: Jiri Wainar

Description:
Display OSD with location, time and possibly some other campaign related info.

Parameter(s):
_this select 0: array (optional)	- position (default: player's position)
_this select 1: array (optional)	- date in format [_year,_month,_day,_hour,_min] (default: current date)

Example:
[] call BIS_fnc_camp_showOSD;

Returns:
- nothing -
*/

private["_fn_getSector"];

_fn_getSector =
{
private["_map","_posX","_posY","_gridX","_gridY","_secWidth","_secHeight"];
private["_bottomLeftX","_bottomLeftY","_topRightX","_topRightY"];

_map = toLower worldName;

if !(_map in ["altis","stratis"]) exitWith
{
	-1
};

if (_map == "stratis") then
{
	_bottomLeftX = 1302;
	_bottomLeftY = 230;
	_topRightX   = 6825;
	_topRightY   = 7810;
}
else
{
	_bottomLeftX = 1765;
	_bottomLeftY = 4639;
	_topRightX   = 28624;
	_topRightY   = 26008;
};

_posX = _this select 0;
_posY = _this select 1;

//check if player is outside the map grid
if !(_posX > _bottomLeftX && _posX < _topRightX && _posY > _bottomLeftY && _posY < _topRightY) exitWith
{
	0
};

//offset player pos to [0,0]
_posX      = _posX - _bottomLeftX;
_posY      = _posY - _bottomLeftY;

_secWidth  = (_topRightX - _bottomLeftX)/3;
_secHeight = (_topRightY - _bottomLeftY)/3;

_gridX = floor (_posX/_secWidth);
_gridY = floor (_posY/_secHeight);

((_gridY * 3) + _gridX + 1)
};


private["_position","_date","_output","_showDate","_showLocation","_showMap"];
private["_tLoc","_tMap","_tDate","_tTime","_tTimeH","_tTimeM","_tDay","_tMonth","_tYear"];

_showDate 	= true;


_position  	= [_this, 0, getPos player, [[]]] call BIS_fnc_param;
_date 	   	= [_this, 1, date, [[]]] call BIS_fnc_param;
_tMap		= [_this, 2, "auto", [""]] call BIS_fnc_param;
_tLoc		= [_this, 3, "auto", [""]] call BIS_fnc_param;

if (_tMap != "") then
{
_showMap = true;
}
else
{
_showMap = false;
};

if (_tLoc != "") then
{
_showLocation = true;
}
else
{
_showLocation = false;
};

//get map text
if (_showMap && _tMap == "auto") then
{
private["_sector","_map","_template"];

_sector = _position call _fn_getSector;

if (_sector == -1) then
{
	["Map not recognized! Only 'Altis' and 'Stratis' are supported."] call BIS_fnc_error;

	_showMap 	= false;
	_showLocation 	= false;
};

_map = gettext (configfile >> "cfgworlds" >> worldname >> "description");

_template = switch (_sector) do
{
	case 1: {localize "STR_A3_SectorNorthWest"};
	case 2: {localize "STR_A3_SectorSouth"};
	case 3: {localize "STR_A3_SectorSouthEast"};
	case 4: {localize "STR_A3_SectorWest"};
	case 5: {localize "STR_A3_SectorCentral"};
	case 6: {localize "STR_A3_SectorEast"};
	case 7: {localize "STR_A3_SectorNorthWest"};
	case 8: {localize "STR_A3_SectorNorth"};
	case 9: {localize "STR_A3_SectorNorthEast"};

	default
	{
		_showLocation = false;

		//hardcoded for Stratis and Altis only
		if (worldname == "Stratis") then
		{
			localize "STR_A3_NearStratis"
		}
		else
		{
			localize "STR_A3_NearAltis"
		};
	};
};

_tMap = format[_template,_map];
};

//get current location text
if (_showLocation && _tLoc == "auto") then
{
private["_locations","_loc"];

_locations = nearestLocations [getPos player, ["NameCity","NameCityCapital","NameLocal","NameMarine","NameVillage"], 500];

//filter-out locations without names
{
	if (text _x == "") then
	{
		locations set [_forEachIndex, objNull];
	};
}
forEach _locations; _locations = _locations - [objNull];

if (count _locations > 0) then
{
	_loc = _locations select 0;

	if ((getPos player) in _loc) then
	{
		_tLoc  = text _loc;
	}
	else
	{
		_tLoc = format[localize "STR_A3_NearLocation", text _loc];		//tolocalize: "Poblíž lokace %1"
	};
}
else
{
	_tLoc = "";
	_showLocation = false;
};
};

//get daytime data
_tYear 	= _date select 0;
_tMonth = _date select 1;
_tDay 	= _date select 2;

if (_tMonth < 10) then {_tMonth = format["0%1",_tMonth]};
if (_tDay < 10) then {_tDay = format["0%1",_tDay]};

//get date text
_tDate = format["%1-%2-%3",_tYear,_tMonth,_tDay];

//get time text
_tTimeH = _date select 3;
_tTimeM = _date select 4;

if (_tTimeH < 10) then {_tTimeH = format["0%1",_tTimeH]};
if (_tTimeM < 10) then {_tTimeM = format["0%1",_tTimeM]};

_tTime = format["%1:%2",_tTimeH,_tTimeM];


//sum the output params & print it
_output =
[
[_tDate,"<t size='1.0' font='PuristaMedium'>%1</t>",0],
[_tTime,"<t size='1.0' font='PuristaBold'>%1</t><br/>",5]
];

if (_showLocation) then
{
_output = _output + [[toUpper _tLoc,"<t size='0.9' font='PuristaBold'>%1</t><br/>",5]];
};

if (_showMap) then
{
_output = _output + [[_tMap,"<t size='0.9'>%1</t><br/>",30]];
};

[_output,-safezoneX,0.85,"<t color='#FFFFFFFF' align='right'>%1</t>"] spawn BIS_fnc_typeText;

Worked fine for me until one of the last dev patches then it throw an error but it was still working.

Saw that you had too threads, was the wrong, but here´s also the other:

_month = str (date select 1);
_day = str (date select 2);
_hour = str (date select 3);
_minute = str (date select 4);

if (date select 1 < 10) then {_month = format ["0%1", str (date select 1)]};
if (date select 2 < 10) then {_day = format ["0%1", str (date select 2)]};
if (date select 3 < 10) then {_hour = format ["0%1", str (date select 3)]};
if (date select 4 < 10) then {_minute = format ["0%1", str (date select 4)]};

_time = format ["%1:%2", _hour, _minute];
_date = format ["%1/%2/%3", _day, _month, str (date select 0)];

_text = format [("<t align = 'right'>%1, %2<br/>" + "SAS Team Royal Lion 43<br/>Mission - Lion Claw"), _time, _date, "<br/>"];
[parseText _text, [safeZoneX + safeZoneW - 0.35 - 0.025, safeZoneY + safeZoneH - 0.25 - 0.05, 0.35, 0.15], [9, 6]] spawn 
{
private ["_content","_","_pos","_size","_duration","_posX","_posY","_posW","_posH","_sizeX","_sizeY","_sizeW","_sizeH","_display","_xList","_yList","_gridsDef","_grids","_index","_ix","_iy","_group","_groupContent","_color","_alpha"];

disableserialization;
_content = [_this,0,"#(argb,8,8,3)color(1,0,1,1)",["",parsetext ""]] call bis_fnc_param;
_pos = [_this,1,[0,0,1,1],[[]],4] call bis_fnc_param;
_size = [_this,2,10,[0,[]]] call bis_fnc_param;
_duration = [_this,6,10,[0]] call bis_fnc_param;
if (typename _size == typename 0) then {_size = [_size,_size]};

_posX = _pos select 0;
_posY = _pos select 1;
_posW = _pos select 2;
_posH = _pos select 3;

_sizeX = _size select 0;
_sizeY = _size select 1;
_sizeW = _posW / (_size select 0);
_sizeH = _posH / (_size select 1);

128 cutrsc ["RscTilesGroup","plain"];
_display = uinamespace getvariable "RscTilesGroup";

_xList = [0,1,2,3,4,5,6,7,8,9];
_yList = [0,1,2,3,4,5,6,7,8,9];
_xList resize _sizeX;
_yList resize _sizeY;
_gridsDef = [];
for "_x" from 0 to (_sizeX - 1) do {
	for "_y" from 0 to (_sizeY - 1) do {
		_gridsDef = _gridsDef + [[_x,_y]];
	};
};
_grids = +_gridsDef;

while {count _grids > 0} do {

	_index = floor random (count _grids - 1);
	_grid = _grids select _index;
	_grids set [_index,-1];
	_grids = _grids - [-1];

	_ix = _grid select 0;
	_iy = _grid select 1;

	//--- Group
	_group = _display displayctrl (1000 + _ix * 10 + _iy);
	_group ctrlsetposition [
		_posX + _ix * _sizeW,
		_posY + _iy * _sizeH,
		_sizeW,
		_sizeH
	];
	_group ctrlcommit 0;


	//--- Content
	if (typename _content == typename "") then {
		_groupContent = _display displayctrl (1200 + _ix * 10 + _iy);
		_groupContent ctrlsettext _content;
	} else {
		_groupContent = _display displayctrl (1100 + _ix * 10 + _iy);
		_groupContent ctrlsetstructuredtext _content;
	};
	_groupContent ctrlsetposition [
		- _ix * _sizeW,
		- _iy * _sizeH - 0.1 + random 0.2,
		_posW,
		_posH
	];
	_color = random 0.5;
	_alpha = if (random 1 > 0.1) then {0.3} else {0};
	_groupContent ctrlsetbackgroundcolor [_color,_color,_color,_alpha];
	_groupContent ctrlsetfade 1;
	_groupContent ctrlcommit 0;

	//--- Animate
	_groupContent ctrlsetposition [
		- _ix * _sizeW,
		- _iy * _sizeH,
		_posW,
		_posH
	];
	_groupContent ctrlsetfade 0;
	_groupContent ctrlcommit (random 0.3);
	sleep 0.01;
};


sleep _duration;


_grids = +_gridsDef;
while {count _grids > 0} do {

	_index = floor random (count _grids - 1);
	_grid = _grids select _index;
	_grids set [_index,-1];
	_grids = _grids - [-1];

	_ix = _grid select 0;
	_iy = _grid select 1;

	if (typename _content == typename "") then {
		_groupContent = _display displayctrl (1200 + _ix * 10 + _iy);
	} else {
		_groupContent = _display displayctrl (1100 + _ix * 10 + _iy);
	};

	_groupContent ctrlsetposition [
		- _ix * _sizeW,
		- _iy * _sizeH - 0.1 + random 0.2,
		_posW,
		_posH
	];
	_groupContent ctrlsetbackgroundcolor [0,0,0,0];
	_groupContent ctrlsetfade 1;
	_groupContent ctrlcommit (random 0.3);
	sleep 0.01;
};
true;
};

Edited by KingoftheSandbox

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  

×