Unknown Type/Outside Function Error

When utilizing code obfuscation with PBO Tools, you may encounter an error titled "Unknown type or code outside function." This issue generally arises when the code includes vectors formatted as "0 0 0" or similar, which are not compatible with string obfuscation in Enforce.

Issue Description

This error typically occurs in scenarios where vector definitions are directly included in function parameters or assignments within the code, which DayZ incorrectly interprets when they are obfuscated. For example:

override void OnPlacementComplete Man player, vector position = "0 0 0", vector orientation = "0 0 0")

In this instance, DayZ does not recognize the obfuscated string representing the vector and throws an error.

Resolution

To address this issue and prevent the "Unknown type or code outside function" error from occurring during the obfuscation process, you can use the //skip comment directive. Here’s how to apply it:

  • Identify the problematic line: Locate the line in your code where the vector "0 0 0" or a similar problematic vector is defined.

  • Directive: Add //skip to the end of the line. This tells PBO Tools to exclude this particular line from the string obfuscation process.

    Example:

    override void OnPlacementComplete Man player, vector position = "0 0 0", vector orientation = "0 0 0") //skip

For any questions or assistance, please contact our support team.

Last updated