LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



View previous topic View next topic Go down Message [Page 1 of 1]

EVENTALIST
EVENTALIST
#1 RMXP- Mission Arrow Empty RMXP- Mission Arrow
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
Mission Arrow
Version: 2.4
Author: Mr Wiggles
Date: May 15, 2011

Version History



  • Version 1.0 4/30/11 - Original Release
  • Version 2.0 5/3/11 - New System
  • Version 2.4 5/15/11 - Bug Fix


Planned Future Versions

  • More features and such, idk what...


Description


This script allows you to put an arrow on the screen to point to an event.

Features

  • V2.0 - Uses a variable for mission id.
  • V2.0 - Easy set up, just create a comment with the mission ids to point to in an event.
  • V2.0 - Point to the EXACT location of the location relative to the player.


Instructions
You'll have to paste the script above main and bellow the default scripts. Download and place the "Mission Arrow" image and place it in your graphics folder.

Script


Code:

#==============================================================================
#                      ** Mission Arrow **
#==============================================================================
# By Mr Wiggles
# Version 2.4
# 5/15/11
#==============================================================================
#                            Instructions:
#                      -------------------------
# To make the arrow point to a loctaion use an event that has:
#    "Missions [id]" in a comment within the top 5 lines.
#    the top five because most scripts that read event comments read
#    the first one. This was done to make the script compatible.
#
# [id] for Missions is all the ids that point to that event.This is good for
#    map change events for pointers on other maps.
#
# If an event is a map transfer and you want to point to missions on that
#    new map use ["all",excluding_ids]
#    ex. "Missions ["all",3,4]" will point to for all other missions that
#    are not 3 or 4.
#
# To make the arrow point to an object if a variable is at a certain value
#    use "ifvar[id]=value" after "Missions [id]".
#    ex.  "Missions [1,3] ifvar[1]=10"
#
# To make the arrow point to an obect if the vairable is NOT the matching
#    value use "ifvar[id]!=value" instead.
#
# To make the arrow point to an object if a switch is at a certain value
#    use "ifswi[id]=value" after "Missions [id]".
#    ex.  "Missions [1,3] ifswi[1]=true"
#
# To make the arrow point to a specific id set the vraiable with the id
#  of the "POINTVAR" to value of the destenation id. To stop pointing set
#  the variable to zero.
#
# NOTE: It is important that you do not have any spaces but those between
#  "Missions" and "[id]" or any arguements like "ifvar[1]=5" or "ifswi[1]=true". 
#    ex.  "Missions ["all",1,2] ifswi[1]=false"
#
# NOTE: The mission comment tags will only work if the event page they are on
#    is active. (say event page 2 needs switch[id] true, if there is a tag
#    on that page it will only work if switch[id] is true.)
#
# NOTE: You can use the list as an arguement branch as well.
#    ex. (event command list)
#        Comment: "Missions ["all",6,10] ifswi[100]=true"
#        Comment: "Missions [1,3] ifvar[1]=13"
#        Comment: "Missions [5,6]"
#  If the first comment arguments are not met it will move to the second
#  line, and if the second are not met it will move down to the third... etc.
#==============================================================================
# Varialbe id used for point target id.
POINTVAR  = 1
#------------------------------------------------------------------------------
# Show debugging information.
DEBUG    = false
#------------------------------------------------------------------------------
# Location of the arrow sprite. [x, y] (320, 240 = Center Screen)
ARROW_LOC = [0, 480]
#------------------------------------------------------------------------------
# Refresh rate (lower number = faster refresh but more lag.)
REFRESH  = 10
#------------------------------------------------------------------------------
# Name of the Picture file for the arrow.
POINT_IMG = "Mission Arrow"
#------------------------------------------------------------------------------
# Arrow Opacity.
AROPACIT  = 180
#==============================================================================
#
# Do not eddit bellow this line unless you know what your doing.
#
#==============================================================================
# ** Scene Map
#==============================================================================
class Scene_Map
  #--------------------------------------------------------------------------
  alias :wma_main :main
  def main
    @wma_window = Window_MNArrow.new
    wma_main
    @wma_window.dispose
  end
  #--------------------------------------------------------------------------
  alias :wma_up :update
  def update
    wma_up
    @wma_window.update
  end
