News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Mods > WoD Mod Pod > Ask a Coder

Reply
 
Thread Tools Display Modes
Old 25th Jan 2002, 10:41 PM   #1
WheatPuppet
Corriganism
 
WheatPuppet's Avatar
 
Join Date: Jan. 22nd, 2002
Location: What state you ask? Denial.
Posts: 85
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
WheatPuppet is offline   Reply With Quote
Old 26th Jan 2002, 09:11 AM   #2
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,753
Try this in the flak shell's Tick() function:
Code:
Velocity -= 0.3 * Region.Zone.ZoneGravity;
Adjust the 0.3 to fit your needs.

CalcDrawOffset() returns a vector for drawing the weapon in 1st person view (see Weapon.RenderOverlays() for details)
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| 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!"
Wormbo is offline   Reply With Quote
Old 29th Jan 2002, 02:00 PM   #3
EasyRaider
Crazy coder
 
EasyRaider's Avatar
 
Join Date: Sep. 21st, 2001
Location: Norway
Posts: 74
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.
EasyRaider is offline   Reply With Quote
Old 30th Jan 2002, 08:12 AM   #4
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,753
Quote:
Originally posted by EasyrideR_/\
That code would be frame rate dependant.
Oops, you're right. Actually it should be:
Code:
simulated function Tick(float DeltaTime)
{
    ...
    Velocity -= 0.3 * Region.Zone.ZoneGravity * DeltaTime;
}
Acceleration won't do anything because Physics is set to PHYS_Falling.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| 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!"
Wormbo is offline   Reply With Quote
Old 30th Jan 2002, 04:34 PM   #5
WheatPuppet
Corriganism
 
WheatPuppet's Avatar
 
Join Date: Jan. 22nd, 2002
Location: What state you ask? Denial.
Posts: 85
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
WheatPuppet is offline   Reply With Quote
Old 31st Jan 2002, 05:11 AM   #6
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,753
What class references?
Region.Zone.ZoneGravity?
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| 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!"
Wormbo is offline   Reply With Quote
Old 31st Jan 2002, 05:33 AM   #7
EasyRaider
Crazy coder
 
EasyRaider's Avatar
 
Join Date: Sep. 21st, 2001
Location: Norway
Posts: 74
Quote:
Originally posted by Wormbo
Acceleration won't do anything because Physics is set to PHYS_Falling.
I didn't know that. But you wouldn't want PHYS_Falling when you're doing your own gravity anyway.
__________________
Aim for the horizon
but watch your step
EasyRaider is offline   Reply With Quote
Old 31st Jan 2002, 08:41 AM   #8
Kangus
Zombie on your pwn!
 
Kangus's Avatar
 
Join Date: Jan. 29th, 2001
Location: Illinois, USA
Posts: 978
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....
__________________
--Kangus
Kangus is offline   Reply With Quote
Old 31st Jan 2002, 10:25 AM   #9
EasyRaider
Crazy coder
 
EasyRaider's Avatar
 
Join Date: Sep. 21st, 2001
Location: Norway
Posts: 74
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
EasyRaider is offline   Reply With Quote
Old 1st Feb 2002, 09:00 AM   #10
WheatPuppet
Corriganism
 
WheatPuppet's Avatar
 
Join Date: Jan. 22nd, 2002
Location: What state you ask? Denial.
Posts: 85
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
WheatPuppet is offline   Reply With Quote
Old 4th Feb 2002, 03:41 PM   #11
EvilDrWong
Every line of code elevates you
 
EvilDrWong's Avatar
 
Join Date: Jun. 16th, 2001
Location: Inside the machine
Posts: 932
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?
EvilDrWong is offline   Reply With Quote
Old 4th Feb 2002, 05:04 PM   #12
WheatPuppet
Corriganism
 
WheatPuppet's Avatar
 
Join Date: Jan. 22nd, 2002
Location: What state you ask? Denial.
Posts: 85
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
WheatPuppet is offline   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 -5. The time now is 02:26 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer