• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Trying to modify ROProjectile/PanzerFaustRocket

Shurek

Grizzled Veteran
May 21, 2006
857
13
www.darkesthourgame.com
Hello,

I hope someone can help me with this. I am trying to modify (or create a new sub-class) based on the existing Inventory.Classes.PanzerfaustRocketProjectile. Basically, I am trying to make a MortarRocketProjectile class.

There aren't many changes I'd like to do. See below. But in summary, I want to change the stock static mesh to a custom shell I created, change the damage type to Artillery, and change the damage radius to a wider one. Maybe I'd want to add in customs sounds later too.

I've edited the file in WOTgreal. What do I need to do to implement it in ROEd? I saved as MortarRocket.uc and put in the System folder and changed the EditPackages in the .ini Still no mortar in the Editor???

Thanks!

:)





//===================================================================
// MortarRocket
//
// Copyright (C) 2004 John "Ramm-Jaeger" Gibson
//
// The mortar shell projectile
//===================================================================
class MortarRocket extends RORocketProj;
//=============================================================================
// defaultproperties
//=============================================================================
defaultproperties
{
speed=8000.0
MaxSpeed=8000.0
Damage=1000.0
DamageRadius=512.0
MomentumTransfer=50000
MyDamageType=class'ROArtilleryDamType'
ShellImpactDamage=class'PanzerFaustImpactDamType'
ExplosionDecal=class'RocketMarkDirt'
ExplosionDecalSnow=class'RocketMarkSnow'
RemoteRole=ROLE_SimulatedProxy
LifeSpan=8.0
bNetTemporary=false
DestroyTime=0.2
ExplodeSound(0)=sound'Inf_Weapons.faust_explode01'
ExplodeSound(1)=sound'Inf_Weapons.faust_explode02'
ExplodeSound(2)=sound'Inf_Weapons.faust_explode03'
DrawType=DT_StaticMesh
StaticMesh=StaticMesh'shurek_stc.Weapons.ALT_mortarshell2'
DrawScale=1.0
AmbientGlow=96
bUnlit=True
LightType=LT_Steady
LightEffect=LE_QuadraticNonIncidence
LightBrightness=255
LightHue=28
LightRadius=5
bDynamicLight=true
bBounce=false
bFixedRotationDir=True
RotationRate=(Roll=50000)
DesiredRotation=(Roll=30000)
ForceType=FT_Constant
ForceScale=5.0
ForceRadius=100.0
bCollideWorld=true
FluidSurfaceShootStrengthMod=10.0
CullDistance=+7500.0
PenetrationTable(0)=26
PenetrationTable(1)=26
PenetrationTable(2)=0
PenetrationTable(3)=0
PenetrationTable(4)=0
PenetrationTable(5)=0
PenetrationTable(6)=0
PenetrationTable(7)=0
PenetrationTable(8)=0
PenetrationTable(9)=0
PenetrationTable(10)=0
}
 
Last edited:
Panzerfaust Atlatl Dart

Panzerfaust Atlatl Dart

I've modified the Faust code to fire long arrows instead of the stock warhead. It works fine except when you fire at point blank range into a target RO locks up. Whats happening is that the static mesh projectile is created and stopped by the target at the same time with no time to explode (I don't want the arrows to explode, but to pierce the target, just have not coded that yet.) Ths may be moot by the time I fully rewritet he code, but if anyone has any insight into how to prevent firing at point blank range I would appreciate it.

Would it be better to base the Atlatl on Grenade code instead of Panzerfaust?
 
Upvote 0
Wouldn't a mortar need a very high celing to work ? Should work on Arad for example, but maybe not on all maps (grenades would just hit the ceiling). Maybe a working mortar should spawn grenades, let them fly a bit, destroy them, calculate where and when should they fall, and spawn the grenades again at some altitude and correct trajectory over the target ?

P.S. Only remember to change the physics type or the grenades won't fly very far :). Second thing is - consider also using just HE tank shell as a base, instead of panzerfaust rocket. He shells have more in common with mortar grenades (ballistics, HE effect, visual effects. the exeption is that sound effect from PF could be maybe better, as PF explosion sounds like someting goinjg off partially buried in the ground ;-), or maybe hand grenade sound) and you can also avoid some various coding problems this way.
 
Last edited:
Upvote 0
Amizaur,

Thanks for the advice.

The number one reason I went with the Pfaust Projectile was the fact that it exploded upon impact just like a mortar round. Satchel and Grenade projectiles do not have that feature, without additional coding involved - and as n00b coder I didn't want to start down that road. Of course, an HE tank projectile could also mimic the impact of a mortar I suppose, but the effect (i.e. flaming log of a shell) didn't seem right.

Launch ceiling is not an issue with the modified pf rocket. My tests on several maps have shown this. As for sound effects, I've recoded it to bring a custom sound I put together which works great. ;)

The one thing I would like to explore for my Beta 2 is how to write code to randomize the velocity number between a certain numerical range. This would allow the impact distances of each shell to be slightly less predictable than what it is now. Generally speaking, when the shell is spawned it will always land within the same proximity point, without much deviation, which is to be expected given the physics involved. I still have a long way to go to learn about to randomize things like this...
 
Last edited:
Upvote 0
Can anyone give an explanation as how to translate these figures into real-world values?

Ex:

speed=8000.0 (km/h????)
MaxSpeed=8000.0 (km/hr????)
MomentumTransfer=50000 (huh?)

RotationRate=(Roll=50000) (angular velocity?)
DesiredRotation=(Roll=30000) (angle?)

I think once I understand what these values mean in real-world terms, I can create a more realistic weapon. Thanks!:D
 
Upvote 0
Can anyone give an explanation as how to translate these figures into real-world values?

Ex:

speed=8000.0 (km/h????)
MaxSpeed=8000.0 (km/hr????)
MomentumTransfer=50000 (huh?)

RotationRate=(Roll=50000) (angular velocity?)
DesiredRotation=(Roll=30000) (angle?)

I think once I understand what these values mean in real-world terms, I can create a more realistic weapon. Thanks!:D

I'm gonna imagine that the rotation rate is in UU.. you can get a description of how UU's translate into real world figures here:
http://wiki.beyondunreal.com/wiki/Unreal_Unit

Note that the length scale is differnet in RO.. i believe the RO scale is 60.352uu == 1 meter.

Speed is meters/second * RO's Distance Scale (so 60.352)

Example:
For a projectile velocity of 820m/s, I * 60.352, and get a speed of 49488.64. Round that to the nearest whole number and you get 49,489.
The max speed, at least for things like tank cannons and bullets, will be the same at the 'speed'. This is because for our purposes, the fastest it will go will be the speed at which is leaves the barrel, so as the projectile travels, it's speed will slow down. This will likely differ for rocket type projectiles that accelerate over time, tweak apprioriately.


Where'd you see Momemtum transfer?
I am probably mistaken, but I believe it's the 'rock the tank this amount when the tank fires' value. I don't know a real-world mapping for it.. i'd recommend just play with it or base of from existing values.
 
Upvote 0
I haven't quite figured out what the MomentumTransfer is all about other than it's real-world physics connotations.

When picking apart the code for various actors, I did notice that things like Tank Shells and bullets have high MomentumTransfer figures, while items like grenades and the satchel have low MT figures. This all makes logical sense to me.

What adjusting this value might do visually in-game is still a mystery to me though. I haven't noticed a difference playing around with it.
 
Last edited:
Upvote 0