end

#==============================================================================
# ** Game Event
#==============================================================================
class Game_Event < Game_Character
  def missions
    return [] if @list.nil?
    for i in [You must be registered and logged in to see this link.] - 1
      line = @list[i]
      next if line.nil?
      command = line.parameters[0]
      next if command.nil? or !command.to_s.include?("Missions [")
      command = command.to_s.split(" ")
      if (command[2].nil? and command.size > 2) or command.size > 3
        string = "Mis Arrow: Event #{self.id} has too many spaces. \n" +
                "Comment: #{command.join(' - ')}"
        print("#{string}")
        $scene = nil
        return
      end
      if command[0] == "Missions"
        missions = command[1]
        unless command[2].nil?
          argue = command[2].split("=")
          unless argue[0].nil?
            argue[0].gsub("[", "$'")
            unless $'.nil?
              id    = $'.sub("]", "").to_i
              value = argue[1].to_i
              if argue[0].include?("ifvar")
                not_val = argue[0].include?("!")
                unless not_val
                  missions = nil unless $game_variables[id] == value
                else
                  missions = nil unless $game_variables[id] != value
                end
              elsif argue[0].include?("ifswi")
                not_val = argue[0].include?("!")
                unless not_val
                  missions = nil unless $game_switches[id] == eval(value)
                else
                  missions = nil unless $game_switches[id] != eval(value)
                end
              end
            end
          else
            missions = nil
          end
        end
        break if missions != nil
      end
    end
    missions = "[]" if command.nil?
    if missions.nil?
      missions = command[1].include?("all") ? "[\"all\"]" : "[]"
    end
    if missions.include?("all")
      new_ids = []; index = 0; 9999.times{index += 1; new_ids.push(index)}
      missions.delete!("\"all\",")
      ids = eval(missions)
      for id in ids
        new_ids.delete(id.to_i)
      end
      ids = new_ids
    else
      ids = eval(missions)
    end
    return ids
  end
end

#==============================================================================
# ** Mission Arrow Window
#==============================================================================
class Window_MNArrow < Window_Base
  #--------------------------------------------------------------------------
  def initialize
    super(-16, -16, 700, 540)
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
    self.contents.font.size = 20
    self.opacity = 0
    @update_wait = 0
    @bitmap = RPG::Cache.picture(POINT_IMG) rescue nil
    @arrow = Arrow_Sprite.new(@bitmap)
    @angle = 0
    refresh
  end
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    pointers = []
    for event in $game_map.events.values
      ids = event.missions
      next if ids.nil? or ids.empty?
      if ids.include?($game_variables[POINTVAR])
        pointers.push(event.id)
        px, py = $game_player.x, $game_player.y
        ex, ey = event.x, event.y
        gx = ex - px; gy = ey - py
        @angle = get_angle(gx, gy)
        @arrow.angle = 270 + @angle; @arrow.visible = true
        w, h = @bitmap.width, @bitmap.height
        self.contents.blt(@arrow.x - (w / 4), @arrow.y - (h / 2), @bitmap,
          Rect.new(0, 0, w / 2, h), AROPACIT)
        event_id = event.id
        break
      else
        @arrow.visible = false
      end
    end
    id = $game_variables[POINTVAR]
    return unless DEBUG and id != 0
    self.contents.fill_rect(Rect.new(-24, 0, 680, 56), Color.new(0,0,0,150))
    self.contents.draw_text(-24, 0, 680, 32,
      "Target Mis:#{id} - Angle:#{@angle} - " +
      "Event#{event_id}:[#{ex}, #{ey}] - " +
      "Player:[#{px}, #{py}] - Point:[#{gx},#{gy}]", 1)
    self.contents.draw_text(0, 24, 680, 32,
      "Pointing at Event ID(s): #{pointers.join(', ')}", 1)
  end
  #--------------------------------------------------------------------------
  def update
    super
    @update_wait -= 1
    return if @update_wait > 0
    @update_wait = REFRESH
    refresh
    @arrow.visible = false if $game_variables[POINTVAR] == 0
    @arrow.update if @arrow.visible
  end
  #--------------------------------------------------------------------------
  def dispose
    @arrow.dispose
    super
  end
  #--------------------------------------------------------------------------
  def get_angle(lx, ly)
    angle  = (Math.atan2(lx, ly) * 100).round
    angle /= 2
    if angle < 0
      angle *= -1; angle = 360 - angle % 360
    end
    angle =  0 if lx == 0 and ly  > 0
    angle =  90 if lx  > 0 and ly == 0
    angle = 180 if lx == 0 and ly  < 0
    angle = 270 if lx  < 0 and ly == 0
    return angle
  end
