Home   Help Search Login Register  

Author Topic: I don't get how they work  (Read 7135 times)

0 Members and 2 Guests are viewing this topic.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: I don't get how they work
« Reply #15 on: 16 Sep 2007, 09:48:50 »
Chris, filepaths must not include the file extension (in this case .pbo)..

Oh, and try this
Code: [Select]
#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 ;)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: I don't get how they work
« Reply #16 on: 16 Sep 2007, 10:27:25 »
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
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: I don't get how they work
« Reply #17 on: 16 Sep 2007, 11:06:31 »
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 for example), un-pbo it and see what's happening in it.

Quote
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..

Code: [Select]
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..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: I don't get how they work
« Reply #18 on: 16 Sep 2007, 21:24:39 »
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
« Last Edit: 16 Sep 2007, 21:30:33 by Chris »
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: I don't get how they work
« Reply #19 on: 16 Sep 2007, 21:38:40 »
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:
« Last Edit: 16 Sep 2007, 21:47:59 by h- »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: I don't get how they work
« Reply #20 on: 17 Sep 2007, 08:44:52 »
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
« Last Edit: 16 Jan 2011, 03:31:04 by Walter_E_Kurtz »
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: I don't get how they work
« Reply #21 on: 17 Sep 2007, 09:39:12 »
Quote
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.

Quote
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:
Code: [Select]
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, and if you're planning on releasing anything to the public you should register your own TAG here
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: I don't get how they work
« Reply #22 on: 17 Sep 2007, 20:49:51 »
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
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: I don't get how they work
« Reply #23 on: 17 Sep 2007, 23:49:35 »
Quote
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
Code: [Select]
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)";
        };
};

Quote
s there any other way to do this without .hpp?
That code goes into the config.cpp, forget the .hpp already  :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: I don't get how they work
« Reply #24 on: 18 Sep 2007, 05:54:10 »
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
« Last Edit: 16 Jan 2011, 03:32:58 by Walter_E_Kurtz »
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: I don't get how they work
« Reply #25 on: 18 Sep 2007, 09:21:11 »
Ooops, the error is caused by a slight 'typo' (I forgot to inherit the mytag_SoldierWB from SoldierWB), instead of
Code: [Select]
class mytag_SoldierWBit should be
Code: [Select]
class mytag_SoldierWB: SoldierWB  :whistle:

Quote
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:
Code: [Select]
class M1Abrams: Tank
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: I don't get how they work
« Reply #26 on: 18 Sep 2007, 21:10:06 »
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:

Code: [Select]
        {
              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:

Code: [Select]
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 :)
« Last Edit: 18 Sep 2007, 21:44:19 by Chris »
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: I don't get how they work
« Reply #27 on: 19 Sep 2007, 00:52:21 »
You need to have the 'inheritanse tree' where the class car inherits it's atributes from, like in one of my examples earlier:
Code: [Select]
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
Quote
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)..

Quote
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  ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: I don't get how they work
« Reply #28 on: 19 Sep 2007, 05:37:18 »
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
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: I don't get how they work
« Reply #29 on: 19 Sep 2007, 10:56:07 »
You still have a major 'typo' in your code..
You're missing the
Code: [Select]
class CfgVehicles
{
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.