Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: gerrtunk on July 14, 2011, 02:13:00 pm

Title: [XP] Actors name control
Post by: gerrtunk on July 14, 2011, 02:13:00 pm
Actors name control
Authors: gerrtunk,gerkrt
Version: 1.0
Type: Misc System
Key Term: Misc System



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



Features
No extra one.


Screenshots
No.


Demo
No.


Script

Spoiler: ShowHide


#==============================================================================
# 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




Instructions
In the script.


Compatibility
No.


Credits and Thanks
No.


Author's Notes

I will add more things when i need them in my projects(or i have time), so it will be updated. Again, feedback, bugs,retc, i will listen.