Page 1 of 2

BZ2 Question: Share Units Across Mods

Posted: Mon Nov 25, 2013 8:05 pm
by bornlibra23
I have no idea about the design of BZ2 & Mods. However I am wondering if its possible to have the units available as plug & play in between mods.
For example I like the Rapier from Uler. So I wish to use it in FE. Is it conceivable that I can simply copy & paste a file from Uler to FE which will enable a end user like me to do the same?

Re: BZ2 Question: Share Units Across Mods

Posted: Mon Nov 25, 2013 8:12 pm
by Red Devil
i already added it to g66 along with some other units; might use it in FE, too, along with some other units i found hiding.

Re: BZ2 Question: Share Units Across Mods

Posted: Mon Nov 25, 2013 9:10 pm
by Zero Angel
Moving files to a different mod is a bit of an undertaking. First you need to pull all assets related to that unit (ODF, model, textures), and that unit's weapons (if you want to retain its original starting weapons). And then you got to find some way to get that unit in.

To get them into the other mod (have them be buildable or selectable as a starting unit) The fastest and most obvious way is to modify a factory build menu or starting vehicles list, but if you don't do it properly then it can make you have bad assets with another player if that player is playing, say, normal FE and you have one with modified files -- because you're changing an existing file.

The third solution and probably the best (but most labor intensive) is to create a recycler variant. This requires you to create clones of a normal recycler, cons, factory, give them slightly different names, (like ivrecy_bl, ibrecy_bl, ivcons_bl, ibfact_bl), and then edit the build menus of the modified one, then you create an autoreg file that allows you to select your modified recycler from a recycler variant list. As the original files arent modified so you can play with people who dont have the rec variant, however for obvious reasons if you were hosting a game with the rec variant enabled, they couldnt join you unless they also downloaded the recycler variant you created.

Re: BZ2 Question: Share Units Across Mods

Posted: Mon Nov 25, 2013 10:19 pm
by bornlibra23
Thanks Zero Angel.
It seems that I was being too naive about this. Sorry I don't know how BZ2 is designed at all. I am just an enthusiastic player of Single Player mods. I have never joined an online game.
I thought that there must be a standard way of interfacing with the game engine which would be flexible enough to allow loading of units from files on the file system on startup.
I assumed that the ODF, textures, model, weapons etc of a particular unit must be packaged together individually. So if I just copied the relevant files from one mod to the other it would work.
It would be a nice feature for Single Player missions adding a new dimension to the game.
One way to achieve this would be to have the build tree available as a directory structure on the file system. This will allow adding & changing units a snap. Perhaps a FUSE interface to the current data storage will help.
Recycler
----Scavenger
--------model
--------odf
--------sounds
--------texture

----Constructor
--------model
--------odf
--------sounds
--------texture

--------Factory
------------model
------------odf
------------sounds
------------texture

------------Sabre
----------------model
----------------odf
----------------sounds
----------------texture


Could you point me to a "Dummies Guide To BZ2 Modding"?

Re: BZ2 Question: Share Units Across Mods

Posted: Mon Nov 25, 2013 11:05 pm
by GSH
Google the BZ2 Pak Explorer. That's the canopener you need for data.pak and patch13.pak, which contain stock assets. (Data.pak is what's on CD, patch13.pak has files added/changed for 1.3). And the filesystem structure is organized more by type than use.

-- GSH

Re: BZ2 Question: Share Units Across Mods

Posted: Mon Nov 25, 2013 11:19 pm
by Nielk1
I am working on BZRAP, which is a mod that collects the races for MP and IA.

Re: BZ2 Question: Share Units Across Mods

Posted: Mon Nov 25, 2013 11:50 pm
by Zero Angel
A lot of mods package things differently, using a big texture folder as a repository for all unit texture files and a big models/bindata folder for all compiled models. The reasons for this is that the textures and models both have to be compiled, and they are usually all compiled in batch into one folder. It's a lot less work for the modmaker to just use one big texture folder and one big model folder then it is to take the time to move each individual compiled .msh (model) or .dxt (texture) into the proper unit heirarchy, especially if that model or texture goes through several revisions -- as well it gets confusing if units or buildings share textures.

A hybrid solution is to create a 'models' and 'texture' folder for each race, as it allows the clean removal of a race for example without having to rummage through a models or textures folder containing assets from all races.

