Jump to content
Sign in to follow this  
zylberome

How to make a pbo from a small Script ?

Recommended Posts

Hi guys,

Long time player here.

 

On an other thread, someone gave me a really nice script to fit my needs. It changes every units CamouflageCoeff, so AI will spot and engage at 200m instead of 450m on a flat terrain.

It's perfect for me as i dont use the 'right clik zoom' anymore. I find it completely breaks my immersion to have to constantly zoom to be able to fight ai on even grounds.

 

Problem is :

after searching on lots of threads, i can't figure out a way to make the pbo i made to work in any single player missions. If i write the scripts in debug windows, it works perfectly though.

 

What i did:

I downloaded arma tools and addonBuilder,

 

In a folder named  -MyAddon :

i put                         -CfgFunctions.hpp

                                 -config.cpp

                                 -MyScript.sqf

                

In the .sqf file is the script made by @Harzach.

Spoiler

ZYL_camo = [] spawn {

while {true} do

        {

            sleep 5;

                       {

                         _x setUnitTrait ["camouflageCoef", 0.5];

                        } forEach allUnits;

}};

 

In config.cpp is written : #include "CfgFunctions.hpp"


In CfgFunctions.hpp is written :

Spoiler

 

class CfgFunctions
{
    class MyAddon
    {
        class MyFunction
        {
            class MyScript
            {
                file = "\MyAddon\MyScript.sqf";
                postInit = 1;
            };
        };
    };
};

 

 

 

 

I used addonbuilder to get a pbo, which i then put in @MyMod/addons/Myaddon.pbo and load it from ArmaManager.

The name @MyMod appears at bottom of the screen in Arma 3 menu.

 

But the pbo don't work as AI engage me from 450/500 m.....

 

Can someone tell me what i did wrong ? And correct me ?

 

I'm so close.......

plz help.

 

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
class DefaultEventhandlers;
class CfgVehicles
{
	class Man;
	class CAManBase: Man
	{
		class EventHandlers: DefaultEventhandlers
		{
			class zyl_setUnitTrait
			{
				init = "(_this select 0) setUnitTrait ['camouflageCoef', 0.5]";
			};
		};
	};
};

If you put this into your config.cpp should be enough. Scratch CfgFunctions.hpp and MyScript.sqf.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you so much for the response !

 

But i think there may be a small typo i can't find somewhere..

 

When i copy your script in the debug console in editor it says   "errors... ; missing etc.."

 

Any idea ?

 

Share this post


Link to post
Share on other sites

It's a config, it won't run in the console.

  • Like 1
  • Thanks 1

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  

×