The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Master_of_Time on February 08, 2006, 11:11:01 PM

Title: Navi script
Post by: Master_of_Time on February 08, 2006, 11:11:01 PM
Okay here's what i need. In The Legend of Zelda: Ocarina of Time, your
fairy, Navi, will give you help when you need it or when you lock on to an
enemy.

Can anyone get/make me a script that gives the player a hint when a
button is pressed? That would help me out A LOT with my game. Thanks.
Title: Navi script
Post by: dragonmagna on February 09, 2006, 12:06:08 AM
With RM2K3, you can do this easily by key imput processing. But that was a major feature they shouldn't have taken out for RMXP.
SO how about just do it with many switches. In the area where you get the hint, put an event on every square where you would get the hint, make it on key press, and then when its done giving the hint, turn on the switch. And if you want it to make a sound, you would need to make about 2 more switches so that you don't hear "Hey" in an anoying voice on every place you step.If you want navi to fly around you, ask someone else, or put it in the charset.
Title: Navi script
Post by: Master_of_Time on February 09, 2006, 01:17:51 AM
Making that many events on one map would make the whole game run
EXTREMELY slow. Like...slower than dial-up slow. LOL

But that thought did cross my mind.
Title: Navi script
Post by: Tsunokiette on February 09, 2006, 01:32:37 AM
This is for if the shift key is pressed down on the map, you'll have to get someone else to do the battle thing for you, I'm supposed to be taking notes right now lol.

Insert this with all the other window scripts.

class Window_Navi_Tip < Window_Base
attr_accessor :tip
def initialize
super(0,400,640,80)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = 'Times New Roman'
self.contents.font.size = 22
@tip = '' unless $tip.nil? != true and $tip != ''
@tip = $tip unless @tip.nil? != true
give_tip
end
def give_tip
self.contents.clear
self.contents.font.color = normal_color
w = self.contents.width
h = self.contents.height
self.contents.draw_text(0,0,w,h,@tip,0)
wait
end
def wait
loop do
self.update
if Input.press?(Input::C)
break
end
end
self.dispose
end
def update
Graphics.update
end
end


then add this in the update definition of Scene_Map

if Input.press?(Input::A)
navi_tip = Window_Navi_Tip.new
end


The tip is automaticly ' ' unless you make it something else, to change the tip, simply use

$tip = 'text here'

If that doesn't work, notify me, give me the error, etc.

EDIT: forgot to say that you just press the space bar/enter/etc. to get it to go away again
Title: Navi script
Post by: ArkBennett on February 09, 2006, 01:38:52 AM
Lol, I remember I tried doing this once with events.
Except you could set the fairy on Attack, Defense, and Support mode.

There was some bug in it though.. I can't remember.
Title: Navi script
Post by: Master_of_Time on February 09, 2006, 04:00:17 AM
Interesting idea, ArkBennet.

Tsuno, nothing happens when I push the button.  :|
Title: Navi script
Post by: dragonmagna on February 11, 2006, 08:44:08 PM
Quote from: Master_of_TimeMaking that many events on one map would make the whole game run
EXTREMELY slow. Like...slower than <a style='text-decoration: none; border-bottom: 3px double;' href="http://www.qklinkserver.com/lm/rtl3.asp?si=92&k=dial%20up&st=1" onmouseover="window.status='Search for: dial-up'; self.ql_skeyphrase='dial%20up'; if(window.event) self.ql_sevent=window.event.srcElement; self.ql_timeout = setTimeout('ql_doMouseOver(1)', 1000); self.ql_isOverLink=true; return true;" onclick="if(self.ql_timeout) clearTimeout(self.ql_timeout); self.ql_isOverTip = false; ql_closeiframe(); self.ql_skeyphrase='dial%20up'; window.status='Search for: dial-up';return true;" onmouseout="window.status=''; if(self.ql_timeout) clearTimeout(self.ql_timeout); self.ql_isOverTip = false; setTimeout('ql_closeiframe()', 1500); ">dial-up</a> slow. LOL

But that thought did cross my mind.

Only if you get a bjillion hints in every map.

Dangit, why does that keep happening when I try to quote?!
Title: Navi script
Post by: Tsunokiette on February 12, 2006, 06:16:05 PM
Quote from: Master_of_TimeInteresting idea, ArkBennet.

Tsuno, nothing happens when I push the button.  :|

Are you pressing shift?
Title: Navi script
Post by: Master_of_Time on February 12, 2006, 06:17:31 PM
Yes I am.

I set the hint to say "Hello!" just to test it, but nothing happens.  :|
Title: Navi script
Post by: Tsunokiette on February 12, 2006, 06:20:43 PM
Quote from: Master_of_TimeYes I am.

I set the hint to say "Hello!" just to test it, but nothing happens.  :|

I'll test it tomorrow (or at least try to).

I'm going to a solo/small ensemble competition from 6:30 Am - 5:00 Pm tomorrow, and I think my grandparents are picking me up.

EDIT: correction, my dad is picking me up, so sometime next week I'll fix it
Title: Navi script
Post by: Tsunokiette on March 02, 2006, 10:58:07 PM
I apologize for the delay.

Just tweaked, tested, and fixed.

Put this with the other window_scripts.

class Window_Navi_Tip < Window_Base
  attr_accessor   :tip
  def initialize
     super(0,400,640,80)
     self.contents = Bitmap.new(width - 32, height - 32)
     self.contents.font.name = 'Times New Roman'
     self.contents.font.size = 22
     @tip = '' unless $tip.nil? != true and $tip != ''
     @tip = $tip unless @tip.nil? != true
     give_tip
  end
  def give_tip
     self.contents.clear
     self.contents.font.color = normal_color
     w = self.contents.width
     h = self.contents.height
     self.contents.draw_text(0,0,w,h,@tip,0)
     wait
  end
  def wait
     loop do
        self.update
        if Input.press?(Input::A)
           break
        end
     end
     self.dispose
  end
  def update
     Graphics.update
     Input.update
  end
end


then add this in the update definition of Scene_Map


if Input.press?(Input::A)
  navi_tip = Window_Navi_Tip.new
end



The tip is automaticly ' ' unless you make it something else, to change the tip, simply use

$tip = 'text here'

Press shift to see the tip, and press shift again to make it go away.
Title: Navi script
Post by: Master_of_Time on March 02, 2006, 11:27:37 PM
Thanks, Tsuno.  :D
Title: Navi script
Post by: Aus Ace Leader on March 05, 2006, 01:54:41 PM
K'ya, I was thinking I might want to use this too, yet this is the second script I would be fidling with, where evectly do I go about putting these?
Title: Navi script
Post by: Tsunokiette on March 06, 2006, 12:13:55 AM
Quote from: Aus Ace LeaderK'ya, I was thinking I might want to use this too, yet this is the second script I would be fidling with, where evectly do I go about putting these?

The window script itself can just be put above main, but for sake of orginization, it's recommended to insert it with all the other window scripts.

For the part that's needed in Scene_Map's update method, just find.

def update

in the  script Scene_Map

and past the lines bellow it.

You can change the tip through the script event command.



You can change what button is needed to close the window (which is recomended because the window accepts input quickly and will probably be closed and opened again, etc. if you press the button too long and it's the same used to both open and close it *inhales*)

Just find this part in the window script itself.

        if Input.press?(Input::A)
           break
        end


and replace the A with another letter -

A = shift
C = space, enter, etc.

there's others, but it would make sense to just choose one or the other.