BlakeDrapeta Posted July 11, 2011 Share Posted July 11, 2011 Hi, I've been working on making a challenge perk, but the type of challenge I need isn't listed in the drop-down type menu. One option it does offer in that menu though is the 'scripted challenge'. Its granted that I'll have to write a script for this, but the challenge window doesn't give me an option to choose a specific script, so I'm guessing the exact challenge in question will have to be specified in the script itself somehow. How do I do that? Also, do I need to use a challenge, or can I substitute/bypass it entirely with a script? I ask the second question because I notice the challenge still asks for threshold and interval values, and I don't know how I would make my script work with these or if it would mess up my script if I didn't write it properly. http://i858.photobucket.com/albums/ab145/Malrang/challengepic.jpg Here is what I have so far. scn CNMightyFistsChallenge int pLevel begin GameMode set pLevel to player.GetLevel if pLevel == 2 ;here is where I'm stuck, I don't know what to do with this after this point.The intention of this script would be to reward a player with a perk when he reaches level two, and every level until level 30 (until his rank in that perk reaches 29). Any help would be appreciated. Link to comment Share on other sites More sharing options...
tunaisafish Posted July 11, 2011 Share Posted July 11, 2011 You could use a challenge, but you don't need to. It's a lot simpler just with a quest script. scn CNMightyFistsChallengeQScr int pLevel int rank Begin GameMode if pLevel >= player.GetLevel return endif ;so this runs only if pLevel is lower than the current player level set pLevel to pLevel + 1 if pLevel < 2 ;not high enough yet. return elseif pLevel > 30 ;too high ;return endif ;So this only runs once for each level from 2 to 30 set rank to (player.HasPerk CNMightyFistsPerk) set rank to rank + 1 if (rank < pLevel) player.addperk CNMightyFistsPerk showmessage CNMightyFistsMsg rank endif End Your Message (CNMightyFistsMsg) will contain something like..."You have gained the Mighty Fists perk (Rank %.0f)" Wow... a 29 level Perk. Those Fists sure will be Mighty. Link to comment Share on other sites More sharing options...
BlakeDrapeta Posted July 11, 2011 Author Share Posted July 11, 2011 Thanks a lot, you're a life saver. :) Link to comment Share on other sites More sharing options...
BlakeDrapeta Posted July 12, 2011 Author Share Posted July 12, 2011 (edited) Okay I tried the script but when I reached level 2 in game it didn't give me the perk. Here is how it appears I had to make one or two edits so it would work with the proper names. scn CNMightyFistsChallenge int pLevel int rank begin GameMode if pLevel >= player.GetLevel return endif set pLevel to pLevel + 1 if pLevel < 2 return elseif pLevel > 30 return endif set rank to (player.HasPerk CNMightyFists) set rank to rank + 1 if (rank < pLevel) player.addperk CNMightyFists showmessage CNMightyFistsMsg rank endif end I also tried an alternate script, but it didn't woprk either (my first script so be gentle). scn CNMightyFistsSCRIPT int plevel int rank begin GameMode set plevel to player.GetLevel if plevel == 2 set rank to (player.HasPerk CNMightyFists) endif if (rank < (plevel - 1)) player.addperk CNMightyFists set rank to rank + 1 showmessage CNMightyFistsMsg rank endif end Edited July 12, 2011 by BlakeDrapeta Link to comment Share on other sites More sharing options...
tunaisafish Posted July 12, 2011 Share Posted July 12, 2011 Make sure you saved the script as a quest script.You'll need to create a quest for it to run. Link to comment Share on other sites More sharing options...
BlakeDrapeta Posted July 12, 2011 Author Share Posted July 12, 2011 Ah okay that fixed it, works perfectly now. Thanks a lot man Link to comment Share on other sites More sharing options...
Recommended Posts