Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Do $something if inside an Area, automatically turns a switch ON when getting inside an area
bulletxt
post Feb 14 2009, 05:34 PM
Post #1


Level 7
Group Icon

Group: Member
Posts: 92
Type: None
RM Skill: Undisclosed




Do $something if inside an Area




Version: 0.3
Date: 12/12/2008
Author: Bulletxt
Editor: Enelvon

This is a script that will avoid you some crazy eventing system. What does it do? Very simple: create an Area in map, when Player gets inside it will turn a specific switch for it to ON. When getting out it will turn the switch to OFF. You can have illimited areas in map and each area will have its own switch id. After the switch goes ON, you already know an event can manage it and do anything you want!
With some imagination and skills, this script will really let you do a lot of things.
The script can also be turned ON/OFF in any moment through a switch. It is suggested to turn it OFF in maps that do not require this script.



The Script (thanks to Enelvon for updating the code): here

Let me know any issues,
Cheers happy.gif

This post has been edited by bulletxt: Feb 20 2009, 09:20 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Michael
post Feb 14 2009, 07:14 PM
Post #2


Level 33
Group Icon

Group: Revolutionary
Posts: 838
Type: Writer
RM Skill: Skilled




Thank you, I find this very useful. Also, maybe you should make it more advance and change some things on it!
Go to the top of the page
 
+Quote Post
   
bulletxt
post Feb 14 2009, 08:14 PM
Post #3


Level 7
Group Icon

Group: Member
Posts: 92
Type: None
RM Skill: Undisclosed




QUOTE (UltiHaker @ Feb 14 2009, 07:14 PM) *
Thank you, I find this very useful. Also, maybe you should make it more advance and change some things on it!


Give some suggestions then to make it more "advanced" wink.gif Tell me what would you like to be implemented!

This post has been edited by bulletxt: Feb 14 2009, 08:23 PM


__________________________
Go to the top of the page
 
+Quote Post
   
Jeffsun
post Feb 16 2009, 10:24 PM
Post #4


Level 2
Group Icon

Group: Member
Posts: 19
Type: Event Designer
RM Skill: Skilled




looking back at what i posted at 11:24 pm, i feel like a newb again. so i erase. biggrin.gif

This post has been edited by Jeffsun: Mar 29 2009, 07:02 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Oralom
post Feb 20 2009, 07:35 AM
Post #5


Level 3
Group Icon

Group: Member
Posts: 34
Type: Event Designer
RM Skill: Beginner




I'm having a bit trouble getting it to work. I don't think I'm naming the area correctly. Do I name it "<switch 100>" or "Area Event" (which is what switch 100 is called in my project)?
Go to the top of the page
 
+Quote Post
   
bulletxt
post Feb 20 2009, 09:17 AM
Post #6


Level 7
Group Icon

Group: Member
Posts: 92
Type: None
RM Skill: Undisclosed




QUOTE (Oralom @ Feb 20 2009, 07:35 AM) *
I'm having a bit trouble getting it to work. I don't think I'm naming the area correctly. Do I name it "<switch 100>" or "Area Event" (which is what switch 100 is called in my project)?


You name it, for example:

CODE
Forest <switch 100>


This post has been edited by bulletxt: Feb 20 2009, 09:18 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Maliki79
post Mar 3 2009, 09:26 AM
Post #7


Level 3
Group Icon

Group: Member
Posts: 35
Type: Event Designer
RM Skill: Intermediate




