Aller au contenu

Photo

Any way to use a pre-generated character with a custom background?


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Proleric

Proleric
  • Members
  • 2 361 messages
For some reason, background is a property of pre-generated characters.

So, in a standalone campaign with custom backgrounds, it doesn't make sense to use existing characters made for the OC (indeed, in my experience, it crashes the game).

Is there any workaround for this? I'm sure many players will want to use their favourite characters in standalone campaigns.

#2
ladydesire

ladydesire
  • Members
  • 1 928 messages
I'm not sure; I know Bioware had a way of triggering the chargen functions if you imported a character created in the stand alone character creator, but I don't know if that functionality is available to us.

#3
Proleric

Proleric
  • Members
  • 2 361 messages
I found the germ of a solution. If you set the nImportEnabled parameter of StartCharGen, it enables importing a character from a saved game, and disables using a pre-generated character (hence preventing the crash).

I'm going to play around with EVENT_TYPE_CHARGEN_IMPORT_HERO to see if I can set the background, reset to level 1 and clear the inventory.

#4
Proleric

Proleric
  • Members
  • 2 361 messages
Well, that was easier than I thought.

Fortunately, my module only has one background.

For reasons of balance, I want the imported character to revert to level 1.

The following snippet in the module script achieves this:

[dascript]
case EVENT_TYPE_CHARGEN_IMPORT_HERO:
{
object oHero = GetHero();
int nGender = GetCreatureGender(oHero);
int nRace = GetCreatureRacialType(oHero);
int nclass = GetCreatureCoreclass(oHero);
int nBackground = BACKGROUND_FOUNDLING;
int nEquipIndex = Chargen_GetEquipIndex(nRace, nclass, nBackground);

Chargen_InitializeCharacter(oHero);
Chargen_SelectGender (oHero, nGender);
Chargen_SelectRace (oHero, nRace);
Chargen_SelectCoreclass (oHero, nclass);
Chargen_SelectBackground(oHero, nBackground);
Chargen_InitInventory (oHero, nclass, nEquipIndex);
SetCreatureMoney(0, oHero);
}
[/dascript]

In effect, this enforces a Quickstart, so I might allow the character build to be imported as is if it's still at level 1.

Modifié par Proleric1, 06 octobre 2010 - 02:37 .