RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

Actors name control

Started by gerkrt, July 14, 2011, 06:13:23 PM

0 Members and 1 Guest are viewing this topic.

gerkrt

This script let you check if actors names have banned words in they.

#==============================================================================
# Actors name control
# By gerkrt/gerrtunk, Heretic86(Idea)
# Version: 1.0
# License: MIT, credits
# Date: 12/07/2011
# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
# script check here: http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================

=begin

------INTRODUCTION------

This script let you check if actors names have banned words in they.

-------INSTRUCTIONS---------

Add any new words in Banned_words list, adding a , 'X' each time.
The switch is actived when the scripts call found what where seeking.
Note that yu can use the scripts in a conditions and efects.

is_banned?(actor_id): Call script that check if the actor have a  banned name.
  is_banned?(1) --> check for alexis actor id 1
 
is_word?(actor_id, word): Call script that check if the actors name is the word.
  is_word?(1, 'Wep')  --> check for alexis actor id and the word 'Wep'

Note that this script is case unsesitive.
=end

module Wep
  Banned_words = 'Wep', 'Joan', 'melodic'
  Switch_for_banned = 1
end

class Interpreter

  #--------------------------------------------------------------------------
  # * Is banned?
  #--------------------------------------------------------------------------
  def is_banned?(actor_id)
    for bw in Wep::Banned_words
      if bw.upcase == $game_actors[actor_id].name.upcase
        $game_switches[Wep::Switch_for_banned] = true
        return truerir
      end
    end
    return false
  end
 
  #--------------------------------------------------------------------------
  # * Is word?
  #--------------------------------------------------------------------------
  def is_word?(actor_id, bw)
    if bw.upcase == $game_actors[actor_id].name.upcase
      $game_switches[Wep::Switch_for_banned] = true
      return true
    end
    return false
  end
   
end