Campaigner Posted July 10, 2010 Share Posted July 10, 2010 I'm feeling stupid right now, for I've searched for hours and can't figure this out. I want to make the following things happen for one mod; 1. Key available from the get go for a door, but the door will only open at a specific hour of the gametime. (IE, the door will only open at 1:43 PM)2. The door does not appear until a note is read (in case you don't want an object in the way at all times)3. Map Marker set so that it is already available, even if you haven't been near it. I did it one time, and I can't figure out how I did it.4. A reusable soul gem like Azura's Star, but with different models. I've tried dimply duplicating the star and changing its model, but it ends up working like a regular soul gem instead. Some help on these tedious little things would be oh so amazing, as it's all that's stopping me from uploading my new mod. Link to comment Share on other sites More sharing options...
Dyshein Posted July 10, 2010 Share Posted July 10, 2010 1. You'd need to make a script that uses variable to get the current time and compare it with the required time, but I'm no scripting pro so I can' help you with what it would look like. 2. I don't know if there is a way to get something to activate if you just read a note, but something like this will enable the door if you pick it up (and set the quest stage to a different stage so you can drop it and stil have the door open) Begin Gamemode If Player.GetItemCount (noterefID) >= 1 && GetStage (questname) == 10 (doorrefid).enable setstage (questname) 20 endif end 3. Just double click the marker, click on the marker data tab, check visible. Link to comment Share on other sites More sharing options...
Campaigner Posted July 11, 2010 Author Share Posted July 11, 2010 2. When I enter that info, along with the note's refID (the overworld one, I suppose), the quest name (in parenthesis), the door and surrounding parts' refIDs (overworld), it says none of them exist, and does not save the script.3. Ah, that did it. Thanks Link to comment Share on other sites More sharing options...
Dyshein Posted July 11, 2010 Share Posted July 11, 2010 Ah, sorry, I was just using parenthesis to show what you are supposed to fill in, you shouldn't actually use them in the script >.>. The best way is to find the refID and use that, like 000112EE.enable. Make sure you are using the RefID and not the Form ID (The formID is the id of the item in the editor, the RefID is the id of a specific item you have placed in the world and can be found by double clicking on it). for quests use Editor ID, not the name that shows up to the player if there are journal entries. Link to comment Share on other sites More sharing options...
Campaigner Posted July 11, 2010 Author Share Posted July 11, 2010 mmkay, I got the script working now, but I still can't get the quest to work. As said in the first post, I want it to start from a certain object, namely "AAAAScribbledNote". Upon picking it up, I don't get a quest notification. I put the condition as "Getitemcount AAAAScribbledNote ==> 1.0000, but it still didn't show up. EDIT: scratch that, it didn't work. The door is not there, even after I put the script on the scroll. Link to comment Share on other sites More sharing options...
Dyshein Posted July 11, 2010 Share Posted July 11, 2010 It sounds like your script isn't running, which could be because your quest isn't running. If you aren't activating your quest from an outside source, you could just do this: Begin Gamemode setstage questname 10 If Player.GetItemCount noterefID >= 1 && GetStage questname == 10 doorrefid.enable setstage questname 20 endif End This will make the quest start itself pretty much as soon as you load the game up, assuming you have start game enabled checked in the quest data tab. Scripting is all trial and error, the more you mess with it the more you learn. I just figured things out by reverse-engineering the scripts from other quests in oblivion. Link to comment Share on other sites More sharing options...
Tefnacht Posted July 11, 2010 Share Posted July 11, 2010 1. You don't need to create a key for the door at all if you only want to restrict the time when it can be opened. All you need is a script for the door that does its “magic” within a OnActivate block. A scripted object with a OnActivate block will NOT execute its default action when it is activated, unless the script itself uses the Activate command. So a scripted door will not open, unless the script specifically tells it to.The command to get the current ingame time is GetCurrentTime (Beware, the returned time is in 24 hour decimal format!). A script for a door that can only be opened between 1:43 pm and 2:00 pm would look like this:ScriptName TEFDemoTimedDoorScript Begin OnActivate If (GetCurrentTime >= 13.7166) && (GetCurrentTime <= 14) ;if the time window matches Activate ;open the door Else ;otherwise give feedback MessageBox “This door only opens between 1:43 pm and 2:00 pm. Come back later.” EndIf End 2. While Dysheins solution should work, I find it overly complicated. No offense. Just enable the door from a OnEquip block of a scripted scroll/book. For this to work, the door has to be a persistent reference, so we can “access” it with a script running on a different object (the scroll). Find the door in the render window, double click it, make sure “Persistent Reference” is ticked (on a load door it will be ticked already and grayed out, load doors are always persistent), enter a unique “Reference Editor ID” and then tick “Initially Disabled”. This will make the door invisible when the game starts until we enable it later. Lets assume you gave the door the ID “TEFDemoDoor”. The script on the scroll would look like this:ScriptName TEFDemoScrollScript Begin OnEquip Player TEFDemoDoor.Enable ;make the door visible and usable EndThe OnEquip block of scrolls and books is run when the scroll/book is read. This means the door reference will be enabled every single time the player reads the scroll/book, but that doesn't matter. If it was already enabled, enabling it again doesn't do anything bad. 4. The behavior of Azura's Star seems to be hardcoded into the game, there is no “simple” way to duplicate its effects. To my knowledge, there is no script block that gets executed when a soul gem is used on a enchanting altar either. I just did some tinkering and couldn't find any.I managed to duplicated the effect with a quest script and a item script though. It would require some more polishing I guess, I am not sure that it is water-proof. There might be some situations where a new gem is added although the old one wasn't really used. Here are the scripts I punched together. They assume that the re-usable soul gem is called “TEFSoulGem”, and the quest “TEFSoulDemoQuest”. The quest needs to have “Start game enabled” ticked. If you use different names, make sure to change them in the scripts too. The object script for the re-usable soul gem:ScriptName TEFSoulGemDemoScript Begin OnDrop ;if the gem is dropped Set TEFSoulDemoQuest.checkforgem To 0 ;we do not need to check for it anymore End Begin MenuMode 1042 ;if we are in the enchantment menu If (Player.GetItemCount TEFSoulGem > 0) ;if the player has the re-usable soul gem in his inventory Set TEFSoulDemoQuest.checkforgem To 1 ;set the quest variable to check if the gem is still there afterwards EndIf EndThe quest script:ScriptName TEFSoulDemoQuestScript short checkforgem ;set to 1 if the player has the reusable soul gem and used a enchanting altar Begin GameMode ;in game mode If (checkforgem) ;if we should check for the gem If (Player.GetItemCount TEFSoulGem == 0) ;if the gem is gone (was used) Player.AddItem TEFSoulGem 1 ;add a new (empty) one EndIf Set checkforgem To 0 ;we do not need to check again EndIf End Maybe this helps, even if it is a huge wall of text.Shadow hide you. Link to comment Share on other sites More sharing options...
Campaigner Posted July 11, 2010 Author Share Posted July 11, 2010 EDIT; I fixed the door, the activate line was not on its own line for some reason. However, the soul gem didn't work. I have a feeling it is because the quest didn't start for whatever reason, despite me having clicked "Start Game Enabled". What could be the problem? Link to comment Share on other sites More sharing options...
Tefnacht Posted July 12, 2010 Share Posted July 12, 2010 I have no idea. I just copy&pasted the scripts I posted into a new plugin, created a new quest and soulgem with the names my posted scripts use and...it works. I even double checked that I did not use any OBSE commands by accident. I didn't. Everything is vanilla script. Those scripts should work. Make sure you test your mods with a “clean” savegame. If you created a mod containing a quest, started the game with that mod loaded, then created a savegame, exited the game, edited the quest in the mod and then restart the game and load that savegame again... you enter a world of potential pain, suffering and malice.Depending on what you edited in the quest, it can work... or not work... or cause a CTD (crash to desktop).If you make a mistake the Construction Set didn't recognize (or your editing caused a unexpected game-state), Oblivion will normally stop processing the script with the mistake in it. If you make or cause a BIG mistake, Oblivion will CTD before it even had a chance to notice that there is something amiss. Since your game didn't CTD, it is probably a minor issue. Try again with a savegame created BEFORE you added your mod to the load list. Other than that, I really have no idea. Need. More. Input. If worse comes to worse, you can always resort to shotgun-debugging: If you are not sure if a script is run, or if a script reaches a certain If-EndIf block, put a MessageBox command in there. If you start the game and the message box does not pop in your face, you know for sure the script itself is not running.If you use OBSE, use PrintToConsole instead. It is less intrusive and doesn't prevent you from gracefully exiting the game in case your messagebox command is called inside a infinite loop. Link to comment Share on other sites More sharing options...
jaime74 Posted July 29, 2010 Share Posted July 29, 2010 (edited) If you created a mod containing a quest, started the game with that mod loaded, then created a savegame, exited the game, edited the quest in the mod and then restart the game and load that savegame again... you enter a world of potential pain, suffering and malice.Is this really the only sad truth? Aren't there any means at all to guarantee compatibility of updated quest mods with outdated savegames?For some reason, I still don't want to give in to what Tefnacht states... :)I am wondering how all those brilliant quest modders outside there usually handle their mod updates without breaking thousands of savegames! If every quest mod would demand a "clean" save with every update, we would forces players to start the quest all over every time! Right now I am fighting with exact that issue, and I don't want to give up hope: I have created a quest and playtested it multiple times up to several different stages, and created savegames for every stage. And now - after changes to the code - some savegames are not compatible anymore (items are missing etc.), while others are. Well, I have been warned, of course, but something makes me not believe that this is all unavoidable! I tried my best to track this down to a lot of possible reasons, and I believe that this is not caused by script code changes! I have done everything, for instance, to avoid the common known issue caused by changing script variables, detected by Wrye long time ago (read this section in the TES CS Wiki for details). Does anybody have some more experience with that problem? What could be other possible reasons? [EDIT: I have now posted this question in better words here.] Edited July 29, 2010 by jaime74 Link to comment Share on other sites More sharing options...
Recommended Posts