-
Posts
1493 -
Joined
-
Last visited
Everything posted by dylbill
-
SSE Detecting fire weapon enchantments on hit
dylbill replied to dafydd99's topic in Skyrim's Creation Kit and Modders
Yep, unfortunately that seems to be the case all too often. -
SSE Detecting fire weapon enchantments on hit
dylbill replied to dafydd99's topic in Skyrim's Creation Kit and Modders
Yes that would require SKSE. You don't have to cycle through the effects though. You can just do If _weapon.GetEnchantment().HasKeyword(MagicDamageFire) . If any of the magic effects in the enchantment have the keyword, it will return true. -
SSE Detecting fire weapon enchantments on hit
dylbill replied to dafydd99's topic in Skyrim's Creation Kit and Modders
Have you tried the OnMagicEffectApply event? https://www.creationkit.com/index.php?title=OnMagicEffectApply_-_ObjectReference -
Do you know if Utility.GetCurrentRealTime() is affected by VATS? That gets the number of seconds since the game has been launched. If it's not affected by VATS you could do something like this: Function WaitLoop(float afSeconds) Float CurrentTime = Utility.GetCurrentRealTime() While (Utility.GetCurrentRealTime() - CurrentTime) < afSeconds ;wait until difference is greater than or equal to afSeconds EndWhile EndFunctionIt's not the most performance friendly function, but for short durations shouldn't be much of a problem. Also it's accuracy would depend on how well the script engine is performing at that moment.
-
Any way to detect how long is left on a timer?
dylbill replied to iqoniq's topic in Fallout 4's Creation Kit and Modders
Unfortunately I don't think you can do it without updating every second as FantaFaust said. I would just use 1 second increments for the timer, and keep track of how many seconds have passed with an int variable. Something like this: Scriptname TM_QuestScript extends Quest Int Property TimerCount = 0 Auto Int Property TimerID = 1 Auto Event OnInit() StartTimer(1, TimerID) EndEvent Event OnTimer(int aiTimerID) If aiTimerID == TimerID TimerCount += 1 If TimerCount == 5 ;Objective Failed, do something. Else StartTimer(1, TimerID) Endif Endif EndEvent Then for your powerup in another script you can do: Scriptname TM_ReferenceAliasScript extends ReferenceAlias ;alias pointing to the player TM_QuestScript Property QuestScriptRef Auto MiscObject Property PowerUp Auto Event OnInit() AddInventoryEventFilter(PowerUp) Endevent Event OnItemAdded(Form akBaseItem, Int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If akBaseItem == PowerUp QuestScriptRef.TimerCount -= 1 ;remove 1 from timer count, giving more time. Endif EndEvent -
[LE] I'll help with the scripts.
dylbill replied to BrightRider's topic in Skyrim's Creation Kit and Modders
Unfortunately I don't know how to make an skse plugin. Maybe it's time to learn though. -
[LE] I'll help with the scripts.
dylbill replied to BrightRider's topic in Skyrim's Creation Kit and Modders
This is serendipitous as I was already working on a mod that has this functionality and I just published it. It's called Crafting Containers and you can find it here: https://www.nexusmods.com/skyrimspecialedition/mods/92825/ It doesn't use an skse dll, rather just papyrus. It adds the contents of containers you have marked (if you're close enough) to your inventory when crafting, then removes the items after. You can set the max distance to 0 for no limit if you wish, being able to use the containers when crafting anywhere. -
To make this work on Enderal, looks like you just need to change the spell properties, and by change I mean fill the properties with the light spells used in Enderal in the Creation Kit. To do this, open the quest this script is attached to, go to the scripts tab and double click on the script to switch the property values.
-
No problem, as long as it works for you that's what's important!
-
Yes, self = None isn't necessary and won't even compile. The only reason to do that is to clear something from script memory. You could do myLinkedRef = none to clear it from memory, but you could also just put that property in the onLoad event. The only reason to hold that in script memory by defining it outside of the event is if you need to use it in other events. Like this: Quest Property anyQuest Auto int Property anyStage Auto Message Property EnableAchiveMessage Auto bool Property bStageMustBeDone = false Auto {false by default if true, look for GetStageDone anyStage if false, look for GetStage >= anyStage} auto State waiting event OnLoad() ObjectReference myLinkedRef = GetLinkedRef() as ObjectReference if (bStageMustBeDone && anyQuest.GetStageDone(anyStage)) || (!bStageMustBeDone && anyQuest.GetStage() >= anyStage) gotoState("done") myLinkedRef.enable() self.disable() self.Delete() myLinkedRef = None EnableAchiveMessage.Show() endif endEvent endState state done ; do nothing ; note: if ref is reenabled after this state is set, this script will not redisable it endStateAlthough using OnLoad is unreliable I've heard, so I would probably just enable your reference with a papyrus fragment on your quest stage.
-
Gotcha. You could also make an invisible activator and make the visible one a static. Then after the script runs, disable and delete the invisible activator.
-
I don't believe states respawn. Once a script is in a state, it should stay in that stay until the GoToState function is used again. You might want to test it to be sure, and possibly make the activator a permanent reference so it doesn't respawn.
-
Not sure but maybe this mod can point you in the right direction: https://www.nexusmods.com/skyrimspecialedition/mods/58266?tab=files
-
SSE Need some help with UI Invoke/Set String
dylbill replied to RedxYeti's topic in Skyrim's Creation Kit and Modders
No problem -
SSE Need some help with UI Invoke/Set String
dylbill replied to RedxYeti's topic in Skyrim's Creation Kit and Modders
Hello, unfortunately you really need Adobe flash to know how to use skse UI script so you can open the .fla and .as files. You can view the .as action script sources courtesy of Mardoxx here https://github.com/Mardoxx/skyrimui But you also need the top movie clip which you need to open the .fla file also. For the Hud menu it's HUDMovieBaseInstance. You can do something like this then: UI.InvokeString("HUD Menu", "HUDMovieBaseInstance.SetLocationName", "Testing 123") But it will fade after a bit just like location does normally. using HUDMovieBaseInstance is how you access the HUDMenu action script class. For something like you're describing though I would recommend iWant Widgets: https://www.nexusmods.com/skyrimspecialedition/mods/36457 which allows you to create your own widget, text based or otherwise from papyrus only. -
It depends on the cloak spell. If the cloak spell has no conditions, meaning it works all the time, you can use the Creation Kit condition HasMagicEffect on the blink spell to check if the cloak spell is active. If the cloak spell has conditions though, this won't work as HasMagicEffect will return true if the actor has the magic effect but the conditions for it are false, meaning it's not active. In which case, you would have to alter the script on the blink spell (I assume it has one.) For the script version, I would use papyrus extender. MagicEffect Property CloakMagicEffect Auto Event OnEffectStart(Actor akTarget, Actor akCaster) MagicEffect[] Effects = PO3_SKSEFunctions.GetAllActiveEffectsOnActor(akTarget) ; get all current active magic effects affecting the akTarget of this (the blink spell) magic effect. Int i = Effects.Find(CloakMagicEffect) If i == -1 ;if the CloakMagicEffect wasn't found in active magic effects array return ;stop the rest of the script from running Endif
-
SSE Connect craftingstation to a container...
dylbill replied to annak366's topic in Skyrim's Creation Kit and Modders
Hello, I agree with IsharaMeradin. I would transfer all the items to the player when you activate the crafting station, then transfer them back afterwords. Here's how I would do it: Scriptname TM_ObjectReferenceScript extends ObjectReference {This script is attached to the crafting station reference} ObjectReference Property LinkedContainer Auto {This Is the container linked to this crafting station} Actor Property PlayerRef Auto Form[] ContainerForms Int[] Amounts Bool Busy = false Event OnActivate(ObjectReference akActionRef) If akActionRef == PlayerRef While Busy == true ;wait for this script to finish doing it's thing EndWhile Busy = true ContainerForms = LinkedContainer.GetContainerForms() ;save all forms in linked container to array Int i = ContainerForms.Length Amounts = Utility.CreateIntArray(i) ;init Amounts array to same length as ContainerForms Array While i > 0 ;save all item amounts to Amounts array i -= 1 Amounts[i] = LinkedContainer.GetItemCount(ContainerForms[i]) EndWhile LinkedContainer.RemoveAllItems(akActionRef) ;transfer all items in LinkedContainer to the player RegisterForMenu("Crafting Menu") Busy = false Endif EndEvent Event OnMenuClose(String menuName) Busy = true UnregisterForMenu("Crafting Menu") Int i = ContainerForms.Length While i > 0 i -= 1 Int Amount = PlayerRef.GetItemCount(ContainerForms[i]) If Amount > Amounts[i] Amount = Amounts[i] Endif If Amount > 0 PlayerRef.RemoveItem(ContainerForms[i], Amount, True, LinkedContainer) ;remove items not used back to linked container. Endif EndWhile ;clear arrays from script memory ContainerForms = Utility.CreateFormArray(0) Amounts = Utility.CreateIntArray(0) Busy = false EndEventNote that this script does require skse, and also I would change the name of the script to something more unique -
There's a mod called Enchantment Swapper: https://www.nexusmods.com/skyrimspecialedition/mods/23091/