[XP] Mouse Controller [Resolved]

Started by Kirye, June 23, 2012, 10:31:55 pm

Previous topic - Next topic

Kirye

June 23, 2012, 10:31:55 pm Last Edit: June 24, 2012, 02:05:02 pm by Kirye
Alright, so I just recently added the Mouse control to my game and i'm in love with it. Everything works great with it, and it's made my game much better. Except for one small problem.

F0's Blacksmith script crashes if the Mouse controller is enabled, and gives me an error in Tons of Add ons' Shaded Text option *Which is off, mind you*. The smithing script works fine with Tons as long as the mouse script isn't in there. So i'm wondering if there's a way to fix it.

Preferably, i'd like the mouse control to work on the Blacksmith script. If there's a way to fix it, i'd appreciate that. If not, is there a way to disable the Mouse Control script when the blacksmith script is activated? I tried $game_system.mouse_control = false and that didn't work.

Thanks kindly to anyone who can help. Not sure what other info to give.

Spoiler: ShowHide

ForeverZer0

The error pops up when a you try to use #draw_text with the string being nil. It just pops up in Tons because that method aliases the and runs before the normal method. I can't think of anything that in the mouse controller that would cause an error related to text drawing. When exactly does it cause the error?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Kirye

I'm assuming it's the Mouse Controller because when I remove it, the script works. The error happens when the BS window opens. I can see the "Forge, Extract" options before it crashes.

Spoiler: ShowHide



Spoiler: ShowHide

Blizzard

Remove Tons for the time being. It's rerouting the error from somewhere else. Then you will get the actual call that causes the error.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Kirye

Quote from: Blizzard on June 24, 2012, 11:39:17 am
Remove Tons for the time being. It's rerouting the error from somewhere else. Then you will get the actual call that causes the error.


Just did, now I get this.

Spoiler: ShowHide

Spoiler: ShowHide

ForeverZer0

I thought of a possible incompatibility with the mouse script. The command window it uses is not setup to handle help text when there is no active command, since this is not possible using normal controls. Try changing this in the blacksmith script:

    # Set help text depending on the selected index.
    help_text = case @command_window.index
    when 0 then 'Use materials to forge new weapons, armors, and items.'
    when 1 then 'Extract materials from weapons, armors, and items.'
    when 2 then !@enchants ? 'Exit the shop.' :
      'Enchant weapons, armors, and items using other items.'
    when 3 then 'Exit the shop.'
    #--------------------------------------------------------------------------------
    else
      ''
    #--------------------------------------------------------------------------------
    end
    @help_window.set_text(help_text)


Notice the lines I inserted in there. Change the script in your game to match that and see if it works.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Kirye

Awesome! It's working now! Thanks alot Blizz and F0. :D

Glad you guys could take the time to help me even if you're done with scripting.

Spoiler: ShowHide