Tsukihime

Actor creation system

109 posts in this topic

Actor creation system

Author: Tsukihime

 

Lx9bn.jpg

 

Overview

 

This script provides basic functionality for creating new actors during the game.

 

Features

  • Add or update an existing actor
  • Create completely new actors
  • Choose your own actor face, character sprite, and class
  • Choose how to distribute bonus stats
  • Choose a name for your new actor
  • Easily customize your face/classes/character sprite choices
  • Lock or unlock classes from being selected

Usage

 

Actor creation is accessed via script call

 

SceneManager.call(Scene_ActorCreate)

 

If you want to modify an existing actor, you must prepare the scene with an extra call

 

 
SceneManager.scene.prepare(actor_id, class_fixed?, face_fixed?, char_fixed?)

 

The actor ID must be one of the actors that are currently in the game.

The rest of the arguments are for locking fields from editing.

 

So for example if you want to prevent the user from changing class, face, and character sprite, you would say

 

SceneManager.scene.prepare(actor_id, true, true, true)

 

You can lock or unlock classes with the following script calls

 

 
$game_system.lock_class(n)
$game_system.unlock_class(n)

 

Where n is the class ID.

 

In the actor information screen, you can specify details about your new actor, distribute bonus stats, and choose a name.

 

At the top of the script there is some configuration. In particular, if you want to add more faces and character sprites, you just have to add the filenames to the lists. Note that I'm assuming you're using Ace's 4x2 sprite sheets.

 

You can also specify how much bonus stats actors start with.

 

Downloads

 

Script: http://db.tt/PcZ84zgR

Required: Custom Database

 

Notes

 

If anyone can draw a better scene that would be great.

 

I'm planning to add some more options like selecting some extra starting features for your new actor.

Edited by Tsukihime
2Late, Jester, Wren and 3 others like this

Share this post


Link to post
Share on other sites

This is cool. It would be even better if you could somehow integrate the character generator.

 

Would be great for RPG's where player choice means everything.

Share this post


Link to post
Share on other sites

Can you make option disable parts of this? I don't want the player be able to change the face and sprite but the rest are awesome.

Share this post


Link to post
Share on other sites

I was thinking of making this a character generator where you can "lock" certain fields.

So like if you were recruiting a key character in the game, you would lock his face/sprite/class/name but allow customization for stat bonuses and stuff.

Share this post


Link to post
Share on other sites

It should when I go and make the face/char drawing functions check the filename to determine whether you're using the Ace standard 8 sets per sheet or just 1 set per sheet.

 

But you can always re-arrange them into 8 chars per sheet.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

I just want that locked fields thing, can't have people changing the faces of my main characters, lol

 

This script has a lot of potential, it just needs some work. But when your done, it's going to be awesome, :)

Share this post


Link to post
Share on other sites

Script updated.

 

1. you can lock fields now and also specify which actor to update.

 

To lock a field, you must first "prepare" the scene.

You can pass in 0 for the actor_id if you want to lock fields for the new actor.

 

SceneManager.call(Scene_ActorCreate)
SceneManager.scene.prepare(actor_id, class fixed, face fixed, char fixed)

 

The actor creation window (now also an actor update window) will automatically update itself to the specified actor information. You can update your actor's information such as stat distribution if you have any bonus points. You can choose to change the class as well if you want.

 

By default, if you pass in an existing actor ID, all fields are locked.

 

Upon saving, all of the information will be written to your game actor.

 

If no actor ID is provided, then it will assume you're creating a new actor.

 

aKwJ7.jpg

 

2. Stat distribution

 

This is a fairly simple stat distribution system that uses bonus points. It is not really meant for anything other than custom characters. Since the focus of this system wasn't really a stat distribution system I just used bonus points.

 

3. Class changing

 

This system also provides a built-in class changing feature so if you want to change your actor's class, you can do it here. If you don't want class changing then just lock the field.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Sweetness! Is there a way to lock specific classes out from being selected?

 

There's a section of my game where the Main Character has to make that choice, so it would be great, :)

 

If not, could you add it? Would be amazing, :D

Share this post


Link to post
Share on other sites

Updated.

 

Just use the following script calls

 

$game_system.lock_class(n)
$game_system.unlock_class(n)

 

Where n is the class ID.

 

Note that this is a global class lock and not specific to actors. I haven't thought of a good way to set that up yet simply because if you're creating arbitrary characters in-game, you don't exactly have the liberty of note tagging objects that aren't accessible in data-manager.

 

Maybe I'll base it on classes rather than actors, so for example if you choose to be a Monk...then you can only change to classes that a Monk can change to.

 

Obviously note-tagging wasn't an issue for standard RPG maker scripts because all of the data you're working with is predictable and fully in your control, but with the introduction of custom data...we suddenly have a whole new set of issues to consider.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

