Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Red Orchestra: Ostfront 41-45 Forums > Red Orchestra Modifications > Coding

Reply
Click here to go to the first Dev post in this thread.  
Thread Tools Display Modes
  #1  
Old 05-13-2007, 10:48 AM
Shurek Shurek is offline
On Vacation
 
Join Date: May 2006
Location: www.darkesthourgame.com
Posts: 857
Default Trying to modify ROProjectile/PanzerFaustRocket

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_morta rshell2'
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 by Shurek; 05-13-2007 at 10:59 AM.
Reply With Quote
  This is the last developer post in this thread.   #2  
Old 05-15-2007, 06:28 PM
[TW]Ramm-Jaeger's Avatar
[TW]Ramm-Jaeger [TW]Ramm-Jaeger is online now
Tripwire Interactive President
 
Join Date: Oct 2005
Posts: 1,724
Default

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.
Reply With Quote
  #3  
Old 05-15-2007, 11:34 PM
Shurek Shurek is offline
On Vacation
 
Join Date: May 2006
Location: www.darkesthourgame.com
Posts: 857
Default

Thanks Ramm, it worked!!!

Custom mortar shells coming right up!

Last edited by Shurek; 05-16-2007 at 02:17 AM.
Reply With Quote
  #4  
Old 05-16-2007, 11:50 PM
Six_Ten's Avatar
Six_Ten Six_Ten is offline
Senior Member
 
Join Date: Mar 2006
Posts: 1,382
Default 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?
Reply With Quote
  #5  
Old 05-17-2007, 11:31 AM
Amizaur's Avatar
Amizaur Amizaur is offline
Senior Member
 
Join Date: Aug 2006
Location: Gdansk, Poland
Posts: 275
Default

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 by Amizaur; 05-17-2007 at 12:07 PM.
Reply With Quote
  #6  
Old 05-25-2007, 04:30 PM
Shurek Shurek is offline
On Vacation
 
Join Date: May 2006
Location: www.darkesthourgame.com
Posts: 857
Default

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 by Shurek; 05-25-2007 at 04:51 PM.
Reply With Quote
  #7  
Old 06-06-2007, 06:07 PM
Shurek Shurek is offline
On Vacation
 
Join Date: May 2006
Location: www.darkesthourgame.com
Posts: 857
Default

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!
Reply With Quote
  #8  
Old 06-08-2007, 01:15 PM
UncleDrax's Avatar
UncleDrax UncleDrax is offline
Senior Member
 
Join Date: Oct 2005
Location: Florida, USA
Posts: 1,473
Default

Quote:
Originally Posted by Shurek View Post
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!
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.
Reply With Quote
  #9  
Old 06-08-2007, 06:13 PM
Shurek Shurek is offline
On Vacation
 
Join Date: May 2006
Location: www.darkesthourgame.com
Posts: 857
Default

UncleDrax,

Thanks for the information. I should have remembered rule #1: UnRealWiki is your best friend
Reply With Quote
  #10  
Old 06-10-2007, 05:06 PM
Divinehammer's Avatar
Divinehammer Divinehammer is offline
Senior Member
 
Join Date: Mar 2006
Location: Sunny, Obamalot
Posts: 1,391
Default

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.
__________________
People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf. -George Orwell
Maps: Dubrava, Pavlov's House
Shared Links
Reply With Quote
  #11  
Old 06-11-2007, 10:42 AM
Shurek Shurek is offline
On Vacation
 
Join Date: May 2006
Location: www.darkesthourgame.com
Posts: 857
Default

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 by Shurek; 06-11-2007 at 12:14 PM.
Reply With Quote
  #12  
Old 06-11-2007, 03:23 PM
Six_Ten's Avatar
Six_Ten Six_Ten is offline
Senior Member
 
Join Date: Mar 2006
Posts: 1,382
Default Momentujm Transfer

Is momentum transfer figure the amount of force transmitted to the target to throw the ragdoll or destroyed mesh around?
__________________
NEMO ME IMPVNE LACESSIT
Reply With Quote
  #13  
Old 06-24-2007, 10:11 AM
Six_Ten's Avatar
Six_Ten Six_Ten is offline
Senior Member
 
Join Date: Mar 2006
Posts: 1,382
Default

I've calculated the speeds for my projectiles. I have the mass of the projectile and its speed. How is momentum transfer calculated?
__________________
NEMO ME IMPVNE LACESSIT
Reply With Quote
  #14  
Old 06-25-2007, 09:39 AM
Divinehammer's Avatar
Divinehammer Divinehammer is offline
Senior Member
 
Join Date: Mar 2006
Location: Sunny, Obamalot
Posts: 1,391
Default

Quote:
Originally Posted by Six_Ten View Post
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.
__________________
People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf. -George Orwell
Maps: Dubrava, Pavlov's House
Shared Links
Reply With Quote
  #15  
Old 07-18-2007, 06:48 PM
fritzspam fritzspam is offline
Junior Member
 
Join Date: May 2007
Location: Germany
Posts: 17
Default

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?
Reply With Quote
  #16  
Old 07-18-2007, 07:16 PM
Shurek Shurek is offline
On Vacation
 
Join Date: May 2006
Location: www.darkesthourgame.com
Posts: 857
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:18 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC