Please Help Me Expert Scripters!!!

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.
Aug 2, 2000
5
0
0
Visit site
I am trying to make a mutator where when you hold down the jump button you can jump higher.

I ideally need to replicate a
state halfgravjump
{
function tick()
{
if( player releases jump )
gotostate('');
playerGravity *=3;
}
begin:
playerGravity /=3;
}
on the client, but i have tried everything and can't get it to replicate. I have put this state in the mutator class,
i have made it in a tournament pickup class, i have declared it simulated, i have tried everything.

Please help if you have any ideas.
 

KittyCSpot

New Member
Sep 4, 2000
2
0
0
Visit site
Hmmm how about something like this...

// ---------

Class JumpHighItem Expands TournamentPickup;

var bool bJumped;
var bool bLetGo;

simulated function Tick( float DeltaTime )
{
// did we jump?
if (bJumped == true)
{
// check button state
if (jumpbuttonvar == pressed)
{
// we let go so reset our var
bLetGo = true;
}
// have we let go yet?
if (bLetGo == true)
{
// we let go so reset our jump acceleration
Pawn(Owner).JumpZ = Pawn(Owner).Default.JumpZ;
}
}
}

simulated function OwnerJumped()
{
Pawn(Owner).JumpZ = Pawn(Owner).Default.JumpZ * 3;
bJumped = true;
bLetGo = false;
}

// --------------

Then all you have to do is make a mutator to give this item to a playerpawn when it is created with something like this... dont bother giving it to a bot cause it wont use it (why waste memory?)

// --------------

class JumpHighMut expands Mutator;


function ModifyPlayer(Pawn Other)
{
local Inventory inv;

if Other.IsA('PlayerPawn')
{
inv = Spawn(class'JumpHighItem');
if( inv != None )
{
inv.bHeldItem = true;
inv.RespawnTime = 0.0;
inv.GiveTo(Other);
}

// called by GameInfo.RestartPlayer()
if ( NextMutator != None )
NextMutator.ModifyPlayer(Other);
}
}

// --------------

a few things in there are pseudo code (I dont know how to access the button state for jumping) but im sure you can figure out the gist of it...not sure if it will work or not cause im too lazy to go write it up and try it...lemmie know how it turns out :)

Cheyenne 'Coolspot' Meyer
 
Aug 2, 2000
5
0
0
Visit site
Thanks a million

I will give it a try.
I have tried something similiar by modifying the jumpboots class and failed before, but i may have been doing something wrong.

I really appreciate your help.

I'll let you know how it goes.
 

G-Man

New Member
Mar 11, 2000
348
0
0
Montreal, Quebec, Canada
Visit site
Hey Jabro,

You might want to check out http://www.myureal.com, there is a message board over there where YoMammy drops by every once in a while. He really knows his stuff. The editing message board isn't very busy (plus it crashed recently and all previous posts were lost, so it looks like even more of a ghost town...), but YoMammy will answer pretty much any technical question you've got. HEy YoMammy, if you read this, I hope you don't mind the referal!