dullman Posted January 15, 2024 Posted January 15, 2024 Hello after trying installing again skyrim se(ae) I saw that all mods that I used are either dead or quite buggy, so decided to get into modding, but here is the problem how I can run creation kit with skse through mo2? Also entire day I spend trying to create a dialogue that new npc would say when player talk to him (but failed in this), so are there any written tutorials which cover those parts? For potential helpers thx.
traison Posted January 15, 2024 Posted January 15, 2024 (edited) 19 minutes ago, dullman said: creation kit with skse through mo2 This is not needed, just run the CK as-is. (Edit: as-is through MO2 that is) 19 minutes ago, dullman said: Also entire day I spend trying to create a dialogue that new npc would say when player talk to him (but failed in this), so are there any written tutorials which cover those parts? I would assume there is, however you may find that your best friend in modding is to review other people's work (that includes the base game). Find a quest that already has similar dialogue to that which you want to create. Once you start to know your way around the place you can put together something truly unique. Edited January 15, 2024 by traison
dullman Posted January 15, 2024 Author Posted January 15, 2024 35 minutes ago, traison said: This is not needed, just run the CK as-is. (Edit: as-is through MO2 that is) I would assume there is, however you may find that your best friend in modding is to review other people's work (that includes the base game). Find a quest that already has similar dialogue to that which you want to create. Once you start to know your way around the place you can put together something truly unique. Not Entirely true even though I installed skse64 I don't have for example access to this function https://wiki.bethesda.net/wiki/creationkit/Skyrim/GetName_-_Form/ since the script does not compile for me
traison Posted January 15, 2024 Posted January 15, 2024 (edited) 44 minutes ago, dullman said: the script does not compile for me That means you didn't install the 2nd part of SKSE. Edit: or you did but the papyrus compiler can't find the scripts. See there's some confusion about which standard to use when it comes to script directory structure. Me for instance am sticking to the old standard, simply because the folder structure makes more sense. Whichever you select, you'll find that about half the mods you download will have its source files in the wrong directory and you'll have to normalize them yourself. Which directory to use is defined in CreationKit.ini: [Papyrus] sScriptSourceFolder = ".\Data\Scripts\Source" Edited January 15, 2024 by traison
dullman Posted January 16, 2024 Author Posted January 16, 2024 9 hours ago, traison said: Edit: or you did but the papyrus compiler can't find the scripts. See there's some confusion about which standard to use when it comes to script directory structure. Me for instance am sticking to the old standard, simply because the folder structure makes more sense. Whichever you select, you'll find that about half the mods you download will have its source files in the wrong directory and you'll have to normalize them yourself. Which directory to use is defined in CreationKit.ini: [Papyrus] sScriptSourceFolder = ".\Data\Scripts\Source" Yeah it was probably this, so thx for help. Also how in Skyrim CK we handle flow of time, means I want some actor custom variables rise with game time so how we do approach this subject that it should not lag much game? (Also it would be for selected actors + player)
traison Posted January 16, 2024 Posted January 16, 2024 3 minutes ago, dullman said: Yeah it was probably this, so thx for help. Also how in Skyrim CK we handle flow of time, means I want some actor custom variables rise with game time so how we do approach this subject that it should not lag much game? (Also it would be for selected actors + player) I created a couple of wrapper functions in my utility scripts for that, to make the vanilla functions more usable: float Function GetCurrentGameTime() Global {Returns the number of in-game minutes that have passed since the character was created.} ; Convert from days to minutes and return the result Return Utility.GetCurrentGameTime() * 1440 EndFunction float Function GetCurrentRealTime() Global {Returns the number of real-life seconds that have passed since the character was created.} ; NOTE This timer keeps running while game is paused. ; Convert from hours to seconds and return the result Return Game.GetRealHoursPassed() * 3600 ;Return Utility.GetCurrentRealTime() ; Do not use this EndFunction So, to track time, first decide what kind of a timer it is (in-game or real) then simply check how much time has passed in an OnUpdate event callback. Your timer resolution will obviously depend on the resolution of the OnUpdate "timer", but also on the fact that natively Papyrus runs extremely slowly. Thus creating a timer with a resolution below say 2-3 seconds might be optimistic, but generally I find you don't really need that in Skyrim - there's Utility.Wait for such things, but that's a function that should be used sparingly.
dullman Posted January 17, 2024 Author Posted January 17, 2024 I have another question how to attach script for all Actors (I wanted all unique actors to have their preferences) but can't really find any idea for this.
Reneer Posted January 17, 2024 Posted January 17, 2024 Scripting for all actors is possible in several different ways: cloak scripts (Spells/Explosions/ActiveMagicEffects) is one variety, see https://psychfox.com/public_mods/source/RenCrimeAOEEffectScript.psc for an example. You could also use https://wiki.bethesda.net/wiki/creationkit/Skyrim/FindRandomActorFromRef_-_Game/ and add the script (AddSpell works for ActiveMagicEffect, but I find using AddPerk is great as well.)
dullman Posted January 17, 2024 Author Posted January 17, 2024 (edited) 1 hour ago, Reneer said: Scripting for all actors is possible in several different ways: cloak scripts (Spells/Explosions/ActiveMagicEffects) is one variety, see https://psychfox.com/public_mods/source/RenCrimeAOEEffectScript.psc for an example. You could also use https://wiki.bethesda.net/wiki/creationkit/Skyrim/FindRandomActorFromRef_-_Game/ and add the script (AddSpell works for ActiveMagicEffect, but I find using AddPerk is great as well.) Yeah I had the spell as effect and attached it to player, but how I can attach it to actors in current cell or maybe only actors that are in talk with player? I mean I though I saw a function that getAllActors in cell but can't find it. EDIT: To be sure how to get ActorRefs to others actors that I can register them Edited January 17, 2024 by dullman
traison Posted January 17, 2024 Posted January 17, 2024 There is no such thing as dynamically adding something to all actors - I mean just think of the performance cost of an operation like that. Nor is it practical for an entire cell. The key is to make it seem like everyone has a spell, that's what the cloak does. The cloak can do something to everyone around you, making it look like everyone in Skyrim was doing something - an illusion. So you got some options: A cloak spell. See the vanilla Flame Cloak spell if you need an example. SPID. Another cloak, probably easier to use? A quest with dynamically populated quest alises. Other alternatives that may not apply here: Attaching said spell to the actorbase, as all references will be copies of this. This could work on all bandits for instance. Some things to consider before proceeding: Cloak spells (and by association, SPID) are a great way to tank game performance. SPID may be doing some heavy lifting in native code so it may in theory be preferable to a vanilla cloak spell, but lets put it this way - I'd think twice before installing SPID in my game. Not because its a bad idea necessarily, I'd just want to be absolutely sure there's no better way to pull off what I'm looking to do. So far in my decade of modding, I haven't needed it, I guess that says something. Quest alises used on their own (without a cloak spell to set the scan range) will be limited to how many alises you can bother to create. There may also be some other technical limitations in the Quest object itself - i.e. you will never get a quest with "all actors in Skyrim" referenced in it. 2 hours ago, dullman said: or maybe only actors that are in talk with player? This you could do from a script fragment attached to one of the TopicInfos. For instance, when the player says "Hello", add the spell to the listener.
dullman Posted January 17, 2024 Author Posted January 17, 2024 1 hour ago, traison said: This you could do from a script fragment attached to one of the TopicInfos. For instance, when the player says "Hello", add the spell to the listener. Thx for tip it's working although I has some problems but at least it run (can't really get a proper id for actor)
Reneer Posted January 18, 2024 Posted January 18, 2024 (edited) 13 hours ago, traison said: There is no such thing as dynamically adding something to all actors - I mean just think of the performance cost of an operation like that. Nor is it practical for an entire cell. The performance of such systems in terms of cost is not as bad as you would think, assuming you keep in mind multithreading where possible, creating async functions where appropriate, and working to tie things in with the actors/objects based on the event system. I've coded approaches in Papyrus a few times, though my examples are not meant to be performant, just functional*. So yes, it is not only possible, but the approach works just fine in my working experience. * = functionality not guaranteed Edited January 18, 2024 by Reneer
traison Posted January 18, 2024 Posted January 18, 2024 (edited) 6 hours ago, Reneer said: The performance of such systems in terms of cost is not as bad as you would think, assuming you keep in mind multithreading where possible, creating async functions where appropriate, and working to tie things in with the actors/objects based on the event system. I've coded approaches in Papyrus a few times, though my examples are not meant to be performant, just functional*. So yes, it is not only possible, but the approach works just fine in my working experience. * = functionality not guaranteed I think you missunderstood my statement, or didn't read my entire post. You can pull off the illusion of everyone having a spell/effect, but you're not going to do it to everyone in Skyrim at once like dullman perhaps was envisioning it: On 1/17/2024 at 5:50 AM, dullman said: I have another question how to attach script for all Actors Edit: If I'm wrong, please teach. Don't have to explain the entire thing, I just want to know how you managed to get a reference to all actors without blowing up your save file, or just generally breaking the game engine. Edited January 18, 2024 by traison
dullman Posted January 18, 2024 Author Posted January 18, 2024 10 minutes ago, traison said: Edit: If I'm wrong, please teach. Don't have to explain the entire thing, I just want to know how you managed to get a reference to all actors without blowing up your save file, or just generally breaking the game engine. Yeah I also expected when I first started dive into modding skyrim that it would be a basic function, but was wrong. Currently what I achieved is to keep a track of actors infected by spell since I only need to keep track of unqiue actors, but here you have a point keeping Form on FormList for every character infected with my script could blow up my saves, good catch I have an ideas to move around this but don't really know if it doable in Skyrim. So at the end I have a question I saw in one of utilities function to manipulate string/int/float list but couldn't find really from where they come (means how to create a new one), so maybe someone knows more about source of those lists?
traison Posted January 18, 2024 Posted January 18, 2024 4 minutes ago, dullman said: Yeah I also expected when I first started dive into modding skyrim that it would be a basic function, but was wrong. Currently what I achieved is to keep a track of actors infected by spell since I only need to keep track of unqiue actors, but here you have a point keeping Form on FormList for every character infected with my script could blow up my saves, good catch I have an ideas to move around this but don't really know if it doable in Skyrim. So at the end I have a question I saw in one of utilities function to manipulate string/int/float list but couldn't find really from where they come (means how to create a new one), so maybe someone knows more about source of those lists? StorageUtil from PapyrusUtil. This is the only reasonable way to store persistent information, and it can be used for every actor in Skyrim (or so they say).
dullman Posted January 18, 2024 Author Posted January 18, 2024 I just wanted to stop this topic since Skyrim does not work for me because it automatically updated and start modding easier things for my mod so that I would require less help/tests. But when I wanted to add a new Food/ingredient item for game I saw that I can't find entries with meals so I asked myself If I remember wrong and skyrim does not have craftable meals? But yeah here is my question How to add a new craftable item (meal for now) and ingredients for it. Also if anyone used skyrim survival mode in his mod, is it easy to use in mod or not? I know that MME has something similar but don't really remember if they allowed to craft new items form theirs ingredients.
traison Posted January 18, 2024 Posted January 18, 2024 (edited) 35 minutes ago, dullman said: How to add a new craftable item (meal for now) and ingredients for it. Food items are potions. The recipe to make one is a constructible object, like the recipe for a sword. Edited January 18, 2024 by traison 1
dullman Posted January 18, 2024 Author Posted January 18, 2024 1 hour ago, traison said: Food items are potions. The recipe to make one is a constructible object, like the recipe for a sword. Thanks I never thought that they would be treated like that. I took a look on Ingredients and it seems that we can't really attach script to it, also fast search could not find how to check by script if actor has ingredient, I probably take e look on some more complicated alchemy system how they resolve that but I suspect it would take some time to find answer to this
traison Posted January 18, 2024 Posted January 18, 2024 10 minutes ago, dullman said: how to check by script if actor has ingredient https://wiki.bethesda.net/wiki/creationkit/Fallout/GetItemCount_-_ObjectReference/
Fotogen Posted January 18, 2024 Posted January 18, 2024 About "cloak" spell. DO NOT USE. Its the best way to fuck up your game. Its not just performance, but also "browler" bug and ... just don't use it. You create a new Quest. Quest has a lot of aliases with conditions. On alias you can specify a script. Plus, Quest itself has a script. Conditions on aliases is important part. This is your "if" statement, filter. Good thing here is, that this condition is executed inside game engine. So in C/C++ and not in super slow Papyrus script. In general, most aliases are flaged as "optional". So you then start that quest, it will try to fill aliases based on contitions and attach scripts. When you don't want it no more, you stop this quest. This will also drop alias scripts. Nice self cleaning mechanics so you don't overload your game and save file. Note: quest will only start if all aliases that are flaged as "not optional" fill. This is good. It means "hey nothing to do here, so why overload the game with stuff that doesn't have to do anything". After that, you can start the quest again. Note: quests can be start-ed, reset-ed and stop-ed.
dullman Posted January 18, 2024 Author Posted January 18, 2024 30 minutes ago, Fotogen said: About "cloak" spell. DO NOT USE. Its the best way to fuck up your game. Its not just performance, but also "browler" bug and ... just don't use it. You create a new Quest. Quest has a lot of aliases with conditions. On alias you can specify a script. Plus, Quest itself has a script. Conditions on aliases is important part. This is your "if" statement, filter. Good thing here is, that this condition is executed inside game engine. So in C/C++ and not in super slow Papyrus script. In general, most aliases are flaged as "optional". So you then start that quest, it will try to fill aliases based on contitions and attach scripts. When you don't want it no more, you stop this quest. This will also drop alias scripts. Nice self cleaning mechanics so you don't overload your game and save file. Note: quest will only start if all aliases that are flaged as "not optional" fill. This is good. It means "hey nothing to do here, so why overload the game with stuff that doesn't have to do anything". After that, you can start the quest again. Note: quests can be start-ed, reset-ed and stop-ed. Although I heard about brawler bug I just don't know what is this and why happens, as for "cloak" spell I use it since I needed to have something that would keep the track for stats for each POI (unique actor which interacted with Player), also for special cases assign them a bigger role than npc (like milkmaid in MME) so they should have keep their records when they do something that isn't responding to actor action (although here if I though more about it I'm not sure if other then scripted events they can e.g. talk each other so maybe here I could much more optimize by allowing only player (or quest with player ref) that keep track of those values). But for now I write a simple mod similar to MME to learn scripting in game and try to feel what I can achieve here
Reneer Posted January 18, 2024 Posted January 18, 2024 (edited) 15 hours ago, traison said: I think you missunderstood my statement, or didn't read my entire post. You can pull off the illusion of everyone having a spell/effect, but you're not going to do it to everyone in Skyrim at once like dullman perhaps was envisioning it: Edit: If I'm wrong, please teach. Don't have to explain the entire thing, I just want to know how you managed to get a reference to all actors without blowing up your save file, or just generally breaking the game engine. Sure, start with https://psychfox.com/public_mods/source/RenCrimeAOEEffectScript.psc and if something doesn't make sense let me know. Keep in mind Fotogen's warnings, however, and note that using Perks would sidestep the old Brawler script bug entirely. Alternatively, you could also include all actors in a Formlist, iterate through that, and add perks that way at mod startup. That would probably get closer to 'every actor, everywhere, all at once' and then dealing with the edge cases that would pop up. Edited January 18, 2024 by Reneer
dullman Posted January 19, 2024 Author Posted January 19, 2024 (edited) Also one question happened to come to my mind. What is better keep several parts of mods each one in different file (by that I mean scripts) or maybe create one large File, and also the second question if there is really difference if we define a script that extends some basic object (like quest) and script that does not extends anything (For me the second should be obviously better choice but it's not sure if it's really is) Edit. I know that from development side it's better to have several files but I ask from skyrim optimization side Edited January 19, 2024 by dullman
traison Posted January 19, 2024 Posted January 19, 2024 15 hours ago, Reneer said: Sure, start with https://psychfox.com/public_mods/source/RenCrimeAOEEffectScript.psc and if something doesn't make sense let me know. I don't see how that would cover the entire world of Skyrim, both exteriors and interiors ("all actors"). However it is an interesting approach to "selecting" everyone in a loaded cell, given that they're within range of at least one explosion. I'll keep this script around, maybe I'll play around with it some time. 7 hours ago, dullman said: What is better keep several parts of mods each one in different file (by that I mean scripts) or maybe create one large File, and also the second question if there is really difference if we define a script that extends some basic object (like quest) and script that does not extends anything (For me the second should be obviously better choice but it's not sure if it's really is) When I started my own mod setup with my rewrite of SLIF years ago I had this vision of splitting everything up into modules and making it possible to sort of hot-swap mods and everything would just work. The reality of Papyrus however is that it's a rather stiff language. You can't really pass references to things around like you could in any reasonable modern language. For instance, to pass a reference to a simple float value you have to wrap it in an array. Callback functions aren't a thing either. So, in the end my mods are not so modular now. Maybe I could have put more effort into it, but since I had no plans to release the entire thing anyways it didn't really matter. These days I generally try to stick to the main titles as it were. Like I won't have logic that belongs to one major feature, half-way baked into another major feature; shared code goes in the shared code script etc. I think when it comes to Papyrus and splitting things up, the more important question is threading. The way threads work is weird in Papyrus and I'm not quite sure what is running where when calling things in another script. Sometimes I get the feeling the thread context remains the same, as in, remote code is executed in the calling context. Sometimes it seems like there's a message queue between scripts, and each script has its own context, regardless of where functions are called from. I generally use SL as a reference when I need to pull more performance out of Papyrus with multitasking.
Reneer Posted January 21, 2024 Posted January 21, 2024 (edited) On 1/19/2024 at 8:25 AM, traison said: I don't see how that would cover the entire world of Skyrim, both exteriors and interiors ("all actors"). However it is an interesting approach to "selecting" everyone in a loaded cell, given that they're within range of at least one explosion. I'll keep this script around, maybe I'll play around with it some time. You're absolutely correct, it doesn't on its own cover the entire world of Skyrim. But if the player visits every part of Skyrim, well. In all seriousness, I've never truly intended to write a script that would grab every NPC reference all at once throughout all of Skyrim. In a cell, sure, maybe even a few cells over (assuming the cell is still loaded.) With that said, I would probably end up cheating and searching through all cells by grabbing their NorthMarkers and using Game.FindRandomActorFromRef or something like that and stuffing them all into a Formlist. Edited January 23, 2024 by Reneer
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now