Battler Graphic Translation

No need to apologise! You're doing amazing stuff. Exciting to see this inch ever closer to the desired effect!

1 - No erros, no effect - like it's not even there.

2 - Script 'Game_Interpreter' line 1411: NoMethodError occured.

undifined method 'update' for nil:NilClass

3 - Script 'Game_Interpreter' line 1411: NameError occured.

undefined local variable or method 'enemy' for

#<Game_Interpreter:0xa83a554>
yikes, made a mistake on the 3rd.

Should be

iterate_enemy_index(1) do |enemy|   enemy.y = 120   enemy.updateendsince you are at it, try this too

Code:
iterate_enemy_index(1) do |enemy|   enemy.y = 120   enemy.refreshend
Hello.

This should work:

Code:
$game_troop.members[index].screen_y = Y
Yup! Give that a try too, and might need to add a line for nil check or the game will crash if the battler die before the script call.

Code:
$game_troop.members[1].screen_y = 120 if $game_troop.members[1].alive?
MeowFace, both take no effect.

Lecode:

Script 'Game_Interpreter' line 1411: NoMethodError occured.

undefined method 'screen_y=' for nil:NilClass

Update:

MeowFace, with the nil check, I get undefined method 'alive?'
Even if the battler die it'll never take a nil value. But well...

EDIT:

@dsden: If there is only one enemy, replace 1 with 0.
$game_troop.members[0].screen_y = 120 if $game_troop.members[0].alive?

results in no effect.
Ok, so in the end, it needs a script to enable that script call somewhere..  >_<

I wonder if working around Scene_battle will do the trick?

hmmm.. found a script while we are at it..

Tsukihime has the code rewritten for interpreter to call a position change for enemy.

http://himeworks.com/2013/04/enemy-re-position/

Not sure if this works with MOG's, it should from what i see. Give it a try 😉
$game_troop.members[0].screen_y = 120works fine for me. Where do you call it ?
@Lecode: He's using MOG's script that modifies shadows and its position. That might be the cause of script calls not working.

But if Lecode's way is working, the next part to do the "sliding" won't be hard.

A code like this should work, showing the battler slowly moving from old Y to new Y

i = 50 while i <= 120 do $game_troop.members[0].screen_y = i if $game_troop.members[0].alive?i += 1end# 50 being the starting Y position

#120 being the New Y Position

# To have the battler move faster across the screen, change i+=1 to something bigger.
@Lecode: He's using MOG's script that modifies shadows and its position. That might be the cause of script calls not working.
Ho well, that's right. x)

Can you paste here (via spoiler) the mog's script you're using, @dseden ?
I'm using a number of scripts from MOG. However, only Battler Motion results in the incompatibility. I'm sorry, I can't place it it a spoiler because a forum error says that the post is too long. And I can't link to it because it is only available in MOG's master demo. I was thinking of uploading it via attachment, but I don't know if he has any terms against sharing around his script in this way.

The Enemy Re-position script crashes on script call without MOG active.
Enemy Motion moves the battler graphic around using a position setting of it's own right? So nope, as long as you are using that script, any other way of "repositioning" will be overwritten on the next frame. For human eye, it never changes its position and continues to do what it always does, moving up/down/left/right as the script tells it.

In this case, you will need to set one the Y you use for that enemy into a variable(eg $game_variables[1] ) and change the variable's value accordingly might still get it to work.
Would you be able to guide me on how I can do this?

So, I assume that getting the enemy index is the first step. Then I need the Y position that the enemy moves about. So I need to understand which variable stores this. Then I will need a script call to update this value, and another call that will animate the movement.

Is this correct?
Nope, Any new script that modifies the battler's position will only ended up in a fight with MOG's script.

Since that script updates the position x y in per frame method. That's why you find script calls not working or does nothing.

You actually had it working when you reported back here that nothing is happening, the position is actually set, but within the next frame, it's changed back to the original position by MOG's script. 0.017 second so i doubt a normal human eye can catch the difference.

As long as you are using that script, script calls and other scripts that modifies the position will end up failing/crashing. The only work around is to put something like $game_variables[1] in the place where the script require you to input Y axis of the enemy (i am assuming it reads from enemy note tag here, if it is 1 setting for ALL enemy, then we can do nothing about it without modifying that script). And even if we are able to get that Y to read from a game variable. The only possible way to show it is "teleport" across the screen.
I'm not entirely sure I understand.

The graphic is positioned in the database at some fixed coordinate, right? Then MOG grabs the Y coordinate and 'hovers' the graphic relative to that coordinate (say +15, 0, -15, for example).

So, can't the fixed Y position be updated, or has MOG locked this variable as it's active?

Now, concerning $game_variables[1], the script doesn't require me to input axis at all. Yes, it reads from note tags: <Motion Standby = x>, and that's all. It just requires a number to determine the movement pattern. So I'm not sure how to test it with this.

Also, I see on MOG's terms that he allows for edits/adaptions. Do you think it would be difficult to have this script modified to achieve this effect? How much do you think it would cost me?
The script is umm.. "locking" the x y to the current on-going math the script is running.

And since that X Y calculation isn't a direct update to the original X Y variable, but using its own variable for calculation, then it updates the original X Y from there, changing the original X Y won't effect that script. It simply changes it to the new X Y the script calculated.

But judging from what you said, it's updating all enemies based on types in the notetag. Not individual x y. So forcibly update the Y will result in ALL enemies' Y being changed.

Will need to take a look at the script to check if it's easy to modify or not. Shouldn't be hard if it's just an extension of what the script currently does, probably adding a switch check somewhere and adding a new notetag for just that type of enemy might work. So all you need it to put the new tag in and flip a switch to change its position. But... it's against my policy to edit and repost someone else's script. (well, the real truth is, i am being my lazy self, and to read through a long script someone else's wrote is not fun) 😛

Try PM Lecode, seems like he's in the mood to help. 😉

As for the cost, i am not sure, i never charged anyone for scripts or graphics i made, simply here to help out of hobby and to refresh my mind what else the game engine can do. 😀
I wouldn't bother him with a PM. I'm sure if he is able to help, he will reply here  🙂

In the mean time, I'm going to throw in another crazy idea for a workaround: is it possible to disable the script and enable it when the graphic has been moved? I'm thinking probably not while it's loaded, or it would break something. Still thought I should ask.
Well, adding a switch or condition check on the method it's using to do the graphic update should be able to "by pass" it from doing anything when the switch/condition is on/met.

So look for the line "def update" in the script, then look for the line that does the graphic change under that.

add this behind that line: "if $game_switches[1]"

So when switch 1 is on the update will ignore that line of code.
There is a lot of 'def update_something' in the script.

But the first one is simply 'def update'. Is it the correct one?

Here it is:

#--------------------------------------------------------------------------

  # * Update

  #--------------------------------------------------------------------------

  alias mog_battler_motion_update update

  def update

      $game_temp.battler_in_motion = false

      mog_battler_motion_update

  end

 

Now, how do I identify the line that does the graphic change?

Original thread: https://forums.rpgmakerweb.com/threads/battler-graphic-translation.44851/