Jump to content
Sign in to follow this  
Vicarious

1.56 New features HELP

Recommended Posts

Hi guys, with the release of the new patch/PMC DLC I've been blown away buy some of the new features that really improve atmosphere... but I've been unable to unpack any of these new .pbo files associated with PMC so I cant see how these effects are implemented.

I realize there is a thread already on the video playback features but was wondering if anyone has figure out how to implement these features yet;

- new dust/wind effect with debris (noticeable in the first mission)

- don't know what to call this but its the effect during the first mission, they implemented the credits in an awesome fashion where they where slowly fading in as you approached them in-game

Also any other new tricks and toys that are found in 1.56 would be good to understand.

BTW am I the only one who cant unpack the new .pbo's? I've tried using pboview and cpbo to no avail.

Thanks in advance !!:cool:

Share this post


Link to post
Share on other sites

BIS wiki have many of those new functions already listed:

http://community.bistudio.com/wiki/Category:ArmA_2:_Functions

You only need to place functions module on map and use e.g. these:

[player,-1,0.8,false] call bis_fnc_sandstorm;

_bis_crows = [player,20,8,20] call bis_fnc_crows;

http://community.bistudio.com/wiki/BIS_fnc_3Dcredits

Share this post


Link to post
Share on other sites

Nope :), I just noticed that 3Dcredits seems to crash the game if "call" is used. It works great with spawn:

_nul = ["text",position objectname] spawn BIS_fnc_3Dcredits;

_nul = ["<t color='#56A5EC'>No more </t><t color='#00FFFF'>mines</t><t color='#56A5EC'> to use. Gather unneeded </t><t color='#00FFFF'>minefields</t><t color='#56A5EC'> for reuse with </t><t color='#00FFFF'>0-0-6</t><t color='#FFFFFF'>",position AMMOT] spawn BIS_fnc_3Dcredits;

Share this post


Link to post
Share on other sites

I'm having trouble getting the BIS fnc 3d credits to work here is the synatax

[Vicarious,[1559.74,558.70,1.49],20,1.5] call BIS_fnc_3Dcredits;

I think its to do with my syntax, any ideas? Oh and i already placed the function module on the map.

P.S I'm not very advanced in the editor so please be gentle ;)

---------- Post added at 11:51 PM ---------- Previous post was at 10:33 PM ----------

Nope :), I just noticed that 3Dcredits seems to crash the game if "call" is used

figured it out, thanks again mate ;)

Share this post


Link to post
Share on other sites

Remember that the Vicarious needs to be a string - "Vicarious" or Vicarious="text written here"

This 3Dcredits is a very cool feature. With little changes it also can display changeing variables.

http://img502.imageshack.us/f/arma2oa2010120115035498.jpg/

Here is what I did. All credits still to orginal script author:

3DtextAmmoTruck.sqf:

/*
Author: Karel Moricky (minor changes by SaOk)

Description:
3D credits.

Parameter(s):
_this select 0: STRING - Text
_this select 1: ARRAY - Position in 3D world

Returns:
True
*/
disableserialization;
private ["_text","_pos","_display","_control","_w","_h","_minsDis","_dis","_alpha","_pos2D"];

_text = format  ["<t color='#FDD017'>Status:<br/></t><t color='#56A5EC'>There is </t><t color='#00FFFF'>%1 mines</t><t color='#56A5EC'> to use</t>",MINEC];
_pos = _this select 1;
_minDis = if (count _this > 2) then {_this select 2} else {20};
_fadeDis = if (count _this > 3) then {_this select 3} else {1.5};
if (isnil "BIS_fnc_3dCredits_n") then {BIS_fnc_3dCredits_n = 2733;};

if (typename _pos == typename objnull) then {_pos = position _pos};
if (typename _pos == typename "") then {_pos = markerpos _pos};

BIS_fnc_3dCredits_n cutrsc ["rscDynamicText","plain"];
BIS_fnc_3dCredits_n = BIS_fnc_3dCredits_n + 1;

//#define DISPLAY (uinamespace getvariable "BIS_dynamicText")
//#define CONTROL (DISPLAY displayctrl 9999)

_display = uinamespace getvariable "BIS_dynamicText";
_control = _display displayctrl 9999;

#define DISPLAY	_display
#define CONTROL	_control

