vasiliipupkin1 Posted February 2 Author Share Posted February 2 Thank you very much for the clear explanation, I didn't know it was so difficult((( there are people like you who understand this. I will definitely do everything as you described, test it, and let you know. I think it should work. But I think modding is not my thing((( I don't understand much. In any case, THANK YOU SO MUCH for taking the time to answer the questions. Link to comment Share on other sites More sharing options...
vasiliipupkin1 Posted February 2 Author Share Posted February 2 No, I haven't tested the new game, I tested it with my save. Thanks for the answers. I'll definitely do the tests and write back! All the best! Link to comment Share on other sites More sharing options...
vasiliipupkin1 Posted February 2 Author Share Posted February 2 (edited) 13 hours ago, scorrp10 said: I did as you described. What I got: This doesn't work, I don't get a .pex file created in Data\Scripts 2. you can compile resourcefurniturescript.psc - which will generate the .pex file in Data\Scripts. Gameplay menu - Papyrus Script Manager - filter for resource. Make sure 'Has Source' says Yes. Right-click, choose Compile. You now should have the .pex file in Data\Scripts. But I have good news. The script works when I create a new game as you described: Option 1: test it on a new game. No need to suffer the usual cart ride. Launch game, and at main menu, open console, and type: coc whiterunorigin There is a chopping block by the 3rd house on the right (right after Breezehome) Option 2: spawn a new chopping block. Load up your save, open console, type: player.placeatme 7022e This will spawn a brand new chopping block under your feet. That is, it works in a new game and when I create a new chopping block for firewood (player.placeatme 7022e). I don't understand what you wrote below. 11 hours ago, scorrp10 said: NOW. If you want your change to work seamlessly on a game in progress, on chopping blocks that already been loaded, you need to do a bit more work. The most blunt approach: in 'OnActivate' function, right at the top, add: ResourceCount = 4 MaxResourcePerActivation = 12 to make it 3 chops of 4 each. (12 firewood total). Then, recompile the script. In fact, if you make this change, you will no longer need the .esp with changed prroperties. Please sorry for my bad English. So as not to torment you... How do I get this to work for the old wood chopping areas in my saves? Edited February 2 by vasiliipupkin1 Link to comment Share on other sites More sharing options...
scorrp10 Posted February 2 Share Posted February 2 The main question is: did you get to a point where you can edit the script? That is, did you get all the .psc file from Scripts.zip to where CK can see them? 1 Link to comment Share on other sites More sharing options...
vasiliipupkin1 Posted Sunday at 06:26 AM Author Share Posted Sunday at 06:26 AM (edited) 54 minutes ago, scorrp10 said: The main question is: did you get to a point where you can edit the script? That is, did you get all the .psc file from Scripts.zip to where CK can see them? Yes sir! I can now edit the script. But when I right click -> Compile -> the .pex file is not created Deleted, did everything again, it worked! The .pex file was created What's the next step, Sir? I understand that I need to insert this into the script? ResourceCount = 4 MaxResourcePerActivation = 12 Where exactly, where should I insert it? Can you make a screenshot? Edited Sunday at 06:45 AM by vasiliipupkin1 Link to comment Share on other sites More sharing options...
scorrp10 Posted Sunday at 03:53 PM Share Posted Sunday at 03:53 PM auto STATE normal Event OnActivate(ObjectReference akActionRef) gotoState("busy") ; debug.trace(self + "OnActivate") if akActionRef == Game.GetPlayer() || (akActionRef as actor).isInFaction(CurrentFollowerFaction) ; debug.trace("akActionRef is either player or a follower") if (akActionRef as actor) != game.getPlayer() ; debug.trace("It's a follower - store in NPCfollower property") ; if not the player, must be the follower NPCfollower = akActionRef endif bool allowActivation = true ; check if player has required item if requiredItemList if akActionRef.GetItemCount(requiredItemList) == 0 if akActionRef == game.getPlayer() ; only require the axe item for the player allowActivation = false ; debug.trace("allowActivation = "+allowActivation) FailureMessage.Show() endif endif endif if allowActivation ResourceCount = 4 ; <<< *** THESE TWO LINES ARE THE NEW ONES *** MaxResourcePerActivation = 12 ; <<< RegisterForEvents(akActionRef) ; debug.trace(self + "player/follower activation START") Activate(akActionRef, true) ; debug.trace(self + "player/follower activation END") endif else ; ;debug.trace(self + "non-follower NPC activation START") ; just activate it Activate(akActionRef, true) ; ;debug.trace(self + "non-follower NPC activation END") endif gotoState("normal") endEvent endState Like this is probably best. 1 Link to comment Share on other sites More sharing options...
vasiliipupkin1 Posted Sunday at 06:31 PM Author Share Posted Sunday at 06:31 PM I did as you said! I inserted ResourceCount = 4 ; MaxResourcePerActivation = 12 ; after if allowActivation Here's what I got if allowActivation ResourceCount = 4 ; MaxResourcePerActivation = 12 ; RegisterForEvents(akActionRef) ; debug.trace(self + "player/follower activation START") Activate(akActionRef, true) ; debug.trace(self + "player/follower activation END") endif Saved the script. Then right-click and "Compile" the file Data\Scripts\ resourcefurniturescript.pex was created I went into the game, loaded the saves and everything works great! It works! You are a genius SIR! Thank you so much for helping me and giving me your time. I couldn't have done it without you. And how did you think of doing this?... Maybe I'm just a little stupid or I don't know a lot of things in terms of modding and programming in general. I'm finishing school and want to go study to be a programmer, so I'm thinking of doing a little programming in the future, and at the same time learning English better. Link to comment Share on other sites More sharing options...
vasiliipupkin1 Posted Sunday at 06:41 PM Author Share Posted Sunday at 06:41 PM Thank you very much for your help and for your time. Everything worked, I figured it out. All the best! 1 Link to comment Share on other sites More sharing options...
scorrp10 Posted Sunday at 07:08 PM Share Posted Sunday at 07:08 PM Frankly, this specific method is 'the dirtiest' and most primitive. Those two extra lines could be added almost anywhere in the function, and they change the outcome for anyone using the block (Player, follower NPC, regular NPC), with no way to customize it on the fly. But hey, it works. As to how one knows... quite a bit of professional experience and a computer science college degree under my belt, and I been messing with Skyrim scripts at least since 2020. The logic of most scripts is not hard to follow. You generally learn a lot by example - by looking at games' original scripts and scripts of other modders. At first it can look completely incomprehensible, but eventually, things start to fall into place. 1 Link to comment Share on other sites More sharing options...
tomahawk6633 Posted Monday at 12:01 AM Share Posted Monday at 12:01 AM This mod is already done. https://www.nexusmods.com/skyrimspecialedition/mods/26888 If you still want to learn you can peek into it to see how it was done. Link to comment Share on other sites More sharing options...
Recommended Posts