I was just checking to see if I forgot to set conditions to make a quest unrepeatable while I was testing my mod in game. I did in fact forgot to set a condition so the whole complete quest text was brought back up along with the reward. It was unintentional but i noticed after i received the quest reward for the second time that I looked down at my xp bar to see that it was 2000/2000.... I redid the convo again which surely should have pushed me over but the xp bar was still 2000/2000 What?? Why no level up? I could have sworn that I had repeated this same situation with a different quest weeks ago and it resulted in the player leveling. Am I mistaken about having the player level up before and there could possabily be something I just have to switch to fix it? Or could there have been something I did that has caused this effect? This is all confusing to me because, 1. I barely know what I'm doing in the first place, and, 2. is that the player is created in the beginning using character generation and I thought that set everything up just like a new character in single player.
Char generated player is not leveling
Débuté par
carmadaum
, mai 11 2010 04:52
#1
Posté 11 mai 2010 - 04:52
#2
Posté 12 mai 2010 - 06:56
Were you testing with a generic, script-created character? If you are testing with a 0-level squab (no class, no armor, 1 hp, etc), he will not level up even when the bar gets full. If you are testing with a character who has a valid class, he ought to level up just as in the game.
If it's the latter, I'd check to see that your experience is actually being awarded.
If it's the latter, I'd check to see that your experience is actually being awarded.
#3
Posté 13 mai 2010 - 05:18
Its a regular player from the character generator. And the quest is giving experience. I placed a way point just in front of the quest end so you can start the mod right there. With a brand new generated lvl 1 player be it human warrior, dwarf rouge, etc I go up to npc initiate convo. He gives a reward of about 1000 xp. I repeat it again and the player ends up with 1999 out of 2000 xp. I talk to the npc for a third time and the xp bar gets maxed out at 2000/2000 no lvl up and a bunch of head aches for me.
#4
Posté 13 mai 2010 - 08:32
do you have the standard module core in place. or do you forward the levelup events to it? if you have somehow overriden the default core and "forgott" to give it access to the levelup routine it explain your problems.
#5
Posté 14 mai 2010 - 07:03
Okay, well I knew from the start that I must be doing something wrong. Me tinkering with this toolset is kinda like a 3 year old trying to fly a stealth bomber. When it comes to scripting I only know enough to find examples of what I need and copy then paste.
That said I was granting the player experience and an iteam through this script:
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_bank"
void AddCreatureExperience(int nXp, object oCreature=OBJECT_SELF)
{
float fXp = IntToFloat(GetExperience(oCreature) + nXp);
SetCreatureProperty(oCreature, PROPERTY_SIMPLE_EXPERIENCE, fXp);
}
int StartingConditional()
{
int bResult;
event evCurrent = GetCurrentEvent();
int nEventType = GetEventType(evCurrent);
int nPlotFlag = GetEventInteger(evCurrent, 1);
object oHero = GetHero();
switch(nEventType)
{
case EVENT_TYPE_SET_PLOT:
{
switch(nPlotFlag)
{
case GOT_KEY:
{
AddCreatureMoney(1000, oHero);
AddCreatureExperience(1000, oHero);
CreateItemOnObject(R"vault_key.uti", oHero);
break;
}
}
break;
}
}
return bResult;
}
The skeleton of it this script is copied from sunjammer's tutorial. The script worked, once flag is tripped the item is received and xp rewarded. Yet as stated before if I redo the reward part over and over the xp becomes maxed out and never lvls.
Knowing that I hadn't modified the module core or completely understood what CID-78 said I attempted a little experiment. I set the plot flag to give one of those preset rewards and found that I had to get rid of the script associated with that plot flag in order for it to work. When I loaded it up in game and repeatedly completed the quest this time the player did lvl up.
Whats the beef? My problem must be with my original script, right? Is missing something?
That said I was granting the player experience and an iteam through this script:
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_bank"
void AddCreatureExperience(int nXp, object oCreature=OBJECT_SELF)
{
float fXp = IntToFloat(GetExperience(oCreature) + nXp);
SetCreatureProperty(oCreature, PROPERTY_SIMPLE_EXPERIENCE, fXp);
}
int StartingConditional()
{
int bResult;
event evCurrent = GetCurrentEvent();
int nEventType = GetEventType(evCurrent);
int nPlotFlag = GetEventInteger(evCurrent, 1);
object oHero = GetHero();
switch(nEventType)
{
case EVENT_TYPE_SET_PLOT:
{
switch(nPlotFlag)
{
case GOT_KEY:
{
AddCreatureMoney(1000, oHero);
AddCreatureExperience(1000, oHero);
CreateItemOnObject(R"vault_key.uti", oHero);
break;
}
}
break;
}
}
return bResult;
}
The skeleton of it this script is copied from sunjammer's tutorial. The script worked, once flag is tripped the item is received and xp rewarded. Yet as stated before if I redo the reward part over and over the xp becomes maxed out and never lvls.
Knowing that I hadn't modified the module core or completely understood what CID-78 said I attempted a little experiment. I set the plot flag to give one of those preset rewards and found that I had to get rid of the script associated with that plot flag in order for it to work. When I loaded it up in game and repeatedly completed the quest this time the player did lvl up.
Whats the beef? My problem must be with my original script, right? Is missing something?
#6
Posté 18 mai 2010 - 08:30
something is very weird with that script.
1) it looks like a ShowTextNode script since it uses "StartingConditional()".
2) But you are using events, which such script shouldn't handle or even recieve. events should be handled by the diffrent core scripts. your own or biowares.
So I can only assume this is some copy and paste deal, because it doesn't make sense. it should be two diffrent scripts doing this. one that deal with the conversation another that deal with the event.
1) it looks like a ShowTextNode script since it uses "StartingConditional()".
2) But you are using events, which such script shouldn't handle or even recieve. events should be handled by the diffrent core scripts. your own or biowares.
So I can only assume this is some copy and paste deal, because it doesn't make sense. it should be two diffrent scripts doing this. one that deal with the conversation another that deal with the event.
#7
Posté 18 mai 2010 - 02:06
What you have there is a plot script. It should be associated with the plot called bank (assuming your include list is correct).
The problem is the function AddCreatureExperience.
That function is very bare-bones. It doesn't do checks to see if the player has reached the next level.
Leveling up is handled via scripting in DA. The default RewardXP checks if the next level is reached and flags the character for level-up which this function doesn't. That is your problem.
As a FYI, if you want the flag to be set only once, you should make sure that the Repeatable flag in the plot is set to No.
Edit: Instead of using AddCreatureExperience(1000, oHero); use RewardXP (oHero, 1000);
Include sys_rewards_h in your include list and get rid of the function AddCreatureExperience.
That should give you the level-up when you trigger the plot flag multiple times.
The problem is the function AddCreatureExperience.
That function is very bare-bones. It doesn't do checks to see if the player has reached the next level.
Leveling up is handled via scripting in DA. The default RewardXP checks if the next level is reached and flags the character for level-up which this function doesn't. That is your problem.
As a FYI, if you want the flag to be set only once, you should make sure that the Repeatable flag in the plot is set to No.
Edit: Instead of using AddCreatureExperience(1000, oHero); use RewardXP (oHero, 1000);
Include sys_rewards_h in your include list and get rid of the function AddCreatureExperience.
That should give you the level-up when you trigger the plot flag multiple times.
Modifié par TimelordDC, 18 mai 2010 - 02:09 .
#8
Posté 18 mai 2010 - 04:05
carmadaum wrote...
Whats the beef? My problem must be with my original script, right? Is missing something?
Since you're able to level up by using "regular" rewards, and since you can get experience via this script once, there is probably nothing wrong with your character. That's good news.
So why isn't experience coming a second time? I don't have answers, but I do have some questions that might help you find them.
1. Are you generating a second key on the PC? It seems that in each case experience is generated, you are also awarding a key. If you're not getting another key, then the script (or this part of the script) might not be running at all.
2. Same as above, is money being awarded properly? If it's not, then the problem is with your script and not your character leveling per se.
3. If I'm reading your script right, the experience award is based on a plot flag being set. In that case, is the flag being set properly? If you have already set it once, are you unsetting it before you try to set it again? Is the plot set as "repeatable"? If not, you may not be able to complete it more than once. Is the plot flag denoted as "final"? Once again, this might keep you from being able to run it properly more than once.
If you can determine if the script is running a second time, that will allow you to figure out if the problem is in the script or if it's in how the plot is set up.
Modifié par BillHoyt, 18 mai 2010 - 05:07 .





Retour en haut