end

#==============================================================================
# ** Arrow Sprite
#==============================================================================
class Arrow_Sprite < Sprite
  #--------------------------------------------------------------------------
  def initialize(bitmap)
    view = Viewport.new(0, 0, 680, 480); view.z = 9000
    super(view)
    unless bitmap.nil?
      self.bitmap = bitmap; w, h = bitmap.width, bitmap.height
      self.src_rect.set(w / 2, 0, w / 2, h)
      self.x, self.y = ARROW_LOC[0] - (w / 2), ARROW_LOC[1] - (h / 2)
      self.x = (w / 4) if self.x < 0
      self.y = (h / 2) if self.y < 0
      self.x = 680 - (w / 4) if self.x > 680
      self.y = 480 - (h / 2) if self.y > 480
      self.ox, self.oy = w / 4, h / 2
      self.opacity = AROPACIT
    else
      string = "Mis Arrow: \'#{POINT_IMG}\' was not found, be sure that it" +
              "\n is in your Graphics\Pictures folder."
      print("#{string}")
    end
    self.visible = false
    update
  end
  #--------------------------------------------------------------------------
  def dispose
    self.bitmap.dispose unless self.bitmap.nil?
    super
  end
end

$wig_mission_arrow = true

"Mission Arrow"
[You must be registered and logged in to see this image.]

[You must be registered and logged in to see this link.]

Support


Post any suggestions for future updates or any errors you may encounter here.

Known Compatibility Issues
none that i know of.

Restrictions
DO NOT post this on any other forum with out my permission, you are free to edit this in anyway for YOUR use only.
EVENTALIST
Show Signature
EVENTALIST
C.O.R.N.
C.O.R.N.
#2 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

BluE

BluE
C.O.R.N.
C.O.R.N.
C.O.R.N.
profile
this is like in all those car games where you need to go to a place yeah? REALLY cool.... Like.....REALLY
C.O.R.N.
Show Signature


Want a real challenge? Try [You must be registered and logged in to see this link.]

If you read this message, please PM me. this is a test. And I'm serious, this isnt just some lousy time wasting paragraph that I wrote just to fill in my signature. It's here for a reason. PM ME.
C.O.R.N.
http://51s-seedy-masteroogway.blogspot.com
EVENTALIST
EVENTALIST
#3 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
Thanks blue, im using it in my game, its for your active missions so you can find them easier.
EVENTALIST
Show Signature
EVENTALIST
C.O.R.N.
C.O.R.N.
#4 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

BluE

BluE
C.O.R.N.
C.O.R.N.
C.O.R.N.
profile
yeah that would help alot. It wouldn't be too great if you got lost or something.
C.O.R.N.
Show Signature


Want a real challenge? Try [You must be registered and logged in to see this link.]

