I have been trying the scripts in the wiki, and the chargen script works fine, but I can't get the level up part to work. I am trying to get the PC to have enough XP to level up to 10 after CharGen.
Whate happens is CharGen launches, you set up the char as a level 1, it puts you in the module, there is a tutorial popu about specializations, but the PC has no exp and is only level 1.
This is the code I was using (from the wiki)
case EVENT_TYPE_MODULE_START:
{
object oHero = GetHero();
// [chargen code goes here]
// preloads resources needed for character generation
PreloadCharGen();
// initiates character generation
StartCharGen(GetHero(),0);
// auto-level the player to level 10
RewardXP(oHero, RW_GetXPNeededForLevel(10), FALSE, FALSE);
SetAutoLevelUp(oHero, FORCE_AUTOLEVEL);
break;
I tried changing the RewardXP to TRUE, TRUE but that didn't help.
Also tried removing the SetAutoLevelUp to see if it would just give the XP, but that didn't do anything either?
Anybody have any other suggestions?
Thanks!
How do I level up the PC after CharGen at EVENT_START_MODULE?
Débuté par
PavelNovotny
, mars 23 2010 12:33
#1
Posté 23 mars 2010 - 12:33
#2
Posté 23 mars 2010 - 08:09
Level up works fine when everything is scripted, so I guess you're hitting a timing problem with manual character generation. You could try moving the level up script to the CHARGEN_END event.
#3
Posté 25 mars 2010 - 08:25
Level up works fine when everything is scripted, so I guess you're hitting a timing problem with manual character generation. You could try moving the level up script to the CHARGEN_END event.
This will work, but you need to put in a flag or something to make sure it only applies that XP once. CHARGEN_END also fires whenever you finish the levelling up dialogue. I once hilariously had the main character stripped naked and the inventory emptied on every level-up, good times
#4
Posté 26 mars 2010 - 08:48
Apologies, I now see there is an integer parameter 0 with this event. You need to check that it's set to CHARGEN_MODE_CREATE. Alternatively, other threads have suggested using PRCSCR for things that might be disrupted by character generation.





Retour en haut