CONTROL ctrlsetfade 1;
CONTROL ctrlcommit 0;
CONTROL ctrlsetstructuredtext parsetext _text;
CONTROL ctrlcommit 0;

_w = safezoneW;//0.5;
_h = safezoneH;//0.3;

while {true} do {
_dis = player distance _pos;
_alpha = abs ((_dis / _minDis) - _fadeDis);

if (_alpha <= 1) then {
	_pos2D = worldtoscreen _pos;

	if (count _pos2D > 0) then {
		CONTROL ctrlsetposition [
			(_pos2D select 0) - _w/2,
			(_pos2D select 1) - _h/2,
			_w,
			_h
		];
		_pos = position AMMOT;
		_minee = if (MINEC == 0) then {format["<t color='#C80000'> %1</t>",MINEC];} else {if (MINEC > 25) then {format["<t color='#00FFFF'> %1</t>",MINEC];} else {format["<t color='#FDD017'> %1</t>",MINEC];};};
		_cond = if (alive AMMOT) then {format["<t color='#66FF00'> In Action</t>"];} else {format["<t color='#C80000'> Destroyed</t>"];};
		_ree= if (CUSTOMSETREARM==1) then {format["<t color='#66FF00'> Enabled</t>"];} else {format["<t color='#C80000'> Disabled</t>"];};
		//CONTROL ctrlsetbackgroundcolor [0,0,0,0.5];
		CONTROL ctrlsetstructuredtext parsetext (format["<t color='#FDD017'>Status:<br/></t><t color='#56A5EC'>Condition:</t>"]+ _cond + format["<br/><t color='#56A5EC'>Mines in Cargo:</t>"]+ _minee + format["<br/><t color='#56A5EC'>Auto rearming:</t>"]+_ree);
		CONTROL ctrlsetfade (_alpha^3);
		CONTROL ctrlcommit 0.01;
	} else {
		CONTROL ctrlsetfade 1;
		CONTROL ctrlcommit 0.1;
	};
} else {
	CONTROL ctrlsetfade 1;
	CONTROL ctrlcommit 0.1;
	sleep 0.1;
};
sleep 0.01;
};

In init.sqf:

FUNKTIO_3DTEXTA=compile preprocessFile "3DtextAmmoTruck.sqf";

Ingame via script or trigger:

_nul = ["",position AMMOT,10,1] spawn FUNKTIO_3DTEXTA;

AMMOT is the ammotruck name

MINEC is the dynamic number for carried mines

CUSTOMSETREARM is a variable if there is autorearm near the truck

Edited by SaOk

Share this post


Link to post
Share on other sites

I try to spawn a text and it worked with this command:

_nul = ["text",[969.33,1127.72,0.27]] spawn BIS_fnc_3Dcredits;

But the problem the text is 5m in the air spawned, how can i spawn him nearer to the ground? Thanks!!

Share this post


Link to post
Share on other sites
But the problem the text is 5m in the air spawned, how can i spawn him nearer to the ground? Thanks!!

Hrmm.. trying to figure out this one myself, I'll try getting it to appear on ground level and get back to you.

Share this post


Link to post
Share on other sites

Its that _h in the script. You cant change it trought the parameters, only with exporting the script from Function Library viewer (with [] call bis_fnc_help) and making a new tweaked script with copied data. _h = 1 would be already nearer to the ground.

Share this post


Link to post
Share on other sites
Its that _h in the script. You cant change it trought the parameters, only with exporting the script from Function Library viewer (with [] call bis_fnc_help) and making a new tweaked script with copied data. _h = 1 would be already nearer to the ground.

please for arma beginner scripter again in easy thx!

Share this post


Link to post
Share on other sites
please for arma beginner scripter again in easy thx!

Here is the script exported. I changed the _h which was SafeZoneH to 1. That already lowers the text, but you can change it to other.

Make a textfile named 3dText.sqf with this code:

/*

Author: Karel Moricky

Description:

3D credits.

Parameter(s):

_this select 0: STRING - Text

_this select 1: ARRAY - Position in 3D world

Returns:

True

*/

disableserialization;

private ["_text","_pos","_display","_control","_w","_h","_minsDis","_dis","_alpha","_pos2D"];

_text = _this select 0;

_pos = _this select 1;

