[XP] Mouse Controller Enhancement Script

Started by nathmatt, March 24, 2010, 08:31:41 pm

Previous topic - Next topic

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


athreus

Thanks for your help, this work, but i have noticed another error with  the \commands function. After i click on the event, the commands window
open, but when i click on map or on a command the game will crash and show a disposed window error in Blizzard Mouse Controller. I hope this can be fixed... Tanks again for your help!

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


athreus

There is a NoMethodError on line 154 when I click on ground for moving.

undefined mehotd 'mouse_in_area?' for nil:NilClass.


Kiwa

I'm getting that exact error if i DONT click on an NPC (event)
if I click the NPC event it will chase it until the enemy attacks me
if its a non threat NPC that speaks.. it will speak..and i can click to close the chat bubble.
if i click on a walkable path.. it bugs and gives me that same error. one block away or ten.. doesn't matter.. insta bug.
Mouse Control Ext is the title i gave my script...obviously lol.
-------------------------------------------------------------------
Script 'Mouse Control Ext' line 154: NoMethodError occored

undefined mehotd 'mouse_in_area?' for nil:NilClass
-------------------------------------------------------------------

I tried it with and without "Eight way Movement" and " Repair Movement" thinking it may help.
but to no avail.
any help would be appreciated :)

nathmatt

remove that line im not sure y i added that line it has no use i fixed and updated
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Kiwa

Thanks!! out of curiosity i actually # the line and it worked fine lol.
I hopped on to post that it was working and wanted to know if it would leave me with bugs :)
guess it wont!
Thanks a bundle!
BTW.. its a great script and i like it a lot. I can see it being a great use to games :)

I'm interested in adding to it..is there a way to add to make it move in the direction of the mouse cursor at a constant rate if i say.. held down the right click or a hot key on the KB?

I'm not a good scriptwriter. So i greatly appreciate all this help from the forum. you guys are great! 

nathmatt

here tell me if this was what you where talking about requires Tons of Add_ons place it below this script

module MCES
 
  Buton_Held = 'Shift'
 
 
  class Processor
   
    alias update_movement update
    def update
      update_movement
      if Input.press?(Input::Key[Buton_Held]) &&
          !$game_temp.message_window_showing && !check_event && @lwait == 0
        @lwait = 5
        x,y = mouse_tile
        $game_player.set(x,y)
      end
    end
  end
         
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Vexus

May 06, 2012, 07:03:00 pm #168 Last Edit: May 07, 2012, 08:39:58 am by Vexus
Hi I'm trying your script on a new project and dunno why but I placed an event on the map with through on (It's some blood on the floor to be specific) but whenever I click on that spot the character doesn't want to move there. Anything I can do to solve it?

Also I'm putting some events set as action on doors or whatever but when I click with the mouse nothing happens so I tried pressing c but still nothing happens, am I doing something wrong?

Thanks

[Edit]

I sort of found a solution for the 2nd problem utilizing the /commands feature but with this new thing another 2 problems arise.

1 - You can right click even if your far away from the event and still get the text/items.
2 - After I do the right click and get the item/text pathfind no longer works to move but works when I press directly on some events.

Hope this can be solved.
Current Project/s:

Kiwa

Nath!! that's EXACTLY what im talking about!
Thanks a ton!

I just had to add an additional 'end' at the end of the script and it worked fine :P ( i kept getting an error at line 18..)

module MCES
 
  Buton_Held = 'Shift'
 
 
  class Processor
   
    alias update_movement update
    def update
      update_movement
      if Input.press?(Input::Key[Buton_Held]) &&
          !$game_temp.message_window_showing && !check_event && @lwait == 0
        @lwait = 5
        x,y = mouse_tile
        $game_player.set(x,y)
      end
    end
  end
  end


I'm Going to fiddle with it more.
im looking for 2 more things with this

1. I think there's a bug when i click a target to just talk to.. it always trys to go benieth them. so if i put a bush there or a tile marked 'X'.. my char can never reach that event to talk to it. unless i hit control. i'll play more with it later busy day lol.

2. i dont want it to disable 'Enter' as an event accessing key.

Thanks :D

I cant wait till i can make script and contribute more to the site. :D

Kiwa

So far..adding that 'End' is the extent of my capability lol.
I'm trying to edit this script to fit my vision...

Things I noticed When the character is facing Left or Down I will walk to their front side.. if they face Right or UP I'm at an angle to them.
I found the code at line 199 and 200..and tried to "fix" it.. and I fixed it real good.
Its now so powerful...that not even RGSS could handle it, and the Hero would always be angled off the NPC.
in other words.. I fixed the script so it was wrong lol.

But my biggest concern in this is understanding the Key mapping.
I tried modifying it.. but I think I just lack understanding

