Ellorienne Posted January 17, 2015 Share Posted January 17, 2015 Is it possible to have a quest provide a different reward each time that it is completed? Or would it be better to have separate quests (let's suppose that there are a lot of different rewards - dozens)? Also, if said quest is a timed quest, is it possible to add something to the script so that the length of the time to complete the quest increases each time? I know very little about code, but I'm guessing that if there were, that something would go in here GlobalTime.SetValue(GlobalDays.GetValue() * 7 + GetNumberOfTimesCompleted x 7)Yep, you can use RandomInt to choose from an Array/bunch of properties for your rewards and then award a different one depending on the number. And to do the time, use this script: http://www.creationkit.com/Complete_Example_Scripts#Script_for_a_quest_with_time_limit You'd modify endTime. So where it says: endTime = Utility.GetCurrentGameTime()+GlobalDays.GetValue() You could add to endTime. So, for example: endTime = (Utility.GetCurrentGameTime()+GlobalDays.GetValue()) * TimesQuestDoneWith TimesQuestDone as an integer var/property updated += 1 every time you complete the quest. Ah yes, thank you :) TimesQuestDone is exactly what I was hoping for (considering the Thieves guild quests I figured it would be possible). Would using RandomInt make the reward random, or, once each reward is assigned from a number, could that number be a specific one? I'm trying to find a shortcut to having to dozens of quests that are ultimately the same (read a book, get a time limit (depending on TimesQuestDone), receive a different reward depending on the book read). Next question, and I possibly should have asked this first, is there a way to apply a property to an item without it being an enchantment? Link to comment Share on other sites More sharing options...
Mattiewagg Posted January 17, 2015 Author Share Posted January 17, 2015 Is it possible to have a quest provide a different reward each time that it is completed? Or would it be better to have separate quests (let's suppose that there are a lot of different rewards - dozens)? Also, if said quest is a timed quest, is it possible to add something to the script so that the length of the time to complete the quest increases each time? I know very little about code, but I'm guessing that if there were, that something would go in here GlobalTime.SetValue(GlobalDays.GetValue() * 7 + GetNumberOfTimesCompleted x 7)Yep, you can use RandomInt to choose from an Array/bunch of properties for your rewards and then award a different one depending on the number. And to do the time, use this script: http://www.creationkit.com/Complete_Example_Scripts#Script_for_a_quest_with_time_limit You'd modify endTime. So where it says: endTime = Utility.GetCurrentGameTime()+GlobalDays.GetValue() You could add to endTime. So, for example: endTime = (Utility.GetCurrentGameTime()+GlobalDays.GetValue()) * TimesQuestDoneWith TimesQuestDone as an integer var/property updated += 1 every time you complete the quest. Ah yes, thank you :) TimesQuestDone is exactly what I was hoping for (considering the Thieves guild quests I figured it would be possible). Would using RandomInt make the reward random, or, once each reward is assigned from a number, could that number be a specific one? I'm trying to find a shortcut to having to dozens of quests that are ultimately the same (read a book, get a time limit (depending on TimesQuestDone), receive a different reward depending on the book read). Next question, and I possibly should have asked this first, is there a way to apply a property to an item without it being an enchantment?You just declare an array, and fill it, and then: Int random = Utility.RandomInt(1, 100); replace 100 with number of possible rewards - 1 Player.AddItem(MyArray[Random]) That is, if you're using an array. Otherwise you'll have to set up a long If/ElseIf thing for each value of Random to add the corresponding item. As for your second question... No idea. I'm not really a magic guy. Link to comment Share on other sites More sharing options...
Ellorienne Posted January 17, 2015 Share Posted January 17, 2015 I suppose that I could just adjust the number of enchantments possible, but I was more going for 'traits'.... Find a book, research trait (timed quest), recieve spell/ability, use new recipe to smith traited armor/weapons (which have the spell/ability as a condition), apply enchantment. Link to comment Share on other sites More sharing options...
Mattiewagg Posted January 17, 2015 Author Share Posted January 17, 2015 I suspect lof may be able to answer. Just give it a little. :D Link to comment Share on other sites More sharing options...
Kerberus14 Posted January 17, 2015 Share Posted January 17, 2015 (edited) Function RegisterForMenu(String MenuName) Native Event OnInit() StatusChecks() EndEvent Function StatusChecks() RegisterForMenu("ShowRaceMenu") EndFunction Event OnMenuClose(String MenuName) PlayerRef.UnEquipAll() PlayerRef.SetWeight(0) PlayerRef.QueueNiNodeUpdate() EndEvent Doesn't work by the way. :sad: Scriptname SkyEndWeight extends ObjectReference Actor Property PlayerRef auto Keyword Property Drink auto Keyword Property Food auto GlobalVariable Property FatGainedDay auto GlobalVariable Property DaysWithoutEat auto Float Property CountDrink auto Float Property CountFood auto Float Property Fat auto Function SetWeight(float weight) native float Function GetWeight() native Function QueueNiNodeUpdate() native Keyword Property Vampire auto Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) if akBaseObject as Potion && akBaseObject.HasKeyword(Drink) Fat= FatGainedDay.GetValue() CountDrink=CountDrink+0.5 Fat=Fat+CountDrink FatGainedDay.SetValue(Fat) CountDrink=0 endif if akBaseObject as Potion && akBaseObject.HasKeyword(FOOD) Fat=FatGainedDay.GetValue() CountFood=CountFood+1 Fat=Fat+CountFood FatGainedDay.SetValue(Fat) CountFood=0 endif EndEvent Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime) PlayerRef.UnEquipAll() EndEvent Event OnSleepStop(bool abInterrupted) if PlayerRef.HasKeyword(Vampire)==0 if FatGainedDay.GetValue()>9 FatGainedDay.SetValue(9) PlayerRef.SetWeight(PlayerRef.GetWeight()+FatGainedDay.GetValue()/10) PlayerRef.QueueNiNodeUpdate() FatGainedDay.SetValue(0) endif if FatGainedDay.GetValue()>=7.5 && FatGainedDay.GetValue()<=9 PlayerRef.SetWeight(PlayerRef.GetWeight()+FatGainedDay.GetValue()/10) PlayerRef.QueueNiNodeUpdate() FatGainedDay.SetValue(0) endif if FatGainedDay.GetValue()>=6 && FatGainedDay.GetValue()<=7.5 PlayerRef.SetWeight(PlayerRef.GetWeight()+FatGainedDay.GetValue()/10) PlayerRef.QueueNiNodeUpdate() FatGainedDay.SetValue(0) endif if FatGainedDay.GetValue()>=4.5 && FatGainedDay.GetValue()<=6 ; Any value between 4.5 and 6 means you keep your current weight FatGainedDay.SetValue(0) endif if FatGainedDay.GetValue()>=3.5 && FatGainedDay.GetValue()<=4.5 PlayerRef.SetWeight(PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+0.5) PlayerRef.QueueNiNodeUpdate() FatGainedDay.SetValue(0) endif if FatGainedDay.GetValue()>=2 && FatGainedDay.GetValue()<=3.5 PlayerRef.SetWeight(PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+1) PlayerRef.QueueNiNodeUpdate() FatGainedDay.SetValue(0) endif if FatGainedDay.GetValue()>=0 && FatGainedDay.GetValue()<=2 PlayerRef.SetWeight(PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+2) PlayerRef.QueueNiNodeUpdate() FatGainedDay.SetValue(0) endif if FatGainedDay.GetValue()==0 DaysWithoutEat.SetValue(0) FatGainedDay.SetValue(0) endif endif EndEvent Function RegisterForMenu(String MenuName) Native Event OnInit() StatusChecks() EndEvent Function StatusChecks() RegisterForMenu("RaceSex Menu") EndFunction Event OnMenuClose(String MenuName) MenuName="RaceSex Menu" PlayerRef.UnEquipAll() PlayerRef.SetWeight(0) PlayerRef.QueueNiNodeUpdate() EndEventThis script regulates the player's weight, placed keywords all around the place to make sure it works correctly. Do you think you have to use this function: http://www.creationkit.com/UpdateWeight_-_Actor ? I didn't have to use it before, I know that all of those lines DO work in that order(I experimented with this before in an onupdate event) but there is something stopping them from working with the OnMenuClose event.. I'll have to find a workaround I guess, maybe using an OnUpdate Event to set that weight then unregistering, but there's the slight problem that Event may be running during ShowRaceMenu, oddly enough I have found out that as soon as I get out of ShowRaceMenu my movementspeed doesn't get updated until after 1 second has passed, so there is a possibility that OnUpdate events are paused during ShowRaceMenu, so there's a chance. Edited January 17, 2015 by Kerberus14 Link to comment Share on other sites More sharing options...
Ellorienne Posted January 17, 2015 Share Posted January 17, 2015 (edited) Haha no worries Matthias :smile: I think I may have found something that could work, based on the sliver sword effect. Add a script to the new weapon - Scriptname ElloAbSharpened extends ObjectReference Perk Property ElloAbSharpened autoEvent OnEquipped(Actor akActor) akActor.AddPerk(ElloAbSharpened)EndEventEvent OnUnEquipped(Actor akActor) akActor.RemovePerk(ElloAbSharpened)EndEvent Then create the perk with Entry Point Mod Target Damage Resist with a multiplier of 0.94 (Sharpened trait increases armor [and spell, but I'm only doing a test run, so only added the one] penetration by 6% ie ignores 6% of damage resistance). Is there a way I can see that perk is working when I equip the weapon? Edited January 17, 2015 by Ellorienne Link to comment Share on other sites More sharing options...
lofgren Posted January 17, 2015 Share Posted January 17, 2015 The USKP team made some changes the silver weapon perk and script because in certain situations it can cause bugs, so I would recommend checking out their changes and considering whether you need to incorporate them into your version. Unfortunately I have not found a good way of testing this type of perk in-game. You just have to have faith. Link to comment Share on other sites More sharing options...
Ellorienne Posted January 17, 2015 Share Posted January 17, 2015 (edited) Ok, I checked that and the post I found the information on must have already had USKP installed, so I'm all good there. Thanks for the tip. It looks like ESO style traited armor and weapons will be achievable :D Combining my two favourite TES games = bliss. Will these effects stack if wearing two of the same type? Edited January 17, 2015 by Ellorienne Link to comment Share on other sites More sharing options...
Hammerbane Posted January 17, 2015 Share Posted January 17, 2015 Is it possible to set the in-game audio volume through scripting? For example, if you wanted to play a custom piece of music for a short amount of time.Also, why isn't this thread stickied yet? Link to comment Share on other sites More sharing options...
Kerberus14 Posted January 17, 2015 Share Posted January 17, 2015 (edited) Can anyone make me an example script that does this?: After X hours of game time had passed, increase value of a variable by Y. @Matt Scriptname SkyEndWeight extends ObjectReference Actor Property PlayerRef autoKeyword Property Drink autoKeyword Property Food autoGlobalVariable Property FatGainedDay autoGlobalVariable Property DaysWithoutEat autoFloat Property Starving auto Float Property CountDrink autoFloat Property CountFood autoFloat Property Fat auto ;Function SetWeight(float weight) native;float Function GetWeight() native;Function QueueNiNodeUpdate() native Keyword Property Vampire auto Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) if akBaseObject as Potion && akBaseObject.HasKeyword(Drink)Fat= FatGainedDay.GetValue()CountDrink=CountDrink+0.5Fat=Fat+CountDrinkFatGainedDay.SetValue(Fat)CountDrink=0endif if akBaseObject as Potion && akBaseObject.HasKeyword(FOOD)Fat=FatGainedDay.GetValue()CountFood=CountFood+1Fat=Fat+CountFoodFatGainedDay.SetValue(Fat)CountFood=0endif EndEvent Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime)PlayerRef.UnEquipAll() if Starving>0Debug.Messagebox("I'm starving, I have lost weight.")elseif Starving == 0Debug.Messagebox("I've gained " + FatGainedDay.GetValue()/10 + " kilograms.")endif EndEvent Event OnSleepStop(bool abInterrupted) if PlayerRef.HasKeyword(Vampire)==0 if FatGainedDay.GetValue()>9FatGainedDay.SetValue(9)PlayerRef.GetActorBase().SetWeight(PlayerRef.GetWeight()+FatGainedDay.GetValue()/10)PlayerRef.QueueNiNodeUpdate()float NeckDelta= PlayerRef.GetWeight()+FatGainedDay.GetValue()/10PlayerRef.UpdateWeight(NeckDelta)FatGainedDay.SetValue(0)endif if FatGainedDay.GetValue()>=7.5 && FatGainedDay.GetValue()<=9PlayerRef.GetActorBase().SetWeight(PlayerRef.GetWeight()+FatGainedDay.GetValue()/10)PlayerRef.QueueNiNodeUpdate()float NeckDelta= PlayerRef.GetWeight()+FatGainedDay.GetValue()/10PlayerRef.UpdateWeight(NeckDelta)FatGainedDay.SetValue(0)endif if FatGainedDay.GetValue()>=6 && FatGainedDay.GetValue()<=7.5PlayerRef.GetActorBase().SetWeight(PlayerRef.GetWeight()+FatGainedDay.GetValue()/10)PlayerRef.QueueNiNodeUpdate()float NeckDelta= PlayerRef.GetWeight()+FatGainedDay.GetValue()/10PlayerRef.UpdateWeight(NeckDelta)FatGainedDay.SetValue(0)endif if FatGainedDay.GetValue()>=4.5 && FatGainedDay.GetValue()<=6; Any value between 4.5 and 6 means you keep your current weightFatGainedDay.SetValue(0)endif if FatGainedDay.GetValue()>=3.5 && FatGainedDay.GetValue()<=4.5PlayerRef.GetActorBase().SetWeight(PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+0.5)PlayerRef.QueueNiNodeUpdate()float NeckDelta= PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+0.5PlayerRef.UpdateWeight(NeckDelta)FatGainedDay.SetValue(0)endif if FatGainedDay.GetValue()>=2 && FatGainedDay.GetValue()<=3.5PlayerRef.GetActorBase().SetWeight(PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+1)PlayerRef.QueueNiNodeUpdate()float NeckDelta= PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+1PlayerRef.UpdateWeight(NeckDelta)FatGainedDay.SetValue(0)endif if FatGainedDay.GetValue()>=0 && FatGainedDay.GetValue()<=2PlayerRef.GetActorBase().SetWeight(PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+2)PlayerRef.QueueNiNodeUpdate()float NeckDelta= PlayerRef.GetWeight()-FatGainedDay.GetValue()/10+2PlayerRef.UpdateWeight(NeckDelta)FatGainedDay.SetValue(0)endif if FatGainedDay.GetValue()==0Starving = Starving + 1elseif FatGainedDay.GetValue()!=0Starving = 0endif if Starving == 14PlayerRef.DamageActorValue("Health",9999999999)endif endifEndEvent ; Function UpdateWeight(float neckDelta) nativeInt Property Once auto Event OnInit()Once=1Starving = 0StatusChecks()EndEvent Event onRaceSwitchComplete()Once=1Starving = 0StatusChecks()EndEvent Function StatusChecks()RegisterForSingleUpdate(5.0)EndFunction Event OnUpdate()if PlayerRef.HasKeyword(Vampire)==0if Once==1PlayerRef.UnEquipAll()Float NeckDelta =0PlayerRef.GetActorBase().SetWeight(0)PlayerRef.QueueNiNodeUpdate()PlayerRef.UpdateWeight(NeckDelta)once==0UnRegisterForUpdate()endifendifEndEvent This is the complete script, I was right, OnUpdate events are paused during showracemenu, so this works like a charm. And I did have to use the UpdateWeight function because the neck did look pretty odd =p, I don't know if QueueNiNode is still necessary or if it has any ramifications if kept there, but I'll just keep it there incase. Because of the keywords I added to all the food items in the game it correctly checks if I'm drinking or eating. The only thing that I haven't tested yet is the OnSleepEnd and OnSleepStart events because I haven't had time XD, at this point I just wished I had testers. Additional: Is it possible to advance the rate at which time passes in Papyrus? And how? Edited January 17, 2015 by Kerberus14 Link to comment Share on other sites More sharing options...
Recommended Posts