Jump to content
⚠ Known Issue: Media on User Profiles ×

Merrymac

Premium Member
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Merrymac

  1. Hey, thanks! I tried your script and it both looked promising and compiled fine, but wouldn't remove the tome, either in the inventory, a container or on the ground. I tried both with Self.GetBaseObject() and mybaseobject. It might be fixable by keeping the individual book properties I have now, but I am also worried it won't fully cover reading a book from the player's inventory while accessing a container (seems like it would always try to remove the item from the container, if I'm reading it right) and/or reading a book from an NPC's inventory. Since the SKSE part feels like a safeguard against that, and perhaps other ways of reading books I don't know about, I think I'll just go with that.
  2. It's actually coming along so far--The BlockActivation() part, together with being able to check for specific menus with SKSE should put the necessary constraints in place, so that the books in question won't trigger the OnRead() script from anywhere outside the player's inventory. So far I can't think of any other ways to access book contents in-game, at least. It would have been ideal to not have to rely on SKSE and to not have individual book properties for every tome, but I've done worse mods :) I've just started copying the scripts and adjusting the book properties for each tome (using TES5Edit, so it's not that bad) and will play with it for a while to test. Seems promising for now, thanks a lot for the help again! Glorious credit will be yours if it ends up on the nexus :D
  3. I solved my container problem with SKSE, by adding a UI.IsMenuOpen("InventoryMenu") condition to the OnRead() event. Now it looks like this: Event OnRead() if UI.IsMenuOpen("InventoryMenu") Game.DisablePlayerControls(False, False, False, False, False, True) int ScrollAmount = Utility.RandomInt(5, 8) Game.GetPlayer().AddItem(RandomScroll, ScrollAmount) Game.GetPlayer().RemoveItem(ThisTome, 1, true) Game.EnablePlayerControls(False, False, False, False, False, True) endif EndEventIf not in the player's inventory menu, it just plays the book opening animation instead. Perhaps not the most elegant solution, but it does the job \o/
  4. Self refers to the objectreference, not the base object. You should use something like actor player = Game.GetPlayer() book myTome = self.GetBaseObject() as book player.RemoveItem(myTome, 1, true) Isn't the reference actually what I want to remove, since that is the instance of the base object being activated? Or am I misunderstanding how that works? I tried adding this, but it wouldn't remove the item from the inventory. You are absolutely right, BlockActivation() solves my initial problem! I'm fine with having to define book properties for each tome, so this is what I have right now: Scriptname _SCR_ScrollTomeLarge extends ObjectReference LeveledItem Property RandomScroll auto Book Property ThisTome auto Event OnLoad() BlockActivation(true) EndEvent Event OnActivate(ObjectReference ThisTome) self.Disable() Game.GetPlayer().AddItem(ThisTome, 1, true) Utility.Wait(1.0) self.Delete() EndEvent Event OnRead() Game.DisablePlayerControls(False, False, False, False, False, True) int ScrollAmount = Utility.RandomInt(5, 8) Game.GetPlayer().AddItem(RandomScroll, ScrollAmount) Game.GetPlayer().RemoveItem(ThisTome, 1, true) Game.EnablePlayerControls(False, False, False, False, False, True) EndEventNow it appears as if you just pick up the tome when it's placed in the world and then activated, and when you use it from the inventory, it adds the scrolls and removes one copy of itself. However, I just realized that it's possible to read a book while it's still in a container, which has presented kind of the same problem over again, except that this time it can't be solved by BlockActivation() ;) So I'm currently banging my head against how to find out if the book is in a container or not. Thanks a lot for your help, it's greatly appreciated! Let me know if you have any ideas about containers as well :D
  5. Thanks, I tried using that, but it seems like activating a book enters menumode (presumably because the book opens) regardless of whether it's from the inventory or the world. Maybe there is a clever way to use it for my purpose, but so far I haven't come across any myself.
  6. I want to turn all existing spell tomes into bundles of scrolls, so that when the player "reads" them, an amount of different scrolls are received instead of learning a spell or opening the book. Here's a script I have attached to a tome (which is changed to being a regular book), which does so successfully: Scriptname _SB_ScrollBundleLarge extends ObjectReference LeveledItem Property RandomScroll auto Event OnRead() Game.DisablePlayerControls(False, False, False, False, False, True) Game.GetPlayer().AddItem(RandomScroll, 6) Game.EnablePlayerControls(False, False, False, False, False, True) endEventHowever, I also need to remove the book itself (which the script is attached to), and this has to account for both the book being in the player's inventory, and the book being activated as an object in the world, outside the inventory menu. Adding the following works for the latter scenario, but does nothing when in the inventory menu: self.Disable() Utility.Wait(1.0) self.Delete()RemoveItem works while in the inventory menu, but I could not get it to work with Self, which means I would have to manually add a property for each book, and also somehow make sure that part doesn't fire when a book is activated outside the inventory menu. I also tried keeping the book as an actual spell tome, having the player learn a dummy spell without effects and attaching the same script to it, with RemoveSpell DummySpell added so the book could be used again. This seemed really buggy however, in that sometimes the script would just not fire at all, and it displays an unwanted "spell learned" notification. Is there any simple way to have the script remove the book it's attached to, no matter where/how the book is activated? Alternatively, is there a way to detect if the book is being read from the inventory menu or outside it, so that the player would simply pick it up when activating it outside?
  7. I'm making a mod to expand on substance addiction and withdrawal, and I am fairly new to scripting (both for FNV and in general). I kinda learned as I went along, and I now have large portions of my total script content running as effect scripts -- When the player gets addicted to something, a magic effect is cast on them, which has a base effect tied to a script that constantly checks for withdrawal effects, increased/decreased addiction levels, if the player is sleeping, and a few other things. I have since noticed that effect scripts seem to run on every frame and I'm guessing that they might be a lot more resource intensive. I also have the impression that using quests for those kinds of scripts is more normal overall. Is it a bad idea to have long-lasting and kind of big scripts running as effects? It seems to work fine in my otherwise heavily modded game, but I plan to release it and don't want it to blow anyone else's computer up :) Converting it all into quest scripts would take some time, so I just want to make sure it's necessary, or at least recommended, first.
  8. As part of my increasingly intricate mod setup, having cells (cleared or not) reset after only 24 hours is vital. However, for a lot of outdoor areas, this means the hand-placed static dragons (near word walls and such) reappear just as quickly, which is not as desirable. Does anyone know of a way to separate the dragon respawn rate from the general cell respawn time? Unconfirmed ideas are welcome too, I don't mind trying to make my own mod for it.
  9. Yeah, I think it makes sense that it has to do with computer resources. The game does run pretty well overall, but there's no denying that my mod list is a bit on the long side :) I've experienced creatures/NPC "pop-in" before, on a lower-end computer, but those have at least appeared where they should. I still don't understand how the creatures appear right next to me instead of where they are supposed to, and the thing is that I see them before the spawning happens. For example, before the spot that i posted a screenshot of in my previous post, I pass a tower with some bandits in it and I can see them clear as day while running. Then, a short stretch after, the exact same bandits appear again, next to me, and just start walking back to the tower. I did also revert to ugrids 5 for a while and still had it happen. But I guess I'll have to clean out a lot more to fix this. Thanks!
  10. I have started a new game, and after playing for a while, the problem appeared again. I realize this isn't a very common issue, but any insight at all is greatly appreciated as it totally ruins the experience of traveling. After doing some testing, I am now pretty sure it only happens to creatures/NPCs I have passed - My guess is that creatures from a cell I was just in teleport to me when I cross over to a new one, but this is just me speculating. I don't know enough about how Skyrim works or how the outdoor cells are divided to confirm this. I did, however, find a spot where I could reproduce the bug. I have attached a screenshot of the location below, and running from Haemar's Shame to this spot (with speedmult modified to 300), the game will suddenly spawn foxes, bears, deer and bandits I have passed along the way. They will often not be hostile to anyone, and instead walk back to where they are supposed to be. Here is the location (where my player marker is): And here is a party of stuff that suddenly spawns there: Again, any help or thoughts are greatly appreciated.
  11. Whenever I travel outdoors, there is a good chance for creatures I have previously met/passed to spawn right next to me, even in places they shouldn't exist. This usually includes wildlife and/or bandits, but I have also had friendly named NPCs spawn in the same way, far away from their usual paths. I think this only occurs when I have passed their original location beforehand, but it doesn't seem to be limited to specific creatures. It does not have anything to do with fast travel (I play with both fast travel and carriages disabled) - they simply pop up right beside me as I'm running or riding. I am running the latest skyrim update and all of the latest unofficial patches. My ugridstoload is set to 7, but I have tested it with 5 and still had the same problem - not that I really know if that could cause it, but it was just something that came to mind. Googling didn't turn up much. It seems some people have had trouble with corpses appearing on fast travel, but that's not exactly the same and was supposedly fixed in a patch. Does anyone have any experience with this? Thanks! Modlist: Snowcrabs:
  12. Edit: Never mind, it was the draugr eye effect and I just had a severe case of the derps. I apparently hadn't tried all of the "draugr abilities" IDs while both deactivating USKP and loading the script fix from this thread. Adding and removing one of the other IDs (not f71d1) fixed it. Might be because I am using the Requiem mod, as it changes quite a lot - not sure. Tip for others having difficulties with this effect: type help "draugr abilities" in the console and try adding/removing all the IDs listed.
×
×
  • Create New...