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.
Soul Engine Ace - Actor Banned Names

0 Members and 1 Guest are viewing this topic.

*
Scripter
Rep:
Level 40
Crownless King
Soul Engine Ace - Actor Banned Names
Version: 2.0
Author: Soulpour777
Date: February 10, 2014

Version History


  • Version 1.0 - Only has in script Banned Names.
  • Version 2.0 - Hash style proposed adding is changed to accessor attribute in game system.

Description


This script allows you to create a list of Banned Names or Words that allows you to create different effects when a banned word is being entered by the player.

Features

  • The game maker can add an array of Banned Names, Swearing Names or Inappropriate Names.
  • Add Banned Names

Instructions

Script Calls:
 
is_actor_banned?(actor_id)
^ check if the actor’s name is banned. e.g. is_actor_banned?(1)
if you wish to print it out on the console, do a script call: p is_actor_banned?(1)
 
banned_word?(actor_id, banned_names)
^ use this script call to check if the actor’s name is the specific word.
eg: banned_word?(1, 'Eric')
if you wish to print it out on the console, do a script call: p banned_word?(1, 'Eric')
 
Script Calls Added in Version 2:
 
$game_system.add_ban_name(name) - Adds a name into the current banned names list.


Script


Code: [Select]
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# SEA - Banned Names
# By: Soulpour777
# Version 2.0
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Version 1 - Only allows in script names.
# Version 2 - Allows in game and in script names
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Description: This script allows you to create a list of Banned Names or Words
# that allows you to create different effects when a banned word is being
# entered by the player.
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Examples:
# 1. Scene Name
# Say for example you are to let the player rename your character and the name
# being entered is banned, you can have this script check that so you can then
# have the player re-enter another name that is not inside the banned names
# list.
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is under Actors / Characters Related Script.
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Script Calls:
#
# Adding A Name:
# $game_system.add_ban_name(name)
# E.g. $game_system.add_ban_name("Eric")
#
# Check if Actor's name is banned:
# is_actor_banned?(actor_id)
# ^ check if the actor's name is banned. e.g. is_actor_banned?(1)
# if you wish to print it out on the console, do a script call: p is_actor_banned?(1)
#
# Check if Actor's Name is Banned with Specific Name
# banned_word?(actor_id, banned_names)
# ^ use this script call to check if the actor's name is the specific word.
# eg: banned_word?(1, 'Eric')
# if you wish to print it out on the console, do a script call: p banned_word?(1, 'Eric')
#
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

module BannedNames
  BannedNamesList = ["Eric", "Joan"]
end

class Game_System
 
    attr_accessor :curr_banned_names
   
    alias gamesystem_init initialize
    def initialize
      gamesystem_init
      assign_names
    end   
   
    def add_ban_name(name)
      @curr_banned_names.push(name)
    end
   
    def assign_names
      @curr_banned_names = BannedNames::BannedNamesList
    end

end

class Game_Interpreter
  def is_actor_banned?(actor_id)
    for banned_names in $game_system.curr_banned_names
      if banned_names.upcase == $game_actors[actor_id].name.upcase
        $game_switches[BannedNames::SwitchForBannedNames] = true
        return true
      else
        return false
      end
    end
  end
 
  def banned_word?(actor_id, banned_names)
    if banned_names.upcase == $game_actors[actor_id].name.upcase
      $game_switches[BannedNames::SwitchForBannedNames] = true
      return true
    end
    return false
  end
 
end



Credit


  • Soulpour777


Support


For any questions, suggestions or comments about this script, please don't hesitate to comment below or PM me here at RMRK. Please be informed that this script is included on Soul Engine Ace, Soulpour777 (me)'s small project, and some of these works as one.

Known Compatibility Issues

- None at the moment


Author's Notes


Sometimes there are names you can't stand...so you ban them.

Terms of Use


All Soul Engine Ace scripts are bound under my terms of use. if any terms of use in RMRK is not located on my terms of use, do remember to add those terms.
« Last Edit: February 10, 2014, 03:33:51 PM by SoulPour777 »


