Aww, yes. Finally an input script. I was getting tired of the pre-set controls. I'm not a good enough scripter to change them myself so this script is very useful for me. Thank you.
Edit: I'm a little confused about this script because of the japenese. Can you tell me exactly where to change the game controls?
This post has been edited by icecold49: Apr 5 2008, 08:37 AM
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)
First,take a look at this code,which is taken from default Scene_Menu line 73 :
CODE
#-------------------------------------------------------------------------- # * Update Command Selection #-------------------------------------------------------------------------- def update_command_selection if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window.index < 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window.index == 4 Sound.play_buzzer return end Sound.play_decision case @command_window.index when 0 # Item $scene = Scene_Item.new when 1,2,3 # Skill, equipment, status start_actor_selection when 4 # Save $scene = Scene_File.new(true, false, false) when 5 # End Game $scene = Scene_End.new end end end
And now,compare it to this :
CODE
#-------------------------------------------------------------------------- # * Update Command Selection #-------------------------------------------------------------------------- def update_command_selection if Input.trigger?(Input::A_Z["T"]) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::A_Z["Y"]) if $game_party.members.size == 0 and @command_window.index < 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window.index == 4 Sound.play_buzzer return end Sound.play_decision case @command_window.index when 0 # Item $scene = Scene_Item.new when 1,2,3 # Skill, equipment, status start_actor_selection when 4 # Save $scene = Scene_File.new(true, false, false) when 5 # End Game $scene = Scene_End.new end end end
Usually you will use default key,which on keyboard :
1.Input::B is key X 2.Input::C is key Z
Ok,
When you change to the "Input::B" to "Input::A_Z["T"]" and "Input ::C" to "Input::A_Z["Y"]",instead of using key X and Z,you'll need to press T and Y in the menu screen.
I can't explain anymore if any of you still didn't understand.
Group: Member
Posts: 9
Type: Developer
RM Skill: Advanced
It works, i can define in every scene a key or a mouse click. But i didnt understand the Feature:
CODE
Feature
Input Module mainly to the expansion of the keys to growth and mouse input possible. Written comment also politely as possible, so please try to take advantage. The main features listed below. For details, see Methods per comment please.
Example # # Key acquisition Input.trigger? (Input:: F2) # F2 is pressed (F2 or F11) Input.trigger? (Input:: NUM [0]) is pressed or 0 # (0 to 9) Input.trigger? (Input:: A_Z [ "A"]) is pressed or # A (A to Z) Input.trigger? (Input:: CLICK [ "L"]) # clicked or Left # ( "L") wheel ( "M") right ( "R") click
# Windows mouse cursor to completely erase # Own cursor in the game when setting recommended Graphics.cursor_visible = false
# Create MAUSUSUPURAITO Picture shows up as a cursor to # # Click when the filename + "_cl" If you say, I switch # (For example, cursor01 => cursor01_cl Mouse_sprite Sprite_MouseCursor.new = @ ( "cursor01") Mouse_sprite.cursor_name @ = "cursor02" # Change graphics
Ini file contents # # [Game field, reads data Title # By default, only exist [Game] API.read_ini ( "Game", "Title")
Did this mean i can define a mouse cursor to show and use or i am wrong?
This post has been edited by Daray: Apr 6 2008, 08:23 AM
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)
Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled
QUOTE (Bo0pi @ Aug 2 2008, 08:26 AM)
=[ i dont get it.
It's a scripter's tool. You don't have to get it.
Simply put, instead of being limited to a small sets of keys in your keyboard, you are now able to code RGSS with input commands using the WHOLE keyboard. It's really useful if you want to make a script that uses multiple keys. Heck, you can even use this in events when you are coding for an event based ABS.
Simply put, instead of being limited to a small sets of keys in your keyboard, you are now able to code RGSS with input commands using the WHOLE keyboard. It's really useful if you want to make a script that uses multiple keys. Heck, you can even use this in events when you are coding for an event based ABS.
lol i mean do i paste it above main?
and where do i change the buttons so i can use them for whatever?
and whenever i CB it doesnt work for some halfass of a reason.
Sorry if this is considered reviving the topic, but... With this script, will it be possible for me to 'link' a common event to an input button?
Example...a common event that increases your level by one once activated, linked to input button "T"; Will I be able to press "T" and increase my level by one?
Anyway, I'll like to know if this is possible and how? Thanks! n_n
__________________________
Fall to the power of the Emo! We have cookies!
Notice!! Check out my topic (http://www.rpgrevolution.com/forums/index.php?showtopic=45736&st=0#entry454175) if you're interested in helping me make a script that limits the number of characters & items you use in battle AND also an item durability feature! Thanks for any help in advance!
Group: Member
Posts: 58
Type: Event Designer
RM Skill: Advanced
QUOTE (Omegas7 @ Oct 11 2008, 09:22 PM)
I didn't understand what was the command for checking if the player pressed the button CONTROL or SHIFT...
Can i use this to add more items like an event for horse minimap and more? cause i preaty much used all of the pre set controlls and i dont want to override say my horse or my minimap on/off and others
Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled
QUOTE (killerrin @ Jan 5 2009, 03:04 PM)
QUOTE (Omegas7 @ Oct 11 2008, 09:22 PM)
I didn't understand what was the command for checking if the player pressed the button CONTROL or SHIFT...
Can i use this to add more items like an event for horse minimap and more? cause i preaty much used all of the pre set controlls and i dont want to override say my horse or my minimap on/off and others
Yes. With this script, you have the whole keyboard to play around with. Just follow the instructions. (Set Call Script as conditional branch)
because i saw this line at the Input.repeat? method
CODE
(count >= 15 and (count - 15) % 4 == 0)
I have tested it before and the refresh count before the second true return to Input.repeat? in RMVX is 23 frames pressed, not 15, as with this script, and as with RMXP. and the next preceding is 6 frames not 4.
Is this maybe supposedly
CODE
(count >= 23 and (count - 23) % 6 == 0)
?
And is it ok for the author if i include this on the release of my scripts? Proper credits to where it is due still. (Just asking)
Group: Member
Posts: 58
Type: Event Designer
RM Skill: Advanced
i need some help see i evented a cheat system i tested it with the Built in button controlls and it worked... but when i move it over to use it with lets say "C" it doesnt work i tried both Input.trigger?(Input::A_Z["C"] and Input::C and Input.trigger?(Input::A_Z["c"]) any help plz?
This post has been edited by killerrin: Jan 6 2009, 01:15 PM
Group: Member
Posts: 36
Type: None
RM Skill: Beginner
I know this is necroposting, but I just have to say that thanks to this script I am able to make my own ABS on vx without using the all so complicated for me scripts. The script is also easy to understand thanks to your instructions, thanks man.
Group: Member
Posts: 11
Type: Writer
RM Skill: Intermediate
Are you able to set keys to conditional branches in events?
For example, if I want text to appear or a picture to appear when the C key on my keyboard is pressed, would I be able to make an event which goes:
conditional branch: When C is pressed yadda yadda
Because I am not so good at scripting...so even if someone told me how to do this, I wouldn't get it. All I need to know is if I can use a conditional branch to detect key input.