OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: Chrispy on 09 Sep 2007, 09:59:11
-
To a lot of you guys this might sound like the most noobest question, but I've been doing some OFP modding and I can't get the .pbo to work.
I'll put some files in, like say, a .wss file (which has the same name as one of the stock ones), or a config file, and it won't work.
I thought it would work because it did work on some other game franchise.
Do I need to get a file in the .pbo that directs OFP to my mod files?
Thanks for any help guys.
Chris :)
-
Details we need details.
What exactly are you trying to pack into this PBO?
Planck
-
An .hpp file to be precise.
Chris
-
Making a PBO involves having a config.bin (config.cpp) at the very least, unless you are packing a mission.
Config files can reference an .hpp file to #include it somewhere in its structure, but, I've never seen an addon that exclusively uses an .hpp file.
Maybe post the contents of said file?
Planck
-
cfgVehicles.hpp is the name of the file.
BTW, I think I know how to make the addon work. I can use Binarize - but I have no idea on how to set the perimeters to the .bat file... I renamed the .bat to something like "bin HiSpeed" but no luck...
I don't see why you need the .hpp file though - if you really do need it, I'll post it up.
Thanks mate.
Chris :)
-
OFP does not read .hpp files unless you tell it to (like with #include in the config.cpp), the config file you use has to be named config.cpp
And I think why Planck wants to see what's in the file is because if you make one typo there in a wrong place the whole thing will not work, or if you have other faults in it..
-
Well, I used the config.cpp file from the BIS Commented Config Files - and I think it worked!
I'm gonna remove the .pbo and see the differences...
* Edit:
No difference I felt at all. This definitely needs looking at. All I changed was the MaxSpeed attributes for some BTW.
Chris :)
Edit: attachment (hispeed.zip) lost in the crash of 2009 - WEK
-
A bit of help, anyone? The .pbo does not actually work. The config.cpp file might need some looking at...
Chris
-
It doesn't work because your attachment only contains a cfgVehicles.hpp and a text file called config.txt.
The config.txt file should really be called config.cpp, otherwise it is just a text file.
Planck
-
Oh, the config file ain't .cpp - my bad. But I get an error when loading up OFP (see attached .jpg).
Any help? Help is very much appreciated. :)
Chris :)
Edit: attachment (hispeed.zip) and image (ofp_preprocessor.JPG) lost in the crash of 2009 - WEK
-
That most likely happens because the #include cfgVehicles.hpp filepath is wrong, it points into the default game dir whereas it should point into the pbo of yours.
So, search for #include "CfgVehicles.hpp" in the config.cpp and change it to
#include "..\yourpboname\CfgVehicles.hpp"No guarantees it will work, making this the way you're making it can be tricky..
-
Chris is running 1.46 could that have anything to do with this prob. the config?
-
I put in "\hispeed.pbo\CfgVehicles.hpp" instead of "CfgVehicles.hpp" but no luck.
Yes I am running v1.46 - no Resistance. And trust me, I can't just teleport to the store and see Resistance on the shelfs and buy it. ;)
It sucks without Resistance doesn't it? :D
Chris
-
hi Chris , iam sure you could have a game store to order it for you somewhere. your missing out mate ;) do you live in a desert or something :P. just pickin on ya!
-
Lol, well would you still advise me to get Resistance if I showed you this list...?:
- I'm only 13.
- No money to spend.
- Hate going into town.
- Mum won't get me it.
- Wouldn't be allowed to order it via the net.
Umm... what else? Yes, it really sucks to be on plain vanilla OFP. What really sucks is that everything these days is for Resistance. You got the great mods like SLX and FFUR for Resistance, cool dynamic, etc. scripts/functions that don't work with v1.46, it sucks, haha. I really ain't experiencing the full potentional of OFP am I? Hehe.
Chris
-
Chris, filepaths must not include the file extension (in this case .pbo)..
Oh, and try this
#include "hispeed\CfgVehicles.hpp"
But your problem doesn't end there. You would need to include all the hpp files into your pbo that are #included in the config.cpp...
Which brings me to the question why on earth are you doing this the way you're doing it ??? :no:
If you're just changing some maxSpeed values it's completely unnecessary to have the whole game config in the pbo, you could just write your own config using the same classnames as BIS uses to override the stock unit maxSpeed, because if you use the whole game config your addon will override everything in the game which most likely causes only trouble..
It's highly possible that either the commented configs are dated are for the first resistance version.
If you would write your own small config you would be done already and not having these problems ;)
-
Well I am a bit new to OFP modding - I'll tell ya that.
So for example, if I wanted to, I could just put in a classname, and have the MaxSpeed entry in? Like said, I'm new to OFP modding, so I might screw up a bit.
And can I just make a config.cpp file, and add in #include "hispeed\CfgVehicles.hpp" and that's it?
If you want, you could make a small .hpp and/or .cpp for me made specially for what I'm doing, and maybe I can edit it a bit somehow? I'm not sure, I'm a bit confused... lol.
Sorry for any frustration caused mate.
Chris
-
You learn by studying :cool2:
To get at least an idea how the configs are done you can download some OFP 1.46 vehicle addon (from ofp.info (http://ofp.gamepark.cz/) for example), un-pbo it and see what's happening in it.
And can I just make a config.cpp file, and add in #include "hispeed\CfgVehicles.hpp" and that's it?
Not really, you would still be overriding every single OFP default vehicle (of course if you want that to happen it doesn't matter, although doing it like this the end-user friendliness is 0), and it requires a bit more than just one #include line..
class CfgPatches
{
class hispeed
{
units[]={};
weapons[]={};
requiredVersion=1.46;
};
};
#include "hispeed\CfgVehicles.hpp"Remove the earlier config.cpp, make a new one and copy/paste that in it.. Although this is not the way you should be doing this IMO..
-
Still the same error - did you what you said h-...
You guys reckon this has any relation to Resistance?
Also, what if I Binarize the .hpp file? I'm not really sure how to actually Binarize it though. I made a shortcut to bin.bat, and added something like "bin myaddon" (the folder was actually called "myaddon" as well) but no luck. The folder "myaddon" was also directly in the Binarize folder...
Chris
-
Exactly what maxSpeeds you have modified?
EDIT:
And the error occurs because the CfgVehicles.hpp also has #includes in it, so again you would need to include all these otherwise unneeded things in the pbo..
Why do you insist on making this with this hpp stuff? :dunno:
-
Why do I insist on making this with the .hpp stuff? I don't know - like said, I'm new to the modding.
Attached is the .zip with the entries I editted the maxSpeed on.
Also, mind helping me a bit with Binarize? Like in the previous post, I'm having a bit of trouble with bin.bat.
Well if you've got a totally better alternative, please share/attach it. :)
Thanks for hanging in there with me bud.
Chris :)
Edit: attachment (New Compressed (zipped) Folder.zip) lost in the crash of 2009 - WEK
-
Well if you've got a totally better alternative, please share/attach it.
That's why I asked about the maxSpeeds :P
And btw, I don't really know why you would need to binarize anything since your addon consist only of text file or two. Binarizing is not vital.
Attached is the .zip with the entries I editted the maxSpeed on.
Ok. So, in short, you want to increase the maxSpeed of every land vehicle (cars, tanks, APCs, men)?
I see one problem with this; these which you have edited are the base classes on which the rest of the vehicles are based on (inherit from) and whilst a good idea the individual vehicle classes however (like the HMMWV; just an example, didn't check) can have it's own maxSpeed value different from the basic class car and thus will not be affected by editing the car class maxSpeed..
Here's an example on how I would do this:
class CfgPatches
{
class mytag_hispeed
{
units[]={};
weapons[]={};
requiredVersion=1.46;
};
};
class CfgVehicles
{
//inheritanse tree..
class All {};
class AllVehicles: All {};
class Land: AllVehicles {};
class LandVehicle: Land {};
class Man: Land {};
class Soldier: Man {};
class Tank: LandVehicle {};
class RussianTank: Tank {};
class Car: LandVehicle {};
class T80: RussianTank {};
class mytag_T80: T80
{
maxSpeed=160;
displayName="T-80 (faster)";
};
};You just need to do that to every vehicle class. This way you have the faster vehicles named differently in the editor.
For some reason I could not override the default vehicle maxSpeeds by trying to override the default classes, it has been such a long time I did anything like thsi I probably forgot something. :dunno:
The mytag refers to OFP tags (http://www.ofpec.com/index.php?option=com_tags&task=info), and if you're planning on releasing anything to the public you should register your own TAG here (http://www.ofpec.com/index.php?option=com_tags&Itemid=52)
-
So the code you put in the quote - is it just that, and that only? All I have to do is edit it to my likings? Thanks a lot man.
Is there any other way to do this without .hpp? (Since you said in my .cpp I'll have to include every other .hpp). :(
Chris
-
So the code you put in the quote - is it just that, and that only?
It's just an example on how to change the maxspeed on the T-80 and name it differently so that you recognise it in the editor, you need to do those similar changes to every vehicle you want to have a higher maxSpeed.
For example if you want to change the default soldiers maxSpeed (named 'Soldier' in the editor IIRC) you jus add a new soldier class
class CfgPatches
{
class mytag_hispeed
{
units[]={};
weapons[]={};
requiredVersion=1.46;
};
};
class CfgVehicles
{
//inheritanse tree..
class All {};
class AllVehicles: All {};
class Land: AllVehicles {};
class LandVehicle: Land {};
class Man: Land {};
class Soldier: Man {};
class Tank: LandVehicle {};
class RussianTank: Tank {};
class Car: LandVehicle {};
class T80: RussianTank {};
class mytag_T80: T80
{
maxSpeed=160;
displayName="T-80 (faster)";
};
class SoldierWB: Soldier {}; //this is the BIS basic west soldier class
class mytag_SoldierWB
{
maxSpeed=34;
displayName="Soldier(faster)";
};
};
s there any other way to do this without .hpp?
That code goes into the config.cpp, forget the .hpp already :P
-
Thanks a lot h- - no .hpp and just a .cpp? Legend!!! :clap: :good:
Will have a muck around later on today and see what I come up with. :)
** EDIT **
Well, I got an error with the soldier - not the T80. Also, for the T80 class, you put class T80: RussianTank - how would I know what to put in for something like an M1A1 or something? I thought the class you put in would be somewhere in CfgVehicles.hpp (yes I have to get over the .hpp lol) - but no.
Thanks for hanging in there with me bud. :)
Chris :)
Edit: attached image (soldierwb.JPG) lost in the crash of 2009 - WEK
-
Ooops, the error is caused by a slight 'typo' (I forgot to inherit the mytag_SoldierWB from SoldierWB), instead of
class mytag_SoldierWBit should be
class mytag_SoldierWB: SoldierWB :whistle:
how would I know what to put in for something like an M1A1 or something? I thought the class you put in would be somewhere in CfgVehicles.hpp
Yes, you can find all the default vehicles in the vehicles.hpp and you can then copy/paste what you need from there.
I think the M1A1 class was:
class M1Abrams: Tank
-
Awesome, now I'm on a roll.
I'll see what crazy stuff I can come up with lol - hopefully I'll enjoy my OFP experience a bit more, heh.
Also, regarding this:
{
maxSpeed=34;
displayName="Soldier(faster)";
};
I'm assuming in between the { and the }; can I add other stuff that was in the .hpp like minFireTime=20 for instance as well?
Thanks man. I'm gonna have a bit of fun with this stuff.
*** EDIT ***
Okay, I tried putting two in now for the .cpp, and I got an error. Here's my code:
class CfgPatches
{
class mytag_hispeed
{
units[]={};
weapons[]={};
requiredVersion=1.46;
};
};
class Car: Jeep {};
class mytag_Jeep: Jeep
{
maxSpeed=160;
displayName="Jeep (Faster)";
};
class SoldierWB: Soldier {}; //this is the BIS basic west soldier class
class mytag_SoldierWB: SoldierWB
{
maxSpeed=34;
displayName="Soldier (Faster)";
};
};
It was an error with the Jeep BTW. I tried Jeep: Car instead but no luck.
I really hope I ain't peeing you off with all this requesting for help... :weeping:
Chris :)
-
You need to have the 'inheritanse tree' where the class car inherits it's atributes from, like in one of my examples earlier:
class All {};
class AllVehicles: All {};
class Land: AllVehicles {};
class LandVehicle: Land {};
class Man: Land {};
class Soldier: Man {};
class Tank: LandVehicle {};
class RussianTank: Tank {};
class Car: LandVehicle {};That doesn't include all you may need, that's just as much as I needed for the example to work.
The class you are adding yourself inherits from an upper class, 'parent class', and the parent class then inherits from it's parent, and so on.
The 'child class' inherits everything from it's parent so in the child you can then edit any of the tokens it has inherited from it's parent.
Which means that the answer to this
I'm assuming in between the { and the }; can I add other stuff that was in the .hpp like minFireTime=20 for instance as well?
is yes.
By looking at the hpp you can find from which class a vehicle inherits, and from the where that class in turn inherits, and so on, and finally you have the correct 'inheritance tree' (not probably called that, but I do)..
I really hope I ain't peeing you off with all this requesting for help...
Nah.
This however shows that there would be a need for a config/addon creation tutorial, written by someone who is better at explaining things than me ::)
-
I found the Jeep problem before I saw your post this morning, so all sussed.
What about the Soldier problem? (See the code in my previous post edit.)
Chris
-
You still have a major 'typo' in your code..
You're missing the
class CfgVehicles
{
-
Awesome, thanks man.
I might try and also make my Jeep sound a bit more gruntier (I think I know how to do that fortunately). :)
Thanks for all the help guys. :good:
Chris :)