However, it is only natural for a modmaker to want to choose a system that allows their mod to be finished development sooner -- and this often means sacrificing modularity or clean design for what's quicker to implement.

Re: BZ2 Question: Share Units Across Mods

Posted: Tue Nov 26, 2013 1:48 am
by bornlibra23
Oh I understand now. I understand that the modders can do it themselves. I was just hoping that an end user could share units across mods. Thanks.
I assume if I do unpack the pak files & replace a unit by another one & compile it back again I would still need to do some coding to make it work?

Re: BZ2 Question: Share Units Across Mods

Posted: Tue Nov 26, 2013 1:58 am
by Zero Angel
You can extract the individual files directly out of the pak file if you dont want to extract the entire contents of the pak file. You should never modify a pak file if you want to play with others, as doing so may cause bad asset issues to occur in multiplayer when you're trying to play with someone that has an unmodified pak file.

A safer thing to do would be to either move your modifications to a folder that bz2 reads anyways (like addon, in many cases -- or feaddon for FE) or copy and existing CFG file (stored in the bz2 root folder) and modify it to add a folder that has your custom assets in it.

Re: BZ2 Question: Share Units Across Mods

Posted: Tue Nov 26, 2013 2:12 am
by bornlibra23
Thanks Zero Angel. I will try that. I am reading the Mod Making Forum to understand how can I replace the Sabre in FE with Rapier from Uler. I can extract from Uler & add the assets into FE as you have described but how do I get to replace the Sabre with it; that is what I am trying to figure out. I am just getting my feet wet with modding.

I have selected the PHAROAH to extract out of Uler instead of Rapier as I could not find it.
furapcoxi.inf // Description of all unit
furapcoxi.odf // Contains reference to a bunch of files. Some of which are not available in this pak. I assume that they are in some other pack or are stock versions. I assume that these are the only files I require. There may be some more.
uvrapier00.xsi -- Can't find this file found uvrapier00.msh though.
uvrapier_cockpit.xsi -- Can't find this file found uvrapier_cockpit.msh though.
uvrapiersf.xsi -- Can't find this file
uvrapiersn.xsi -- Can't find this file
uvrapiersr.xsi -- Can't find this file
icon_uvrapier.tga -- Can't find this file found icon_uvrapier.dxtbz2 though.
*tank*.wav -- Can't find these files

I took these files & rolled up them into UlerPharoah.pak & added them into FE using AddPack("@rootdir\UlerPharoah.pak"); function in the configuration file. I get to the messed up login screen so I assume that the pak file is good. I am sure I will encounter more problems but will take them on as I find them. I am a complete newbie. This will be my first time editing a mod. To simplify I can also add the entire Uler1364y.pak file to FE.

Now I have to figure out how to replace the Sabre with Pharoah. Also if I require more files to transfer. Any thoughts?
Nielk1 wrote:I am working on BZRAP, which is a mod that collects the races for MP and IA.
I am trying to get the Pharoah into FE replacing Sabre. Can you guide me?

Re: BZ2 Question: Share Units Across Mods

Posted: Tue Nov 26, 2013 3:54 am
by Zero Angel
bornlibra23 wrote:Thanks Zero Angel. I will try that. I am reading the Mod Making Forum to understand how can I replace the Sabre in FE with Rapier from Uler. I can extract from Uler & add the assets into FE as you have described but how do I get to replace the Sabre with it; that is what I am trying to figure out. I am just getting my feet wet with modding.

I have selected the PHAROAH to extract out of Uler instead of Rapier as I could not find it.
furapcoxi.inf // Description of all unit
furapcoxi.odf // Contains reference to a bunch of files. Some of which are not available in this pak. I assume that they are in some other pack or are stock versions. I assume that these are the only files I require. There may be some more.
uvrapier00.xsi -- Can't find this file found uvrapier00.msh though.
uvrapier_cockpit.xsi -- Can't find this file found uvrapier_cockpit.msh though.
uvrapiersf.xsi -- Can't find this file
uvrapiersn.xsi -- Can't find this file
uvrapiersr.xsi -- Can't find this file
icon_uvrapier.tga -- Can't find this file found icon_uvrapier.dxtbz2 though.
*tank*.wav -- Can't find these files

