How can i Make a replacement mod? |
How can i Make a replacement mod? |
Aug 23 2011, 03:50
Post
#1
|
|
Junior Member Group: Members Posts: 25 Joined: 3-October 07 From: London Member No.: 1,371 |
I was wondering if someone could help me or send me to a tutorial on how to make replacement mods for units.
Any help is appreciated -------------------- "An army without a leader is a body without a spirit"
|
|
|
Aug 23 2011, 12:40
Post
#2
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
It's not too difficult, just a bit of quick config work. You'll want to get your hands on the config.cpp file that's got the class you want to replace and ditto for the class you're replacing it with. If you're lucky, the class you want to replace it with won't inherit from the class you're replacing, but if you don't know, it's important to check!
If they don't, then it's a simple matter of having this sort of config for your replacement addon: CODE class CfgVehicles { class NewClass; //External Class Reference class OldClass: NewClass {}; }; (Obviously, you'll replace "oldclass" and "newclass" with the classnames you'd want! If they do inherit from each other, you can try the first method, but I don't think it'll work (recursion and all that, I should also point out that I've told you not to do this, so I'm not responsible for any damage you might do to your computer if you do it!), you need to rewrite whole thing, so, let's say you wanted to replace the class "SoldierEMG" with a variant that's got a different model and equipment. So the replacement class looks like this: CODE class HSO_ETroopLMG : SoldierEMG { model="\HSO_SLA\Soldier.p3d"; displayName="Infantry Autorifleman (RPK74)"; vehicleClass="HSO_SLAMan"; weapons[]={HSO_RPK74,DefaultManWeapons}; magazines[]= { HSO_545_RPK,HSO_545_RPK,HSO_545_RPK,HSO_545_RPK, HSO_545_RPK,HSO_545_RPK, HandGrenade,HandGrenade,HandGrenade,HandGrenade }; class Wounds { tex[]={}; mat[]={ "ca\characters\data\np_hhl.rvmat", "ca\characters\data\np_hhl_wound1.rvmat", "ca\characters\data\np_hhl_wound2.rvmat", "HSO_SLA\tex\SLA_body.rvmat", "HSO_SLA\tex\SLA_body_wound1.rvmat", "HSO_SLA\tex\SLA_body_wound2.rvmat" }; }; }; You'll need to find the class you'd normally inherit from, SoldierEMG from characters.pbo (it's best to extract the file directly from the pbo for this, to make sure it's the latest version!) which looks like this: CODE class SoldierEMG: SoldierEB { displayName=$STR_DN_MGUNNER; cost=60000; accuracy=1.5; nameSound="machineGunner"; weapons[]={PK,DefaultManWeapons}; magazines[]= { 100Rnd_762x54_PK,100Rnd_762x54_PK,100Rnd_762x54_PK,100Rnd_762x54_PK, 100Rnd_762x54_PK }; threat[]={1, 0.1, 0.8}; respawnWeapons[]={pk,DefaultManWeapons}; respawnMagazines[]={100Rnd_762x54_PK,100Rnd_762x54_PK,}; }; Then you'll want to replace the relevant parts with the one from the replacement class: (if something isn't there in the original class, such as the wound definitions here, you'll need to add them in) CODE class SoldierEMG: SoldierEB { model="\HSO_SLA\Soldier.p3d"; displayName="Infantry Autorifleman (RPK74)"; cost=60000; accuracy=1.5; nameSound="machineGunner"; weapons[]={HSO_RPK74,DefaultManWeapons}; magazines[]= { HSO_545_RPK,HSO_545_RPK,HSO_545_RPK,HSO_545_RPK, HSO_545_RPK,HSO_545_RPK, HandGrenade,HandGrenade,HandGrenade,HandGrenade }; threat[]={1, 0.1, 0.8}; respawnWeapons[]={pk,DefaultManWeapons}; respawnMagazines[]={100Rnd_762x54_PK,100Rnd_762x54_PK,}; class Wounds { tex[]={}; mat[]={ "ca\characters\data\np_hhl.rvmat", "ca\characters\data\np_hhl_wound1.rvmat", "ca\characters\data\np_hhl_wound2.rvmat", "HSO_SLA\tex\SLA_body.rvmat", "HSO_SLA\tex\SLA_body_wound1.rvmat", "HSO_SLA\tex\SLA_body_wound2.rvmat" }; }; }; (Ok, before you point it out, yeah, I did forget to define the respawnweapons and respawnmagazines classes in the addon I based this on, sue me ) Finally, Do not sign replacement addons. Using them online with other players who aren't can cause a lot of problems for everyone. -------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Aug 23 2011, 15:49
Post
#3
|
|
Junior Member Group: Members Posts: 25 Joined: 3-October 07 From: London Member No.: 1,371 |
That's a great help, Thanks D@ve . Would that also work for Razor in the campaign?
This post has been edited by Beretta: Aug 23 2011, 15:53 -------------------- "An army without a leader is a body without a spirit"
|
|
|
Aug 23 2011, 16:17
Post
#4
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
For some reason I thought this was in the ArmA.1 section. It should work for Razor, AFAIK there's nothing particularly special about them configwise, just FR troops with fixed identities. -------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Aug 23 2011, 18:41
Post
#5
|
|
Junior Member Group: Members Posts: 25 Joined: 3-October 07 From: London Member No.: 1,371 |
The last question, Where are the config.cpp files stored for the original Arma 2 units?
-------------------- "An army without a leader is a body without a spirit"
|
|
|
Aug 23 2011, 22:09
Post
#6
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
It depends on what you're looking for, almost all of it can be found in the addons folder's pbo files (the filenames are pretty descriptive), most of them are binarized though, (they'll be named "config.bin", rather than "config.cpp") you'll need something like eliteness to view them.
-------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Aug 23 2011, 22:14
Post
#7
|
|
Junior Member Group: Members Posts: 25 Joined: 3-October 07 From: London Member No.: 1,371 |
It depends on what you're looking for, almost all of it can be found in the addons folder's pbo files (the filenames are pretty descriptive), most of them are binarized though, (they'll be named "config.bin", rather than "config.cpp") you'll need something like eliteness to view them. Thanks -------------------- "An army without a leader is a body without a spirit"
|
|
|
Nov 22 2011, 16:37
Post
#8
|
|
New Member Group: Members Posts: 6 Joined: 21-November 11 Member No.: 9,329 |
Hi D@V£, I was wondering if you could help me out. I'm trying to make a unit replacement file that swaps the OA Delta Force characters for ardvarkdb's awesome AOR-1 SEALs and Multicam Rangers from his TF86 Temp SF pack. I took another replacement mod, un-pbo'ed it, then extracted the .bat file. Then I edited the files with the correct strings, I think, and now I'm not sure what to do next. I have four files, $PREFIX$, CfgPatches.hpp, CfgVehicles.hpp and config.cpp. What do I do next? Could I maybe send you them to look at? I really, really want to get this working. These units are the best out there.
Link to the mod is here: http://www.multiupload.com/RTRRBZELOK And some pics: http://forums.bistudio.com/showpost.php?p=...;postcount=1691 http://forums.bistudio.com/showpost.php?p=...;postcount=1693 |
|
|
Nov 22 2011, 22:50
Post
#9
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
IMO, trying to reverse engineer another replacement mod is just asking for a headache. Read the first post I made in this thread, what you'll want is just a config.cpp file that looks something like this:
CODE class CfgPatches { class My_replacement_Mod { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"CAweapons"}; }; }; class CfgVehicles { //External Class References class NewClass1; class NewClass2; class NewClass3; class NewClass4; class NewClass5; class NewClass6; class NewClass7; class NewClass8; class NewClass9; class NewClass10; class NewClass11; //Class Replacements class US_Delta_Force_AR_EP1: NewClass1 {}; class US_Delta_Force_Air_Controller_EP1: NewClass2 {}; class US_Delta_Force_Assault_EP1: NewClass3 {}; class US_Delta_Force_EP1: NewClass4 {}; class US_Delta_Force_M14_EP1: NewClass5 {}; class US_Delta_Force_MG_EP1: NewClass6 {}; class US_Delta_Force_Marksman_EP1: NewClass7 {}; class US_Delta_Force_Medic_EP1: NewClass8 {}; class US_Delta_Force_Night_EP1: NewClass9 {}; class US_Delta_Force_SD_EP1: NewClass10 {}; class US_Delta_Force_TL_EP1: NewClass11 {}; }; Replace "NewClass1" through to "Newclass11" with the vehicle classes from the the addon you want to use as a replacement, plonk it in a pbo, and you're good to go. (Unless ardvarkdb's used the DFOR classes as a base, though I wouldn't expect he would...) -------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Nov 22 2011, 23:49
Post
#10
|
|
New Member Group: Members Posts: 6 Joined: 21-November 11 Member No.: 9,329 |
Ok, I'll give it a try.
|
|
|
Nov 23 2011, 00:09
Post
#11
|
|
New Member Group: Members Posts: 6 Joined: 21-November 11 Member No.: 9,329 |
Doesn't work, provided I did everything correctly and have the right classes from the mod. Nothing is changed in-game.
This post has been edited by Suicide Commando: Nov 23 2011, 00:59 |
|
|
Nov 23 2011, 02:31
Post
#12
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
Does it throw out any kind of error message? If it isn't doing anything, then it's possible the addon hasn't been packed correctly - check the config is a cpp file (ie, it's actually called "config.cpp", not something like "config.cpp.txt", be warned that some versions of windows like to hide the .txt extension!).
Otherwise, are you using a modfolder? I don't think addons like this would work if you just put them in the default addons folder. -------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Nov 23 2011, 04:02
Post
#13
|
|
New Member Group: Members Posts: 6 Joined: 21-November 11 Member No.: 9,329 |
No, there is no error message, simply doesn't work. It is a .cpp file, no other extension at the end. And yes, I put it in it's own mod folder and activated it.
|
|
|
Nov 23 2011, 13:03
Post
#14
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
Hmm... I just checked with the latest version, and this method doesn't seem to work.
-------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Nov 23 2011, 15:40
Post
#15
|
|
New Member Group: Members Posts: 6 Joined: 21-November 11 Member No.: 9,329 |
Ok, sounds good. I really appreciate this too D@V£. Thanks for your time and effort.
|
|
|
Nov 23 2011, 21:33
Post
#16
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
Well, I've puntered around a bit, and I haven't really made any progress. As best I can tell it is overwriting the pre-existing class in some ways (ie, you can change the weapons used by a character doing this), but not in others (you can't change the model).
I don't know why this is. The best explanation I can think of is some kind of otherwise undetectable conflict between addons, but to be certain I'd have to build a replacement addon from the ground up (ie, not requiring any external addons), and I don't really have the free time right now to do something like that. Sorry I can't be of anymore of help here -------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Nov 23 2011, 22:10
Post
#17
|
|
New Member Group: Members Posts: 6 Joined: 21-November 11 Member No.: 9,329 |
Well, I do appreciate you trying. Guess I'm back to square one again...
|
|
|
Lo-Fi Version | Time is now: 25th April 2024 - 18:43 |