For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

need help with Uscript for Jump/Bounce Mutator

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
OwYeaW
Posts: 3
Joined: Mon Feb 27, 2017 9:05 pm

need help with Uscript for Jump/Bounce Mutator

Post by OwYeaW »

yo guys, i need some help with making a script

basically what i want is a mutator that lets the player jump continuously

the player can say "!bounce" and "!nobounce" or type in console "mutate bounce" and "mutate nobounce" to toggle it on/off
- if toggled on; when the player holds down the jump key the player will constantly jump
- if toggled off; the player just jumps 1 time each key press

since i have little knowledge in Uscripting i am not able to make it by myself
but what i got so far is this:

Code: Select all

class BounceMutator extends Mutator;

function Mutate(string MutateString, PlayerPawn Sender) {

  Super.Mutate(MutateString, Sender);

  switch MutateString {
    case "bounce":
      EnableBounce(Sender);
    break;
    case "nobounce":
      DisableBounce(Sender, false);
    break;
  }
}
function bool MutatorTeamMessage(Actor Sender, Pawn Receiver,
                                 PlayerReplicationInfo PRI, coerce string S, name Type,
                                 optional bool bBeep) {

      if(Sender.IsA('TournamentPlayer') && Sender == Receiver) {
            if(S ~= "!bounce") {
      EnableBounce(PlayerPawn(Sender));

    } else if(S ~= "!nobounce") {
      DisableBounce(PlayerPawn(Sender), false);
    }
      }
            // Allow other message mutators to do their job.
  if (nextMessageMutator != none) {
    return nextMessageMutator.mutatorTeamMessage(sender, receiver, pri, s, type, bBeep);
  } else {
    return true;
  }
}
function EnableBounce(PlayerPawn Sender) {
  local int i;
  Sender.ClientMessage("AutoBouncing Enabled");
}
function DisableBounce(PlayerPawn Sender, bool bForced) {
  local int i;
  Sender.ClientMessage("AutoBouncing Disabled");
}
i took a lot of stuff from other already existing scripts
the mutate commands are working correctly but the say message doesnt work yet
but what i mainly want to ask is to help with the main function of the script; making the player jump constantly, whenever the player hits a ground surface it will jump directly from the first frame

Image
i guess it should be something like this, but as i said i have little knowledge in Uscripting, so it would be great if anyone can help me with this :)
Last edited by OwYeaW on Mon Feb 27, 2017 10:31 pm, edited 1 time in total.
User avatar
medor
OldUnreal Member
Posts: 343
Joined: Sun May 17, 2009 7:19 am

Re: need help with Uscript for Jump/Bounce Mutator

Post by medor »

For real bounce you ave to hold down the walk keyboard key during the jump.
3 ms is ok between each jump

Me :D

Sorry it's french http://unrealtournament.99.free.fr/forum/viewtopic.php?f=10&t=1864

UTfiles http://medor.no-ip.org/
Image
Image
Image
Image
User avatar
OwYeaW
Posts: 3
Joined: Mon Feb 27, 2017 9:05 pm

Re: need help with Uscript for Jump/Bounce Mutator

Post by OwYeaW »

For real bounce you ave to hold down the walk keyboard key during the jump.
3 ms is ok between each jump
a bounce can be performed with or without holding walk
as many people know; a jump when holding walk is lower than a regular jump
so a bounce when holding walk gives you less height and thus less distance

the reason why most people prefer walk bouncing:
when a player jumps 1 frame/tick later than it landed on the ground the bounce will not be performed properly
- if this happens when the player does a regular bounce, the player would lose all momentum because of that single frame/tick that it stood on the ground
(so the bounce wont even be performed and the player would just do a regular jump instead)
- if this happens when the player does a walk bounce, the player would only lose a part of its momentum that depends on how many frames/ticks the player stands on the ground before jumping again
(so the walk bounce will be performed but will have less speed because of the lost momentum)


ive made several autohotkey scripts that would spam space when holding the space button
they would work 100% when playing offline, but they never worked 100% when playing online

so my idea is to make this Bounce Mutator that lets the player jump continuously whenever it holds the jump key, server sided
this mutator would give consistency in bouncing and equality for every player
i wonder why a mutator like this hasnt been made yet, i dont think its complicated to make

help is really appreciated guys :)
Last edited by OwYeaW on Tue Feb 28, 2017 3:39 pm, edited 1 time in total.

Return to “UScript Board”