Posted: Mon Oct 15, 2012 7:41 am Post subject:
Creating a new IFV
Subject description: A quick analysis of IFV coding
IFV's are complex vehicles to make, and can throw a inexperienced/rookie modder off track. Indeed, as some of the more veteran members appeared to have had some issues, I decided to write a quick tutorial.
Special thanks to Graion Dialtch (spelt correct?) for assistance with the coding side of things.
1) Go find the IFV entry in Rules.ini. It shouldn't be too hard to find, but for the inexperianced, it should look like this:
;Infantry Fighting Vehicle - IFV
[FV]
UIName=Name:FV
Name=IFV
Prerequisite=GAWEAP
Primary=HoverMissile
Strength=360
Category=Transport
Armor=light
DeployTime=.022
TechLevel=3
Sight=8
PipScale=Passengers
Speed=10
CrateGoodie=no
Owner=British,French,Germans,Americans,Alliance
AllowedToStartInMultiplayer=no
Cost=600
Soylent=600
Points=20
ROT=5
Crusher=no
TooBigToFitUnderBridge=true
Turret=yes ;GEF should be no for ifv???
Passengers=1
Gunner=yes
AirRangeBonus=4 ;GEF this should always be less than or equal to the range of the primary weapon. Otherwise targeting issues could arise
;GEF If you change TurretCount, find this line in objtype.h and change it to reflect the new number of turrets
;#define OBJTYPE_DIM_TurretMax 15
;Or Weapon Count.
;TurretCount=15
HasTurretTooltips=yes
TurretCount=4
WeaponCount=17
2) Next, take a look at the Voxel you want to use. This is where things can get a bit complex, so keep at attention. It may not look it, but the IFV has a turret - so should your vehicle (the effects of non-turreted IFV's are untested, but it is likely to crash the game, so I wouldn't try it). You need to have the following:
X.vxl (where X is the Voxel you want to use)
Xtur.vxl
Xtur1.vxl
And of course, HVA's with the relevant file names.
Voxel wise, it is important to have a Xtur and Xtur1. If you do not, the Model will not show up correctly ingame. And as always, make sure you have HVA's with the exact same file names as your Voxels. Otherwise, bad things will happen.
This is the part where Graion and I got stuck, so take care!
3) The most important parts of the IFV's actual code are "Gunner=yes" and "Passengers=1". Gunner logic is what the IFV uses for weapon morphing. Passengers specifies the number of people who can occupy the vehicle. Setting the Passenger levels higher than 1 (with pips enabled) will require you to issue the deploy command twice - once to deploy the gunner, and another to deploy the passengers. The IFV will ALWAYS use the first passenger for it's turret.
4) The next part is the Turret Count and Weapon Count. Turret Count is the number of Voxelised Turrets the vehicle uses. This should be set at a value equal to the number of XturY.vxl's (where Y is a number) you have (so if your vehicle has Xtur1 up to Xtur8, the Turret Count should be . The vehicle's default Xtur does not count towards this total.
Weapon Count on the other hand is how many weapons the IFV uses. The code helpfully points out what Infantry occupant uses which weapon, making modding this section a breeze - simply implant the weapons you want into the slots and your done.
5) The final important part is the Turret Index. The Turret Index specifies which turret to use when a vehicle is occupied, as well as the corresponding Weapon from the Weapon Count. This interacts with this part of an Infantry's coding:
Code:
IFVMode=X
(where X is a number corresponding to a Turret)
As an example, an Allied GI has IFVMode=2 as his default value. This means when he enters the IFV, the Vehicle will select Weapon 2 from the Weapon Index, and morph Turret 1 as shown in the Turret Index, thus creating your typical Machine Gun IFV.
A methord exists for specifying who can enter an IFV. However, we currently are not aware of the Technique at this time, but will update the Tutorial as needed.
On a final note, none of the above requires Ares, though it is highly recommended. The only time you will ever need Ares logic with your IFV's is if your Mod supports more than one IFV-type unit, and also maybe for specifically specifying what Infantry Types can use the Vehicle.
And that's the end of this analysis. Hopefully someone out there finds it useful for designing their own IFV's. Otherwise, I apologize for wasting your time.
FYI, IFV logic works with more than one passenger slot. It uses the first infantry for determining weapon/turret. It also alters the way the passenger-related logic works in following fashion:
- If PipScale is displayed for passengers, there will be a gap between the first and second pip.
- Deploying the transport that contains more than 1 infantry requires you to use the deploy command two times for all infantry to exit. First deploy only unloads all but the first (as in, the one corresponding to first pip) infantry, whilst second deploy order is required for that one infantry unit to exit.
This, in a way, seems like intentional behaviour (altough for the point #2, reverse would be far more useful IMHO), so I wouldn't be surprised if originally the IFV had more than one passenger slot. In that case, I wonder why they scrapped that feature. Balancing maybe? Of course it's just as likely that all of the above are just random side-effects of IFV logic. _________________ QUICK_EDIT
FYI, IFV logic works with more than one passenger slot. It uses the first infantry for determining weapon/turret. It also alters the way the passenger-related logic works in following fashion:
- If PipScale is displayed for passengers, there will be a gap between the first and second pip.
- Deploying the transport that contains more than 1 infantry requires you to use the deploy command two times for all infantry to exit. First deploy only unloads all but the first (as in, the one corresponding to first pip) infantry, whilst second deploy order is required for that one infantry unit to exit.
This, in a way, seems like intentional behaviour (altough for the point #2, reverse would be far more useful IMHO), so I wouldn't be surprised if originally the IFV had more than one passenger slot. In that case, I wonder why they scrapped that feature. Balancing maybe? Of course it's just as likely that all of the above are just random side-effects of IFV logic.
The Release IFV in design looks basically like a Dwarfed Version of the Stryker IFV which was in service around the Games Time Frame (Also the Allies being American also further would have supported this idea) so it was probably originally supposed to be an APC. Even its Concept Art which while didn't look like the Stryker IFV looked like an Armored Car supports the idea of it being an APC. they probably scrapped it as eventually the Allies received the Nighthawk which provided the same role of carrying multiple infantry. _________________ ~ Excelsior ~ QUICK_EDIT
FYI, IFV logic works with more than one passenger slot. It uses the first infantry for determining weapon/turret. It also alters the way the passenger-related logic works in following fashion:
- If PipScale is displayed for passengers, there will be a gap between the first and second pip.
- Deploying the transport that contains more than 1 infantry requires you to use the deploy command two times for all infantry to exit. First deploy only unloads all but the first (as in, the one corresponding to first pip) infantry, whilst second deploy order is required for that one infantry unit to exit.
This, in a way, seems like intentional behaviour (altough for the point #2, reverse would be far more useful IMHO), so I wouldn't be surprised if originally the IFV had more than one passenger slot. In that case, I wonder why they scrapped that feature. Balancing maybe? Of course it's just as likely that all of the above are just random side-effects of IFV logic.
Duly noted. Hopefully I worded this correctly. QUICK_EDIT
An IFV without turret works fine BTW, in fact it works even without a hack/patch & was the only way to get a IFV clone to work in the original game. _________________
An IFV without turret works fine BTW, in fact it works even without a hack/patch & was the only way to get a IFV clone to work in the original game.
I stand corrected if that is indeed the case. However, this was how I got my IFV unit to work within the game - we did try several dozen fixes, none of them worked until I found out we were missing an important Voxel piece. QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum