Jump to content

cdcooley

Premium Member
  • Posts

    2124
  • Joined

  • Last visited

Everything posted by cdcooley

  1. That is fairly easy, but details matter so what's the setup for your toggle-able fireplace? Here's a basic script that I haven't tried to compile so there may be errors, but it should get you pointed in the right direction. Change the ZZZ prefix to something more appropriate for your mod. This script assumes there's a fire object that gets enabled and disabled and it's linked to the activator in the CK. Instead of using GetLinkedRef() you could also use an ObjectReference property for that fire object. If the fire is triggered in some other way like playing an animation then things might need to be rewritten if need states to track the current status of the fire. ScriptName ZZZ_FireplaceActivatorScript extends ObjectReference Event OnActivate(ObjectReference akActionRef) if GetLinkedRef().IsDisabled() if charcoalAvailable ; charcoal was made the last time the fire burned so give it to the player charcoalAvailable = false PlayerRef.AddItem(Charcoal, 1) ; one charcoal stick PlayerRef.AddItem(Coal01, 1) ; and one charcoal block endif if PlayerRef.GetItemCount(Firewood01) > 1 PlayerRef.RemoveItem(Firewood01, 2) GetLinkedRef().Enable() RegisterForSingleUpdateGameTime(4.0) ; 4 game hours elseif ZZZ_FirewoodStorage && ZZZ_FirewoodStorage.GetItemCount() > 1 ZZZ_FirewoodStorage.RemoveItem(Firewood01, 2) GetLinkedRef().Enable() RegisterForSingleUpdateGameTime(4.0) ; 4 game hours else NeedFirewoodMSG.Show() endif endif EndEvent Event OnUpdate() GetLinkedRef().Disable() charcoalAvailable = true EndEvent bool charcoalAvailable Message Property ZZZ_NeedFirewoodMSG Auto {"Two firewood needed to light fire." or something similar.} ObjectReference Property ZZZ_FirewoodStorage Auto {Optional reference to a container near the fireplace that can be used by the player to store firewood. The player can then light the fire even if not carrying firewood (but will need to refill the container periodically).} MiscObject Property Charcoal Auto MiscObject Property Coal01 Auto MiscObject Property Firewood01 Auto Actor Property PlayerRef Auto
  2. The dummy file idea works but it has to be a valid plugin file. You can copy any small esm or esp file and rename it to the missing DLC (or other mod) file. Use the "Apply Script..." option on the follower plugin and run the "List records referencing specific plugin" script to list all of the dependencies. After you've edited all of the listed records to remove the dependencies you can use the "Clean Masters" option.
  3. Combined with the conditions you're already checking IsWeaponMagicOut should work.
  4. If your willing to determine the adjustments needed based on player height and camera settings you should be able to use the GetAngleZ and GetAngleX to do it. Here is the logic I use to move the selection cube from my Decorator Helper mod to a spot in front of the player adjusted by the player's viewing angle. The way I'm calculating the offZ value works well enough for my approximate positioning but the basic factors are the player/camera height and scaling based on object distance. float angZ = PlayerRef.GetAngleZ() float offZ = 120.0 - 125,0 * sin(PlayerRef.GetAngleX()*1.25) MoveTo(PlayerRef, 100.0 * sin(angZ), 100.0 * cos(angZ), offZ)
  5. They are deleted just like the code says. In code, delete means delete. Moving them to the recycling bin would have been harder and serve no real purpose. Technically if you put that script in some other folder with files that end in .skse but aren't really SKSE64 co-save files then it could delete the wrong things. But I don't know of any other program that uses the .skse extension and even if you had one why would you use that script on its files?
  6. There are only two things to know about the start game enabled quests. First, dialogue associated with them won't work correctly unless you have generated a .SEQ file or the game has been saved and reloaded. Second, the quest will attempt to start while you are still on the main start menu which means the OnInit event will run for any scripts on that quest before everything is set up correctly. (The OnInit event will also be run when it should when you're loading a new game, but if you have functions in the OnInit event that need to run in game time mode you could end up with two version of OnInit running at the same time with different views of the state of the game. Appropriate use of RegisterForSingleUpdateGameTime can overcome the OnInit event problems.) If your quest has dialogue you need to generate the matching SEQ file. If you're doing anything complicated in the OnInit event you should move the real action to OnUpdate and call RegisterForSingleUpdateGameTime from OnInit. Simple things like adding an item to the player are fine to put directly in OnInit though.
  7. There's no script length limit if you use an external text editor instead of the Creation Kit editor. So if your only problem is script length I recommend just editing that script externally and compiling outside of the CK. You can still use the CK to attach the script to objects and fill properties, you just won't be able to edit it after it gets too large. The CK Wiki has info about setting up an external editor.
  8. The writing, acting, and other things that give the character personality are the critical parts. Inigo (which has been mentioned) has very little actual scripting and the first version was even on the standard follower framework with no custom scripting. The technical thing you need to master is use of the conditions for dialogue. The situational awareness that Inigo seems to have is really just thousands of dialogue lines with appropriate conditions. For example, lines about how much Inigo likes the rain have conditions to make sure it's actually raining. To keep his comments from being annoying various lines are also conditioned to only play at certain times of day, days of week, if the player is holding a torch, etc. Deck16 has a pretty good tutorial at Making a unique-voiced follower in Skyrim that covers all of the critical basics. If you're going to do a custom-voiced character that you don't want to be treated like just one more member of the team by the multi-follower framework mods (EFF, AFT, iAFT, etc.) then I recommend you don't use the standard follower framework. With just 3-4 simple AI packages, a few script fragments, and about a dozen dialogue entries you can do just about everything the standard framework does for you. If anyone is serious about trying this I can give more specific guidance. Or you can be like SmartBlueCat and create a standard-framework follower so compelling that by the time you've hit the limits of the standard framework someone (maybe me) offers to take your character off that system and give it the scripting brains to match the personality you've already given it. The main thing scripting can do is make the character more aware of the world and not look like an idiot. But there are limits, so make sure you come up with some excuse to explain why your character sometimes makes inappropriate comments or repeats things.
  9. That looks reasonable to me. You could accomplish the same thing without the quest to check distance to the player and locate the nearest container (because there are matching functions that can do that) but it's not going to run any faster so there's no point in changing things.
  10. Using "sqv dialoguefollower" in the console will also show you the reference id for your current human and animal follower in the list of aliases for that quest.
  11. You can install Inigo at any point, so yes give him a try.
  12. I'm confused by what you mean by "scrolling through the formlist". Do you still have some loop in your code? If not the "PlayerRef.RemoveItem(ListA, 999, true, SwapContainer)" call is probably what's taking the most time to complete and foamyesque's idea of putting the OnItemAdded check (with an appropriate inventory filter) on the player really is the best solution.
  13. Your solution in post number #3 with a persistent swap container in some holding cell should be the fastest and least CPU intensive. The aiItemCount value will be the number of that particular item actually transferred even though you said to transfer up to 999. I wouldn't use a spawned container that's just adding overhead to create and destroy an object. I would use a single "SwapContainer.RemoveAllItems()" call in the script applied to the player instead of removing each item type individually in the container's script. You can do that with a small delay after transferring the items or if this swapping function is going to run periodically on the player you could do the RemoveAllItems call just before you transfer the items. If a batch stays in the container for a while it won't hurt anything. You just don't want the number of things in the container to keep accumulating forever. And depending on how often you want to do that swapping you may be better off handling the swap feature by using an inventory filter and OnItemAdded event directly from a ReferenceAlias script for an alias referencing the player. (In that case you would need to remove items from the chest one at a time). But I wouldn't use the OnItemAdded event on the player strategy unless it's critical that you swap out items as soon as they are added to the player. Just using the event system and swap container method should be fast enough.
  14. Any NPC held by a reference alias could be made essential by that alias. The easiest way to see if a particular character is in an alias is to click on it in the console and run "sv" on it.
  15. I love that idea, but there is no such script. Clairvoyance is a built-in game effect and we don't have any access to it.
  16. You can't skip those because they are scenes and not standard dialogue. Technically the lines could be pulled into a more standard dialogue structure but features like being pulled into the sky by Meridia while talking with her wouldn't be possible in the dialogue only version. It's also possible that conditions could possibly be added to provide some ability to skip at least parts of them. But in both cases the changes would be a huge amount of work which is probably why no one has done it.
  17. Just because SKSE is showing in the console doesn't mean it's visible to the Papyrus scripting system. Are the .pex scripts from the SKSE archive in the game's Data\Scripts folder? If the scripts aren't installed correctly then SkyUI can't detect and use SKSE functions.
  18. I've looked at this before because I use a variation of this in my own game. That mod changes 5 game settings (and gives the player Healing Hands as a starting spell). The settings it changes are: fEssentialDeathTime fEssentialDownCombatHealthRegenMult fEssentialHealthPercentReGain fEssentialNonCombatHealRateBonus fEssentialNPCMinimumHealth It's sets all of those to zero except for minimum health which it sets to -1. Personally I don't think the first of those does anything for Skyrim. But the others do all have an effect. In my game I set the minimum health to -90 and the others to 0.01 or 0.001. Using small non-zero values for the multipliers and rates means they will automatically heal (slowly) and allowing the health to go down to -90 allows enemies and friends taken down by a strong hit to stay down longer. You can adjust the minimum health and recovery factors to your own taste. But even if you set the recovery values to 0 they'll still get up when combat is over. If you want to test your values just "coc elsweyr" and use "startcombat player" and "damageav health -1000" and (when you are ready) "stopcombat" on Maiq. You can use "getav health" to monitor his auto-healing to see how different values work. (He always cowers and never fights so he's a perfect test case.)
  19. If you have any mods that provide an SKSE plugin or any other type of DLL file those also have to be updated. Simply Knock is one example of that type of mod.
  20. No. Papyrus doesn't have a way to interact outside of the game and neither does SKSE. In theory an SKSE plugin could do that, but I don't know of any that do.
  21. I see the same behavior. I just consider it a minor annoyance and occasionally it's even useful. When I run a program to watch my Papyrus log files on my second monitor I can actually scroll up and down through the log while still in the game. :)
  22. The easiest solution is to provide absolutely no doors between that cell and any others. Place a marker in the cell and another one for the return and use the MoveTo script function to move the player to the markers at the appropriate time (either from some quest even or when the player activates some object). That still won't prevent custom followers that have a "warping" script from following and you also won't be protected from followers or follower framework mods that provide a spell or hotkey for summoning followers to the player. People have tried all sorts of complicated strategies to keep all NPCs away and some are more successful than others but experience shows that trying to prevent absolutely every NPC from following isn't really worth the effort. My recommendation is to just use the no door trick and then make sure the players know they shouldn't be bringing followers along at that stage. Then don't worry about it because ultimately it's their decision and problem if it breaks something or spoils their fun.
  23. Whoever told you to check the Papyrus log has no clue about how the game works. You won't find anything useful there if you're trying to debug a crash. Crashes come from memory allocation problems and mod conflicts.
  24. You do want to mix the two methods if you want maximum efficiency but you don't want to register for updates. If your situation makes sense for the user to press the keys in a particular order that's easiest and most efficient. In some of my mods you can hold modifier keys to alter the effect of an action key (i.e. hold down shift + alt while pressing Keypad 5 and you'll get a different behavior than if you just press Keypad 5). If you have that simple case you register the final key and then check for the two modifier keys with IsKeyPressed directly in the OnKeyDown event. If you want to allow the keys to be pressed in any order you register for all three keys and when any one is pressed do the checks with IsKeyPressed for the other two. The important complication is that you have to make sure that it won't hurt anything if more than one of those triggers at the same time (or very close to the same time) due to timing issues.
×
×
  • Create New...