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 22nd Jan 2002, 11:33 AM   #1
navboy
Registered User
 
Join Date: Jan. 5th, 2001
Location: tornados, Wizard of Oz, 70's rock group, lots of native Americans, etc.
Posts: 340
adding velocities ...

I just made a mover that a player can stand on that goes pretty fast, but when i jump i get left far behind, and when i fire a rocket forward it flies back in my face.

So it looks to me like the player's velocity is not affected by the velocity of the mover, and in turn i don't know whether the rocket's velocity is affected by the player's velocity since the player's velocity isn't correct.

Anyone know how to make these velocites add to each other the way they should? I didn't see an obvious place in the mover code for it, and it's not a custom gametype so i can't modify the players themselves any ...
navboy is offline   Reply With Quote
Old 22nd Jan 2002, 12:27 PM   #2
Kangus
Zombie on your pwn!
 
Kangus's Avatar
 
Join Date: Jan. 29th, 2001
Location: Illinois, USA
Posts: 978
Arrow

well, the DoJump function in playerpawn only adds the Z (vertical) velocity of the player's base (whatever they are standing on) when called.
Also, the player's velocity does not affect the rocket's velocity with the default UT rocket launcher at all. Its not coded to.

I don't know much about mover code, but you might be able to solve the problem with a new zone type that changes its gravity (x, y or Z) when triggered (at the same time the mover is triggered of course).
__________________
--Kangus
Kangus is offline   Reply With Quote
Old 22nd Jan 2002, 08:39 PM   #3
navboy
Registered User
 
Join Date: Jan. 5th, 2001
Location: tornados, Wizard of Oz, 70's rock group, lots of native Americans, etc.
Posts: 340
well the mover's not at a constant velocity the whole time, plus there are other problems ....

hmmm ...

I'm wondering about the feasibility of putting some code in the mover's Timer() function along the lines of:

local Pawn P;

if ( StandingCount > 0 )
for ( P=Level.PawnList; P!=None; P=P.nextPawn )
if ( P.Base == self )
{
P.SomethingToAffectVelocity();
}


but i'm not sure what i can do to affect the pawn's velocity or if this approach would have unseen nasty side effects in network play ...

If i just did P.Velocity += Velocity type of thing it would just keep ramping up the pawn's velocity, so that won't work ....
navboy is offline   Reply With Quote
Old 22nd Jan 2002, 09:15 PM   #4
Kangus
Zombie on your pwn!
 
Kangus's Avatar
 
Join Date: Jan. 29th, 2001
Location: Illinois, USA
Posts: 978
yeah, that sounds solid aside from the SomethingToAffectVelocity() function... not sure what you'd put in there.
__________________
--Kangus
Kangus is offline   Reply With Quote
Old 22nd Jan 2002, 11:40 PM   #5
Smoke39
whatever
 
Smoke39's Avatar
 
Join Date: Jun. 2nd, 2001
Posts: 1,793
Arrow

What about:

if ( P.Physics != PHYS.Falling ) // If they're falling and thus have jumped
{
P.AddVelocity ( Velocity ); // Add the velocity of the mover to the foo's jump velocity
}

Not sure if you need vect or vector in front of Velocity. I can never remember that.
Smoke39 is offline   Reply With Quote
Old 23rd Jan 2002, 03:06 AM   #6
navboy
Registered User
 
Join Date: Jan. 5th, 2001
Location: tornados, Wizard of Oz, 70's rock group, lots of native Americans, etc.
Posts: 340
Interesting you mention that i tried something very similar a while ago. Every second (in mover's Timer() ) i called the pawns addvelocity and added the mover velocity (and addvelocity itself sets the pawn's physics to falling) ... but it didn't have any effect at all. I thought for sure it would keep adding the mover's velocity to the pawn's velocity resulting in some insane velocity for the pawn.

But as i ride on the mover, nothing's any different than normal, and when i jump up, i go straight up, with no horizontal velocity whatsoever. I starting to think the game code itself ignores anything but z velocity when you jump; i guess it took jumping from a very fast mover to make me realize it.

I'm still looking for a way to make this work however
navboy is offline   Reply With Quote
Old 23rd Jan 2002, 08:11 PM   #7
navboy
Registered User
 
Join Date: Jan. 5th, 2001
Location: tornados, Wizard of Oz, 70's rock group, lots of native Americans, etc.
Posts: 340
Hey i got it working! The Inventory actor has a OwnerJumped() function so i added it to a subclass i made of TournamentPickup and put a trigger around each PlayerStart that gives the player a copy of it. Then i added this function:

function OwnerJumped()
{
local Pawn PawnOwner;

PawnOwner = Pawn(Owner);
if ( (PawnOwner.Base != Level) && (PawnOwner.Base != None) )
{
PawnOwner.Velocity.X += PawnOwner.Base.Velocity.X;
PawnOwner.Velocity.Y += PawnOwner.Base.Velocity.Y;
}


I guess my question now is am i causing any unforeseen problems by adding an extra inventory item to the player, and if i wanted to investigate your Detached() approach to compare to this one would i be using the mover's Detach function?
navboy 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 12:17 PM.


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