Jump to content

lee3310

Members
  • Posts

    167
  • Joined

  • Last visited

Everything posted by lee3310

  1. Hello again! After several attempts, I've managed to strike gold with the scripted approach. This actor script was the first to actually work. Scriptname NPCAggressorMatSwapScript extends Actor Event OnItemEquipped(Form akBaseObject, ObjectReference akReference) if akBaseObject as Armor MatSwap myMaterial = Game.GetFormFromFile(0x001735, "aggressor2.esp") as MatSwap setMaterialSwap(myMaterial) ApplyMaterialSwap(myMaterial) endIf EndEvent It detects when a piece of armor is equipped to apply the material swap. I'm surprised that using those matswap functions directly on the whole actor would also work on the armor being worn. It wasn't even necessary to access the matswap through formlists and to obtain the armor via GetWornItem. It was actually far simpler. Here's a guy wearing an outfit that's mostly skin. The humanmale mesh is completely invisible. Unfortunately the material swap doesn't persist when closing and reopening the game. I would need to make it periodically and automatically apply the material somehow, instead of having to open the inventory of the NPC and equip then unequip a piece of armor manually. Maybe using OnLoad() instead, or making it a magic effect. If "setMaterialSwap(myMaterial)" doesn't work, you can always reapply the matswap manually "onLoad()" / "OnPlayerLoadGame()" Event OnInit() Self.RegisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame") EndEvent Event Actor.OnPlayerLoadGame(Actor akSender) Self.ApplyMaterialSwap(myMaterial) Self.RegisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame") EndEvent Event OnLoad() Self.ApplyMaterialSwap(myMaterial) EndEventYou can ditch the "self" and maybe there is a better option, i don't know.
  2. I used that function along with "Rename Anything" "SetRefName()" to copy a ref name to another but it only works when the PC is in same cell (refs are 3d loaded) GetDisplayName() should also work on unloaded but persistent object references that have displayable names. It's easy to test what statement is failing ("getName" or "setName") but yes, it's definitely "SetRefName()" that needs actor to be loaded.
  3. And there's a third one, CallQuestFunction, which calls functions from scripts attached to quests: cqf QuestEditorIDorFormID "ScriptName.FunctionName" arguments On most cases, when you pass an argument to a function you can use the word selected to send the current selected reference. Let's say you want to kill piper and "blame" the actor that you have currently selected: 2F25.cf "Actor.KillEssential" selectedThat'd pass the selected reference as akKiller without the need of copying the reference's form id. oO, didn't know about the "selected" keyword.
  4. I used that function along with "Rename Anything" "SetRefName()" to copy a ref name to another but it only works when the PC is in same cell (refs are 3d loaded)
  5. You can set the "Essential/Protected" flag on a quest alias if that's what you are asking.
  6. I'm also intrigued by that. i found some unused vanilla robotic voice files in Nuka world DLC with the player voiceType, so maybe Bethesda intended to add a voice generator in CK at some point (like xVasynth).
  7. I'm not seeing you starting the quest like i told you in the previous post. Did you try that ? I ran sqv FO4_BartonvillePastorDialogueSermons as you suggested and it reported the quest was not started and I tried multiple things but could not get it to fire up. But after much investigation I did manage to get it working again. Four days troubleshooting resolved with a single line (i.e., conditioned the quest off the pastor voice type. Just tested it...coc'd to the settlement from the start menu then ran sqv which reported the quest running. Thanks guys for the help. I'll take a look at OnQuestInit() event too. Personally, not done much questing so this is quite the experience. Also, if you have any unfilled non-optional alias, the quest won't start...
  8. I'm not seeing you starting the quest like i told you in the previous post. Did you try that ? Event OnActivate(ObjectReference akActionRef) if akActionRef == FO4_PastorAllen ; Add addition code to randomly select a scene to play Utility.Wait(0.1) ; ; Turn the lectern lights on ; FO4_LecternLightsEnable.enable() ; ; Reset The Quest ; ChurchQuest.Stop() ChurchQuest.Start() ; ; Start up the scene ; If ChurchQuest.IsRunning() PastorAllenSermon01.Start() Else Debug.Trace("Quest not running") Endif endif EndEvent Also, if the quest is only used for the sermon part, untick the start game enable since it's repeatable (can be started with the lectern) and you can start the scene OnQuestInit() event instead.
  9. There is: https://www.nexusmods.com/fallout4/mods/51165/?tab=files
  10. Yes, if there is only one type in the struct "armor" then there is no need for struct
  11. If you replaces the vanilla texture (.dds) it will work out of the box, but if you add it as new MSWP then it won't show up until rebuilding the precombines in that area (or edit the vanilla precombines in nifskope) I see. Thanks for the info. So far I only did swaps on a copy & newly placed objects. MSWAP and precombines are a pain in the a** to deal with. Even after generating new precombines, CK can still ignore the changes and apply the old green material in the combined Nif (there is some discussions and workarounds for it). This xedit script can help with that: https://github.com/praecipitator/f4-xedit-scripts/blob/main/Apply%20Material%20Swap%20V2.pas
  12. Not sure but i think you will have to reset the quest before playing the scene again. Remove the run once flag then stop(if running)/start the quest before playing the scene. Nistion can confirm it since he asked about the RunOnce flag. PS Did you check if the quest is actually running (with "sqv" cmd) ?
  13. If you replaces the vanilla texture (.dds) it will work out of the box, but if you add it as new MSWP then it won't show up until rebuilding the precombines in that area (or edit the vanilla precombines in nifskope)
  14. Actually, the AI voice is from Immersive Reader which comes with OneNote for Windows. I agree that sit normally during the majority of the sermon would be better, and switch to the prayer animation at the proper time would be so much better. I will have to experiment and see if there is a way to achieve a smooth transition between the two. I will say that the ElevenLabs AI voices are very high quality. I'm also interested in a simple way to update furniture idle (without exit/enter). You can try playIdle() on the sited NPCs and see how it goes, or maybe use a package to play the praying (head down) idle on end/start based on condition. Is it possible to add keywords to the furniture via script. If so, could one add a script to the furniture and toggle the furniture keyword (AnimFurnPraying orAnimFurnChairSitAnims) based on something like a global. Not sure if the NPC would then play the respective animation or not...brainstorming here. Unfortunately, at the moment I can test it as my quest has decided to stop working. Pastor enter the lectern and is suposed to kickoff the quest however, it des not. Haven't been able to troubleshoot why yet. I mentioned the fact that NPCs need to exit then enter the furniture again for the new idle to take effect (if you add a new keyword to the object via script). I only used OnActivate() event (instead of onSit) and never had any problem with it. You attache a script to the lectern with: Event OnActivate(ObjectReference akActionRef) if akActionRef == Pastor ; your code here. endif EndEvent The Furniture is "activated" when used.
  15. Actually, the AI voice is from Immersive Reader which comes with OneNote for Windows. I agree that sit normally during the majority of the sermon would be better, and switch to the prayer animation at the proper time would be so much better. I will have to experiment and see if there is a way to achieve a smooth transition between the two. I will say that the ElevenLabs AI voices are very high quality. I'm also interested in a simple way to update furniture idle (without exit/enter). You can try playIdle() on the sited NPCs and see how it goes, or maybe use a package to play the praying (head down) idle on end/start based on condition.
  16. Well, after the huge amount of time spent on it and the hard work (2 years !!!) it would be a shame.
  17. Very cool, did you use ElevenLabs (Prime Voice AI) for the sermon ? PS I think a normal sitting idle is more appropriate here, you can switch keyword at the end of the sermon but i don't know an easy way to update the idle without making NPCs leave the furniture (exit enter again).
  18. I thought that the game makes NPCs run, jog, walk in follow/travel packages based on target distance " fFollowStartSprintDistance". I'm curious to know how you do that in script.
  19. Thanks niston, i see that it was a wishful thinking. I was trying to get the last actor linked to a ref and i thought maybe it was akAll[akAll.Length] but i will use a new KW with SetLinkedRef / GetLinkedRef to overwrite the old reference and always get the last one.
  20. Since i'm planning on injecting more LLs using a repeatable quest, this is what i'm going to do.
  21. There is still two active F4SE modders i know of, so maybe we can get something similar to "GetNthForm()" for Fo4.
  22. it's a long shot but does this function return a sorted array per chance ? i mean: ak1.SetLinkedRef(ak0, KW) ak2.SetLinkedRef(ak0, KW) ak3.SetLinkedRef(ak0, KW) Actor[] akAll = ak0.GetActorsLinkedToMe(KW) akAll[0] == ak1 akAll[1] == ak2 akAll[2] == ak3
  23. Quote: "In the editor, you can duplicate forms inside a leveleditem but if injecting the same form twice doesn't have any side effects (like changing the spawn chance) then it's all good." unquote That's exactly what i was afraid of. I will see if it's possible to check if the form is already in the LvLitem before adding it. (or maybe set a var to false after adding each LVL)
  24. If you want to attache the script to the furniture then OnActivate() event will do the trick. if akActionRef == PastorAllen...
  25. It eliminates the possibility of mod conflicts on the record-level. However, if two mods touch the same vanilla form, funny things can still happen depending on the mods.. Note that if you set a quest to "Run once", you won't be able to start it again if it's been stopped previously because the game will block it. (Save games hold quest stage, running state, etc. informations in the form of a quest data). Well, i hope i can still stop the quest after disabling the run once flag mid-save (to trigger OnQuestInit event again). Yes, if you uncheck the "Run once" flag mid-playthrough, you can start-stop the quest anytime and as many times as you like because the game won't block it anymore. That's good news. Thanks :thumbsup:
×
×
  • Create New...