Difference between revisions of "High-Level Character Generation"
(added forum thread) |
m (moved Character Generation at a level Higher than 1 to High-Level Character Generation: Sounds better) |
(No difference)
|
Revision as of 20:11, 13 October 2010
Note: This is a draft. Let me know on the BSN forum thread if these don't work or I'm unclear on what must be done.
BSN thread: http://social.bioware.com/forum/1/topic/71/index/5020925
Contents
Introduction
In the Awakening and post-Awakening DLC, anyone who created a new character may have noticed that the character generation screen didn't start at level 1. With this tutorial, custom modules made by players will be able to have similar funtionality.
Creating the scripts
First, it is very important that you DUPLICATE the important core scripts. By creating your own scripts, you won't have to worry about screwing the official campaign or other modules.
The scripts that must be duplicated for this tutorial: - module_core - sys_chargen_h - sys_chargen
If you already have duplicates of these for other systems/tutorials (such as the background tutorial), make your edits in those files.
When you duplicate the files, make sure that the names are unique while still naming their purpose for easy editing. For example, you might add a module-specific prefix: - scar_module_core - scar_sys_chargen_h - scar_sys_chargen
Editing the sys_chargen_h file
The first thing you want to do is avoid duplicate functions, as this confuses the compiler. You won't need or want to edit every function, so at the top of the file place another include:
- include "sys_chargen_h"
For this tutorial, you can delete everything except the "Chargen_InitializeCharacter" function. (Leave any functions that you may have edited, but don't forget to integrate them when necessary.)
Next you need to create a new name for this function. I suggest the prefix you used for the script files:
scar_Chargen_InitializeCharacter
Near the top of the function you should see a group of lines that look like this:
// ------------------------------------------------------------------------- // 2. Set Creature to Level and Experience 0 // ------------------------------------------------------------------------- SetCreatureProperty(oChar,PROPERTY_SIMPLE_LEVEL,1.0f,PROPERTY_VALUE_BASE); SetCreatureProperty(oChar,PROPERTY_SIMPLE_EXPERIENCE,0.0f,PROPERTY_VALUE_BASE);
Set the level and XP to the appropriate values for your starting level. (You can give less XP, forcing a character to gain that extra XP before leveling. This does not affect companions.)
You also need to find this group:
// ------------------------------------------------------------------------- // 6. Set up points available to distribute (skills only on humanoids) // ------------------------------------------------------------------------- if (IsHumanoid(oChar)) { SetCreatureProperty(oChar,PROPERTY_SIMPLE_SKILL_POINTS, 1.0, PROPERTY_VALUE_BASE); } SetCreatureProperty(oChar,PROPERTY_SIMPLE_ATTRIBUTE_POINTS, 5.0, PROPERTY_VALUE_BASE); SetCreatureProperty(oChar,PROPERTY_SIMPLE_TALENT_POINTS, 2.0, PROPERTY_VALUE_BASE);
And set the values to the appropriate level (or give more/less that usual for certain modules.)
Editing the sys_chargen file
Now that the include file is created, open the sys_chargen file. Make sure that you have both chargen includes. For example:
- include "sys_chargen_h"
- include "scar_sys_chargen_h"
This will keep normal functions from breaking.
Find and replace all "Chargen_InitializeCharacter" functions with your custom function. This will start your character at the appropriate level.
There is a bug that occurs during "Quick-Start" unless another step is taken. Find all instances of "AL_DoAutoLevelUp". (There should be two in an unedited file.)
The function that causes the problem looks like this:
AL_DoAutoLevelUp(oChar, TRUE, TRUE);
Either set both trues to falses or copy/paste the other function to this space.
Editing the module_core
The home stretch. Now we have to associate the module chargen script with our custom script.
Near the bottom of an unedited script, you should find:
// ----------------------------------------------------------------- // Handle character generation events sent by the engine. // ----------------------------------------------------------------- if ((nEvent >= EVENT_TYPE_CHARGEN_START && nEvent <= EVENT_TYPE_CHARGEN_END) || nEvent == EVENT_TYPE_PLAYERLEVELUP ) { HandleEvent(ev, R"sys_chargen.ncs"); }
Switch the script handling the event to your custom script.
Calling the custom module script
For those who don't know, a module script now must be associated with the module itself. This is done through [File->Manage Modules->Poperties]. Make sure you have your module selected before you hit properties.
Underneath the module name, there should be a parameter named "Script". Enter the browser and select your custom module_core script. Once you're finished eidting the module, click OK.
Final steps
Unless you already have the function in your module_core, you need to actually run character generation.
Under "EVENT_TYPE_MODULE_START", add these lines:
PreloadCharGen(); StartCharGen(GetHero());
Export and Test
Make sure you save each file along the way, and compile all scripts once finished. Export the scripts and play your module. You should begin character generation at the appropriate level.