reposition "show scrolling text"

The error appears when these scenarios happens.
> The common event is run through parallel process / autorun (haven't double checked).
> The common event is run when you transferred map while the event is still active.
> The common event is run through item / skill from item menu.

This line
Code:
ev = $game_map.events[@event_id]
Get the event that runs the script. If it runs after using an item / skill, it doesn't know which event run the script. Thus it throws an error

---------------------------------------------------------------------
To get into more technical talk. An event has two type of variables x and y, screen_x and screen_y.

The x and y variables determine the position of an event on the map grid. No matter what is your position, if an event is placed on coordinate (2,2) on the map. The variable stays that way

In other hand, screen_x and screen_y are variables that changes overtime and the value is relative to the screen position. The default screen resolution is 544x418, so the screen_x and screen_y values usually varies around that numbers, even minus when they're off screen. You see when you walk through the map, the map and events scrolls in different direction. It because when you walk, they also change the screen_x and screen_y so that they're being redrawn in different location on the screen
---------------------------------------------------------------------

If you use the provided script call directly on event, it should works.

p.s: personally instead of this
Code:
ev = $game_map.events[@event_id]
It's more easy to use
Code:
ev = get_character(index)
Where index is
-1 = player
0 = this event
more than 0 = other events
What TheoAllen said is completely true. If you are using common events called from inside a skill to set your window position then your common event will know nothing of the map event who is casting the skill.

If you want to use it from something that is not the event itself then you should first store that event in a variable, then use that variable to get your window position. However when displaying your scroll text that way you should be aware of a couple of things:
  1. If two events launch a skill more or less simultaneously, depending on how those events are handled you might have your variable overwritten before actually displaying scroll text and have both message shown over the last event using a skill. This is not something that's guaranteed to happen but there is a risk for it tho happen.
  2. In the same situation where two events launch a skill more or less simultaneously the last one casting will have its message displayed only after the 1st message disappears. That's because the engine waits until a message is completed before showing another one.
For this reason if you want to use scroll text to show skill names it is fine if you do it for $game_player, less fine if you want to do it for every single event. It is not impossible to do it for other events too but in my opinion using Scroll Text for that purpose is a poor way to implement it.
I agree that using scroll text for the skill name display isn't ideal, but it was the only thing I could think of. I posted a thread about if it is possible to do this with scripting and haven't had a response, so I'm using scroll text for now!

use the provided script call directly on event

As you have no doubt learned, I'm not so great when it comes to anything that requires scripts, so I don't know how to do this. I can't call a script in the skill page (except by running a common event) and I don't see how I can make the event itself call the script when the skill is used, as it is done randomly through an ABS.

I think I might have to abandon this idea for a while. Hopefully someone will be able to help me adapt the ABS script to provide what I need.

I've managed to get it to work for the player, which is nice, and I've learned a little about scripting, so thanks for that, guys!
I don't see how I can make the event itself call the script when the skill is used, as it is done randomly through an ABS.

That depends on how the ABS works. If it somehow includes a way to force actions then you can have every event display the message and force an action to itself. Even then, however, I think using scroll text is not a good idea when you have to display more skill names.

I posted a thread about if it is possible to do this with scripting and haven't had a response

It is definitely possible. One way of implementing it - one that comes to my mind while writing this - is to have your text displayed in a viewport over characters (events and player) heads and then move it up so that it disappears. This way you can display more than just a single message at once.

The main problem behind all this is that you need to know who is casting the skill to be able to display the viewport. This means that to do it you need to check the ABS code.

There is also one more thing I'd like to point while we are at it: if every enemy in the screen casts a skill and you write the name for each skill the player will hardly be able to read them all. If the player does not read them the result will be a huge mess without any real purpose other than confusing the player.

I am not saying you should abandon this idea and this, of course, is just my opinion, but if I were the one playing I wouldn't like having so much text. I would rather focus on the battle itself rather than skill names.

That said, even if I don't like having that much text it is still doable as long as you know how the ABS refers to each event.
That depends on how the ABS works.

I'm using Falcao's ABS. (https://falcaorgss.wordpress.com/2012/12/02/falcao-pearl-abs-liquid-v1/)
coupled with Sixth's AI addition (https://forums.rpgmakerweb.com/inde...module-for-falcaos-abs-v1-2-02-09-2015.43130/)

So the skills are chosen semi-randomly, dependent on an enemy's HP level etc in some cases.

The main problem behind all this is that you need to know who is casting the skill

YES! 😀 That's the issue. Given that there's multiple enemies on the map that could be attacking the player simultaneously, it's kinda important that the game knows which event is doing what. I used your script to display the skill names that enemies use - the only problem was that I couldn't change the position of the text on-screen to correspond to the position of the event. That's the only problem.

I would rather focus on the battle itself rather than skill names.

I know what you mean. In fact, the enemies don't use a ton of skills and it wouldn't be too wordy. In the default RPGmaker battle screen, whenever a player or enemy attacks or uses a skill, it says 'X uses/casts Y...'. I didn't want to lose that feature when using an ABS, as otherwise it just ends up being a series of animations that don't really mean anything. The enemy casts a spell, and something happens. So I wanted to keep some reference to the skill/magic being used. It also helps the player know how to deal with it too (e.g. an enemy casts a poison spell - the player knows that he is poisoned and can deal with it. I know this can be done through state icons too, but that's just one example.)

I like my ambitious ideas, it's just a shame I can't always implement them. I basically want to make FFXI in RPG maker! (not literally, but you get the idea)

EDIT: Something else I noticed is that the character 'waits' until the scroll text has gone. This is definitely bad. I thought it would run 'in the background' like a parallel process. that's way more of a problem than its position on the screen. 🙁
Something else I noticed is that the character 'waits' until the scroll text has gone. This is definitely bad. I thought it would run 'in the background' like a parallel process. that's way more of a problem than its position on the screen.

That happens because scroll text event command has a Fiber.yield while $game_message.busy? in it. That means everything in your map will stop while your game message is being displayed. You can call it manually so that it doesn't wait but honestly speaking since we agreed on the fact that it is not the best option I don't think you should put too much effort in something that you will abandon as soon as you get something better.

Original thread: https://forums.rpgmakerweb.com/threads/reposition-show-scrolling-text.97108/