_minDis = if (count _this > 2) then {_this select 2} else {20};

_fadeDis = if (count _this > 3) then {_this select 3} else {1.5};

if (isnil "BIS_fnc_3dCredits_n") then {BIS_fnc_3dCredits_n = 2733;};

if (typename _pos == typename objnull) then {_pos = position _pos};

if (typename _pos == typename "") then {_pos = markerpos _pos};

BIS_fnc_3dCredits_n cutrsc ["rscDynamicText","plain"];

BIS_fnc_3dCredits_n = BIS_fnc_3dCredits_n + 1;

//#define DISPLAY (uinamespace getvariable "BIS_dynamicText")

//#define CONTROL (DISPLAY displayctrl 9999)

_display = uinamespace getvariable "BIS_dynamicText";

_control = _display displayctrl 9999;

#define DISPLAY _display

#define CONTROL _control

CONTROL ctrlsetfade 1;

CONTROL ctrlcommit 0;

CONTROL ctrlsetstructuredtext parsetext _text;

CONTROL ctrlcommit 0;

_w = safezoneW;//0.5;

_h = 1;//0.3;

while {true} do {

_dis = player distance _pos;

_alpha = abs ((_dis / _minDis) - _fadeDis);

if (_alpha <= 1) then {

_pos2D = worldtoscreen _pos;

if (count _pos2D > 0) then {

CONTROL ctrlsetposition [

(_pos2D select 0) - _w/2,

(_pos2D select 1) - _h/2,

_w,

_h

];

//CONTROL ctrlsetbackgroundcolor [0,0,0,0.5];

CONTROL ctrlsetstructuredtext parsetext _text;

CONTROL ctrlsetfade (_alpha^3);

CONTROL ctrlcommit 0.01;

} else {

CONTROL ctrlsetfade 1;

CONTROL ctrlcommit 0.1;

};

} else {

CONTROL ctrlsetfade 1;

CONTROL ctrlcommit 0.1;

sleep 0.1;

};

sleep 0.01;

};

Then you would need init.sqf with this code:

FUNKTIO_3DTEXTA=compile preprocessFile "3dText.sqf";

And then ingame via script or trigger, you can create 3dtext with this code:

_nul = ["write text here",position unitname,10,1] spawn FUNKTIO_3DTEXTA;

Edited by SaOk

Share this post


Link to post
Share on other sites

@SaOk

The above code yields no result for me, I can't get the text to display at all when trying it that way... I even changed _h back to SafeZoneH and still get no text at all, is something missing?

Maybe if you could create a sample mission so i could compare what I'm doing wrong? only if you have the time of course, it would be much appreciated.

Share this post


Link to post
Share on other sites

Sorry, there was ";" missing after parsetext _text. I put it back to example. If it still dosent work, I check it again tommorrow, need to go to sleep now. I tried to change my changes back to orginal, but its easy to forget something.

Share this post


Link to post
Share on other sites

For us complete and utter n00bs, can someone please make a demonstration mission implementing the new BIS_fnc_destroyCity and BIS_fnc_sandstorm functions on the Zargabad map?

I have read the information on the biki, including the part about checking if Functions was initialized, and other posts that have popped up talking about how to do it but just can't make it work.

Many thanks in advance.

Humbly,

KaBoNG :o

Share this post


Link to post
Share on other sites
For us complete and utter n00bs, can someone please make a demonstration mission implementing the new BIS_fnc_destroyCity and BIS_fnc_sandstorm functions on the Zargabad map?

I have read the information on the biki, including the part about checking if Functions was initialized, and other posts that have popped up talking about how to do it but just can't make it work.

Many thanks in advance.

Humbly,

KaBoNG :o

I'll whack together a sample mission for you tomorrow mate, I'm off to bed for now its midnight here in the land of OZ ;).

Share this post


Link to post
Share on other sites

The 3d text seems to dissapear after loading a savegame. I think its that my spawn system. I might be going a bad way, but just in case. I use now a crow to detect if the game is loaded with this loop:

3dtextguard.sqf:

private ["_crow"];
_crow = "crow" camcreate [
	getpos crowpos select 0,
	getpos crowpos select 1,
	50];
