Author Topic: Callback(s) for player movement  (Read 1127 times)

I don't know if there's actually some huge issue with this that makes it impossible, but it would be pretty useful.

If there's already something like this, I have no idea how I missed it.

It'd have a boolean for if they're starting to move or stopping, and different functions/values for strafing, forward/backward, etc.

e.g.
Code: [Select]
package annoyingAlarm
{
function Armor::onMoveForward(%this, %obj, %val)
{
parent::onMoveForward(%this, %obj, %val);
%obj.emote(AlarmProjectile);
}

function Armor::onMoveBackward(%this, %obj, %val)
{
parent::onMoveBackward(%this, %obj, %val);
%obj.emote(AlarmProjectile);
}


function Armor::onStrafe(%this, %obj, %dir, %val)
{
parent::onMoveBackward(%this, %obj, %dir, %val);
%obj.emote(AlarmProjectile);
}
};

or alternatively

Code: [Select]
package annoyingAlarm
{
function Armor::onMove(%this, %obj, %type, %val)
{
parent::onMove(%this, %obj, %type, %val);
%obj.emote(AlarmProjectile);
}
};

Having a callback for when a player moves means it would have to be called 32 times per second. The engine calculates movement 32 times per second and sends out networked updates at the same rate.

Your alternative is not feasible, but callbacks for when the player starts L/R strafing or F/R moving make sense.

...speaking of trace spam, we need to be able to filter traces.

EDIT: with function counting and timing like those in OllyDbg:
« Last Edit: April 03, 2013, 04:50:12 PM by Kalphiter »

but callbacks for when the player starts L/R strafing or F/R moving make sense.
this is what i meant

Having a callback for when a player moves means it would have to be called 32 times per second.
i knew about this


What is this even
I see a ton of random letters
That is assembly.

"Profile" is the amount of times the section of code was called.

Imagine being able to have a function counter that could catch how long it takes for a function to run and how often it's called.

i knew about this
Callbacks that often are unacceptable and will lag the server the more they're used.

Kalph, he means that he wants it to work like the trigger system. It's only called when they start or stop moving.

Kalph, he means that he wants it to work like the trigger system. It's only called when they start or stop moving.

I've done this for LOB, but it uses client to server operations.

Having a callback for when a player moves means it would have to be called 32 times per second. The engine calculates movement 32 times per second and sends out networked updates at the same rate.

Your alternative is not feasible, but callbacks for when the player starts L/R strafing or F/R moving make sense.

...speaking of trace spam, we need to be able to filter traces.

EDIT: with function counting and timing like those in OllyDbg:
-snip-

It'd have a boolean for if they're starting to move or stopping

Kalph, he means that he wants it to work like the trigger system. It's only called when they start or stop moving.
It sounds like he asked for both. Yes, callbacks like what he listed are needed.

I've done this for LOB, but it uses client to server operations.
which probably works best for this currently, but it's way too slow to be extremely useful and requiring a client mod is p annoying