Duk3nat0r Posted December 6, 2012 Share Posted December 6, 2012 (edited) Hi guys, I need some help with scripting please, and there are basicly three questions. Background: I'm working on a house mod where you can buy upgrades for the house, and the only tutorials I found was about adding new upgrades to existing houses, so I had to build the quest from the ground up. I dont have any scripting background, so this is a first for me. Question 1: I'm using the following script when buying an upgrade: (note the "xxxxxx" is just a place holder, since each upgrade differ) Scriptname TIF__xxxxxxxx Extends TopicInfo Hidden Function Fragment_0(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actorgame.getplayer().removeitem(gold, tdNarmoHall.value as int)decoratemarker.enable()EndFunction MiscObject Property Gold Auto int Property GoldAmount Auto ObjectReference Property DecorateMarker Auto GlobalVariable Property tdNarmoHall AutoWhat I need help with, is how do I script a three day delay before decoratemarker.enable() is enabled? Question 2: Then, how do I make the option of this specific upgrade not appear in the dialog during the three day delay? Question 3: In the games HousePurches quest, when an upgrade is purchesed the "GetVMQuestVariable" condition is set and "SolitudeHouseVar_var" (just an example) is used. Do I need this for my quest? And how do I set these var up? Any help is welcome, tx! Edited December 6, 2012 by Th3 Duk3 Link to comment Share on other sites More sharing options...
dfac364 Posted December 7, 2012 Share Posted December 7, 2012 Im just throwing out an idea because im not sure how well this would work, but for the three day delay the only thing i could think of without going crazy deep in advanced scripting would be to use utility.wait(500) 500 just being a random number as an example although im not sure how well this would work but im guessing not so well, adn you would definitely want it to be the last line of your script, other than that I assume their would be some way to get the current day of the week as a numerical value than have it add three and set a quest stage specifically made for activating the marker on that day, but im not that great with scripts, to be honest sounds like a lot more work than its worth. As for the second question, you could do that by setting a condition to the dialogue topic, hope this helps and good luck Link to comment Share on other sites More sharing options...
BigKevSexyMan Posted December 8, 2012 Share Posted December 8, 2012 I wouldn't use a utility.wait. It seems like it might be volatile. What I would do instead, is creation a spell that lasts for three days. Then cast it on the user. Now, attach a script to it. Add a Quest Property to the script. Then, using the OnEventStart event you can set the stage to a waiting stage, and use the OnEventFinish to set the stage to the current "completed house" level. Link to comment Share on other sites More sharing options...
scrivener07 Posted December 8, 2012 Share Posted December 8, 2012 use utility.wait(500) What I would do instead, is creation a spell that lasts for three days :facepalm: :facepalm: :facepalm: lol http://www.creationkit.com/RegisterForSingleUpdateGameTime_-_Form Link to comment Share on other sites More sharing options...
Duk3nat0r Posted December 8, 2012 Author Share Posted December 8, 2012 (edited) :laugh: someone already gave me this advice: Utility.WaitGameTime(72); script pauses for 72 hoursMyObject.Enable() I'll check to see if it works. But I still need some help with the other two questions. Edited December 8, 2012 by Th3 Duk3 Link to comment Share on other sites More sharing options...
scrivener07 Posted December 8, 2012 Share Posted December 8, 2012 You could try something like this in a new script attached to your quest. Scriptname DecorateMyHouse extends Quest ;assuming your quest name is... PlayerHomeQuest Int PendingUpgrade ObjectReference property decoratemarker01 auto ;chair marker ObjectReference property decoratemarker02 auto ;table marker ObjectReference property decoratemarker03 auto ;bed marker ;#2 I never play with dialogue but Im sure its really easy. ;#3 You dont think you need to mess with the VMQuestVariable for your custom house. Event OnUpdate() debug.trace(self + " Enabling house upgrade " + PendingUpgrade) if (PendingUpgrade == 1) decoratemarker01.enable() ;chair return elseif (PendingUpgrade == 2) decoratemarker02.enable() ;table return elseif (PendingUpgrade == 3) decoratemarker03.enable() ;bed return else debug.trace(self + " Something went wrong..") endif EndEvent ;You can even get really crazy and design the function to handle the gold amount too i guess function SetUpgrade(int _upgrade) if (_upgrade == 1) PendingUpgrade = 1 RegisterForSingleUpdateGameTime(72.0) ;In three days run the OnUpdate() block return elseif (_upgrade == 2) PendingUpgrade = 2 RegisterForSingleUpdateGameTime(72.0) return elseif (_upgrade == 3) PendingUpgrade = 3 RegisterForSingleUpdateGameTime(72.0) return else debug.trace(self + " Upgrade number not valid") endif endfunction Then is your dialogue script just call the SetUpgrade(x) function where x is the upgrade you want. Scriptname TIF__xxxxxxxx Extends TopicInfo Hidden Function Fragment_0(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor game.getplayer().removeitem(gold, tdNarmoHall.value as int) ;decoratemarker.enable() doing this different PlayerHomeQuest.SetUpgrade(2) ;adds a table in three days EndFunction ;<scriptName> Property <QuestName> Auto DecorateMyHouse Property PlayerHomeQuest auto ;declare path to custom function MiscObject Property Gold Auto int Property GoldAmount Auto ;ObjectReference Property DecorateMarker Auto ; doesnt need to be here anymore GlobalVariable Property tdNarmoHall Auto Its not perfect and doesnt handle every situation but I think its a good start. Link to comment Share on other sites More sharing options...
Duk3nat0r Posted December 23, 2012 Author Share Posted December 23, 2012 Tx scrivener07, I'll have a look at it. Link to comment Share on other sites More sharing options...
Recommended Posts