If you read this message, please PM me. this is a test. And I'm serious, this isnt just some lousy time wasting paragraph that I wrote just to fill in my signature. It's here for a reason. PM ME.
C.O.R.N.
http://51s-seedy-masteroogway.blogspot.com
EVENTALIST
EVENTALIST
#5 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
true that, and i always wanted a script that did this, but i couldn't find one, now that i can make scripts i just wrote it.
EVENTALIST
Show Signature
EVENTALIST
C.O.R.N.
C.O.R.N.
#6 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

BluE

BluE
C.O.R.N.
C.O.R.N.
C.O.R.N.
profile
Lol. Try making it with events
C.O.R.N.
Show Signature


Want a real challenge? Try [You must be registered and logged in to see this link.]

If you read this message, please PM me. this is a test. And I'm serious, this isnt just some lousy time wasting paragraph that I wrote just to fill in my signature. It's here for a reason. PM ME.
C.O.R.N.
http://51s-seedy-masteroogway.blogspot.com
EVENTALIST
EVENTALIST
#7 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
i did, never worked out the way i wanted it to.

but that was a while back, i bet i could now if i wanted too.
EVENTALIST
Show Signature
EVENTALIST
C.O.R.N.
C.O.R.N.
#8 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

BluE

BluE
C.O.R.N.
C.O.R.N.
C.O.R.N.
profile
challenging isn't it?
C.O.R.N.
Show Signature


Want a real challenge? Try [You must be registered and logged in to see this link.]

If you read this message, please PM me. this is a test. And I'm serious, this isnt just some lousy time wasting paragraph that I wrote just to fill in my signature. It's here for a reason. PM ME.
C.O.R.N.
http://51s-seedy-masteroogway.blogspot.com
Administrator
Administrator
#9 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
@wiggles - this will go great with any ABS! Thanks for sharing!
whether it's event commands or script, you never cease to make it more fun ^,^
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Poster Mcposty
Poster Mcposty
#10 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

MotionM

MotionM
Poster Mcposty
Poster Mcposty
Poster Mcposty
profile
Really great script. Kudo's mate.
Poster Mcposty
Show Signature


[You must be registered and logged in to see this link.]
^Want the above userbar in your profile? Here's the code.
Code:
 [img]http://img718.imageshack.us/img718/7481/gfuserbar.jpg[/img][/URL]



View my blog, [You must be registered and logged in to see this link.]

Want a certain music album or game reviewed? Send me an Email at [You must be registered and logged in to see this link.]!

[You must be registered and logged in to see this image.]: MShinigaki
Add me for some League of Legends fun!
Poster Mcposty
https://www.dropbox.com/sh/l3s9sn0nmkaxmy7/Lrut_zZyWd http://motionmreview.blogspot.com/ https://twitter.com/_motionm
ACTIVATED
ACTIVATED
#11 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

Ragnai

avatar
ACTIVATED
ACTIVATED
ACTIVATED
profile
Really nice! After the first few seconds I knew it could make good use in my project. One thing that bugs me though is that the arrow can't make the difference between: upper-right and lower-right, couldn't you split up the charset so we could add those directions? Or 'simply' use a picture which is rotating if it doesn't consume too much resources.

Thanks in advance and thanks for the script!
ACTIVATED
Show Signature
ACTIVATED
EVENTALIST
EVENTALIST
#12 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
i can look into those additions and i my self thought that would be a nice addition, when i find the time i will try to add those updates.
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
#13 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

Ragnai

avatar
ACTIVATED
ACTIVATED
ACTIVATED
profile
Thanks in advance, I'm looking forward to it (:
ACTIVATED
Show Signature
ACTIVATED
EVENTALIST
EVENTALIST
#14 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
So, thanks to blue's catalog i see i forgot about this one...
I'm gonna try to get your request filled in the NEAR future.
EVENTALIST
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
#15 RMXP- Mission Arrow Empty Re: RMXP- Mission Arrow
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
* updated script *

@Ragnai - Hope you still come here, sorry about the long wait. :S
EVENTALIST
Show Signature
EVENTALIST

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 1]

 

Chatbox system disabled
Personal messaging disabled