 |
Forum Info
|
 |
Forum Members: 18,537
Total Threads: 8,626
Posts: 94,205
Administrators:
DeeZire, Redemption
There are currently 112 users online.
|
 |
Partner Links
|
 |
 |
Advertisements
|
 |
|
| Generals & Zero Hour Editing Discuss any modding related issues to do with Generals and Zero Hour here. |
01-30-2004, 11:44 AM
|
#1 (permalink)
|
|
Senior Member
Join Date: Mar 2003
Location: UK
Posts: 676
|
Bouncing Grenades
I have decided to release some code I wrote for my TS mod which is highly unlikely to ever be released. Anyway, this code will create a disc thrower weapon where, if the projectile misses its target, it will bounce along the ground a bit and then blow up. Enjoy
Quote:
WeaponObjects.ini
;------------------------------------------------------------------------------
Object DiscGrenade
; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
ConditionState = NONE
Model = GIDisc_P
End
End
; ***DESIGN parameters ***
DisplayName = OBJECT:TankShell
EditorSorting = SYSTEM
ArmorSet
Armor = ProjectileArmor
End
VisionRange = 0.0
; *** ENGINEERING Parameters ***
KindOf = PROJECTILE
Body = ActiveBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0
End
Behavior = DestroyDie ModuleTag_03
;nothing
End
Behavior = DumbProjectileBehavior ModuleTag_09
DetonateCallsKill = Yes
; To tweak a Bezier path, please see GS
FirstHeight = 20 ; Height of Bezier control points above highest intervening terrain
SecondHeight = 20
FirstPercentIndent = 33% ; Percentage of shot distance control points are placed
SecondPercentIndent = 75%
FlightPathAdjustDistPerSecond = 0 ; Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag.
End
Behavior = PhysicsBehavior ModuleTag_05
Mass = 5 ; we can't have a zero mass, but we want it pretty tiny...
AllowBouncing = Yes
End
Behavior = HeightDieUpdate ModuleTag_06
TargetHeight = 1.0 ;;; changed from previous, 50
TargetHeightIncludesStructures = No
End
; ---- begin Projectile death behaviors
Behavior = InstantDeathBehavior DeathModuleTag_01
DeathTypes = NONE +DETONATED
; we detonated normally.
;FX = FX_NukeGLA
End
Behavior = InstantDeathBehavior DeathModuleTag_02
DeathTypes = NONE +LASERED
; shot down by laser.
;FX = FX_GenericMissileDisintegrate
;OCL = OCL_GenericMissileDisintegrate
End
Behavior = InstantDeathBehavior DeathModuleTag_03
DeathTypes = ALL -LASERED -DETONATED
; kills self
FX = FX_GrenadeBounce
OCL = OCL_CreateBouncingGrenade
End
; ---- end Projectile death behaviors
Geometry = Sphere
GeometryIsSmall = Yes
GeometryMajorRadius = 1.0
Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length
Scale = 1.4
End
;------------------------------------------------------------------------------
Object DiscGrenadeBounce
; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
ConditionState = NONE
Model = GIDisc_P
End
End
; ***DESIGN parameters ***
DisplayName = OBJECT:TankShell
EditorSorting = SYSTEM
ArmorSet
Armor = ProjectileArmor
End
VisionRange = 0.0
; *** ENGINEERING Parameters ***
KindOf = PROJECTILE
Body = ActiveBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0
End
Behavior = DestroyDie ModuleTag_03
;nothing
End
Behavior = LifetimeUpdate ModuleTag_04 ; random death time
MinLifetime = 1000 ; min lifetime in msec
MaxLifetime = 2000 ; max lifetime in msec
End
Behavior = PhysicsBehavior ModuleTag_05
Mass = 0.6 ; we can't have a zero mass, but we want it pretty tiny...
AllowBouncing = Yes
End
Behavior = FireWeaponWhenDeadBehavior ModuleTag_06
DeathWeapon = DiscThrowerGrenadeBounceWeapon
StartsActive = Yes
End
Behavior = WanderAIUpdate ModuleTag_07
End
Locomotor = SET_NORMAL DiscBounceLocomotor
; ---- begin Projectile death behaviors
Behavior = InstantDeathBehavior DeathModuleTag_01
DeathTypes = ALL
; we detonated normally.
FX = WeaponFX_GenericTankShellDetonation
End
; ---- end Projectile death behaviors
Geometry = Sphere
GeometryIsSmall = Yes
GeometryMajorRadius = 1.0
Shadow = SHADOW_VOLUME ; wanted so you can see that they are bouncing....
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length
Scale = 1.4
End
|
Quote:
Weapon.ini
;-------------------------------------------------------------------------------------------------
Weapon DiscThrowerGrenadeWeapon
PrimaryDamage = 60.0
PrimaryDamageRadius = 5.0
ScatterRadiusVsInfantry = 10.0 ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
AttackRange = 150.0
MinTargetPitch = -15 ; we may not target anything outside of this pitch range
MaxTargetPitch = 15 ; ditto
DamageType = EXPLOSION
DeathType = NORMAL
WeaponSpeed = 200 ; dist/sec
ProjectileObject = DiscGrenade
ProjectileDetonationFX = WeaponFX_GenericTankShellDetonation
FireSound = MarauderTankWeapon
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
DelayBetweenShots = 1500 ; time between shots, msec
ClipSize = 0 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 0 ; how long to reload a Clip, msec
; note, these only apply to units that aren't the explicit target
; (ie, units that just happen to "get in the way"... projectiles
; always collide with the Designated Target, regardless of these flags
ProjectileCollidesWith = STRUCTURES WALLS
End
;-------------------------------------------------------------------------------------------------
Weapon DiscThrowerGrenadeBounceWeapon
PrimaryDamage = 60.0
PrimaryDamageRadius = 5.0
AttackRange = 150.0
DamageType = EXPLOSION
DeathType = NORMAL
FireSound = MarauderTankWeapon
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
DelayBetweenShots = 1500 ; time between shots, msec
ClipSize = 1 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 0 ; how long to reload a Clip, msec
End
|
Quote:
ObjectCreationList.ini
; -----------------------------------------------------------------------------
ObjectCreationList OCL_CreateBouncingGrenade
CreateObject
ObjectNames = DiscGrenadeBounce
Offset = X:0.0 Y:0.0 Z:1.0
Count = 1
Disposition = LIKE_EXISTING INHERIT_VELOCITY
End
End
|
Quote:
Locomotor.ini
;------------------------------------------------------------------------------
Locomotor DiscBounceLocomotor
Surfaces = GROUND RUBBLE
Speed = 250 ; in dist/sec
MinSpeed = 250
TurnRate = 1 ; in degrees/sec
TurnRateDamaged = 1 ; in degrees/sec
Acceleration = 100 ; in dist/(sec^2)
AccelerationDamaged = 100 ; in dist/(sec^2)
Braking = 1 ; in dist/(sec^2)
PreferredHeight = 1
ZAxisBehavior = NO_Z_MOTIVE_FORCE
Appearance = HOVER
StickToGround = No
AllowAirborneMotiveForce = Yes
End
|
You will need to make a simple disc w3d in Renx (or you could cheat and use a normal tank shell...) If you have a problem, post it here...
|
|
|
01-30-2004, 03:38 PM
|
#2 (permalink)
|
|
Senior Member
Join Date: Aug 2003
Location: UK
Posts: 704
|
It's brilliant when people decide to release code they have worked on! Nice one!
|
|
|
01-30-2004, 04:06 PM
|
#3 (permalink)
|
|
Senior Member
Join Date: Aug 2003
Posts: 1,087
|
Yeah its the whole point of a modding community 
|
|
|
01-30-2004, 06:32 PM
|
#4 (permalink)
|
|
Senior Member
Join Date: Apr 2003
Location: Canada
Posts: 968
|
Cool  Nice working DJRowley. Glad to see somebody releasing code as well 
|
|
|
01-31-2004, 03:02 PM
|
#5 (permalink)
|
|
Senior Member
Join Date: Jun 2003
Location: Texas
Posts: 709
|
Indeed, I wish I had a infantry model that was animated that looks like a grenader w/ grenade launcher.
|
|
|
01-31-2004, 04:17 PM
|
#6 (permalink)
|
|
Senior Member
Join Date: Jul 2003
Location: Scotland, UK
Posts: 752
|
I used this code to make the Rangers Flashbangs bounce, pretty cool. Thanks for code DJ!
|
|
|
01-31-2004, 04:34 PM
|
#7 (permalink)
|
|
Senior Member
Join Date: Aug 2003
Posts: 1,087
|
Quote:
|
Originally Posted by Vanguard
Indeed, I wish I had a infantry model that was animated that looks like a grenader w/ grenade launcher.
|
Its not that hard...just use another model and its animations, modify the model if nescessary, the skin, and then all you have to do is make the firing animations which is not too hard.
|
|
|
01-31-2004, 04:56 PM
|
#8 (permalink)
|
|
Senior Member
Join Date: Aug 2003
Location: UK
Posts: 704
|
The mob member's throw a molotov cocktail, that would fit for a grenade thrower without a launcher
|
|
|
01-31-2004, 08:29 PM
|
#9 (permalink)
|
|
Senior Member
Join Date: Jul 2003
Location: Scotland, UK
Posts: 752
|
You could use the Siege Trooper I suppose, or just the Ranger Flashbang animation...
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
Smoke Grenades...
|
juLLe |
Generals & Zero Hour Editing |
9 |
06-01-2004 05:39 PM |
|
Bouncing Grenades Tutorial
|
DJRowley |
Generals & Zero Hour Editing |
0 |
05-12-2004 12:48 PM |
|
New Upgrade HE Grenades
|
Cold-Blooded |
Generals & Zero Hour Editing |
12 |
08-15-2003 12:23 AM |
|
Grenades
|
JhonnyRey |
Red Alert 2 & Yuri's Revenge Editing |
16 |
03-08-2003 06:20 AM |
All times are GMT -4. The time now is 12:21 PM.
|