It doesn't have to be a very comprehensive list, but I am hoping that it can be CASE INSENSITIVE. IE Ralph == ralph == RaLpH etc. It does NOT need to use Regular Expressions or anything so complicated.
The closest thing I can compare it to is PHP's in_array() or substr() functions.
For example, in PHP it would be like this:
$profane_names = array('Penis','Groin','CrotchFruit');
$name = Penis
if in_array(strtolower($name))
{
return TRUE;
}
Im also hoping that it could match substrings. For example, say COOT was a bad word, the name COOTY would be not allowed. Of course, that is just an example. Need the Case Insensitive part like bad tho!
Im limiting the Name to 5 Characters, so yes, I know CrotchFruit won't fit, and since its not really that big of a deal, I don't really care if the Player decides creative workarounds. Im just going for the obvious ones. 5 Letter ones and shorter. Bitc*, Cu**, Whor*, etc. without touching George Carlin's fav 7 of the worst of the worst to try to keep my examples of profanity to at least moderate levels.
Basically, what I want to do is flat out PUNISH the player for the first hour or so of the game (which I already put the dialouge in the events) for picking an absolutely obvious douchebag name by having other characters being excessively rude to the Player (not the character) by saying stuff like "What kind of a name is \n[1]?", then ending the game without warning when another character that is supposed to Join the Party decides that they dont want anything to do with anyone with one of those names and telling them "Your story ends here, \n[1]".
I apologize for the examples of the profanity that I used, however, I believe that I am not the only one who thinks that any game they make gets ruined when players are allowed to name their characters inappropriately, but would still like for the players to have the option of picking their characters names. Its one thing to name your character "Mario" or "Luigi", but when players enter (well, just use your imaginations) in a fantasy enviornment, it detracts from the immersion factor and comprimises our efforts at a storytelling experience. Thus, I want to make the punishment of the player a semi enjoyable experience, but point out to them that this is not the way I intend for the game to be played. That way I don't alienate the audience, but it provides a totally different and much shorter experience.
Test this script and tell me if it goes well and is what you want.
#==============================================================================
# Banned words
# 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 true
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
Do what you want, but if you're really that concerned about it, why make the character nameable at all?
You might as well add in any girl names to the list (if the character is male, which I am assuming) and any other sort of insults such as "loser" or "retard". By the time you got rid of any *IMMERSION BREAKING* names, you might as well have just made a pre-approved list of names the player could use.
Fuck, The Legendary Lone Swordsman!
And his evil, robotic brother ... P3n0r?
To be honest, there's just too many ways to get around such a script. There's also swear words from other languages to take into account as well. Plus, if they were truly hardcore, they could just import the Actors.rvdata in another project or otherwise edit the name.
People are going to do what they want if they want to do it. It's best to just shrug and let them have their fun.
EDIT : That said, good work on quickly writing up a script to help, gerkrt. Although I disagree with banning names, I don't want to diminish the help that was offered.
Wouldn't it be easier to store the banned names in an array though?
Not that it really matters, I'm just insane.
Quote from: Exhydra on July 12, 2011, 09:25:39 PM
And his evil, robotic brother ... P3n0r?
To be honest, there's just too many ways to get around such a script. There's also swear words from other languages to take into account as well. Plus, if they were truly hardcore, they could just import the Actors.rvdata in another project or otherwise edit the name.
People are going to do what they want if they want to do it. It's best to just shrug and let them have their fun.
EDIT : That said, good work on quickly writing up a script to help, gerkrt. Although I disagree with banning names, I don't want to diminish the help that was offered.
I think his idea is to can react to actors names, in a funny or interesting way, i dont see why its bad this or anybody will make that to evade it.
Yeah, I guess I misread the reason he had listed for wanting the script to begin with.
However, people get their fun in different ways, so if they want to name their character a bad word, then they should be able to have it. Which they can with this script, but it comes along with a punishment ... which they might find amusing in itself. Or they might find it annoying and close the game, who knows.
Anyway, the player has to want to be immersed in the game to begin with ... it's not something you can really force on them.
You can give the player the option to choose a name among small selection.
It does gives a different feeling, but I think it's a nicer way to control the name than allowing the player to enter any which name and then saying that's not allowed whether blacklisting or whitelisting is used.
You can also allow the player to choose certain characteristics of the actor and then generate/specify (depending on the number of possible options) a name to reflect those choices. This do put pressure on you to actively use the information in game, so you may not feel the extra burden is worth it.
*hugs*