Hey I was wondering if anyone knew of or was willing to write a script for random name generation for actors (enemies would be cool too). I have a script made by Logan Forrests, and it does generate random names for actors through the name input process, but I need to be able to apply a random name through a script call or similar method. Any help would be appreciated greatly.
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
Hey DivineJoker:
I whipped this up a little while ago. This will use script calls to rename actors random names. However, the enemy part doesn't work just yet. Give me a while and I'll see if I can't fix it. Or maybe someone will take it and fix it before then. At any rate. Here it is:
randomnamer
Code:
# Random Namer
# By: Ixfuru
# 9/1/12
################################################################################
# This script renames actors and enemies with a script call.
# $game_actors[x].random_male_actor_name
# or
# $game_actors[x].random_female_actor_name
# Or you can replace $game_actors[x], with $game_party.members[x] to name the
# member in the party in the x position. 0 is the leader.
# Replace x with actor's id from the database. Replace string with whatever
# you wish to rename the actor.
# Troop names will be changed automatically based on random enemy names
# you supply.
#
# To change the original database name of the enemy, you'll need to set
# up the RANDOM_ENEMY_NAME hash in the configuration section.
################################################################################
# Place above Main, below materials.
# Credit Ixfuru
################################################################################
#The following array is used to store enemy ids. These are enemies,
# which will be given random name from onset of the game when they are first
# created. Just place their database ids in the array.
# END CONFIGURATION SECTION
################################################################################
module RPG
class Enemy
include RandomNamer
alias rn_rpge_initialize initialize unless $@
def initialize
rn_rpge_initialize
for enemy in TROOP_NAMES
TROOP_NAMES.include?($data_enemies[enemy])
new_name = rand(TROOP_NAMES.size - 1)
@name = TROOP_NAMES[new_name]
end
end
# !!!overwrites the make_unique_names method!!!
################################################################################
class Game_Troop
include RandomNamer
def make_unique_names
for enemy in members
next unless enemy.exist?
next unless TROOP_NAMES.empty?
n = @names_count[enemy.original_name]
n = 0 if n == nil
enemy.letter = TROOP_NAMES[n % TROOP_NAMES.size]
@names_count[enemy.original_name] = n + 1
end
for enemy in members
n = @names_count[enemy.original_name]
n = 0 if n == nil
enemy.plural = true if n >= 2
end
end