RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Character running speed.

Status
Not open for further replies.

mrc

Wanderer
Character running speed.

Does anyone know how to change the character speed, I want it to move (when dismounted) with the same speed as if they were mounted.

Any idea ?
 

Obsydian

Wanderer
there's a funny bug. Try to add a horse, then mount it. Finally change your bodyvalue to a ghost. Look in that area. You run with a speed of a horse. The only problem is stoping, becouse you like someone on a horse. This may give You some idea.

Regards
Sid
 

Jeff

Lord
you need to make a script that sends the same packet the server sends to the client when you mount a horse, i've seen this done and seen the sciprt it is possible, unfortunately i dont have it, but will see about getting it.

IE [fastwalk, the server send the packet that changes the client into thinking your mounted and you walk fast. :)
 

tophyr

Wanderer
In Server/Mobile.cs:

Code:
private static TimeSpan m_WalkFoot = TimeSpan.FromSeconds( 0.4 );
private static TimeSpan m_RunFoot = TimeSpan.FromSeconds( 0.2 );
private static TimeSpan m_WalkMount = TimeSpan.FromSeconds( 0.2 );
private static TimeSpan m_RunMount = TimeSpan.FromSeconds( 0.1 );

That's what controls character walking/running speed. The client can send packets as fast as it wants (and sometimes does, that's how speedhacks work), but RunUO won't let anyone move any more often than what's set right there. A value of "0.2" means that every .2 seconds you can move a tile, so 5 tiles per second.
 

Jeff

Lord
tophyr said:
In Server/Mobile.cs:

Code:
private static TimeSpan m_WalkFoot = TimeSpan.FromSeconds( 0.4 );
private static TimeSpan m_RunFoot = TimeSpan.FromSeconds( 0.2 );
private static TimeSpan m_WalkMount = TimeSpan.FromSeconds( 0.2 );
private static TimeSpan m_RunMount = TimeSpan.FromSeconds( 0.1 );

That's what controls character walking/running speed. The client can send packets as fast as it wants (and sometimes does, that's how speedhacks work), but RunUO won't let anyone move any more often than what's set right there. A value of "0.2" means that every .2 seconds you can move a tile, so 5 tiles per second.
ya but thats permanant, i was under the impression that they wanted this to be turned on and off at times, which would mean you would need to send the wrong packet to the client that you were mounted, i could be wrong tho, maybe they want to run around fast like this all the time, who knows.
 

tophyr

Wanderer
Sorious said:
ya but thats permanant, i was under the impression that they wanted this to be turned on and off at times, which would mean you would need to send the wrong packet to the client that you were mounted, i could be wrong tho, maybe they want to run around fast like this all the time, who knows.

Packets have almost no effect on walking speed, except in that if the client doesn't send a MovementReq packet, the Mobile will never move :p

The way it happens is...

1) Mobile (server side) keeps track of the last time he moved tiles (through normal means like walking/running).
2) Player (client side) moves somewhere, client sends a MovementReq packet to the server.
3) Server packethandlers pick up the packet, dish it out and eventually call Mobile.Move(), where it checks if the required amount of time has passed (ie 0.4 sec, 0.2 sec or 0.1 sec).
3a) If the delay has passed, Move allows the move and does all the work associated with moving a mobile, including sending a MovementAck packet back to the client with their new location.
3b) If the delay has NOT passed (ie, the player is trying to move too soon), Move queues the action and creates a FastWalkEvent. If there are enough FWE's piled up, the server flags the Mobile as FastWalking and logs a warning.

So, long story short, in order to change movement speed, you need to change those four variables (to change it for *everyone*) or you need to change Mobile.Move() to be more adaptable. If you go lower than (faster than) 0.1 seconds, you'll run into packet issues because the client probably won't send them any more than 10 per sec (doesn't expect you to move faster than that), but other than that, packets won't enter the picture at all.
 

arul

Sorceror
First thing that you have to do if you want to change client speed is editing the PlayerMobiles fastwalk code, but thats not enough, then you have to send to the client extended command packet ( 0xBF ) with the 0x26 id and one byte value from which will the client determine the speed. ( 0 = default speed, 1 = mounted speed, the rest of numbers I haven't tested, those two are commonly sent by OSI ).

The packet code might look this way
Code:
    public class SetClientSpeed : Packet
    {
        public SetClientSpeed(byte value)
            : base(0xBF)
        {
            EnsureCapacity(6);
            m_Stream.Write((short)0x26);
            m_Stream.Write(value);
        }
    }

And finally you can send it to the client whenever you like:
Code:
mobile.Send( new SetClientSpeed( 1 ) );
 

Jeff

Lord
tophyr said:
Packets have almost no effect on walking speed, except in that if the client doesn't send a MovementReq packet, the Mobile will never move :p

The way it happens is...

1) Mobile (server side) keeps track of the last time he moved tiles (through normal means like walking/running).
2) Player (client side) moves somewhere, client sends a MovementReq packet to the server.
3) Server packethandlers pick up the packet, dish it out and eventually call Mobile.Move(), where it checks if the required amount of time has passed (ie 0.4 sec, 0.2 sec or 0.1 sec).
3a) If the delay has passed, Move allows the move and does all the work associated with moving a mobile, including sending a MovementAck packet back to the client with their new location.
3b) If the delay has NOT passed (ie, the player is trying to move too soon), Move queues the action and creates a FastWalkEvent. If there are enough FWE's piled up, the server flags the Mobile as FastWalking and logs a warning.

So, long story short, in order to change movement speed, you need to change those four variables (to change it for *everyone*) or you need to change Mobile.Move() to be more adaptable. If you go lower than (faster than) 0.1 seconds, you'll run into packet issues because the client probably won't send them any more than 10 per sec (doesn't expect you to move faster than that), but other than that, packets won't enter the picture at all.

wrong read the post under yours, ill see if i can get the script and show you.
 

tophyr

Wanderer
Interesting, hadn't realized the client speed was settable. I assume he'd still have to modify the Move() method and/or timespans, though, correct?
 
Status
Not open for further replies.
Top