Custom Vehicle Pickup Factory – Part 2


The final piece to this puzzle, while not necessarily needed, does enhance the appearance quite a bit. I’ve chose to add a glow effect, or GlowComp beneath the floating ammo, and it looks like it is coming from basemesh. We’re using a particle system this time, and not a satic mesh, therefore we add the line‘Template=ParticleSystem’Pickups.Health_Large.Effects.P_Pickups_Base_Health_Glow’. Look around in the content browser for a particle effect which suites your needs and swap in that effect’s name to see the change in appearance. Although I have the Translation=(Z=0.0) set to zero, I had to make some adjustments from time to time depending on which base and ammo meshes I’ve used, therefore I just keep it in there.

[code]

 //THIS IS THE GLOW EFFECT BEANEATH THE ITEM
   Begin Object Name=Glowcomp
   Template=ParticleSystem’Pickups.Health_Large.Effects.P_Pickups_Base_Health_Glow’
   Translation=(Z=0.0)
   SecondsBeforeInactive=1.0f
   Scale=1.5
   End Object
   Glow=Glowcomp
   Components.Add(Glowcomp)

 [/code]

Well, that’s all there is to it really. Swap out the meshes for other ones and play with a few of the values until you get one of your own which you like. The code below is everything listed above and should work fine in your build of UDK. I’m currently using it in the May 2011 build.

You can do the same with health as well. Take a look at the code for my vehicle health packs below. I haven’t marked up that class nearly as much as they are nearly identical.

[code]
class UTPickupFactory_VehicleHealth extends UTHealthPickupFactory;
simulated function PostBeginPlay()
{
Super.PostBeginPlay();
     Glow.SetFloatParameter(‘LightStrength’,1.0f);
}
defaultproperties
{
bPredictRespawns=false
bIsSuperItem=false
RespawnTime=30.000000
MaxDesireability=0.700000
HealingAmount=40
PickupSound=SoundCue’A_Pickups.Health.Cue.A_Pickups_Health_Medium_Cue’
bRotatingPickup=true
YawRotationRate=18384
bFloatingPickup=true
bRandomStart=true
BobSpeed=2.0
BobOffset=5.0
//THIS IS THE BASE OF THE PICKUP
Begin Object Name=BaseMeshComp
StaticMesh=StaticMesh’Pickups.Health_Large.Mesh.S_Pickups_Base_Health_Large’
Translation=(Z=-48)
Scale=2.0
End Object</pre>
//THIS IS THE ACTUAL HEALTH PACK
Begin Object Name=HealthPickUpMesh
StaticMesh=StaticMesh’Pickups.Health_Medium.Mesh.S_Pickups_Health_Medium’
MaxDrawDistance=7000
Scale=1.5
Translation=(Z=50.0)
End Object
//THIS IS THE GLOW EFFECT
Begin Object Name=Glowcomp
Template=ParticleSystem’Pickups.Health_Large.Effects.P_Pickups_Base_Health_Glow’
Translation=(Z=-50.0)
SecondsBeforeInactive=1.0f
Scale=2.0
End Object
Glow=Glowcomp
Components.Add(Glowcomp)
}

[/code]

 

[code]
  class UTVAmmo_TestTruckMissilePickupFactory extends UTAmmoPickupFactory;

  // Expose to Unrealscript and Unreal Editor.
  // the editinline variable modifier allows the editor to edit the primitive component within the properties
  // window. Secondly the instanced variable modifier means that the object reference will automatically
  // be recreated when the actor is spawned.
  var() const EditInline Instanced array <PrimitiveComponent> PrimitiveComponents;

  defaultproperties
  {

   //TELLS YOU HOW MUCH AMMO IT WILL DELIVER.
   AmmoAmount=10
   //TELLS YOU WHICH WEAPON IT IS ADDING AMMO FOR.
   TargetWeapon=class’UTVWeap_ScorpionTestTurret’
   PickupSound=SoundCue’A_Pickups.Ammo.Cue.A_Pickup_Ammo_Rocket_Cue’
   MaxDesireability=0.3
   //MAKES THE PICKUP ROTATE!
   bRotatingPickup=True
   //YOU GUESSED IT – HOW LONG (IN SEC) UNTIL AMMO RESPAWNS)
   RespawnTime=5.000000
   //EFFECTS HOW THE PICKUP BOBS UP AND DOWN
   BobSpeed=2.0
   BobOffset=5.0

  //THIS IS MADE LARGER THAN THE DEFAULT UTAmmoPickupFactory BECAUSE THE VEHICLES ARE LARGER THAN YOUR TYPICAL GAME PAWN.
   Begin Object Name=CollisionCylinder
   CollisionRadius=30.0
   CollisionHeight=15.6
   End Object

   // these are so dark they need all the help they can get to have their leet textures show up instead of being basically black
   Begin Object Name=PickupLightEnvironment
   AmbientGlow=(R=1.0f,G=1.0f,B=1.0f,A=1.0f)
   End Object

   //THIS IS THE STATIC MESH FOR THE PICKUP
   Begin Object Name=AmmoMeshComp
   StaticMesh=StaticMesh’Pickups.Ammo_Rockets.Mesh.S_Ammo_RocketLauncher’
   Rotation=(Roll=16384)
   Translation=(X=0.0,Y=0.0,Z=55)
   Scale=2.0
   MaxDrawDistance=4000
   End Object
   PickupMesh=AmmoMeshComp
   Components.Add(AmmoMeshComp);

   //THIS IS THE BASE, BENEATH THE AMMO
   Begin Object Name=PickupBaseMeshComp
   StaticMesh=StaticMesh’Pickups.Base_Powerup.Mesh.S_Pickups_Base_Powerup01′
   Scale=2.0
   MaxDrawDistance=4000
   Translation=(X=0.0,Y=0.0,Z=-10.0)
   CollideActors=false
   bUsePrecomputedShadows=True
   bAcceptsDynamicLights=true
   bAcceptsLights=true
   LightEnvironment=PickupLightEnvironment
   End Object
   Components.Add(PickupBaseMeshComp);

   //THIS IS THE GLOW EFFECT BEANEATH THE ITEM
   Begin Object Name=Glowcomp
   Template=ParticleSystem’Pickups.Health_Large.Effects.P_Pickups_Base_Health_Glow’
   Translation=(Z=0.0)
   SecondsBeforeInactive=1.0f
   Scale=1.5
   End Object
   Glow=Glowcomp
   Components.Add(Glowcomp)

  } [/code]

Leave a Reply