Jump to content
Sign in to follow this  
sickboy

CBA: Community Base Addons public release!

Recommended Posts

As to your system for publicVariable array, would rather recommend event-based like

"myEvent" addPublicVariableEventHandler { _var = _this select 0; _value = _this select 1; /* add _value to array */ };

as your arrays will grow a lot otherwise and rebroadcasts a lot of duplicated content throughout the game.

Otherwise, an object variable is another thing I can recommend;

_vehicle setVariable ["myVar", true, true];

where the 2nd true (3rd parameter) means broadcast in MP.

In any case locallity of the vehicle can change throughout the game, from server to players, other players, back to server etc, depending on who's the driver/commander/gunner. (With some exceptions; I think weaponboxes are local to everyone (an instance per machine but dont remember)

I would recommend to make sure the eventhandler is added on every machine, and handle it as normal with a local check, and execute the code where it is local.

If the concern is clients that don't have the addon installed, then you could broadcast the code+addEventHandler code and make it execute on clients that don't have the addon on join.

Another concern is MP synchronization of certain object types, iirc bullets, or was it grenades, or rockets, or missiles, or all (???), do not synchronize visually in MP when you execute the setPos etc commands on only the machine where the vehicle is local.

This should be especially visual with tracers.

I think some evidence of this and workarounds are available in the following ace systems:

http://dev-heaven.net/projects/ace-mod2/repository/revisions/develop/show/Addons/sys_grenadethrow

http://dev-heaven.net/projects/ace-mod2/repository/revisions/develop/show/Addons/sys_rocket_ballistics

http://dev-heaven.net/projects/ace-mod2/repository/revisions/develop/show/Addons/sys_sight_adjustment

http://dev-heaven.net/projects/ace-mod2/repository/revisions/develop/show/Addons/sys_multi_barrel

etc

Edited by Sickboy

Share this post


Link to post
Share on other sites
Another concern is MP synchronization of certain object types, iirc bullets, or was it grenades, or rockets, or missiles, or all (???), do not synchronize visually in MP when you execute the setPos etc commands on only the machine where the vehicle is local.

This should be especially visual with tracers.

This would have been quite useful to know in the first place... :o

So if this that's the case then I suppose the best solution would be, as you said, to execute the code locally on every client. That would mean broadcasting code to clients who don't have the addon. Do you know the best way to do that? I know you can broadcast code with publicVariable but how do you ensure it is executed by the client?

Share this post


Link to post
Share on other sites
This would have been quite useful to know in the first place... :o

So if this that's the case then I suppose the best solution would be, as you said, to execute the code locally on every client. That would mean broadcasting code to clients who don't have the addon. Do you know the best way to do that? I know you can broadcast code with publicVariable but how do you ensure it is executed by the client?

Something along the lines of: http://wave.dev-heaven.net/waves/w+hqMyBUAMA/embed

This is about the only usage of setVehicleInit I'd recommend though :)

You could use a different 'dummy vehicle' type, add the vehicleInit directly with createVehicle or createUnit array,

maybe some other options im missing :)

Personally i'm more for requiring addons to be identical amongst all connected nodes or otherwise supply a mission-script variant, however I suppose this isn't always feasable.

Edited by Sickboy

Share this post


Link to post
Share on other sites

Yea, setVehicleInit was my initial thought for calling the code. I think it should be pretty simple now.

I'm wondering, will it work the same if I just use the vehicle that the init EH is attached to use setVehicleInit on? So, the addon is initialized through an init XEH attached to All (and thus inherited by all CfgVehicles), and has a check to make sure it only runs once. Why not just use this "init" vehicle for the purpose of broadcasting the code as well?

---------- Post added at 12:37 PM ---------- Previous post was at 12:33 PM ----------

Personally i'm more for requiring addons to be identical amongst all connected nodes or otherwise supply a mission-script variant, however I suppose this isn't always feasable.

Well the purpose of this addon is to add a neglected feature from BIS (sorta). It shouldn't really effect gameplay or anything as it's mostly trivial, and therefore I don't want to restrict it so that everyone needs it for it to work. And it has to be an addon because it needs to work all of the time (regardless of mission).

Edited by Big Dawg KS

Share this post


Link to post
Share on other sites

Alright. So I tested this last night and while my setVehicleInit commands didn't work, I found out that missiles (and I'm assuming rockets too) do have their position synced over the network when you setPos them. Which means now my code needs to check which type of ammo it is (not a problem, simple config check) and then decide whether to run only the client local to the vehicle or for every client. Fine, should be quite doable.

Now if only I could get the eventHandler attached on all clients. The compile code already gets broadcasted (simple publicVariable), but I'll have to look into the inits.

Share this post


Link to post
Share on other sites

Do I have to install CBA on the server as well or do I just copy the key on server? Is there any minus if I have it on server as well?

Share this post


Link to post
Share on other sites
Do I have to install CBA on the server as well or do I just copy the key on server?
You can choose to only allow the addon by having only the key on the server.
Is there any minus if I have it on server as well?
None that we know of. (And if there are, we need to know about it)

Share this post


Link to post
Share on other sites

OK. I had it on the server all the time and usually none of us had problems. Though there was a dude that had the same version but he said that it wont initialize. I guess he did something wrong becouse it always worked on my side. I was just asking becouse some mods are client side only, some not and Im not that skillful to figure it out on my own:). Let me refrase second question. Do you know if there is any plus to have it on the server? I guess I need to have it on server as well becouse some mods are on server that require CBA. Thanks for info.

Edited by 11aTony

Share this post


Link to post
Share on other sites

This works with OA or we should wait for new version?

Share this post


