Jump to content
Sign in to follow this  
Charles Barkley

Functions do work in test-mission but not when packed as addon

Recommended Posts

Hey guys!

I come across a mean issue where I am not able to use the function configuration that works for my addon-test mission in my packed addon.pbo.

 

Erros in .rpt on startup

 

15:20:01 Warning Message: Script camp\fn_buildCampsite.sqf not found

15:20:01 Warning Message: Script camp\fn_packCampsiteItem.sqf not found

15:20:01 Warning Message: Script init\fn_init.sqf not found

15:20:01 Warning Message: Script init\fn_backpackInit.sqf not found

15:20:01 Warning Message: Script utils\fn_log.sqf not found

 

 

.pbo file structure

 

image.png

 

CfgFunctions.hpp 

 

class CfgFunctions{
    class ReconMod{
        class Camp{
            file = "camp";
            class buildCampsite {};
            class packCampsiteItem {};
        }
        class Init{
            file = "init";
            class init{preInit = 1;};
            class backpackInit {};
        }
        class Utils{
            file = "utils";
            class log{};
        }
    }
}

 

CfgPatches.hpp 

 

class CfgPatches {
    class ReconMod {
        author = "xetra11";
        name = "Recon Mod";
        version = "1.0";
        units[] = {};
        weapons[] = {};
        requiredVersion = 1.0;
        requiredAddons[] = {};
    };
};

 

config.cpp

#include <CfgFunctions.hpp>
#include <CfgVehicles.hpp>
#include <CfgPatches.hpp>

 

 

Did I miss a part where it says to have functions work in an addon I have to go another way of declaring functions?


Thanks for your help in advance!

 

Share this post


Link to post
Share on other sites

Try adding reconmod in front of file = "camp"; , e.g. file = "reconmod\camp";

  • Thanks 1

Share this post


Link to post
Share on other sites
That was the problem!
But I did not fully grasped the reason?
Is prefix in \camp like the name of my .pbo file or what?
 
And if so? Do I need to kinda dynamically add it when packing an addon/pbo ? Because in my mission I cannot use this prefix - the path is invalid for it.
 
I saw ALiVE Mod using file paths like "x/addon/functioname.sqf" but I assume they replace the "x" with a proper value for either addon packing or testing in a mission, aye?

Share this post


Link to post
Share on other sites

Also consider getting an OFPEC tag https://www.ofpec.com/tags/ and prefix your addons with your nametag. E.g. ReconMod is kind of a universal name that others might want to use as well. Naming it ChBa_ReconMod makes it harder to conflict the namespace.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×