Fallina Posted July 27, 2013 Share Posted July 27, 2013 I'm not entirely sure which thread to post this in, hope this is where it goes. I'm getting my feet wet with some scripting, I think. It's possible this can be done without scripting, but I'm running into several snags no matter which approach I take. The premise for what I'm wanting to do is have the player's carry weight increase slightly every 10 levels. After digging through some assets, I decided I would need to create specialized "perks" that would add to the players carry weight. I made a perk with 5 ranks, made it hidden, and linked it to a custom, +10 carry weight ability . Now I need to get it to apply every 10 lvl. I decided a script would probably be necessary to do this. If anyone knows a way to do this -without- a script, please let me know, I'd be more than happy to implement it. So, on to the scripting issues I've encountered. For one, I ran into a snag finding a function that would return specific Perk Ranks. The function HasPerk only returns true/false, not specific ranks. So I reworked the perks to be single rank perks and made 5 individual, similarly named perks with the same purpose, add 10 carry weight. They are: zLUCU1, zLUCU2, zLUCU3, zLUCU4, and zLUCU5.This is the script as it stands: scn zCarryUpSCRIPT begin GameMode int zPClvl set zPClvl to player.GetLevel ;---------------------------lvl 10 Bonusif zPClvl >= 10if player.HasPerk zLUCU1 == 0player.AddPerk zLUCU1endifendif ;---------------------------lvl 20 Bonusif zPClvl >= 20if player.HasPerk zLUCU2 == 0player.AddPerk zLUCU2endifendif ;---------------------------lvl 30 Bonusif zPClvl >= 30if player.HasPerk zLUCU3 == 0player.AddPerk zLUCU3endifendif ;---------------------------lvl 40 Bonusif zPClvl >= 40if player.HasPerk zLUCU4 == 0player.AddPerk zLUCU4endifendif ;---------------------------lvl 50 Bonusif zPClvl >= 50if player.HasPerk zLUCU5 == 0player.AddPerk zLUCU5endifendifend I'm not sure if GetLevel actually works in script or not. I know there are several functions which work in the console, but can't be used in scripting. If anyone has any ideas on why this doesn't seem to be working, or another method to achieve the same ends, let me know. Link to comment Share on other sites More sharing options...
rickerhk Posted July 27, 2013 Share Posted July 27, 2013 Getlevel works fine, and there's nothing I know of to get the perk rank.Looks ok to me except I would putint zPClvlabove the gamemode block.You didn't say what the script is running on? Running the script on a quest would probably be the best. Link to comment Share on other sites More sharing options...
Fallina Posted July 27, 2013 Author Share Posted July 27, 2013 Okay. Now I feel silly.... I can't believe I missed that step.................... Thank you for reminding me it won't do anything as a Quest script unless it's actually... y'know.... attached to a quest. Link to comment Share on other sites More sharing options...
Recommended Posts