Foxkit: TppSharedGimmickData

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

The other FoxKit Tutorials

## **Beginning**

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.

## **TppSharedGimmickData list**

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.

## **LbaTool**

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.

### **Entity TppSharedGimmickData**

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.

### **Last steps...**

#### **Lba files**

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.**

#### **Models, motions and parts files**

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.