Help - Search - Members - Calendar
Full Version: How do I do this?
RPG RPG Revolution Forums > Scripting > Script Development and Support
SleepingSirenx
How can I automatically make the game call Input.trigger(Input::Z) while in game? It is like the game automatically presses the Z button even without the player's own hands. Thank you.
stripe103
Sadly, you've got it all wrong. Input.trigger cheks if the desired key currently is being pushed. If it is, it returns true. It do not push the key for you. But I do believe that there is scripts that does what you want, even if I can't find it right now.
prizmik
Work around it,- establish a redundant event that could be called into action by more manageable means but initiate analogous operations to that of "(Input::Z)".
Redd
This goes in Script Support.
SleepingSirenx
Oh thank you sir Redd, hope someone can help me. smile.gif
Night_Runner
I believe that this should help you smile.gif
CODE
module Input
  class << self
    alias nr_ssx_trigger?  trigger?  unless $@
  end
  def self.trigger?(input)
    if input == Input::Z
      return true
    else
      return nr_ssx_trigger?(input)
    end
  end
end
SleepingSirenx
Thank you very much! You really is one of the best scripters! Thank you again.

EDIT : Figured It Out! Thank You!

EDIT : On another thought, how can I enable/disable this during runtime?
Night_Runner
Disabling....... that never occurred to me happy.gif

I've updated the code:
CODE
module Input
  class << self
    alias nr_ssx_trigger?  trigger?  unless $@
  end
  def self.trigger?(input)
    if not $game_switches.nil?
      if $game_switches[13] == true
        if input == Input::Z
          return true
        end
      end
    end
    return nr_ssx_trigger?(input)
  end
end


To enable the Z trigger always being triggered you need to have switch 13 on, where 13 can be changed on line 7.
SleepingSirenx
You really is the best! I wish I could script like you. smile.gif Thank you very much!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.