Posted by: RC_3197 - Wednesday, February 10, 2021 1:10:30 AM
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: [url=http://www.cnclabs.com/forums/cnc_postst13759p2_Creating-a-Pulse-Rifle-weapon--could-use-some-help.aspx?=]http://www.cnclabs.com/forums/cnc_postst13759p2_Creating-a-Pulse-Rifle-weapon--could-use-some-help.aspx?=[/url] 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[/quote] 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[/quote]

Posted by: Annihilationzh - Wednesday, February 10, 2021 4:51:38 PM
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.

Posted by: RC_3197 - Wednesday, February 10, 2021 7:59:18 PM
[quote=Annihilationzh;150235]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.[/quote] 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!