That's alright, it's really the only instance I need to use your system (I'm keeping all of the other actors pre-set), so it doesn't matter if it's global.

 

Thanks Tsuki!

Edited by Niko Jose DelValle

Share this post


Link to post
Share on other sites

Is it possible this could set the player's stats to 1 and pool in the numbers of their stats to the bonus, so that they could use those points to build the stats?

Share this post


Link to post
Share on other sites

I can give you two modes to choose from: class defaults, or your defaults.

 

Class default means it follows the class levels.

Your default means you specify the base stats (regardless of level). Maybe higher levels have more bonuses.

 

Anyways, do you mean you want say, 100 bonus points by reducing all of the non-HP/MP stats to 1?

Share this post


Link to post
Share on other sites

Precisely. HP and MP would be locked and I'd use custom formula after this, however I was thinking more of reducing all the stats to 1 base and giving, the ammount to the pool how much you can use.

 

 

Say, you had attack of 50 and defense of 30, you'd get 80 points from that, plus the 20 from agi and so on.

Share this post


Link to post
Share on other sites

Hmm there might be a problem with reducing stats to 1.

 

Here's how stats are calculated:

 

(base stats + (param plus + <bonus from custom scripts>)) * stuff about rates

 

param plus is stats from features and stuff, and I've conveniently bundled my bonus stats on top of that.

 

The problem now is that "base stats" are generated from the class base stats for your level (that's what the stats curves are for).

 

I can rewrite the base stats to go back to 1, and then dump the class base stats into that bonus pool, but that's pretty much overwriting shared classes which may conflict with existing scripts that rely on the correct base stats.

 

And then what happens when you level? Should all of those stats be tossed in the stat pool? It can easily go up into thousands of bonus points, and allocating them is quite tedious in general since it's one point at a time.

 

I'd rather leave the level 1 stats as they are and then just dump all later stats into the bonus pool.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Quick question. How would I go about removing a created actor from the party when talking to an event, THEN have that event look like said actor and save the actor info so if you decide you want that actor back, walk up to him/her and talk. Then the event reverts to another graphic. Is this easily done?

Share this post


Link to post
Share on other sites

I would create a new event completely based on the actor you just removed and give it some event commands to talk to you and ask to join your party.

 

But that would be a different script.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Well, I was hoping to have the game start at a Tavern and it starts as a story being told. You 'fill out' the heroes that are present, each in different parts of the tavern and as you play, you could talk to them to have them join. So, the guy by the fireplace the first time you play is a mage, but the next time you make him as a fighter (anyone by the fireplace starts with high resistance to Fire, so it kinda matters who is where).

 

Hmm, any ideas or do I need another script?

 

EDIT: Not sure I explained it right, lol. Anyone get what I am trying to do?

Edited by Juan Alvarado

Share this post


Link to post
Share on other sites

Works great...but how do I remove a party member that is created, how do I select that one. I erased all the party members but the first, then I had it create an actor and I assumed it would be actor 2 so the event would change, but it did not. How do I target that created actor? Is there a script to remove those actors?

Share this post


Link to post
Share on other sites

I believe there aren't any scripts yet despite all of the strong scripts developed within a few months after the engine's release. At least, on these forums, I think custom data is a relatively feature in Ace.

 

Because you cannot predict what someone might do (eg: I might create 20 actors), it's hard to come up with good events that will do exactly what you want the game to do.

 

I've been writing a lot of scripts with this in mind and provide options for change-by-ID or change-by-party-position.

 

As for why it didn't work, there are two sets of data as far as the engine is concerned:

 

$data_actors

$game_actors

 

The first one is the content you put in the database.

The second is the list of actors that are currently in the game.

 

By default, each ID in $game_actors corresponds to the same ID in the database. Which makes sense; if Ericalways changed places, you'd be doing a lot of work just to keep track of where he is. And what if I had multiple actors named Eric? Then you really don't have a way to figure out which actor is the actual Eric you want to target.

 

My design simply extends this idea by appending all new actors to the end of the database. So if you had 10 actors in your database, then your newly created actor will be #11.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Could you give me an example of how to use this

 

SceneManager.call(Scene_ActorCreate)

SceneManager.scene.prepare(actor_id, class fixed, face fixed, char fixed)

 

If I wanted to have the 5th actor, a warrior, with face warrior.png and character $CharBaseMale (using victor visual equip), how would you write this?

also, could you call and have more than one actor 5 in a team?

 

Also, using your current scripts, I am getting an error after pressing yes. Some problem with Game_actor (equipment) line 114-126 or something. It is a comparison of 'size' with the nil class.

I have the two scripts you have required at the top of my script list (in materials) with the custom database first.

Could the error have something to do with using Yanfly-Equip Engine?

 

thanks

Edited by DisturbedInside

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.