Kain Nobel
Member
Bug Found!":k8w1ts80 said:3/14/2008
Brewmiester: "It looks like $scene doesn't reinitialize when you change maps. (but it does when you enter / exit the menu)"
Thanks to Brewmiester for fixing this script, it is my first origional script I have ever publicly released! (Probably because its my first script to work in a while )
Also, if you've ever made an event system like this and know who you are, you need to tell me so I can place you in the credits as well
Its a simple plug 'n play script, instructions are commented within.
Be sure to look for @toggle_or_hold = 15 and you can change that value to switch between Toggle and Hold mode. You can create an item that is non-consumable within the menu linked to a common event that'll toggle this switch ON/OFF, so the player can change it within the menu.
This script also calls @display_image = 16 and that is also another switch value, you need to add it to your array only if you plan on using it, if not please delete any lines having anything to do with the @display_image $game_switch.
I do plan on expanding on this script in the future (maybe) so if you have any suggestions, contact me.
There's other uses aside from the basic function of the script within the comments, I'll even release a demo later that expands on the idea of this script. Again, thanks and leave me comments on how you like this script.
You'll need to put this image in your */Graphics/Pictures folder (or use/create one you desire, like a finger or something for that unique FFVII feel.)
http://i224.photobucket.com/albums/dd28 ... ouHere.png[/img]
Have fun and enjoy!
Code:
#= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# [KN]-Arrow Over Head
#= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# Created by: Kain Nobel (With Help from Brewmiester @ RMXP.org, thanks!)
# Version: 0.2
# Date Created: 2/29/2008
# Date Modified: 3/5/2008
# Contact: http://www.neoseeker.com/forums/22121
# -> Be sure to send me a PM there, and I will gladly reply.
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
=begin
INSTRUCTIONS:
Place this script anywhere above 'main' (and, obviously, below the SDK if
you are using it. This script is a pretty simple plug 'n play script, and
does not overwrite any other RGSS methods within the game system. It calls the
picture "YouHere.png" but you can re-name or use any other picture you desire,
just be sure to change the filename within the script, respectively.
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
HOW DO I USE THIS IN MY GAME?
Just simply press either the 'A' button, the 'Z' button or 'Shift' and it
should work. This script uses two different modes, the Toggle Mode and the
Hold Mode.
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-TOGGLE MODE: $game_switches[@toggle_or_hold] = false
Simply Press 'SHIFT' to enable/disable the Arrow Over Head feature.
-HOLD MODE: $game_switches[@toggle_or_hold] = true
You must Hold 'SHIFT' to enable the Arrow Over Head feature. When this button is
released, the arrow over your head disappears.
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-DISPLAY IMAGE $game_switches[@display_image]
When this switch is on, you can use it in conditional branches or page
conditions. "Why?" you ask? Well, page 2 of an event can be an arrow graphic
for a transfer event, so when the YouHere locator is on, so is the transfer arrows.
Just a thought? Thats what I use it in my game for, but whatever its up to you.
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COMPATIBILITY ISSUES?
None that I know of, I don't know why there would be? Surprisingly I don't
use any version of SDK, so as far as it being SDK compatible, I wouldn't know.
Of course, I'm pretty sure any conflicts with the SDK would be a simple fix,
just let me know if you need me to make it "SDK Compatible" and I'll be glad to.
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CREDITS:
First off, this is my first publicly released script in a long long time, but
I'm not an expert scripter yet, this was made basically for my learning purpose
alone. I coded it all, then Brewmiester fixed up a couple little errors I didn't
know how to fix, thanks to him for the quick edits I needed for it to run.
There is somebody, I believe they're in the RMXP.org community or possibly
Creation Asylum, who had created an "Arrow Over Head" event system which I had
based this script off of. If it is you, or you know who they are, please let me
know, and let them know as well, because I'd like to credit them and thank
them because I created this script based off of their origional work. ;)
=end
#= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
class Arrow_Over_Head < Sprite
#------------------------
# * Object Initialization
#------------------------
def initialize
super
@mode = 15
@display_image = 16
@toggle_mode = $game_switches[@mode]
self.bitmap = RPG::Cache.picture("YouHere")
self.ox = 16
self.oy = 32
self.visible = false
update
end
#=================
# * Object Refresh
#=================
def update
super
self.x = ($game_player.real_x / 4 + 16)
self.y = ($game_player.real_y / 4 - 16)
#----------
# HOLD MODE
#----------
if @toggle_mode == false
if Input.press?(Input::A)
self.visible = true
else
self.visible = false
end
end
#------------
# TOGGLE MODE
#------------
if @toggle_mode == true
if Input.trigger?(Input::A)
self.visible = !self.visible
end
end
#-----------------
# If self.visible?
#-----------------
if self.visible == true
$game_switches[@display_image] = true
else
$game_switches[@display_image] = false
end
end
end