Trying to modify ROProjectile/PanzerFaustRocket

  • 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/
  • Weve updated the Tripwire Privacy Notice under our Policies to be clearer about our use of customer information to come in line with the EU General Data Protection Regulation (GDPR) rules that come into force today (25th May 2018). The following are highlights of our changes:


    We've incorporated the relevant concepts from the GDPR including joining the EU and Swiss Privacy Shield framework. We've added explanations for why and how Tripwire processes customer data and the types of data that we process, as well as information about your data protection rights.



    For more information about our privacy practices, please review the new Privacy Policy found here: https://tripwireinteractive.com/#/privacy-notice

Shurek

FNG / Fresh Meat
May 21, 2006
857
13
0
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:

[TW]Ramm-Jaeger

Tripwire Interactive President
Oct 11, 2005
1,884
3,097
0
www.redorchestragame.com
You have to compile the code. Put mortarrocket.uc in some folder like this:
MyCodePackage\Classes\MortarRocket.uc

Then add "MyCodePackage" to the edit packages, and compile MyCodePackage. This will create a MyCodePackage.u file that contains your compiled code.
 

Six_Ten

FNG / Fresh Meat
Mar 12, 2006
1,382
400
0
aztecmod.darkesthourgame.com
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?
 

Amizaur

FNG / Fresh Meat
Aug 18, 2006
275
3
0
44
Gdansk, Poland
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:

Shurek

FNG / Fresh Meat
May 21, 2006
857
13
0
www.darkesthourgame.com
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:

Shurek

FNG / Fresh Meat
May 21, 2006
857
13
0
www.darkesthourgame.com
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
 

UncleDrax

FNG / Fresh Meat
Oct 13, 2005
1,494
60
0
Florida, USA
www.endoftheworldfor.us
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.
 

Divinehammer

FNG / Fresh Meat
Mar 9, 2006
1,397
6
0
Sunny, Obamalot
so if momentum transfer is from the pfaust to the target would it then be possible to mod the pfaust so that when it hits a tank it just catches on fire and keeps rolling IMO the best and most realistic animation.
 

Shurek

FNG / Fresh Meat
May 21, 2006
857
13
0
www.darkesthourgame.com
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:

Divinehammer

FNG / Fresh Meat
Mar 9, 2006
1,397
6
0
Sunny, Obamalot
I've calculated the speeds for my projectiles. I have the mass of the projectile and its speed. How is momentum transfer calculated?

Wouldnt this just be a force equation or a kinetic energy equation? I dont know physics was a long time ago seems like there has to be an equation.
 

fritzspam

FNG / Fresh Meat
May 23, 2007
17
0
0
Germany
When the mortar will be ready e.g. as a mod ?

Would be love to use it on our server. I was already trying to change some settings of the Panzerfaust, but ingame nothing happened different. What to do? Mutator needed?
 

Shurek

FNG / Fresh Meat
May 21, 2006
857
13
0
www.darkesthourgame.com
The mortar shell will be used with static mortar positions in an upcoming map release (not mine). Rumor is that it will be announced as a beta very, very soon - that's all I can say. ;)

The .u file will be distributed with the map from what I understand and set up as redirects by server admins so that players can use it online.