Guide for FoxKit 1.0. This guide assumes that the user already knows how to work with FoxKit and understand Datasets/ fox2 files and the mod folder structure. Please see FoxKit: Installing, Import Files and Terrain and FoxKit: StaticModel and GeoxCollisionFreeShape
Entity that works with lba files. (Locator Binary Array). Location data used to place gimmicks that is a little bit different then the TppPermanentGimmickData.
This entity transforms a model as something that becomes alive, animated, breakable, falling by gravity. A static model of a chair, if not loaded by lba files, will be just a static model that won’t fall if player touches it. Or a box that without lba it won’t break if a grenade blows up near. Cloth will not swing around without lba.
The game has a limit of how many lba should be spawned in free roam mission. Luckily, if the user does a new custom mission or location the limit can raise to up more than hundreds of lba working without crashing the game. This guide will only spawn two Gimmicks in the free roam mission as a good start to understand how to load lba files. Each location pack_common gimmick have TppGimmickImmediateStateData and other types of entities that set a kind of limit of gimmicks the location will have.
The guide will load two Gimmicks. A Chair and a Flag/Banner. The first thing to do is build a mockup assets in Unity with a simple Dataset that will not be inside MOD. The purpose of creating this fox2 file is to get the Positions and Rotations of the model to copy/paste into lba files. We do it because FoxKit can not load lba files just yet.
Create a Dataset named “MockupGimmicks” and build a small assets scene. I did this:
We’ll see this Fox2 later.
Very important list to query the values that we will need later.
numDynamicGimmick It does need more info about this one. Not sure what it means other than value 0 does not do nothing. The highest number founded was 22 from cable gimmick. The majority of gimmicks only need 1 or 2.
flags Every gimmick will have a first flag and a second flag. Notice that flag2 will have value 0 for the mostly gimmicks. Some have more than one number in flag1 that it will depend of which model is been loaded. Barbwire has three types of staticmodel and therefore has three flags1 that cause a specific behavior. But, this still needs more information. It’s a lot of time to look at each one and it will be a pleasure to anyone who tries to test each and note what happens in-game.
name |
numDynamicGimmick |
flags1 |
flags2 |
---|---|---|---|
alarm_lamp |
3 |
603980296 |
0 |
ashtray |
1 |
267 |
0 |
barricade |
3/ 5 |
16642 258 |
0 |
barbwire |
2 |
16781568 256 16777472 |
0 8192 |
barrel |
1 |
262400 |
0 |
basket |
2 |
267 |
0 |
bed |
1 |
262400 |
0 |
book |
5 |
267 |
0 |
bottle |
1/ 4 |
282 |
0 |
bucket |
1/ 2/ 3 |
267 536871185 |
0 |
cable |
6/ 16/ 22 |
274 3145993 67109138 |
0 64 |
can |
1 |
267 |
0 |
carton |
2 |
267 |
0 |
chair |
1/ 2/ 3 |
267 |
0 |
chandelier |
1 |
285 |
0 |
cloth |
2/ 3 |
259 |
0 |
cloth inhouse |
1 |
536870915 |
0 |
communicator |
1 |
3145993 |
0 |
cup |
1/ 2 |
282 |
0 |
desk |
2 |
2147483904 |
0 |
dish |
1/ 2/ 3/ 4 |
267 |
0 |
drum white/blue |
2 |
270 |
0 |
drum red |
2 |
260 |
0 |
normal drum |
2/ 4 |
1049119 |
0 |
flag/banner |
2/ 7 |
603980035 |
0 |
fence |
3/ 4 |
259 16781568 16777478 16777486 16777497 281 |
0 |
gas_cylinder |
2 |
267 |
0 |
gunny_sack |
1 |
273 |
0 |
house window |
1/ 2/ 3 |
261 |
0 |
hut |
1 |
262 2147483910 298 |
0 524288 |
ladder |
1 |
297 |
0 |
lamp |
3 |
1573397 |
0 |
light |
1 |
3146249 3146250 |
0 |
med_equip |
1 |
267 |
0 |
net |
1 |
259 |
0 |
pot |
1 |
267 278 |
0 |
radio |
1 |
24 267 |
0 |
roadcone |
2 |
267 |
0 |
sandbag |
1 |
34 |
0 |
signboard |
1 |
16777486 303 |
0 |
stairs |
1 |
2147483904 |
0 |
sunshade |
2 |
3 603979779 |
0 |
tank |
2/ 3 |
267 |
0 |
television |
1 |
261 |
0 |
tent |
2/ 3 |
3 259 |
0 2 |
timber |
1 |
262 |
0 |
tin_wall |
1 |
16777486 |
0 |
tire |
6 |
267 |
0 |
tree |
2 |
270 |
0 |
tool |
4 |
267 |
0 |
tub |
1 |
267 |
0 |
utility_pole |
1/ 2 |
284 |
0 |
wall |
2 |
2 |
0 |
window |
2 |
261 603979779 |
0 |
wood_box |
1/ 6 |
256 |
0 |
wood_box gntn |
5 |
262400 |
0 |
wood_box/mafr_desk001 |
1/ 2/ 3 |
2147483904 |
0 65536 |
Download here. https://github.com/youarebritish/LbaTool/releases/tag/1.0
Find the lba for afgh_char002 and afgh_flag001 and paste in afgh_common_fpk/Assets/tpp/level/location/afgh/block_common/lba or in a place you know better for it in your project. The path folder I choose here is because we are working to spawn in free roam AFGH location pack_common. If we’re in a side-op it probably would be in Sideop_fpk/Assets/tpp/level/mission2/quest/ih/lba.
Open the afgh_char002 and afgh_flag001 outside of Unity with the LbaTool. Remember the mockupGimmick we did later and open the file too.
Erase the content afgh_char002.lba we have at the start, including the dataset path.
locator name of chair: afgh_char002_gim_n0000 | srt_afgh_char002 |
locator name of flag: afgh_flag001_gim_n0000 | srt_afgh_flag001 |
If you want to add more than one locator, just increase the …gim_n0000| to gim_n0001|, gim_n0002| and so on.
Copy position and rotation from the mockupGimmick to the lba file and save. Example afgh_char002:
Do the same for afgh_flag001.
Notice that dataset=”path” will be our fox2file where we’ll add the Entity TppSharedGimmickData. So, once we finish exporting the main fox2 file, we will add the dataset path in lba file again and repack with the tool.
Create a new DataSet and drop two Entities TppSharedGimmickData. One for the Chair and another for Flag/Banner we planned.
afgh_char002
modelFile Just add the model of afgh_char002.fmdl here
geomFile Just add the geom of afgh_char002.geom here
breakedModelFile and breakedGeomFile Some models like box, wood desk, wall have a second fmdl and geom for pieces that will of course end the break animation and result in a visual broke of the first model. It’s funny that you can add anything here and make the break quite interesting visually.
partsFile Model needs a part file to load ph, target and effects. Remember to add the files and path in Unity and Mod Folder.
numDynamicGimmick As we talk about at the beginning of this guide. Need more information about.
locaterFile lba files will be in every fpk folder. Precisely in /Assets/tpp/level folder. In our case we are using afgh_common_fpk. So the location for it will be is /Assets/tpp/level/location/afgh/block_common/lba. Make sure to add it later in Unity and Mod Folder.
flags1 Please see the QueryList. It’s not clear what this flags actually means. Needs more information.
flags2 Please see the QueryList. It’s not clear what this flags actually means. Needs more information.
Do the same for the afgh_flag001.
Export the Fox2 file to the fpkd of our Mod Folder. You can now delete the mockupGimmick. It’s important that this fox2 file we did just to take the positions and rotations for lba files not load in the Mod.
Look that I’m using the same mod from the previously guides. Every mod can have tons of fox2 file that deals with something in specific.
We need to edit manually the MyThirdFox2File in xml to add the flag number and of course check if the paths are correctly done. Remember now to check the QueryList and choose the best flag.
Save and pack the fox2 file.
Back to the lba files and now let’s add the dataset path. Save, pack with the LbaTool and copy/paste for our Mod Folder in fpk/Assets/tpp/level/location/afgh/block_common/lba or the path you choose in TppSharedGimmickData.
We need to add to our mod folder the fmdls, geoms, parts and motion of our chair and flag. Motion is only about the flag. Sometimes a lba will need a effect too. To know which effect and motion to add to our project, look inside the parts file of the model and everything will be there.
Fmdl and Geoms
Motion
Parts Notice that parts goes to fpkd folder, not fpk.
Done. Now test it. Make the .mgsv file in Makebite building the LoadingStairsInGame folder. Open with SnakeBite and see it in game.
Unfortunately due to the limits of Free Roam. Only one TppSharedGimmick was spawned. The flag works at least.