[HELP]How to make char stop move?

10/19/2010 01:06 pwerty#1
walk/run/jump .. how to disable client/char to do it? [5165]
10/19/2010 01:13 _tao4229_#2
To make an object stop moving - do work ([Only registered and activated users can see links. Click Here To Register...]).
10/19/2010 04:53 pro4never#3
Status effects.

Run through the possible status effects and you will notice that there are a BUNCH that disable client movement. At least on current tq patch there's something like 5-10 that do that.
10/19/2010 14:51 hunterman01#4
Quote:
Originally Posted by pro4never View Post
Status effects.

Run through the possible status effects and you will notice that there are a BUNCH that disable client movement. At least on current tq patch there's something like 5-10 that do that.
Im pretty sure in the older clients there is hardly anything like that. Then again i havent really gone through and checked it out. But i know they used something like this in the recent patch for the recently released SnowBanshee he uses an attack like freeze or some shit it turns you into a ice cube and you cant move its crazy
10/19/2010 20:45 _DreadNought_#5
for 5180, I found that the status effect 59 fucks the character but still can see objects moving around him, I use the type 0 to restore the character to normal however this will remove all the status effect (TopWarrior, TopTrojan etc...)
10/20/2010 06:05 FuriousFang#6
Make a bool that equals true... and when it walks, make it check that bool. Then when u don't want it to move... make the bool false and it won't walk. Same with jumping! It's that easy. lol =]
10/20/2010 07:24 Arcо#7
Quote:
Originally Posted by FuriousFang View Post
Make a bool that equals true... and when it walks, make it check that bool. Then when u don't want it to move... make the bool false and it won't walk. Same with jumping! It's that easy. lol =]
or just use the status effect
:facepalm:
10/20/2010 07:28 FuriousFang#8
Quote:
Originally Posted by WTFIDKBBQ View Post
or just use the status effect
:facepalm:
Not everyone knows what you're talking about when you say that Arco. Using a bool is a simple fix for people that don't know how to do that. Hint, why i'm suggesting it. =]
10/20/2010 07:52 pro4never#9
Quote:
Originally Posted by FuriousFang View Post
Not everyone knows what you're talking about when you say that Arco. Using a bool is a simple fix for people that don't know how to do that. Hint, why i'm suggesting it. =]
That also will not stop the client from sending the movement packets. Thus they will still move on their screen and you will then have to send a packet back 'correcting' their position.

A simple status effect combined with checks on movement to see if they are frozen is the best way to handle this.


@Dread: Status effects COMBINE

Eg: 1 is bluename 2 is poison... 3 is therefor bluename AND poison.

Due to this they follow a pattern of growth because you must account for all combination possible.

So lets say for example top tro has a value of 100 (it's not... I'm just using as an example)

When you add your freeze effect (which you are claiming to be 59, not sure on that... doesn't seem to follow the pattern but w/e) you would actually use a value of 159 (top tro PLUS freeze effect)

Personally I use a add/remove system for my effects where I have a character dictionary where... Key = the status effect and Value = the date time added, a bool for if it should be removed and a value for how long it should last.

Then in my character update thread I run through characters and their active status effect values and check time started, duration, should be removed vs current datetime and if so I remove it from the client effect bools and as such update the client at the same time (any time my status effect pool is altered it will update the client, YAY use of accessors (get/set))

It's rather simple to do and lets you do something like...

if(Client.ActiveEffects.ContainsKey(StatusEnums.Fr ozen))
return;

There is no duplication or accidental double removal of effects due to it being a dictionary key value (if you try it will fuck up.. and personally my add/remove effect code checks for it)


<edit>

posted my codes I use for it... not that most ppl will bother

[Only registered and activated users can see links. Click Here To Register...]
10/20/2010 08:22 FuriousFang#10
Quote:
Originally Posted by pro4never View Post
That also will not stop the client from sending the movement packets. Thus they will still move on their screen and you will then have to send a packet back 'correcting' their position.

A simple status effect combined with checks on movement to see if they are frozen is the best way to handle this.

That's a good explanation. I thought by checking before it sends the packet it would be fine though? I guess you're right though. Using both methods would be the best way to do it. Thank you.
10/20/2010 08:54 pro4never#11
The client will still send the walk packet though... the client does NOT wait for a response in order to move itself. The server simply confirms the movement. If you don't respond the client will continue moving all on its own unless you send back a correct coords packet to teleport them back to their old location which is... not fun.

It's so much easier to simply send a locked status effect so they can't, by legitimate means move their character. You should still place checks server side though as they could easily be using a bot or some other method of attempting movement.

One should NEVER assume the information that the client sends to be valid. it should always be checked and corrections made.
10/20/2010 13:42 _tao4229_#12
You guys really need to learn what a Bit field - Wikipedia, the free encyclopedia is


Don't use dictionaries, etc, you can use simple bitwise logic to do everything you need.

Code:
void setFlag(uint flag) {
    status |= flag;
}
void removeFlag(uint flag) {
    status &= ~flag;
}
bool checkFlag(uint flag) {
    return (status & flag) == flag;
}