desc.ext: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=basics=
=Basics=
 
==Mission Related File References==
==Mission Related File References==
'Mission Related' files are  
'Mission Related' files are  


Line 8: Line 6:
*desc.ext
*desc.ext
*any.sqX file call (execvm, loadfile, etc)
*any.sqX file call (execvm, loadfile, etc)
*any.bikb (arma only)
*any.fsm  (arma only)
*any.fsm  (arma only)
*any.bikb (arma only)
==Files vs Paths==
There are four classes of file reference.


==Ofp vs Arma==
*\Hard\Path
 
File references in have quite different target locations between the engines. As an example, by default, a campaign desc.ext will look in
 
~dtaext\sounds // ofp  and,
~dtaext        // arma
 
 
==Files and Paths==
No matter which way Bis swing the cat, now, or in the future, there are only four classes of file reference.
 
*\HardPath\
*\HardFile (no path, just a file)
*\HardFile (no path, just a file)
*SoftPath\
*Soft\Path
*SoftFile
*SoftFile


Innocently similar references will result in drastically different search paths for the file of interest.
Innocently similar references will result in drastically different search paths for the file of interest.


SoftPath is my term to describe the opposite of \Absolute path references. It is '''not''', a relative reference. With the sole exception of #includes, Bi have never been able to implement relative addressing for anything, including addons.
Note that a Soft\Path is '''not''' a relative file reference. (BI do not use relative addressing for anything in their engines except #include)


The following 'truth' was gleaned from an invaluable tool that saved days of hair pulling frustration:
The following 'truth' was gleaned from an invaluable tool that saved days of hair pulling frustration:
Line 36: Line 25:


All honor and glory to Kju and Alef
All honor and glory to Kju and Alef
=General=


---------
As a '''general''' guide, the file search algorithm breaks down to the following, and in the following order:
As a '''general''' guide, the file search algorithm breaks down to the following, and in the following order:


*mission\
*mission\
*campaign\Scripts\ or campaign\DtaExt\ '''if''' a campaign
*Campaign\Scripts\ or Campaign\DtaExt\ (if a campaign)
*exe\Scripts\ or exe\DtaExt\ if '''not''' a campaign
*exe\Scripts\ or exe\DtaExt\
*\PboPrefix (arma only)
*PboPrefix
*exe\
*exe\


Bis dont use *Scripts\ or *DtaExt\ in any Arma product and may have forgotten them.  
PboPrefix is where the initial part (or all), of the Soft or \Hard path matches an Arma Addon's internal prefix.
By definition, Soft and \Hard '''files''' cannot refer to Addons. Addons are defined as pbo's containing config.cpp's. For Addons that have no internal prefix (All of OFP, and some Arma Oem's), the NameOfPbo is substitued.
==Ofp vs Arma==


==sqX==
*Where relevant, prepending DtaExt\ or Scripts\ remains the same.
*Arma extends desc.ext to be able to refer to files outside of it's own folder and children.
*Arma extends mission\desc.ext's to be able to refer to files in campaign\desc.ext
*An OFP engine prepends a Sound\ Folder to sound references in it's desc.ext. Thus:
  sound[] = {"S01v05.ogg", db-10, 1.0};
actually refers to a ~Sound\S01v05.ogg. Arma does not prepend.
==sqX (Scripts)==
sqX is the scripting language found in mission.sqm, *.sqs and *.sqf. A sqX script, regardless of source follows the following file pathing for missionspace (note that sqX encountered in addons behaves differently)
sqX is the scripting language found in mission.sqm, *.sqs and *.sqf. A sqX script, regardless of source follows the following file pathing for missionspace (note that sqX encountered in addons behaves differently)


Line 59: Line 56:
*exe\anything
*exe\anything


  [] exec "fred\startmusic.sqs";
  [] exec "Soft\Path.sqs";
*mission\fred
*mission\
 
  [] exec "SoftFile.sqs";
  [] exec "startmusic.sqs";
*mission\
*mission\
*campaign\Scripts (if campaign)
*campaign\Scripts\
*OFP\Scripts
*OFP\Scripts\
 
===ARMA===
===ARMA===


   [] exec(VM) "playsound.sqX";
   [] exec(VM) "SoftFile.sqX";
   [] exec(VM) "fred\playsound.sqX";
*mission\
*exe\scripts\ '''OR''' campaign\scripts\
*exe\
   [] exec(VM) "Soft\Path.sqX";
*mission\
*mission\
*exe\scripts\ '''OR''' campaign\scripts\  
*exe\scripts\ '''OR''' campaign\scripts\
*fred.pbo '''IF''' a SoftPath
*PboPrefix
*exe\    '''IF''' a SoftFile
   [] execVM "\HardFile.sqf";
 
   [] execVM "\playsound.sqf";
*exe\ ONLY  
*exe\ ONLY  
 
   [] execVM "\Hard\Path.sqf";
   [] execVM "\fred\playsound.sqf";
*PboPrefix
*fred.pbo
*exe\
*exe\fred\


==desc.ext==
==desc.ext==
Line 90: Line 85:
  sound[] = {"\Anything",1,1};
  sound[] = {"\Anything",1,1};
mission\
mission\
====campaign.ext====
====campaign.ext====
  sound[] = {"\Anything",1,1};
  sound[] = {"\Anything",1,1};
Line 115: Line 109:


===ARMA===
===ARMA===
  loadScreen="fred\piccie.paa";
====mission.ext====
  loadScreen="piccie.paa";
====campaign.ext====
 
Unlike OFP, Arma engines allow a desc.ext to reference files otuside of it's own space.
Unlike OFP, Arma engines allow access from mission description.ext's into the campaign\space.
  loadScreen="Soft\Path.paa";
*mission\
*campaign\dtaext\
*arma\dtaext\
*PboPrefix
  loadScreen="SoftFile.paa";
*mission\
*mission\
*campaign\dtaext\ '''AND''' arma\dtaext\
*campaign\dtaext\
*exe\ '''IF''' SoftFile
*arma\dtaext\
*fred.pbo '''IF''' SoftPath
*exe\
 
  loadScreen="\Hard\Path.paa";
  loadScreen="\fred\piccie.paa";
*PboPrefix ONLY
*fred.pbo ONLY
  loadScreen="\HardFile.paa";
  loadScreen="\piccie.paa";
*exe\  ONLY
*exe\  ONLY
==bikb==
==bikb==
 
*Prior to hotfix patch in version 1.05, bikb couldn't access anything except addons
bikb is just another hair pulling inconsistency. You can't specify softpaths or files, it results in a rpt error
*bikb is only a convention. you can have any extension.
*the file cannot be binarised even tho it's classtext. This is marked to change at further engine revisions.
*You can't specify soft\paths or SoftFiles, it results in a rpt error


  Protocol bin\config.bin/RadioProtocol_EP1_EN/: Missing word fred\05bv01.ogg
  Protocol bin\config.bin/RadioProtocol_EP1_EN/: Missing word fred\05bv01.ogg


 
  speech[] = {"\Hard\Path.ogg"};
  speech[] = {"\fred\05bv01.ogg"};
  speech[] = {"\HardFile.ogg"};
  speech[] = {"\05bv01.ogg"};
either reference searches in the following order
either reference searches in the following order


*mission\
*mission\
*campaign\
*campaign\
*fred.pbo (in the obvious case of a \hardpath)
*PboPrefix (in the obvious case of a \hard\path)
 
just scream. it helps
=earlier notes=
----
*DescriptionRoot is the location of the description.ext
*This in turn becomes a CampaignRoot or a MissionRoot (see below)
*A \hardpath or lack of one changes the search order.
 
**A relative path first scans the DescriptionRoot. If not found, it scans \addons
 
DescriptionRoot\Relpath\to\file// is first scanned then
\RelPath\to\file
 
**A \hardpath of the same name ONLY looks in \addons
 
The same algorithm applies to mission.sqm but not bikb (and probably not fsm)
 
=DescriptionRoots=


Two types of description.ext exist, and they operated differently.
==missionroot==
The desc.ext is located in the primary folder of a mission.sqm
Addressing rules as above.
==campaignroot==
The campaign root is defined as being the start of the campaign folder. It contains
desc.ext
missions\
scripts\ (optional)
DtaExt\  (optional)
Note that there is no mission.sqm
'''IF''' this campaign is, in fact, an addon (a config.cpp exists) additional folders and files may exist. They, don't have relevence to the addressing space of a campaign other than they will be accessed like any other \addon.
A campaignroot\desc.ext is 'special' in that the only useable locations are dtaext\ (and scripts\)
===Scripts\===
scripts\ are a global entity for mission.sqms. They aren't desc.ext related.
not tested: an exec/eval in desc.ext might? access this folder
the scripts\ folder is accessed by mission.sqm's as a last resort if relative addressing is used.
===DtaExt===
unlike MissionRoot, you cannot have a sounds\ child folder as such (or any other)
All references are implied DtaExt (sigh)
sounds[]=fred
and
sounds[]=\fred
mean DtaExt\fred
'''Not tested: \fred\...  might be scanned by the engine'''
In fact, the DtaExt default is quite pointless. Inconsistent as ever, campaignroot's can't have the same structure as missions. but, there's no reason anymore why they shouldn't.
Bis have crippled the original default folders of DtaExt\sounds for sounds, and DtaExt\Music for music. They must be fully specified as
sounds[]=Sounds\whatever; (which actually means DtaExt\Sounds\....
This isn't a bad thing, but there wasn't a reason to keep the dtaext at all!!!!
There may or may not be other 'special' folders, 'my documents'\arma\username and other trifles. But you can't rely on it or them. they are likely to break or disappear at whim. mission scripts eg seem to have default access to ca\data\scripts. Fool it is, who rely on Bis to maintain that.
Bis themselves dont actually use dtaext (or scripts) in any of their campaigns. Probably because their mission makers either weren't aware of them, or could understand them.
But, from not making used of the global architecture, means common sound files (and common scripts) are bloated in each mission that uses one, for any official campaign.
=other=


=other misc=


<pre>
<pre>
Line 239: Line 165:
</pre>
</pre>
=cfgSounds=
=cfgSounds=
one hell of a mess with titleS note the plural
titles[]={StartTime,Text,...};
 
ofp can use semi colons between


ofp used semi colons between


titles[]={StartTime,Text};
titles[]=
titles[]=


Line 251: Line 177:
   sounds[]={};
   sounds[]={};
   class Seq1 {name="Seq1";  sound[]={"sound\09v07.ogg", db, 1.0};    titles[]={0,      $STRM_09v07};  };//standard
   class Seq1 {name="Seq1";  sound[]={"sound\09v07.ogg", db, 1.0};    titles[]={0,      $STRM_09v07};  };//standard
   class 11v01{name="11v01"; sound[]={"sound\11v01.ogg", db-05, 1.0}; titles[]={{0,0.4}, $STRM_11v01};  };
   class 11v01{name="11v01"; sound[]={"sound\11v01.ogg", db-05, 1.0}; titles[]={{0,0.4}, $STRM_11v01};  };
   class 11v04{name="11v04"; sound[]={"sound\11v04.ogg", db-05, 1.0}; titles[]={ 0,      $STRM_11v04,  {5.5,0.5}, $STRM_11v04a};    };
   class 11v04{name="11v04"; sound[]={"sound\11v04.ogg", db-05, 1.0}; titles[]={ 0,      $STRM_11v04,  {5.5,0.5}, $STRM_11v04a};    };
Line 284: Line 209:
};
};
</pre>
</pre>
=Scripts=
scripts are part of mission.sqm and \hardpaths to addons are valid. Therefore, all relative references in a mission.sqm (and their scripts) are relative to the mission.sqm, NOT the folder they are encountered in. (sigh)
expActiv="nul=[] execVM ""scripts\dialog.sqf""";
relative to mission.sqm
expActiv="nul=[] execVM ""\scripts\dialog.sqf""";
would refer to a (non existent) pboprefix 'scripts'
fowley kbAddTopic ["dialog", "scripts\dialog.bikb", ""];
again, relative to mission.sqm, even tho, this piece of text is in the 'scripts' folder.
Note that Campaign root scripts folder is implied if it cannot find file in the mission.
execvm thing.sqf // assumes it's in mission.sqm root, OR campaignroot\scripts
execvm Scripts\thing.sqf // will look in mission.sqm\scripts or campaignRoot\scripts\scripts
previously, mission.sqm\scripts and ~\sound were also a default folders. but it looks like they broke it.
==bikb==
    speech[] = {"\sound\02v1.ogg"};
similar to mission.sqm's and desc.ext, if the file is not found in a genuine addon, it's looked for in missionRoot. However:
'''you CANNOT have relative refereces'''
    speech[] = {"sound\02v1.ogg"};
goes off to wander land.
Prior to hotfix patch in version 1.05, bikb couldn't access anything except addons
notes:
*bikb is only a convention. you can have any extension.
*the file cannot be binarised even tho it's classtext. This is marked to change at further engine revisions.

Revision as of 07:29, 18 October 2011

Basics

Mission Related File References

'Mission Related' files are

  • mission.sqm
  • desc.ext
  • any.sqX file call (execvm, loadfile, etc)
  • any.bikb (arma only)
  • any.fsm (arma only)

Files vs Paths

There are four classes of file reference.

  • \Hard\Path
  • \HardFile (no path, just a file)
  • Soft\Path
  • SoftFile

Innocently similar references will result in drastically different search paths for the file of interest.

Note that a Soft\Path is not a relative file reference. (BI do not use relative addressing for anything in their engines except #include)

The following 'truth' was gleaned from an invaluable tool that saved days of hair pulling frustration:

http://technet.microsoft.com/en-us/sysinternals/bb896645

All honor and glory to Kju and Alef

General

As a general guide, the file search algorithm breaks down to the following, and in the following order:

  • mission\
  • Campaign\Scripts\ or Campaign\DtaExt\ (if a campaign)
  • exe\Scripts\ or exe\DtaExt\
  • PboPrefix
  • exe\

PboPrefix is where the initial part (or all), of the Soft or \Hard path matches an Arma Addon's internal prefix. By definition, Soft and \Hard files cannot refer to Addons. Addons are defined as pbo's containing config.cpp's. For Addons that have no internal prefix (All of OFP, and some Arma Oem's), the NameOfPbo is substitued.

Ofp vs Arma

  • Where relevant, prepending DtaExt\ or Scripts\ remains the same.
  • Arma extends desc.ext to be able to refer to files outside of it's own folder and children.
  • Arma extends mission\desc.ext's to be able to refer to files in campaign\desc.ext
  • An OFP engine prepends a Sound\ Folder to sound references in it's desc.ext. Thus:
 sound[] = {"S01v05.ogg", db-10, 1.0}; 

actually refers to a ~Sound\S01v05.ogg. Arma does not prepend.

sqX (Scripts)

sqX is the scripting language found in mission.sqm, *.sqs and *.sqf. A sqX script, regardless of source follows the following file pathing for missionspace (note that sqX encountered in addons behaves differently)

By convention only, sqX files are .sqs for exec calls and .sqf for execVM calls. (The actual extension is immaterial)

OFP

OFP only uses exec

  [] exec "\anything"
  • exe\anything
[] exec "Soft\Path.sqs";
  • mission\
[] exec "SoftFile.sqs";
  • mission\
  • campaign\Scripts\
  • OFP\Scripts\

ARMA

  [] exec(VM) "SoftFile.sqX";
  • mission\
  • exe\scripts\ OR campaign\scripts\
  • exe\
  [] exec(VM) "Soft\Path.sqX";
  • mission\
  • exe\scripts\ OR campaign\scripts\
  • PboPrefix
  [] execVM "\HardFile.sqf";
  • exe\ ONLY
  [] execVM "\Hard\Path.sqf";
  • PboPrefix
  • exe\

desc.ext

OFP

mission.ext

sound[] = {"Anything",1,1};

mission\Sound

sound[] = {"\Anything",1,1};

mission\

campaign.ext

sound[] = {"\Anything",1,1};

campaign\dtaext\Anything

sound[] = {"Anything",1,1};

campaign\dtaext\sound\Anything

notes:

For large missions, although and of course, you can place everything in a single mission folder with no subfolders, Ofp mission designers tend to use the following folder constructs:

  • Sound
  • Music
  • Voice
  • Scripts
  • OtherStuff

This innocent and sensible looking order illustrates inconsistency of syntax in the texts. Thus:

sound[] = {"S01v05.ogg", db-10, 1.0}; // and
sound[] = {"\sound\S01v05.ogg", db-10, 1.0};  // both refer to ~\Sound\S01v05.ogg

and

sound[] = {"\music\S01v05.ogg", db-10, 1.0};  //refers to ~\Music\S01v05.ogg

but

sound[] = {"music\S01v05.ogg", db-10, 1.0};  //refers to ~\SOUND\Music\S01v05.ogg

ARMA

mission.ext

campaign.ext

Unlike OFP, Arma engines allow a desc.ext to reference files otuside of it's own space. Unlike OFP, Arma engines allow access from mission description.ext's into the campaign\space.

loadScreen="Soft\Path.paa";
  • mission\
  • campaign\dtaext\
  • arma\dtaext\
  • PboPrefix
loadScreen="SoftFile.paa";
  • mission\
  • campaign\dtaext\
  • arma\dtaext\
  • exe\
loadScreen="\Hard\Path.paa";
  • PboPrefix ONLY
loadScreen="\HardFile.paa";
  • exe\ ONLY

bikb

  • Prior to hotfix patch in version 1.05, bikb couldn't access anything except addons
  • bikb is only a convention. you can have any extension.
  • the file cannot be binarised even tho it's classtext. This is marked to change at further engine revisions.
  • You can't specify soft\paths or SoftFiles, it results in a rpt error
Protocol bin\config.bin/RadioProtocol_EP1_EN/: Missing word fred\05bv01.ogg
speech[] = {"\Hard\Path.ogg"};
speech[] = {"\HardFile.ogg"};

either reference searches in the following order

  • mission\
  • campaign\
  • PboPrefix (in the obvious case of a \hard\path)


other misc

class CfgRadio //straightfoward array of {filename,volume,pitch}
{
  sounds[]={};
  class Seq0{name="Seq0";  sound[]={"sound\09r06.wss", db-40, 1.0};	title=$STRM_09r06;  };
};
class CfgSFX
{
  sounds[]={hospoda2};
  class Hospoda2
  {
    name="Hospoda2";
    sounds[]={sound1};//<<<<<name of sound array
    sound1[]={"hospoda2.ogg", db-0,1, 1, 1, 1, 1};//who knows
    empty[]= {, , , , 1 , 5, 20};
  };
};

cfgSounds

titles[]={StartTime,Text,...};

ofp can use semi colons between


titles[]=

class CfgSounds
{
  sounds[]={};
  class Seq1 {name="Seq1";  sound[]={"sound\09v07.ogg", db, 1.0};    titles[]={0,       $STRM_09v07};  };//standard
  class 11v01{name="11v01"; sound[]={"sound\11v01.ogg", db-05, 1.0}; titles[]={{0,0.4}, $STRM_11v01};  };
  class 11v04{name="11v04"; sound[]={"sound\11v04.ogg", db-05, 1.0}; titles[]={ 0,      $STRM_11v04,  {5.5,0.5}, $STRM_11v04a};    };
  class DX04v01
  {
    name="DX04v01";
    sound[]={"sound\DX04v01.ogg", db+60, 1.0};
    titlesfont="tahomaB24";
    titlessize=0.025;
  titles[]=
    {
      0, $STRD_DX04v01;
      10, $STRD_DX04v02;//show next text in 10 seconds
   // ofp will accept semi colon or ; for above
    };
  };


cfgENVsounds=

class CfgEnvSounds
{
  sounds[]={dest};
  class dest
  {
    name="dest";
    sound[]={"sound\dest.ogg", db, 1.0};
    soundNight[]={"sound\dest.ogg", db, 1.0};//<<<<
    titles[]={};
  };
};