OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Jagermeister on 01 Nov 2011, 05:12:32
-
Hi,
I've searched everywhere for this, but I can't find any answers. In my personal config, I've changed the magazinetype for GrenadeLauncher from 256 to 32. It works perfectly - grenadiers can now carry the same amount of ammo as regular soldiers do. But when I do the same to LAWLauncher, I get problems:
- I can no longer select LAW ammo in the selection screen. It's just gone. Any LAW ammo that comes with description.txt is missing. SoldierWLAW comes with LAW ammo. No problem. Yet when I de-select his ammo and try to put it back -- it's gone again?
- This has something to do with the fact that LAWLauncher and (most rifles, for that matter) don't have their own magazine. "LAWLauncher" just uses "LAWLauncher" for magazines, but "M16GrenadeLauncher" uses "GrenadeLauncher." Is there a way to fix this? I don't want to create a new magazine; I'll have to insert it into every mission's description.txt.
- I have experimented with giving LAWLauncher a new magazine, but for some reason it causes crashes in the Resistance campaign. I think it has something to do with the weapon pool.
-
I can't understand your post very well... Also I put "description.txt" and it's "Description.ext" write your descritpion.ext here to look it.
-
I'm talking about the config.cpp file. Anyone with their own config.cpp file can try this. Change LAWLauncher's magazinetype= from magazinetype=256 to magazinetype=32 and you'll start to see problems. Do it to GrenadeLauncher or anything else and it works fine.
I meant description.ext, but it doesn't really matter. My problem is with the config file.
-
The conclusion would appear to be that OFP/CWA likes its magazinetypes to correspond with weapontypes. Weapons can be categorized by how they appear in ones inventory. Rifles, RPGs and handguns all take up space; the abilities to Throw (handgrenades) or Put (mines / charges) don't. Grenade launchers are seemingly a special case in being an attribute of some rifles. Pistols only turned up with Resistance in version 1.75.
OFP/CWA apparently expects that primary and secondary weapons (rifles and AT launchers) will have corresponding ammo in the main magazine slots, and gets confused when it doesn't find it there. Having tested your modification, I found any LAW ammo listed in description.ext to be available in the loadout screen so long as it's taken before you start playing with LAW launchers. The SP mission UnderHill is good for testing this.
If you want launchers and rockets to behave in the usual fashion at the gear screen you'd have to change the LAWlauncher to
weaponType=2;
like a pistol. Unfortunately that causes a whole host of crazy behaviour; try it if you dare!
In short, you can make do as you have it: when selecting gear re-distribute LAW/RPG ammo before touching the launchers. Weapontypes 1 and 16 belong with magazinetype 256. Added in the Resistance upgrade, weapontype 2 is married to magazinetype 32.
-
Edit: I SOLVED IT! :D Just put this into LAWLauncher:
weaponType="16 + 4096";
For some reason, that works. Everything works perfectly now.
I was afraid of that. :( Funny thing is, THERE IS a way to get it to act normally. Just add this to LAWLauncher:
magazines[]={"RPGLauncher/or any placeholder","LAWLauncher"};
If you do that, it works -- you can select and use LAWLauncher ammo in the selection screen without it disapearing. Perfect, right? Only it causes another problem.
When I played the Resistance campaign, if I complete a mission with LAWLauncher/RPGLauncher ammo in my inventory, the game crashes as the next mission's about to load. If I drop the ammo before the mission completes, it works fine. If I take magazines= out of the config, it also works fine. Adding more than one magazine to magazines= will cause a crash.
I'm guessing this has something to do with Resistance's weapon pool feature, because I don't get the problem in other campaigns or missions. Man, so frustrating. :(