I can't seem to find any tutorials on this. How do I set a module to start with a specific character I have created? Right now it's just using Jaden as I'm finishing the levels. I need to set a character with gear, skills and stats that I can use to test the areas.
Set starting character for module
Débuté par
Guest_dewkl_*
, mars 29 2010 02:00
#1
Guest_dewkl_*
Posté 29 mars 2010 - 02:00
Guest_dewkl_*
#2
Posté 29 mars 2010 - 04:29
There are instructions on the wiki - look under Character Generation.
#3
Guest_dewkl_*
Posté 29 mars 2010 - 06:09
Guest_dewkl_*
Edit: Solved temporarily by switching out the default character.
For some reason the character is locked in tutorial mode when it starts (level up tutorial), the background music from the character creation doesn't go away and tutorial acts stuck. Here's a screenshot.
I'd just create a character in character creation and use that one if it was possible (just save and load it between testing), but it doesn't seem like areas update (placeables etc) if you are playing with a save from an older area.are-version. Levels do though, but that makes sense.
For some reason the character is locked in tutorial mode when it starts (level up tutorial), the background music from the character creation doesn't go away and tutorial acts stuck. Here's a screenshot.
#include "sys_chargen_h"
#include "utility_h"
#include "sys_rewards_h"
const int FORCE_AUTOLEVEL = 2;
void main()
{
// keep track of whether the event has been handled
int nEventHandled = FALSE;
event ev = GetCurrentEvent();
switch(GetEventType(ev))
{
case EVENT_TYPE_MODULE_START:
{
object oHero = GetHero();
// skip character generation
Chargen_InitializeCharacter(oHero);
Chargen_SelectGender(oHero, GENDER_MALE);
Chargen_SelectRace(oHero, RACE_HUMAN);
Chargen_SelectCoreclass(oHero, class_WARRIOR);
Chargen_SelectBackground(oHero, BACKGROUND_NOBLE);
// give the player some equipment
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_arm_cht_lgt_rlr.uti"));
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_arm_bot_lgt_rlr.uti"));
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_arm_glv_lgt_rlr.uti"));
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_arm_shd_sml_wdn.uti"));
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_wep_mel_lsw_lsw.uti"));
// autolevel
RewardXP(oHero, RW_GetXPNeededForLevel(10), FALSE, FALSE);
SetAutoLevelUp(oHero, FORCE_AUTOLEVEL);
break;
}
}
// if this event wasn't handled by this script fall through to the core script
if(!nEventHandled)
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}I'd just create a character in character creation and use that one if it was possible (just save and load it between testing), but it doesn't seem like areas update (placeables etc) if you are playing with a save from an older area.are-version. Levels do though, but that makes sense.
Modifié par dewkl, 29 mars 2010 - 06:53 .
#4
Posté 29 mars 2010 - 06:45
You could try unchecking Tutorials on the in-game Options screen. At first glance, I can't see anything wrong with your script.
#5
Guest_dewkl_*
Posté 29 mars 2010 - 07:00
Guest_dewkl_*
Seems it was that easy. It solved everything and for some strange reason the background music disappeared (as it should). Thanks.
Now I just have to find out how to set a talent/skill build the character loads with. Make a custom autolevel set or make a script that distributes the skills (if that is even possible without getting into too much)?
Now I just have to find out how to set a talent/skill build the character loads with. Make a custom autolevel set or make a script that distributes the skills (if that is even possible without getting into too much)?
Modifié par dewkl, 29 mars 2010 - 07:46 .
#6
Posté 25 juin 2011 - 10:20
I know it's bad form to necro a post, but this one is so pertinent. I've used a startup screipt from the wiki to either generate or import a character, which works. But I'm also trying to give him a staff, which is not working. ANy pointers for me?
#include "events_h"
#include "global_objects_h"
#include "sys_chargen_h"
#include "utility_h"
void main()
{
// keep track of whether the event has been handled
int nEventHandled = FALSE;
int nImportHero = TRUE;
event ev = GetCurrentEvent();
switch(GetEventType(ev))
{
case EVENT_TYPE_MODULE_START:
{
// preloads resources needed for character generation
PreloadCharGen();
object oHero = GetHero();
// initiates character generation
StartCharGen(oHero, 0, nImportHero);
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_wep_mag_sta_mgc.uti"));
break;
}
}
// if this event wasn't handled by this script fall through to the core script
if(!nEventHandled)
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}
#include "events_h"
#include "global_objects_h"
#include "sys_chargen_h"
#include "utility_h"
void main()
{
// keep track of whether the event has been handled
int nEventHandled = FALSE;
int nImportHero = TRUE;
event ev = GetCurrentEvent();
switch(GetEventType(ev))
{
case EVENT_TYPE_MODULE_START:
{
// preloads resources needed for character generation
PreloadCharGen();
object oHero = GetHero();
// initiates character generation
StartCharGen(oHero, 0, nImportHero);
EquipItem(oHero, UT_AddItemToInventory(R"gen_im_wep_mag_sta_mgc.uti"));
break;
}
}
// if this event wasn't handled by this script fall through to the core script
if(!nEventHandled)
{
HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
}
}
#7
Posté 26 juin 2011 - 06:15
The StartCharGen command triggers a new event (CHARGEN_START) which occurs after your script finishes.
Your script probably equips the character, but then CharGen replaces the inventory.
My solution is to place a one-shot trigger around the start waypoint which equips the player. This works because the trigger entry event happens after module load and character generation.
I imagine you can also do this in EVENT_TYPE_CHARGEN_END, checking for CHARGEN_MODE_CREATE to ensure that it doesn't happen on every level up.
With 20:20 hindsight, I wish Bioware had given self-documenting names to functions which wrap event triggers (e.g. EventWR_StartCharGen), but we are where we are.
Your script probably equips the character, but then CharGen replaces the inventory.
My solution is to place a one-shot trigger around the start waypoint which equips the player. This works because the trigger entry event happens after module load and character generation.
I imagine you can also do this in EVENT_TYPE_CHARGEN_END, checking for CHARGEN_MODE_CREATE to ensure that it doesn't happen on every level up.
With 20:20 hindsight, I wish Bioware had given self-documenting names to functions which wrap event triggers (e.g. EventWR_StartCharGen), but we are where we are.





Retour en haut