Link to post
Share on other sites
This works with OA or we should wait for new version?
CBA is not yet compatible with installations using just OA(*), but Sickboy and I are working on getting an improved CBA out. Stay tuned... :)

(*) It works with a combined ArmA II + OA installation, though, even if it's not technically complete.

Edited by Killswitch

Share this post


Link to post
Share on other sites

Extended eventhandlers seem to work, though. Can anybody confirm this?

Share this post


Link to post
Share on other sites

Great news!

But can I have a request?

Since BIS still hides some objects in the editor, is it possible to implement so that we see all object in the editor for ArmA2 and ArmA2:OA into the CBA release?

Since SickBoy made a addon that did just that for ArmA2 it could be incorporated as an addon or something you wish with the CBA.

It would make editing a lot easier...I think.

Share this post


Link to post
Share on other sites

If I am not mistaken that would mean replicating all the classes that are hidden and setting their scope to not be protected. That is a hell of a lot of work for very little gain and is really outside of the scope of CBA.

Share this post


Link to post
Share on other sites

yes I am somewhat aware of that.

I'm not capable of doing it but it would great having such a feature with CBA.

Not adding any new stuff, just revealing the ArmA2 and ArmA2:OA content.

I'm just asking...if it's to much then don't.

Share this post


Link to post
Share on other sites

Here are two new CBA releases for you:

  • CBA v0.4.2 for use with classic ArmA II.
  • CBA v0.5.0 for Combined Operations and Operation Arrowhead users.

The new 0.5.0 release contains a @CBA that has been updated for the content in OA and also a @CBA_OA that users of standalone Arrowhead installations need to use in addition to @CBA

Mirror sites - could we wait a bit with hosting 0.5.0 for a wider audience? There's a chance that 0.5.0 may have teething issues, so I'd like to wait a bit before it's hosted on the larger

addons websites in case a patch or two is needed in the near future

You can read about CBA in general here

Downloads: here

What do I download?

  • If you're still on ArmA II, download the 0.4.2 version and use -mod=@CBA
  • If you have a merged "Combined Operations" installation with both Arma II and Arrowhead, download 0.5.0 and use -mod=@CBA
  • If you have a standalone Operation Arrowhead installation, get 0.5.0 and use both mod folders: -mod=@CBA;@CBA_OA

How do I install it?

In short, you unpack the archives to a temporary location and then copy (drag&drop) the @CBA folder (and possibly the @CBA_OA) folder into your ArmA II installation folder. That's it.

Then, you need to modify your ArmA II launch parameters to load CBA and any other mod folders you want, using the -mod=... startup parameter.

For ArmA II and Combined Operations, you only need @CBA:

-mod=@CBA

If you have a standalone Arrowhead, use this:

-mod=@CBA;@CBA_OA

There's a bit more written on that here

Edited by Killswitch

Share this post


Link to post
Share on other sites

This is good news. I have a standalone instilation of OA. I am not sure how to use these files.. Any advice?

Thanks.

Share this post


Link to post
Share on other sites
This is good news. I have a standalone instilation of OA. I am not sure how to use these files.. Any advice?

Thanks.

Drop the @CBA_OA folder in your main OA/A2 directory. Then add:

-mod=@CBA_OA

to your shortcuts command line. If you are using any other mod folders add them after like so:

-mod=@CBA_OA;@Mod_Folder_1;@Mod_Folder_2

Lastly. Always use mod folders for your 3rd party content. Don't just throw the .pbos in the main AddOns folder of your OA directory. It's a pain in the ass if conflicts occur, among other things.

Good luck and enjoy this gem of a game!

Share this post


Link to post
Share on other sites

Does this new version make any changes to extended eventhandlers? Right now I'm just using XEH stand alone (without the rest of CBA) in OA and it seems to be working fine.

Share this post


Link to post
Share on other sites
Does this new version make any changes to extended eventhandlers? Right now I'm just using XEH stand alone (without the rest of CBA) in OA and it seems to be working fine.
Yes, Extended Eventhandlers has been...extended :D to accommodate the new content in Arrowhead. The older XEH in the previous (0.4.x) CBA will still work with a merged (A2+OA) installation, but the old one only covers the A2 content.

Share this post


Link to post
Share on other sites

this addons cause saved game to crash (campaign) when try to reload.

ps: version 1.52 && beta 71900

[3989,89.147,1385.37,"XEH: PreInit Started"]

[3989,91.415,1385.37,"XEH: PreInit Finished"]

C:\Users\Nobody\Documents\ArmA 2\Saved\ca\missions_e\campaign\continue.ArmA2OASave.: Item count not matching: 833!=1209

Error 'Bad file structure' at 'C:\Users\Nobody\Documents\ArmA 2\Saved\ca\missions_e\campaign\continue.ArmA2OASave.'.

ErrorMessage: Cannot load 'C:\Users\Nobody\Documents\ArmA 2\Saved\ca\missions_e\campaign\continue.ArmA2OASave'.

Share this post


Link to post
Share on other sites

not that i know what i'm talking about here, but:

this mod requires cba\addon\main\script_macros_common.hpp"

help?

Share this post


Link to post
Share on other sites
this addons cause saved game to crash (campaign) when try to reload.

ps: version 1.52 && beta 71900

I think I am having the same problem, I am using just @CBA seeing as I have A2 and OA merged. I am restarting my campaign to see if it was because of the CBA update....But if not :butbut:

EDIT: Using A2 v1.07 + OA v1.52

EDIT 2: Yep, it breaks the campaign. I tried starting a new one and it crashes upon loading, only started when I installed this new version....

Edited by Devil Dogs SF

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×