I took these files & rolled up them into UlerPharoah.pak & added them into FE using AddPack("@rootdir\UlerPharoah.pak"); function in the configuration file. I get to the messed up login screen so I assume that the pak file is good. I am sure I will encounter more problems but will take them on as I find them. I am a complete newbie. This will be my first time editing a mod.

Now I have to figure out how to replace the Sabre with Pharoah. Also if I require more files to transfer. Any thoughts?
The XSI is the 'source' model file. BZ2 prefers to use MSH files, so when you put an MSH file into a BZ2 folder, and an ODF asks for an XSI (like uvrapier00.xsi), BZ2 will check for an MSH version, if it cant find one then it will look for the XSI version and convert it to MSH.

It's kind of the same with other texture files like PIC and TGA except BZ2 will not automatically convert those to DXTBZ2 format, you must provide the textures in dxtbz2 format (there is a converter for that, look around on the forums).

uvrapier00.msh is all that you need as far as the tanks' model is concerned. If, however you don't have the MSH and want to build an MSH with animations built-in then you need to provide the animation XSIs, (uvrapiersf, uvrapiersn, etc) so that the animations are 'baked' into the MSH when it is created by BZ2.

Re: BZ2 Question: Share Units Across Mods

Posted: Tue Nov 26, 2013 4:35 am
by bornlibra23
Zero Angel thank you for the explanation. I figured it out from various forum posts as well.
Now that I have these files & are presumably loaded into FE how can I have FE replace Sabre with Pharoah?
For reference I opened the data.pak & under objects\isdf\buildings\ibrecy I found a lot of *.inf & *.odf files. Curiously all the odf files contain a maxHealth = 12000 & other common variables. Some like ibrecy.odf contain values like buildItem1= "ivscav". So in theory if I replace ivscav wih another value the corresponding unit should be built. I checked in vehicles\ivscav\ivscav.odf & found baseName = "ivscav". So I assume that if I replace it with "furapcoxi" it should build the Pharoah. But which file should I edit? There are so many odf files with similar content.

Also I assume that after all the pak files are loaded everything is available in the same namespace.

Re: BZ2 Question: Share Units Across Mods

Posted: Tue Nov 26, 2013 6:55 am
by Zero Angel
bornlibra23 wrote:Zero Angel thank you for the explanation. I figured it out from various forum posts as well.
Now that I have these files & are presumably loaded into FE how can I have FE replace Sabre with Pharoah?
For reference I opened the data.pak & under objects\isdf\buildings\ibrecy I found a lot of *.inf & *.odf files. Curiously all the odf files contain a maxHealth = 12000 & other common variables. Some like ibrecy.odf contain values like buildItem1= "ivscav". So in theory if I replace ivscav wih another value the corresponding unit should be built. I checked in vehicles\ivscav\ivscav.odf & found baseName = "ivscav". So I assume that if I replace it with "furapcoxi" it should build the Pharoah. But which file should I edit? There are so many odf files with similar content.

Also I assume that after all the pak files are loaded everything is available in the same namespace.
You should edit buildItems in the recyler or factory's ODF.

BaseName is used for ODF variants of things, like if I made a constructor that had a different build menu, but I wanted to reuse the unit icon and description files (inf) from the ivcons, I can just specify baseName = "ivcons" and it will use those files.

Re: BZ2 Question: Share Units Across Mods

Posted: Tue Nov 26, 2013 8:58 am
by MrTwosheds
What you are trying to do is a mod in its own right, just changing the name in a factory does not mean it will be able to build that unit, vehicles have "requirements" eg the sabre requires you to have built a bunker first, so a race that does not have a bunker will not be able to build it.
Mod assets cannot be swapped about like that, the option to do so would need to be designed in by the mods maker.

Re: BZ2 Question: Share Units Across Mods

Posted: Tue Nov 26, 2013 4:23 pm
by Red Spot
In all honosty I never been able to understand why people want different mods packed together, stuff simply doesnt fit.
Playing with new stuff on the other hand can be fun, but you can simply use the editor to do that without a load of work. That however doesnt allow you to play missions, but that shouldnt matter. If you want all the assets of the mods you clearly are interested in the visual aspect of the mods and not their gameplay/missions.