Jump to content

dylbill

Premium Member
  • Posts

    1493
  • Joined

  • Last visited

Everything posted by dylbill

  1. Fragments are a special case. If you want separate functions you have to put them in a separate script. You can attach another script to the same quest then do: (GetOwningQuest() as YourScriptName).EnableObjectsAtFirstStop()
  2. To "convert" an NPC into another, just disable / delete the npc and use PlaceActorAtMe or MoveTo to replace it with another. I use resurrect in my NPC Death Alerts mod. Here's how I do it. npcdeathalerttransferchest is just an empty container base form. objectreference transferchest = npcdeathalertchestref.placeatme(npcdeathalerttransferchest, 1) armor helmet = victim.getwornform(0x00000001) as armor armor clothes = victim.getwornform(0x00000004) as armor armor gloves = victim.getwornform(0x00000008) as armor armor amulet = victim.getwornform(0x00000020) as armor armor ring = victim.getwornform(0x00000040) as armor armor boots = victim.getwornform(0x00000080) as armor armor shield = victim.getwornform(0x00000200) as armor armor circlet = victim.getwornform(0x00001000) as armor utility.wait(0.2) victim.removeallitems(transferchest, true, true) ;utility.wait(0.2) ;transferchest.activate(playerRef) utility.wait(0.75) victim.resurrect() utility.wait(0.75) victim.removeallitems() utility.wait(0.2) transferchest.removeallitems(victim, true, true) utility.wait(0.2) if helmet != none victim.equipitem(helmet) endif if clothes != none victim.equipitem(clothes) endif if gloves != none victim.equipitem(gloves) endif if amulet != none victim.equipitem(amulet) endif if ring != none victim.equipitem(ring) endif if boots != none victim.equipitem(boots) endif if shield != none victim.equipitem(shield) endif if circlet != none victim.equipitem(circlet) endif utility.wait(0.2) transferchest.disable() transferchest.delete()
  3. The user doesn't need the source files at all, they only need the .pex files in data/scripts. In your CreationKitCustom.ini, you can add this: [Papyrus] sScriptSourceFolder = ".\Data\Scripts\Source" But you will still need to copy the files from Data\Source\Scripts to there cause that's where the creation kit will have unzipped the source files to, and then re-install skse after to overwrite the .psc files. I just always make sure all source .psc files are in both folders so I don't have to worry about it.
  4. Most likely your source scripts aren’t in the right folder. In SE they changed the source folder to data/source/scripts while in le it was data/scripts/source. I just always make sure all the source .psc scripts are in both folders
  5. No problem, and yes, you can’t use skse if uploading your mod to xbox.
  6. xkkmEl is correct. I'd recommend something like this. May need to be tweaked because I'm not sure how fast crime gold is updated. no skse version Faction Property CrimeFactionWinterhold Auto Event OnActivate(ObjectReference akActionRef) if akActionRef == Game.GetPlayer() if IsLocked() int crimeGold = CrimeFactionWinterhold.GetCrimeGold() Utility.Wait(2) ;wait for lock picking menu to close int newCrimeGold = CrimeFactionWinterhold.GetCrimeGold() int diff = newCrimeGold - crimeGold if diff > 0 ;player was likely caught CrimeFactionWinterhold.SetCrimeGold(newCrimeGold + 100) ;add 100 to crime gold Endif Endif Endif EndEvent skse version Faction Property CrimeFactionWinterhold Auto int crimeGold Event OnActivate(ObjectReference akActionRef) if akActionRef == Game.GetPlayer() if UI.IsMenuOpen("Lockpicking Menu") crimeGold = CrimeFactionWinterhold.GetCrimeGold() RegisterForMenu("Lockpicking Menu") Endif Endif EndEvent Event OnMenuClose(string menuName) if menuName == "Lockpicking Menu" UnRegisterForMenu("Lockpicking Menu") Utility.Wait(2) int newCrimeGold = CrimeFactionWinterhold.GetCrimeGold() int diff = newCrimeGold - crimeGold if diff > 0 ;player was likely caught CrimeFactionWinterhold.SetCrimeGold(newCrimeGold + 100) ;add 100 to crime gold Endif Endif EndEvent
  7. I've used this tutorial to add collision to nifs before:
  8. Put a script on the display case that extends objectReference with the OnActivate event.
  9. No problem The other option is to make your own skse plugin. How I got started was Mrowr Purr's tutorials. Basic setup: https://www.youtube.com/watch?v=rTN9bAB2S9A&list=PLektTyeQhBZeDIRp2g15SsK1GX2Ig8YVW To bind functions to papyrus: https://www.youtube.com/watch?v=lBs2mhB1Abs&list=PLektTyeQhBZeDIRp2g15SsK1GX2Ig8YVW&index=9 My plugin is open source, so here's a link to those functions I added: https://github.com/Dylbill-Iroh/DbSkseFunctions/blob/main/DbSkseFunctions/src/BipedSlots.cpp
  10. Unfortunately no. Including the resource with your mod download can lead to versioning conflicts which should be avoided.
  11. Hey, coincidentally I was working on similar functions for my script resource Dylbill's Papyrus Functions, so adding that wasn't too much trouble. Relevent functions in DbSkseFunctions: GetArmorAddonRaces ArmorAddonHasRace AddAdditionalRaceToArmorAddon RemoveAdditionalRaceFromArmorAddon https://www.nexusmods.com/skyrimspecialedition/mods/65410
  12. For this I think what would work is OnStoryKillActor https://ck.uesp.net/wiki/OnStoryKillActor_-_Quest set up with the Kill Actor Event https://ck.uesp.net/wiki/Kill_Actor_Event in the story manager. Another method is if you're using SKSE you can use my mod Dylbill's Papyrus Functions that has DbSkseEvents.psc. Here's an example script: race Property giantRace Auto Event OnInit() ;register this script for when the player kills any npc DbSkseEvents.RegisterFormForGlobalEvent("OnDeathGlobal", self, Game.GetPlayer(), 1) EndEvent Event OnDeathGlobal(Actor Victim, Actor Killer) if Victim.GetRace() == giantRace ;do something ;unregister for the event if it's no longer needed DbSkseEvents.UnRegisterFormForGlobalEvent("OnDeathGlobal", self, Game.GetPlayer(), 1) endif EndEvent
  13. Gotcha. If it was me I'd write a papyrus script to speed up the process. You can check with skse and papyrusUtil. Put all the armorAddons from ks hairdos in a formlist in the ck. In papyrus cycle through the list, check each with ArmorAddon.GetModelPath(bool firstPerson, bool female) and MiscUtil.FileExists(string fileName). If it doesn't exist, Log or print the armor addon to an external file.
  14. I'm not sure what you mean by that. Do you mean there are meshes included with KS Hairdo that are not used by the mod?
  15. If you're using skse and want a search function similar to help console command, you can use my mod Dylbill's papyrus functions: https://www.nexusmods.com/skyrimspecialedition/mods/65410 It includes this function in DbSkseFunctions.psc: ;Get all forms who's name (with GetName()) match the sFormName. ;nameMatchMode 0 = exact match, 1 = name contains sFormName. ;formTypeMatchMode 1 = forms that have a type in formTypes. ;formTypeMatchMode 0 = forms that do not have a type in formTypes. ;formTypeMatchMode -1 (or if formTypes == none) = formType filter is ignored completely, get all forms regardless of type that match (or contain) sFormName. Form[] Function GetAllFormsWithName(string sFormName, int nameMatchMode = 0, int[] formTypes = none, int formTypeMatchMode = 0) Global Native Then you can use DbMiscFunctions.GetFormIDHex(Form akForm) for each form in the array to get the ids in hex format.
  16. Here is an example for animation events. Listen for when the staff is equipped, find which hand it's equipped in then register for the appropriate animation event. Also unregister for the event when the staff is unequipped. Here's all the animation events fyi. https://ck.uesp.net/wiki/Animation_Events Event Oninit() RegisterForAnimationEvent(PlayerRef, "MRh_SpellFire_Event") ;for right hand RegisterForAnimationEvent(PlayerRef, "MLh_SpellFire_Event") ;for left hand EndEvent Event OnAnimationEvent(ObjectReference akSource, string asEventName) Debug.MessageBox("akSource = " + akSource + \ "\nEvent = " + asEventName) EndEvent
  17. Are you using SKSE? If so you can use my mod Dylbill's Papyrus Functions which includes DbSkseEvents. https://www.nexusmods.com/skyrimspecialedition/mods/65410?tab=posts&jump_to_comment=147667121 Something like this: Enchantment Property StaffEnchFireball Auto weapon property StaffFireball auto Event Oninit() PlayerRef.AddItem(StaffFireball) PlayerRef.EquipItem(StaffFireball) DbSkseEvents.RegisterFormForGlobalEvent("OnActorSpellFireGlobal", Self, StaffFireball, 1) ;compare StaffFireball with 'Source'. Register for when any actor fires a spell from the StaffFireball. DbSkseEvents.RegisterFormForGlobalEvent("OnHitGlobal", Self, StaffEnchFireball, 2) ;compare StaffEnchFireball with 'Source'. Register for when anything is hit with a StaffEnchFireball enchantment. EndEvent Event OnActorSpellFireGlobal(Actor Caster, Form Source, int slot) Debug.MessageBox("Caster = " + Caster.getDisplayName() + " " + Caster + "\nSource = " + Source.GetName() + " " + Source + "\nslot = " + slot) Endevent Event OnHitGlobal(ObjectReference Attacker, ObjectReference Target, Form Source, Ammo akAmmo, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) Debug.MessageBox("Attacker = " + Attacker.getDisplayName() + " " + Attacker + "\nTarget = " + Target.GetDisplayName() + " " + Target + "\nSource = " + \ Source.GetName() + " " + Source + "\nAmmo = " + akAmmo.getName() + " " + akAmmo + "\nProjectile = " + akProjectile.getName() + " " + akProjectile) EndEvent If you're not using skse, it may be possible to use an animation event.
  18. This is how I do it in one of my mods. It's not perfect because it won't trigger if a script is causing the player to fast travel, only when the player fast travels from the map menu. This one also listens for the loading menu. Maybe doing something like this in conjunction with OnLocationChange as Sphered suggested will get it done. Requires SKSE. Actor Property pPlayerRef Auto Cell CurrentCell Event OnInit() RegisterforMenu("MapMenu") RegisterForMenu("Loading Menu") EndEvent Event OnMenuOpen(String menuName) if menuName == "MapMenu" CurrentCell = pPlayerRef.GetParentCell() Endif EndEvent Event OnMenuClose(String menuName) Utility.Wait(1) if menuName == "MapMenu" If pPlayerRef.GetParentCell() != CurrentCell SendModEvent("SCC_OnFastTravelEvent") Endif Elseif menuName == "Loading Menu" SendModEvent("SCC_OnLoadMenuExitEvent") Endif EndEvent
  19. You can try something like this: Function disableObject(form akBaseObject) ObjectReference ref = Game.FindClosestReferenceOfTypeFromRef(akBaseObject, Game.GetPlayer(), 9000.0) if ref ;reference was found ref.disable() Endif Endfunction
  20. Skse has OpenCustomMenu and CloseCustomMenu funtions in UI.psc A lot of menu resources use these, including my mod Extended Vanilla Menus https://www.nexusmods.com/skyrimspecialedition/mods/67946
  21. Console Tweaks will work on SLE but the console command ShowScriptForms will only work on SSE cause it requires DbSkseFunctions.psc from my mod Dylbill's Papyrus Functions. Also it will print the info to the console, not log it.
  22. Actually I thought it would be easier to use this as a console command, so I added the command ShowScriptForms to my mod Console Tweaks which you can find here: https://www.nexusmods.com/skyrimspecialedition/mods/69244 Install the mod, then enter the console command "ShowScriptForms _de_woodharvestscript" to display all forms with the script attached and their mod origins
  23. Are you able to compile and run scripts in your game? If so you can use my mod Dylbills Papyrus Functions: https://www.nexusmods.com/skyrimspecialedition/mods/65410?tab=description which has 2 functions that will help. GetAllFormsWithScriptAttached and GetModOriginName Here's an example script that will log all forms with the _de_woodharvestscript script attached Event OnInit() LogScriptForms("_de_woodharvestscript") EndEvent Function LogScriptForms(string akScriptName) Form[] akForms = DbSkseFunctions.GetAllFormsWithScriptAttached(akScriptName) Debug.trace("printing " + akForms.length + " forms for " + akScriptName) int i = 0 while i < akForms.length if akForms[i] Debug.trace("\n" + i + ": ") ObjectReference ref = akForms[i] as ObjectReference if ref Form bas = ref.GetBaseObject() Debug.trace("refr: " + ref + " mod: " + DbMiscFunctions.GetModOriginName(ref)) Debug.trace("base: " + bas + " mod: " + DbMiscFunctions.GetModOriginName(bas)) else Debug.trace("form: " + akForms[i] + " mod: " + DbMiscFunctions.GetModOriginName(akForms[i])) Endif EndIf i += 1 EndWhile Debug.Notification("done logging") EndFunction This of course is assuming the mod that the script comes from is active in your game
  24. You can use the mod CoMap: https://www.nexusmods.com/skyrimspecialedition/mods/56123
×
×
  • Create New...