Kain Nobel
Member
3/14/2008":306jl1ge said:Bug Found!
Brewmiester: "It looks like $scene doesn't reinitialize when you change maps. (but it does when you enter / exit the menu)"
3/6/2008":306jl1ge said:Bug Found!
I can't believe I didn't discover this until today, but the arrow seems to only work on one map, then not appear on the next map. The switch is still on, because the red transfer locator arrows appear, but the arrow isn't there after a transfer player command. When I go into the menu, or press F9 while in playtest, then exit the respective menu, the arrow is fixed. I have to figure out how come the arrow only updates after exiting a menu.
3/5/2008":306jl1ge said:Bug Fixed!
Brewmiester's origional offset of the X/Y of the cursor was incorrect. By using screen_x and screen_y, I had remedied the 'arrow runs all over the screen' bug.
Thanks to Brewmiester for helping me with 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.
Required: YouHere.png
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]
Optional: [KN]-Locator.png
You'll need to put this image in your */Graphics/Characters folder. You can change the color by adjusting the hue bar in the character_hue slider in an event.
http://i224.photobucket.com/albums/dd28 ... ocator.png[/img]
Well, you can use them to show you where a ladder is, where a transfer player is, etc... Here's a screenshot of how I would set the event up.
http://i224.photobucket.com/albums/dd28 ... _tut_1.png[/img]
Make switch condition on PAGE 2 of the transfer event, make sure both the first page with no condition and the second page with the ~display image switch ON both have the transfer event process.
Note the Custom move route, how I detail the arrow flashing, as well as the checkboxes for Direction Fix ON, Phasing ON, Always on Top ON and Stop Animation ON.
This is a simple way to modify your transfer events along with the arrow over head display, just like good ol' FFVII back in the day.
http://i224.photobucket.com/albums/dd28 ... _tut_1.png[/img]
Make switch condition on PAGE 2 of the transfer event, make sure both the first page with no condition and the second page with the ~display image switch ON both have the transfer event process.
Note the Custom move route, how I detail the arrow flashing, as well as the checkboxes for Direction Fix ON, Phasing ON, Always on Top ON and Stop Animation ON.
This is a simple way to modify your transfer events along with the arrow over head display, just like good ol' FFVII back in the day.
http://i224.photobucket.com/albums/dd288/Kain_Nobel/Screen%20Shots/KN-Mines03.png[/img]
http://i224.photobucket.com/albums/dd28 ... ines04.png[/img]
http://i224.photobucket.com/albums/dd28 ... ines04.png[/img]
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.x = $game_player.screen_x
#self.y = ($game_player.real_y / 4 - 16)
self.y = ($game_player.screen_y - ((32 * 2) - 10))
#----------
# 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