武装突袭 Wiki
探索
首页
讨论板
所有页面
社区页
交互式地图
最新博文
页面
最新页面
Contact Reports
Hotshot's Sandbox
DIK KeyCodes
Curator
武装突袭 Wiki
Product.cpp/bin File Format
Oxygen Light
最新博客
分类
Uploaded with UploadWizard
Face A2 Face101.jpg
Face A2 Face102.jpg
Face A2 Face103.jpg
Face A2 Face104.jpg
Face A2 Face105.jpg
Face A2 Face106.jpg
Face A2 Face107.jpg
含有损坏文件链接的页面
Eden Editor: Introduction
Eden Editor: Switching from 2D Editor
Eden Editor: Menu Bar
Eden Editor: Asset Browser
Eden Editor: Toolbar
Eden Editor: Status Bar
Eden Editor: Entity Attributes
社区
社区首页
社区中心
帮助中心
FANDOM
游戏
电影
电视
wiki
探索wiki
社区中心
创建wiki
尚未注册?
注册
登录
登录
注册
武装突袭 Wiki
4,828
个页面
探索
首页
讨论板
所有页面
社区页
交互式地图
最新博文
页面
最新页面
Contact Reports
Hotshot's Sandbox
DIK KeyCodes
Curator
武装突袭 Wiki
Product.cpp/bin File Format
Oxygen Light
最新博客
分类
Uploaded with UploadWizard
Face A2 Face101.jpg
Face A2 Face102.jpg
Face A2 Face103.jpg
Face A2 Face104.jpg
Face A2 Face105.jpg
Face A2 Face106.jpg
Face A2 Face107.jpg
含有损坏文件链接的页面
Eden Editor: Introduction
Eden Editor: Switching from 2D Editor
Eden Editor: Menu Bar
Eden Editor: Asset Browser
Eden Editor: Toolbar
Eden Editor: Status Bar
Eden Editor: Entity Attributes
社区
社区首页
社区中心
帮助中心
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
编辑“
RaP File Format - Elite
”
返回页面
编辑
可视化编辑器
查看历史
讨论 (0)
正在编辑
RaP File Format - Elite
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
{{unsupported-doc}} ==Caveat== If you are researching the nitty gritty of raP encoding for [[raP File Format - OFP|OFP]] you are in the wrong place. This document is specifically for Elite/Arma1 & 2 raPified files on the Xbox and beyond. However, if you are not too familiar with this subject, the Introduction in the [[raP File Format - OFP|OFP]] version will help you best. ==Changes from OFP== *Two new entry types /*extern*/ class thing; delete /*class*/ thing; *Enhanced TokenName name= RealVariable (as opposed to name="variable";) Xbox mission.par's only *Non contiguous data file non-contiguous data stream. Class '''bodies''' are now located 'arbitrarily' in a file offset, as opposed to being directly after the class name. *a rarely used sha/md5 ==Changes at Arma== *Enhanced token is not used. *sha/md5 is not used ==Introduction== <big>raP encoding for Xbox Files</big> ===Conventions=== see [[Generic FileFormat Data Types]] ===Mandatory PreReading=== ====The Human==== [[BI]] use c++ class syntax to package data for almost everything. Anything configurable / alterable / makeable / editable by a player (author) involves creating a file or files consisting of class statements. The Mission Editor eg, creates several files for a mission consisting solely of class statements. Everything is defined or declared within classes. There is no specific file extension that is or is not a rap file. an rvmat or mission.sqm can, as equally be humanly readable text, or, binarised rap. '''Any''' text file that contains class statements, is, by definition, a rapifiable file. This includes bisurf, fsm, cpp, (model).cfg, BI's world revolves around the engine's ability to work with data contained in (a series of) class {bodies}. So much so, that at run time, a file that is in humanly readable text, is automatically converted to rap binary. The engine never sees 'text'. This also applies to description.ext and some other files that cannot be SAVED as rap binary, but are, most definately, rapified by the engine before use. Class anything ultimately means raP binary Class syntax can briefly (but accurately) be described as follows: class thing [: InheritedClass] { '''body''' }; [: InheritedClass] is optional. It is <u>heavily</u> used in the config.cpp's of addons. If specified it '''must''' be referenced prior to being used. The '''body''' of a class consists of { #tokens and /or #arrays and /or #(embedded) classes and /or #nothing at all! class default{}; is perfectly valid eg. }; Any given file that contains classes, contains nothing else but classes. There aren't, classes, and ummm, err, ummm 'other' things. '''The file itself is considered an implied class!''' The very first statement of all files is //class filename { Everything within that file is embedded within the class filename {....}; ====The Engine==== The class structure is used internally within the engine for all most game data and configuration. The engine holds this data in tokenised form for more efficient processing. This internal tokenised data can also be held in a file (a savegame eg). But, it is a class structure regardless. To improve loading speed many files within the ofp tree are pre-tokenised. They were 'converted' to hold the tokenised form of the same class statements. In fact, the engine does not care which 'type' of file it is dealing with. A mission.sqm can be either. If it hasn't been pre-tokenised (eg contains text-readable class statements) the engine converts it on the fly. Tokenised files have a magic signature as their first four bytes. "\0raP". The file extension is meaningless in this regard. In the early days of ofp, when the campaign mission.sqm's came pre-tokenised, it was assumed wrongly, this was some attempt at encryption. They were also called 'binary' files because it was noticed that the tokenised form of a config.cpp was called config.bin (config.rap would have been far more appropriate). In fact, the engine will happily work with a config.cpp that is rap encoded. Various utilities (tools) arrived on the internet in an attempt to decode them (and conversely, encode them). cpp2bin, bin2cpp, Coc binview are the most well known of these. They are detailed here as 'raP' files because of their unique signature. This document refers to rapifying and de-rapifying files containing nothing but, class statements. ==Xbox/Arma== raP encoding is an extension to Flashpoint PC raP encoding. ==Overall Structure== struct raP { char Signature[4]; // 4 byte raP signature (\0raP) byte AuthenticationSignature[20] // XBOX ONLY NOT ARMA ulong Always0; ulong Always8; ulong OffsetToEnums; ClassBody ClassBody; // one and one only, within which, will be more class bodies Enums { ulong nEnums; // generally always 0 enumlist.... // optional }; }; ''' All offsets are relative to start of file''' ===Authentication Signature=== Unique to Xbox, not known on ArmA. Following the four byte signature "\0 r a P" is an ''optional'' 20 byte signature intended to provide a unique value to this file and to prevent tampering. This value, or 'Authentication signature' is generated from a common 'Authentication Key' plus the content of the file itself. The Authentication key for Xbox Elite is 16 bytes and not listed here. You can obtain source code for generating signatures elsewhere. The signature is 'optional' '''only''' in the sense that not all types of files have it. A signature appears in '''.par''' files for example, but not in the official bis mission.sqms. ===File Offset to Enumerated list=== the offset points to points to the end of All class data and consequently the start of an enum list (if any). There may well be, no enumerated list, there '''will''' be a ListCount saying so! ===ClassBody=== ClassBody { Asciiz InheritedClassname; // can be zero [[#CompressedInteger]] nEntries; // can be zero. ClassEntry ClassEntries[nEntries]; }; ClassBodies contain zero or more 'entries'. These 'entries' consist of strings, arrays, classes, etc. The 1st byte of each entry defines what 'type' of entry it is. Note that ALL classes other than the first class body above are EMBEDDED classes within this one. Furthermore, this unique class cannot have an inheritance (obviously), and their is no classname associated with it. In OFP raP the classname of this unique class was, the name of the file (config.cpp eg) ==ClassEntries== {| class="wikitable" border="0" !align="left"|Type !align="left"|ID !align="left"|SubID !align="left"|Asciiz Name !align="left"|Value !align="left"|Example |- |align="left"|class||0||-||classname||4byte OffsetToBody||class thing{...}; |- |align="left"|string||1||0||name=||Asciiz string||thing="hello"; |- |align="left"|float||1||1||name=||4byte float||thing=0.123; |- |align="left"|long||1||2||name=||4byte long||thing=123; |- |align="left"|Array||2||-||name[]=||{nElements Elements[nElements]}||thing[]={1,0.2,"three",{4,5,6},{"seven"}}; |- |align="left"|extern||3||-||classname||-||class thing; |- |align="left"|delete||4||-||classname||-||delete thing; |- |- |} ==Entry Types== 0 Embedded Class 1 value = (string, float, integer, variable) 2 array[]={....}; 3 /*extern*/ class label; 4 delete /*class*/ label; ===EntryType 0: RapClass=== RapClass { byte Type; // 0 Asciiz ClassName ulong OffsetToClassBody; }; '''All offsets in raP are relative to the start of file.''' ===EntryType 1: Value Eq=== RapValue { byte Type; //1 byte SubType; Asciiz Aname; 01 00 Aname="AString"; 01 01 Aname= float; 01 02 Aname= long; //01 03 AnArray[]= { .........}; '''not used''' 01 04 Aname=Asciiz Variable name; // public or private ====SubType 4: Asciiz Variable Name==== XBOX only A variable name (as opposed to a string constant) is as follows Aname = "fred"; // constant Aname=_fred; // public or private variable ===EntryType 2: array[]=== RapArray { byte Type;// 02 Asciiz ArrayName; ArrayStruct; }; ==ArrayStruct== [[#CompressedInteger]] nElements;ArrayElements[nElements]; nElements is a declaring how many items make up the array, zero, is a legal value ==ArrayElements== each element of the array consists of a single subtype byte followed by appropriate data for the type. Thus 0 Asciiz string constant; 1 float 2 long 3 recursive array ArrayStruct; 4 Asciiz String variable A recursive array recurses into further entries with no name attached. A recursive array is as follows AnArray[]= { {1,2} , 3,4}; ===EntryType 3:ExternClass=== 03 Asciiz Classname; // class Classname; ===EntryType 4:Delete Class=== 04 Asciiz Classname; // delete Classname; <hr> ==Extern Classes== Unlike OFP, a valuable addition to the Token types has been the definition /*extern*/ class car; class BigCar:car {...}; class RedCar:BigCar{...}; The tedious business of listing class All:Default{}; class Vehicle:All{}; ... class Target:Vehicle{}; class Strategic:Target{}; class car{}:Strategic{}; simply to declate a car !!! has (sometimes) been done away with. Instead, the new types deal with all things car. (or at least the engine goes looking elsewhere, which it did, anyway, in ofp). The intention '''was''' that you did not need to know '''anything''' about how the underlying class (eg CfgVehicles) is constructed. The practicalities are however that you pretty much have to declare an ofp looking tree to 'get at' any of the embedded classes (or inferred, inherited, embedded classes), of the class you're inheriting. This tree structure can become quite long, and, of necessity, accurate, thus there is no real improvement to the ofp way of doing things. ===CompressedInteger=== This is the same construct as found in [[raP File Format - OFP|OFP raP files]]. The value is used to declare the number of entries in the class body or nArrays ==enumerated list (optional)== The next four bytes after all class bodies are the enumerated list count. These defines (if any) continue until end of file. Where no list exists (the '''very''' normal case), the count is zero. A list consists of an asciiz name and an (implied) integer value as follows (manposnoweapon) {01 00 00 00} which equates in C to enum { manposweapon=1, manshower=88, manhungry=12, .... } This list is encountered in some few 'official' config.cpp's. It's use by model makers is rare. Textually, you can have as many enum lists as required. They are ultimately congregated into one, enum list at the end of a raP encoded file. The order in which they are presented in this list has no bearing on their text equivalent. They are (generally) iterated as encountered and always converted to lower case. You reference enums via their stringname. Thus thisValue=manposweapon; and thisValue="ManPosWeapon"; are identical in effect. Both result in an integer value of 1 being assigned at run time. [[category:Operation Flashpoint Elite: Modelling|RAP]] [[Category:BIS_File_Formats|RAP]]
摘要:
请注意在武装突袭 Wiki上的所有贡献都将依据CC-BY-SA进行发布。
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
Template:Tool-disclaimer
(
查看源代码
)
Template:Unsupported-doc
(
查看源代码
)
Follow on IG
TikTok
Join Fan Lab