Status
Not open for further replies.

Winek

Veteran
Veteran
Joined
Apr 12, 2017
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
Hello! I'm not 100% sure if it's exactly here I must post, but it's for RPG Maker MV, so I'll assume that it is.

Basically, what I want to do is to be able to edit the position of battlers in-game.
I have most gameplay elements and whatnot that I have ready for all that stuff, but all I need is the command line to set it to something different.

In sprite.js, I have found the command setHome.
Code:
Sprite_Battler.prototype.setHome = function(x, y) {
    this._homeX = x;
    this._homeY = y;
    this.updatePosition();
};

I've played with it, and from what I've seen, it does change the position of the actors.

My only question would be: how could I access it? I use various plugins from Yanfly, which includes YEP_SkillCore. What I'd like to do, for example, is something like this:
Code:
<After Eval>
a.setHome(100,200);
</After Eval>

But obviously, that doesn't work (since it's probably referring to the battler itself, rather than the sprite). So... could anyone help me out with this? I've been searching around, but I just can't figure it out. Any help would be appreciated! :rock-right::distrust:
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,510
Reaction score
12,013
First Language
English
Primarily Uses
RMVXA
As you want help with the scripting side of things, rather than with something that you can do directly in the editor, I think this is better in a more script focussed section.

[mod]I am, therefore, moving this to Javascript/Plugin Support.[/mod]
 

Winek

Veteran
Veteran
Joined
Apr 12, 2017
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
Thank you for moving it! I'll keep it in mind if I have more script-related question.
 

Winek

Veteran
Veteran
Joined
Apr 12, 2017
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
Hey there! After hours of researching, I've found out how to do it.

If anyone's curious, here's an example of application:

Code:
<Before Eval>
sprite =  BattleManager.getSprite(a)
sprite.setHome(sprite._homeX + 100, sprite._homeY - 100);
</Before Eval>

This works for both actors and enemies.

Peace! :rock-right:
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,510
Reaction score
12,013
First Language
English
Primarily Uses
RMVXA
[closed]IgnoreMe[/closed]
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

SF_People3_3 added!
index.php

ScreenShot_1_3_2022_1_32_12.png
I feel QSprite for MV is underrated. I basically am able to use my chibi sideview battlers I drew on the maps and have all the motions available. this'll help a lot with cutscenes.
I've figured out how to reasonably tall-ify chibi sprites on my editor. I like that making tall sprites gives me control on expressing how tall characters seem on the field relative to each other as well as better differentiate adult sprites from child sprites.
doing some wacky experimental stuff in MV right now :kaoluv: I cannot wait to drop what I've been working on
Doing RPG Maker News for this week. (January 14th - 20th, 2022)

Forum statistics

Threads
118,557
Messages
1,116,936
Members
155,596
Latest member
Lumiki
Top