Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Random extra Actor Names (RMXP)

Save-Point

Full Version: Random extra Actor Names (RMXP)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to create a random NPC generator, like on the websites, and I want to use the RPGXP engine to do it. Here's what I'm looking for specifically....


Here's what I'd like... a script that takes an array of names, and when a script call is done, it will automatically change a specific actor's name to one of the random names. This way, when I'm displaying a message on screen about that NPC, I can simply type a message like...

First name: \n[50] Last name: \n[51]

or...

First name: \n[52]\n[53] Last name \n[54]\n[55]

...

as in the case of prefixes and suffixes. This might seem kinda of weird as to why I'd be wanting to do this, but it does have RPGXP implications as I'd like to use it to create a bounty system, much like in the old Freelancer games, where the bounty name was random each time, and simply increased the level of the enemiy and bounty price each time you faced a new bounty system, I plan to use it in a never ending questing RPG (you know, the kind that don't end when the storyline does?)

I'd rather use the array vs an event system that does the random variable and...

@>Conditional Branch: Variable [51:First Name] == 1
@>Change Actor Name: [First Name] , 'Aarlen'
@>
: Branch End


EDIT: Fixed it myself (Resolved)

I am definitely not a scripter, that's for sure, but after plucking away at a few things, I came up with this basic version of it... I just create this new script above MAIN, in which I do a simple define, create an array, do the random of 0-5 (which becomes 1-6) for the array. Then I use the package actor names of 52, 53, and 54 to hold the random bits and pieces... Future versions will allow for prefix/suffixes, Last names and more. So far it works without a bug.

def name_actors
$FirstNameArray = ["Eric", "Mavon", "Rechard", "Zachary","Tunis","Terran",]
nm1=rand(5)+1
nm2=rand(5)+1
nm3=rand(5)+1
$game_actors[52].name = $FirstNameArray[nm1]
$game_actors[53].name = $FirstNameArray[nm2]
$game_actors[54].name = $FirstNameArray[nm3]
# Etc
end