_nul = ["",position objectname,10,1] spawn FUNKTIO_3DTEXTA;
while {true} do {		
while {isNull _crow} do {
_nul = ["",position objectname,10,1] spawn FUNKTIO_3DTEXTA;
_crow = "crow" camcreate [
	getpos crowpos select 0,
	getpos crowpos select 1,
	50];
};
sleep 2;
};

Now just make the 3dtextguard.sqf run once and it spawns a new 3dtext everytime the old is gone. You need a invisible helipad named crowpos to get it work. ;)

_nul = [] execVM "3dtextguard.sqf";

Edited by SaOk

Share this post


Link to post
Share on other sites

Here you go KaBoNG, I tried to make it as simple as possible for you, here's what I included;

-BIS_fnc_destroyCity

-BIS_fnc_sandstorm

-BIS_fnc_crows

-BIS_fnc_flies

-BIS_fnc_3Dcredits

Just let me know if you need any help, good luck ;)

function_sample

http://www.multiupload.com/REBCSUY0O4

Share this post


Link to post
Share on other sites

Excellent - many thanks. Now I know how to implement functions using triggers.

However, I would rather implement BIS_fnc_destroyCity in the init.sqf so that the city is already destroyed when the mission starts. I have figured out how to add the function to the init.sqf file by deleting the trigger and adding the following two lines to your init.sqf, directly above the "sleep 1;" line:

waituntil {!isnil "bis_fnc_init"};

[rasman,500,42] call bis_fnc_destroyCity;

But this works the same way as your tigger method (i.e. the city isn't destroyed until after the mission starts).

How can I start the mission with the city already destroyed?

Edited by KaBoNG

Share this post


Link to post
Share on other sites
How can I start the mission with the city already destroyed?

Give the player something else to look at as the city is destroyed. Intro video, blackout, whatever.

Share this post


Link to post
Share on other sites

Or make a copy of the script so you dont need to wait for Function module. That way you can call compile preprocess the file from an init field.

if (!isserver) exitwith {};

private ["_center","_areaSize","_seed","_blacklist","_debug","_buildings","_pos","_posX","_posY","_posTotal","_seedLocal"];
_center = _this select 0;
_areaSize = if (count _this > 1) then {_this select 1} else {1000};
_seed = if (count _this > 2) then {_this select 2} else {1138};
_blacklist = if (count _this > 3) then {_this select 3} else {[]};
_debug = if (isnil "_debug") then {false} else {_debug};

if (typename _center == typename "") then {_center = markerpos _center};
if (typename _center == typename objnull) then {_center = position _center};

if (_areaSize < 0) then {_areaSize = 1000;};
if (_seed < 0) then {_seed = 1138;};

_seed =  round(_seed % 42);
if (_seed == 0) then {_seed = 42;};

_buildings = _center nearobjects ["house",_areaSize];
_buildings = _buildings - _blacklist;
{
 _pos = position _x;
 _posX = _pos select 0;
 _posY = _pos select 1;
 _posTotal = _posX + _posY;
 _seedLocal = (_posTotal % _seed) / _seed;

 if (_seedLocal < 0.5) then {
   //_x setdamage 1;
   for "_i" from 1 to 7 do {
     _x sethit [format ["dam%1",_i],1];
     _x sethit [format ["dam %1",_i],1];
   };
   if (_debug) then {_marker =_x call bis_fnc_boundingboxmarker; _marker setmarkercolor "colorred";};
 } else {
   if (_seedLocal > 0.9) then {
     //_x hideobject true;
     _x setdamage 1;
     if (_debug) then {_marker =_x call bis_fnc_boundingboxmarker; _marker setmarkercolor "colorblue";};

   } else {
     _x setdamage 0.5;
     if (_debug) then {_marker =_x call bis_fnc_boundingboxmarker; _marker setmarkercolor "colorgreen";};
   };
 };
} foreach _buildings;

Share this post


Link to post
Share on other sites

looking at the BIS_fnc_destroyCity

what does this do/mean?

seed (Optional): Number - random seed (default is 1138)

Share this post


Link to post
Share on other sites
Or make a copy of the script so you dont need to wait for Function module. That way you can call compile preprocess the file from an init field.

I presume you mean add the script you show in your post to my mission. Exactly where do I put this script (which file, in which place, etc.)? Does it replace the BIS_fnc_destroyCity function?

Remember you're dealing with a n00bie here. ;)

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  

×