RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Self switch control

0 Members and 1 Guest are viewing this topic.

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
TDS Self switch control
Version: 1.0
Author: TDS
Date:Jul 5 2008

Version History


  • <Version 1.0> 07.05.2008 Release

Description



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

Features

  • Turns self switches on and off with a simple call script
  • Allows you to control self switches from events on other maps


Instructions

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

Code: [Select]
control_self_switch(map_id, event_id, self_switch, value)


  • map_id = ID of the map where the event is
  • event_id = ID of the event you wish to use
  • self_switch = Self switch to change value('A', 'B', 'C', 'D')
  • value = true or false

Example:
Code: [Select]
control_self_switch(1,  2,  'A',  true)


Script


Code: [Select]
#=============================================================================
# ** 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


  • TDS

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.

*****
Rep:
Level 88
Oh wow. This is insanely helpful for me. I was actually about to look for something like this.

Awesome work, TDS.

**
Rep:
Level 84
~Chase Leader~
Awesome script, I already have some great ideas for it.
(I am new to scripting so something SIMPLE like this is awesome to me)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
This script looks nice. Good work TDS