User Tools

Site Tools


arma:misc

Misc Stuff

Area where all misc stuff is placed, before proper place can be found them (if any).

Default Installation Files

Default installation files from your DVD.

User Interface

When using desktop and ArmA resolution of 1024×768 and your user interface image files are 1280×1024 you'll encounter some memory errors and ArmA will crash.

Here is example images in question:

class RscDisplayLoadMission : RscStandardDisplay
{
	class controlsBackground
	{
		class LoadingPic : RscPicture
		{
			text = "\VTE_objects\UI\VTE_loading-01.pac";
			colortext[] = {1, 1, 1, 1};
		};
	};
};

To fix this problem, use image resolution 1024 x 1024 (or other power of two resolution I believe).

Aircraft Scripts

This section describes some basic things about addon aircraft scripts.

This is practical example of setting up F4 Phantom aircraft addon from OFP conversion into ArmA compatible environment.

First we have exhaust smoke script in OFP like this:

; We know who we are
_plane = _this select 0;
 
#SmokeLoop
; If we're dead, we can stop smoking
?(!alive _plane) : goto "Exit";
~0.01;
?(speed _plane < 100) : goto "SmokeLoop";
 
_alpha = 0.16 * ((speed _plane / 900));
?(_alpha > .16): _alpha =.16;
 
drop ["\ca\data\cl_basic", "", "Billboard", 1, 10, [0,-5,.1], [5-random 10, 5-random 10, 5-random 10], 0, 10, 1, 1, [5,15,40], [[.2,.2,.2,_alpha/10], [.2,.2,.2,_alpha], [.2,.2,.2,0]], [0,.2,1], 5, 5, "", "", _plane]
 
goto "SmokeLoop";
 
#Exit
exit

Now we have ported the SQS script into SQF format which ArmA likes. This is how it looks when its ported:

private ["_plane", "_s", "_alpha"];
 
// We know who we are
_plane = _this select 0;
 
// Alive and with the engine on?
while {alive _plane && isEngineOn _plane} do
{
	sleep 0.01;
	_s = speed _plane;
 
	if (_s > 100) then
	{
		_alpha = 0.16 * (_s / 900);
		if (_alpha > 0.16) then
		{
			_alpha = 0.16;
		};
		drop["\ca\data\cl_basic", "", "Billboard", 1, 10, [0, -5, 0.1], [5 - random 10, 5 - random 10, 5 - random 10], 0, 10, 1, 1, [5, 15, 40], [[0.2, 0.2, 0.2, _alpha/10], [0.2, 0.2, 0.2, _alpha], [0.2, 0.2, 0.2, 0]], [0, 0.2, 1], 5, 5, "", "", _plane];
	};
};

Next you need to run this script from your aircraft's config.cpp file. This is used with compatibility to Extended Eventhandlers (XEH) like this:

class Extended_Init_EventHandlers
{
	class VTE_SomeClassName
	{
		VTE_F4_engine = "if (isEngineOn (_this select 0)) then {[_this select 0,true] execVM '\path\to\script.sqf'}";
	};
};
 
class Extended_Engine_EventHandlers
{
	class VTE_SomeClassName
	{
		vte_someclassname_smokefx = "if (_this select 1) then {_this execVM '\path\to\script.sqf'}";
	};
};

And your aircraft is ready to run this smoke script. Notice how the extended_init_eventhandlers are used to start the script even if you place the aircraft flying in mission editor. The extended_engine_eventhandlers alone works OK if you start the aircraft on ground, so after mission start the engine is started by AI or player.

Unpacked Addons

Using unpacked addons, meaning your “My_soldier.pbo” is on directory (dir) instead of an addon. This method allows you to edit the addon while ArmA is still running so you can see changes ingame after mission restart (or new mission editor preview).

Usage

  1. Place your My_soldier.pbo addon into any mod dir you want.
  2. Unpack the pbo and place this dir into ArmA ROOT dir.
  3. Make sure there is proper $PBOPREFIX$ file inside this dir.

Run ArmA and you should be able to edit the DIR contents and see edited results ingame after mission restart / new mission editor preview.

Howto run DOS tools

To run DOS tools you need to open the dos box in windows (or cmd whatever its called).

Its recommended to do this through a batch file (.bat), as this way all the work you are doing are by default saved, so you don't have to retype sometimes very difficult commands many times over.

To create dos batch file do this:

  1. Using windows explorer (My Computer) browse to the directory where you want the command to be run.
  2. Right Mouse Button (RMB) click and choose New → Text Document.
  3. Give it file name: _run_moveobject.bat
  4. Open _run_moveobject.bat in your favorite text editor.

Now you have created dos batch file and are ready to write some commands to it.

The “prefix” _run_ is just there for two reasons, the _ places it usually to the first on the alphabets so its first found in dir/explorer list, the “run” part describes it to be file that runs some util. You can call the .bat file what ever you like, totally up to you, this was just one example.

Simple setup to run Mikero's MoveObject util would look like this:

MoveObject.exe camel_pilot.p3d ca\characters\data\ some\new\path\
pause

First line would be the actual command line to run moveobject util, second line is “pause” which means the dos box pauses until you press any key to continue, when you do this… there is no more commands to execute so the dos box closes itself automatically. So leaving out the pause command just opens the dos box for the duration of running the tool/commands, which most cases is very short time and you can't even see what happened.

Another example is BIS tool called pal2pace, here is how you convert all PNG files in the dir into PAA files:

for %%i in (*.png) do (\armatools\texview2\pal2pace %%i)
pause

This is bit more complicated command, it will process a loop where it goes through all PNG files found in the dir and executes the pal2pace util for them. Again the pause command on the second line causes the dos box to halt when pal2pace on the first line is done, so you can observe what happened.

arma/misc.txt · Last modified: 2009-12-10 19:38 (external edit)