Whenever I use this script, I get a really noticeable slow down.
Is there any way to fix this (Or is it something I'M doing)?
Go to the top of the page
 
+Quote Post
   
bulletxt
post Mar 3 2009, 11:02 AM
Post #8


Level 7
Group Icon

Group: Member
Posts: 92
Type: None
RM Skill: Undisclosed




QUOTE (Maliki79 @ Mar 3 2009, 09:26 AM) *
Whenever I use this script, I get a really noticeable slow down.
Is there any way to fix this (Or is it something I'M doing)?


To avoid it, turn off the switch of the script on maps where it's not needed.

Also, try this script version. Download: here

Let me know if this works better (I'm almost sure it won't though). Also, tell me exactly the average of FPS in game with the script ON and OFF.

I'll further investigate this depending on your reply.

This post has been edited by bulletxt: Mar 3 2009, 11:04 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Maliki79
post Mar 3 2009, 12:39 PM
Post #9


Level 3
Group Icon

Group: Member
Posts: 35
Type: Event Designer
RM Skill: Intermediate




QUOTE (bulletxt @ Mar 3 2009, 02:02 PM) *
QUOTE (Maliki79 @ Mar 3 2009, 09:26 AM) *
Whenever I use this script, I get a really noticeable slow down.
Is there any way to fix this (Or is it something I'M doing)?


To avoid it, turn off the switch of the script on maps where it's not needed.

Also, try this script version. Download: here

Let me know if this works better (I'm almost sure it won't though). Also, tell me exactly the average of FPS in game with the script ON and OFF.

I'll further investigate this depending on your reply.


Thanks for the assist!
I'll try it out when I get to my home computer.
But let me let you know what I'm attempting to use this for.
I found a way to enable battles while in a vehicle (info is in my post in the VX Faq section, if you wanna know how I'm doing it)
What I'm looking to do is basically disable the functionality of a given area if you are in a vehicle so that if you are on the boat, you won't have to fight monsters that you'd see on land and even better, be able to lay two areas on top of each other with different troups that you'll only see if on a vehicle.
I don't know if your script could do that, but if you could tweak it, I'm sure many of us would thank you for it!
Go to the top of the page
 
+Quote Post
   
bulletxt
post Mar 3 2009, 04:18 PM
Post #10


Level 7
Group Icon

Group: Member
Posts: 92
Type: None
RM Skill: Undisclosed




QUOTE (Maliki79 @ Mar 3 2009, 12:39 PM) *
QUOTE (bulletxt @ Mar 3 2009, 02:02 PM) *
QUOTE (Maliki79 @ Mar 3 2009, 09:26 AM) *
Whenever I use this script, I get a really noticeable slow down.
Is there any way to fix this (Or is it something I'M doing)?


To avoid it, turn off the switch of the script on maps where it's not needed.

Also, try this script version. Download: here

Let me know if this works better (I'm almost sure it won't though). Also, tell me exactly the average of FPS in game with the script ON and OFF.

I'll further investigate this depending on your reply.


Thanks for the assist!
I'll try it out when I get to my home computer.
But let me let you know what I'm attempting to use this for.
I found a way to enable battles while in a vehicle (info is in my post in the VX Faq section, if you wanna know how I'm doing it)
What I'm looking to do is basically disable the functionality of a given area if you are in a vehicle so that if you are on the boat, you won't have to fight monsters that you'd see on land and even better, be able to lay two areas on top of each other with different troups that you'll only see if on a vehicle.
I don't know if your script could do that, but if you could tweak it, I'm sure many of us would thank you for it!


This script turns a switch ON when you are inside an area and goes off when out of it. This means you can do what you said. You can merge areas. All you have to do is handle things inside events.

This script is simple but powerful. You just need imagination and creativity.


__________________________
Go to the top of the page
 
+Quote Post
   
Jeffsun
post Mar 6 2009, 11:05 PM
Post #11


Level 2
Group Icon

Group: Member
Posts: 19
Type: Event Designer
RM Skill: Skilled




why is it that I have to press menu and refresh the screen before it activates?


__________________________
Go to the top of the page
 
+Quote Post
   
miget man12
post Aug 22 2009, 10:30 AM
Post #12


Making a Comeback
Group Icon

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate




I have a mini bug fix that I'm assuming is the problem that "why is it that I have to press menu and refresh the screen before it activates?" was referring to.
[Show/Hide] Fixed Code
CODE
################################################################################
=begin
Do $something if inside Area

Version: 0.3
Date: 12/12/2008
Author: BulletXt
Email: bulletxt@gmail.com
Editor: Enelvon
Small Bug Fix by Miget man12

=end

################################################################################
# INSTRUCTIONS
# Insert
# <switch ID>
# into the name of any area that uses this script. Replace ID with the ID of the
# switch that the script will turn on.

# Example:  Forest <switch 1>

# CONFIGURATION

#This is the switch that turns ON/OFF this script
#The script is OFF by default, so you must turn it on in an event
#I recommend to turn OFF the script in maps where you don't need this script
#Default is 100

DSIA = 20

# END CONFIGURATION

################################################################################

class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias enelvon_bulletext_area_update update
  def update
    enelvon_bulletext_area_update
    ###########################################################################
#####
    #if the script switch is on
    if $game_switches[DSIA] == true
      for area in $data_areas.values
        area.name.scan(/<switch ([\d]*)>/)
        m = $1.to_i
        if $game_player.in_area?(area)
          #p m
          if $game_switches[m] == false # I put this here to check if it is
                                        # necessary to call the refresh,
                                        # because if the switch is already on,
                                        # there's no point
            $game_switches[m] = true
            $game_map.need_refresh = true # tells $game_map that Events should be  
                                          # refreshed
          end
        else
          if $game_switches[m] == true
            $game_switches[m] = false
            $game_map.need_refresh = true # Events should be refreshed
          end
        end
      end
    end
  end
end
I meant to post this a while ago, but I completely forgot about it biggrin.gif
Also, this doesn't count as a necropost does it? happy.gif

~Miget man12


__________________________
By the way:


I'm bored because it's summer so I decided to drop by for a bit.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th June 2013 - 12:38 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker