Aller au contenu

Photo

Script to Set XP


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

#1
Rowwena

Rowwena
  • Members
  • 33 messages
Hi,
I am having a problem with this one. I have tried one I found at the lexicon, and another I pulled from the OC and tried to modify, but I could not get either to work, even when they said they compiled.

I am looking for a script that will set the PC's experience. Basically, I want one that is called on from the end of a conversation that, like in the OC, will advance the PC to level 3 before moving on to the next area. I know that I could just give them XP the normal way, but since some of the previous encounters are optional, I do not want the PCs that do these to advance beyond the level points.

This is for a single player/stand-alone module.

Any help would be appreciated.

#2
Rowwena

Rowwena
  • Members
  • 33 messages
Nevermind, I found one here. Got luck with searching Google for once.

http://social.biowar...-4744022-1.html

Thanks Okto

#3
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Your script can be a lot simpler then the link you posted.   You already know the level you want them to be (3) and that they will need and the amount of xp that they will need for that level (3000) .  So just set it. Of cource a check to make sure you are not going to take any away would not hurt. 

void main()
{
  object oPC = GetPCSpeaker();
  int xp = GetXP(oPC);
  // check to make sure that you are not going to take XP away from the PC.
  if (xp < 3000) SetXP(oPC,3000);