Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Print Page - Self switch control

The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: TDS on February 03, 2009, 11:37:58 PM

Title: Self switch control
Post by: TDS on February 03, 2009, 11:37:58 PM
TDS Self switch control
Version: 1.0
Author: TDS
Date:Jul 5 2008

Version History




Description




Just a simple script that allows you to control self switches of events even if they are on other maps.

Features



Instructions

Put this in a call script to use the effect of the script.

control_self_switch(map_id, event_id, self_switch, value)



Example:
control_self_switch(1,  2,  'A',  true)


Script




#=============================================================================
# ** TDS Self Switch Control
# Version: 1.0
#------------------------------------------------------------------------------
# This script allows to change more easily the state of a self switch in events
# even if they are not on the current map.
#==============================================================================
# WARNING:
#
# Do not release, distribute or change my work without my expressed written
# consent, doing so violates the terms of use of this work.
#
# * Not Knowing English or understanding these terms will not excuse you in any
#   way from the consequenses.
#
# * This applies to all of my work whether they have thiss notice or not.
#
# Contact Email: Sephirothtds@hotmail.com
#==============================================================================

 #--------------------------------------------------------------------------
 # * Control Self Switch
 # map_id : ID of map
 # event_id  : ID of event
 # self_switch   : Self switch ( 'A', 'B', 'C', 'D')
 # value : Set value of activation (True or False)
 #--------------------------------------------------------------------------
 def control_self_switch(map_id, event_id, self_switch, value)
key = [map_id, event_id, self_switch]
$game_self_switches[key] = value
$game_map.refresh
 end


Credit




Support



On this topic.

Known Compatibility Issues

None that I'm aware of.

Demo



None needed unless someone finds it too hard to understand the script.

Author's Notes



Enjoy.

Restrictions

Free to use on any project with proper credit.
Title: Re: Self switch control
Post by: Revo on February 03, 2009, 11:49:39 PM
Oh wow. This is insanely helpful for me. I was actually about to look for something like this.

Awesome work, TDS.
Title: Re: Self switch control
Post by: Chase_Leader on February 05, 2009, 12:57:25 PM
Awesome script, I already have some great ideas for it.
(I am new to scripting so something SIMPLE like this is awesome to me)
Title: Re: Self switch control
Post by: modern algebra on February 05, 2009, 05:33:02 PM
This script looks nice. Good work TDS