![]() |
|
|
#1 |
|
Silly Flak Grenade Physics
I was messing around with a flak-grenade type weapon and I was trying to figure out how to make it arc correctly, but I seem to be having trouble.
The flak grenade uses Physics="PHYS_Falling" in default properties to make it arc the way it does, but this arc is too extreme. Is there a way of making it arc only slightly over a long distance? I'm a newbie coder, so I am not really sure what I can and can't do. BTW- What exactly does the CalcDrawOffset function do. The name suggests that it might have to do with the discrepancy between "internal" viewpoint (the player view) and an "external" viewpoint. I can't be sure though.
__________________
A Haiku The people who say Never say never, always Forget their own rule. Share the knowledge: Unreal Wiki |
|
|
|
|
|
|
#2 |
|
Try this in the flak shell's Tick() function:
Code:
Velocity -= 0.3 * Region.Zone.ZoneGravity; CalcDrawOffset() returns a vector for drawing the weapon in 1st person view (see Weapon.RenderOverlays() for details)
__________________
Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives Everything you ever wanted to know about replication (but were afraid to ask) [in German] | UnrealScript security considerations <elmuerte> you shouldn't do all-nighters, it's a waste of time and effort <TNSe> nono <TNSe> its always funny to find code a week later you dont even remember writing <Pfhoenix> what's worse is when you have a Star Wars moment <Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!" |
|
|
|
|
|
|
#3 |
|
That code would be frame rate dependant. A Timer() might be better.
(edit) Or something like: Code:
Acceleration = 0.5 * Region.Zone.ZoneGravity();
__________________
Aim for the horizon but watch your step Last edited by EasyRaider; 29th Jan 2002 at 02:17 PM. |
|
|
|
|
|
|
#4 | |
|
Quote:
Code:
simulated function Tick(float DeltaTime)
{
...
Velocity -= 0.3 * Region.Zone.ZoneGravity * DeltaTime;
}
__________________
Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives Everything you ever wanted to know about replication (but were afraid to ask) [in German] | UnrealScript security considerations <elmuerte> you shouldn't do all-nighters, it's a waste of time and effort <TNSe> nono <TNSe> its always funny to find code a week later you dont even remember writing <Pfhoenix> what's worse is when you have a Star Wars moment <Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!" |
||
|
|
|
|
|
#5 |
|
Umm, thanks.
How is it that you figure out all these esoteric class references?
__________________
A Haiku The people who say Never say never, always Forget their own rule. Share the knowledge: Unreal Wiki |
|
|
|
|
|
|
#6 |
|
What class references?
Region.Zone.ZoneGravity?
__________________
Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives Everything you ever wanted to know about replication (but were afraid to ask) [in German] | UnrealScript security considerations <elmuerte> you shouldn't do all-nighters, it's a waste of time and effort <TNSe> nono <TNSe> its always funny to find code a week later you dont even remember writing <Pfhoenix> what's worse is when you have a Star Wars moment <Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!" |
|
|
|
|
|
|
#7 | |
|
Quote:
__________________
Aim for the horizon but watch your step |
||
|
|
|
|
|
#8 |
|
simple answer.... I shoulda said this ages ago.
Reduce the grenade's mass in its default properties, this should make its arc longer. The default mass for most things seems to be 100.... |
|
|
|
|
|
|
#9 |
|
You mean the native physics code makes less massive objects fall slower?
I refuse to believe the physics are that bad coded...
__________________
Aim for the horizon but watch your step |
|
|
|
|
|
|
#10 |
|
That would be awfully daft!
Remember... 9.8 m/s^2.... 9.8 m/s^2
__________________
A Haiku The people who say Never say never, always Forget their own rule. Share the knowledge: Unreal Wiki |
|
|
|
|
|
|
#11 |
|
heres an idea... why not just shoot the projectile a bit faster? it wont fall as short as it is now... or hows about giving it a bit of a boost on its Z axis velocity when its spawned? that should make it arc a bit further.
__________________
How can you challenge a perfect immortal machine? |
|
|
|
|
|
|
#12 |
|
The problem with that is that I dont want to fire it faster. The flak shell moves horizontally at about the right rate, just it doesn't move vertically at the right rate. Trust me, I got the x/y movement about right.
__________________
A Haiku The people who say Never say never, always Forget their own rule. Share the knowledge: Unreal Wiki |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|