Jump to content


How to make infantries or POW trucks capture infantries.


1 reply to this topic

#1 Kris

    <Custom title available>

  • Project Team
  • 3825 posts

Posted 18 December 2007 - 06:55

Here's an old tutorial i posted ages ago (back in 2006 to be exact), It was too good just to get buried so i dugged it up and posted it here.

View PostYayo01, on 13 May 2006, 22:21, said:

What the heck....heres a crappy tut xD :D

First off , Define a Stungun in Weapon.ini. After that, Give that weapon to the infantry, truck, blegh you want to have the POW Ability

(look code below on how a stun gun code looks like)

Weapon StunGun
	PrimaryDamage = 100.0;define a lower number here.. EG&#58; 30 if you want the object last 3 or so shots befor surrenderin&#39;
	PrimaryDamageRadius = 0.0;must be zero
	AttackRange = 70.0;how far can the gun be fired?
	DamageType = SURRENDER;allows you to use the VoiceSubue Field of the Objects	
  UnitSpecificSounds
	DeathType = EXTRA_2
	WeaponSpeed = 999999.0 
	ProjectileObject = NONE
	FireSound = *entry from SoundEffects.ini
	RadiusDamageAffects = ENEMIES;should be enemies only...
	DelayBetweenShots = 5000
	ClipSize = 0  
	ClipReloadTime = 0;;if you want to make the weapon have a slow reload rate then...define how many Millisecs here...1000 is 1 sec btw;&#41;
  End


The "EXTRA_2" DeathType must be defined on the infantry's Death Code, On the first slowdeath module. You must add *-EXTRA_2 so it will not trigger the *argghh* voice when killed, Instead it will trigger its own voice you defined on its own SDB module.

Behavior = SlowDeathBehavior ModuleTag_Death01
	  DeathTypes = ALL -CRUSHED -SPLATTED -EXPLODED -BURNED -POISONED -POISONED_BETA -POISONED_GAMMA -EXTRA_2
	  SinkDelay = 3000
	  SinkRate = 0.5
	  DestructionDelay = 8000
	  FX = INITIAL FX_Argghhh!!
	End


You must add a new death module that uses the *EXTRA_2* death type in the deathtype field of the module

*this is the actual module that triggers the POW thing*
Behavior = SlowDeathBehavior ModuleTag_XX;&#91;XX&#93; can be anything..
	  DeathTypes = NONE +EXTRA_2
	  DestructionDelay = 0;this should be zero if you want the object appear immediatly
	  FX = INITIAL FX_SomeoneSurrendering;voice of the infantry surrender..if u want,Must be defined in FXLIST.ini
  
	  OCL = INITIAL OCL_InfantrySurrender; this will create a *surrendered* Crate, defined in OCL.ini
	End


Now you must create the OCL defined on the death module
In OCL.ini (AKA, ObjectCreationList.ini) =

ObjectCreationList OCL_InfantrySurrender;can be changed to what ever u want
	CreateObject
	  ObjectNames = SurrenderedGuy
	  Offset = X&#58;0 Y&#58;0 Z&#58;0
	  Count = 1
	  Disposition = SEND_IT_FLYING
	  DispositionIntensity = 0.1
	End
  End


Now after that, The thing will create a "surrendered" infantry when shotted by a weapon using the *EXTRA_2* deathtype. But, The object must now be defined in crate.ini

In Crate.INI, You must crate data of the surrendered infantry crate

EG:
CrateData *can be any name, without spaces, EG&#58; PimpMyAssCrateData*
	CreationChance = 1.0; this should be one
	CrateObject = SurrenderedGuyCrate 1.0 
	OwnedByMaker = Yes
  End


In the CrateObject, You must make the crate of the surrendered guy using his/her surrendered anims which you can find in W3DZH.big.

Object SurrenderedGuyCrate;the name must match the Cratedata field...
	Draw = W3DModelDraw ModuleTag_01
	  OkToChangeModelColor = Yes
	  DefaultConditionState
		Model = model name;AIRNGR_SKN
		Animation = model name	  &#59;The surrendering anims can be found in Generals or ZH.
		AnimationMode = MANUAL	&#59;can be ONCE, MANUAL Will do for now.
		Flags = START_FRAME_LAST&#59;can me removed, your choice.
		WeaponFireFXBone = PRIMARY Muzzle	&#59;must be defined like in the orig infantry.
		WeaponMuzzleFlash = PRIMARY MuzzleFX&#59;what comment above me said.
	  End
	End
	EditorSorting = MISC_MAN_MADE
	KindOf = PARACHUTABLE SELECTABLE 
  
	Behavior = SalvageCrateCollide ModuleTag_02
	  ForbidOwnerPlayer = Yes;should be yes
	  RequiredKindOf = BOAT			   &#59; the BOAT kindof must be putted on the POW Truck..so the truck is the only object that can pick it up...
	  ExecuteFX = &#34;entry from FXList.ini&#34;; If u want to spice it, You could make a fxlist that triggers a soundfx.. So when a pow truck picks up the &#34;dude&#34;. He will laugh to death or something.
	  LevelChance = 0%	  &#59;must be 0 so you can always get the &#34;surrendered dude&#34; and nothing else.
	  WeaponChance = 0%  &#59;must be 0 *what comment above said*
	  MoneyChance = 100%
	  MinMoney = 500		 &#59;change the value of the crate if u want
	  MaxMoney = 1000	  &#59;change the value of the crate if u want
	End
  
&#59;If you want to make the object stays longer, you must change the fields below.
	Behavior = DeletionUpdate ModuleTag_03
	  MinLifetime = 30000;just bored so me add numb to it xD
	  MaxLifetime = 35000;ditto
	End
  
	Geometry = CYLINDER
	GeometryMajorRadius = 10.0
	GeometryMinorRadius = 10.0
	GeometryHeight = 12.0
	GeometryIsSmall = Yes
	Shadow = SHADOW_DECAL
	ShadowSizeX = 14
	ShadowSizeY = 14
	ShadowTexture = ShadowI
  End


If you want it to be targetable so the enemy can't pick it up, Then you must define the *FORCEATTACKABLE * kindof in the kindof field of the object

and if you want it to be runned over by a tank or light vehicle....you must add this module =

Behavior = SquishCollide ModuleTag_XD
	End


This Module will allow the thing to be crushed, If the object has a BOAT kindof, The object will just pick it up. He can't crush it because its defined on the * RequiredKindOf* field in the SalvageCrateCollide module...

Thats all....I think :dizz:

If this thing fucked your ZH, Then Sorry for my crappy tutorial. :)

sorry if this tut is a mess xD if someone wants to fix something here....go ahead :)








#2 Dauth

    <Custom title available>

  • Gold Member
  • 11193 posts

Posted 18 December 2007 - 10:41

Looks well detailed and easy enough to follow, nice work



2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users