I want it so I can function the game normally without the mouse. if I need it for only menu systems that's fine. but game play i want functional thru only keyboard.
I'm 1 enter key short after installing these scripts (I also linked confirm to enter as well as H but neither work now). from it working out that way...
following that I'd like to set them as key binds that link with the Hot Keys of ABS.
such as LEFT is melee Right is cast your selected spell.

----------------------TLDR---------------------
I need help understanding Mouse key mapping.. left, right click AND adding BOTH perhaps.
------------------------------------------------
I know its not any of your responsibility. I'll continue to fiddle till I learn something either way lol.
Thanks ahead of time :D



nathmatt

May 07, 2012, 03:05:20 pm #171 Last Edit: May 07, 2012, 03:14:09 pm by nathmatt
@Kiwa
1. i wrote the script to move to the players facing direction as i figured that would be the best place to end up when clicking on an event

2. i actually don't know the key mapping but if you check out Tons of Add_ons or Blizz-abs under the Input Module most if not all are there.

3 The Original Mouse Controller maps the mouse key to the C Button which is y i made it not work with events
if i didn't events would activate when standing next them and trying to move with the mouse

@Vexus
Give me a few min i will add a ignore name_tag to to events to allow the player to go to that specific spot

edit: use \ignore and it the player will go there now
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Vexus

\ignore works, thanks :)

Anything can be done about events with /commands make pathfind no longer work when clicking on the ground but only work when you click on events that are reachable?

And is there any other solution apart of /commands to make events set on impassable things clickable when near them? (Would also be great if clicking on an event the character would walk to it even if the event is set on an impassable rock or whatever.)

Thanks
Current Project/s:

nathmatt

fixed just had to move the event check before the passability check
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Vexus

May 07, 2012, 04:39:52 pm #174 Last Edit: May 07, 2012, 05:45:47 pm by Vexus
Sweet!

Thanks a lot, it works :)

[Edit]

Um I think I've stumbled on a new weird problem :S

So now when I click on a door I can start their events which is great so I have an event on a door which turns a switch on making the door change graphic and you get new options on this page, till here it works. I choose from the new choices another option which triggers another switch and removes the previous switch and the door changes graphic again for the final page (Which has only some choices that all finish with some texts) BUT now the event when clicked no message/choices show nor the character moves near the door.

I'm sorry for giving you so many trouble but it's not like I'm doing it on purpose :P

Sorry again.
Current Project/s:

nathmatt

upload a demo so i can see what ur talking about
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Vexus

May 07, 2012, 06:23:51 pm #176 Last Edit: May 07, 2012, 06:25:34 pm by Vexus
Ok I just want to say on a new project at first it didn't work too then out of a sudden it started working then again didn't work.

The thing is apart of the mouse script I have nothing else yet so it should work the same on both projects :/ (Only thing different on the actual project is the tileset used.)

Anyway here's a link:

http://www.mediafire.com/?jbs0a36oi7sevi8

To trigger it in sequence click on the wood trunk near the house once (For now it's just testing) then go to the door and press on barricade, light reinforce and first choice, when it's done click again the door for hard reinforce for the final page then try clicking on the door again to see if the choices work or not.

On my actual project nothing happens when I click again but on the new one sometimes it worked sometimes it stopped earlier.. so confusing :S
Current Project/s:

nathmatt

ok it had to do with the direction when you changed the graphic the direction changed and could not be reached because of the wall so add \directionfix[2] 2 to say the area below it is free
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Vexus

Current Project/s:

Kiwa

May 09, 2012, 07:35:31 am #179 Last Edit: May 09, 2012, 07:41:50 am by Kiwa
Hey nath,

I'm using your code and I like it a lot (looks like you made updates too..so ill update my code)
I've actually learned a lot about RGSS from your script. it seems pretty easy to understand once you stop to read and think more.

so the point of my post is I'm modifying the script here and there to learn about it. I made the right click move as well as its linked melee.
but what I can't figure out is how to Disable the attack. I cant seem to follow the script to locate how it runs to blizz ABS to attack.

Also I'm trying to make 'Enter' work as it does without you're script (still...lol)
so I made an NPC when I talk to him gives the option to disable your script with "$MCES.disabled = true"
However neither the 'Enter' key works again nor does the 'C' Key as defined at the bottom...but the right click still attacks.

So now I'm feeling confused after I felt I was understanding :P

maybe some line references or key words I can type in the search to understand where these come from.
for example...
How does the right click attack?
How does left click cancel 'Enter'?
Why does 'right click' attack work when script is disabled?
Why does 'C' not work..with or without your code activated?

Sorry I'm a difficult and stubborn at times.. :P

Sorry, it seems I forced you into being my teacher lol.. I hope you don't mind the questions :P
If you don't want to give guidance on this I understand and I'll stop asking and drop it...and maybe focus my efforts elsewhere.

I really appreciate the help tho.