Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 5:25 pm
All times are UTC + 0
Creating a new IFV
Moderators: Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [6 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Sir Shockwave
Cyborg Firebomber


Joined: 06 Sep 2011

PostPosted: Mon Oct 15, 2012 7:41 am    Post subject:  Creating a new IFV
Subject description: A quick analysis of IFV coding
Reply with quote  Mark this post and the followings unread

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:

Code:
; **************************************************************************
; ********************************* IFV ************************************

;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

Weapon1=HoverMissile      ;Normal
EliteWeapon1=HoverMissileE      ;Normal
Weapon2=RepairBullet   ;Engineer
EliteWeapon2=RepairBullet   ;Engineer
Weapon3=CRM60         ;GI
EliteWeapon3=CRM60         ;GI
Weapon4=CRFlakGuyGun      ;Flak Troop ;Rocketeer
EliteWeapon4=CRFlakGuyGun      ;Flak Troop ;Rocketeer
Weapon5=CRMP5         ;Seal
EliteWeapon5=CRMP5         ;Seal
Weapon6=AWPE         ;Sniper
EliteWeapon6=AWPE         ;Sniper
Weapon7=CRElectricBolt   ;ShockTrooper
EliteWeapon7=CRElectricBolt   ;ShockTrooper
Weapon8=CRNuke         ;Crazy Ivan
EliteWeapon8=CRNuke         ;Crazy Ivan
Weapon9=CRMindControl   ;Yuri
EliteWeapon9=CRMindControl   ;Yuri
Weapon10=CRRadBeamWeapon;Desolator
EliteWeapon10=CRRadBeamWeapon;Desolator
Weapon11=CRNeutronRifle   ;Chrono
EliteWeapon11=CRNeutronRifle   ;Chrono
Weapon12=CRTerrorBomb      ;Terrorist
EliteWeapon12=CRTerrorBomb      ;Terrorist
Weapon13=CowShot      ;Cow
EliteWeapon13=CowShot      ;Cow
Weapon14=CRPsychicJab      ;Initiate
EliteWeapon14=CRPsychicJab      ;Initiate
Weapon15=CRVirusGun      ;Virus
EliteWeapon15=CRVirusGun      ;Virus
Weapon16=CRSuperMindBlast      ;Yuri Prime
EliteWeapon16=CRSuperMindBlast      ;Yuri Prime
Weapon17=CRMissileLauncher      ;Guardian GI
EliteWeapon17=CRMissileLauncher      ;Guardian GI



;Weapons
;GEF
;0=rocket
;1=gun
;2=repair arm
;3=high-tech

NormalTurretIndex=0
NormalTurretWeapon=0
RepairTurretIndex=2
RepairTurretWeapon=1
MachineGunTurretIndex=1
MachineGunTurretWeapon=2
FlakTurretIndex=1
FlakTurretWeapon=3
PistolTurretIndex=1
PistolTurretWeapon=4
SniperTurretIndex=1
SniperTurretWeapon=5
ShockTurretIndex=3
ShockTurretWeapon=6
ExplodeTurretIndex=3
ExplodeTurretWeapon=7
BrainBlastTurretIndex=3
BrainBlastTurretWeapon=8
RadCannonTurretIndex=3
RadCannonTurretWeapon=9
ChronoTurretIndex=3
ChronoTurretWeapon=10
TerroristExplodeTurretIndex=3
TerroristExplodeTurretWeapon=11
CowTurretIndex=3
CowTurretWeapon=12
InitiateTurretIndex=3
InitiateTurretWeapon=13
VirusTurretIndex=3
VirusTurretWeapon=14
YuriPrimeTurretIndex=3
YuriPrimeTurretWeapon=15
GuardianTurretIndex=3
GuardianTurretWeapon=16



IsSelectableCombatant=yes
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
VoiceSelect=IFVSelect
VoiceMove=IFVMove
VoiceAttack=IFVAttackCommand
VoiceFeedback=
DieSound=GenVehicleDie
MoveSound=IFVMoveStart
EnterTransportSound= IFVTransform
LeaveTransportSound= IFVTransform
CrushSound=TankCrush
Maxdebris=3
DebrisTypes=TIRE
DebrisMaximums=6
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
MovementZone=Normal
ThreatPosed=10   ; This value MUST be 0 for all building addons
DamageParticleSystems=SparkSys,SmallGreySSys
SpecialThreatValue=1
ZFudgeColumn=10
ZFudgeTunnel=13
ImmuneToRadiation=no
ImmuneToPsionics=no
Size=3
SizeLimit=1
VeteranAbilities=STRONGER,FIREPOWER,SIGHT,FASTER
EliteAbilities=SELF_HEAL,STRONGER,FIREPOWER,ROF
Accelerates=false

DeathWeapon=CRNuke ;GEF This will be a special case that only goes off if it's piloted by Ivan
ElitePrimary=HoverMissileE
;Bombable=no

; ********************************* IFV ************************************
; **************************************************************************


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


Key Words: #Tutorials #Modding #RedAlert2 #YurisRevenge #Ares #Rules.INI 

Last edited by Sir Shockwave on Tue Oct 16, 2012 7:13 am; edited 1 time in total

Back to top
View user's profile Send private message
Starkku
Cyborg Commando


Joined: 28 Dec 2007
Location: Finland

PostPosted: Mon Oct 15, 2012 7:53 am    Post subject: Reply with quote  Mark this post and the followings unread

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.

_________________

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Twitter Channel URL
Atomic_Noodles
Defense Minister


Joined: 05 Oct 2011

PostPosted: Mon Oct 15, 2012 8:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Starkku wrote:
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 ~

Back to top
View user's profile Send private message Visit poster's website
Sir Shockwave
Cyborg Firebomber


Joined: 06 Sep 2011

PostPosted: Tue Oct 16, 2012 7:13 am    Post subject: Reply with quote  Mark this post and the followings unread

Starkku wrote:
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.

Back to top
View user's profile Send private message
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Tue Oct 16, 2012 11:02 am    Post subject: Reply with quote  Mark this post and the followings unread

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.

_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
Sir Shockwave
Cyborg Firebomber


Joined: 06 Sep 2011

PostPosted: Tue Oct 16, 2012 12:53 pm    Post subject: Reply with quote  Mark this post and the followings unread

Mig Eater wrote:
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.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
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


Powered by phpBB © phpBB Group

[ Time: 0.1390s ][ Queries: 11 (0.0075s) ][ Debug on ]