rpg_objects missing function??

So, I was away writing some plugins, and I noticed that there was a function that should be doing something, and yet, it is doing nothing!

The function in question can be found at line 1944 of the aforementioned script. And here is the little blighter for convenience;

Game_Action.prototype.itemEffectCommonEvent = function(target, effect) {};So yea, I checked, and the function is definitely called when it should be, but its not doing anything in the function.

It was checked out, and the common events still seem to be running, so whats going on here?

Note: I would have expected to see something like this within the function:

Game_Action.prototype.itemEffectCommonEvent = function(target, effect) { $gameTemp.reserveCommonEvent(effect.dataId);};So yea, anyone got any idea whats going on there?

Edit:

It seems the common event is actually called from within another function:

Game_Action.prototype.applyGlobal = function() { this.item().effects.forEach(function(effect) { if (effect.code === Game_Action.EFFECT_COMMON_EVENT) { $gameTemp.reserveCommonEvent(effect.dataId); } }, this);};So uhhh... Whats all that about?
What fires the Common Event is:

Game_Action.prototype.applyGlobal = function() {    this.item().effects.forEach(function(effect) {        if (effect.code === Game_Action.EFFECT_COMMON_EVENT) {            $gameTemp.reserveCommonEvent(effect.dataId);        }    }, this);};
Which is called by:

Code:
BattleManager.startAction = function() {    var subject = this._subject;    var action = subject.currentAction();    var targets = action.makeTargets();    this._phase = 'action';    this._action = action;    this._targets = targets;    subject.useItem(action.item());    this._action.applyGlobal();    this.refreshStatus();    this._logWindow.startAction(subject, action, targets);};
itemEffectCommonEvent is called on applyItemEffect, which is called once for each target of the item / skill / etc.

applyGlobal is called once per usage. That's the right place to have it 🙂
@Mellye - I was not asking where the call was fired from, I was asking why there is an empty function that is not required in the slightest. And that empty function is being called - as Hudell said, each time a skill or item is affecting a target.

It just seems pointless to have an empty function sitting there doing nothing. 🙁
so what is the point of having an empty function then?

Are there other objects that are "instantiated from it" (using Ruby terms) that fill in the details, or override/alias it?  Like Game_Interpreter's pluginCommand?
so what is the point of having an empty function then?

Are there other objects that are "instantiated from it" (using Ruby terms) that fill in the details, or override/alias it?  Like Game_Interpreter's pluginCommand?
The point is mostly "forward-compatibility".

That function is already called by applyItemEffect() that fires during Action.apply(), which happens once per target.

If you want to make a plugin that may allow Common Events to have target data and to fire once per target, you already have a point to begin.

Since those itemEffectFooBar() functions are all being selected by a Switch that names every possible item effect, adding this one extra probably just seemed like a natural thing to do.
Yea, you make a fair point.  It does seem likely that they could have just added it for completeness. 🙂
@Mellye - I was not asking where the call was fired from, I was asking why there is an empty function that is not required in the slightest. And that empty function is being called - as Hudell said, each time a skill or item is affecting a target.

It just seems pointless to have an empty function sitting there doing nothing. 🙁
maybe for someone aliasing that method to add some feature...

i still found it as good design... although it's empty... it holds many future possibilities.

the bad design is:

Game_Map.prototype.data = function() {    return $dataMap.data;};but the Game_Map still use $dataMap.data instead of this.data();

Game_Map.prototype.tileId = function(x, y, z) {    var width = $dataMap.width;    var height = $dataMap.height;    return $dataMap.data[(z * height + y) * width + x] || 0;};currently trying to convert formar region map loader and need to overwrite... instead of aliasing >.<.

(i hate overwrite btw. i always alias if possible)

also... now the map data is accessed differently...

in ACE it's:

data[x,y,z]

now in MV:

data[(z * height + y) * width + x]

so i guess the conversion will be really hard. T.T
I think they did this in Ace too.


Sometimes I feel like they were literally transliterating ruby code to JS.

also... now the map data is accessed differently...


in ACE it's:


data[x,y,z]


now in MV:


data[(z * height + y) * width + x]


so i guess the conversion will be really hard. T.T
No, that's pretty much how you would index into a 3D array.


Ace's Table class just hides the details from you and gives you a nice way to access it.

Original thread: https://forums.rpgmakerweb.com/threads/rpg_objects-missing-function.50358/