Amaranth's Super Simple Mouse System for Ace

What's the workaround - not doing a call common event? That's not really ideal.


@Firgof, can you change that line to this:

self.enabled = $game_switches[id] if $game_switchesI've tested it and it works.

This (line 262):    mx, my = SceneManager.scene.instance_variable_get🙂@spriteset).tilemap_offset


crashes with a NoMethodError when pressing any key while using Tsukihime's splash screen map (which runs before the title screen, which is also a map (via Acezon's map as title screen script)).
Can you provide the EXACT error message, and a link to Tsukihime's script?


@cabfe, I can't reproduce your error. If I add an autorun event that calls a common event, I can't use the mouse while either are processing. Can you give me screenshots of your autorun and your common event so I can copy your conditions? Or make a small demo project that illustrates the issue and upload it for me?
You can still use Common events, but they have to be triggered outside the Autorun event.

I used a switch that activated a Parallel event which contained the Call Common Event.

This way the Autorun and Parallel events launch simultaneously without breaking the "block the player" function of Autorun.

It's not very convenient, I agree, just a workaround...

I prepared a demo to show all the cases I worked on so far.

MouseBlock.zip
I don't have time to download and look at it now ... but does this demo show the actual issues, or the workarounds?


I added an autorun event on the map which does a Call Common Event command, which I think is what you described as not working, and it works perfectly. The mouse cannot be used while either the autorun OR the common event are processing.
I included the 3 scenarios :

1 - Autorun with Call Common Event included (the buggy one)

2 - Autorun with the actual command that should have been called in the Common Event.

3 - The workaround using a parallel event in addition to the Autorun.

It does happen when there is a Wait command in the Autorun.

I tried without and the movements were blocked.

Also, I noted that in case 1, the cursor changes when you hover active elements (that is, which have the <mouse something> comment).

That doesn't happen in the others cases.

So there is definitely something that is "freeing" the mouse actions.

Please take your time. I'm not in a hurry to have it fixed. There are so many other things to do, I can wait 🙂
I have fixed the issue above, where an autorun or player-triggered event would call a common event and the mouse would be incorrectly re-enabled, allowing the player to move around while the calling event is still in progress.


Please download the latest version from Pastebin.


Changes are:


- 2 methods added for Game_Map (previously there were none; these methods OVERWRITE the original, rather than aliasing it, so if you have other scripts that alias these methods, the mouse script needs to be placed above them)


- small change to Game_Interpreter.setup method
Great !

Just tried it and works like a charm.

Thank you !
Me again, sorry about this.

I am still doing my final (I hope) play testing and a couple of times now I've had the following error message.

ErrorMessage_zpsc464c878.png


Everything works fine before and after it.  It has only happened during battle.

Confused, as always.
Can you reproduce it regularly?

Is this line 281?

y = (@pos[1] + my) / 32if so, change this method

Code:
  def self.grid    return nil if @pos.nil?    mx, my = SceneManager.scene.instance_variable_get(:@spriteset).tilemap_offset    x = (@pos[0] + mx) / 32    y = (@pos[1] + my) / 32    return [x, y]  end
to say this:

Code:
  def self.grid    return nil if @pos.nil?    if SceneManager.scene_is?(Scene_Map)      mx, my = SceneManager.scene.instance_variable_get(:@spriteset).tilemap_offset    else      mx = my = 0     end    x = (@pos[0] + mx) / 32    y = (@pos[1] + my) / 32    return [x, y]  end
and see if it goes away. Though if that's the problem, I'd actually expect it to have errored on the line above it.It shouldn't even be running this method when you're in battle, so I might have to look into that a bit.
My line 281 reads:

pos = [x, y].pack('11')
What version are you using? Can you get the latest and greatest?


Have you modified it? Are you using a custom battle script?
I'm using version 1.8, so the only thing I'm missing is the update for the common event.

I haven't modified it in any way except to select a different icon for the mouse cursor

I'm using Yanfly's Battle Engine.

I've carried on play testing, but haven't been able to reproduce the error again so far.  It has only happened twice in all the many, many hours I've play tested since version 1.8 came out, but both those instances have been in the last couple of days.
Those methods have NEVER been changed, since the script was first released.

Can you try changing that line to these lines instead:

begin post = [x, y].pack('ll')rescue p sprintf('mouse script error on pos = [x, y].pack(\'ll\'); x is %s, y is %s', x.to_s, y.to_s) return nilendand play with the console on. If it happens again, let me know what's in the console.You're better to copy/paste that rather than type it in - that's ll, the letters, not 11, the numbers, which you wrote above.
I immediately get the message

SystemStackError

stack level too deep

Should I have also deleted line 282 which reads

   return Scr2cli.call(self.hwnd, pos) == 0 ? nil : pos.unpack('ll')
mmm ... just change it back to the way it was. I'll have to spend a bit more time on it, and I'm about to shut down now.
i'd hate to sound like an idiot. But, why doesn't it work?

I put in the comments but nothing happens. Like, i put <Mouse talk Phil> for example. And when i goto test play, i hover my mouse over them and nothing comes up. 

What gives? :T
Did you install the script in the right place? Is it exactly as it is in pastebin, or have you made any mods to it?


Can you post a screenshot of your event window (the whole window, not just the command)?
5PrACXw.png


WJdsrxC.png


What am i doing wrong?

I haven't modified the script and it's below all my other scripts.

EDIT: The path finding works if i use the script code. But that's ALL that works.
Have you checked that the icon indexes are all correct? If you want, you can zip up your project (uncompressed - I want to see the events, resources and scripts) and send me a link to download it (not on 4shared or anywhere that requires me to register) and I'll take a look at it. I'm sure it'll be something really simple.
Erh... well. I've not changed a single thing on the script for icons. So it can't be that... :T I'll send you the file in a moment.

Edit: What can i use to let you download it?
Just zip it up and load it up somewhere - mediafile (is it still around?), dropbox, anywhere that doesn't require me to register and isn't 4shared.

Original thread: https://forums.rpgmakerweb.com/threads/amaranths-super-simple-mouse-system-for-ace.17829/