OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: Chaos_Creator on 28 Sep 2002, 06:32:19
-
How do I change the default ammo slot size of the grenades for grenadelaunchers?
By default, they take up 2 ammo slots, and that's unrealistic. A typical 203 gunner has more then three rounds on him, so I want to scale it back to 1 slot, but I would like to avoid making a custom gun, cause frankly...I'm not that good at addon making...yet.
If anyone has a clue, let me know.
Thanks,
Chaos_Creator
-
Simple, in the cfgweapon section for the grenadelauncer change from...
magazinetype=2 * 256;
to...
magazinetype=256;
('256' represents 1 slot, and a regular soldier has '10*256' slots to fill up).
Unfortunately you'll have to make up your own amended weapon cpp file to make this change (simple solution) OR amend a working 1.75 config.bin file and have the changes appy throughout the game (better but hard to find solution).
-
('256' represents 1 slot, and a regular soldier has '10*256' slots to fill up).
No, 256 is the textures size
it should be:
magazineType="1 * 256";
-
We're getting warmer. :D
Does anyone know how to convert the config.bin to config.cpp for editing?
Or if I write an amended config.cpp specifically for the grenadelauncher, do I have to make up my own class or can I use the grenadelauncher class?
I would prefer to edit the 1.75 config.bin, but I just can't decode it. This way it would affect all the addons that use grenadelauncher, and normal weapons too, which I view as a the realistic way.
-
OK, I opened up the config.bin and copied the grenade related code out and pasted it into a new config.cpp, for an addon called M203A.
My problem is I get a nasty error when I try to run OFP.
'm203a\config.cpp.cfgweapons':'{' encountered instead of '='
Here's the code I wrote. It's my first addon from scratch so expect some errors.
Can someone check this out and see what I did wrong?
#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7
#define true 1
#define false 0
// type scope
#define private 0
#define protected 1
#define public 2
#define WeaponNoSlot 0// dummy weapons
#define WeaponSlotPrimary 1// primary weapons
#define WeaponSlotSecondary 16// secondary weapons
#define WeaponSlotItem 256// items
#define WeaponSlotBinocular 4096// binocular
#define WeaponHardMounted 65536
class CfgPatches
{
class M203Launcher
{
units[] = {};
weapons[] = {M203Launcher};
requiredVersion = 1.75;
};
};
cfgweapons
{
Class Default
class GrenadeLauncher: Default
class M203Launcher: GrenadeLauncher
{
cursor="t_select.paa";
scopeMagazine=2;
weaponType=0;
magazineType="1 * 256";
ammo="Grenade";
displayName="GRENADE";
displayNameMagazine="40MM GRENADE";
shortNameMagazine="GRENADE";
count=1;
reloadTime=0;
sound[]={"M203A\Weapons\grenade_launch",0.000316,1};
reloadSound[]={"M203A\Weapons\M16load",0.000316,1};
initSpeed=60;
canLock=0;
autoReload=0;
ffMagnitude=0.100000;
ffFrequency=1;
ffCount=1;
recoil="Empty";
dispersion=0.015000;
aiDispersionCoefY=2.000000;
maxLeadSpeed=15;
optics=0;
muzzlePos="usti granatometu";
muzzleEnd="konec granatometu";
uiPicture="igrenadier";
};
class M16GrenadeLauncher
class M203Launcher : M16GrenadeLauncher
{
scopeWeapon=2;
scopeMagazine=0;
weaponType=1;
valueWeapon=2;
valueMagazine=2;
displayName="M16 + M203A";
model="m16_granatomet_proxy";
picture="";
uiPicture="igrenadier";
muzzles[]={"M16Muzzle","M203Muzzle"};
class M16Muzzle: M16
{
magazines[]={"M16"};
};
class M203Muzzle: GrenadeLauncher
{
displayName="M203 Launcher";
sound[]={"M203A\weapons\M16GrenadeLaunch",0.000316,1};
magazines[]={"GrenadeLauncher","Flare","FlareGreen","FlareRed","FlareYellow"};
};
canDrop=1;
};
};
-
OK, I did some reading, and fixed the initial error, however I just can't seem to get this updated config to work. Shit...all I wanted to do was reduce the ammo slot of the 203 from 2 to 1. I tried to edit the config.bin, but when I recompiled it, something must have gotten chopped off, because OFP flipped out.
the latest error:
m203a\config.cpp/CfgWeapons/M203LauncherGun/: undefined base class 'M203LauncherGun'
Can someone please check out this config, and let me know what I did wrong?
class CfgPatches
{
class M203Launcher
{
units[] = {};
weapons[] = {M203Launcher};
requiredVersion = 1.75;
};
};
class CfgAmmo
{
class Default {};
class Grenade: Default{};
class 40MMGrenade: Grenade
{
hit=20;
indirectHit=18;
indirectHitRange=7;
minRange=15;
minRangeProbab=0.300000;
midRange=80;
midRangeProbab=0.550000;
maxRange=150;
maxRangeProbab=0.000000;
model="granat";
cost=40;
simulation="shotShell";
simulationStep=0.050000;
soundHit[]={"M203A\Explosions\expl3",10.000000,1};
soundFly[]={"M203A\objects\noise",0.000032,1};
soundEngine[]={"",0.000100,4};
visibleFire=2;
audibleFire=0.250000;
visibleFireTime=0;
};
};
class CfgWeapons
{
class Default{};
class GrenadeLauncher: Default{};
class M203Launcher: GrenadeLauncher
{
cursor="t_select.paa";
scopeMagazine=2;
weaponType=0;
magazineType="1 * 256";
ammo="40MMGrenade";
displayName="GRENADE";
displayNameMagazine="40MM GRENADE";
shortNameMagazine="GRENADE";
count=1;
reloadTime=0;
sound[]={"M203A\Weapons\grenade_launch",0.000316,1};
reloadSound[]={"M203A\Weapons\M16load",0.000316,1};
initSpeed=60;
canLock=0;
autoReload=0;
ffMagnitude=0.100000;
ffFrequency=1;
ffCount=1;
recoil="Empty";
dispersion=0.015000;
aiDispersionCoefY=2.000000;
maxLeadSpeed=15;
optics=0;
muzzlePos="usti granatometu";
muzzleEnd="konec granatometu";
uiPicture="igrenadier";
};
class M16GrenadeLauncher{};
class M203LauncherGun: M16GrenadeLauncher
{
scopeWeapon=2;
scopeMagazine=0;
weaponType=1;
valueWeapon=2;
valueMagazine=2;
displayName="M16 + M203A";
model="M203A\m16_pmp_granatomet";
picture="";
uiPicture="M203A\igrenadier";
muzzles[]={"M16Muzzle","M203Muzzle"};
class M16: M16GrenadeLauncher{};
class M16Muzzle: M16
{
magazines[]={"M16"};
};
class M203Muzzle: M203LauncherGun
{
displayName="M203 Launcher";
sound[]={"M203A\weapons\M16GrenadeLaunch",0.000316,1};
magazines[]={"M203Launcher","Flare","FlareGreen","FlareRed","FlareYellow"};
};
canDrop=1;
};
};
class CfgVehicles
{
class All{};
class AllVehicles:All{};
class Land:AllVehicles{};
class Man:Land{};
class Soldier:Man{};
class SoldierWB:Soldier{};
class SoldierWG:SoldierWB
class M203Soldier:SoldierWG
{
displayName = "Soldier (M203A)";
weapons[]={"M203Launcher","Throw","Put"};
magazines[]={M16,M16,M16,M16,M203Launcher,M203Launcher,M203Launcher,M203Launcher,M203Launcher,M203Launcher};
};
};
class CfgNonAIVehicles
{
class ProxyWeapon {};
class ProxyM203Launcher: ProxyWeapon {};
};
-
As I said initially
magazineType=256; is all you need to put though
magazineType="1 * 256"; does the same thing, okay Crunchy!
Now looking briefly at your config changes I think you need to change the
class M203Muzzle: M203LauncherGun
to
class M203Muzzle: M203Launcher
but the simplest way to do it is to simple change the magazinetype to '=256' in the
class GrenadeLauncher: Default
thats if you want the changes to apply to every rifle grenade launcher and if you're recrypting a config.bin back into the game.
Now the other problem you might have is a faulty decrypted 1.75 config.bin file (I picked up about 3 from various palces on the net and none worked properly when 'binned' again. It was only till I asked someone (won't say who) to actually send me a working version that I managed to get things cooking!).
Give me your email address and I'll send it to you.
But you'll also need Amalfi's 'cpp2bin' application to convert back to a config.bin for it to work ingame (get this app at ofp.gamezone.cz).
That should do it.
-
I think you're right about the bad decryption. I decrypted the config.bin using OFPManager, and adjusted the ammo slot value, but when I used cpp2bin util I got mega errors in OFPR. That's why I pursued making a psuedo addon by copying the values from the config.bin to a seperate config.cpp. I'm not exactly a pro at this and programming was never my forte, so I couldn't make it work.
Thanks for the offer of sending me the good config.bin. My email is braybon9@hotmail.com
-
ah ha. Figure it out. I was able to get a copy of an editable config.cpp. Worked as promised when cpp2bin'd. Now, I can make fun missions, where you have more then 3 grenades to work with. Cool
-
I would need the working decoded config.cpp too. Not for cheating but for changing the slots etc. If anyone could send it to jorkki90@hotmail.com I'd appreciate =)
-
BIS have an annotated Config.bin available from their Oxygen pages.
SelectThis
-
Checked the config from BIS site, I believe it's for 1.46? I would need the config for 1.75... Anyone? :)