Jump to content
  • 0

Custom billboards


monkeebhoy

Question

Recommended Posts

  • 0

... it will work in a mission file and the billboard can be build by the server, but all clients MUST have the picture in either a mod or mission folder, it is impossible to "stream" it from the server, however iirc then you could possibly show a youtube video on it.

Link to comment
Share on other sites

  • 0

Still doesn't work.  Got the server PBO up with the path pointing to epoch.altis\images\mercs.jpg and it's still giving a Cannot Load Texture error.  

 

 i assume its in the folder images in your mission? ... in that case, remove the "epoch.altis\" part, just have this "images\mercs.jpg",

Link to comment
Share on other sites

  • 0
Darth_Rogue

 

This is what I use server side, Jump on my server and steal the images from my PBO and see it that works. 

 

One think you are not doing anything strange with your client PBO are you ? I have seen it that sometimes the "default" path changes if you are trying to use CfgFunctions and Init's within that. So then the path of "dmr\img\bla.jpg" has to change.

private ["_objs"];
_objs = [
	["Land_Billboard_F",[14135.1,16505.4,0],64.4319,[[0.902073,0.431584,0],[0,0,1]],false],
	["Land_Billboard_F",[13710.3,16122,0],257.386,[[-0.975863,-0.218382,0],[-0,0,1]],false]
];

{
	private ["_obj","_bb"];
	_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
	_bb = ["dmr\img\bb01.jpg","dmr\img\bb02.jpg","dmr\img\bb03.jpg","dmr\img\bb04.jpg","dmr\img\bb05.jpg"] call BIS_fnc_selectRandom;
	_obj setObjectTextureGlobal [0, _bb];	
	if (_x select 4) then {
		_obj setDir (_x select 2);
		_obj setPos (_x select 1);
	} else {
		_obj setPosATL (_x select 1);
		_obj setVectorDirAndUp (_x select 3);
	};
} foreach _objs;
Link to comment
Share on other sites

  • 0

Can't seem to get the images to load.  Just says "Cannot load image......".  The paths are correct.  I've tried saving them as paa and jpg.  Image dimensions are 1024x512, which works fine for my custom server banner.  Any ideas?

 

Dont know why, but on my test server i have same problem Cannot load image......

But when i add same files with same configs to my host server, all images working without any problems.

Link to comment
Share on other sites

  • 0

I wonder if it's because I don't have my test server's mission packed into a PBO, it's just a folder.  I'll test that theory and see.  Thanks, Dawrfer!  I'll check it out after while.

 

 

Update - Can confirm that that was the problem.  As soon as I packed the mission on my test server into a PBO it worked.  So apparently it's a pathing issue when the mission isn't packed.  

Link to comment
Share on other sites

  • 0

I do for my production server, but since I make frequent changes to the test server it's much more simple to just leave it unpacked.  When the updates and changes are ready I always pack it before shipping it over to production.  But in this case it caused a problem.  

Link to comment
Share on other sites

  • 0

Is there any chance one of you gents can post a detailed "How to" now that this has been figured out as i am confused by all this convo and as a result to that not sure how to implement custom billboards. Much appreciated and apologise for being a noob 

Link to comment
Share on other sites

  • 0

How about this ?

 

You can load them onto the server PBO but for ease just use the mission PBO.

 

If you make your image 500 x 313 that seems to work well for me and keeps them small enough.

 

Create a file called billboard.sqf with the following in it

if (!isServer) exitWith {};
private ["_objs"];
_objs = [
    ["Land_Billboard_F",[14135.1,16505.4,0],64.4319,[[0.902073,0.431584,0],[0,0,1]],false],
    ["Land_Billboard_F",[13710.3,16122,0],257.386,[[-0.975863,-0.218382,0],[-0,0,1]],false]
];

{
    private ["_obj","_bb"];
    _obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
    _bb = ["dmr\img\bb01.jpg","dmr\img\bb02.jpg","dmr\img\bb03.jpg","dmr\img\bb04.jpg","dmr\img\bb05.jpg"] call BIS_fnc_selectRandom;
    _obj setObjectTextureGlobal [0, _bb];    
    if (_x select 4) then {
        _obj setDir (_x select 2);
        _obj setPos (_x select 1);
    } else {
        _obj setPosATL (_x select 1);
        _obj setVectorDirAndUp (_x select 3);
    };
} foreach _objs;

