# Biology

The biology framework won't do much on its own, and is primarily intended for third party modders to use in their own mods.

## 1. Getting a unit's biology

To check the biology of a unit, use the `ls_common_fnc_getBiology` function.

Here we get the biology of the current unit that the player is controlling (`ls_player`) and display a groan sound if the player is a zombie.

```sqf
private _biology = ls_player call ls_common_fnc_getBiology;
_biology params ["_type", "_species", "_isOrganic", "_bloodModels"];

// _type will be the "group" that a species belongs to
// _species will be the exact type.
// Example: Humans have the _type of "nearhuman", but a species of "human".

if (_type == "zombie") then {
    systemChat "rurrgghhh";
};
```

## 2. Configuration

### 2.1 Creating a custom biology

You can easily create your own custom biology via config. Here is a biology already included in Legion Studios: Core as an example.

```cpp
class ls_biologies {
    class biology_base; // default biology class, contains default values
    class hologram: biology_base {
        scope = 2; // Only biologies with scope > 0 are used
        species = ""; // Exact species type. Optional, class name is used if empty
        type = "hologram"; // The type, such as human, an alien species, droid, etc.
        isOrganic = 0; // 0-Non-organic being, 1-Organic being
        // Condition for a unit to be this biology.
        // Passed params: [_unit, _uniformConfig, _face]
        condition = "call ls_common_fnc_biologyCondition_isHologram";
        // Array of models to use when this unit bleeds.
        // A hologram doesn't bleed, so this stays empty.
        bloodModels[] = {};
    };
};
```

## 3. Examples of using biologies

Biologies can be used for lots of different systems, such as "ion" and "emp" effects not doing anything or having a lesser effect on organic beings.

Legion Studios: Core also uses the blood models when ACE Medical is loaded. Normal blood drops will be replaced with custom ones defined in the unit's biology.

## 4. Additional Resources

* [Legion Studios Public Repo: Biologies Implementation](https://github.com/Legion-Studios/LegionCore-Public/blob/master/addons/common/ls_biologies.hpp)
* [Legion Studios Public Repo: isAlien](https://github.com/Legion-Studios/LegionCore-Public/blob/master/addons/common/functions/fnc_biologyCondition_isAlien.sqf)
* [Legion Studios Public Repo: isHologram](https://github.com/Legion-Studios/LegionCore-Public/blob/master/addons/common/functions/fnc_biologyCondition_isHologram.sqf)
* [Legion Studios Public Repo: isDroid](https://github.com/Legion-Studios/LegionCore-Public/blob/master/addons/common/functions/fnc_biologyCondition_isDroid.sqf)
* [Legion Studios Public Repo: isZombie](https://github.com/Legion-Studios/LegionCore-Public/blob/master/addons/common/functions/fnc_biologyCondition_isZombie.sqf)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://legion-studios.gitbook.io/legion-studios/frameworks/biology.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
