gamerlj Posted October 23, 2009 Share Posted October 23, 2009 Hello all, I am trying to create some items that award xp when used. I was wondering how I might go about giving xp to just the player character, or all currently recruited characters, etc using scripts. I looked through the scripts in kotor tool, but none of the scripts seem to be what I need. If anyone can give some pointers that would be great. Thanks. --gamerlj Link to comment Share on other sites More sharing options...
Star Admiral Posted October 23, 2009 Share Posted October 23, 2009 Have you tried using the GiveXPToCreature() function? That allows you to specify both the amount of XP given and the specific creature to give it to. For example, to give 100XP to the main player only, you would use GiveXPToCreature( 100, GetFirstPC() ). - Star Admiral Link to comment Share on other sites More sharing options...
harIII Posted October 23, 2009 Share Posted October 23, 2009 You could also do it another way which would be relatively easy. Take the line that says something to the affect of "Manaan_Plot_Sonic_Gun" in Spells.2da and copy it at the bottom of Spells.2da. All you really need to do is change the script to give you exp. You can use the one below, it should compile. void main () { GiveXPToCreature(GetFirstPC(),nAmount); } Then you need to go to your item's properties and add one that activates this new row in Spells.2da. Note: There is a downfall to this strategy. If my logic is correct the script will fire every time you use the weapon so you will need to either do one of two things: Option 1 (Easy Path) - Make the script give you very small amounts so that on average you'll get the amount of exp that you are looking for. Option 2 (Hard Path) - Have somebody like Star Admiral or another well known scripter make you a script that gets the tag of the selected target, then check to see when they die, and then give you the desired exp. Hope this helps. Link to comment Share on other sites More sharing options...
gamerlj Posted October 25, 2009 Author Share Posted October 25, 2009 I've gotten the scripts working now. I really appreciate the help. The scripts you suggested worked really well. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.