Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline RC_3197  
#1 Posted : Wednesday, February 10, 2021 1:10:30 AM(UTC)
RC_3197
Private
Joined: 2/9/2021(UTC)
Posts: 3

Thanks: 1 times
So I've been working on a mod for generals for a while now. I've run into a few snags but nothing too difficult to overcome. That was until I needed to get a custom bullet for an infantry (and many of the units I'm making in the near future are going to need this too) I've got the bullet modeled but I just can't get it to behave correctly at all. I've tried many different variations of it (particle trail following an invisible projectile, Missile AI) the best result is the spectre gunship shell because it flies straight and always hits it's target except for when the infantry is very close to the target. When it's close the projectile doesn't appear or do damage at all. I think this is because the projectile is hitting the ground before it can reach the target. If the target moves a little further out you can see it's being launched at an angle where it's almost hitting the ground. I was wondering if anyone here has run into a similar issue and if there are any solutions out there or if it's not fixable and I should use my backup plan instead.

And I've seen this forum post: http://www.cnclabs.com/forums/cnc_postst13759p2_Creating-a-Pulse-Rifle-weapon--could-use-some-help.aspx?= and although very informative, it doesn't give me the solution I need

Here's what I've tried:
- MissileAIUpdate: Always hits the target but curves at angles that make it no longer look like a bullet
- Particle Trail: Does pretty much the same thing as the projectile would normally, just looks a lot worse
- Changing geometry size: Does pretty much nothing
- HeightDieUpdate: Does nothing, I only put it on recently because the spectre gunship has it and I hoped it would keep the projectile alive for longer

Here's my code:

Quote:
Object CustomProjectile

; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
DefaultConditionState
Model = AVSpectreShell1
End
End

; ***DESIGN parameters ***
EditorSorting = SYSTEM
VisionRange = 0.0
ArmorSet
Conditions = None
Armor = ProjectileArmor
DamageFX = None
End

; *** ENGINEERING Parameters ***
KindOf = PROJECTILE
Body = ActiveBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0
End
Behavior = HeightDieUpdate ModuleTag_04
TargetHeight = 1.0
TargetHeightIncludesStructures = No
OnlyWhenMovingDown = Yes
InitialDelay = 1000
End
; ---- begin Projectile death behaviors
Behavior = InstantDeathBehavior DeathModuleTag_01
DeathTypes = ALL
End
; ---- end Projectile death behaviors

Behavior = PhysicsBehavior ModuleTag_09
Mass = 1
End
;Version 1
; Behavior = MissileAIUpdate ModuleTag_07
; DetonateCallsKill = Yes
; TryToFollowTarget = Yes
; FuelLifetime = 500
; DetonateOnNoFuel = No
; InitialVelocity = 500 ; in dist/sec
; IgnitionDelay = 0
; DistanceToTravelBeforeTurning = 0
; DistanceToTargetForLock = 100
; End
;Version 2
; Behavior = MissileAIUpdate ModuleTag_07
; TryToFollowTarget = Yes
; FuelLifetime = 0
; InitialVelocity = 200 ; in dist/sec
; IgnitionDelay = 0
; DistanceToTravelBeforeTurning = 0
; End
;Version 0
;Behavior = MissileAIUpdate ModuleTag_07
;DetonateCallsKill = Yes
;TryToFollowTarget = Yes
;InitialVelocity = 300 ; in dist/sec
;IgnitionDelay = 0
;DistanceToTargetForLock = 1000
;End
;version 3
; Behavior = DumbProjectileBehavior ModuleTag_04
; DetonateCallsKill = Yes
; FirstHeight = 0 ; Height of Bezier control points above highest intervening terrain
; SecondHeight = 0
; FirstPercentIndent = 0% ; Percentage of shot distance control points are placed
; SecondPercentIndent = 100%
; FlightPathAdjustDistPerSecond = 9999 ; Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag.
; End
;version 4, disable locomotor
Behavior = DumbProjectileBehavior ModuleTag_07
FlightPathAdjustDistPerSecond = 9999 ; Can allow a max speed this can attempt to follow a target. Units are their velocity we can tag.
End

;Locomotor = SET_NORMAL CustomProjectileLocomotor
Geometry = Cylinder

GeometryMajorRadius = 0.1
GeometryHeight = 0.1
GeometryIsSmall = Yes
;Geometry = Sphere
;GeometryMajorRadius = 1.0
Scale = 1.0

End


Weapon code:
Quote:

Weapon CustomInfantryGun
PrimaryDamage = 10.0
PrimaryDamageRadius = 1.0
AttackRange = 100.0
;MinimumAttackRange = 5.0
DamageType = SMALL_ARMS
DeathType = NORMAL
WeaponSpeed = 900.0
;WeaponSpeed = 300.0
ProjectileObject = CustomProjectile
;FireFX = WeaponFX_Censored
;VeterancyFireFX = HEROIC WeaponFX_Censored
;FireSound = Censored
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
DelayBetweenShots = 1000
ClipSize = 0
ClipReloadTime = 0
End

Edited by user Wednesday, February 10, 2021 1:30:54 AM(UTC)  | Reason: Not specified

UserPostedImage
UserPostedImage
Sponsor
Offline Annihilationzh  
#2 Posted : Wednesday, February 10, 2021 4:51:38 PM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
The game doesn't really handle very fast projectile well. You'd probably need to slow it down for it to work at close range.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
thanks 1 user thanked Annihilationzh for this useful post.
RC_3197 on 2/11/2021(UTC)
Offline RC_3197  
#3 Posted : Wednesday, February 10, 2021 7:59:18 PM(UTC)
RC_3197
Private
Joined: 2/9/2021(UTC)
Posts: 3

Thanks: 1 times
Originally Posted by: Annihilationzh Go to Quoted Post
The game doesn't really handle very fast projectile well. You'd probably need to slow it down for it to work at close range.


Yep, that seems to be the issue. And although not perfect it's definitely a lot closer to the goal and I understand the limitations better. Now I have to weigh if the quirks that come with this style of weapon are worth keeping it or not. Thanks for your help!
UserPostedImage
UserPostedImage
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.