or

_Billboard1 = createVehicle ["Land_Billboard_F", [13338.2,14530.4,-0.365062], [], 0, "CAN_COLLIDE"];
_Billboard1 setDir 157.719;
_Billboard1 setPosATL [13338.2,14530.4,-0.365062];
_Billboard1 setObjectTextureGlobal [0, "dmr\img\bbkos.jpg"];

 place this into your mission PBO.  Within the initServer.sqf call it with. (you can also use init.sqf but initServer.sqf should only load on the server)

[] execVM "billboard.sqf"

Then place your images in the directory specified on _bb.

 

In this case this will randomly show the 5 different images randomly on the board. For a Static image you can use change _bb to something like

_bb = ['myimage.jpg']

_objs is the array of your billboard location..  

Link to comment
Share on other sites

  • 0

In case others were interested, I thought I'd update this thread with information on doing this with Eden (which I'm loving). Works great as you can see from this image (forgive the quality it's on my old work laptop which I used just to confirm that everything was okay, not my home desktop):

 

camp_redoubt_screenshot.jpg

The basic process is the same as noted previously in this thread but I'll document it below.

You're going to want one extra mod while editing the map which is e3den (big shout out to Chainsaw Squirrel for bringing that to our attention). This mod allows you to export SQF instead of SQM from Eden.

Start ARMA and open the Eden 3D editor. Place a billboard where you want it and get the SQF code for it by selecting Tools -> Export to SQF - Export Objects to SQF. This will copy the SQF code to your clipboard.

Create a new file in a code editor such as Notepad++ and paste the SQF you just copied to the clipboard from E3den into it. It will look like this:

{private _object = createVehicle [_x select 0,[0,0,0],[],0,'CAN_COLLIDE'];if (surfaceIsWater (_x select 1)) then [{_object setPosASL (_x select 1)},{_object setPosATL (_x select 1)}];_object setVectorDirAndUp (_x select 2)} forEach [["Land_Billboard_F",[14004,12992.6,0],[[0.974599,0.223959,0],[0,0,1]]]];

The important information is at the end of the line, for example:

[["Land_Billboard_F",[14004,12992.6,0],[[0.974599,0.223959,0],[0,0,1]]]];

and is, as you will see, the first set of coordinates, in this example [14004,12992.6,0] and the second two sets [[0.974599,0.223959,0],[0,0,1]].

Okay, now you want to de-PBO your mission file using Eliteness or similar, and create a new folder, e.g. "custom" within the mission folder. Let's assume that you placed one billboard and that's all you need. You want to create a file, I call mine billboard.sqf, in the custom folder. This will contain the following:

if (isServer) then {

_Billboard1 = createVehicle ["Land_Billboard_F", ***SETPOSATL***, [], 0, "CAN_COLLIDE"];
_Billboard1 setVectorDirAndUp ***SETVECTORDIRANDUP***;
_Billboard1 setPosATL ***SETPOSATL***;
_Billboard1 setObjectTextureGlobal [0, "custom\camp_redoubt.jpg"];

};

You'll want to replace the "***SETPOSATL***" in two lines with the first set of coordinates and replace the "***SETVECTORDIRANDUP***" with the second two. Do not copy and paste too many square brackets. In this example your billboard.sqf will look like this:

if (isServer) then {

_Billboard1 = createVehicle ["Land_Billboard_F", [14004,12992.6,0], [], 0, "CAN_COLLIDE"];
_Billboard1 setVectorDirAndUp [[0.974599,0.223959,0],[0,0,1]];
_Billboard1 setPosATL [14004,12992.6,0];
_Billboard1 setObjectTextureGlobal [0, "custom\camp_redoubt.jpg"];

};

Obviously you will also need to change the name of the picture file... Make sure that you have copied the JPG or PAA image file that you want on the billboard to the custom folder too.

Add the following to the init.sqf in the mission folder:

	[] execVM "custom\billboards.sqf";

Re-PBO the mission file, upload to your server, restart it and you're good to go. If you need more billboards then copy and paste the four lines beginning with _Billboard1, change that to Billboard2, etc. and change the ***SETPOSATL***, ***SETVECTORDIRANDUP*** and image names appropriately. Works like a dream.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...