PDA

View Full Version : [K1] SetXP using negative value?


dragonturtle
05-20-2006, 02:22 AM
SetXP doesn't accept negative values -- is this a hardcoded function, or is the function defined somewhere for me to change?

I want to delevel the player character (via script, not with a save game editor), and I remember that SetXP allowed negatives in NWN...

Any help or alternative solutions would be greatly appreciated!

Darkkender
05-20-2006, 03:56 AM
It could be because the nwscript.nss is source used for the original Kotor game was produced early on in NWN history. Since the development broke off long before the development of the various NWN expansions it is possible that Bioware add negative number support in that function following Kotor's initial development. What this would mean is that NWN would now have support for this functionality but Kotor wouldn't. There has been alot added to NWN scripting for NWN that would be wonderful if Kotor had as well but we are not so lucky since Kotor wasn't meant to be modded officially.

stoffe
05-20-2006, 07:17 AM
I want to delevel the player character (via script, not with a save game editor), and I remember that SetXP allowed negatives in NWN...


Unfortunately I don't think this is possible. As far as I know none of the XP manipulating functions allow you to remove XP already gained from a creature, and there are no functions to modify the level directly.

The only thing that is possible is to set the class level of the second class of a multiclassed NPC back down to 0, but this won't automatically remove anything granted by those levels earlier that isn't directly automatically calculated from the class level value.

dragonturtle
05-20-2006, 06:12 PM
The only thing that is possible is to set the class level of the second class of a multiclassed NPC back down to 0, but this won't automatically remove anything granted by those levels earlier that isn't directly automatically calculated from the class level value.

Is this accomplished by using AddMultiClass? For example, using AddMultiClass the first time, I could make the PC a 4 Scout/4 Soldier. The second time I use AddMultiClass the PC becomes a 4 Scout/0 Guardian which appears to lower class level.

However, the second call to that function messes up Skills (e.g. PC has Repair 8 at level 4/4, but Repair 16 at level 4/0). Not only that, but when I attempt to level up at 4/0, the game crashes when I hit the Skills button on the levelup screen. It crashes regardless whether I have saved skill points or not.