Stealth21 Posted June 11, 2021 Share Posted June 11, 2021 (edited) When every player's skills are in their 100 values, I considered that there is nothing interesting in the battles and in the unlocking chests/doors proccess. So I would like to make 2 mods. The first one is - if the player has the Skeleton Key and it's security skill is equal to 100 (to 140 if including the value given by the skeleton key "ability spell"), then it is possible to unlock any locked, NOT to the key, chest/door just with pressing 'z' button while watching on the locked target. That is done.The second one - edit Mehrunes Dagger enchantment's script effect. If all of the player skills are equal to 100, then every dagger hit will be fatal (an instant death). I am in trouble a little - the skills quantity is 21. Their check (GetAVForBaseActor) can not be written in the one line because it is too long in this way. Yes, I do realize that it is possible to divide that check to subchecks OR use While<->Loop. I would like to avoid the using of While<->Loop because it will be processing each dagger's strike. There is such line as "Master skills:" in the player stats, but it is not gettable through GetPCStat function. Can someone share with me his/her experience of how to get the quantity of the skills advanced to the master level? Edited June 11, 2021 by Stealth21 Link to comment Share on other sites More sharing options...
KatsAwful Posted June 12, 2021 Share Posted June 12, 2021 A while loop will process within a frame, not line by line. As long as its relatively short and functionally quick (which it sounds like it will be) you will not experience any meaningful script processing time The best way to get the rank of all skills is to just process each one. You could store it in a quest variable or a variable that saves to the save file (arrays and strings) set index to 12 while index <= 32 ; skill values are 12 through 32 if PlayerREF.GetActorValueC index >= 100 let skills += 1 ; increment some sort of flag endif let index += 1 loop ; this will process within 1 frame, but its not many lines so its fine if skills == 21 ; all skills are 100 let quest.string == "100" ; strings are stored to your save file else ; not all are good let quest.string == "0" ; quest scripts can be called without the quest script running endif This is something I whipped together, should get you most of the way there. The game counts "master" skills by checking your base actor value. The one issue with GetActorValueC is that it checks the current AV, so you can technically cheat and just spam some spells or something, but seems reasonable to me Link to comment Share on other sites More sharing options...
Stealth21 Posted June 12, 2021 Author Share Posted June 12, 2021 (edited) KatsAwful, yes, currently I applied the code related to your presented. I created AllSkills100InstantKiller global short variable and added the next code to the OnEquip block of the Mechrunes Dagger's script: set AllSkills100InstantKiller to 12 While ( AllSkills100InstantKiller < 33 ) if (( Player.GetAVForBaseActorC AllSkills100InstantKiller ) < 100 ) break else set AllSkills100InstantKiller to AllSkills100InstantKiller + 1 endif loop- it will be processed only once per dagger equipping, which is acceptable by me :D I used GetAVForBaseActorC, not the GetAVC - isn't it get the skill with such parameters like fortifiers and drains?.. And it is not necessary to write PlayerREF - just Player was always working. Also I edited the scripted effect of the enchantment of that weapon: if RandomChance <= LuckMod ; Check against dice roll kill player ; Make 'em deader ... elseif ( AllSkills100InstantKiller == 33 ) kill player if (( Player.GetEquippedCurrentCharge 16 ) < 500 ) Player.SetEquippedCurrentCharge 8000 16 endif endifso everyone just need to be hitted with that dagger only once. It will be never out of enchantment charge.I was looking for the realization way without the global variable declaring. Everything could be realized just in the enchantment script effect's script, but then the proccess will be going through the While<->Loop each hit, so it was not an option. I did not trust to that function - GetVariable - because to get the exact script ref of the equipped dagger, I'd had to declare an array, use GetEquippedItems for it, go through the array in the search of the reference which GetEquipmentSlot == 16, get the script ref using GetScript and only then operate with it's variables through GetVariable. But, as I noted, there are the info about the total Novice, Apprentice, Journeyman, Expert and Master skills already calculated and showed in the journal's stats. So I hoped to find the way to retrieve that value from there. It is not among the PCMiscStats (though, value 102/-102 is influenced by the changes in the player's skills...). No function to get it/them, neither the some kind of array with them. It is not among the gamesettings 'variables'. So looks like the only way to get the info about the total skills being advanced to 100 is to go with the checks through all of them using the While<->Loop subblock. Edited June 12, 2021 by Stealth21 Link to comment Share on other sites More sharing options...
Recommended Posts