hey guys
I've attached this script to a line of dialogue for one of my npc characters. it's meant to level up the Player
#include "sys_chargen_h"
#include "utility_h"
#include "sys_rewards_h"
#include "events_h"
const int FORCE_AUTOLEVEL = 2;
void main()
{
// keep track of whether the event has been handled
object oHero = GetHero();
// skip character generation
Chargen_InitializeCharacter(oHero);
Chargen_SelectGender(oHero, GENDER_MALE);
Chargen_SelectRace(oHero, RACE_HUMAN);
Chargen_SelectBackground(oHero, BACKGROUND_NOBLE);
Chargen_SelectCoreclass(oHero, class_WARRIOR);
SetCreatureProperty(oHero,PROPERTY_SIMPLE_ATTRIBUTE_POINTS,40.0,PROPERTY_VALUE_BASE);
RewardXP(oHero, RW_GetXPNeededForLevel(20), FALSE, FALSE);
SetAutoLevelUp(oHero, FORCE_AUTOLEVEL);
}
However even though i have the plus button next to the pc's name i can't actually level up or adjust the attributes of the player.
yes they do increase but not enough to even get the first skill point and more over I can't even select any talents can anyone help me please
leveling up mid game isn't work properly
Débuté par
Bassline204
, févr. 24 2011 10:15
#1
Posté 24 février 2011 - 10:15
#2
Posté 25 février 2011 - 12:18
Most of that script relates to character generation so if all you want to do is allow the player to level up to level 20 after talking to an NPC you can get rid of most of it. All you really need is RewardXP line:
EDIT: I should add that the assumption is the character is currently on 0xp otherwise you'll have to subtract their current XP from the number returned by RW_GetXPNeededForLevel(20).
object oHero = GetHero(); RewardXP(oHero, RW_GetXPNeededForLevel(20), FALSE, FALSE);This will make them level 20 and give them the choice to spend the points where they want. However if you add:
SetAutoLevelUp(oHero, FORCE_AUTOLEVEL);They will be levelled up with and all points will be spent for them.
EDIT: I should add that the assumption is the character is currently on 0xp otherwise you'll have to subtract their current XP from the number returned by RW_GetXPNeededForLevel(20).
Modifié par Sunjammer, 25 février 2011 - 12:29 .
#3
Posté 25 février 2011 - 04:50
hey SunJammer
I realised what the real problem is. My points are getting given to me but the level up button in the game doesn't do anything. it won't allow me go through the level up process where you can spend your points. Any thoughts on how to fix this.
I realised what the real problem is. My points are getting given to me but the level up button in the game doesn't do anything. it won't allow me go through the level up process where you can spend your points. Any thoughts on how to fix this.
#4
Posté 25 février 2011 - 09:05
I suspect you already have the answer. If you want to level up manually, remove SetAutoLevelUp and all the other stuff you don't need.
If you've followed that advice, but still can't use the level up button, please post your character creation script, as there could be a problem there.
If you've followed that advice, but still can't use the level up button, please post your character creation script, as there could be a problem there.





Retour en haut






