Blockland Forums > Suggestions & Requests
Callback(s) for player movement
(1/2) > >>
otto-san:
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: ---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);
}
};
--- End code ---

or alternatively


--- Code: ---package annoyingAlarm
{
function Armor::onMove(%this, %obj, %type, %val)
{
parent::onMove(%this, %obj, %type, %val);
%obj.emote(AlarmProjectile);
}
};
--- End code ---
Kalphiter:
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:
otto-san:

--- Quote from: Kalphiter on April 03, 2013, 04:40:19 PM ---but callbacks for when the player starts L/R strafing or F/R moving make sense.

--- End quote ---
this is what i meant


--- Quote from: Kalphiter on April 03, 2013, 04:40:19 PM ---Having a callback for when a player moves means it would have to be called 32 times per second.

--- End quote ---
i knew about this
Zeblote:

--- Quote from: Kalphiter on April 03, 2013, 04:40:19 PM ---

--- End quote ---
What is this even
I see a ton of random letters
Kalphiter:

--- Quote from: Zeblote on April 03, 2013, 05:35:06 PM ---What is this even
I see a ton of random letters

--- End quote ---
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.


--- Quote from: otto-san on April 03, 2013, 05:32:54 PM ---i knew about this

--- End quote ---
Callbacks that often are unacceptable and will lag the server the more they're used.
Navigation
Message Index
Next page

Go to full version