If you like my work, please do support me on Patreon.
https://www.patreon.com/Soulpour777?ty=h

********
Furry Philosopher
Rep:
Level 94
Rawr?
2013 Best RPG Maker User (Creativity)Randomizer - GIAW 11Gold - GIAW 11 (Hard)Secret Santa 2013 ParticipantFor frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Programming)2012 Best RPG Maker User (Mapping)Secret Santa 2012 ParticipantGold - GIAW 9Project of the Month winner for September 2008For taking a crack at the RMRK Wiki2011 Best RPG Maker User (Programming)2011 Kindest Member2011 Best Veteran2010 Most Deserving Of A Promotion2010 Best RPG Maker User (Technical)
Haha. Strangely enough, I can see this script being useful. The grown-up players tend to be more childish at times than actual children are.




*
Scripter
Rep:
Level 40
Crownless King
Haha. Strangely enough, I can see this script being useful. The grown-up players tend to be more childish at times than actual children are.

Thanks! I just am somehow bothered how people name their actors, so to give justice... well xD


If you like my work, please do support me on Patreon.
https://www.patreon.com/Soulpour777?ty=h

*
A-pow 2015
Rep:
Level 81
2014 Best RPG Maker User - GraphicsFor frequently finding and reporting spam and spam bots2013 Most Unsung MemberSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.How can I help you? :Da^2 + b^2 = c^2Secret Santa 2012 ParticipantSilver - GIAW 10Silver - GIAW 9Bronze - GIAW HalloweenGold - Game In A Week VII
I don't really agree with censoring players this way, but I'm sure other people will find it useful.

**
Rep:
Level 56
Dragon agent
I could replicate most of this using regular events, however there's one option that I wouldn't be able to do with events, would be of use to me and isn't in the script. More like two options actually, but second is kinda addition.

First one is that to check if name of actor CONTAINS banned word (both for specific word and for any banned word)
E.g. contains_banned_word?(1, 'Eric') would return true for both Eric and Not Eric.

Now, for the addition thing: It would be cool if you add optional parameter to ignore letter case, so I (or anyone else) won't need to include every possible case of e.g. shit (Shit, shit, SHIT, sHit, shiT, etc.) or any other bad word.
Rave Darkhog Darkhogini. PhD in scamwareology, learned at Stencil University LLC.

**
Rep:
Level 62
RMRK Junior
I don't really agree with censoring players this way, but I'm sure other people will find it useful.

Agreed. And unless there is an instance of catching every spelling and creative acronym, it'll just make players get more creative.

Now, for the addition thing: It would be cool if you add optional parameter to ignore letter case, so I (or anyone else) won't need to include every possible case of e.g. shit (Shit, shit, SHIT, sHit, shiT, etc.) or any other bad word.

Not to mention the creative spellings of the same word:

$hit, S.H.I.T., shhhit...

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Now, for the addition thing: It would be cool if you add optional parameter to ignore letter case, so I (or anyone else) won't need to include every possible case of e.g. shit (Shit, shit, SHIT, sHit, shiT, etc.) or any other bad word.

Looking at the code, it looks like this is already implemented.
Code: [Select]
    if banned_names.upcase == $game_actors[actor_id].name.upcase
This line implies case insensitivity; it checks if the inputted name converted to entirely uppercase is the same as any of the banned names converted to uppercase.
If it's operating with case sensitivity then there's something funky going on.

Not to mention the creative spellings of the same word:

$hit, S.H.I.T., shhhit...

Yeah, the best way to check for that kind of stuff I can think of is through relatively complex regular expressions, which just scare the hell out of people who are unfamiliar with them. Unless you want to come up with something like
Code: [Select]
/([s$])+([ _.,])*h+([ _.,])*[i1!]+([ _.,])*[t4]+([ _.,])*/i
for each word you want to ban, it's just not gonna happen. The particularly grouse players will always find a loophole, anyway. If you don't want to have your players walking around with uncouth names, you're going to have to either use a script like this to do as much as you can to prevent it, or just not allow players the freedom of naming characters.
it's like a metaphor or something i don't know